summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeInstallation.cmake22
-rw-r--r--CMakeLists.txt90
-rw-r--r--COPYING52
-rw-r--r--CTestConfig.cmake2
-rw-r--r--MANIFEST78
-rw-r--r--Makefile.am24
-rw-r--r--Makefile.in24
-rw-r--r--README.txt2
-rw-r--r--bin/Makefile.am57
-rw-r--r--bin/Makefile.in1368
-rw-r--r--bin/batch/cori_ctestP.sl.in.cmake17
-rw-r--r--bin/batch/cori_ctestS.sl.in.cmake16
-rw-r--r--bin/batch/cori_knl_ctestP.sl.in.cmake17
-rw-r--r--bin/batch/cori_knl_ctestS.sl.in.cmake16
-rw-r--r--bin/batch/ctest.qsub.in.cmake21
-rw-r--r--bin/batch/ctestP.lsf.in.cmake2
-rw-r--r--bin/batch/ctestP.sl.in.cmake6
-rw-r--r--bin/batch/ctestS.lsf.in.cmake2
-rw-r--r--bin/batch/knl_ctestP.sl.in.cmake6
-rw-r--r--bin/batch/ray_ctestP.lsf.in.cmake2
-rwxr-xr-xbin/config.guess966
-rwxr-xr-xbin/config.sub2514
-rwxr-xr-xbin/genparser2
-rw-r--r--bin/h5cc.in (renamed from tools/src/misc/h5cc.in)0
-rw-r--r--bin/h5redeploy.in (renamed from tools/src/misc/h5redeploy.in)0
-rwxr-xr-xbin/make_err4
-rwxr-xr-xbin/snapshot12
-rwxr-xr-xbin/trace2
-rw-r--r--c++/Makefile.am8
-rw-r--r--c++/Makefile.in13
-rw-r--r--c++/examples/CMakeLists.txt32
-rw-r--r--c++/examples/CMakeTests.cmake136
-rw-r--r--c++/examples/Makefile.in9
-rw-r--r--c++/examples/chunks.cpp338
-rw-r--r--c++/examples/compound.cpp16
-rw-r--r--c++/examples/create.cpp12
-rw-r--r--c++/examples/extend_ds.cpp24
-rw-r--r--c++/examples/h5group.cpp288
-rw-r--r--c++/examples/h5tutr_cmprss.cpp196
-rw-r--r--c++/examples/h5tutr_crtatt.cpp58
-rw-r--r--c++/examples/h5tutr_crtdat.cpp55
-rw-r--r--c++/examples/h5tutr_crtgrp.cpp34
-rw-r--r--c++/examples/h5tutr_crtgrpar.cpp54
-rw-r--r--c++/examples/h5tutr_crtgrpd.cpp136
-rw-r--r--c++/examples/h5tutr_extend.cpp218
-rw-r--r--c++/examples/h5tutr_rdwt.cpp48
-rw-r--r--c++/examples/h5tutr_subset.cpp192
-rw-r--r--c++/examples/readdata.cpp36
-rw-r--r--c++/examples/writedata.cpp518
-rw-r--r--c++/src/CMakeLists.txt51
-rw-r--r--c++/src/H5LcreatProp.cpp40
-rw-r--r--c++/src/H5LcreatProp.h8
-rw-r--r--c++/src/H5Location.cpp7
-rw-r--r--c++/src/Makefile.am10
-rw-r--r--c++/src/Makefile.in39
-rw-r--r--c++/src/cpp_doc_config2
-rw-r--r--c++/test/CMakeLists.txt20
-rw-r--r--c++/test/CMakeTests.cmake3
-rw-r--r--c++/test/CMakeVFDTests.cmake82
-rw-r--r--c++/test/Makefile.in9
-rw-r--r--c++/test/dsets.cpp80
-rw-r--r--c++/test/tarray.cpp1
-rw-r--r--c++/test/tobject.cpp128
-rw-r--r--config/cmake/CMakeFindJavaCommon.cmake2
-rw-r--r--config/cmake/CTestCustom.cmake186
-rwxr-xr-xconfig/cmake/CTestScript.cmake13
-rw-r--r--config/cmake/ConfigureChecks.cmake43
-rw-r--r--config/cmake/FindHDFJAVA.cmake.in79
-rw-r--r--config/cmake/FindHDFS.cmake70
-rw-r--r--config/cmake/FindJNI.cmake347
-rw-r--r--config/cmake/H5pubconf.h.in38
-rw-r--r--config/cmake/HDF5UseFortran.cmake13
-rw-r--r--config/cmake/HDF5_Examples.cmake.in3
-rw-r--r--config/cmake/HDFCompilerFlags.cmake97
-rw-r--r--config/cmake/README.txt.cmake.in2
-rw-r--r--config/cmake/UseJava.cmake1151
-rw-r--r--config/cmake/UseJavaClassFilelist.cmake23
-rw-r--r--config/cmake/UseJavaSymlinks.cmake19
-rw-r--r--config/cmake/cacheinit.cmake2
-rw-r--r--config/cmake/hdf5-config-version.cmake.in50
-rw-r--r--config/cmake/hdf5-config.cmake.in52
-rw-r--r--config/cmake/jrunTest.cmake74
-rw-r--r--config/cmake/libhdf5.settings.cmake.in22
-rw-r--r--config/cmake/mccacheinit.cmake6
-rwxr-xr-xconfig/cmake/scripts/CTestScript.cmake43
-rwxr-xr-xconfig/cmake/scripts/HDF5config.cmake37
-rwxr-xr-xconfig/cmake/scripts/HDF5options.cmake16
-rw-r--r--config/cmake/scripts/HPC/bsub-HDF5options.cmake15
-rw-r--r--config/cmake/scripts/HPC/qsub-HDF5options.cmake42
-rw-r--r--config/cmake/scripts/HPC/raybsub-HDF5options.cmake15
-rw-r--r--config/cmake/scripts/HPC/sbatch-HDF5options.cmake15
-rw-r--r--config/cmake/userblockTest.cmake20
-rw-r--r--config/cmake/vfdTest.cmake16
-rw-r--r--config/cmake_ext_mod/CTestCustom.cmake4
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake80
-rw-r--r--config/cmake_ext_mod/FindSZIP.cmake232
-rw-r--r--config/cmake_ext_mod/HDFLibMacros.cmake122
-rw-r--r--config/cmake_ext_mod/HDFMacros.cmake78
-rw-r--r--config/cmake_ext_mod/HDFUseCXX.cmake4
-rw-r--r--config/cmake_ext_mod/HDFUseFortran.cmake14
-rw-r--r--config/cmake_ext_mod/grepTest.cmake149
-rw-r--r--config/cmake_ext_mod/runTest.cmake86
-rw-r--r--config/conclude.am2
-rw-r--r--config/gnu-flags495
-rw-r--r--config/lt_vers.am20
-rw-r--r--config/toolchain/build32.cmake75
-rw-r--r--config/toolchain/clang.cmake11
-rw-r--r--config/toolchain/mingw64.cmake14
-rwxr-xr-xconfigure887
-rw-r--r--configure.ac194
-rw-r--r--examples/CMakeLists.txt36
-rw-r--r--examples/CMakeTests.cmake289
-rw-r--r--examples/Makefile.am26
-rw-r--r--examples/Makefile.in35
-rw-r--r--examples/h5_extend_write.c6
-rw-r--r--fortran/Makefile.am11
-rw-r--r--fortran/Makefile.in16
-rw-r--r--fortran/examples/CMakeLists.txt145
-rw-r--r--fortran/examples/CMakeTests.cmake130
-rw-r--r--fortran/examples/Makefile.in9
-rw-r--r--fortran/src/CMakeLists.txt325
-rw-r--r--fortran/src/H5Pff.F902
-rw-r--r--fortran/src/H5Sf.c9
-rw-r--r--fortran/src/H5_f.c6
-rw-r--r--fortran/src/H5_ff.F901
-rw-r--r--fortran/src/H5match_types.c6
-rw-r--r--fortran/src/Makefile.in29
-rw-r--r--fortran/test/CMakeLists.txt457
-rw-r--r--fortran/test/CMakeTests.cmake236
-rw-r--r--fortran/test/Makefile.in9
-rw-r--r--fortran/test/tH5O_F03.F903
-rw-r--r--fortran/testpar/Makefile.in9
-rw-r--r--fortran/testpar/ptest.f902
-rw-r--r--hl/Makefile.am12
-rw-r--r--hl/Makefile.in15
-rw-r--r--hl/c++/Makefile.am8
-rw-r--r--hl/c++/Makefile.in13
-rw-r--r--hl/c++/examples/CMakeLists.txt23
-rw-r--r--hl/c++/examples/CMakeTests.cmake4
-rw-r--r--hl/c++/examples/Makefile.in9
-rw-r--r--hl/c++/src/CMakeLists.txt36
-rw-r--r--hl/c++/src/Makefile.in29
-rw-r--r--hl/c++/test/CMakeLists.txt29
-rw-r--r--hl/c++/test/CMakeTests.cmake9
-rw-r--r--hl/c++/test/Makefile.in9
-rw-r--r--hl/c++/test/ptableTest.cpp126
-rw-r--r--hl/c++/test/ptableTest.h2
-rw-r--r--hl/examples/CMakeLists.txt11
-rw-r--r--hl/examples/CMakeTests.cmake65
-rw-r--r--hl/examples/Makefile.in9
-rw-r--r--hl/fortran/Makefile.am8
-rw-r--r--hl/fortran/Makefile.in13
-rw-r--r--hl/fortran/examples/CMakeLists.txt42
-rw-r--r--hl/fortran/examples/CMakeTests.cmake13
-rw-r--r--hl/fortran/examples/Makefile.in9
-rw-r--r--hl/fortran/src/CMakeLists.txt206
-rw-r--r--hl/fortran/src/H5DSff.F9034
-rw-r--r--hl/fortran/src/H5HL_buildiface.F9016
-rw-r--r--hl/fortran/src/H5IMff.F904
-rw-r--r--hl/fortran/src/H5TBff.F9012
-rw-r--r--hl/fortran/src/Makefile.in29
-rw-r--r--hl/fortran/test/CMakeLists.txt51
-rw-r--r--hl/fortran/test/CMakeTests.cmake84
-rw-r--r--hl/fortran/test/Makefile.in9
-rw-r--r--hl/fortran/test/tstimage.F902
-rw-r--r--hl/fortran/test/tsttable.F902
-rw-r--r--hl/src/CMakeLists.txt36
-rw-r--r--hl/src/H5LDprivate.h17
-rw-r--r--hl/src/Makefile.in29
-rw-r--r--hl/test/CMakeLists.txt68
-rw-r--r--hl/test/CMakeTests.cmake88
-rw-r--r--hl/test/Makefile.in9
-rw-r--r--hl/test/gen_test_ds.c22
-rw-r--r--hl/test/h5hltest.h4
-rw-r--r--hl/test/test_ds.c138
-rw-r--r--hl/test/test_dset_append.c1088
-rw-r--r--hl/test/test_file_image.c90
-rw-r--r--hl/test/test_h5do_compat.c50
-rw-r--r--hl/test/test_image.c62
-rw-r--r--hl/test/test_ld.c1134
-rw-r--r--hl/test/test_lite.c90
-rw-r--r--hl/test/test_packet.c30
-rw-r--r--hl/test/test_packet_vlen.c810
-rw-r--r--hl/test/test_table.c146
-rw-r--r--hl/tools/Makefile.in9
-rw-r--r--hl/tools/gif2h5/CMakeLists.txt67
-rw-r--r--hl/tools/gif2h5/CMakeTests.cmake42
-rw-r--r--hl/tools/gif2h5/Makefile.am12
-rw-r--r--hl/tools/gif2h5/Makefile.in25
-rw-r--r--hl/tools/gif2h5/gif2mem.c3
-rw-r--r--hl/tools/h5watch/CMakeLists.txt56
-rw-r--r--hl/tools/h5watch/CMakeTests.cmake49
-rw-r--r--hl/tools/h5watch/Makefile.am27
-rw-r--r--hl/tools/h5watch/Makefile.in43
-rw-r--r--java/CMakeLists.txt6
-rw-r--r--java/Makefile.am10
-rw-r--r--java/Makefile.in15
-rw-r--r--java/examples/Makefile.in9
-rw-r--r--java/examples/datasets/CMakeLists.txt61
-rw-r--r--java/examples/datasets/Makefile.in9
-rw-r--r--java/examples/datatypes/CMakeLists.txt57
-rw-r--r--java/examples/datatypes/Makefile.in9
-rw-r--r--java/examples/groups/CMakeLists.txt78
-rw-r--r--java/examples/groups/JavaGroupExample.sh.in14
-rw-r--r--java/examples/groups/Makefile.in9
-rw-r--r--java/examples/intro/CMakeLists.txt69
-rw-r--r--java/examples/intro/Makefile.in9
-rw-r--r--java/src/Makefile.am2
-rw-r--r--java/src/Makefile.in9
-rw-r--r--java/src/hdf/hdf5lib/CMakeLists.txt2
-rw-r--r--java/src/hdf/hdf5lib/H5.java25
-rw-r--r--java/src/hdf/hdf5lib/HDF5Constants.java6
-rw-r--r--java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java2
-rw-r--r--java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java102
-rw-r--r--java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java123
-rw-r--r--java/src/jni/CMakeLists.txt4
-rw-r--r--java/src/jni/Makefile.in29
-rw-r--r--java/src/jni/h5Constants.c16
-rw-r--r--java/src/jni/h5Imp.c2
-rw-r--r--java/src/jni/h5eImp.c68
-rw-r--r--java/src/jni/h5fImp.c52
-rw-r--r--java/src/jni/h5gImp.c20
-rw-r--r--java/src/jni/h5lImp.c4
-rw-r--r--java/src/jni/h5oImp.c60
-rw-r--r--java/src/jni/h5oImp.h27
-rw-r--r--java/src/jni/h5pFAPLImp.c334
-rw-r--r--java/src/jni/h5pFAPLImp.h36
-rw-r--r--java/src/jni/h5pFCPLImp.c2
-rw-r--r--java/src/jni/h5sImp.c12
-rw-r--r--java/src/jni/h5tImp.c2
-rw-r--r--java/src/jni/h5util.c4
-rw-r--r--java/test/CMakeLists.txt24
-rw-r--r--java/test/Makefile.am2
-rw-r--r--java/test/Makefile.in11
-rw-r--r--java/test/TestAll.java1
-rw-r--r--java/test/TestH5.java31
-rw-r--r--java/test/TestH5F.java58
-rw-r--r--java/test/TestH5Fparams.java2
-rw-r--r--java/test/TestH5Ocreate.java53
-rw-r--r--java/test/TestH5Oparams.java15
-rw-r--r--java/test/TestH5P.java4
-rw-r--r--java/test/TestH5Pfaplhdfs.java138
-rw-r--r--java/test/TestH5Pfapls3.java159
-rw-r--r--java/test/TestH5Z.java33
-rw-r--r--java/test/junit.sh.in48
-rw-r--r--java/test/testfiles/JUnit-TestH5Ocreate.txt3
-rw-r--r--java/test/testfiles/JUnit-TestH5Oparams.txt5
-rw-r--r--java/test/testfiles/JUnit-TestH5Pfaplhdfs.txt9
-rw-r--r--java/test/testfiles/JUnit-TestH5Pfapls3.txt10
-rw-r--r--m4/ax_check_class.m475
-rw-r--r--m4/ax_check_classpath.m46
-rw-r--r--m4/ax_check_java_home.m46
-rw-r--r--m4/ax_check_junit.m44
-rw-r--r--m4/ax_check_rqrd_class.m46
-rw-r--r--m4/ax_java_check_class.m48
-rw-r--r--m4/ax_java_options.m44
-rw-r--r--m4/ax_jni_include_dir.m461
-rw-r--r--m4/ax_prog_jar.m44
-rw-r--r--m4/ax_prog_java.m46
-rw-r--r--m4/ax_prog_java_cc.m46
-rw-r--r--m4/ax_prog_java_works.m451
-rw-r--r--m4/ax_prog_javac.m46
-rw-r--r--m4/ax_prog_javac_works.m46
-rw-r--r--m4/ax_prog_javadoc.m44
-rw-r--r--m4/ax_prog_javah.m416
-rw-r--r--m4/ax_try_compile_java.m48
-rw-r--r--m4/ax_try_run_java.m44
-rw-r--r--release_docs/HISTORY-1_10.txt706
-rw-r--r--release_docs/INSTALL_CMake.txt32
-rw-r--r--release_docs/README_HDF5_CMake12
-rw-r--r--release_docs/RELEASE.txt623
-rw-r--r--release_docs/USING_CMake_Examples.txt24
-rw-r--r--src/CMakeLists.txt98
-rw-r--r--src/H5.c20
-rw-r--r--src/H5A.c107
-rw-r--r--src/H5AC.c458
-rw-r--r--src/H5Adense.c30
-rw-r--r--src/H5B.c834
-rw-r--r--src/H5Bdbg.c220
-rw-r--r--src/H5CX.c555
-rw-r--r--src/H5CXprivate.h18
-rw-r--r--src/H5Cmpio.c358
-rw-r--r--src/H5D.c6
-rw-r--r--src/H5Dchunk.c1212
-rw-r--r--src/H5Dcompact.c1
-rw-r--r--src/H5Dcontig.c25
-rw-r--r--src/H5Dearray.c488
-rw-r--r--src/H5Defl.c3
-rw-r--r--src/H5Dfarray.c456
-rw-r--r--src/H5Dint.c156
-rw-r--r--src/H5Dio.c4
-rw-r--r--src/H5Dmpio.c13
-rw-r--r--src/H5Dpkg.h10
-rw-r--r--src/H5Dvirtual.c85
-rw-r--r--src/H5EAdbg.c182
-rw-r--r--src/H5EAtest.c134
-rw-r--r--src/H5Einit.h334
-rw-r--r--src/H5Eint.c388
-rw-r--r--src/H5FAtest.c30
-rw-r--r--src/H5FDhdfs.c2167
-rw-r--r--src/H5FDhdfs.h122
-rw-r--r--src/H5FDmpio.c1020
-rw-r--r--src/H5FDros3.c1833
-rw-r--r--src/H5FDros3.h105
-rw-r--r--src/H5FDs3comms.c3593
-rw-r--r--src/H5FDs3comms.h604
-rw-r--r--src/H5FL.c8
-rw-r--r--src/H5FSpkg.h6
-rw-r--r--src/H5Ffake.c14
-rw-r--r--src/H5Fint.c6
-rw-r--r--src/H5Fpkg.h3
-rw-r--r--src/H5Fprivate.h7
-rw-r--r--src/H5Fpublic.h82
-rw-r--r--src/H5Fsfile.c32
-rw-r--r--src/H5Fsuper.c63
-rw-r--r--src/H5Ftest.c73
-rw-r--r--src/H5G.c145
-rw-r--r--src/H5Gcompact.c8
-rw-r--r--src/H5Gdense.c5
-rw-r--r--src/H5Gint.c59
-rw-r--r--src/H5Glink.c11
-rw-r--r--src/H5Gpublic.h9
-rw-r--r--src/H5Gstab.c20
-rw-r--r--src/H5HFdbg.c17
-rw-r--r--src/H5HFiblock.c348
-rw-r--r--src/H5HFman.c1
-rw-r--r--src/H5HFprivate.h12
-rw-r--r--src/H5HFsection.c12
-rw-r--r--src/H5HFspace.c7
-rw-r--r--src/H5HLdbg.c46
-rw-r--r--src/H5I.c264
-rw-r--r--src/H5L.c51
-rw-r--r--src/H5Lexternal.c7
-rw-r--r--src/H5Lpublic.h4
-rw-r--r--src/H5MF.c3
-rw-r--r--src/H5MM.c2
-rw-r--r--src/H5MP.c6
-rw-r--r--src/H5MPtest.c2
-rw-r--r--src/H5O.c7
-rw-r--r--src/H5Ochunk.c2
-rw-r--r--src/H5Ocopy.c3
-rw-r--r--src/H5Odtype.c14
-rw-r--r--src/H5Ofill.c238
-rw-r--r--src/H5Ofsinfo.c98
-rw-r--r--src/H5Oginfo.c4
-rw-r--r--src/H5Oint.c13
-rw-r--r--src/H5Olayout.c6
-rw-r--r--src/H5Omessage.c42
-rw-r--r--src/H5Omtime.c268
-rw-r--r--src/H5Oname.c70
-rw-r--r--src/H5Opline.c342
-rw-r--r--src/H5Oprivate.h12
-rw-r--r--src/H5Opublic.h14
-rw-r--r--src/H5Ounknown.c6
-rw-r--r--src/H5P.c11
-rw-r--r--src/H5PB.c224
-rw-r--r--src/H5Pacpl.c43
-rw-r--r--src/H5Pdapl.c8
-rw-r--r--src/H5Pdcpl.c77
-rw-r--r--src/H5Pdxpl.c28
-rw-r--r--src/H5Pencdec.c20
-rw-r--r--src/H5Pfapl.c22
-rw-r--r--src/H5Pfcpl.c16
-rw-r--r--src/H5Pgcpl.c20
-rw-r--r--src/H5Plapl.c13
-rw-r--r--src/H5Plcpl.c6
-rw-r--r--src/H5Pocpl.c4
-rw-r--r--src/H5Ppkg.h16
-rw-r--r--src/H5Pprivate.h7
-rw-r--r--src/H5Pstrcpl.c4
-rw-r--r--src/H5Rint.c7
-rw-r--r--src/H5S.c22
-rw-r--r--src/H5ST.c16
-rw-r--r--src/H5Sall.c64
-rw-r--r--src/H5Sdbg.c34
-rw-r--r--src/H5Shyper.c472
-rw-r--r--src/H5Snone.c63
-rw-r--r--src/H5Spkg.h20
-rw-r--r--src/H5Spoint.c204
-rw-r--r--src/H5Sprivate.h16
-rw-r--r--src/H5Sselect.c82
-rw-r--r--src/H5T.c160
-rw-r--r--src/H5TS.c6
-rw-r--r--src/H5TSprivate.h1
-rw-r--r--src/H5Tcommit.c3
-rw-r--r--src/H5Tcompound.c10
-rw-r--r--src/H5Tconv.c3724
-rw-r--r--src/H5Torder.c10
-rw-r--r--src/H5Tpkg.h2
-rw-r--r--src/H5Zpublic.h2
-rw-r--r--src/H5Zscaleoffset.c5
-rw-r--r--src/H5Ztrans.c4
-rw-r--r--src/H5config.h.in31
-rw-r--r--src/H5dbg.c92
-rw-r--r--src/H5detect.c53
-rw-r--r--src/H5make_libsettings.c13
-rw-r--r--src/H5private.h19
-rw-r--r--src/H5public.h7
-rw-r--r--src/H5system.c210
-rw-r--r--src/H5timer.c118
-rw-r--r--src/H5win32defs.h24
-rw-r--r--src/Makefile.am22
-rw-r--r--src/Makefile.in263
-rw-r--r--src/hdf5.h18
-rw-r--r--src/libhdf5.settings.in4
-rw-r--r--test/CMakeLists.txt244
-rw-r--r--test/CMakeTests.cmake673
-rw-r--r--test/CMakeVFDTests.cmake245
-rw-r--r--test/Makefile.am39
-rw-r--r--test/Makefile.in258
-rw-r--r--test/accum.c51
-rw-r--r--test/accum_swmr_reader.c22
-rw-r--r--test/app_ref.c6
-rw-r--r--test/atomic_reader.c30
-rw-r--r--test/atomic_writer.c10
-rw-r--r--test/big.c13
-rw-r--r--test/bittests.c188
-rw-r--r--test/btree2.c1210
-rw-r--r--test/cache.c15441
-rw-r--r--test/cache_api.c95
-rw-r--r--test/cache_common.c2154
-rw-r--r--test/cache_common.h524
-rw-r--r--test/cache_image.c3035
-rw-r--r--test/cache_logging.c15
-rw-r--r--test/cache_tagging.c301
-rw-r--r--test/cmpd_dset.c980
-rw-r--r--test/cork.c218
-rw-r--r--test/cross_read.c12
-rw-r--r--test/dangle.c3
-rw-r--r--test/del_many_dense_attrs.c2
-rw-r--r--test/direct_chunk.c131
-rw-r--r--test/dsets.c962
-rw-r--r--test/dt_arith.c1472
-rw-r--r--test/dtransform.c408
-rw-r--r--test/dtypes.c2021
-rw-r--r--test/earray.c522
-rw-r--r--test/efc.c13
-rw-r--r--test/enc_dec_plist.c85
-rw-r--r--test/enc_dec_plist_cross_platform.c4
-rw-r--r--test/enum.c26
-rw-r--r--test/err_compat.c228
-rw-r--r--test/error_test.c63
-rw-r--r--test/evict_on_close.c48
-rw-r--r--test/extend.c40
-rw-r--r--test/external.c674
-rw-r--r--test/external_common.c127
-rw-r--r--test/external_common.h45
-rw-r--r--test/external_env.c218
-rw-r--r--test/external_fname.h37
-rw-r--r--test/farray.c414
-rw-r--r--test/fheap.c92
-rw-r--r--test/file_image.c9
-rw-r--r--test/filenotclosed.c2
-rw-r--r--test/fill18.h5bin0 -> 3479 bytes
-rw-r--r--test/fillval.c929
-rw-r--r--test/filter_fail.c38
-rw-r--r--test/flush1.c2
-rw-r--r--test/flush2.c10
-rw-r--r--test/flushrefresh.c109
-rw-r--r--test/flushrefreshTest.cmake118
-rw-r--r--test/freespace.c26
-rw-r--r--test/gen_cross.c59
-rw-r--r--test/gheap.c324
-rw-r--r--test/h5test.c503
-rw-r--r--test/h5test.h33
-rw-r--r--test/hdfs.c1767
-rw-r--r--test/hyperslab.c158
-rw-r--r--test/istore.c137
-rw-r--r--test/lheap.c20
-rw-r--r--test/links.c4796
-rw-r--r--test/links_env.c89
-rw-r--r--test/mf.c2570
-rw-r--r--test/mount.c38
-rw-r--r--test/mtime.c56
-rw-r--r--test/ntypes.c84
-rw-r--r--test/objcopy.c194
-rw-r--r--test/ohdr.c88
-rw-r--r--test/page_buffer.c14
-rw-r--r--test/reserved.c86
-rw-r--r--test/ros3.c1937
-rw-r--r--test/s3comms.c2730
-rw-r--r--test/set_extent.c1436
-rw-r--r--test/stab.c236
-rw-r--r--test/swmr.c168
-rw-r--r--test/swmr_addrem_writer.c38
-rw-r--r--test/swmr_common.c20
-rw-r--r--test/swmr_generator.c38
-rw-r--r--test/swmr_reader.c38
-rw-r--r--test/swmr_remove_reader.c32
-rw-r--r--test/swmr_remove_writer.c34
-rw-r--r--test/swmr_sparse_reader.c34
-rw-r--r--test/swmr_sparse_writer.c42
-rw-r--r--test/swmr_start_write.c56
-rw-r--r--test/swmr_writer.c40
-rw-r--r--test/tarray.c16
-rw-r--r--test/tattr.c633
-rw-r--r--test/tcheck_version.c82
-rw-r--r--test/test_usecases.sh.in31
-rw-r--r--test/testexternal_env.sh.in42
-rw-r--r--test/testfiles/err_compat_12
-rw-r--r--test/testfiles/err_compat_22
-rw-r--r--test/testfiles/error_test_22
-rw-r--r--test/testflushrefresh.sh.in25
-rw-r--r--test/testframe.c388
-rw-r--r--test/testhdf5.c4
-rw-r--r--test/testhdf5.h90
-rw-r--r--test/testlinks_env.sh.in12
-rw-r--r--test/testmeta.c110
-rw-r--r--test/testswmr.sh.in11
-rw-r--r--test/testvds_env.sh.in44
-rw-r--r--test/testvdsswmr.sh.in13
-rw-r--r--test/tfile.c679
-rw-r--r--test/tgenprop.c16
-rw-r--r--test/th5o.c24
-rw-r--r--test/th5s.c206
-rw-r--r--test/tid.c9
-rw-r--r--test/titerate.c18
-rw-r--r--test/tmisc.c22
-rw-r--r--test/trefer.c250
-rw-r--r--test/tselect.c2717
-rw-r--r--test/tsohm.c260
-rw-r--r--test/ttime.c6
-rw-r--r--test/tunicode.c12
-rw-r--r--test/tvlstr.c27
-rw-r--r--test/tvltypes.c6
-rw-r--r--test/twriteorder.c384
-rw-r--r--test/unlink.c380
-rw-r--r--test/unregister.c239
-rw-r--r--test/use_append_chunk.c4
-rw-r--r--test/use_append_mchunks.c4
-rw-r--r--test/use_common.c500
-rw-r--r--test/use_disable_mdc_flushes.c374
-rw-r--r--test/vds.c226
-rw-r--r--test/vds_env.c333
-rw-r--r--test/vds_swmr.h1
-rw-r--r--test/vds_swmr_gen.c2
-rw-r--r--test/vds_swmr_reader.c12
-rw-r--r--test/vds_swmr_writer.c2
-rw-r--r--test/vfd.c217
-rw-r--r--testpar/CMakeLists.txt42
-rw-r--r--testpar/CMakeTests.cmake74
-rw-r--r--testpar/CMakeVFDTests.cmake86
-rw-r--r--testpar/Makefile.in9
-rw-r--r--testpar/t_bigio.c528
-rw-r--r--testpar/t_cache.c42
-rw-r--r--testpar/t_cache_image.c68
-rw-r--r--testpar/t_chunk_alloc.c159
-rw-r--r--testpar/t_coll_chunk.c30
-rw-r--r--testpar/t_dset.c8
-rw-r--r--testpar/t_file.c100
-rw-r--r--testpar/t_filter_read.c66
-rw-r--r--testpar/t_filters_parallel.c11
-rw-r--r--testpar/t_mdset.c1059
-rw-r--r--testpar/t_mpi.c1591
-rw-r--r--testpar/t_ph5basic.c135
-rw-r--r--testpar/t_pread.c7
-rw-r--r--testpar/t_prestart.c2
-rw-r--r--testpar/t_prop.c2
-rw-r--r--testpar/t_shapesame.c108
-rw-r--r--testpar/t_span_tree.c136
-rw-r--r--testpar/testpar.h29
-rw-r--r--testpar/testphdf5.c476
-rw-r--r--testpar/testphdf5.h59
-rw-r--r--tools/CMakeLists.txt7
-rw-r--r--tools/Makefile.am8
-rw-r--r--tools/Makefile.in15
-rw-r--r--tools/lib/CMakeLists.txt38
-rw-r--r--tools/lib/Makefile.in9
-rw-r--r--tools/lib/h5diff.c11
-rw-r--r--tools/lib/h5diff_array.c19
-rw-r--r--tools/lib/h5tools.c38
-rw-r--r--tools/lib/h5tools_dump.c114
-rw-r--r--tools/lib/h5tools_filters.c2
-rw-r--r--tools/lib/h5tools_str.c57
-rw-r--r--tools/lib/h5tools_utils.c511
-rw-r--r--tools/lib/h5tools_utils.h13
-rw-r--r--tools/lib/h5trav.c42
-rw-r--r--tools/lib/io_timer.c5
-rw-r--r--tools/libtest/CMakeLists.txt18
-rw-r--r--tools/libtest/CMakeTests.cmake49
-rw-r--r--tools/libtest/Makefile.am34
-rw-r--r--tools/libtest/Makefile.in1486
-rw-r--r--tools/libtest/h5tools_test_utils.c1266
-rw-r--r--tools/src/Makefile.in9
-rw-r--r--tools/src/h5copy/CMakeLists.txt18
-rw-r--r--tools/src/h5copy/Makefile.in9
-rw-r--r--tools/src/h5copy/h5copy.c8
-rw-r--r--tools/src/h5diff/CMakeLists.txt70
-rw-r--r--tools/src/h5diff/Makefile.in9
-rw-r--r--tools/src/h5diff/h5diff_common.c28
-rw-r--r--tools/src/h5diff/ph5diff_main.c26
-rw-r--r--tools/src/h5dump/CMakeLists.txt26
-rw-r--r--tools/src/h5dump/Makefile.in9
-rw-r--r--tools/src/h5dump/h5dump.c469
-rw-r--r--tools/src/h5dump/h5dump_ddl.c12
-rw-r--r--tools/src/h5dump/h5dump_xml.c14
-rw-r--r--tools/src/h5format_convert/CMakeLists.txt26
-rw-r--r--tools/src/h5format_convert/Makefile.in9
-rw-r--r--tools/src/h5format_convert/h5format_convert.c10
-rw-r--r--tools/src/h5import/CMakeLists.txt30
-rw-r--r--tools/src/h5import/Makefile.in9
-rw-r--r--tools/src/h5import/h5import.c2
-rw-r--r--tools/src/h5jam/CMakeLists.txt59
-rw-r--r--tools/src/h5jam/Makefile.in9
-rw-r--r--tools/src/h5ls/CMakeLists.txt18
-rw-r--r--tools/src/h5ls/Makefile.in9
-rw-r--r--tools/src/h5ls/h5ls.c1456
-rw-r--r--tools/src/h5repack/CMakeLists.txt20
-rw-r--r--tools/src/h5repack/Makefile.am2
-rw-r--r--tools/src/h5repack/Makefile.in13
-rw-r--r--tools/src/h5repack/h5repack.c292
-rw-r--r--tools/src/h5repack/h5repack_copy.c181
-rw-r--r--tools/src/h5repack/h5repack_filters.c10
-rw-r--r--tools/src/h5repack/h5repack_main.c375
-rw-r--r--tools/src/h5repack/h5repack_refs.c52
-rw-r--r--tools/src/h5stat/CMakeLists.txt18
-rw-r--r--tools/src/h5stat/Makefile.in9
-rw-r--r--tools/src/h5stat/h5stat.c411
-rw-r--r--tools/src/misc/CMakeLists.txt103
-rw-r--r--tools/src/misc/Makefile.am24
-rw-r--r--tools/src/misc/Makefile.in152
-rw-r--r--tools/src/misc/h5debug.c388
-rw-r--r--tools/src/misc/h5mkgrp.c6
-rw-r--r--tools/src/misc/h5repart.c601
-rw-r--r--tools/test/Makefile.in9
-rw-r--r--tools/test/h5copy/CMakeLists.txt28
-rw-r--r--tools/test/h5copy/CMakeTests.cmake122
-rw-r--r--tools/test/h5copy/Makefile.in9
-rw-r--r--tools/test/h5copy/h5copygentest.c110
-rw-r--r--tools/test/h5copy/testh5copy.sh.in9
-rw-r--r--tools/test/h5diff/CMakeLists.txt28
-rw-r--r--tools/test/h5diff/CMakeTests.cmake78
-rw-r--r--tools/test/h5diff/Makefile.in9
-rw-r--r--tools/test/h5diff/h5diffgentest.c608
-rw-r--r--tools/test/h5dump/CMakeLists.txt30
-rw-r--r--tools/test/h5dump/CMakeTests.cmake669
-rw-r--r--tools/test/h5dump/CMakeTestsPBITS.cmake145
-rw-r--r--tools/test/h5dump/CMakeTestsVDS.cmake111
-rw-r--r--tools/test/h5dump/CMakeTestsXML.cmake173
-rw-r--r--tools/test/h5dump/CMakeVFDTests.cmake91
-rw-r--r--tools/test/h5dump/Makefile.in9
-rw-r--r--tools/test/h5dump/h5dumpgentest.c61
-rw-r--r--tools/test/h5dump/testh5dump.sh.in37
-rw-r--r--tools/test/h5format_convert/CMakeLists.txt19
-rw-r--r--tools/test/h5format_convert/CMakeTests.cmake220
-rw-r--r--tools/test/h5format_convert/Makefile.in9
-rw-r--r--tools/test/h5import/CMakeLists.txt11
-rw-r--r--tools/test/h5import/CMakeTests.cmake260
-rw-r--r--tools/test/h5import/Makefile.in9
-rw-r--r--tools/test/h5import/h5importtest.c168
-rw-r--r--tools/test/h5jam/CMakeLists.txt28
-rw-r--r--tools/test/h5jam/CMakeTests.cmake82
-rw-r--r--tools/test/h5jam/Makefile.in9
-rw-r--r--tools/test/h5jam/h5jamgentest.c6
-rw-r--r--tools/test/h5jam/tellub.c2
-rw-r--r--tools/test/h5ls/CMakeLists.txt22
-rw-r--r--tools/test/h5ls/CMakeTests.cmake178
-rw-r--r--tools/test/h5ls/CMakeTestsVDS.cmake82
-rw-r--r--tools/test/h5ls/Makefile.in9
-rw-r--r--tools/test/h5repack/CMakeLists.txt81
-rw-r--r--tools/test/h5repack/CMakeTests.cmake602
-rw-r--r--tools/test/h5repack/CMakeVFDTests.cmake98
-rw-r--r--tools/test/h5repack/Makefile.am5
-rw-r--r--tools/test/h5repack/Makefile.in72
-rw-r--r--tools/test/h5repack/h5repack.sh.in121
-rw-r--r--tools/test/h5repack/h5repackgentest.c340
-rw-r--r--tools/test/h5repack/h5repacktst.c134
-rw-r--r--tools/test/h5repack/testfiles/h5repack-help.txt77
-rw-r--r--tools/test/h5repack/testfiles/h5repack_f32le.h5bin0 -> 2336 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_f32le_ex-0.datbin0 -> 288 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_f32le_ex.h5bin0 -> 1464 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_1d.h5bin0 -> 2096 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-0.dat1
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-1.datbin0 -> 24 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_1d_ex.h5bin0 -> 1504 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_2d.h5bin0 -> 2304 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_2d_ex-0.datbin0 -> 256 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_2d_ex.h5bin0 -> 1472 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_3d.h5bin0 -> 4096 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_3d_ex-0.datbin0 -> 2048 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_3d_ex.h5bin0 -> 1472 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl14
-rw-r--r--tools/test/h5repack/testfiles/h5repack_uint8be.h5bin0 -> 2304 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_uint8be_ex-0.datbin0 -> 64 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_uint8be_ex-1.dat1
-rw-r--r--tools/test/h5repack/testfiles/h5repack_uint8be_ex-2.dat1
-rw-r--r--tools/test/h5repack/testfiles/h5repack_uint8be_ex-3.dat1
-rw-r--r--tools/test/h5repack/testfiles/h5repack_uint8be_ex.h5bin0 -> 1608 bytes
-rw-r--r--tools/test/h5repack/testh5repack_detect_szip.c4
-rw-r--r--tools/test/h5stat/CMakeLists.txt6
-rw-r--r--tools/test/h5stat/CMakeTests.cmake55
-rw-r--r--tools/test/h5stat/Makefile.in9
-rw-r--r--tools/test/h5stat/h5stat_gentest.c14
-rw-r--r--tools/test/h5stat/testfiles/h5stat_help1.ddl10
-rw-r--r--tools/test/h5stat/testfiles/h5stat_help2.ddl10
-rw-r--r--tools/test/h5stat/testfiles/h5stat_nofile.ddl10
-rw-r--r--tools/test/misc/CMakeLists.txt50
-rw-r--r--tools/test/misc/CMakeTestsClear.cmake325
-rw-r--r--tools/test/misc/CMakeTestsMkgrp.cmake124
-rw-r--r--tools/test/misc/CMakeTestsRepart.cmake31
-rw-r--r--tools/test/misc/Makefile.in9
-rw-r--r--tools/test/misc/h5clear_gentest.c140
-rw-r--r--tools/test/misc/h5perf_gentest.c666
-rw-r--r--tools/test/misc/talign.c34
-rw-r--r--tools/test/misc/vds/CMakeLists.txt11
-rw-r--r--tools/test/misc/vds/Makefile.in9
-rw-r--r--tools/test/perform/CMakeLists.txt118
-rw-r--r--tools/test/perform/CMakeTests.cmake57
-rw-r--r--tools/test/perform/Makefile.in9
-rw-r--r--tools/test/perform/iopipe.c14
-rw-r--r--tools/test/perform/overhead.c6
-rw-r--r--tools/test/perform/perf.c33
-rw-r--r--tools/test/perform/perf_meta.c28
-rw-r--r--tools/test/perform/pio_engine.c97
-rw-r--r--tools/test/perform/pio_perf.c320
-rw-r--r--tools/test/perform/pio_standalone.c119
-rw-r--r--tools/test/perform/pio_standalone.h2
-rw-r--r--tools/test/perform/sio_engine.c101
-rw-r--r--tools/test/perform/sio_perf.c238
-rw-r--r--tools/test/perform/sio_standalone.c119
-rw-r--r--tools/test/perform/sio_standalone.h2
-rw-r--r--tools/testfiles/h5dump-help.txt10
-rw-r--r--tools/testfiles/help-1.ls9
-rw-r--r--tools/testfiles/help-2.ls9
-rw-r--r--tools/testfiles/help-3.ls9
-rw-r--r--tools/testfiles/pbits/tnofilename-with-packed-bits.ddl10
-rw-r--r--tools/testfiles/pbits/tpbitsIncomplete.ddl10
-rw-r--r--tools/testfiles/pbits/tpbitsLengthExceeded.ddl10
-rw-r--r--tools/testfiles/pbits/tpbitsLengthPositive.ddl10
-rw-r--r--tools/testfiles/pbits/tpbitsMaxExceeded.ddl10
-rw-r--r--tools/testfiles/pbits/tpbitsOffsetExceeded.ddl10
-rw-r--r--tools/testfiles/pbits/tpbitsOffsetNegative.ddl10
-rw-r--r--tools/testfiles/t128bit_float.h5bin0 -> 2160 bytes
-rw-r--r--tools/testfiles/textlinksrc-nodangle-1.ls9
-rw-r--r--tools/testfiles/tgroup-1.ls9
-rw-r--r--tools/testfiles/tudlink-2.ddl1
736 files changed, 76519 insertions, 54159 deletions
diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake
index 7a0746a..dc229d2 100644
--- a/CMakeInstallation.cmake
+++ b/CMakeInstallation.cmake
@@ -33,7 +33,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
EXPORT ${HDF5_EXPORTED_TARGETS}
DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/hdf5
FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake
- NAMESPACE ${HDF5_PACKAGE}::
+ NAMESPACE ${HDF_PACKAGE_NAMESPACE}
COMPONENT configinstall
)
endif ()
@@ -45,7 +45,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
export (
TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} ${HDF5_UTILS_TO_EXPORT}
FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake
- NAMESPACE ${HDF5_PACKAGE}::
+ NAMESPACE ${HDF_PACKAGE_NAMESPACE}
)
endif ()
endif ()
@@ -104,6 +104,12 @@ endif ()
# Configure the hdf5-config-version .cmake file for the install directory
#-----------------------------------------------------------------------------
if (NOT HDF5_EXTERNALLY_CONFIGURED)
+ # 3.11 or greater
+ #write_basic_package_version_file (
+ # ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake
+ # VERSION ${HDF5_PACKAGE_VERSION}
+ # COMPATIBILITY SameMinorVersion
+ #)
configure_file (
${HDF_RESOURCES_DIR}/hdf5-config-version.cmake.in
${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake @ONLY
@@ -186,7 +192,7 @@ HDF_README_PROPERTIES(HDF5_BUILD_FORTRAN)
#-----------------------------------------------------------------------------
# Configure the COPYING.txt file for the windows binary package
#-----------------------------------------------------------------------------
-if (WIN32)
+if (WIN32 OR MINGW)
configure_file (${HDF5_SOURCE_DIR}/COPYING ${HDF5_BINARY_DIR}/COPYING.txt @ONLY)
endif ()
@@ -206,7 +212,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
${HDF5_SOURCE_DIR}/release_docs/COPYING
${HDF5_SOURCE_DIR}/release_docs/RELEASE.txt
)
- if (WIN32)
+ if (WIN32 OR MINGW)
set (release_files
${release_files}
${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt
@@ -220,7 +226,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt
${HDF5_SOURCE_DIR}/release_docs/INSTALL
)
- if (WIN32)
+ if (WIN32 OR MINGW)
set (release_files
${release_files}
${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt
@@ -288,7 +294,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}/hdf.bmp")
set (CPACK_GENERATOR "TGZ")
- if (WIN32)
+ if (WIN32 OR MINGW)
set (CPACK_GENERATOR "ZIP")
if (NSIS_EXECUTABLE)
@@ -453,7 +459,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
if (HDF5_PACKAGE_EXTLIBS)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
- if (WIN32)
+ if (WIN32 OR MINGW)
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;ALL;/")
else ()
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/")
@@ -462,7 +468,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
endif ()
endif ()
if (SZIP_FOUND AND SZIP_USE_EXTERNAL)
- if (WIN32)
+ if (WIN32 OR MINGW)
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;ALL;/")
else ()
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8e93231..2062675 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,10 @@
cmake_minimum_required (VERSION 3.10)
project (HDF5 C)
+if(POLICY CMP0074)
+ cmake_policy(SET CMP0074 NEW)
+endif()
+
#-----------------------------------------------------------------------------
# Instructions for use : Normal Build
#
@@ -10,7 +14,7 @@ project (HDF5 C)
# set CMAKE_INSTALL_PREFIX to the required install path.
# Make install can be used to install all components for system-wide use.
#
-if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
+if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
MESSAGE(FATAL_ERROR "\nERROR! ${PROJECT_NAME} DOES NOT SUPPORT IN SOURCE BUILDS!\n"
"CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
" == CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}\n"
@@ -28,6 +32,12 @@ if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
)
endif ()
+# CMake version 3.14 added option --ignore-eol to compare files
+# cmake -E compare_files --ignore-eol file1 file2
+#if(CMAKE_VERSION VERSION_LESS "3.14.0" AND WIN32)
+# MESSAGE(FATAL_ERROR "Windows builds requires a minimum of CMake 3.14")
+#endif()
+
#-----------------------------------------------------------------------------
# Instructions for use : Sub-Project Build
#
@@ -314,7 +324,7 @@ set (HDF5_PACKAGE_NAME "HDF5")
set (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}")
set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}")
set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}")
-if (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "")
+if (H5_VERS_SUBRELEASE)
set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}")
else ()
set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}")
@@ -416,18 +426,23 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
# Mac OS X Options
#-----------------------------------------------------------------------------
if (HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS)
- set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries")
+ set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE)
endif ()
#-----------------------------------------------------------------------------
# Option to Build Shared and Static libs, default is both
#-----------------------------------------------------------------------------
+option (ONLY_SHARED_LIBS "Only Build Shared Libraries" OFF)
+set (H5_ENABLE_STATIC_LIB YES)
+if (ONLY_SHARED_LIBS)
+ set (H5_ENABLE_STATIC_LIB NO)
+ set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries")
+endif ()
option (BUILD_SHARED_LIBS "Build Shared Libraries" ON)
set (H5_ENABLE_SHARED_LIB NO)
if (BUILD_SHARED_LIBS)
set (H5_ENABLE_SHARED_LIB YES)
endif ()
-set (H5_ENABLE_STATIC_LIB YES)
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
#-----------------------------------------------------------------------------
@@ -507,7 +522,7 @@ endif ()
# and we need to call the executable from inside the CMake configuration
#-----------------------------------------------------------------------------
set (EXE_EXT "")
-if (WIN32)
+if (WIN32 OR MINGW)
set (EXE_EXT ".exe")
add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1)
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
@@ -563,6 +578,27 @@ include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake)
set (CMAKE_MODULE_PATH ${HDF_RESOURCES_DIR} ${HDF_RESOURCES_EXT_DIR} ${CMAKE_MODULE_PATH})
#-----------------------------------------------------------------------------
+# Option to Enable HDFS
+#-----------------------------------------------------------------------------
+option (HDF5_ENABLE_HDFS "Enable HDFS" OFF)
+if (HDF5_ENABLE_HDFS)
+ find_package(JNI REQUIRED)
+ if (JNI_FOUND)
+ set (H5_HAVE_LIBJVM 1)
+ endif ()
+ find_package(HDFS REQUIRED)
+ if (HDFS_FOUND)
+ set (H5_HAVE_LIBHDFS 1)
+ set (H5_HAVE_HDFS_H 1)
+ if (NOT MSVC)
+ list (APPEND LINK_LIBS -pthread)
+ endif ()
+ else ()
+ message (FATAL_ERROR "Set to use libhdfs library, but could not find or use libhdfs. Please verify that the path to HADOOP_HOME is valid, and/or reconfigure without HDF5_ENABLE_HDFS")
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
# Option to Enable MPI Parallel
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF)
@@ -610,35 +646,34 @@ if (H5_HAVE_PARALLEL)
endif ()
endif ()
-set (DEFAULT_API_VERSION "v110")
+#option (DEFAULT_API_VERSION "Enable v1.10 API (v16, v18, v110)" "v110")
+set (DEFAULT_API_VERSION "v110" CACHE STRING "Enable v1.10 API (v16, v18, v110)")
+set_property (CACHE DEFAULT_API_VERSION PROPERTY STRINGS v16 v18 v110)
#-----------------------------------------------------------------------------
# Option to use 1.6.x API
#-----------------------------------------------------------------------------
-option (HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF)
set (H5_USE_16_API_DEFAULT 0)
-if (HDF5_USE_16_API_DEFAULT)
+if (DEFAULT_API_VERSION MATCHES "v16")
set (H5_USE_16_API_DEFAULT 1)
- set (DEFAULT_API_VERSION "v16")
endif ()
#-----------------------------------------------------------------------------
# Option to use 1.8.x API
#-----------------------------------------------------------------------------
-option (HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF)
set (H5_USE_18_API_DEFAULT 0)
-if (HDF5_USE_18_API_DEFAULT)
+if (DEFAULT_API_VERSION MATCHES "v18")
set (H5_USE_18_API_DEFAULT 1)
- set (DEFAULT_API_VERSION "v18")
endif ()
#-----------------------------------------------------------------------------
# Option to use 1.10.x API
#-----------------------------------------------------------------------------
-option (HDF5_USE_110_API_DEFAULT "Use the HDF5 1.10.x API by default" ON)
+if (NOT DEFAULT_API_VERSION)
+ set (DEFAULT_API_VERSION "v110")
+endif ()
set (H5_USE_110_API_DEFAULT 0)
-if (HDF5_USE_110_API_DEFAULT)
+if (DEFAULT_API_VERSION MATCHES "v110")
set (H5_USE_110_API_DEFAULT 1)
- set (DEFAULT_API_VERSION "v110")
endif ()
#-----------------------------------------------------------------------------
@@ -667,14 +702,17 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
endif ()
endif ()
endif ()
+
#-----------------------------------------------------------------------------
# Option to use threadsafe
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF)
if (HDF5_ENABLE_THREADSAFE)
# check for unsupported options
- message (STATUS " **** thread-safety option not supported with static library **** ")
- message (STATUS " **** thread-safety option will not be used building static library **** ")
+ if (WIN32 OR MINGW)
+ message (STATUS " **** thread-safety option not supported with static library **** ")
+ message (STATUS " **** thread-safety option will not be used building static library **** ")
+ endif ()
if (HDF5_ENABLE_PARALLEL)
if (NOT ALLOW_UNSUPPORTED)
message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ")
@@ -712,9 +750,9 @@ if (HDF5_ENABLE_THREADSAFE)
endif ()
endif ()
set(THREADS_PREFER_PTHREAD_FLAG ON)
- find_package(Threads)
- if (NOT Threads_FOUND)
- message (STATUS " **** thread-safe package not found - threads still might work **** ")
+ find_package(Threads REQUIRED)
+ if (Threads_FOUND)
+ set (H5_HAVE_THREADSAFE 1)
endif ()
endif ()
@@ -725,13 +763,17 @@ add_subdirectory (src)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
- add_dependencies (${HDF5_LIB_TARGET} ZLIB)
+ if (NOT ONLY_SHARED_LIBS)
+ add_dependencies (${HDF5_LIB_TARGET} ZLIB)
+ endif ()
if (BUILD_SHARED_LIBS)
add_dependencies (${HDF5_LIBSH_TARGET} ZLIB)
endif ()
endif ()
if (SZIP_FOUND AND SZIP_USE_EXTERNAL)
- add_dependencies (${HDF5_LIB_TARGET} SZIP)
+ if (NOT ONLY_SHARED_LIBS)
+ add_dependencies (${HDF5_LIB_TARGET} SZIP)
+ endif ()
if (BUILD_SHARED_LIBS)
add_dependencies (${HDF5_LIBSH_TARGET} SZIP)
endif ()
@@ -744,7 +786,7 @@ endif ()
option (BUILD_TESTING "Build HDF5 Unit Testing" ON)
if (BUILD_TESTING)
set (DART_TESTING_TIMEOUT 1200
- CACHE INTEGER
+ CACHE STRING
"Timeout in seconds for each test (default 1200=20minutes)"
)
@@ -828,7 +870,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
message (STATUS "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}")
# Building with PGI requires CMake 3.3 or greater because previous versions
# of CMake add the wrong compiler flag for the PGI Fortran compiler.
- if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "PGI" AND "${CMAKE_VERSION}" VERSION_LESS "3.3")
+ if (CMAKE_Fortran_COMPILER_ID MATCHES "PGI" AND CMAKE_VERSION VERSION_LESS "3.3")
message (FATAL_ERROR " **** PGI FORTRAN REQUIRES CMAKE VERSION 3.3 OR GREATER **** ")
endif ()
diff --git a/COPYING b/COPYING
index 10481dd..659bf1c 100644
--- a/COPYING
+++ b/COPYING
@@ -3,10 +3,10 @@ HDF5 (Hierarchical Data Format 5) Software Library and Utilities
-----------------------------------------------------------------------------
HDF5 (Hierarchical Data Format 5) Software Library and Utilities
-Copyright (c) 2006-2018, The HDF Group.
+Copyright 2006 by The HDF Group.
NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities
-Copyright (c) 1998-2006, The Board of Trustees of the University of Illinois.
+Copyright 1998-2006 by The Board of Trustees of the University of Illinois.
All rights reserved.
@@ -28,9 +28,20 @@ provided that the following conditions are met:
DISCLAIMER:
THIS SOFTWARE IS PROVIDED BY THE HDF GROUP AND THE CONTRIBUTORS
-"AS IS" WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT SHALL THE HDF GROUP OR THE CONTRIBUTORS BE LIABLE FOR ANY DAMAGES SUFFERED BY THE USERS ARISING OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+"AS IS" WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO
+EVENT SHALL THE HDF GROUP OR THE CONTRIBUTORS BE LIABLE FOR ANY DAMAGES
+SUFFERED BY THE USERS ARISING OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code ("Enhancements") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to The HDF Group, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form.
+You are under no obligation whatsoever to provide any bug fixes, patches, or
+upgrades to the features, functionality or performance of the source code
+("Enhancements") to anyone; however, if you choose to make your Enhancements
+available either publicly, or directly to The HDF Group, without imposing a
+separate written license agreement for such Enhancements, then you hereby
+grant the following license: a non-exclusive, royalty-free perpetual license
+to install, use, modify, prepare derivative works, incorporate into other
+computer software, distribute, and sublicense such enhancements or derivative
+works thereof, in binary and source code form.
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
@@ -44,7 +55,9 @@ http://support.hdfgroup.org/ftp/HDF5/releases/COPYING_LBNL_HDF5.
-----------------------------------------------------------------------------
Contributors: National Center for Supercomputing Applications (NCSA) at
-the University of Illinois, Fortner Software, Unidata Program Center (netCDF), The Independent JPEG Group (JPEG), Jean-loup Gailly and Mark Adler (gzip), and Digital Equipment Corporation (DEC).
+the University of Illinois, Fortner Software, Unidata Program Center
+(netCDF), The Independent JPEG Group (JPEG), Jean-loup Gailly and Mark Adler
+(gzip), and Digital Equipment Corporation (DEC).
-----------------------------------------------------------------------------
@@ -67,20 +80,20 @@ and/or accompanying materials:
for the operation of UC LLNL.
DISCLAIMER:
- This work was prepared as an account of work sponsored by an agency of
- the United States Government. Neither the United States Government nor
- the University of California nor any of their employees, makes any
- warranty, express or implied, or assumes any liability or responsibility
- for the accuracy, completeness, or usefulness of any information,
- apparatus, product, or process disclosed, or represents that its use
- would not infringe privately- owned rights. Reference herein to any
- specific commercial products, process, or service by trade name,
- trademark, manufacturer, or otherwise, does not necessarily constitute
- or imply its endorsement, recommendation, or favoring by the United
- States Government or the University of California. The views and
- opinions of authors expressed herein do not necessarily state or reflect
- those of the United States Government or the University of California,
- and shall not be used for advertising or product endorsement purposes.
+ THIS WORK WAS PREPARED AS AN ACCOUNT OF WORK SPONSORED BY AN AGENCY OF
+ THE UNITED STATES GOVERNMENT. NEITHER THE UNITED STATES GOVERNMENT NOR
+ THE UNIVERSITY OF CALIFORNIA NOR ANY OF THEIR EMPLOYEES, MAKES ANY
+ WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY OR RESPONSIBILITY
+ FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY INFORMATION,
+ APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE
+ WOULD NOT INFRINGE PRIVATELY- OWNED RIGHTS. REFERENCE HEREIN TO ANY
+ SPECIFIC COMMERCIAL PRODUCTS, PROCESS, OR SERVICE BY TRADE NAME,
+ TRADEMARK, MANUFACTURER, OR OTHERWISE, DOES NOT NECESSARILY CONSTITUTE
+ OR IMPLY ITS ENDORSEMENT, RECOMMENDATION, OR FAVORING BY THE UNITED
+ STATES GOVERNMENT OR THE UNIVERSITY OF CALIFORNIA. THE VIEWS AND
+ OPINIONS OF AUTHORS EXPRESSED HEREIN DO NOT NECESSARILY STATE OR REFLECT
+ THOSE OF THE UNITED STATES GOVERNMENT OR THE UNIVERSITY OF CALIFORNIA,
+ AND SHALL NOT BE USED FOR ADVERTISING OR PRODUCT ENDORSEMENT PURPOSES.
-----------------------------------------------------------------------------
@@ -90,3 +103,4 @@ in HDF Products (www.hdfgroup.org/doc_resource/SZIP/) for further details.
-----------------------------------------------------------------------------
+
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
index 886228d..fd6b956 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/MANIFEST b/MANIFEST
index 73858a0..bf90760 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -71,12 +71,15 @@
./bin/errors _DO_NOT_DISTRIBUTE_
./bin/genparser
./bin/gcov_script _DO_NOT_DISTRIBUTE_
+./bin/h5cc.in
+./bin/h5redeploy.in
./bin/h5vers
./bin/iostats
./bin/locate_sw
./bin/make_err
./bin/make_overflow
./bin/make_vers
+./bin/Makefile.am
./bin/makehelp
./bin/mkdirs
./bin/newer
@@ -92,10 +95,6 @@
./bin/timekeeper _DO_NOT_DISTRIBUTE_
./bin/trace
./bin/yodconfigure
-./bin/batch/cori_ctestP.sl.in.cmake
-./bin/batch/cori_ctestS.sl.in.cmake
-./bin/batch/cori_knl_ctestP.sl.in.cmake
-./bin/batch/cori_knl_ctestS.sl.in.cmake
./bin/batch/ctestP.lsf.in.cmake
./bin/batch/ctestP.sl.in.cmake
./bin/batch/ctestS.lsf.in.cmake
@@ -103,6 +102,7 @@
./bin/batch/knl_ctestP.sl.in.cmake
./bin/batch/knl_ctestS.sl.in.cmake
./bin/batch/knl_H5detect.sl.in.cmake
+./bin/batch/ctest.qsub.in.cmake
./bin/batch/ray_ctestP.lsf.in.cmake
./bin/batch/ray_ctestS.lsf.in.cmake
./bin/batch/raybsub
@@ -264,7 +264,6 @@
./fortran/src/h5fc.in
./fortran/src/hdf5_fortrandll.def.in
-
./fortran/test/Makefile.am
./fortran/test/fflush1.F90
./fortran/test/fflush2.F90
@@ -461,6 +460,8 @@
./release_docs/INSTALL_parallel
./release_docs/INSTALL_Warnings.txt
./release_docs/INSTALL_Windows.txt
+./release_docs/README_HDF5_CMake
+./release_docs/README_HPC
./release_docs/RELEASE.txt
./release_docs/README_HDF5_CMake
./release_docs/README_HPC
@@ -542,8 +543,8 @@
./src/H5CS.c
./src/H5CSprivate.h
./src/H5CX.c
-./src/H5CXprivate.h
./src/H5CXmodule.h
+./src/H5CXprivate.h
./src/H5D.c
./src/H5Dbtree.c
./src/H5Dbtree2.c
@@ -633,6 +634,8 @@
./src/H5FDdrvr_module.h
./src/H5FDfamily.c
./src/H5FDfamily.h
+./src/H5FDhdfs.c
+./src/H5FDhdfs.h
./src/H5FDint.c
./src/H5FDlog.c
./src/H5FDlog.h
@@ -643,9 +646,13 @@
./src/H5FDmpio.h
./src/H5FDmulti.c
./src/H5FDmulti.h
+./src/H5FDros3.c
+./src/H5FDros3.h
./src/H5FDpkg.h
./src/H5FDprivate.h
./src/H5FDpublic.h
+./src/H5FDs3comms.h
+./src/H5FDs3comms.c
./src/H5FDsec2.c
./src/H5FDsec2.h
./src/H5FDspace.c
@@ -971,6 +978,10 @@
./test/evict_on_close.c
./test/extend.c
./test/external.c
+./test/external_common.c
+./test/external_common.h
+./test/external_env.c
+./test/external_fname.h
./test/error_test.c
./test/err_compat.c
./test/filter_error.h5
@@ -988,6 +999,7 @@
./test/file_image.c
./test/file_image_core_test.h5
./test/fill_old.h5
+./test/fill18.h5
./test/fillval.c
./test/filter_fail.c
./test/filter_plugin.c
@@ -1038,6 +1050,7 @@
./test/h5fc_ext_none.h5
./test/h5test.c
./test/h5test.h
+./test/hdfs.c
./test/hyperslab.c
./test/istore.c
./test/le_data.h5
@@ -1061,7 +1074,9 @@
./test/paged_nopersist.h5
./test/paged_persist.h5
./test/reserved.c
+./test/ros3.c
./test/pool.c
+./test/s3comms.c
./test/set_extent.c
# ====distribute this for now. See HDFFV-8236====
./test/space_overflow.c
@@ -1092,9 +1107,12 @@
./test/tcoords.c
./test/testabort_fail.sh.in
./test/testcheck_version.sh.in
+./test/testexternal_env.sh.in
./test/testerror.sh.in
./test/testlinks_env.sh.in
./test/test_filter_plugin.sh.in
+./test/test_filters_le.h5
+./test/test_filters_be.h5
./test/testflushrefresh.sh.in
./test/testframe.c
./test/testhdf5.c
@@ -1104,6 +1122,7 @@
./test/testmeta.c
./test/testswmr.sh.in
./test/testvdsswmr.sh.in
+./test/testvds_env.sh.in
./test/tfile.c
./test/tgenprop.c
./test/th5o.c
@@ -1143,11 +1162,10 @@
./test/use_disable_mdc_flushes.c
./test/use.h
./test/vfd.c
-./test/test_filters_le.h5
-./test/test_filters_be.h5
./test/gen_filters.c
./test/chunk_info.c
./test/vds.c
+./test/vds_env.c
./test/vds_swmr.h
./test/vds_swmr_gen.c
./test/vds_swmr_reader.c
@@ -1450,6 +1468,7 @@
./tools/test/h5repack/dynlib_rpk.c
./tools/test/h5repack/dynlib_vrpk.c
./tools/test/h5repack/h5repack.sh.in
+./tools/test/h5repack/h5repackgentest.c
./tools/test/h5repack/h5repack_plugin.sh.in
./tools/test/h5repack/h5repacktst.c
./tools/test/h5repack/testh5repack_detect_szip.c
@@ -1509,12 +1528,13 @@
./tools/lib/io_timer.c
./tools/lib/io_timer.h
+./tools/libtest/Makefile.am
+./tools/libtest/h5tools_test_utils.c
+
./tools/src/misc/Makefile.am
-./tools/src/misc/h5cc.in
./tools/src/misc/h5clear.c
./tools/src/misc/h5debug.c
./tools/src/misc/h5mkgrp.c
-./tools/src/misc/h5redeploy.in
./tools/src/misc/h5repart.c
./tools/test/misc/Makefile.am
./tools/test/misc/h5repart_gentest.c
@@ -1662,6 +1682,7 @@
./tools/testfiles/h5dump-help.txt
./tools/testfiles/non_existing.ddl
./tools/testfiles/packedbits.ddl
+./tools/testfiles/t128bit_float.h5
./tools/testfiles/taindices.h5
./tools/testfiles/tall-1.ddl
./tools/testfiles/tall-2.ddl
@@ -2513,12 +2534,25 @@
./tools/test/h5repack/testfiles/h5repack_early.h5
./tools/test/h5repack/testfiles/h5repack_ext.bin
./tools/test/h5repack/testfiles/h5repack_ext.h5
+./tools/test/h5repack/testfiles/h5repack_f32le.h5
+./tools/test/h5repack/testfiles/h5repack_f32le_ex-0.dat
+./tools/test/h5repack/testfiles/h5repack_f32le_ex.h5
./tools/test/h5repack/testfiles/h5repack_fill.h5
./tools/test/h5repack/testfiles/h5repack_filters.h5
./tools/test/h5repack/testfiles/h5repack_fletcher.h5
./tools/test/h5repack/testfiles/h5repack_fsm_aggr_nopersist.h5
./tools/test/h5repack/testfiles/h5repack_fsm_aggr_persist.h5
./tools/test/h5repack/testfiles/h5repack_hlink.h5
+./tools/test/h5repack/testfiles/h5repack_int32le_1d.h5
+./tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-0.dat
+./tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-1.dat
+./tools/test/h5repack/testfiles/h5repack_int32le_1d_ex.h5
+./tools/test/h5repack/testfiles/h5repack_int32le_2d.h5
+./tools/test/h5repack/testfiles/h5repack_int32le_2d_ex-0.dat
+./tools/test/h5repack/testfiles/h5repack_int32le_2d_ex.h5
+./tools/test/h5repack/testfiles/h5repack_int32le_3d.h5
+./tools/test/h5repack/testfiles/h5repack_int32le_3d_ex-0.dat
+./tools/test/h5repack/testfiles/h5repack_int32le_3d_ex.h5
./tools/test/h5repack/testfiles/h5repack.info
./tools/test/h5repack/testfiles/h5repack_layout.h5
./tools/test/h5repack/testfiles/h5repack_layouto.h5
@@ -2537,6 +2571,12 @@
./tools/test/h5repack/testfiles/h5repack_shuffle.h5
./tools/test/h5repack/testfiles/h5repack_soffset.h5
./tools/test/h5repack/testfiles/h5repack_szip.h5
+./tools/test/h5repack/testfiles/h5repack_uint8be.h5
+./tools/test/h5repack/testfiles/h5repack_uint8be_ex-0.dat
+./tools/test/h5repack/testfiles/h5repack_uint8be_ex-1.dat
+./tools/test/h5repack/testfiles/h5repack_uint8be_ex-2.dat
+./tools/test/h5repack/testfiles/h5repack_uint8be_ex-3.dat
+./tools/test/h5repack/testfiles/h5repack_uint8be_ex.h5
./tools/test/h5repack/testfiles/ublock.bin
./tools/test/h5repack/testfiles/crtorder.tordergr.h5.ddl
./tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl
@@ -2974,6 +3014,8 @@
./java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java
./java/src/hdf/hdf5lib/structs/H5E_error2_t.java
./java/src/hdf/hdf5lib/structs/H5F_info2_t.java
+./java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java
+./java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java
./java/src/hdf/hdf5lib/structs/H5G_info_t.java
./java/src/hdf/hdf5lib/structs/H5L_info_t.java
./java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
@@ -3137,6 +3179,8 @@
./java/test/testfiles/JUnit-TestH5P.txt
./java/test/testfiles/JUnit-TestH5PData.txt
./java/test/testfiles/JUnit-TestH5Pfapl.txt
+./java/test/testfiles/JUnit-TestH5Pfaplhdfs.txt
+./java/test/testfiles/JUnit-TestH5Pfapls3.txt
./java/test/testfiles/JUnit-TestH5Plist.txt
./java/test/testfiles/JUnit-TestH5Pvirtual.txt
./java/test/testfiles/JUnit-TestH5PL.txt
@@ -3174,6 +3218,8 @@
./java/test/TestH5P.java
./java/test/TestH5PData.java
./java/test/TestH5Pfapl.java
+./java/test/TestH5Pfaplhdfs.java
+./java/test/TestH5Pfapls3.java
./java/test/TestH5Plist.java
./java/test/TestH5Pvirtual.java
./java/test/TestH5PL.java
@@ -3194,9 +3240,12 @@
./java/lib/ext/slf4j-simple-1.7.25.jar
# CMake-specific Files
+./config/toolchain/build32.cmake
+./config/toolchain/clang.cmake
./config/toolchain/crayle.cmake
./config/toolchain/GCC.cmake
./config/toolchain/intel.cmake
+./config/toolchain/mingw64.cmake
./config/toolchain/PGI.cmake
./config/cmake/cacheinit.cmake
@@ -3205,8 +3254,7 @@
./config/cmake/ConfigureChecks.cmake
./config/cmake/CPack.Info.plist.in
./config/cmake/CTestCustom.cmake
-./config/cmake/FindHDFJAVA.cmake.in
-./config/cmake/FindJNI.cmake
+./config/cmake/FindHDFS.cmake
./config/cmake/H5cxx_config.h.in
./config/cmake/H5pubconf.h.in
./config/cmake/hdf5-config.cmake.in
@@ -3314,6 +3362,8 @@
./testpar/CMakeVFDTests.cmake
./tools/CMakeLists.txt
./tools/lib/CMakeLists.txt
+./tools/libtest/CMakeLists.txt
+./tools/libtest/CMakeTests.cmake
./tools/src/CMakeLists.txt
./tools/test/CMakeLists.txt
./tools/src/h5copy/CMakeLists.txt
@@ -3328,6 +3378,7 @@
./tools/test/h5dump/CMakeTestsPBITS.cmake
./tools/test/h5dump/CMakeTestsXML.cmake
./tools/test/h5dump/CMakeTestsVDS.cmake
+./tools/test/h5dump/CMakeVFDTests.cmake
./tools/src/h5format_convert/CMakeLists.txt
./tools/test/h5format_convert/CMakeLists.txt
./tools/test/h5format_convert/CMakeTests.cmake
@@ -3367,6 +3418,7 @@
# CMake-specific HPC Scripts
./config/cmake/scripts/HPC/sbatch-HDF5options.cmake
./config/cmake/scripts/HPC/bsub-HDF5options.cmake
+./config/cmake/scripts/HPC/qsub-HDF5options.cmake
./config/cmake/scripts/HPC/raybsub-HDF5options.cmake
# Files generated by autogen
@@ -3382,6 +3434,7 @@
./c++/examples/Makefile.in
./c++/Makefile.in
./configure
+./bin/Makefile.in
./c++/src/Makefile.in
./c++/test/Makefile.in
./examples/Makefile.in
@@ -3432,6 +3485,7 @@
./testpar/Makefile.in
./tools/Makefile.in
./tools/lib/Makefile.in
+./tools/libtest/Makefile.in
./tools/src/Makefile.in
./tools/src/h5copy/Makefile.in
./tools/src/h5diff/Makefile.in
diff --git a/Makefile.am b/Makefile.am
index e3e5e3d..af3d634 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -49,11 +49,6 @@ include $(top_srcdir)/config/commence.am
# Conditionals. These conditionals are defined during configure
# Define each variable to empty if it is not used to placate pmake
-if BUILD_PARALLEL_CONDITIONAL
- TESTPARALLEL_DIR =testpar
-else
- TESTPARALLEL_DIR=
-endif
if BUILD_CXX_CONDITIONAL
CXX_DIR =c++
else
@@ -74,9 +69,24 @@ if BUILD_HDF5_HL_CONDITIONAL
else
HDF5_HL_DIR=
endif
+if BUILD_TESTS_CONDITIONAL
+ TESTSERIAL_DIR =test
+else
+ TESTSERIAL_DIR=
+endif
+if BUILD_TESTS_PARALLEL_CONDITIONAL
+ TESTPARALLEL_DIR =testpar
+else
+ TESTPARALLEL_DIR=
+endif
+if BUILD_TOOLS_CONDITIONAL
+ TOOLS_DIR =tools
+else
+ TOOLS_DIR=
+endif
-SUBDIRS = src test $(TESTPARALLEL_DIR) tools . $(CXX_DIR) $(FORTRAN_DIR) \
- $(JAVA_DIR) $(HDF5_HL_DIR)
+SUBDIRS = src $(TESTSERIAL_DIR) $(TESTPARALLEL_DIR) bin $(TOOLS_DIR) . \
+ $(CXX_DIR) $(FORTRAN_DIR) $(JAVA_DIR) $(HDF5_HL_DIR)
DIST_SUBDIRS = src test testpar tools . c++ fortran hl examples java
# Some files generated during configure that should be cleaned
diff --git a/Makefile.in b/Makefile.in
index ef473e7..61ab46f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -208,8 +208,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/bin/compile \
$(top_srcdir)/bin/config.guess $(top_srcdir)/bin/config.sub \
$(top_srcdir)/bin/install-sh $(top_srcdir)/bin/ltmain.sh \
$(top_srcdir)/bin/missing $(top_srcdir)/config/commence.am \
- COPYING bin/COPYING bin/README bin/compile bin/config.guess \
- bin/config.sub bin/install-sh bin/ltmain.sh bin/missing
+ COPYING
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -323,7 +322,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -346,9 +344,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -375,6 +376,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -429,6 +431,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -453,7 +456,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -572,7 +574,7 @@ TRACE = perl $(top_srcdir)/bin/trace
# Some files/directories generated during check that should be cleaned
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *-tmp
-@BUILD_PARALLEL_CONDITIONAL_FALSE@TESTPARALLEL_DIR =
+@BUILD_CXX_CONDITIONAL_FALSE@CXX_DIR =
# Define subdirectories to build.
# Add this directory to SUBDIRS so that examples get built after tools
@@ -584,8 +586,6 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *-tmp
# Conditionals. These conditionals are defined during configure
# Define each variable to empty if it is not used to placate pmake
-@BUILD_PARALLEL_CONDITIONAL_TRUE@TESTPARALLEL_DIR = testpar
-@BUILD_CXX_CONDITIONAL_FALSE@CXX_DIR =
@BUILD_CXX_CONDITIONAL_TRUE@CXX_DIR = c++
@BUILD_FORTRAN_CONDITIONAL_FALSE@FORTRAN_DIR =
@BUILD_FORTRAN_CONDITIONAL_TRUE@FORTRAN_DIR = fortran
@@ -593,8 +593,14 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *-tmp
@BUILD_JAVA_CONDITIONAL_TRUE@JAVA_DIR = java
@BUILD_HDF5_HL_CONDITIONAL_FALSE@HDF5_HL_DIR =
@BUILD_HDF5_HL_CONDITIONAL_TRUE@HDF5_HL_DIR = hl
-SUBDIRS = src test $(TESTPARALLEL_DIR) tools . $(CXX_DIR) $(FORTRAN_DIR) \
- $(JAVA_DIR) $(HDF5_HL_DIR)
+@BUILD_TESTS_CONDITIONAL_FALSE@TESTSERIAL_DIR =
+@BUILD_TESTS_CONDITIONAL_TRUE@TESTSERIAL_DIR = test
+@BUILD_TESTS_PARALLEL_CONDITIONAL_FALSE@TESTPARALLEL_DIR =
+@BUILD_TESTS_PARALLEL_CONDITIONAL_TRUE@TESTPARALLEL_DIR = testpar
+@BUILD_TOOLS_CONDITIONAL_FALSE@TOOLS_DIR =
+@BUILD_TOOLS_CONDITIONAL_TRUE@TOOLS_DIR = tools
+SUBDIRS = src $(TESTSERIAL_DIR) $(TESTPARALLEL_DIR) bin $(TOOLS_DIR) . \
+ $(CXX_DIR) $(FORTRAN_DIR) $(JAVA_DIR) $(HDF5_HL_DIR)
DIST_SUBDIRS = src test testpar tools . c++ fortran hl examples java
diff --git a/README.txt b/README.txt
index 29081b6..d2014b3 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.10.5 released on 2019-02-25
+HDF5 version 1.10.6 released on 2019-12-23
------------------------------------------------------------------------------
Please refer to the release_docs/INSTALL file for installation instructions.
diff --git a/bin/Makefile.am b/bin/Makefile.am
new file mode 100644
index 0000000..a39b695
--- /dev/null
+++ b/bin/Makefile.am
@@ -0,0 +1,57 @@
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+##
+## Makefile.am
+## Run automake to generate a Makefile.in from this file.
+#
+# HDF5 Library Makefile(.in)
+#
+
+include $(top_srcdir)/config/commence.am
+
+# Include src directory
+AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib
+
+# These are our main targets
+bin_SCRIPTS=h5redeploy
+
+# Tell automake to clean h5redeploy script
+CLEANFILES=h5redeploy
+
+# These were generated by configure. Remove them only when distclean.
+DISTCLEANFILES=h5cc
+
+# All programs rely on hdf5 library and h5tools library
+LDADD=$(LIBH5TOOLS) $(LIBHDF5)
+
+# How to build h5redeploy script
+h5redeploy: h5redeploy.in
+ @cp $(srcdir)/$@.in $@
+
+# h5cc needs custom install and uninstall rules, since it may be
+# named h5pcc if hdf5 is being built in parallel mode.
+if BUILD_PARALLEL_CONDITIONAL
+ H5CC_NAME=h5pcc
+else
+ H5CC_NAME=h5cc
+endif
+
+$(DESTDIR)$(bindir):
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1;
+
+install-exec-local: $(DESTDIR)$(bindir)
+ @$(INSTALL) h5cc $(DESTDIR)$(bindir)/$(H5CC_NAME)
+uninstall-local:
+ @$(RM) $(DESTDIR)$(bindir)/$(H5CC_NAME)
+
+include $(top_srcdir)/config/conclude.am
diff --git a/bin/Makefile.in b/bin/Makefile.in
new file mode 100644
index 0000000..5ce94e9
--- /dev/null
+++ b/bin/Makefile.in
@@ -0,0 +1,1368 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+# HDF5 Library Makefile(.in)
+#
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+TESTS =
+subdir = bin
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \
+ $(top_srcdir)/m4/aclocal_fc.m4 \
+ $(top_srcdir)/m4/ax_check_class.m4 \
+ $(top_srcdir)/m4/ax_check_classpath.m4 \
+ $(top_srcdir)/m4/ax_check_java_home.m4 \
+ $(top_srcdir)/m4/ax_check_junit.m4 \
+ $(top_srcdir)/m4/ax_java_options.m4 \
+ $(top_srcdir)/m4/ax_jni_include_dir.m4 \
+ $(top_srcdir)/m4/ax_prog_jar.m4 \
+ $(top_srcdir)/m4/ax_prog_java.m4 \
+ $(top_srcdir)/m4/ax_prog_java_works.m4 \
+ $(top_srcdir)/m4/ax_prog_javac.m4 \
+ $(top_srcdir)/m4/ax_prog_javac_works.m4 \
+ $(top_srcdir)/m4/ax_prog_javadoc.m4 \
+ $(top_srcdir)/m4/ax_try_compile_java.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/H5config.h \
+ $(top_builddir)/fortran/src/H5config_f.inc
+CONFIG_CLEAN_FILES = h5cc
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(bindir)"
+SCRIPTS = $(bin_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.sh.log=.log)
+SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver
+SH_LOG_COMPILE = $(SH_LOG_COMPILER) $(AM_SH_LOG_FLAGS) $(SH_LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/h5cc.in \
+ $(top_srcdir)/config/commence.am \
+ $(top_srcdir)/config/conclude.am COPYING README compile \
+ config.guess config.sub install-sh ltmain.sh missing \
+ test-driver
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
+AMTAR = @AMTAR@
+
+# H5_CFLAGS holds flags that should be used when building hdf5,
+# but which should not be exported to h5cc for building other programs.
+# AM_CFLAGS is an automake construct which should be used by Makefiles
+# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
+# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
+AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
+
+# Include src directory
+AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \
+ -I$(top_srcdir)/tools/lib
+AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
+AM_JAVACFLAGS = @AM_JAVACFLAGS@
+AM_JAVAFLAGS = @AM_JAVAFLAGS@
+AM_JNIFLAGS = @AM_JNIFLAGS@
+AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@
+AR = @AR@
+AR_FLAGS = @AR_FLAGS@
+ASSERTS = @ASSERTS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_MODE = @BUILD_MODE@
+BYTESEX = @BYTESEX@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CC_VERSION = @CC_VERSION@
+CFLAGS = @CFLAGS@
+CODESTACK = @CODESTACK@
+CONFIG_DATE = @CONFIG_DATE@
+CONFIG_MODE = @CONFIG_MODE@
+CONFIG_USER = @CONFIG_USER@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CXX_VERSION = @CXX_VERSION@
+CYGPATH_W = @CYGPATH_W@
+DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
+DEV_WARNINGS = @DEV_WARNINGS@
+DIRECT_VFD = @DIRECT_VFD@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTERNAL_FILTERS = @EXTERNAL_FILTERS@
+
+# Make sure that these variables are exported to the Makefiles
+F9XMODEXT = @F9XMODEXT@
+F9XMODFLAG = @F9XMODFLAG@
+F9XSUFFIXFLAG = @F9XSUFFIXFLAG@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_f90 = @FCFLAGS_f90@
+FCLIBS = @FCLIBS@
+FC_VERSION = @FC_VERSION@
+FGREP = @FGREP@
+FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
+FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
+FSEARCH_DIRS = @FSEARCH_DIRS@
+Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
+GREP = @GREP@
+H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@
+H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@
+H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@
+H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@
+H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@
+H5_CFLAGS = @H5_CFLAGS@
+H5_CLASSPATH = @H5_CLASSPATH@
+H5_CPPFLAGS = @H5_CPPFLAGS@
+H5_CXXFLAGS = @H5_CXXFLAGS@
+H5_FCFLAGS = @H5_FCFLAGS@
+H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
+H5_JAVACFLAGS = @H5_JAVACFLAGS@
+H5_JAVAFLAGS = @H5_JAVAFLAGS@
+H5_JNIFLAGS = @H5_JNIFLAGS@
+H5_LDFLAGS = @H5_LDFLAGS@
+H5_VERSION = @H5_VERSION@
+HADDR_T = @HADDR_T@
+HAVE_DMALLOC = @HAVE_DMALLOC@
+HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
+HAVE_PTHREAD = @HAVE_PTHREAD@
+HDF5_HL = @HDF5_HL@
+HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
+HDF_CXX = @HDF_CXX@
+HDF_FORTRAN = @HDF_FORTRAN@
+HDF_JAVA = @HDF_JAVA@
+HID_T = @HID_T@
+HL = @HL@
+HL_FOR = @HL_FOR@
+HSIZE_T = @HSIZE_T@
+HSSIZE_T = @HSSIZE_T@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@
+INTERNAL_DEBUG_OUTPUT = @INTERNAL_DEBUG_OUTPUT@
+JAR = @JAR@
+JAVA = @JAVA@
+JAVAC = @JAVAC@
+JAVACFLAGS = @JAVACFLAGS@
+JAVADOC = @JAVADOC@
+JAVAFLAGS = @JAVAFLAGS@
+JAVAPREFIX = @JAVAPREFIX@
+JAVA_JUNIT = @JAVA_JUNIT@
+JAVA_PATH_NAME = @JAVA_PATH_NAME@
+JAVA_VERSION = @JAVA_VERSION@
+JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
+JUNIT = @JUNIT@
+LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LL_PATH = @LL_PATH@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_STATIC_EXEC = @LT_STATIC_EXEC@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MEMORYALLOCSANITYCHECK = @MEMORYALLOCSANITYCHECK@
+MKDIR_P = @MKDIR_P@
+MPE = @MPE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@
+OBJEXT = @OBJEXT@
+OPTIMIZATION = @OPTIMIZATION@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@
+PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@
+PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@
+PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@
+PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@
+PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@
+PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@
+PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@
+PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@
+PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@
+PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@
+PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@
+PAC_FORTRAN_NUM_INTEGER_KINDS = @PAC_FORTRAN_NUM_INTEGER_KINDS@
+PARALLEL = @PARALLEL@
+PARALLEL_FILTERED_WRITES = @PARALLEL_FILTERED_WRITES@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PREADWRITE = @PREADWRITE@
+PROFILING = @PROFILING@
+RANLIB = @RANLIB@
+ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
+RUNPARALLEL = @RUNPARALLEL@
+RUNSERIAL = @RUNSERIAL@
+R_INTEGER = @R_INTEGER@
+R_LARGE = @R_LARGE@
+SEARCH = @SEARCH@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T = @SIZE_T@
+STATIC_EXEC = @STATIC_EXEC@
+STATIC_SHARED = @STATIC_SHARED@
+STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
+STRIP = @STRIP@
+SYMBOLS = @SYMBOLS@
+TESTPARALLEL = @TESTPARALLEL@
+TESTS_JUNIT = @TESTS_JUNIT@
+THREADSAFE = @THREADSAFE@
+TIME = @TIME@
+TR = @TR@
+TRACE_API = @TRACE_API@
+UNAME_INFO = @UNAME_INFO@
+USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
+USE_FILTER_SZIP = @USE_FILTER_SZIP@
+USINGMEMCHECKER = @USINGMEMCHECKER@
+VERSION = @VERSION@
+WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
+_ACJNI_JAVAC = @_ACJNI_JAVAC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
+docdir = $(exec_prefix)/doc
+dvidir = @dvidir@
+enable_shared = @enable_shared@
+enable_static = @enable_static@
+exec_prefix = @exec_prefix@
+fortran_linux_linker_option = @fortran_linux_linker_option@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Shell commands used in Makefiles
+RM = rm -f
+CP = cp
+
+# Some machines need a command to run executables; this is that command
+# so that our tests will run.
+# We use RUNEXEC instead of RUNSERIAL directly because it may be that
+# some tests need to be run with a different command. Older versions
+# of the makefiles used the command
+# $(LIBTOOL) --mode=execute
+# in some directories, for instance.
+RUNEXEC = $(RUNSERIAL)
+
+# Libraries to link to while building
+LIBHDF5 = $(top_builddir)/src/libhdf5.la
+LIBH5TEST = $(top_builddir)/test/libh5test.la
+LIBH5F = $(top_builddir)/fortran/src/libhdf5_fortran.la
+LIBH5FTEST = $(top_builddir)/fortran/test/libh5test_fortran.la
+LIBH5CPP = $(top_builddir)/c++/src/libhdf5_cpp.la
+LIBH5JNI = $(top_builddir)/java/src/jni/libhdf5_java.la
+LIBH5TOOLS = $(top_builddir)/tools/lib/libh5tools.la
+LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
+LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
+LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
+
+# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
+# has been removed. According to the official description of DESTDIR by Gnu at
+# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
+# prepended to the normal and complete install path that it precedes for the
+# purpose of installing in a temporary directory which is useful for building
+# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
+# '/' at the beginning of the normal install path. When DESTDIR is empty the
+# path then begins with '//', which is incorrect and causes problems at least for
+# Cygwin.
+
+# Scripts used to build examples
+# If only shared libraries have been installed, have h5cc build examples with
+# shared libraries instead of static libraries
+H5CC = ${DESTDIR}$(bindir)/h5cc
+H5CC_PP = ${DESTDIR}$(bindir)/h5pcc
+H5FC = ${DESTDIR}$(bindir)/h5fc
+H5FC_PP = ${DESTDIR}$(bindir)/h5pfc
+H5CPP = ${DESTDIR}$(bindir)/h5c++
+ACLOCAL_AMFLAGS = "-I m4"
+
+# The trace script; this is used on source files from the C library to
+# insert tracing macros.
+TRACE = perl $(top_srcdir)/bin/trace
+
+# .chkexe files are used to mark tests that have run successfully.
+# .chklog files are output from those tests.
+# *.clog and *.clog2 are from the MPE option.
+CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
+
+# These are our main targets
+bin_SCRIPTS = h5redeploy
+
+# Tell automake to clean h5redeploy script
+CLEANFILES = h5redeploy
+
+# These were generated by configure. Remove them only when distclean.
+DISTCLEANFILES = h5cc
+
+# All programs rely on hdf5 library and h5tools library
+LDADD = $(LIBH5TOOLS) $(LIBHDF5)
+@BUILD_PARALLEL_CONDITIONAL_FALSE@H5CC_NAME = h5cc
+
+# h5cc needs custom install and uninstall rules, since it may be
+# named h5pcc if hdf5 is being built in parallel mode.
+@BUILD_PARALLEL_CONDITIONAL_TRUE@H5CC_NAME = h5pcc
+
+# Automake needs to be taught how to build lib, progs and tests targets.
+# These will be filled in automatically for the most part (e.g.,
+# lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and
+# EXTRA_TEST variables are supplied to allow the user to force targets to
+# be built at certain times.
+LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
+ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB)
+
+PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
+ $(EXTRA_PROG)
+
+chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
+TEST_EXTENSIONS = .sh
+SH_LOG_COMPILER = $(SHELL)
+AM_SH_LOG_FLAGS =
+REALTIMEOUTPUT = $(realtimeOutput)
+TEST_PROG_CHKEXE = $(TEST_PROG:=.chkexe_)
+TEST_PROG_PARA_CHKEXE = $(TEST_PROG_PARA:=.chkexe_)
+TEST_SCRIPT_CHKSH = $(TEST_SCRIPT:=.chkexe_)
+TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .log .sh .sh$(EXEEXT) .trs
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign bin/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+$(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__empty):
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+h5cc: $(top_builddir)/config.status $(srcdir)/h5cc.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+recheck: all
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+.sh.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.sh$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(SCRIPTS) all-local
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS install-exec-local
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-local
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-local
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am all-local check check-TESTS check-am clean \
+ clean-generic clean-libtool cscopelist-am ctags-am distclean \
+ distclean-generic distclean-libtool distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binSCRIPTS \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-exec-local install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
+ pdf-am ps ps-am recheck tags-am uninstall uninstall-am \
+ uninstall-binSCRIPTS uninstall-local
+
+.PRECIOUS: Makefile
+
+
+# List all build rules defined by HDF5 Makefiles as "PHONY" targets here.
+# This tells the Makefiles that these targets are not files to be built but
+# commands that should be executed even if a file with the same name already
+# exists.
+.PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \
+ build-tests check-clean check-install check-p check-s check-vfd \
+ install-doc lib progs tests uninstall-doc _exec_check-s _test help
+
+help:
+ @$(top_srcdir)/bin/makehelp
+
+# How to build h5redeploy script
+h5redeploy: h5redeploy.in
+ @cp $(srcdir)/$@.in $@
+
+$(DESTDIR)$(bindir):
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1;
+
+install-exec-local: $(DESTDIR)$(bindir)
+ @$(INSTALL) h5cc $(DESTDIR)$(bindir)/$(H5CC_NAME)
+uninstall-local:
+ @$(RM) $(DESTDIR)$(bindir)/$(H5CC_NAME)
+
+# lib/progs/tests targets recurse into subdirectories. build-* targets
+# build files in this directory.
+build-lib: $(LIB)
+build-progs: $(LIB) $(PROGS)
+build-tests: $(LIB) $(PROGS) $(chk_TESTS)
+
+# General rule for recursive building targets.
+# BUILT_SOURCES contain targets that need to be built before anything else
+# in the directory (e.g., for Fortran type detection)
+lib progs tests check-s check-p :: $(BUILT_SOURCES)
+ @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1;
+ @for d in X $(SUBDIRS); do \
+ if test $$d != X && test $$d != .; then \
+ (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
+ fi; \
+ done
+
+# General rule for recursive cleaning targets. Like the rule above,
+# but doesn't require building BUILT_SOURCES.
+check-clean ::
+ @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1;
+ @for d in X $(SUBDIRS); do \
+ if test $$d != X && test $$d != .; then \
+ (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
+ fi; \
+ done
+
+# Tell Automake to build tests when the user types `make all' (this is
+# not its default behavior). Also build EXTRA_LIB and EXTRA_PROG since
+# Automake won't build them automatically, either.
+all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
+
+# make install-doc doesn't do anything outside of doc directory, but
+# Makefiles should recognize it.
+# UPDATE: docs no longer reside in this build tree, so this target
+# is deprecated.
+install-doc uninstall-doc:
+ @echo "Nothing to be done."
+
+# clean up files generated by tests so they can be re-run.
+build-check-clean:
+ $(RM) -rf $(CHECK_CLEANFILES)
+
+# run check-clean whenever mostlyclean is run
+mostlyclean-local: build-check-clean
+
+# check-install is just a synonym for installcheck
+check-install: installcheck
+
+# Run each test in order, passing $(TEST_FLAGS) to the program.
+# Since tests are done in a shell loop, "make -i" does apply inside it.
+# Set HDF5_Make_Ignore to a non-blank string to ignore errors inside the loop.
+# The timestamps give a rough idea how much time the tests use.
+#
+# Note that targets in chk_TESTS (defined above) will be built when the user
+# types 'make tests' or 'make check', but only programs in TEST_PROG,
+# TEST_PROG_PARA, or TEST_SCRIPT will actually be executed.
+check-TESTS: test
+
+test _test:
+ @$(MAKE) build-check-s
+ @$(MAKE) build-check-p
+
+# Actual execution of check-s.
+build-check-s: $(LIB) $(PROGS) $(chk_TESTS)
+ @if test -n "$(TEST_PROG)$(TEST_SCRIPT)"; then \
+ echo "===Serial tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
+ fi
+ @$(MAKE) $(AM_MAKEFLAGS) _exec_check-s
+ @if test -n "$(TEST_PROG)$(TEST_SCRIPT)"; then \
+ echo "===Serial tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\
+ fi
+
+_exec_check-s: $(TEST_PROG_CHKEXE) $(TEST_SCRIPT_CHKSH)
+
+# The dummy.chkexe here prevents the target from being
+# empty if there are no tests in the current directory.
+# $${log} is the log file.
+# $${tname} is the name of test.
+$(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
+ @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummy.chkexe_"; then \
+ tname=$(@:.chkexe_=)$(EXEEXT);\
+ log=$(@:.chkexe_=.chklog); \
+ echo "============================"; \
+ if $(top_srcdir)/bin/newer $(@:.chkexe_=.chkexe) $${tname}; then \
+ echo "No need to test $${tname} again."; \
+ else \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "============================" | tee $${log}; \
+ else \
+ echo "============================" > $${log}; \
+ fi; \
+ if test "X$(FORTRAN_API)" = "Xyes"; then \
+ echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ else \
+ echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ elif test "X$(CXX_API)" = "Xyes"; then \
+ echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\
+ else \
+ echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ fi; \
+ else \
+ echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ else \
+ echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "============================" | tee -a $${log}; \
+ else \
+ echo "============================" >> $${log}; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ srcdir="$(srcdir)" \
+ $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) | tee -a $${log} 2>&1 \
+ && touch $(@:.chkexe_=.chkexe) || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ else \
+ srcdir="$(srcdir)" \
+ $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
+ && touch $(@:.chkexe_=.chkexe) || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ fi; \
+ echo "" >> $${log}; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
+ echo "============================" | tee -a $${log}; \
+ else \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \
+ echo "============================" >> $${log}; \
+ fi; \
+ if test -z "$(REALTIMEOUTPUT)"; then \
+ cat $${log}; \
+ fi; \
+ fi; \
+ fi
+
+# The dummysh.chkexe here prevents the target from being
+# empty if there are no tests in the current directory.
+# $${log} is the log file.
+# $${tname} is the name of test.
+$(TEST_SCRIPT_CHKSH) $(TEST_SCRIPT_PARA_CHKSH) dummysh.chkexe_:
+ @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummysh.chkexe_"; then \
+ cmd=$(@:.chkexe_=);\
+ tname=`basename $$cmd`;\
+ chkname=`basename $(@:.chkexe_=.chkexe)`;\
+ log=`basename $(@:.chkexe_=.chklog)`; \
+ echo "============================"; \
+ if $(top_srcdir)/bin/newer $${chkname} $$cmd $(SCRIPT_DEPEND); then \
+ echo "No need to test $${tname} again."; \
+ else \
+ echo "============================" > $${log}; \
+ if test "X$(FORTRAN_API)" = "Xyes"; then \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ elif test "X$(CXX_API)" = "Xyes"; then \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ else \
+ echo "Testing $${tname} $(TEST_FLAGS)"; \
+ echo "$${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ echo "============================" >> $${log}; \
+ RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \
+ srcdir="$(srcdir)" \
+ $(TIME) $(SHELL) $$cmd $(TEST_FLAGS) >> $${log} 2>&1 \
+ && touch $${chkname} || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ echo "" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \
+ echo "============================" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)"; \
+ cat $${log}; \
+ fi; \
+ echo "============================"; \
+ fi
+
+# Actual execution of check-p.
+build-check-p: $(LIB) $(PROGS) $(chk_TESTS)
+ @if test -n "$(TEST_PROG_PARA)$(TEST_SCRIPT_PARA)"; then \
+ echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
+ fi
+ @if test -n "$(TEST_PROG_PARA)"; then \
+ echo "**** Hint ****"; \
+ echo "Parallel test files reside in the current directory" \
+ "by default."; \
+ echo "Set HDF5_PARAPREFIX to use another directory. e.g.,"; \
+ echo " HDF5_PARAPREFIX=/PFS/user/me"; \
+ echo " export HDF5_PARAPREFIX"; \
+ echo " make check"; \
+ echo "**** end of Hint ****"; \
+ fi
+ @for test in $(TEST_PROG_PARA) dummy; do \
+ if test $$test != dummy; then \
+ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \
+ RUNEXEC="$(RUNPARALLEL)" || exit 1; \
+ fi; \
+ done
+ @for test in $(TEST_SCRIPT_PARA) dummy; do \
+ if test $$test != dummy; then \
+ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ || exit 1; \
+ fi; \
+ done
+ @if test -n "$(TEST_PROG_PARA)$(TEST_SCRIPT_PARA)"; then \
+ echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\
+ fi
+
+# Run test with different Virtual File Driver
+check-vfd: $(LIB) $(PROGS) $(chk_TESTS)
+ @for vfd in $(VFD_LIST) dummy; do \
+ if test $$vfd != dummy; then \
+ echo "============================"; \
+ echo "Testing Virtual File Driver $$vfd"; \
+ echo "============================"; \
+ $(MAKE) $(AM_MAKEFLAGS) check-clean || exit 1; \
+ HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \
+ fi; \
+ done
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bin/batch/cori_ctestP.sl.in.cmake b/bin/batch/cori_ctestP.sl.in.cmake
deleted file mode 100644
index 287fe3c..0000000
--- a/bin/batch/cori_ctestP.sl.in.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-#SBATCH -C haswell
-#SBATCH --nodes=1
-#SBATCH -t 00:30:00
-#SBATCH --mail-type=BEGIN,END,FAIL
-##SBATCH --mail-user=<username>@sandia.gov
-#SBATCH --export=ALL
-#SBATCH --job-name=h5_ctestP
-
-cd @HDF5_BINARY_DIR@
-CMD="ctest . -R MPI_TEST_ -E t_cache_image -C Release -T test"
-
-echo "Run $CMD. Test output will be in build/ctestP.out"
-$CMD >& ctestP.out
-echo "Done running $CMD"
-
diff --git a/bin/batch/cori_ctestS.sl.in.cmake b/bin/batch/cori_ctestS.sl.in.cmake
deleted file mode 100644
index 50bef6b..0000000
--- a/bin/batch/cori_ctestS.sl.in.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-#SBATCH -C haswell
-#SBATCH --nodes=1
-#SBATCH -t 00:30:00
-#SBATCH --mail-type=BEGIN,END,FAIL
-##SBATCH --mail-user=<username>@sandia.gov
-#SBATCH --export=ALL
-#SBATCH --job-name=h5_ctestS
-
-cd @HDF5_BINARY_DIR@
-CMD="ctest . -E MPI_TEST_ -C Release -j 32 -T test"
-
-echo "Run $CMD. Test output will be in build/ctestS.out"
-$CMD >& ctestS.out
-echo "Done running $CMD"
diff --git a/bin/batch/cori_knl_ctestP.sl.in.cmake b/bin/batch/cori_knl_ctestP.sl.in.cmake
deleted file mode 100644
index 82378ec..0000000
--- a/bin/batch/cori_knl_ctestP.sl.in.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-#SBATCH -C knl,quad,cache
-#SBATCH --nodes=1
-#SBATCH -t 00:30:00
-#SBATCH --mail-type=BEGIN,END,FAIL
-##SBATCH --mail-user=<username>@sandia.gov
-#SBATCH --export=ALL
-#SBATCH --job-name=h5_ctestP
-
-cd @HDF5_BINARY_DIR@
-CMD="ctest . -R MPI_TEST_ -E t_cache_image -C Release -T test"
-
-echo "Run $CMD. Test output will be in build/ctestP.out"
-$CMD >& ctestP.out
-echo "Done running $CMD"
-
diff --git a/bin/batch/cori_knl_ctestS.sl.in.cmake b/bin/batch/cori_knl_ctestS.sl.in.cmake
deleted file mode 100644
index bcb4881..0000000
--- a/bin/batch/cori_knl_ctestS.sl.in.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-#SBATCH -C knl,quad, cache
-#SBATCH --nodes=1
-#SBATCH -t 00:30:00
-#SBATCH --mail-type=BEGIN,END,FAIL
-##SBATCH --mail-user=<username>@sandia.gov
-#SBATCH --export=ALL
-#SBATCH --job-name=h5_ctestS
-
-cd @HDF5_BINARY_DIR@
-CMD="ctest . -E MPI_TEST_ -C Release -j 32 -T test"
-
-echo "Run $CMD. Test output will be in build/ctestS.out"
-$CMD >& ctestS.out
-echo "Done running $CMD"
diff --git a/bin/batch/ctest.qsub.in.cmake b/bin/batch/ctest.qsub.in.cmake
new file mode 100644
index 0000000..702fca7
--- /dev/null
+++ b/bin/batch/ctest.qsub.in.cmake
@@ -0,0 +1,21 @@
+#!/bin/bash -l
+if [ $# -gt 0 ]; then
+ SUMMARY_FILE=$1
+fi
+ACCOUNT_ID=@ACCOUNT_ID@
+
+echo "Run parallel test command. Test output will be in build/${SUMMARY_FILE}"
+CTEST_CMD=`which ctest`
+
+#SKIPTESTS <<KEYWORD:script inserts list of skips tests here -- don't remove>>
+
+cd @HDF5_BINARY_DIR@
+if [[ $SUMMARY_FILE == *"ctestS"* ]]; then
+ CMD="${CTEST_CMD} . -E MPI_TEST_ -C Release -j 32 -T test"
+else
+ CMD="${CTEST_CMD} . -R MPI_TEST_ ${SKIP_TESTS} -C Release -T test"
+fi
+
+qsub -t 60 -n 1 -q debug-flat-quad -A ${ACCOUNT_ID} ${CMD} >& ${SUMMARY_FILE}
+
+echo "Done running ctest parallel command."
diff --git a/bin/batch/ctestP.lsf.in.cmake b/bin/batch/ctestP.lsf.in.cmake
index 2777f39..3fdd5ce 100644
--- a/bin/batch/ctestP.lsf.in.cmake
+++ b/bin/batch/ctestP.lsf.in.cmake
@@ -14,6 +14,6 @@
cd @HDF5_BINARY_DIR@
echo "Run parallel test command. Test output will be in build/ctestP.out"
-ctest . -R 'TEST_PAR|PH5DIFF|PERFORM' -E t_cache_image -C Release -T test >& ctestP.out
+ctest . -R MPI_TEST_ -C Release -T test >& ctestP.out
echo "Done running ctest parallel command."
diff --git a/bin/batch/ctestP.sl.in.cmake b/bin/batch/ctestP.sl.in.cmake
index 8d216d6..6399de7 100644
--- a/bin/batch/ctestP.sl.in.cmake
+++ b/bin/batch/ctestP.sl.in.cmake
@@ -8,9 +8,7 @@
#SBATCH --job-name=h5_ctestP
cd @HDF5_BINARY_DIR@
-CMD="ctest . -R MPI_TEST_ -E t_cache_image -C Release -T test"
+ctest . -R MPI_TEST_ -C Release -T test >& ctestP.out
-echo "Run $CMD. Test output will be in build/ctestP.out"
-$CMD >& ctestP.out
-echo "Done running $CMD"
+echo "Done running ctestP.sl"
diff --git a/bin/batch/ctestS.lsf.in.cmake b/bin/batch/ctestS.lsf.in.cmake
index 7ef5af5..a01d39b 100644
--- a/bin/batch/ctestS.lsf.in.cmake
+++ b/bin/batch/ctestS.lsf.in.cmake
@@ -11,7 +11,7 @@
cd @HDF5_BINARY_DIR@
echo "Run command. Test output will be in build/ctestS.out"
-ctest . -E 'TEST_PAR|PH5DIFF|PERFORM' -C Release -j 32 -T test >& ctestS.out
+ctest . -E MPI_TEST_ -C Release -j 32 -T test >& ctestS.out
##$CMD >& ctestS.out
echo "Done running command."
diff --git a/bin/batch/knl_ctestP.sl.in.cmake b/bin/batch/knl_ctestP.sl.in.cmake
index 79dfb89..f985fbb 100644
--- a/bin/batch/knl_ctestP.sl.in.cmake
+++ b/bin/batch/knl_ctestP.sl.in.cmake
@@ -6,13 +6,11 @@
#SBATCH --mail-type=BEGIN,END,FAIL
##SBATCH --mail-user=<username>@sandia.gov
#SBATCH --export=ALL
-#SBATCH --job-name=h5_ctestS
+#SBATCH --job-name=h5_ctestP
cd @HDF5_BINARY_DIR@
#run parallel tests except t_cache_image test
-CMD="ctest . -R MPI_TEST_ -E t_cache_image -C Release -T test"
+ctest . -R MPI_TEST_ -C Release -T test >& ctestP.out
-echo "Run $CMD. Test output will be in build/ctestP.out"
-$CMD >& ctestP.out
echo "Done running $CMD"
diff --git a/bin/batch/ray_ctestP.lsf.in.cmake b/bin/batch/ray_ctestP.lsf.in.cmake
index 082276a..7067a65 100644
--- a/bin/batch/ray_ctestP.lsf.in.cmake
+++ b/bin/batch/ray_ctestP.lsf.in.cmake
@@ -15,6 +15,6 @@
cd @HDF5_BINARY_DIR@
echo "Run parallel test command. Test output will be in build/ctestP.out"
-ctest . -R 'MPI_TEST_' -E t_cache_image -C Release -T test >& ctestP.out
+ctest . -R 'MPI_TEST_' -C Release -T test >& ctestP.out
echo "Done running ctest parallel command."
diff --git a/bin/config.guess b/bin/config.guess
index 6c32c86..7f9ebbe 100755
--- a/bin/config.guess
+++ b/bin/config.guess
@@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2014 Free Software Foundation, Inc.
+# Copyright 1992-2019 Free Software Foundation, Inc.
-timestamp='2014-11-04'
+timestamp='2019-09-10'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2014-11-04'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -27,7 +27,7 @@ timestamp='2014-11-04'
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
#
# Please send patches to <config-patches@gnu.org>.
@@ -39,7 +39,7 @@ Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2014 Free Software Foundation, Inc.
+Copyright 1992-2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,8 +84,6 @@ if test $# != 0; then
exit 1
fi
-trap 'exit 1' 1 2 15
-
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,38 @@ trap 'exit 1' 1 2 15
# Portable tmp directory creation inspired by the Autoconf team.
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+ : "${TMPDIR=/tmp}"
+ # shellcheck disable=SC2039
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+ dummy=$tmp/dummy
+ case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+ ,,) echo "int x;" > "$dummy.c"
+ for driver in cc gcc c89 c99 ; do
+ if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$driver"
+ break
+ fi
+ done
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+ esac
+}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
@@ -132,14 +134,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "${UNAME_SYSTEM}" in
+case "$UNAME_SYSTEM" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
+ set_cc_for_build
+ cat <<-EOF > "$dummy.c"
#include <features.h>
#if defined(__UCLIBC__)
LIBC=uclibc
@@ -149,13 +151,20 @@ Linux|GNU|GNU/*)
LIBC=gnu
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+ # If ldd exists, use it to detect musl libc.
+ if command -v ldd >/dev/null && \
+ ldd --version 2>&1 | grep -q ^musl
+ then
+ LIBC=musl
+ fi
;;
esac
# Note: order is significant - the case branches are not exclusive.
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -168,21 +177,31 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+ "/sbin/$sysctl" 2>/dev/null || \
+ "/usr/sbin/$sysctl" 2>/dev/null || \
+ echo unknown)`
+ case "$UNAME_MACHINE_ARCH" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ earmv*)
+ arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine="${arch}${endian}"-unknown
+ ;;
+ *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
esac
# The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
+ # to ELF recently (or will in the future) and ABI.
+ case "$UNAME_MACHINE_ARCH" in
+ earm*)
+ os=netbsdelf
+ ;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
@@ -197,43 +216,72 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
os=netbsd
;;
esac
+ # Determine ABI tags.
+ case "$UNAME_MACHINE_ARCH" in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
+ ;;
+ esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
+ case "$UNAME_VERSION" in
Debian*)
release='-gnu'
;;
*)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
+ echo "$machine-${os}${release}${abi-}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
+ exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+ exit ;;
+ *:MidnightBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
exit ;;
*:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
exit ;;
*:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
+ exit ;;
+ *:OS108:*:*)
+ echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
exit ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
exit ;;
*:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
+ exit ;;
+ *:Sortix:*:*)
+ echo "$UNAME_MACHINE"-unknown-sortix
+ exit ;;
+ *:Twizzler:*:*)
+ echo "$UNAME_MACHINE"-unknown-twizzler
+ exit ;;
+ *:Redox:*:*)
+ echo "$UNAME_MACHINE"-unknown-redox
+ exit ;;
+ mips:OSF1:*.*)
+ echo mips-dec-osf1
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
@@ -251,63 +299,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
+ UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
+ UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
+ UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
+ UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
+ UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
+ UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
+ UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
+ UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
+ UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
+ echo "$UNAME_MACHINE"-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
+ echo "$UNAME_MACHINE"-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
@@ -319,7 +358,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
+ echo arm-acorn-riscix"$UNAME_RELEASE"
exit ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
@@ -346,38 +385,38 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
exit ;;
sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
+ echo i386-pc-auroraux"$UNAME_RELEASE"
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
+ set_cc_for_build
+ SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
- SUN_ARCH="x86_64"
+ SUN_ARCH=x86_64
fi
fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
@@ -386,25 +425,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
exit ;;
sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ echo m68k-sun-sunos"$UNAME_RELEASE"
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ echo m68k-sun-sunos"$UNAME_RELEASE"
;;
sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
+ echo sparc-sun-sunos"$UNAME_RELEASE"
;;
esac
exit ;;
aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
+ echo sparc-auspex-sunos"$UNAME_RELEASE"
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
@@ -415,44 +454,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
+ echo m68k-milan-mint"$UNAME_RELEASE"
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
+ echo m68k-hades-mint"$UNAME_RELEASE"
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
+ echo m68k-unknown-mint"$UNAME_RELEASE"
exit ;;
m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
+ echo m68k-apple-machten"$UNAME_RELEASE"
exit ;;
powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
+ echo powerpc-apple-machten"$UNAME_RELEASE"
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
+ echo mips-dec-ultrix"$UNAME_RELEASE"
exit ;;
VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
+ echo vax-dec-ultrix"$UNAME_RELEASE"
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
+ echo clipper-intergraph-clix"$UNAME_RELEASE"
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
@@ -461,23 +500,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
{ echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
+ echo mips-mips-riscos"$UNAME_RELEASE"
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
@@ -503,17 +542,17 @@ EOF
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
+ if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+ [ "$TARGET_BINARY_INTERFACE"x = x ]
then
- echo m88k-dg-dgux${UNAME_RELEASE}
+ echo m88k-dg-dgux"$UNAME_RELEASE"
else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ echo m88k-dg-dguxbcs"$UNAME_RELEASE"
fi
else
- echo i586-dg-dgux${UNAME_RELEASE}
+ echo i586-dg-dgux"$UNAME_RELEASE"
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
@@ -530,7 +569,7 @@ EOF
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
@@ -542,14 +581,14 @@ EOF
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h>
main()
@@ -560,7 +599,7 @@ EOF
exit(0);
}
EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
then
echo "$SYSTEM_NAME"
else
@@ -574,7 +613,7 @@ EOF
exit ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@@ -583,18 +622,18 @@ EOF
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
@@ -609,28 +648,28 @@ EOF
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ case "$UNAME_MACHINE" in
+ 9000/31?) HP_ARCH=m68000 ;;
+ 9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ case "$sc_cpu_version" in
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ case "$sc_kernel_bits" in
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ if [ "$HP_ARCH" = "" ]; then
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
#include <stdlib.h>
@@ -663,13 +702,13 @@ EOF
exit (0);
}
EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
+ if [ "$HP_ARCH" = hppa2.0w ]
then
- eval $set_cc_for_build
+ set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@@ -680,23 +719,23 @@ EOF
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
- HP_ARCH="hppa2.0w"
+ HP_ARCH=hppa2.0w
else
- HP_ARCH="hppa64"
+ HP_ARCH=hppa64
fi
fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
exit ;;
ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux"$HPUX_REV"
exit ;;
3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include <unistd.h>
int
main ()
@@ -721,11 +760,11 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
@@ -734,7 +773,7 @@ EOF
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
@@ -742,9 +781,9 @@ EOF
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
+ echo "$UNAME_MACHINE"-unknown-osf1mk
else
- echo ${UNAME_MACHINE}-unknown-osf1
+ echo "$UNAME_MACHINE"-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
@@ -769,127 +808,120 @@ EOF
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
exit ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
+ echo sparc-unknown-bsdi"$UNAME_RELEASE"
exit ;;
*:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+ exit ;;
+ arm:FreeBSD:*:*)
+ UNAME_PROCESSOR=`uname -p`
+ set_cc_for_build
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+ else
+ echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+ fi
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
+ case "$UNAME_PROCESSOR" in
amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=x86_64 ;;
+ i386)
+ UNAME_PROCESSOR=i586 ;;
esac
+ echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
exit ;;
i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
+ echo "$UNAME_MACHINE"-pc-cygwin
exit ;;
*:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
+ echo "$UNAME_MACHINE"-pc-mingw64
exit ;;
*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
+ echo "$UNAME_MACHINE"-pc-mingw32
exit ;;
*:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
+ echo "$UNAME_MACHINE"-pc-msys
exit ;;
i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
+ echo "$UNAME_MACHINE"-pc-pw32
exit ;;
*:Interix*:*)
- case ${UNAME_MACHINE} in
+ case "$UNAME_MACHINE" in
x86)
- echo i586-pc-interix${UNAME_RELEASE}
+ echo i586-pc-interix"$UNAME_RELEASE"
exit ;;
authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
+ echo x86_64-unknown-interix"$UNAME_RELEASE"
exit ;;
IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
+ echo ia64-unknown-interix"$UNAME_RELEASE"
exit ;;
esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
+ echo "$UNAME_MACHINE"-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
+ echo x86_64-pc-cygwin
exit ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
+ *:Minix:*:*)
+ echo "$UNAME_MACHINE"-unknown-minix
exit ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -902,129 +934,169 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arm*:Linux:*:*)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
exit ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+ exit ;;
+ e2k:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ k1om:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ IS_GLIBC=0
+ test x"${LIBC}" = xgnu && IS_GLIBC=1
+ sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
+ #undef mips
+ #undef mipsel
+ #undef mips64
+ #undef mips64el
+ #if ${IS_GLIBC} && defined(_ABI64)
+ LIBCABI=gnuabi64
+ #else
+ #if ${IS_GLIBC} && defined(_ABIN32)
+ LIBCABI=gnuabin32
+ #else
+ LIBCABI=${LIBC}
+ #endif
+ #endif
+
+ #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa64r6
+ #else
+ #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa32r6
+ #else
+ #if defined(__mips64)
+ CPU=mips64
+ #else
+ CPU=mips
+ #endif
+ #endif
+ #endif
+
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
+ MIPS_ENDIAN=el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
+ MIPS_ENDIAN=
#else
- CPU=
+ MIPS_ENDIAN=
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
+ test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
;;
+ mips64el:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
openrisc*:Linux:*:*)
- echo or1k-unknown-linux-${LIBC}
+ echo or1k-unknown-linux-"$LIBC"
exit ;;
or32:Linux:*:* | or1k*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
+ echo sparc-unknown-linux-"$LIBC"
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
+ echo hppa64-unknown-linux-"$LIBC"
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
+ PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+ PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+ *) echo hppa-unknown-linux-"$LIBC" ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
+ echo powerpc64-unknown-linux-"$LIBC"
exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
+ echo powerpc-unknown-linux-"$LIBC"
exit ;;
ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
+ echo powerpc64le-unknown-linux-"$LIBC"
exit ;;
ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
+ echo powerpcle-unknown-linux-"$LIBC"
+ exit ;;
+ riscv32:Linux:*:* | riscv64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
exit ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1038,34 +1110,34 @@ EOF
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
+ echo "$UNAME_MACHINE"-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
+ echo "$UNAME_MACHINE"-unknown-stop
exit ;;
i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
+ echo "$UNAME_MACHINE"-unknown-atheos
exit ;;
i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
+ echo "$UNAME_MACHINE"-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
+ echo i386-unknown-lynxos"$UNAME_RELEASE"
exit ;;
i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ echo "$UNAME_MACHINE"-pc-msdosdjgpp
exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ i*86:*:4.*:*)
+ UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
fi
exit ;;
i*86:*:5:[678]*)
@@ -1075,12 +1147,12 @@ EOF
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1090,9 +1162,9 @@ EOF
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
else
- echo ${UNAME_MACHINE}-pc-sysv32
+ echo "$UNAME_MACHINE"-pc-sysv32
fi
exit ;;
pc:*:*:*)
@@ -1100,7 +1172,7 @@ EOF
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
+ # prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
@@ -1112,9 +1184,9 @@ EOF
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
@@ -1134,9 +1206,9 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
@@ -1145,28 +1217,28 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
+ echo m68k-unknown-lynxos"$UNAME_RELEASE"
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
+ echo sparc-unknown-lynxos"$UNAME_RELEASE"
exit ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ echo rs6000-unknown-lynxos"$UNAME_RELEASE"
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ echo powerpc-unknown-lynxos"$UNAME_RELEASE"
exit ;;
SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
+ echo mips-dde-sysv"$UNAME_RELEASE"
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
@@ -1177,7 +1249,7 @@ EOF
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
+ echo "$UNAME_MACHINE"-sni-sysv4
else
echo ns32k-sni-sysv
fi
@@ -1197,23 +1269,23 @@ EOF
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
+ echo "$UNAME_MACHINE"-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
+ echo m68k-apple-aux"$UNAME_RELEASE"
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ echo mips-nec-sysv"$UNAME_RELEASE"
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv"$UNAME_RELEASE"
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
@@ -1232,77 +1304,94 @@ EOF
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
+ echo sx4-nec-superux"$UNAME_RELEASE"
exit ;;
SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
+ echo sx5-nec-superux"$UNAME_RELEASE"
exit ;;
SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
+ echo sx6-nec-superux"$UNAME_RELEASE"
exit ;;
SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
+ echo sx7-nec-superux"$UNAME_RELEASE"
exit ;;
SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
+ echo sx8-nec-superux"$UNAME_RELEASE"
exit ;;
SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
+ echo sx8r-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-ACE:SUPER-UX:*:*)
+ echo sxace-nec-superux"$UNAME_RELEASE"
exit ;;
Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ echo powerpc-apple-rhapsody"$UNAME_RELEASE"
exit ;;
*:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
exit ;;
*:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
+ UNAME_PROCESSOR=`uname -p`
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ if command -v xcode-select > /dev/null 2> /dev/null && \
+ ! xcode-select --print-path > /dev/null 2> /dev/null ; then
+ # Avoid executing cc if there is no toolchain installed as
+ # cc will be a stub that puts up a graphical alert
+ # prompting the user to install developer tools.
+ CC_FOR_BUILD=no_compiler_found
+ else
+ set_cc_for_build
fi
- if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
- # Avoid executing cc on OS X 10.9, as it ships with a stub
- # that puts up a graphical alert prompting to install
- # developer tools. Any system running Mac OS X 10.7 or
- # later (Darwin 11 and later) is required to have a 64-bit
- # processor. This is not true of the ARM version of Darwin
- # that Apple uses in portable devices.
- UNAME_PROCESSOR=x86_64
+ # uname -m returns i386 or x86_64
+ UNAME_PROCESSOR=$UNAME_MACHINE
fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
+ if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
+ NEO-*:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk"$UNAME_RELEASE"
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
+ echo nse-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSR-*:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSV-*:NONSTOP_KERNEL:*:*)
+ echo nsv-tandem-nsk"$UNAME_RELEASE"
exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
+ NSX-*:NONSTOP_KERNEL:*:*)
+ echo nsx-tandem-nsk"$UNAME_RELEASE"
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
@@ -1311,18 +1400,19 @@ EOF
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
- if test "$cputype" = "386"; then
+ # shellcheck disable=SC2154
+ if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
- echo ${UNAME_MACHINE}-unknown-plan9
+ echo "$UNAME_MACHINE"-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
@@ -1343,14 +1433,14 @@ EOF
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ echo mips-sei-seiux"$UNAME_RELEASE"
exit ;;
*:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
+ case "$UNAME_MACHINE" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
@@ -1359,34 +1449,188 @@ EOF
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
exit ;;
i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
+ echo "$UNAME_MACHINE"-pc-rdos
exit ;;
i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
+ echo "$UNAME_MACHINE"-pc-aros
exit ;;
x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
+ echo "$UNAME_MACHINE"-unknown-esx
exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
+ exit ;;
+ *:Unleashed:*:*)
+ echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
+ exit ;;
+esac
+
+# No uname command or uname output not recognized.
+set_cc_for_build
+cat > "$dummy.c" <<EOF
+#ifdef _SEQUENT_
+#include <sys/types.h>
+#include <sys/utsname.h>
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include <signal.h>
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include <sys/utsname.h>
+#endif
+#endif
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+#include <sys/param.h>
+#if defined (BSD)
+#if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname un;
+ uname (&un);
+ printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname *un;
+ uname (&un);
+ printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
+
+echo "$0: unable to guess system type" >&2
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+ mips:Linux | mips64:Linux)
+ # If we got here on MIPS GNU/Linux, output extra information.
+ cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+ ;;
esac
cat >&2 <<EOF
-$0: unable to guess system type
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+ https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+ https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
config.guess timestamp = $timestamp
@@ -1405,16 +1649,16 @@ hostinfo = `(hostinfo) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
EOF
exit 1
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/bin/config.sub b/bin/config.sub
index 7ffe373..0f2234c 100755
--- a/bin/config.sub
+++ b/bin/config.sub
@@ -1,8 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2014 Free Software Foundation, Inc.
+# Copyright 1992-2019 Free Software Foundation, Inc.
-timestamp='2014-12-03'
+timestamp='2019-06-30'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2014-12-03'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -33,7 +33,7 @@ timestamp='2014-12-03'
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -53,12 +53,11 @@ timestamp='2014-12-03'
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -68,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2014 Free Software Foundation, Inc.
+Copyright 1992-2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -90,12 +89,12 @@ while test $# -gt 0 ; do
- ) # Use stdin as input.
break ;;
-* )
- echo "$me: invalid option $1$help"
+ echo "$me: invalid option $1$help" >&2
exit 1 ;;
*local*)
# First pass through any local machine types.
- echo $1
+ echo "$1"
exit ;;
* )
@@ -111,1228 +110,1164 @@ case $# in
exit 1;;
esac
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
+# Split fields of configuration type
+# shellcheck disable=SC2162
+IFS="-" read field1 field2 field3 field4 <<EOF
+$1
+EOF
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
- ;;
- -lynx*)
- os=-lynxos
+# Separate into logical components for further validation
+case $1 in
+ *-*-*-*-*)
+ echo Invalid configuration \`"$1"\': more than four components >&2
+ exit 1
;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ *-*-*-*)
+ basic_machine=$field1-$field2
+ os=$field3-$field4
;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ *-*-*)
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+ # parts
+ maybe_os=$field2-$field3
+ case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
+ | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+ | storm-chaos* | os2-emx* | rtmk-nova*)
+ basic_machine=$field1
+ os=$maybe_os
+ ;;
+ android-linux)
+ basic_machine=$field1-unknown
+ os=linux-android
+ ;;
+ *)
+ basic_machine=$field1-$field2
+ os=$field3
+ ;;
+ esac
;;
- -psos*)
- os=-psos
+ *-*)
+ # A lone config we happen to match not fitting any pattern
+ case $field1-$field2 in
+ decstation-3100)
+ basic_machine=mips-dec
+ os=
+ ;;
+ *-*)
+ # Second component is usually, but not always the OS
+ case $field2 in
+ # Prevent following clause from handling this valid os
+ sun*os*)
+ basic_machine=$field1
+ os=$field2
+ ;;
+ # Manufacturers
+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+ | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+ | convergent* | ncr* | news | 32* | 3600* | 3100* \
+ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+ | ultra | tti* | harris | dolphin | highlevel | gould \
+ | cbm | ns | masscomp | apple | axis | knuth | cray \
+ | microblaze* | sim | cisco \
+ | oki | wec | wrs | winbond)
+ basic_machine=$field1-$field2
+ os=
+ ;;
+ *)
+ basic_machine=$field1
+ os=$field2
+ ;;
+ esac
+ ;;
+ esac
;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
+ *)
+ # Convert single-component short-hands not valid as part of
+ # multi-component configurations.
+ case $field1 in
+ 386bsd)
+ basic_machine=i386-pc
+ os=bsd
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=scout
+ ;;
+ alliant)
+ basic_machine=fx80-alliant
+ os=
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ os=
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=sysv
+ ;;
+ amiga)
+ basic_machine=m68k-unknown
+ os=
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=linux
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=bsd
+ ;;
+ cray)
+ basic_machine=j90-cray
+ os=unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ os=
+ ;;
+ da30)
+ basic_machine=m68k-da30
+ os=
+ ;;
+ decstation | pmax | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ os=
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=msdosdjgpp
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=ebmon
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=ose
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=go32
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=sysv3
+ ;;
+ hp300 | hp300hpux)
+ basic_machine=m68k-hp
+ os=hpux
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=bsd
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=proelf
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=mach
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=sysv
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ os=mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=mingw32ce
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=msdos
+ ;;
+ msys)
+ basic_machine=i686-pc
+ os=msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ os=nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-pc
+ os=netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=sysv
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=nonstopux
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=os68k
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=linux
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ os=rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=coff
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=udi
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ os=
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=sysv2
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ os=
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ os=
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=sunos4
+ ;;
+ sun3)
+ basic_machine=m68k-sun
+ os=
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=sunos4
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ os=
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=solaris2
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ os=
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=unicos
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=tops20
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=vms
+ ;;
+ vsta)
+ basic_machine=i386-pc
+ os=vsta
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=vxworks
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=mingw32
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=unicos
+ ;;
+ *)
+ basic_machine=$1
+ os=
+ ;;
+ esac
;;
esac
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | be32 | be64 \
- | bfin \
- | c4x | c8051 | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | epiphany \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | k1om \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa32r6 | mipsisa32r6el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64r6 | mipsisa64r6el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 | or1k | or1knd | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pyramid \
- | riscv32 | riscv64 \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | visium \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- leon|leon[3-9])
- basic_machine=sparc-$basic_machine
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
+ # Here we handle the default manufacturer of certain CPU types. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ cpu=hppa1.1
+ vendor=winbond
;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ op50n)
+ cpu=hppa1.1
+ vendor=oki
;;
- ms1)
- basic_machine=mt-unknown
+ op60c)
+ cpu=hppa1.1
+ vendor=oki
;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
+ ibm*)
+ cpu=i370
+ vendor=ibm
;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
+ orion105)
+ cpu=clipper
+ vendor=highlevel
;;
- xscaleeb)
- basic_machine=armeb-unknown
+ mac | mpw | mac-mpw)
+ cpu=m68k
+ vendor=apple
;;
-
- xscaleel)
- basic_machine=armel-unknown
+ pmac | pmac-mpw)
+ cpu=powerpc
+ vendor=apple
;;
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | c8051-* | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | k1om-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa32r6-* | mipsisa32r6el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64r6-* | mipsisa64r6el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | or1k*-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pyramid-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | visium-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
+ cpu=m68000
+ vendor=att
;;
3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
+ cpu=we32k
+ vendor=att
;;
bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
+ cpu=powerpc
+ vendor=ibm
+ os=cnk
;;
decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
+ cpu=pdp10
+ vendor=dec
+ os=tops10
;;
decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
+ cpu=pdp10
+ vendor=dec
+ os=tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
+ cpu=m68k
+ vendor=motorola
;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
+ dpx2*)
+ cpu=m68k
+ vendor=bull
+ os=sysv3
;;
encore | umax | mmax)
- basic_machine=ns32k-encore
+ cpu=ns32k
+ vendor=encore
;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
+ elxsi)
+ cpu=elxsi
+ vendor=elxsi
+ os=${os:-bsd}
;;
fx2800)
- basic_machine=i860-alliant
+ cpu=i860
+ vendor=alliant
;;
genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
+ cpu=ns32k
+ vendor=ns
;;
h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
+ cpu=hppa1.1
+ vendor=hitachi
+ os=hiuxwe2
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
+ cpu=m68000
+ vendor=hp
;;
hp9k3[2-9][0-9])
- basic_machine=m68k-hp
+ cpu=m68k
+ vendor=hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
+ cpu=hppa1.0
+ vendor=hp
;;
i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ os=sysv32
;;
i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ os=sysv4
;;
i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ os=sysv
;;
i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ os=solaris2
;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
+ j90 | j90-cray)
+ cpu=j90
+ vendor=cray
+ os=${os:-unicos}
;;
iris | iris4d)
- basic_machine=mips-sgi
+ cpu=mips
+ vendor=sgi
case $os in
- -irix*)
+ irix*)
;;
*)
- os=-irix4
+ os=irix4
;;
esac
;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- leon-*|leon[3-9]-*)
- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- moxiebox)
- basic_machine=moxie-unknown
- os=-moxiebox
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i686-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
+ cpu=m68000
+ vendor=convergent
;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ cpu=m68k
+ vendor=atari
+ os=mint
;;
news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
+ cpu=mips
+ vendor=sony
+ os=newsos
;;
- next | m*-next )
- basic_machine=m68k-next
+ next | m*-next)
+ cpu=m68k
+ vendor=next
case $os in
- -nextstep* )
+ openstep*)
+ ;;
+ nextstep*)
;;
- -ns2*)
- os=-nextstep2
+ ns2*)
+ os=nextstep2
;;
*)
- os=-nextstep3
+ os=nextstep3
;;
esac
;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
+ cpu=np1
+ vendor=gould
;;
op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
+ cpu=hppa1.1
+ vendor=oki
+ os=proelf
;;
pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
+ cpu=hppa1.1
+ vendor=hitachi
+ os=hiuxwe2
;;
pbd)
- basic_machine=sparc-tti
+ cpu=sparc
+ vendor=tti
;;
pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
+ cpu=m68k
+ vendor=tti
;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ pc532)
+ cpu=ns32k
+ vendor=pc532
;;
pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
+ cpu=pn
+ vendor=gould
;;
- ppc | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ power)
+ cpu=power
+ vendor=ibm
;;
ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
+ cpu=i386
+ vendor=ibm
;;
rm[46]00)
- basic_machine=mips-siemens
+ cpu=mips
+ vendor=siemens
;;
rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
+ cpu=romp
+ vendor=ibm
;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
+ sde)
+ cpu=mipsisa32
+ vendor=sde
+ os=${os:-elf}
;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
+ simso-wrs)
+ cpu=sparclite
+ vendor=wrs
+ os=vxworks
;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
+ tower | tower-32)
+ cpu=m68k
+ vendor=ncr
;;
- sei)
- basic_machine=mips-sei
- os=-seiux
+ vpp*|vx|vx-*)
+ cpu=f301
+ vendor=fujitsu
;;
- sequent)
- basic_machine=i386-sequent
+ w65)
+ cpu=w65
+ vendor=wdc
;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
+ w89k-*)
+ cpu=hppa1.1
+ vendor=winbond
+ os=proelf
;;
- sh5el)
- basic_machine=sh5le-unknown
+ none)
+ cpu=none
+ vendor=none
;;
- sh64)
- basic_machine=sh64-unknown
+ leon|leon[3-9])
+ cpu=sparc
+ vendor=$basic_machine
;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
+ leon-*|leon[3-9]-*)
+ cpu=sparc
+ vendor=`echo "$basic_machine" | sed 's/-.*//'`
;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
+
+ *-*)
+ # shellcheck disable=SC2162
+ IFS="-" read cpu vendor <<EOF
+$basic_machine
+EOF
;;
- spur)
- basic_machine=spur-unknown
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ cpu=$basic_machine
+ vendor=pc
;;
- st2000)
- basic_machine=m68k-tandem
+ # These rules are duplicated from below for sake of the special case above;
+ # i.e. things that normalized to x86 arches should also default to "pc"
+ pc98)
+ cpu=i386
+ vendor=pc
;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
+ x64 | amd64)
+ cpu=x86_64
+ vendor=pc
;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ # Recognize the basic CPU types without company name.
+ *)
+ cpu=$basic_machine
+ vendor=unknown
;;
- sun2)
- basic_machine=m68000-sun
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+ # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ craynv-unknown)
+ vendor=cray
+ os=${os:-unicosmp}
;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
+ c90-unknown | c90-cray)
+ vendor=cray
+ os=${os:-unicos}
;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
+ fx80-unknown)
+ vendor=alliant
;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
+ romp-unknown)
+ vendor=ibm
;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
+ mmix-unknown)
+ vendor=knuth
;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
+ microblaze-unknown | microblazeel-unknown)
+ vendor=xilinx
;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
+ rs6000-unknown)
+ vendor=ibm
;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
+ vax-unknown)
+ vendor=dec
;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
+ pdp11-unknown)
+ vendor=dec
;;
- sun4)
- basic_machine=sparc-sun
+ we32k-unknown)
+ vendor=att
;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
+ cydra-unknown)
+ vendor=cydrome
;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
+ i370-ibm*)
+ vendor=ibm
;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
+ orion-unknown)
+ vendor=highlevel
;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
+ xps-unknown | xps100-unknown)
+ cpu=xps100
+ vendor=honeywell
;;
- t90)
- basic_machine=t90-cray
- os=-unicos
+
+ # Here we normalize CPU types with a missing or matching vendor
+ dpx20-unknown | dpx20-bull)
+ cpu=rs6000
+ vendor=bull
+ os=${os:-bosx}
;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
+
+ # Here we normalize CPU types irrespective of the vendor
+ amd64-*)
+ cpu=x86_64
;;
- tx39)
- basic_machine=mipstx39-unknown
+ blackfin-*)
+ cpu=bfin
+ os=linux
;;
- tx39el)
- basic_machine=mipstx39el-unknown
+ c54x-*)
+ cpu=tic54x
;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
+ c55x-*)
+ cpu=tic55x
;;
- tower | tower-32)
- basic_machine=m68k-ncr
+ c6x-*)
+ cpu=tic6x
;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
+ e500v[12]-*)
+ cpu=powerpc
+ os=$os"spe"
;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
+ mips3*-*)
+ cpu=mips64
;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
+ ms1-*)
+ cpu=mt
;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
+ m68knommu-*)
+ cpu=m68k
+ os=linux
;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
+ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+ cpu=s12z
;;
- vms)
- basic_machine=vax-dec
- os=-vms
+ openrisc-*)
+ cpu=or32
;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
+ parisc-*)
+ cpu=hppa
+ os=linux
;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ cpu=i586
;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
+ pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+ cpu=i686
;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ cpu=i686
;;
- w65*)
- basic_machine=w65-wdc
- os=-none
+ pentium4-*)
+ cpu=i786
;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
+ pc98-*)
+ cpu=i386
;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
+ ppc-* | ppcbe-*)
+ cpu=powerpc
;;
- xps | xps100)
- basic_machine=xps100-honeywell
+ ppcle-* | powerpclittle-*)
+ cpu=powerpcle
;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ppc64-*)
+ cpu=powerpc64
;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
+ ppc64le-* | powerpc64little-*)
+ cpu=powerpc64le
;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
+ sb1-*)
+ cpu=mipsisa64sb1
;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
+ sb1el-*)
+ cpu=mipsisa64sb1el
;;
- none)
- basic_machine=none-none
- os=-none
+ sh5e[lb]-*)
+ cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
+ spur-*)
+ cpu=spur
;;
- op50n)
- basic_machine=hppa1.1-oki
+ strongarm-* | thumb-*)
+ cpu=arm
;;
- op60c)
- basic_machine=hppa1.1-oki
+ tx39-*)
+ cpu=mipstx39
;;
- romp)
- basic_machine=romp-ibm
+ tx39el-*)
+ cpu=mipstx39el
;;
- mmix)
- basic_machine=mmix-knuth
+ x64-*)
+ cpu=x86_64
;;
- rs6000)
- basic_machine=rs6000-ibm
+ xscale-* | xscalee[bl]-*)
+ cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;;
- vax)
- basic_machine=vax-dec
+
+ # Recognize the canonical CPU Types that limit and/or modify the
+ # company names they are paired with.
+ cr16-*)
+ os=${os:-elf}
;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
+ crisv32-* | etraxfs*-*)
+ cpu=crisv32
+ vendor=axis
;;
- pdp11)
- basic_machine=pdp11-dec
+ cris-* | etrax*-*)
+ cpu=cris
+ vendor=axis
;;
- we32k)
- basic_machine=we32k-att
+ crx-*)
+ os=${os:-elf}
;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
+ neo-tandem)
+ cpu=neo
+ vendor=tandem
;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
+ nse-tandem)
+ cpu=nse
+ vendor=tandem
;;
- cydra)
- basic_machine=cydra-cydrome
+ nsr-tandem)
+ cpu=nsr
+ vendor=tandem
;;
- orion)
- basic_machine=orion-highlevel
+ nsv-tandem)
+ cpu=nsv
+ vendor=tandem
;;
- orion105)
- basic_machine=clipper-highlevel
+ nsx-tandem)
+ cpu=nsx
+ vendor=tandem
;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
+ s390-*)
+ cpu=s390
+ vendor=ibm
;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
+ s390x-*)
+ cpu=s390x
+ vendor=ibm
;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
+ tile*-*)
+ os=${os:-linux-gnu}
;;
+
*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
+ # Recognize the canonical CPU types that are allowed with any
+ # company name.
+ case $cpu in
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | abacus \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+ | alphapca5[67] | alpha64pca5[67] \
+ | am33_2.0 \
+ | amdgcn \
+ | arc | arceb \
+ | arm | arm[lb]e | arme[lb] | armv* \
+ | avr | avr32 \
+ | asmjs \
+ | ba \
+ | be32 | be64 \
+ | bfin | bpf | bs2000 \
+ | c[123]* | c30 | [cjt]90 | c4x \
+ | c8051 | clipper | craynv | csky | cydra \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | elxsi | epiphany \
+ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+ | h8300 | h8500 \
+ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle \
+ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+ | m88110 | m88k | maxq | mb | mcore | mep | metag \
+ | microblaze | microblazeel \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64eb | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mmix \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nfp \
+ | nios | nios2 | nios2eb | nios2el \
+ | none | np1 | ns16k | ns32k | nvptx \
+ | open8 \
+ | or1k* \
+ | or32 \
+ | orion \
+ | picochip \
+ | pdp10 | pdp11 | pj | pjl | pn | power \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+ | pru \
+ | pyramid \
+ | riscv | riscv32 | riscv64 \
+ | rl78 | romp | rs6000 | rx \
+ | score \
+ | sh | shl \
+ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+ | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+ | spu \
+ | tahoe \
+ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+ | tron \
+ | ubicom32 \
+ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+ | vax \
+ | visium \
+ | w65 \
+ | wasm32 | wasm64 \
+ | we32k \
+ | x86 | x86_64 | xc16x | xgate | xps100 \
+ | xstormy16 | xtensa* \
+ | ymp \
+ | z8k | z80)
+ ;;
+
+ *)
+ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+ exit 1
+ ;;
+ esac
;;
esac
# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+ digital*)
+ vendor=dec
;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ commodore*)
+ vendor=cbm
;;
*)
;;
@@ -1340,197 +1275,244 @@ esac
# Decode manufacturer-specific aliases for certain operating systems.
-if [ x"$os" != x"" ]
+if [ x$os != x ]
then
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
+ # First match some system type aliases that might get confused
+ # with valid system types.
+ # solaris* is a basic system type, with this one exception.
+ auroraux)
+ os=auroraux
;;
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ bluegene*)
+ os=cnk
;;
- -solaris)
- os=-solaris2
+ solaris1 | solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
- -svr4*)
- os=-sysv4
+ solaris)
+ os=solaris2
;;
- -unixware*)
- os=-sysv4.2uw
+ unixware*)
+ os=sysv4.2uw
;;
- -gnu/linux*)
+ gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
- # First accept the basic system types.
+ # es1800 is here to avoid being matched by es* (a different OS)
+ es1800*)
+ os=ose
+ ;;
+ # Some version numbers need modification
+ chorusos*)
+ os=chorusos
+ ;;
+ isc)
+ os=isc2.2
+ ;;
+ sco6)
+ os=sco5v6
+ ;;
+ sco5)
+ os=sco3.2v5
+ ;;
+ sco4)
+ os=sco3.2v4
+ ;;
+ sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ ;;
+ sco3.2v[4-9]* | sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ ;;
+ scout)
+ # Don't match below
+ ;;
+ sco*)
+ os=sco3.2v2
+ ;;
+ psos*)
+ os=psos
+ ;;
+ # Now accept the basic system types.
# The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
+ # Each alternative MUST end in a * to match a version number.
+ # sysv* is not here because it comes later, after sysvr4.
+ gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
+ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+ | sym* | kopensolaris* | plan9* \
+ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+ | aos* | aros* | cloudabi* | sortix* | twizzler* \
+ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+ | knetbsd* | mirbsd* | netbsd* \
+ | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
+ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
+ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+ | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
+ | chorusrdb* | cegcc* | glidix* \
+ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+ | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
+ | linux-newlib* | linux-musl* | linux-uclibc* \
+ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+ | interix* | uwin* | mks* | rhapsody* | darwin* \
+ | openstep* | oskit* | conix* | pw32* | nonstopux* \
+ | storm-chaos* | tops10* | tenex* | tops20* | its* \
+ | os2* | vos* | palmos* | uclinux* | nucleus* \
+ | morphos* | superux* | rtmk* | windiss* \
+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+ | nsk* | powerunix)
# Remember, each alternative MUST END IN *, to match a version number.
;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
+ qnx*)
+ case $cpu in
+ x86 | i*86)
;;
*)
- os=-nto$os
+ os=nto-$os
;;
esac
;;
- -nto-qnx*)
+ hiux*)
+ os=hiuxwe2
;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ nto-qnx*)
;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
+ sim | xray | os68k* | v88r* \
+ | windows* | osx | abug | netware* | os9* \
+ | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
;;
- -linux-dietlibc)
- os=-linux-dietlibc
+ linux-dietlibc)
+ os=linux-dietlibc
;;
- -linux*)
+ linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ lynx*178)
+ os=lynxos178
+ ;;
+ lynx*5)
+ os=lynxos5
;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ lynx*)
+ os=lynxos
;;
- -opened*)
- os=-openedition
+ mac*)
+ os=`echo "$os" | sed -e 's|mac|macos|'`
;;
- -os400*)
- os=-os400
+ opened*)
+ os=openedition
;;
- -wince*)
- os=-wince
+ os400*)
+ os=os400
;;
- -osfrose*)
- os=-osfrose
+ sunos5*)
+ os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
;;
- -osf*)
- os=-osf
+ sunos6*)
+ os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
;;
- -utek*)
- os=-bsd
+ wince*)
+ os=wince
;;
- -dynix*)
- os=-bsd
+ utek*)
+ os=bsd
;;
- -acis*)
- os=-aos
+ dynix*)
+ os=bsd
;;
- -atheos*)
- os=-atheos
+ acis*)
+ os=aos
;;
- -syllable*)
- os=-syllable
+ atheos*)
+ os=atheos
;;
- -386bsd)
- os=-bsd
+ syllable*)
+ os=syllable
;;
- -ctix* | -uts*)
- os=-sysv
+ 386bsd)
+ os=bsd
;;
- -nova*)
- os=-rtmk-nova
+ ctix* | uts*)
+ os=sysv
;;
- -ns2 )
- os=-nextstep2
+ nova*)
+ os=rtmk-nova
;;
- -nsk*)
- os=-nsk
+ ns2)
+ os=nextstep2
;;
# Preserve the version number of sinix5.
- -sinix5.*)
+ sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
- -sinix*)
- os=-sysv4
+ sinix*)
+ os=sysv4
;;
- -tpf*)
- os=-tpf
+ tpf*)
+ os=tpf
;;
- -triton*)
- os=-sysv3
+ triton*)
+ os=sysv3
;;
- -oss*)
- os=-sysv3
+ oss*)
+ os=sysv3
;;
- -svr4)
- os=-sysv4
+ svr4*)
+ os=sysv4
;;
- -svr3)
- os=-sysv3
+ svr3)
+ os=sysv3
;;
- -sysvr4)
- os=-sysv4
+ sysvr4)
+ os=sysv4
;;
- # This must come after -sysvr4.
- -sysv*)
+ # This must come after sysvr4.
+ sysv*)
;;
- -ose*)
- os=-ose
+ ose*)
+ os=ose
;;
- -es1800*)
- os=-ose
+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+ os=mint
;;
- -xenix)
- os=-xenix
+ zvmoe)
+ os=zvmoe
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
+ dicos*)
+ os=dicos
;;
- -aros*)
- os=-aros
+ pikeos*)
+ # Until real need of OS specific support for
+ # particular features comes up, bare metal
+ # configurations are quite functional.
+ case $cpu in
+ arm*)
+ os=eabi
+ ;;
+ *)
+ os=elf
+ ;;
+ esac
;;
- -zvmoe)
- os=-zvmoe
+ nacl*)
;;
- -dicos*)
- os=-dicos
+ ios)
;;
- -nacl*)
+ none)
;;
- -none)
+ *-eabi)
;;
*)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
exit 1
;;
esac
@@ -1546,261 +1528,265 @@ else
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
-case $basic_machine in
+case $cpu-$vendor in
score-*)
- os=-elf
+ os=elf
;;
spu-*)
- os=-elf
+ os=elf
;;
*-acorn)
- os=-riscix1.2
+ os=riscix1.2
;;
arm*-rebel)
- os=-linux
+ os=linux
;;
arm*-semi)
- os=-aout
+ os=aout
;;
c4x-* | tic4x-*)
- os=-coff
+ os=coff
;;
c8051-*)
- os=-elf
+ os=elf
+ ;;
+ clipper-intergraph)
+ os=clix
;;
hexagon-*)
- os=-elf
+ os=elf
;;
tic54x-*)
- os=-coff
+ os=coff
;;
tic55x-*)
- os=-coff
+ os=coff
;;
tic6x-*)
- os=-coff
+ os=coff
;;
# This must come before the *-dec entry.
pdp10-*)
- os=-tops20
+ os=tops20
;;
pdp11-*)
- os=-none
+ os=none
;;
*-dec | vax-*)
- os=-ultrix4.2
+ os=ultrix4.2
;;
m68*-apollo)
- os=-domain
+ os=domain
;;
i386-sun)
- os=-sunos4.0.2
+ os=sunos4.0.2
;;
m68000-sun)
- os=-sunos3
+ os=sunos3
;;
m68*-cisco)
- os=-aout
+ os=aout
;;
mep-*)
- os=-elf
+ os=elf
;;
mips*-cisco)
- os=-elf
+ os=elf
;;
mips*-*)
- os=-elf
+ os=elf
;;
or32-*)
- os=-coff
+ os=coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
+ os=sysv3
;;
sparc-* | *-sun)
- os=-sunos4.1.1
+ os=sunos4.1.1
;;
- *-be)
- os=-beos
+ pru-*)
+ os=elf
;;
- *-haiku)
- os=-haiku
+ *-be)
+ os=beos
;;
*-ibm)
- os=-aix
+ os=aix
;;
*-knuth)
- os=-mmixware
+ os=mmixware
;;
*-wec)
- os=-proelf
+ os=proelf
;;
*-winbond)
- os=-proelf
+ os=proelf
;;
*-oki)
- os=-proelf
+ os=proelf
;;
*-hp)
- os=-hpux
+ os=hpux
;;
*-hitachi)
- os=-hiux
+ os=hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
+ os=sysv
;;
*-cbm)
- os=-amigaos
+ os=amigaos
;;
*-dg)
- os=-dgux
+ os=dgux
;;
*-dolphin)
- os=-sysv3
+ os=sysv3
;;
m68k-ccur)
- os=-rtu
+ os=rtu
;;
m88k-omron*)
- os=-luna
+ os=luna
;;
- *-next )
- os=-nextstep
+ *-next)
+ os=nextstep
;;
*-sequent)
- os=-ptx
+ os=ptx
;;
*-crds)
- os=-unos
+ os=unos
;;
*-ns)
- os=-genix
+ os=genix
;;
i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
+ os=mvs
;;
*-gould)
- os=-sysv
+ os=sysv
;;
*-highlevel)
- os=-bsd
+ os=bsd
;;
*-encore)
- os=-bsd
+ os=bsd
;;
*-sgi)
- os=-irix
+ os=irix
;;
*-siemens)
- os=-sysv4
+ os=sysv4
;;
*-masscomp)
- os=-rtu
+ os=rtu
;;
f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
+ os=uxpv
;;
*-rom68k)
- os=-coff
+ os=coff
;;
*-*bug)
- os=-coff
+ os=coff
;;
*-apple)
- os=-macos
+ os=macos
;;
*-atari*)
- os=-mint
+ os=mint
+ ;;
+ *-wrs)
+ os=vxworks
;;
*)
- os=-none
+ os=none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
+case $vendor in
+ unknown)
case $os in
- -riscix*)
+ riscix*)
vendor=acorn
;;
- -sunos*)
+ sunos*)
vendor=sun
;;
- -cnk*|-aix*)
+ cnk*|-aix*)
vendor=ibm
;;
- -beos*)
+ beos*)
vendor=be
;;
- -hpux*)
+ hpux*)
vendor=hp
;;
- -mpeix*)
+ mpeix*)
vendor=hp
;;
- -hiux*)
+ hiux*)
vendor=hitachi
;;
- -unos*)
+ unos*)
vendor=crds
;;
- -dgux*)
+ dgux*)
vendor=dg
;;
- -luna*)
+ luna*)
vendor=omron
;;
- -genix*)
+ genix*)
vendor=ns
;;
- -mvs* | -opened*)
+ clix*)
+ vendor=intergraph
+ ;;
+ mvs* | opened*)
vendor=ibm
;;
- -os400*)
+ os400*)
vendor=ibm
;;
- -ptx*)
+ ptx*)
vendor=sequent
;;
- -tpf*)
+ tpf*)
vendor=ibm
;;
- -vxsim* | -vxworks* | -windiss*)
+ vxsim* | vxworks* | windiss*)
vendor=wrs
;;
- -aux*)
+ aux*)
vendor=apple
;;
- -hms*)
+ hms*)
vendor=hitachi
;;
- -mpw* | -macos*)
+ mpw* | macos*)
vendor=apple
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
vendor=atari
;;
- -vos*)
+ vos*)
vendor=stratus
;;
esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
-echo $basic_machine$os
+echo "$cpu-$vendor-$os"
exit
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/bin/genparser b/bin/genparser
index 8cf6ec2..e6aee5b 100755
--- a/bin/genparser
+++ b/bin/genparser
@@ -218,7 +218,7 @@ perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' ${path_to_hl_src}/H5
# will simply ignore them, but we want to avoid those warnings.
for f in ${path_to_hl_src}/H5LTparse.c ${path_to_hl_src}/H5LTanalyze.c
do
- echo '#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 ' >> tmp.out
+ echo '#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wconversion" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wlarger-than=" ' >> tmp.out
diff --git a/tools/src/misc/h5cc.in b/bin/h5cc.in
index 9c4e3ca..9c4e3ca 100644
--- a/tools/src/misc/h5cc.in
+++ b/bin/h5cc.in
diff --git a/tools/src/misc/h5redeploy.in b/bin/h5redeploy.in
index 242459a..242459a 100644
--- a/tools/src/misc/h5redeploy.in
+++ b/bin/h5redeploy.in
diff --git a/bin/make_err b/bin/make_err
index bfe8861..a6461d4 100755
--- a/bin/make_err
+++ b/bin/make_err
@@ -244,7 +244,7 @@ sub create_init ($) {
print HEADER "/* Major error codes */\n";
print HEADER "/*********************/\n\n";
foreach $name (keys %major) {
- print HEADER " "x(0*$indent),"assert(${name}_g==(-1));\n";
+ print HEADER " "x(0*$indent),"HDassert(${name}_g==(-1));\n";
print HEADER " "x(0*$indent),"if((msg = H5E_create_msg(cls, H5E_MAJOR, \"${major{$name}}\"))==NULL)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\")\n";
print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)\n";
@@ -260,7 +260,7 @@ sub create_init ($) {
# Iterate over all the minor errors in each section
for $name ( @{$section_list{$sect_name}}) {
- print HEADER " "x(0*$indent),"assert(${name}_g==(-1));\n";
+ print HEADER " "x(0*$indent),"HDassert(${name}_g==(-1));\n";
print HEADER " "x(0*$indent),"if((msg = H5E_create_msg(cls, H5E_MINOR, \"${minor{$name}}\"))==NULL)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\")\n";
print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)\n";
diff --git a/bin/snapshot b/bin/snapshot
index 5c78fc8..bde68a5 100755
--- a/bin/snapshot
+++ b/bin/snapshot
@@ -130,9 +130,9 @@ DISPLAYUSAGE()
set -
cat <<EOF
Usage: $PROGNAME [all] [checkout] [ftp <URL> [diff] [test] [srcdir] [release] [help]
- [clean] [distclean] [echo] [deploy <dir>] [deploydir <dir>]
- [zlib <zlib_path>] [releasedir <dir>] [srcdirname <dir>] [check-vfd]
- [exec <command>] [module-load <module-list>] [op-configure <option>]
+ [clean] [distclean] [echo] [deploy <dir>] [deploydir <dir>]
+ [zlib <zlib_path>] [releasedir <dir>] [srcdirname <dir>] [check-vfd]
+ [exec <command>] [module-load <module-list>] [op-configure <option>]
[--<option>]
all: Run all commands (checkout, test & release)
[Default is all]
@@ -149,8 +149,8 @@ Usage: $PROGNAME [all] [checkout] [ftp <URL> [diff] [test] [srcdir] [release] [h
setenv <name> <value>:
Set environment variable <name> to <value>.
setenvN <N> <name> <value> ...:
- Set environment variable with <N> values.
- E.g., setenvN 3 x a b c is same as setenv x="a b c".
+ Set environment variable with <N> values.
+ E.g., setenvN 3 x a b c is same as setenv x="a b c".
srcdir: Use srcdir option (does not imply other commands)
"snapshot srcdir" is equivalent to "snapshot srcdir all"
"snapshot srcdir checkout" is equivalent to "snapshot checkout"
@@ -168,7 +168,7 @@ Usage: $PROGNAME [all] [checkout] [ftp <URL> [diff] [test] [srcdir] [release] [h
Use <dir> as the release directory
[Default is $ReleaseDir_default]
check-vfd:
- Run make check-vfd instead of just make check.
+ Run make check-vfd instead of just make check.
exttest <testscript>;
Run testscript;
exec <command>:
diff --git a/bin/trace b/bin/trace
index cf41238..d9a2e3b 100755
--- a/bin/trace
+++ b/bin/trace
@@ -120,6 +120,8 @@ $Source = "";
"H5FD_t" => "x",
"H5FD_class_t" => "x",
"H5FD_stream_fapl_t" => "x",
+ "H5FD_ros3_fapl_t" => "x",
+ "H5FD_hdfs_fapl_t" => "x",
"H5FD_file_image_callbacks_t" => "x",
"H5G_iterate_t" => "x",
"H5G_info_t" => "x",
diff --git a/c++/Makefile.am b/c++/Makefile.am
index 94fbefc..92d9f50 100644
--- a/c++/Makefile.am
+++ b/c++/Makefile.am
@@ -18,9 +18,15 @@
include $(top_srcdir)/config/commence.am
+if BUILD_TESTS_CONDITIONAL
+ TEST_DIR = test
+else
+ TEST_DIR=
+endif
+
## Only recurse into subdirectories if C++ interface is enabled.
if BUILD_CXX_CONDITIONAL
- SUBDIRS=src test
+ SUBDIRS=src $(TEST_DIR)
endif
DIST_SUBDIRS = src test examples
diff --git a/c++/Makefile.in b/c++/Makefile.in
index 8a1c5d0b..d60e983 100644
--- a/c++/Makefile.in
+++ b/c++/Makefile.in
@@ -484,7 +484,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -507,9 +506,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -536,6 +538,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -590,6 +593,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -614,7 +618,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -731,7 +734,9 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-@BUILD_CXX_CONDITIONAL_TRUE@SUBDIRS = src test
+@BUILD_TESTS_CONDITIONAL_FALSE@TEST_DIR =
+@BUILD_TESTS_CONDITIONAL_TRUE@TEST_DIR = test
+@BUILD_CXX_CONDITIONAL_TRUE@SUBDIRS = src $(TEST_DIR)
DIST_SUBDIRS = src test examples
# Automake needs to be taught how to build lib, progs and tests targets.
@@ -1281,7 +1286,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt
index d3a18f2..58d85c1 100644
--- a/c++/examples/CMakeLists.txt
+++ b/c++/examples/CMakeLists.txt
@@ -34,17 +34,37 @@ set (tutr_examples
foreach (example ${examples})
add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp)
- target_include_directories(cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (cpp_ex_${example} STATIC)
- target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
+ target_include_directories (cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (cpp_ex_${example} STATIC)
+ target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (cpp_ex_${example} SHARED)
+ target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ if (MINGW)
+ target_link_options (${HDF5_CPP_LIBSH_TARGET}
+ PRIVATE -static-libgcc -static-libstdc++
+ )
+ endif ()
+ endif ()
set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
endforeach ()
foreach (example ${tutr_examples})
add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp)
- target_include_directories(cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (cpp_ex_${example} STATIC)
- target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
+ target_include_directories (cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (cpp_ex_${example} STATIC)
+ target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (cpp_ex_${example} SHARED)
+ target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ if (MINGW)
+ target_link_options (${HDF5_CPP_LIBSH_TARGET}
+ PRIVATE -static-libgcc -static-libstdc++
+ )
+ endif ()
+ endif ()
set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
endforeach ()
diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake
index bd1f95b..bbe3433 100644
--- a/c++/examples/CMakeTests.cmake
+++ b/c++/examples/CMakeTests.cmake
@@ -16,81 +16,79 @@
##############################################################################
##############################################################################
# Remove any output file left over from previous test run
- add_test (
- NAME CPP_ex-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- Group.h5
- SDS.h5
- SDScompound.h5
- SDSextendible.h5
- Select.h5
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (CPP_ex-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "CPP_ex-clear-objects")
+add_test (
+ NAME CPP_ex-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ Group.h5
+ SDS.h5
+ SDScompound.h5
+ SDSextendible.h5
+ Select.h5
+)
+set_tests_properties (CPP_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_cppex)
- foreach (example ${examples})
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME CPP_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>)
- else ()
- add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:cpp_ex_${example}>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=cpp_ex_${example}.txt"
- #-D "TEST_REFERENCE=cpp_ex_${example}.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "CPP_ex_${example}")
- endforeach ()
+foreach (example ${examples})
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME CPP_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cpp_ex_${example}>)
+ else ()
+ add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:cpp_ex_${example}>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=cpp_ex_${example}.txt"
+ #-D "TEST_REFERENCE=cpp_ex_${example}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+ set_tests_properties (CPP_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_cppex)
+ if (last_test)
+ set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test})
+ endif ()
+ set (last_test "CPP_ex_${example}")
+endforeach ()
#the following dependencies are handled by the order of the files
# SET_TESTS_PROPERTIES(CPP_ex_readdata PROPERTIES DEPENDS CPP_ex_create)
# SET_TESTS_PROPERTIES(CPP_ex_chunks PROPERTIES DEPENDS CPP_ex_extend_ds)
- add_test (
- NAME CPP_ex_tutr-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- h5tutr_cmprss.h5
- h5tutr_dset.h5
- h5tutr_extend.h5
- h5tutr_group.h5
- h5tutr_groups.h5
- h5tutr_subset.h5
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (CPP_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "CPP_ex_tutr-clear-objects")
+add_test (
+ NAME CPP_ex_tutr-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ h5tutr_cmprss.h5
+ h5tutr_dset.h5
+ h5tutr_extend.h5
+ h5tutr_group.h5
+ h5tutr_groups.h5
+ h5tutr_subset.h5
+)
+set_tests_properties (CPP_ex_tutr-clear-objects PROPERTIES FIXTURES_SETUP clear_cppex_tutr)
- foreach (example ${tutr_examples})
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME CPP_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>)
- else ()
- add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:cpp_ex_${example}>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=cpp_ex_${example}.txt"
- #-D "TEST_REFERENCE=cpp_ex_${example}.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "CPP_ex_${example}")
- endforeach ()
+foreach (example ${tutr_examples})
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME CPP_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cpp_ex_${example}>)
+ else ()
+ add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:cpp_ex_${example}>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=cpp_ex_${example}.txt"
+ #-D "TEST_REFERENCE=cpp_ex_${example}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+ set_tests_properties (CPP_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_cppex_tutr)
+ if (last_test)
+ set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test})
+ endif ()
+ set (last_test "CPP_ex_${example}")
+endforeach ()
#the following dependencies are handled by the order of the files
# SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtatt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat)
# SET_TESTS_PROPERTIES(CPP_ex_h5tutr_rdwt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat)
diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in
index 16b8857..f88726f 100644
--- a/c++/examples/Makefile.in
+++ b/c++/examples/Makefile.in
@@ -432,7 +432,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -455,9 +454,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -484,6 +486,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -538,6 +541,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -562,7 +566,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1235,7 +1238,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp
index 142e70f..03e2855 100644
--- a/c++/examples/chunks.cpp
+++ b/c++/examples/chunks.cpp
@@ -37,194 +37,194 @@ const int RANKC = 1;
int main (void)
{
- hsize_t i, j;
+ hsize_t i, j;
// Try block to detect exceptions raised by any of the calls inside it
try
{
- /*
- * Turn off the auto-printing when failure occurs so that we can
- * handle the errors appropriately
- */
- Exception::dontPrint();
-
- /*
- * Open the file and the dataset.
- */
- H5File file( FILE_NAME, H5F_ACC_RDONLY );
- DataSet dataset = file.openDataSet( DATASET_NAME );
-
- /*
- * Get filespace for rank and dimension
- */
- DataSpace filespace = dataset.getSpace();
-
- /*
- * Get number of dimensions in the file dataspace
- */
- int rank = filespace.getSimpleExtentNdims();
-
- /*
- * Get and print the dimension sizes of the file dataspace
- */
- hsize_t dims[2]; // dataset dimensions
- rank = filespace.getSimpleExtentDims( dims );
- cout << "dataset rank = " << rank << ", dimensions "
- << (unsigned long)(dims[0]) << " x "
- << (unsigned long)(dims[1]) << endl;
-
- /*
- * Define the memory space to read dataset.
- */
- DataSpace mspace1(RANK, dims);
-
- /*
- * Read dataset back and display.
- */
- int data_out[NX][NY]; // buffer for dataset to be read
- dataset.read( data_out, PredType::NATIVE_INT, mspace1, filespace );
-
- cout << "\n";
- cout << "Dataset: \n";
- for (j = 0; j < dims[0]; j++)
- {
- for (i = 0; i < dims[1]; i++)
- cout << data_out[j][i] << " ";
- cout << endl;
- }
-
- /*
- * dataset rank 2, dimensions 10 x 5
- * chunk rank 2, dimensions 2 x 5
-
- * Dataset:
- * 1 1 1 3 3
- * 1 1 1 3 3
- * 1 1 1 0 0
- * 2 0 0 0 0
- * 2 0 0 0 0
- * 2 0 0 0 0
- * 2 0 0 0 0
- * 2 0 0 0 0
- * 2 0 0 0 0
- * 2 0 0 0 0
- */
-
- /*
- * Read the third column from the dataset.
- * First define memory dataspace, then define hyperslab
- * and read it into column array.
- */
- hsize_t col_dims[1];
- col_dims[0] = 10;
- DataSpace mspace2( RANKC, col_dims );
-
- /*
- * Define the column (hyperslab) to read.
- */
- hsize_t offset[2] = { 0, 2 };
- hsize_t count[2] = { 10, 1 };
- int column[10]; // buffer for column to be read
-
- /*
- * Define hyperslab and read.
- */
- filespace.selectHyperslab( H5S_SELECT_SET, count, offset );
- dataset.read( column, PredType::NATIVE_INT, mspace2, filespace );
-
- cout << endl;
- cout << "Third column: " << endl;
- for (i = 0; i < 10; i++)
- cout << column[i] << endl;
-
- /*
- * Third column:
- * 1
- * 1
- * 1
- * 0
- * 0
- * 0
- * 0
- * 0
- * 0
- * 0
- */
-
- /*
- * Get creation properties list.
- */
- DSetCreatPropList cparms = dataset.getCreatePlist();
-
- /*
- * Check if dataset is chunked.
- */
- hsize_t chunk_dims[2];
- int rank_chunk;
- if( H5D_CHUNKED == cparms.getLayout() )
- {
- /*
- * Get chunking information: rank and dimensions
- */
- rank_chunk = cparms.getChunk( 2, chunk_dims);
- cout << "chunk rank " << rank_chunk << "dimensions "
- << (unsigned long)(chunk_dims[0]) << " x "
- << (unsigned long)(chunk_dims[1]) << endl;
-
- /*
- * Define the memory space to read a chunk.
- */
- DataSpace mspace3( rank_chunk, chunk_dims );
-
- /*
- * Define chunk in the file (hyperslab) to read.
- */
- offset[0] = 2;
- offset[1] = 0;
- count[0] = chunk_dims[0];
- count[1] = chunk_dims[1];
- filespace.selectHyperslab( H5S_SELECT_SET, count, offset );
-
- /*
- * Read chunk back and display.
- */
- int chunk_out[2][5]; // buffer for chunk to be read
- dataset.read( chunk_out, PredType::NATIVE_INT, mspace3, filespace );
- cout << endl;
- cout << "Chunk:" << endl;
- for (j = 0; j < chunk_dims[0]; j++)
- {
- for (i = 0; i < chunk_dims[1]; i++)
- cout << chunk_out[j][i] << " ";
- cout << endl;
- }
- /*
- * Chunk:
- * 1 1 1 0 0
- * 2 0 0 0 0
- */
- }
+ /*
+ * Turn off the auto-printing when failure occurs so that we can
+ * handle the errors appropriately
+ */
+ Exception::dontPrint();
+
+ /*
+ * Open the file and the dataset.
+ */
+ H5File file( FILE_NAME, H5F_ACC_RDONLY );
+ DataSet dataset = file.openDataSet( DATASET_NAME );
+
+ /*
+ * Get filespace for rank and dimension
+ */
+ DataSpace filespace = dataset.getSpace();
+
+ /*
+ * Get number of dimensions in the file dataspace
+ */
+ int rank = filespace.getSimpleExtentNdims();
+
+ /*
+ * Get and print the dimension sizes of the file dataspace
+ */
+ hsize_t dims[2]; // dataset dimensions
+ rank = filespace.getSimpleExtentDims( dims );
+ cout << "dataset rank = " << rank << ", dimensions "
+ << (unsigned long)(dims[0]) << " x "
+ << (unsigned long)(dims[1]) << endl;
+
+ /*
+ * Define the memory space to read dataset.
+ */
+ DataSpace mspace1(RANK, dims);
+
+ /*
+ * Read dataset back and display.
+ */
+ int data_out[NX][NY]; // buffer for dataset to be read
+ dataset.read( data_out, PredType::NATIVE_INT, mspace1, filespace );
+
+ cout << "\n";
+ cout << "Dataset: \n";
+ for (j = 0; j < dims[0]; j++)
+ {
+ for (i = 0; i < dims[1]; i++)
+ cout << data_out[j][i] << " ";
+ cout << endl;
+ }
+
+ /*
+ * dataset rank 2, dimensions 10 x 5
+ * chunk rank 2, dimensions 2 x 5
+
+ * Dataset:
+ * 1 1 1 3 3
+ * 1 1 1 3 3
+ * 1 1 1 0 0
+ * 2 0 0 0 0
+ * 2 0 0 0 0
+ * 2 0 0 0 0
+ * 2 0 0 0 0
+ * 2 0 0 0 0
+ * 2 0 0 0 0
+ * 2 0 0 0 0
+ */
+
+ /*
+ * Read the third column from the dataset.
+ * First define memory dataspace, then define hyperslab
+ * and read it into column array.
+ */
+ hsize_t col_dims[1];
+ col_dims[0] = 10;
+ DataSpace mspace2( RANKC, col_dims );
+
+ /*
+ * Define the column (hyperslab) to read.
+ */
+ hsize_t offset[2] = { 0, 2 };
+ hsize_t count[2] = { 10, 1 };
+ int column[10]; // buffer for column to be read
+
+ /*
+ * Define hyperslab and read.
+ */
+ filespace.selectHyperslab( H5S_SELECT_SET, count, offset );
+ dataset.read( column, PredType::NATIVE_INT, mspace2, filespace );
+
+ cout << endl;
+ cout << "Third column: " << endl;
+ for (i = 0; i < 10; i++)
+ cout << column[i] << endl;
+
+ /*
+ * Third column:
+ * 1
+ * 1
+ * 1
+ * 0
+ * 0
+ * 0
+ * 0
+ * 0
+ * 0
+ * 0
+ */
+
+ /*
+ * Get creation properties list.
+ */
+ DSetCreatPropList cparms = dataset.getCreatePlist();
+
+ /*
+ * Check if dataset is chunked.
+ */
+ hsize_t chunk_dims[2];
+ int rank_chunk;
+ if( H5D_CHUNKED == cparms.getLayout() )
+ {
+ /*
+ * Get chunking information: rank and dimensions
+ */
+ rank_chunk = cparms.getChunk( 2, chunk_dims);
+ cout << "chunk rank " << rank_chunk << "dimensions "
+ << (unsigned long)(chunk_dims[0]) << " x "
+ << (unsigned long)(chunk_dims[1]) << endl;
+
+ /*
+ * Define the memory space to read a chunk.
+ */
+ DataSpace mspace3( rank_chunk, chunk_dims );
+
+ /*
+ * Define chunk in the file (hyperslab) to read.
+ */
+ offset[0] = 2;
+ offset[1] = 0;
+ count[0] = chunk_dims[0];
+ count[1] = chunk_dims[1];
+ filespace.selectHyperslab( H5S_SELECT_SET, count, offset );
+
+ /*
+ * Read chunk back and display.
+ */
+ int chunk_out[2][5]; // buffer for chunk to be read
+ dataset.read( chunk_out, PredType::NATIVE_INT, mspace3, filespace );
+ cout << endl;
+ cout << "Chunk:" << endl;
+ for (j = 0; j < chunk_dims[0]; j++)
+ {
+ for (i = 0; i < chunk_dims[1]; i++)
+ cout << chunk_out[j][i] << " ";
+ cout << endl;
+ }
+ /*
+ * Chunk:
+ * 1 1 1 0 0
+ * 2 0 0 0 0
+ */
+ }
} // end of try block
// catch failure caused by the H5File operations
catch( FileIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSpace operations
catch( DataSpaceIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
return 0;
}
diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp
index 192a1cf..4b116e0 100644
--- a/c++/examples/compound.cpp
+++ b/c++/examples/compound.cpp
@@ -41,15 +41,15 @@ int main(void)
{
/* First structure and dataset*/
typedef struct s1_t {
- int a;
- float b;
- double c;
+ int a;
+ float b;
+ double c;
} s1_t;
/* Second structure (subset of s1_t) and dataset*/
typedef struct s2_t {
- double c;
- int a;
+ double c;
+ int a;
} s2_t;
// Try block to detect exceptions raised by any of the calls inside it
@@ -135,12 +135,12 @@ int main(void)
*/
cout << endl << "Field c : " << endl;
for( i = 0; i < LENGTH; i++)
- cout << s2[i].c << " ";
+ cout << s2[i].c << " ";
cout << endl;
cout << endl << "Field a : " << endl;
for( i = 0; i < LENGTH; i++)
- cout << s2[i].a << " ";
+ cout << s2[i].a << " ";
cout << endl;
/*
@@ -161,7 +161,7 @@ int main(void)
*/
cout << endl << "Field b : " << endl;
for( i = 0; i < LENGTH; i++)
- cout << s3[i] << " ";
+ cout << s3[i] << " ";
cout << endl;
/*
diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp
index 890fb03..06b981b 100644
--- a/c++/examples/create.cpp
+++ b/c++/examples/create.cpp
@@ -25,11 +25,11 @@
#include "H5Cpp.h"
using namespace H5;
-const H5std_string FILE_NAME( "SDS.h5" );
-const H5std_string DATASET_NAME( "IntArray" );
-const int NX = 5; // dataset dimensions
-const int NY = 6;
-const int RANK = 2;
+const H5std_string FILE_NAME( "SDS.h5" );
+const H5std_string DATASET_NAME( "IntArray" );
+const int NX = 5; // dataset dimensions
+const int NY = 6;
+const int RANK = 2;
int main (void)
{
@@ -41,7 +41,7 @@ int main (void)
for (j = 0; j < NX; j++)
{
for (i = 0; i < NY; i++)
- data[j][i] = i + j;
+ data[j][i] = i + j;
}
/*
* 0 1 2 3 4 5
diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp
index 271100e..9e005c6 100644
--- a/c++/examples/extend_ds.cpp
+++ b/c++/examples/extend_ds.cpp
@@ -105,8 +105,8 @@ int main (void)
* Write the data to the hyperslab.
*/
int data1[3][3] = { {1, 1, 1}, /* data to write */
- {1, 1, 1},
- {1, 1, 1} };
+ {1, 1, 1},
+ {1, 1, 1} };
dataset.write( data1, PredType::NATIVE_INT, mspace1, fspace1 );
/*
@@ -179,16 +179,16 @@ int main (void)
/*
* Resulting dataset
*
- * 1 1 1 3 3
- * 1 1 1 3 3
- * 1 1 1 0 0
- * 2 0 0 0 0
- * 2 0 0 0 0
- * 2 0 0 0 0
- * 2 0 0 0 0
- * 2 0 0 0 0
- * 2 0 0 0 0
- * 2 0 0 0 0
+ * 1 1 1 3 3
+ * 1 1 1 3 3
+ * 1 1 1 0 0
+ * 2 0 0 0 0
+ * 2 0 0 0 0
+ * 2 0 0 0 0
+ * 2 0 0 0 0
+ * 2 0 0 0 0
+ * 2 0 0 0 0
+ * 2 0 0 0 0
*/
/*
* Display the result.
diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp
index a8c9953..fab54cd 100644
--- a/c++/examples/h5group.cpp
+++ b/c++/examples/h5group.cpp
@@ -33,7 +33,7 @@ using std::endl;
using namespace H5;
const H5std_string FILE_NAME( "Group.h5" );
-const int RANK = 2;
+const int RANK = 2;
// Operator function
extern "C" herr_t file_info(hid_t loc_id, const char *name, const H5L_info_t *linfo,
@@ -48,169 +48,169 @@ int main(void)
// Try block to detect exceptions raised by any of the calls inside it
try
{
- /*
- * Turn off the auto-printing when failure occurs so that we can
- * handle the errors appropriately
- */
- Exception::dontPrint();
-
- /*
- * Create the named file, truncating the existing one if any,
- * using default create and access property lists.
- */
- H5File *file = new H5File( FILE_NAME, H5F_ACC_TRUNC );
-
- /*
- * Create a group in the file
- */
- Group* group = new Group( file->createGroup( "/Data" ));
-
- /*
- * Create dataset "Compressed Data" in the group using absolute
- * name. Dataset creation property list is modified to use
- * GZIP compression with the compression effort set to 6.
- * Note that compression can be used only when dataset is chunked.
- */
- dims[0] = 1000;
- dims[1] = 20;
- cdims[0] = 20;
- cdims[1] = 20;
- DataSpace *dataspace = new DataSpace(RANK, dims); // create new dspace
- DSetCreatPropList ds_creatplist; // create dataset creation prop list
- ds_creatplist.setChunk( 2, cdims ); // then modify it for compression
- ds_creatplist.setDeflate( 6 );
-
- /*
- * Create the first dataset.
- */
- DataSet* dataset = new DataSet(file->createDataSet(
- "/Data/Compressed_Data", PredType::NATIVE_INT,
- *dataspace, ds_creatplist ));
-
- /*
- * Close the first dataset.
- */
- delete dataset;
- delete dataspace;
-
- /*
- * Create the second dataset.
- */
- dims[0] = 500;
- dims[1] = 20;
- dataspace = new DataSpace(RANK, dims); // create second dspace
- dataset = new DataSet(file->createDataSet("/Data/Float_Data",
- PredType::NATIVE_FLOAT, *dataspace));
-
- delete dataset;
- delete dataspace;
- delete group;
- delete file;
-
- /*
- * Now reopen the file and group in the file.
- */
- file = new H5File(FILE_NAME, H5F_ACC_RDWR);
- group = new Group(file->openGroup("Data"));
-
- /*
- * Access "Compressed_Data" dataset in the group.
- */
- try { // to determine if the dataset exists in the group
- dataset = new DataSet( group->openDataSet( "Compressed_Data" ));
- }
- catch( GroupIException not_found_error ) {
- cout << " Dataset is not found." << endl;
- }
- cout << "dataset \"/Data/Compressed_Data\" is open" << endl;
-
- /*
- * Close the dataset.
- */
- delete dataset;
-
- /*
- * Create hard link to the Data group.
- */
- file->link( H5L_TYPE_HARD, "Data", "Data_new" );
-
- /*
- * We can access "Compressed_Data" dataset using created
- * hard link "Data_new".
- */
- try { // to determine if the dataset exists in the file
- dataset = new DataSet(file->openDataSet( "/Data_new/Compressed_Data" ));
- }
- catch( FileIException not_found_error )
- {
- cout << " Dataset is not found." << endl;
- }
- cout << "dataset \"/Data_new/Compressed_Data\" is open" << endl;
-
- /*
- * Close the dataset.
- */
- delete dataset;
-
- /*
- * Use iterator to see the names of the objects in the file
- * root directory.
- */
- cout << endl << "Iterating over elements in the file" << endl;
- herr_t idx = H5Literate(file->getId(), H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL);
- cout << endl;
-
- /*
- * Unlink name "Data" and use iterator to see the names
- * of the objects in the file root direvtory.
- */
- cout << "Unlinking..." << endl;
- try { // attempt to unlink the dataset
- file->unlink( "Data" );
- }
- catch( FileIException unlink_error )
- {
- cout << " unlink failed." << endl;
- }
- cout << "\"Data\" is unlinked" << endl;
-
- cout << endl << "Iterating over elements in the file again" << endl;
- idx = H5Literate(file->getId(), H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL);
- cout << endl;
-
- /*
- * Close the group and file.
- */
- delete group;
- delete file;
+ /*
+ * Turn off the auto-printing when failure occurs so that we can
+ * handle the errors appropriately
+ */
+ Exception::dontPrint();
+
+ /*
+ * Create the named file, truncating the existing one if any,
+ * using default create and access property lists.
+ */
+ H5File *file = new H5File( FILE_NAME, H5F_ACC_TRUNC );
+
+ /*
+ * Create a group in the file
+ */
+ Group* group = new Group( file->createGroup( "/Data" ));
+
+ /*
+ * Create dataset "Compressed Data" in the group using absolute
+ * name. Dataset creation property list is modified to use
+ * GZIP compression with the compression effort set to 6.
+ * Note that compression can be used only when dataset is chunked.
+ */
+ dims[0] = 1000;
+ dims[1] = 20;
+ cdims[0] = 20;
+ cdims[1] = 20;
+ DataSpace *dataspace = new DataSpace(RANK, dims); // create new dspace
+ DSetCreatPropList ds_creatplist; // create dataset creation prop list
+ ds_creatplist.setChunk( 2, cdims ); // then modify it for compression
+ ds_creatplist.setDeflate( 6 );
+
+ /*
+ * Create the first dataset.
+ */
+ DataSet* dataset = new DataSet(file->createDataSet(
+ "/Data/Compressed_Data", PredType::NATIVE_INT,
+ *dataspace, ds_creatplist ));
+
+ /*
+ * Close the first dataset.
+ */
+ delete dataset;
+ delete dataspace;
+
+ /*
+ * Create the second dataset.
+ */
+ dims[0] = 500;
+ dims[1] = 20;
+ dataspace = new DataSpace(RANK, dims); // create second dspace
+ dataset = new DataSet(file->createDataSet("/Data/Float_Data",
+ PredType::NATIVE_FLOAT, *dataspace));
+
+ delete dataset;
+ delete dataspace;
+ delete group;
+ delete file;
+
+ /*
+ * Now reopen the file and group in the file.
+ */
+ file = new H5File(FILE_NAME, H5F_ACC_RDWR);
+ group = new Group(file->openGroup("Data"));
+
+ /*
+ * Access "Compressed_Data" dataset in the group.
+ */
+ try { // to determine if the dataset exists in the group
+ dataset = new DataSet( group->openDataSet( "Compressed_Data" ));
+ }
+ catch( GroupIException not_found_error ) {
+ cout << " Dataset is not found." << endl;
+ }
+ cout << "dataset \"/Data/Compressed_Data\" is open" << endl;
+
+ /*
+ * Close the dataset.
+ */
+ delete dataset;
+
+ /*
+ * Create hard link to the Data group.
+ */
+ file->link( H5L_TYPE_HARD, "Data", "Data_new" );
+
+ /*
+ * We can access "Compressed_Data" dataset using created
+ * hard link "Data_new".
+ */
+ try { // to determine if the dataset exists in the file
+ dataset = new DataSet(file->openDataSet( "/Data_new/Compressed_Data" ));
+ }
+ catch( FileIException not_found_error )
+ {
+ cout << " Dataset is not found." << endl;
+ }
+ cout << "dataset \"/Data_new/Compressed_Data\" is open" << endl;
+
+ /*
+ * Close the dataset.
+ */
+ delete dataset;
+
+ /*
+ * Use iterator to see the names of the objects in the file
+ * root directory.
+ */
+ cout << endl << "Iterating over elements in the file" << endl;
+ herr_t idx = H5Literate(file->getId(), H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL);
+ cout << endl;
+
+ /*
+ * Unlink name "Data" and use iterator to see the names
+ * of the objects in the file root direvtory.
+ */
+ cout << "Unlinking..." << endl;
+ try { // attempt to unlink the dataset
+ file->unlink( "Data" );
+ }
+ catch( FileIException unlink_error )
+ {
+ cout << " unlink failed." << endl;
+ }
+ cout << "\"Data\" is unlinked" << endl;
+
+ cout << endl << "Iterating over elements in the file again" << endl;
+ idx = H5Literate(file->getId(), H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL);
+ cout << endl;
+
+ /*
+ * Close the group and file.
+ */
+ delete group;
+ delete file;
} // end of try block
// catch failure caused by the H5File operations
catch( FileIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSpace operations
catch( DataSpaceIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the Attribute operations
catch( AttributeIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
return 0;
}
diff --git a/c++/examples/h5tutr_cmprss.cpp b/c++/examples/h5tutr_cmprss.cpp
index 9b1d2bc..9531bdd 100644
--- a/c++/examples/h5tutr_cmprss.cpp
+++ b/c++/examples/h5tutr_cmprss.cpp
@@ -1,8 +1,8 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
@@ -24,130 +24,130 @@ using std::endl;
#include "H5Cpp.h"
using namespace H5;
-const H5std_string FILE_NAME("h5tutr_cmprss.h5");
-const H5std_string DATASET_NAME("Compressed_Data");
-const int DIM0 = 100;
-const int DIM1 = 20;
+const H5std_string FILE_NAME("h5tutr_cmprss.h5");
+const H5std_string DATASET_NAME("Compressed_Data");
+const int DIM0 = 100;
+const int DIM1 = 20;
int main (void)
{
- hsize_t dims[2] = { DIM0, DIM1 }; // dataset dimensions
- hsize_t chunk_dims[2] = { 20, 20 }; // chunk dimensions
+ hsize_t dims[2] = { DIM0, DIM1 }; // dataset dimensions
+ hsize_t chunk_dims[2] = { 20, 20 }; // chunk dimensions
int i,j, buf[DIM0][DIM1];
// Try block to detect exceptions raised by any of the calls inside it
try
{
- // Turn off the auto-printing when failure occurs so that we can
- // handle the errors appropriately
- Exception::dontPrint();
+ // Turn off the auto-printing when failure occurs so that we can
+ // handle the errors appropriately
+ Exception::dontPrint();
- // Create a new file using the default property lists.
- H5File file(FILE_NAME, H5F_ACC_TRUNC);
+ // Create a new file using the default property lists.
+ H5File file(FILE_NAME, H5F_ACC_TRUNC);
- // Create the data space for the dataset.
- DataSpace *dataspace = new DataSpace(2, dims);
+ // Create the data space for the dataset.
+ DataSpace *dataspace = new DataSpace(2, dims);
- // Modify dataset creation property to enable chunking
- DSetCreatPropList *plist = new DSetCreatPropList;
- plist->setChunk(2, chunk_dims);
+ // Modify dataset creation property to enable chunking
+ DSetCreatPropList *plist = new DSetCreatPropList;
+ plist->setChunk(2, chunk_dims);
- // Set ZLIB (DEFLATE) Compression using level 6.
- // To use SZIP compression comment out this line.
- plist->setDeflate(6);
+ // Set ZLIB (DEFLATE) Compression using level 6.
+ // To use SZIP compression comment out this line.
+ plist->setDeflate(6);
- // Uncomment these lines to set SZIP Compression
- // unsigned szip_options_mask = H5_SZIP_NN_OPTION_MASK;
- // unsigned szip_pixels_per_block = 16;
- // plist->setSzip(szip_options_mask, szip_pixels_per_block);
+ // Uncomment these lines to set SZIP Compression
+ // unsigned szip_options_mask = H5_SZIP_NN_OPTION_MASK;
+ // unsigned szip_pixels_per_block = 16;
+ // plist->setSzip(szip_options_mask, szip_pixels_per_block);
- // Create the dataset.
- DataSet *dataset = new DataSet(file.createDataSet( DATASET_NAME,
- PredType::STD_I32BE, *dataspace, *plist) );
-
- for (i = 0; i< DIM0; i++)
- for (j=0; j<DIM1; j++)
- buf[i][j] = i+j;
-
- // Write data to dataset.
- dataset->write(buf, PredType::NATIVE_INT);
-
- // Close objects and file. Either approach will close the HDF5 item.
- delete dataspace;
- delete dataset;
- delete plist;
- file.close();
-
- // -----------------------------------------------
- // Re-open the file and dataset, retrieve filter
- // information for dataset and read the data back.
- // -----------------------------------------------
-
- int rbuf[DIM0][DIM1];
- int numfilt;
- size_t nelmts={1}, namelen={1};
- unsigned flags, filter_info, cd_values[1], idx;
- char name[1];
- H5Z_filter_t filter_type;
-
- // Open the file and the dataset in the file.
- file.openFile(FILE_NAME, H5F_ACC_RDONLY);
- dataset = new DataSet(file.openDataSet( DATASET_NAME));
-
- // Get the create property list of the dataset.
- plist = new DSetCreatPropList(dataset->getCreatePlist ());
-
- // Get the number of filters associated with the dataset.
- numfilt = plist->getNfilters();
- cout << "Number of filters associated with dataset: " << numfilt << endl;
-
- for (idx=0; idx < numfilt; idx++) {
- nelmts = 0;
-
- filter_type = plist->getFilter(idx, flags, nelmts, cd_values, namelen, name , filter_info);
-
- cout << "Filter Type: ";
-
- switch (filter_type) {
- case H5Z_FILTER_DEFLATE:
- cout << "H5Z_FILTER_DEFLATE" << endl;
- break;
- case H5Z_FILTER_SZIP:
- cout << "H5Z_FILTER_SZIP" << endl;
- break;
- default:
- cout << "Other filter type included." << endl;
- }
- }
-
- // Read data.
- dataset->read(rbuf, PredType::NATIVE_INT);
-
- delete plist;
- delete dataset;
- file.close(); // can be skipped
+ // Create the dataset.
+ DataSet *dataset = new DataSet(file.createDataSet( DATASET_NAME,
+ PredType::STD_I32BE, *dataspace, *plist) );
+
+ for (i = 0; i< DIM0; i++)
+ for (j=0; j<DIM1; j++)
+ buf[i][j] = i+j;
+
+ // Write data to dataset.
+ dataset->write(buf, PredType::NATIVE_INT);
+
+ // Close objects and file. Either approach will close the HDF5 item.
+ delete dataspace;
+ delete dataset;
+ delete plist;
+ file.close();
+
+ // -----------------------------------------------
+ // Re-open the file and dataset, retrieve filter
+ // information for dataset and read the data back.
+ // -----------------------------------------------
+
+ int rbuf[DIM0][DIM1];
+ int numfilt;
+ size_t nelmts={1}, namelen={1};
+ unsigned flags, filter_info, cd_values[1], idx;
+ char name[1];
+ H5Z_filter_t filter_type;
+
+ // Open the file and the dataset in the file.
+ file.openFile(FILE_NAME, H5F_ACC_RDONLY);
+ dataset = new DataSet(file.openDataSet( DATASET_NAME));
+
+ // Get the create property list of the dataset.
+ plist = new DSetCreatPropList(dataset->getCreatePlist ());
+
+ // Get the number of filters associated with the dataset.
+ numfilt = plist->getNfilters();
+ cout << "Number of filters associated with dataset: " << numfilt << endl;
+
+ for (idx=0; idx < numfilt; idx++) {
+ nelmts = 0;
+
+ filter_type = plist->getFilter(idx, flags, nelmts, cd_values, namelen, name , filter_info);
+
+ cout << "Filter Type: ";
+
+ switch (filter_type) {
+ case H5Z_FILTER_DEFLATE:
+ cout << "H5Z_FILTER_DEFLATE" << endl;
+ break;
+ case H5Z_FILTER_SZIP:
+ cout << "H5Z_FILTER_SZIP" << endl;
+ break;
+ default:
+ cout << "Other filter type included." << endl;
+ }
+ }
+
+ // Read data.
+ dataset->read(rbuf, PredType::NATIVE_INT);
+
+ delete plist;
+ delete dataset;
+ file.close(); // can be skipped
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSet operations
catch(DataSetIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSpace operations
catch(DataSpaceIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
return 0; // successfully terminated
diff --git a/c++/examples/h5tutr_crtatt.cpp b/c++/examples/h5tutr_crtatt.cpp
index f865501..fcf6c27 100644
--- a/c++/examples/h5tutr_crtatt.cpp
+++ b/c++/examples/h5tutr_crtatt.cpp
@@ -1,8 +1,8 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
@@ -21,11 +21,11 @@
#include "H5Cpp.h"
using namespace H5;
-const H5std_string FILE_NAME( "h5tutr_dset.h5" );
-const H5std_string DATASET_NAME( "dset" );
-const H5std_string ATTR_NAME( "Units" );
+const H5std_string FILE_NAME( "h5tutr_dset.h5" );
+const H5std_string DATASET_NAME( "dset" );
+const H5std_string ATTR_NAME( "Units" );
-const int DIM1 = 2;
+const int DIM1 = 2;
int main (void)
{
@@ -36,52 +36,52 @@ int main (void)
// Try block to detect exceptions raised by any of the calls inside it
try
{
- // Turn off the auto-printing when failure occurs so that we can
- // handle the errors appropriately
- Exception::dontPrint();
+ // Turn off the auto-printing when failure occurs so that we can
+ // handle the errors appropriately
+ Exception::dontPrint();
- // Open an existing file and dataset.
- H5File file( FILE_NAME, H5F_ACC_RDWR );
- DataSet dataset = file.openDataSet( DATASET_NAME );
+ // Open an existing file and dataset.
+ H5File file( FILE_NAME, H5F_ACC_RDWR );
+ DataSet dataset = file.openDataSet( DATASET_NAME );
- // Create the data space for the attribute.
- DataSpace attr_dataspace = DataSpace (1, dims );
+ // Create the data space for the attribute.
+ DataSpace attr_dataspace = DataSpace (1, dims );
- // Create a dataset attribute.
- Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE,
- attr_dataspace);
+ // Create a dataset attribute.
+ Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE,
+ attr_dataspace);
- // Write the attribute data.
- attribute.write( PredType::NATIVE_INT, attr_data);
+ // Write the attribute data.
+ attribute.write( PredType::NATIVE_INT, attr_data);
} // end of try block
// catch failure caused by the H5File operations
catch( DataSpaceIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the H5File operations
catch( AttributeIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the H5File operations
catch( FileIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
return 0; // successfully terminated
diff --git a/c++/examples/h5tutr_crtdat.cpp b/c++/examples/h5tutr_crtdat.cpp
index 7cd49f8..985f6ac 100644
--- a/c++/examples/h5tutr_crtdat.cpp
+++ b/c++/examples/h5tutr_crtdat.cpp
@@ -1,8 +1,8 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
@@ -18,57 +18,58 @@
#include <iostream>
#include <string>
+
#include "H5Cpp.h"
using namespace H5;
-const H5std_string FILE_NAME("h5tutr_dset.h5");
-const H5std_string DATASET_NAME("dset");
-const int NX = 4; // dataset dimensions
-const int NY = 6;
-const int RANK = 2;
+const H5std_string FILE_NAME("h5tutr_dset.h5");
+const H5std_string DATASET_NAME("dset");
+const int NX = 4; // dataset dimensions
+const int NY = 6;
+const int RANK = 2;
int main (void)
{
// Try block to detect exceptions raised by any of the calls inside it
try
{
- // Turn off the auto-printing when failure occurs so that we can
- // handle the errors appropriately
- Exception::dontPrint();
+ // Turn off the auto-printing when failure occurs so that we can
+ // handle the errors appropriately
+ Exception::dontPrint();
- // Create a new file using the default property lists.
- H5File file(FILE_NAME, H5F_ACC_TRUNC);
+ // Create a new file using the default property lists.
+ H5File file(FILE_NAME, H5F_ACC_TRUNC);
- // Create the data space for the dataset.
- hsize_t dims[2]; // dataset dimensions
- dims[0] = NX;
- dims[1] = NY;
- DataSpace dataspace(RANK, dims);
+ // Create the data space for the dataset.
+ hsize_t dims[2]; // dataset dimensions
+ dims[0] = NX;
+ dims[1] = NY;
+ DataSpace dataspace(RANK, dims);
- // Create the dataset.
- DataSet dataset = file.createDataSet(DATASET_NAME, PredType::STD_I32BE, dataspace);
+ // Create the dataset.
+ DataSet dataset = file.createDataSet(DATASET_NAME, PredType::STD_I32BE, dataspace);
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSet operations
catch(DataSetIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSpace operations
catch(DataSpaceIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
return 0; // successfully terminated
diff --git a/c++/examples/h5tutr_crtgrp.cpp b/c++/examples/h5tutr_crtgrp.cpp
index 4bdb02c..e35cb46 100644
--- a/c++/examples/h5tutr_crtgrp.cpp
+++ b/c++/examples/h5tutr_crtgrp.cpp
@@ -1,8 +1,8 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
@@ -31,31 +31,31 @@ int main(void)
// Try block to detect exceptions raised by any of the calls inside it
try
{
- // Turn off the auto-printing when failure occurs so that we can
- // handle the errors appropriately
- Exception::dontPrint();
+ // Turn off the auto-printing when failure occurs so that we can
+ // handle the errors appropriately
+ Exception::dontPrint();
- // Create a new file using default property lists.
- H5File file(FILE_NAME, H5F_ACC_TRUNC);
-
- // Create a group named "/MygGroup" in the file
- Group group(file.createGroup("/MyGroup"));
+ // Create a new file using default property lists.
+ H5File file(FILE_NAME, H5F_ACC_TRUNC);
+
+ // Create a group named "/MygGroup" in the file
+ Group group(file.createGroup("/MyGroup"));
- // File and group will be closed as their instances go out of scope.
+ // File and group will be closed as their instances go out of scope.
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the Group operations
catch(GroupIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
return 0;
diff --git a/c++/examples/h5tutr_crtgrpar.cpp b/c++/examples/h5tutr_crtgrpar.cpp
index 3e175d6..76ec9e5 100644
--- a/c++/examples/h5tutr_crtgrpar.cpp
+++ b/c++/examples/h5tutr_crtgrpar.cpp
@@ -1,8 +1,8 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
@@ -33,50 +33,50 @@ int main(void)
try
{
- // Turn off the auto-printing when failure occurs so that we can
- // handle the errors appropriately.
+ // Turn off the auto-printing when failure occurs so that we can
+ // handle the errors appropriately.
- Exception::dontPrint();
+ Exception::dontPrint();
- // Create a new file using default properties.
+ // Create a new file using default properties.
- H5File file(FILE_NAME, H5F_ACC_TRUNC);
+ H5File file(FILE_NAME, H5F_ACC_TRUNC);
- // Create group "MyGroup" in the root group using an absolute name.
-
- Group group1(file.createGroup( "/MyGroup"));
+ // Create group "MyGroup" in the root group using an absolute name.
+
+ Group group1(file.createGroup( "/MyGroup"));
- // Create group "Group_A" in group "MyGroup" using an
- // absolute name.
+ // Create group "Group_A" in group "MyGroup" using an
+ // absolute name.
- Group group2(file.createGroup("/MyGroup/Group_A"));
+ Group group2(file.createGroup("/MyGroup/Group_A"));
- // Create group "Group_B" in group "MyGroup" using a
- // relative name.
+ // Create group "Group_B" in group "MyGroup" using a
+ // relative name.
- Group group3(group1.createGroup ("Group_B"));
+ Group group3(group1.createGroup ("Group_B"));
- // Close the groups and file.
+ // Close the groups and file.
- group1.close();
- group2.close();
- group3.close();
- file.close();
+ group1.close();
+ group2.close();
+ group3.close();
+ file.close();
} // end of try block
// catch failure caused by the File operations
catch(FileIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the Group operations
catch(GroupIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
return 0;
diff --git a/c++/examples/h5tutr_crtgrpd.cpp b/c++/examples/h5tutr_crtgrpd.cpp
index 318ab1c..e3bb1b1 100644
--- a/c++/examples/h5tutr_crtgrpd.cpp
+++ b/c++/examples/h5tutr_crtgrpd.cpp
@@ -1,8 +1,8 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
@@ -27,11 +27,11 @@ using namespace H5;
const H5std_string FILE_NAME("h5tutr_groups.h5");
const H5std_string DATASET_NAME1("/MyGroup/dset1");
const H5std_string DATASET_NAME2("dset2");
-const int RANK = 2;
-const int D1DIM1 = 3;
-const int D1DIM2 = 3;
-const int D2DIM1 = 2;
-const int D2DIM2 = 10;
+const int RANK = 2;
+const int D1DIM1 = 3;
+const int D1DIM2 = 3;
+const int D2DIM1 = 2;
+const int D2DIM2 = 10;
int main(void)
{
@@ -41,93 +41,93 @@ int main(void)
// Try block to catch exceptions raised by any of the calls inside it
try
{
- // Turn off the auto-printing when failure occurs so that we can
- // handle the errors appropriately
- Exception::dontPrint();
+ // Turn off the auto-printing when failure occurs so that we can
+ // handle the errors appropriately
+ Exception::dontPrint();
- // Initialize the first dataset.
- for (i = 0; i < D1DIM1; i++)
- for (j = 0; j < D1DIM2; j++)
- dset1_data[i][j] = j + 1;
+ // Initialize the first dataset.
+ for (i = 0; i < D1DIM1; i++)
+ for (j = 0; j < D1DIM2; j++)
+ dset1_data[i][j] = j + 1;
- // Initialize the second dataset.
- for (i = 0; i < D2DIM1; i++)
- for (j = 0; j < D2DIM2; j++)
- dset2_data[i][j] = j + 1;
+ // Initialize the second dataset.
+ for (i = 0; i < D2DIM1; i++)
+ for (j = 0; j < D2DIM2; j++)
+ dset2_data[i][j] = j + 1;
- // Open an existing file and dataset.
- H5File file(FILE_NAME, H5F_ACC_RDWR);
+ // Open an existing file and dataset.
+ H5File file(FILE_NAME, H5F_ACC_RDWR);
// Create the data space for the first dataset. Note the use of
// pointer for the instance 'dataspace'. It can be deleted and
// used again later for another data space. An HDF5 identifier is
// closed by the destructor or the method 'close()'.
- hsize_t dims[RANK]; // dataset dimensions
- dims[0] = D1DIM1;
- dims[1] = D1DIM2;
- DataSpace *dataspace = new DataSpace (RANK, dims);
-
- // Create the dataset in group "MyGroup". Same note as for the
- // dataspace above.
- DataSet *dataset = new DataSet (file.createDataSet(DATASET_NAME1,
- PredType::STD_I32BE, *dataspace));
-
- // Write the data to the dataset using default memory space, file
- // space, and transfer properties.
- dataset->write(dset1_data, PredType::NATIVE_INT);
-
- // Close the current dataset and data space.
- delete dataset;
- delete dataspace;
-
- // Create the data space for the second dataset.
- dims[0] = D2DIM1;
- dims[1] = D2DIM2;
- dataspace = new DataSpace (RANK, dims);
-
- // Create group "Group_A" in group "MyGroup".
- Group group(file.openGroup("/MyGroup/Group_A"));
-
- // Create the second dataset in group "Group_A".
- dataset = new DataSet (group.createDataSet(DATASET_NAME2,
- PredType::STD_I32BE, *dataspace));
-
- // Write the data to the dataset using default memory space, file
- // space, and transfer properties.
- dataset->write(dset2_data, PredType::NATIVE_INT);
-
- // Close all objects.
- delete dataspace;
- delete dataset;
- group.close();
+ hsize_t dims[RANK]; // dataset dimensions
+ dims[0] = D1DIM1;
+ dims[1] = D1DIM2;
+ DataSpace *dataspace = new DataSpace (RANK, dims);
+
+ // Create the dataset in group "MyGroup". Same note as for the
+ // dataspace above.
+ DataSet *dataset = new DataSet (file.createDataSet(DATASET_NAME1,
+ PredType::STD_I32BE, *dataspace));
+
+ // Write the data to the dataset using default memory space, file
+ // space, and transfer properties.
+ dataset->write(dset1_data, PredType::NATIVE_INT);
+
+ // Close the current dataset and data space.
+ delete dataset;
+ delete dataspace;
+
+ // Create the data space for the second dataset.
+ dims[0] = D2DIM1;
+ dims[1] = D2DIM2;
+ dataspace = new DataSpace (RANK, dims);
+
+ // Create group "Group_A" in group "MyGroup".
+ Group group(file.openGroup("/MyGroup/Group_A"));
+
+ // Create the second dataset in group "Group_A".
+ dataset = new DataSet (group.createDataSet(DATASET_NAME2,
+ PredType::STD_I32BE, *dataspace));
+
+ // Write the data to the dataset using default memory space, file
+ // space, and transfer properties.
+ dataset->write(dset2_data, PredType::NATIVE_INT);
+
+ // Close all objects.
+ delete dataspace;
+ delete dataset;
+ group.close();
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSet operations
catch(DataSetIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSpace operations
catch(DataSpaceIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the Group operations
catch(GroupIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
return 0;
diff --git a/c++/examples/h5tutr_extend.cpp b/c++/examples/h5tutr_extend.cpp
index 8c1bc03..b6927ea 100644
--- a/c++/examples/h5tutr_extend.cpp
+++ b/c++/examples/h5tutr_extend.cpp
@@ -1,8 +1,8 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
@@ -24,17 +24,17 @@ using std::endl;
#include "H5Cpp.h"
using namespace H5;
-const H5std_string FILE_NAME("h5tutr_extend.h5");
-const H5std_string DATASETNAME("ExtendibleArray");
+const H5std_string FILE_NAME("h5tutr_extend.h5");
+const H5std_string DATASETNAME("ExtendibleArray");
int main (void)
{
- hsize_t dims[2] = {3,3}; // dataset dimensions at creation
+ hsize_t dims[2] = {3,3}; // dataset dimensions at creation
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
hsize_t chunk_dims[2] ={2, 5};
- int data[3][3] = { {1, 1, 1}, // data to write
- {1, 1, 1},
- {1, 1, 1} };
+ int data[3][3] = { {1, 1, 1}, // data to write
+ {1, 1, 1},
+ {1, 1, 1} };
// Variables used in extending and writing to the extended portion of dataset
@@ -42,127 +42,127 @@ int main (void)
hsize_t offset[2];
hsize_t dimsext[2] = {7, 3}; // extend dimensions
int dataext[7][3] = { {2, 3, 4},
- {2, 3, 4},
- {2, 3, 4},
- {2, 3, 4},
- {2, 3, 4},
- {2, 3, 4},
- {2, 3, 4} };
+ {2, 3, 4},
+ {2, 3, 4},
+ {2, 3, 4},
+ {2, 3, 4},
+ {2, 3, 4},
+ {2, 3, 4} };
// Try block to detect exceptions raised by any of the calls inside it
try
{
- // Turn off the auto-printing when failure occurs so that we can
- // handle the errors appropriately
- Exception::dontPrint();
-
- // Create a new file using the default property lists.
- H5File file(FILE_NAME, H5F_ACC_TRUNC);
-
- // Create the data space for the dataset. Note the use of pointer
- // for the instance 'dataspace'. It can be deleted and used again
- // later for another dataspace. An HDF5 identifier can be closed
- // by the destructor or the method 'close()'.
- DataSpace *dataspace = new DataSpace (2, dims, maxdims);
-
- // Modify dataset creation property to enable chunking
- DSetCreatPropList prop;
- prop.setChunk(2, chunk_dims);
-
- // Create the chunked dataset. Note the use of pointer.
- DataSet *dataset = new DataSet(file.createDataSet( DATASETNAME,
- PredType::STD_I32BE, *dataspace, prop) );
+ // Turn off the auto-printing when failure occurs so that we can
+ // handle the errors appropriately
+ Exception::dontPrint();
+
+ // Create a new file using the default property lists.
+ H5File file(FILE_NAME, H5F_ACC_TRUNC);
+
+ // Create the data space for the dataset. Note the use of pointer
+ // for the instance 'dataspace'. It can be deleted and used again
+ // later for another dataspace. An HDF5 identifier can be closed
+ // by the destructor or the method 'close()'.
+ DataSpace *dataspace = new DataSpace (2, dims, maxdims);
+
+ // Modify dataset creation property to enable chunking
+ DSetCreatPropList prop;
+ prop.setChunk(2, chunk_dims);
+
+ // Create the chunked dataset. Note the use of pointer.
+ DataSet *dataset = new DataSet(file.createDataSet( DATASETNAME,
+ PredType::STD_I32BE, *dataspace, prop) );
- // Write data to dataset.
- dataset->write(data, PredType::NATIVE_INT);
-
- // Extend the dataset. Dataset becomes 10 x 3.
- size[0] = dims[0] + dimsext[0];
- size[1] = dims[1];
- dataset->extend(size);
-
- // Select a hyperslab in extended portion of the dataset.
- DataSpace *filespace = new DataSpace(dataset->getSpace ());
- offset[0] = 3;
- offset[1] = 0;
- filespace->selectHyperslab(H5S_SELECT_SET, dimsext, offset);
-
- // Define memory space.
- DataSpace *memspace = new DataSpace(2, dimsext, NULL);
-
- // Write data to the extended portion of the dataset.
- dataset->write(dataext, PredType::NATIVE_INT, *memspace, *filespace);
-
- // Close all objects and file.
- prop.close();
- delete filespace;
- delete memspace;
- delete dataspace;
- delete dataset;
- file.close();
-
- // ---------------------------------------
- // Re-open the file and read the data back
- // ---------------------------------------
-
- int rdata[10][3];
- int i,j, rank, rank_chunk;
- hsize_t chunk_dimsr[2], dimsr[2];
-
- // Open the file and dataset.
- file.openFile(FILE_NAME, H5F_ACC_RDONLY);
- dataset = new DataSet(file.openDataSet( DATASETNAME));
-
- // Get the dataset's dataspace and creation property list.
- filespace = new DataSpace(dataset->getSpace());
- prop = dataset->getCreatePlist();
-
- // Get information to obtain memory dataspace.
- rank = filespace->getSimpleExtentNdims();
- herr_t status_n = filespace->getSimpleExtentDims(dimsr);
-
- if (H5D_CHUNKED == prop.getLayout())
- rank_chunk = prop.getChunk(rank, chunk_dimsr);
- cout << "rank chunk = " << rank_chunk << endl;;
-
- memspace = new DataSpace(rank, dimsr, NULL);
- dataset->read(rdata, PredType::NATIVE_INT, *memspace, *filespace);
+ // Write data to dataset.
+ dataset->write(data, PredType::NATIVE_INT);
+
+ // Extend the dataset. Dataset becomes 10 x 3.
+ size[0] = dims[0] + dimsext[0];
+ size[1] = dims[1];
+ dataset->extend(size);
+
+ // Select a hyperslab in extended portion of the dataset.
+ DataSpace *filespace = new DataSpace(dataset->getSpace ());
+ offset[0] = 3;
+ offset[1] = 0;
+ filespace->selectHyperslab(H5S_SELECT_SET, dimsext, offset);
+
+ // Define memory space.
+ DataSpace *memspace = new DataSpace(2, dimsext, NULL);
+
+ // Write data to the extended portion of the dataset.
+ dataset->write(dataext, PredType::NATIVE_INT, *memspace, *filespace);
+
+ // Close all objects and file.
+ prop.close();
+ delete filespace;
+ delete memspace;
+ delete dataspace;
+ delete dataset;
+ file.close();
+
+ // ---------------------------------------
+ // Re-open the file and read the data back
+ // ---------------------------------------
+
+ int rdata[10][3];
+ int i,j, rank, rank_chunk;
+ hsize_t chunk_dimsr[2], dimsr[2];
+
+ // Open the file and dataset.
+ file.openFile(FILE_NAME, H5F_ACC_RDONLY);
+ dataset = new DataSet(file.openDataSet( DATASETNAME));
+
+ // Get the dataset's dataspace and creation property list.
+ filespace = new DataSpace(dataset->getSpace());
+ prop = dataset->getCreatePlist();
+
+ // Get information to obtain memory dataspace.
+ rank = filespace->getSimpleExtentNdims();
+ herr_t status_n = filespace->getSimpleExtentDims(dimsr);
+
+ if (H5D_CHUNKED == prop.getLayout())
+ rank_chunk = prop.getChunk(rank, chunk_dimsr);
+ cout << "rank chunk = " << rank_chunk << endl;;
+
+ memspace = new DataSpace(rank, dimsr, NULL);
+ dataset->read(rdata, PredType::NATIVE_INT, *memspace, *filespace);
- cout << endl;
- for (j = 0; j < dimsr[0]; j++) {
- for (i = 0; i < dimsr[1]; i++)
- cout << " " << rdata[j][i];
- cout << endl;
- }
-
- // Close all objects and file.
- prop.close();
- delete filespace;
- delete memspace;
- delete dataset;
- file.close();
+ cout << endl;
+ for (j = 0; j < dimsr[0]; j++) {
+ for (i = 0; i < dimsr[1]; i++)
+ cout << " " << rdata[j][i];
+ cout << endl;
+ }
+
+ // Close all objects and file.
+ prop.close();
+ delete filespace;
+ delete memspace;
+ delete dataset;
+ file.close();
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSet operations
catch(DataSetIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSpace operations
catch(DataSpaceIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
return 0; // successfully terminated
diff --git a/c++/examples/h5tutr_rdwt.cpp b/c++/examples/h5tutr_rdwt.cpp
index 4c9d49e..f17e6a5 100644
--- a/c++/examples/h5tutr_rdwt.cpp
+++ b/c++/examples/h5tutr_rdwt.cpp
@@ -1,8 +1,8 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
@@ -21,10 +21,10 @@
#include "H5Cpp.h"
using namespace H5;
-const H5std_string FILE_NAME("h5tutr_dset.h5");
-const H5std_string DATASET_NAME("dset");
-const int DIM0 = 4; // dataset dimensions
-const int DIM1 = 6;
+const H5std_string FILE_NAME("h5tutr_dset.h5");
+const H5std_string DATASET_NAME("dset");
+const int DIM0 = 4; // dataset dimensions
+const int DIM1 = 6;
int main (void)
{
@@ -32,41 +32,41 @@ int main (void)
// Data initialization.
int i, j;
- int data[DIM0][DIM1]; // buffer for data to write
+ int data[DIM0][DIM1]; // buffer for data to write
for (j = 0; j < DIM0; j++)
- for (i = 0; i < DIM1; i++)
- data[j][i] = i * 6 + j + 1;
+ for (i = 0; i < DIM1; i++)
+ data[j][i] = i * 6 + j + 1;
// Try block to detect exceptions raised by any of the calls inside it
try
{
- // Turn off the auto-printing when failure occurs so that we can
- // handle the errors appropriately
- Exception::dontPrint();
+ // Turn off the auto-printing when failure occurs so that we can
+ // handle the errors appropriately
+ Exception::dontPrint();
- // Open an existing file and dataset.
- H5File file(FILE_NAME, H5F_ACC_RDWR);
- DataSet dataset = file.openDataSet(DATASET_NAME);
+ // Open an existing file and dataset.
+ H5File file(FILE_NAME, H5F_ACC_RDWR);
+ DataSet dataset = file.openDataSet(DATASET_NAME);
- // Write the data to the dataset using default memory space, file
- // space, and transfer properties.
- dataset.write(data, PredType::NATIVE_INT);
+ // Write the data to the dataset using default memory space, file
+ // space, and transfer properties.
+ dataset.write(data, PredType::NATIVE_INT);
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSet operations
catch(DataSetIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
return 0; // successfully terminated
diff --git a/c++/examples/h5tutr_subset.cpp b/c++/examples/h5tutr_subset.cpp
index 14a9ced..0747880 100644
--- a/c++/examples/h5tutr_subset.cpp
+++ b/c++/examples/h5tutr_subset.cpp
@@ -1,8 +1,8 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
@@ -24,13 +24,13 @@ using std::endl;
#include "H5Cpp.h"
using namespace H5;
-const H5std_string FILE_NAME("h5tutr_subset.h5");
-const H5std_string DATASET_NAME("IntArray");
+const H5std_string FILE_NAME("h5tutr_subset.h5");
+const H5std_string DATASET_NAME("IntArray");
const int RANK = 2;
-const int DIM0_SUB = 3; // subset dimensions
+const int DIM0_SUB = 3; // subset dimensions
const int DIM1_SUB = 4;
-const int DIM0 = 8; // size of dataset
+const int DIM0 = 8; // size of dataset
const int DIM1 = 10;
int main (void)
@@ -41,134 +41,134 @@ int main (void)
// Try block to detect exceptions raised by any of the calls inside it
try
{
- // Turn off the auto-printing when failure occurs so that we can
- // handle the errors appropriately
- Exception::dontPrint();
-
- // ---------------------------------------------------
- // Create a new file using the default property lists.
- // Then create a dataset and write data to it.
- // Close the file and dataset.
- // ---------------------------------------------------
+ // Turn off the auto-printing when failure occurs so that we can
+ // handle the errors appropriately
+ Exception::dontPrint();
+
+ // ---------------------------------------------------
+ // Create a new file using the default property lists.
+ // Then create a dataset and write data to it.
+ // Close the file and dataset.
+ // ---------------------------------------------------
- H5File file(FILE_NAME, H5F_ACC_TRUNC);
+ H5File file(FILE_NAME, H5F_ACC_TRUNC);
- hsize_t dims[2];
- dims[0] = DIM0;
- dims[1] = DIM1;
- DataSpace dataspace = DataSpace (RANK, dims);
+ hsize_t dims[2];
+ dims[0] = DIM0;
+ dims[1] = DIM1;
+ DataSpace dataspace = DataSpace (RANK, dims);
- DataSet dataset(file.createDataSet( DATASET_NAME,
- PredType::STD_I32BE, dataspace) );
+ DataSet dataset(file.createDataSet( DATASET_NAME,
+ PredType::STD_I32BE, dataspace) );
- for (j = 0; j < DIM0; j++) {
- for (i = 0; i < DIM1; i++)
- if (i< (DIM1/2))
- data[j][i] = 1;
- else
- data[j][i] = 2;
- }
+ for (j = 0; j < DIM0; j++) {
+ for (i = 0; i < DIM1; i++)
+ if (i< (DIM1/2))
+ data[j][i] = 1;
+ else
+ data[j][i] = 2;
+ }
- dataset.write(data, PredType::NATIVE_INT);
+ dataset.write(data, PredType::NATIVE_INT);
- cout << endl << "Data Written to File:" << endl;
- for (j = 0; j < DIM0; j++) {
- for (i = 0; i < DIM1; i++)
- cout << " " << data[j][i];
- cout << endl;
- }
+ cout << endl << "Data Written to File:" << endl;
+ for (j = 0; j < DIM0; j++) {
+ for (i = 0; i < DIM1; i++)
+ cout << " " << data[j][i];
+ cout << endl;
+ }
- dataspace.close();
- dataset.close();
- file.close();
+ dataspace.close();
+ dataset.close();
+ file.close();
- // ---------------------------------------------------
- // Reopen the file and dataset and write a subset of
- // values to the dataset.
- // ---------------------------------------------------
+ // ---------------------------------------------------
+ // Reopen the file and dataset and write a subset of
+ // values to the dataset.
+ // ---------------------------------------------------
- hsize_t offset[2], count[2], stride[2], block[2];
- hsize_t dimsm[2];
+ hsize_t offset[2], count[2], stride[2], block[2];
+ hsize_t dimsm[2];
- file.openFile(FILE_NAME, H5F_ACC_RDWR);
- dataset = file.openDataSet(DATASET_NAME);
+ file.openFile(FILE_NAME, H5F_ACC_RDWR);
+ dataset = file.openDataSet(DATASET_NAME);
- // Specify size and shape of subset to write.
+ // Specify size and shape of subset to write.
- offset[0] = 1;
- offset[1] = 2;
+ offset[0] = 1;
+ offset[1] = 2;
- count[0] = DIM0_SUB;
- count[1] = DIM1_SUB;
+ count[0] = DIM0_SUB;
+ count[1] = DIM1_SUB;
- stride[0] = 1;
- stride[1] = 1;
+ stride[0] = 1;
+ stride[1] = 1;
- block[0] = 1;
- block[1] = 1;
+ block[0] = 1;
+ block[1] = 1;
- // Define Memory Dataspace. Get file dataspace and select
- // a subset from the file dataspace.
+ // Define Memory Dataspace. Get file dataspace and select
+ // a subset from the file dataspace.
- dimsm[0] = DIM0_SUB;
- dimsm[1] = DIM1_SUB;
+ dimsm[0] = DIM0_SUB;
+ dimsm[1] = DIM1_SUB;
- DataSpace memspace(RANK, dimsm, NULL);
+ DataSpace memspace(RANK, dimsm, NULL);
- dataspace = dataset.getSpace();
- dataspace.selectHyperslab(H5S_SELECT_SET, count, offset, stride, block);
+ dataspace = dataset.getSpace();
+ dataspace.selectHyperslab(H5S_SELECT_SET, count, offset, stride, block);
- // Write a subset of data to the dataset, then read the
- // entire dataset back from the file.
+ // Write a subset of data to the dataset, then read the
+ // entire dataset back from the file.
- cout << endl << "Write subset to file specifying: " << endl;
- cout << " offset=1x2 stride=1x1 count=3x4 block=1x1" << endl;
- for (j = 0; j < DIM0_SUB; j++) {
- for (i = 0; i < DIM1_SUB; i++)
- sdata[j][i] = 5;
- }
-
- dataset.write(sdata, PredType::NATIVE_INT, memspace, dataspace);
- dataset.read(rdata, PredType::NATIVE_INT);
+ cout << endl << "Write subset to file specifying: " << endl;
+ cout << " offset=1x2 stride=1x1 count=3x4 block=1x1" << endl;
+ for (j = 0; j < DIM0_SUB; j++) {
+ for (i = 0; i < DIM1_SUB; i++)
+ sdata[j][i] = 5;
+ }
+
+ dataset.write(sdata, PredType::NATIVE_INT, memspace, dataspace);
+ dataset.read(rdata, PredType::NATIVE_INT);
- cout << endl << "Data in File after Subset is Written:" << endl;
- for (i = 0; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++)
- cout << " " << rdata[i][j];
- cout << endl;
- }
- cout << endl;
-
- // It is not necessary to close these objects because close() will
- // be called when the object instances are going out of scope.
- dataspace.close();
- memspace.close();
- dataset.close();
- file.close();
+ cout << endl << "Data in File after Subset is Written:" << endl;
+ for (i = 0; i < DIM0; i++) {
+ for (j = 0; j < DIM1; j++)
+ cout << " " << rdata[i][j];
+ cout << endl;
+ }
+ cout << endl;
+
+ // It is not necessary to close these objects because close() will
+ // be called when the object instances are going out of scope.
+ dataspace.close();
+ memspace.close();
+ dataset.close();
+ file.close();
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSet operations
catch(DataSetIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSpace operations
catch(DataSpaceIException error)
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
return 0; // successfully terminated
diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp
index 5a2f3bc..3df8191 100644
--- a/c++/examples/readdata.cpp
+++ b/c++/examples/readdata.cpp
@@ -31,9 +31,9 @@ using namespace H5;
const H5std_string FILE_NAME( "SDS.h5" );
const H5std_string DATASET_NAME( "IntArray" );
-const int NX_SUB = 3; // hyperslab dimensions
+const int NX_SUB = 3; // hyperslab dimensions
const int NY_SUB = 4;
-const int NX = 7; // output buffer dimensions
+const int NX = 7; // output buffer dimensions
const int NY = 7;
const int NZ = 3;
const int RANK_OUT = 3;
@@ -49,8 +49,8 @@ int main (void)
{
for (i = 0; i < NY; i++)
{
- for (k = 0; k < NZ ; k++)
- data_out[j][i][k] = 0;
+ for (k = 0; k < NZ ; k++)
+ data_out[j][i][k] = 0;
}
}
@@ -81,19 +81,19 @@ int main (void)
*/
if( type_class == H5T_INTEGER )
{
- cout << "Data set has INTEGER type" << endl;
+ cout << "Data set has INTEGER type" << endl;
/*
- * Get the integer datatype
+ * Get the integer datatype
*/
- IntType intype = dataset.getIntType();
+ IntType intype = dataset.getIntType();
/*
* Get order of datatype and print message if it's a little endian.
*/
- H5std_string order_string;
+ H5std_string order_string;
H5T_order_t order = intype.getOrder( order_string );
- cout << order_string << endl;
+ cout << order_string << endl;
/*
* Get size of the data element stored in file and print it.
@@ -119,15 +119,15 @@ int main (void)
hsize_t dims_out[2];
int ndims = dataspace.getSimpleExtentDims( dims_out, NULL);
cout << "rank " << rank << ", dimensions " <<
- (unsigned long)(dims_out[0]) << " x " <<
- (unsigned long)(dims_out[1]) << endl;
+ (unsigned long)(dims_out[0]) << " x " <<
+ (unsigned long)(dims_out[1]) << endl;
/*
* Define hyperslab in the dataset; implicitly giving strike and
* block NULL.
*/
- hsize_t offset[2]; // hyperslab offset in the file
- hsize_t count[2]; // size of the hyperslab in the file
+ hsize_t offset[2]; // hyperslab offset in the file
+ hsize_t count[2]; // size of the hyperslab in the file
offset[0] = 1;
offset[1] = 2;
count[0] = NX_SUB;
@@ -146,8 +146,8 @@ int main (void)
/*
* Define memory hyperslab.
*/
- hsize_t offset_out[3]; // hyperslab offset in memory
- hsize_t count_out[3]; // size of the hyperslab in memory
+ hsize_t offset_out[3]; // hyperslab offset in memory
+ hsize_t count_out[3]; // size of the hyperslab in memory
offset_out[0] = 3;
offset_out[1] = 0;
offset_out[2] = 0;
@@ -164,9 +164,9 @@ int main (void)
for (j = 0; j < NX; j++)
{
- for (i = 0; i < NY; i++)
- cout << data_out[j][i][0] << " ";
- cout << endl;
+ for (i = 0; i < NY; i++)
+ cout << data_out[j][i][0] << " ";
+ cout << endl;
}
/*
* 0 0 0 0 0 0 0
diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp
index f5c06cf..eada2ed 100644
--- a/c++/examples/writedata.cpp
+++ b/c++/examples/writedata.cpp
@@ -34,19 +34,19 @@ using namespace H5;
const H5std_string FILE_NAME( "Select.h5" );
const H5std_string DATASET_NAME( "Matrix in file" );
-const int MSPACE1_RANK = 1; // Rank of the first dataset in memory
+const int MSPACE1_RANK = 1; // Rank of the first dataset in memory
const int MSPACE1_DIM = 50; // Dataset size in memory
-const int MSPACE2_RANK = 1; // Rank of the second dataset in memory
-const int MSPACE2_DIM = 4; // Dataset size in memory
-const int FSPACE_RANK = 2; // Dataset rank as it is stored in the file
-const int FSPACE_DIM1 = 8; // Dimension sizes of the dataset as it is
-const int FSPACE_DIM2 = 12; // stored in the file
-const int MSPACE_RANK = 2; // Rank of the first dataset in memory
-const int MSPACE_DIM1 = 8; // We will read dataset back from the file
-const int MSPACE_DIM2 = 9; // to the dataset in memory with these
- // dataspace parameters
-const int NPOINTS = 4; // Number of points that will be selected
- // and overwritten
+const int MSPACE2_RANK = 1; // Rank of the second dataset in memory
+const int MSPACE2_DIM = 4; // Dataset size in memory
+const int FSPACE_RANK = 2; // Dataset rank as it is stored in the file
+const int FSPACE_DIM1 = 8; // Dimension sizes of the dataset as it is
+const int FSPACE_DIM2 = 12; // stored in the file
+const int MSPACE_RANK = 2; // Rank of the first dataset in memory
+const int MSPACE_DIM1 = 8; // We will read dataset back from the file
+const int MSPACE_DIM2 = 9; // to the dataset in memory with these
+ // dataspace parameters
+const int NPOINTS = 4; // Number of points that will be selected
+ // and overwritten
int main (void)
{
@@ -57,271 +57,271 @@ int main (void)
*/
try
{
- /*
- * Turn off the auto-printing when failure occurs so that we can
- * handle the errors appropriately
- */
- Exception::dontPrint();
-
- /*
- * Create a file.
- */
- H5File* file = new H5File( FILE_NAME, H5F_ACC_TRUNC );
-
- /*
- * Create property list for a dataset and set up fill values.
- */
- int fillvalue = 0; /* Fill value for the dataset */
- DSetCreatPropList plist;
- plist.setFillValue(PredType::NATIVE_INT, &fillvalue);
-
- /*
- * Create dataspace for the dataset in the file.
- */
- hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2}; // dim sizes of ds (on disk)
- DataSpace fspace( FSPACE_RANK, fdim );
-
- /*
- * Create dataset and write it into the file.
- */
- DataSet* dataset = new DataSet(file->createDataSet(
- DATASET_NAME, PredType::NATIVE_INT, fspace, plist));
-
- /*
- * Select hyperslab for the dataset in the file, using 3x2 blocks,
- * (4,3) stride and (2,4) count starting at the position (0,1).
- */
- hsize_t start[2]; // Start of hyperslab
- hsize_t stride[2]; // Stride of hyperslab
- hsize_t count[2]; // Block count
- hsize_t block[2]; // Block sizes
- start[0] = 0; start[1] = 1;
- stride[0] = 4; stride[1] = 3;
- count[0] = 2; count[1] = 4;
- block[0] = 3; block[1] = 2;
- fspace.selectHyperslab( H5S_SELECT_SET, count, start, stride, block);
-
- /*
- * Create dataspace for the first dataset.
- */
- hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset
- (in memory) */
- DataSpace mspace1( MSPACE1_RANK, dim1 );
-
- /*
- * Select hyperslab.
- * We will use 48 elements of the vector buffer starting at the
- * second element. Selected elements are 1 2 3 . . . 48
- */
- start[0] = 1;
- stride[0] = 1;
- count[0] = 48;
- block[0] = 1;
- mspace1.selectHyperslab( H5S_SELECT_SET, count, start, stride, block);
-
- /*
- * Write selection from the vector buffer to the dataset in the file.
- *
- * File dataset should look like this:
- * 0 1 2 0 3 4 0 5 6 0 7 8
- * 0 9 10 0 11 12 0 13 14 0 15 16
- * 0 17 18 0 19 20 0 21 22 0 23 24
- * 0 0 0 0 0 0 0 0 0 0 0 0
- * 0 25 26 0 27 28 0 29 30 0 31 32
- * 0 33 34 0 35 36 0 37 38 0 39 40
- * 0 41 42 0 43 44 0 45 46 0 47 48
- * 0 0 0 0 0 0 0 0 0 0 0 0
- */
- int vector[MSPACE1_DIM]; // vector buffer for dset
-
- /*
- * Buffer initialization.
- */
- vector[0] = vector[MSPACE1_DIM - 1] = -1;
- for (i = 1; i < MSPACE1_DIM - 1; i++)
- vector[i] = i;
-
- dataset->write( vector, PredType::NATIVE_INT, mspace1, fspace );
-
- /*
- * Reset the selection for the file dataspace fid.
- */
- fspace.selectNone();
-
- /*
- * Create dataspace for the second dataset.
- */
- hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second dataset
- (in memory */
- DataSpace mspace2( MSPACE2_RANK, dim2 );
-
- /*
- * Select sequence of NPOINTS points in the file dataspace.
- */
- hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
- from the file dataspace */
- coord[0][0] = 0; coord[0][1] = 0;
- coord[1][0] = 3; coord[1][1] = 3;
- coord[2][0] = 3; coord[2][1] = 5;
- coord[3][0] = 5; coord[3][1] = 6;
-
- fspace.selectElements( H5S_SELECT_SET, NPOINTS, (const hsize_t *)coord);
-
- /*
- * Write new selection of points to the dataset.
- */
- int values[] = {53, 59, 61, 67}; /* New values to be written */
- dataset->write( values, PredType::NATIVE_INT, mspace2, fspace );
-
- /*
- * File dataset should look like this:
- * 53 1 2 0 3 4 0 5 6 0 7 8
- * 0 9 10 0 11 12 0 13 14 0 15 16
- * 0 17 18 0 19 20 0 21 22 0 23 24
- * 0 0 0 59 0 61 0 0 0 0 0 0
- * 0 25 26 0 27 28 0 29 30 0 31 32
- * 0 33 34 0 35 36 67 37 38 0 39 40
- * 0 41 42 0 43 44 0 45 46 0 47 48
- * 0 0 0 0 0 0 0 0 0 0 0 0
- *
- */
-
- /*
- * Close the dataset and the file.
- */
- delete dataset;
- delete file;
-
- /*
- * Open the file.
- */
- file = new H5File( FILE_NAME, H5F_ACC_RDONLY );
-
- /*
- * Open the dataset.
- */
- dataset = new DataSet( file->openDataSet( DATASET_NAME ));
-
- /*
- * Get dataspace of the dataset.
- */
- fspace = dataset->getSpace();
-
- /*
- * Select first hyperslab for the dataset in the file. The following
- * elements are selected:
- * 10 0 11 12
- * 18 0 19 20
- * 0 59 0 61
- *
- */
- start[0] = 1; start[1] = 2;
- block[0] = 1; block[1] = 1;
- stride[0] = 1; stride[1] = 1;
- count[0] = 3; count[1] = 4;
- fspace.selectHyperslab(H5S_SELECT_SET, count, start, stride, block);
-
- /*
- * Add second selected hyperslab to the selection.
- * The following elements are selected:
- * 19 20 0 21 22
- * 0 61 0 0 0
- * 27 28 0 29 30
- * 35 36 67 37 38
- * 43 44 0 45 46
- * 0 0 0 0 0
- * Note that two hyperslabs overlap. Common elements are:
- * 19 20
- * 0 61
- */
- start[0] = 2; start[1] = 4;
- block[0] = 1; block[1] = 1;
- stride[0] = 1; stride[1] = 1;
- count[0] = 6; count[1] = 5;
- fspace.selectHyperslab(H5S_SELECT_OR, count, start, stride, block);
-
- /*
- * Create memory dataspace.
- */
- hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the
+ /*
+ * Turn off the auto-printing when failure occurs so that we can
+ * handle the errors appropriately
+ */
+ Exception::dontPrint();
+
+ /*
+ * Create a file.
+ */
+ H5File* file = new H5File( FILE_NAME, H5F_ACC_TRUNC );
+
+ /*
+ * Create property list for a dataset and set up fill values.
+ */
+ int fillvalue = 0; /* Fill value for the dataset */
+ DSetCreatPropList plist;
+ plist.setFillValue(PredType::NATIVE_INT, &fillvalue);
+
+ /*
+ * Create dataspace for the dataset in the file.
+ */
+ hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2}; // dim sizes of ds (on disk)
+ DataSpace fspace( FSPACE_RANK, fdim );
+
+ /*
+ * Create dataset and write it into the file.
+ */
+ DataSet* dataset = new DataSet(file->createDataSet(
+ DATASET_NAME, PredType::NATIVE_INT, fspace, plist));
+
+ /*
+ * Select hyperslab for the dataset in the file, using 3x2 blocks,
+ * (4,3) stride and (2,4) count starting at the position (0,1).
+ */
+ hsize_t start[2]; // Start of hyperslab
+ hsize_t stride[2]; // Stride of hyperslab
+ hsize_t count[2]; // Block count
+ hsize_t block[2]; // Block sizes
+ start[0] = 0; start[1] = 1;
+ stride[0] = 4; stride[1] = 3;
+ count[0] = 2; count[1] = 4;
+ block[0] = 3; block[1] = 2;
+ fspace.selectHyperslab( H5S_SELECT_SET, count, start, stride, block);
+
+ /*
+ * Create dataspace for the first dataset.
+ */
+ hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset
+ (in memory) */
+ DataSpace mspace1( MSPACE1_RANK, dim1 );
+
+ /*
+ * Select hyperslab.
+ * We will use 48 elements of the vector buffer starting at the
+ * second element. Selected elements are 1 2 3 . . . 48
+ */
+ start[0] = 1;
+ stride[0] = 1;
+ count[0] = 48;
+ block[0] = 1;
+ mspace1.selectHyperslab( H5S_SELECT_SET, count, start, stride, block);
+
+ /*
+ * Write selection from the vector buffer to the dataset in the file.
+ *
+ * File dataset should look like this:
+ * 0 1 2 0 3 4 0 5 6 0 7 8
+ * 0 9 10 0 11 12 0 13 14 0 15 16
+ * 0 17 18 0 19 20 0 21 22 0 23 24
+ * 0 0 0 0 0 0 0 0 0 0 0 0
+ * 0 25 26 0 27 28 0 29 30 0 31 32
+ * 0 33 34 0 35 36 0 37 38 0 39 40
+ * 0 41 42 0 43 44 0 45 46 0 47 48
+ * 0 0 0 0 0 0 0 0 0 0 0 0
+ */
+ int vector[MSPACE1_DIM]; // vector buffer for dset
+
+ /*
+ * Buffer initialization.
+ */
+ vector[0] = vector[MSPACE1_DIM - 1] = -1;
+ for (i = 1; i < MSPACE1_DIM - 1; i++)
+ vector[i] = i;
+
+ dataset->write( vector, PredType::NATIVE_INT, mspace1, fspace );
+
+ /*
+ * Reset the selection for the file dataspace fid.
+ */
+ fspace.selectNone();
+
+ /*
+ * Create dataspace for the second dataset.
+ */
+ hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second dataset
+ (in memory */
+ DataSpace mspace2( MSPACE2_RANK, dim2 );
+
+ /*
+ * Select sequence of NPOINTS points in the file dataspace.
+ */
+ hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
+ from the file dataspace */
+ coord[0][0] = 0; coord[0][1] = 0;
+ coord[1][0] = 3; coord[1][1] = 3;
+ coord[2][0] = 3; coord[2][1] = 5;
+ coord[3][0] = 5; coord[3][1] = 6;
+
+ fspace.selectElements( H5S_SELECT_SET, NPOINTS, (const hsize_t *)coord);
+
+ /*
+ * Write new selection of points to the dataset.
+ */
+ int values[] = {53, 59, 61, 67}; /* New values to be written */
+ dataset->write( values, PredType::NATIVE_INT, mspace2, fspace );
+
+ /*
+ * File dataset should look like this:
+ * 53 1 2 0 3 4 0 5 6 0 7 8
+ * 0 9 10 0 11 12 0 13 14 0 15 16
+ * 0 17 18 0 19 20 0 21 22 0 23 24
+ * 0 0 0 59 0 61 0 0 0 0 0 0
+ * 0 25 26 0 27 28 0 29 30 0 31 32
+ * 0 33 34 0 35 36 67 37 38 0 39 40
+ * 0 41 42 0 43 44 0 45 46 0 47 48
+ * 0 0 0 0 0 0 0 0 0 0 0 0
+ *
+ */
+
+ /*
+ * Close the dataset and the file.
+ */
+ delete dataset;
+ delete file;
+
+ /*
+ * Open the file.
+ */
+ file = new H5File( FILE_NAME, H5F_ACC_RDONLY );
+
+ /*
+ * Open the dataset.
+ */
+ dataset = new DataSet( file->openDataSet( DATASET_NAME ));
+
+ /*
+ * Get dataspace of the dataset.
+ */
+ fspace = dataset->getSpace();
+
+ /*
+ * Select first hyperslab for the dataset in the file. The following
+ * elements are selected:
+ * 10 0 11 12
+ * 18 0 19 20
+ * 0 59 0 61
+ *
+ */
+ start[0] = 1; start[1] = 2;
+ block[0] = 1; block[1] = 1;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 3; count[1] = 4;
+ fspace.selectHyperslab(H5S_SELECT_SET, count, start, stride, block);
+
+ /*
+ * Add second selected hyperslab to the selection.
+ * The following elements are selected:
+ * 19 20 0 21 22
+ * 0 61 0 0 0
+ * 27 28 0 29 30
+ * 35 36 67 37 38
+ * 43 44 0 45 46
+ * 0 0 0 0 0
+ * Note that two hyperslabs overlap. Common elements are:
+ * 19 20
+ * 0 61
+ */
+ start[0] = 2; start[1] = 4;
+ block[0] = 1; block[1] = 1;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 6; count[1] = 5;
+ fspace.selectHyperslab(H5S_SELECT_OR, count, start, stride, block);
+
+ /*
+ * Create memory dataspace.
+ */
+ hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the
dataset in memory when we
read selection from the
dataset on the disk */
- DataSpace mspace(MSPACE_RANK, mdim);
-
- /*
- * Select two hyperslabs in memory. Hyperslabs has the same
- * size and shape as the selected hyperslabs for the file dataspace.
- */
- start[0] = 0; start[1] = 0;
- block[0] = 1; block[1] = 1;
- stride[0] = 1; stride[1] = 1;
- count[0] = 3; count[1] = 4;
- mspace.selectHyperslab(H5S_SELECT_SET, count, start, stride, block);
- start[0] = 1; start[1] = 2;
- block[0] = 1; block[1] = 1;
- stride[0] = 1; stride[1] = 1;
- count[0] = 6; count[1] = 5;
- mspace.selectHyperslab(H5S_SELECT_OR, count, start, stride, block);
-
- /*
- * Initialize data buffer.
- */
- int matrix_out[MSPACE_DIM1][MSPACE_DIM2];
- for (i = 0; i < MSPACE_DIM1; i++)
- for (j = 0; j < MSPACE_DIM2; j++)
- matrix_out[i][j] = 0;
-
- /*
- * Read data back to the buffer matrix.
- */
- dataset->read(matrix_out, PredType::NATIVE_INT, mspace, fspace);
-
- /*
- * Display the result. Memory dataset is:
- *
- * 10 0 11 12 0 0 0 0 0
- * 18 0 19 20 0 21 22 0 0
- * 0 59 0 61 0 0 0 0 0
- * 0 0 27 28 0 29 30 0 0
- * 0 0 35 36 67 37 38 0 0
- * 0 0 43 44 0 45 46 0 0
- * 0 0 0 0 0 0 0 0 0
- * 0 0 0 0 0 0 0 0 0
- */
- for (i=0; i < MSPACE_DIM1; i++)
- {
- for(j=0; j < MSPACE_DIM2; j++)
- cout << matrix_out[i][j] << " ";
- cout << endl;
- }
-
- /*
- * Close the dataset and the file.
- */
- delete dataset;
- delete file;
+ DataSpace mspace(MSPACE_RANK, mdim);
+
+ /*
+ * Select two hyperslabs in memory. Hyperslabs has the same
+ * size and shape as the selected hyperslabs for the file dataspace.
+ */
+ start[0] = 0; start[1] = 0;
+ block[0] = 1; block[1] = 1;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 3; count[1] = 4;
+ mspace.selectHyperslab(H5S_SELECT_SET, count, start, stride, block);
+ start[0] = 1; start[1] = 2;
+ block[0] = 1; block[1] = 1;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 6; count[1] = 5;
+ mspace.selectHyperslab(H5S_SELECT_OR, count, start, stride, block);
+
+ /*
+ * Initialize data buffer.
+ */
+ int matrix_out[MSPACE_DIM1][MSPACE_DIM2];
+ for (i = 0; i < MSPACE_DIM1; i++)
+ for (j = 0; j < MSPACE_DIM2; j++)
+ matrix_out[i][j] = 0;
+
+ /*
+ * Read data back to the buffer matrix.
+ */
+ dataset->read(matrix_out, PredType::NATIVE_INT, mspace, fspace);
+
+ /*
+ * Display the result. Memory dataset is:
+ *
+ * 10 0 11 12 0 0 0 0 0
+ * 18 0 19 20 0 21 22 0 0
+ * 0 59 0 61 0 0 0 0 0
+ * 0 0 27 28 0 29 30 0 0
+ * 0 0 35 36 67 37 38 0 0
+ * 0 0 43 44 0 45 46 0 0
+ * 0 0 0 0 0 0 0 0 0
+ * 0 0 0 0 0 0 0 0 0
+ */
+ for (i=0; i < MSPACE_DIM1; i++)
+ {
+ for(j=0; j < MSPACE_DIM2; j++)
+ cout << matrix_out[i][j] << " ";
+ cout << endl;
+ }
+
+ /*
+ * Close the dataset and the file.
+ */
+ delete dataset;
+ delete file;
} // end of try block
// catch failure caused by the H5File operations
catch( FileIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
// catch failure caused by the DataSpace operations
catch( DataSpaceIException error )
{
- error.printErrorStack();
- return -1;
+ error.printErrorStack();
+ return -1;
}
return 0;
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index 945b352..2a92ed2 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -84,24 +84,26 @@ set (CPP_HDRS
${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.h
)
-add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS})
-target_include_directories(${HDF5_CPP_LIB_TARGET}
- PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-target_compile_definitions(${HDF5_CPP_LIB_TARGET}
- PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings
-)
-TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC)
-target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
-set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}")
-H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} STATIC 0)
-set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp)
-set (install_targets ${HDF5_CPP_LIB_TARGET})
+if (NOT ONLY_SHARED_LIBS)
+ add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS})
+ target_include_directories (${HDF5_CPP_LIB_TARGET}
+ PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ target_compile_definitions(${HDF5_CPP_LIB_TARGET}
+ PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings
+ )
+ TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC)
+ target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
+ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}")
+ H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} STATIC 0)
+ set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp)
+ set (install_targets ${HDF5_CPP_LIB_TARGET})
+endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_CPP_LIBSH_TARGET} SHARED ${CPP_SOURCES} ${CPP_HDRS})
- target_include_directories(${HDF5_CPP_LIBSH_TARGET}
+ target_include_directories (${HDF5_CPP_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
@@ -110,7 +112,14 @@ if (BUILD_SHARED_LIBS)
PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings
)
TARGET_C_PROPERTIES (${HDF5_CPP_LIBSH_TARGET} SHARED)
- target_link_libraries (${HDF5_CPP_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
+ target_link_libraries (${HDF5_CPP_LIBSH_TARGET}
+ PUBLIC ${HDF5_LIBSH_TARGET}
+ )
+ if (MINGW)
+ target_link_options (${HDF5_CPP_LIBSH_TARGET}
+ PRIVATE -static-libgcc -static-libstdc++
+ )
+ endif ()
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIBSH_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_CPP_LIBSH_TARGET} ${HDF5_CPP_LIB_NAME} SHARED "CXX")
set_target_properties (${HDF5_CPP_LIBSH_TARGET} PROPERTIES FOLDER libraries/cpp)
@@ -136,7 +145,9 @@ if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries)
endif ()
- INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries)
+ if (NOT ONLY_SHARED_LIBS)
+ INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} cpplibraries)
+ endif ()
install (
TARGETS
@@ -163,7 +174,9 @@ set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}")
set (_PKG_CONFIG_LIBS_PRIVATE)
-set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_CPP_LIB_CORENAME}")
+if (NOT ONLY_SHARED_LIBS)
+ set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_CPP_LIB_CORENAME}")
+endif ()
if (BUILD_SHARED_LIBS)
set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_CPP_LIB_CORENAME}")
endif ()
@@ -182,7 +195,7 @@ install (
COMPONENT cpplibraries
)
-if (NOT WIN32)
+if (NOT WIN32 AND NOT MINGW)
set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER})
configure_file (
${HDF_RESOURCES_DIR}/libh5cc.in
diff --git a/c++/src/H5LcreatProp.cpp b/c++/src/H5LcreatProp.cpp
index 695c1fe..bde9339 100644
--- a/c++/src/H5LcreatProp.cpp
+++ b/c++/src/H5LcreatProp.cpp
@@ -103,6 +103,46 @@ LinkCreatPropList::LinkCreatPropList(const LinkCreatPropList& original) : PropLi
LinkCreatPropList::LinkCreatPropList(const hid_t plist_id) : PropList(plist_id) {}
//--------------------------------------------------------------------------
+// Function: LinkCreatPropList::setCreateIntermediateGroup
+///\brief Specifies in property list whether to create missing
+/// intermediate groups.
+///\param crt_intmd_group - IN: Flag specifying whether to create
+/// intermediate groups upon the creation of an object
+///\exception H5::PropListIException
+// April, 2019
+//--------------------------------------------------------------------------
+void LinkCreatPropList::setCreateIntermediateGroup(bool crt_intmd_group) const
+{
+ herr_t ret_value = H5Pset_create_intermediate_group(id, (unsigned)crt_intmd_group);
+ // Throw exception if H5Pset_create_intermediate_group returns failure
+ if (ret_value < 0)
+ {
+ throw PropListIException("setCreateIntermediateGroup", "H5Pset_create_intermediate_group failed");
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: LinkCreatPropList::getCreateIntermediateGroup
+///\brief Determines whether property is set to enable creating missing
+/// intermediate groups.
+///\return true if creating intermediate groups is enabled, and false, otherwise
+///\exception H5::PropListIException
+// April, 2019
+//--------------------------------------------------------------------------
+bool LinkCreatPropList::getCreateIntermediateGroup() const
+{
+ unsigned crt_intmd_group;
+ herr_t ret_value = H5Pget_create_intermediate_group(id, &crt_intmd_group);
+ // Throw exception if H5Pget_create_intermediate_group returns failure
+ if (ret_value < 0)
+ {
+ throw PropListIException("getCreateIntermediateGroup", "H5Pget_create_intermediate_group failed");
+ }
+
+ return((bool)crt_intmd_group);
+}
+
+//--------------------------------------------------------------------------
// Function: LinkCreatPropList::setCharEncoding
///\brief Sets the character encoding of the string.
///
diff --git a/c++/src/H5LcreatProp.h b/c++/src/H5LcreatProp.h
index f6e10bf..908ef63 100644
--- a/c++/src/H5LcreatProp.h
+++ b/c++/src/H5LcreatProp.h
@@ -40,6 +40,14 @@ class H5_DLLCPP LinkCreatPropList : public PropList {
// using the property list id.
LinkCreatPropList (const hid_t plist_id);
+ // Specifies in property list whether to create missing
+ // intermediate groups
+ void setCreateIntermediateGroup(bool crt_intmd_group) const;
+
+ // Determines whether property is set to enable creating missing
+ // intermediate groups
+ bool getCreateIntermediateGroup() const;
+
// Sets the character encoding of the string.
void setCharEncoding(H5T_cset_t encoding) const;
diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp
index 2c49016..2641960 100644
--- a/c++/src/H5Location.cpp
+++ b/c++/src/H5Location.cpp
@@ -1066,7 +1066,7 @@ void H5Location::link(const char *curr_name, const Group& new_loc,
hid_t lcpl_id = lcpl.getId();
hid_t lapl_id = lapl.getId();
- ret_value = H5Lcreate_hard(getId(), curr_name, new_loc.getId(), new_name, H5P_DEFAULT, H5P_DEFAULT);
+ ret_value = H5Lcreate_hard(getId(), curr_name, new_loc_id, new_name, lcpl_id, lapl_id);
if (ret_value < 0)
throwException("link", "creating link failed");
}
@@ -1102,14 +1102,13 @@ void H5Location::link(const H5std_string& curr_name, const Group& new_loc,
/// H5Lcreate_hard APIs in the HDF5 C Reference Manual.
// March 2018
//--------------------------------------------------------------------------
-void H5Location::link(const char *curr_name, const hid_t same_loc,
- const char *new_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const
+void H5Location::link(const char *curr_name, const hid_t same_loc, const char *new_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const
{
herr_t ret_value = -1;
hid_t lcpl_id = lcpl.getId();
hid_t lapl_id = lapl.getId();
- ret_value = H5Lcreate_hard(getId(), curr_name, same_loc, new_name, H5P_DEFAULT, H5P_DEFAULT);
+ ret_value = H5Lcreate_hard(getId(), curr_name, same_loc, new_name, lcpl_id, lapl_id);
if (ret_value < 0)
throwException("link", "creating link failed");
diff --git a/c++/src/Makefile.am b/c++/src/Makefile.am
index 949325a..eb50209 100644
--- a/c++/src/Makefile.am
+++ b/c++/src/Makefile.am
@@ -32,15 +32,15 @@ bin_SCRIPTS=h5c++
# Source files for the library
libhdf5_cpp_la_SOURCES=H5Exception.cpp H5IdComponent.cpp \
- H5DataSpace.cpp H5PropList.cpp H5Library.cpp \
- H5FaccProp.cpp H5FcreatProp.cpp H5LcreatProp.cpp \
- H5LaccProp.cpp H5DaccProp.cpp H5DxferProp.cpp \
+ H5DataSpace.cpp H5PropList.cpp H5Library.cpp \
+ H5FaccProp.cpp H5FcreatProp.cpp H5LcreatProp.cpp \
+ H5LaccProp.cpp H5DaccProp.cpp H5DxferProp.cpp \
H5DcreatProp.cpp H5Location.cpp H5AbstractDs.cpp \
H5Attribute.cpp H5Object.cpp H5OcreatProp.cpp \
- H5DataType.cpp H5AtomType.cpp H5PredType.cpp \
+ H5DataType.cpp H5AtomType.cpp H5PredType.cpp \
H5EnumType.cpp H5IntType.cpp H5FloatType.cpp \
H5StrType.cpp H5ArrayType.cpp H5VarLenType.cpp \
- H5CompType.cpp H5DataSet.cpp H5CommonFG.cpp H5Group.cpp \
+ H5CompType.cpp H5DataSet.cpp H5CommonFG.cpp H5Group.cpp \
H5File.cpp
# HDF5 C++ library depends on HDF5 Library.
diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in
index 144c3d2..c7c217f 100644
--- a/c++/src/Makefile.in
+++ b/c++/src/Makefile.in
@@ -497,7 +497,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -520,9 +519,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -549,6 +551,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -603,6 +606,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -627,7 +631,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -744,29 +747,29 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-LT_VERS_INTERFACE = 104
+LT_VERS_INTERFACE = 105
LT_VERS_REVISION = 0
-LT_VERS_AGE = 1
-LT_CXX_VERS_INTERFACE = 104
+LT_VERS_AGE = 2
+LT_CXX_VERS_INTERFACE = 105
LT_CXX_VERS_REVISION = 0
-LT_CXX_VERS_AGE = 1
+LT_CXX_VERS_AGE = 2
LT_F_VERS_INTERFACE = 102
-LT_F_VERS_REVISION = 0
+LT_F_VERS_REVISION = 1
LT_F_VERS_AGE = 0
LT_HL_VERS_INTERFACE = 101
-LT_HL_VERS_REVISION = 2
+LT_HL_VERS_REVISION = 3
LT_HL_VERS_AGE = 1
LT_HL_CXX_VERS_INTERFACE = 101
-LT_HL_CXX_VERS_REVISION = 3
+LT_HL_CXX_VERS_REVISION = 4
LT_HL_CXX_VERS_AGE = 1
LT_HL_F_VERS_INTERFACE = 100
-LT_HL_F_VERS_REVISION = 4
+LT_HL_F_VERS_REVISION = 5
LT_HL_F_VERS_AGE = 0
LT_JAVA_VERS_INTERFACE = 104
-LT_JAVA_VERS_REVISION = 0
+LT_JAVA_VERS_REVISION = 1
LT_JAVA_VERS_AGE = 4
LT_TOOLS_VERS_INTERFACE = 101
-LT_TOOLS_VERS_REVISION = 2
+LT_TOOLS_VERS_REVISION = 3
LT_TOOLS_VERS_AGE = 1
# This is our main target
@@ -778,15 +781,15 @@ bin_SCRIPTS = h5c++
# Source files for the library
libhdf5_cpp_la_SOURCES = H5Exception.cpp H5IdComponent.cpp \
- H5DataSpace.cpp H5PropList.cpp H5Library.cpp \
- H5FaccProp.cpp H5FcreatProp.cpp H5LcreatProp.cpp \
- H5LaccProp.cpp H5DaccProp.cpp H5DxferProp.cpp \
+ H5DataSpace.cpp H5PropList.cpp H5Library.cpp \
+ H5FaccProp.cpp H5FcreatProp.cpp H5LcreatProp.cpp \
+ H5LaccProp.cpp H5DaccProp.cpp H5DxferProp.cpp \
H5DcreatProp.cpp H5Location.cpp H5AbstractDs.cpp \
H5Attribute.cpp H5Object.cpp H5OcreatProp.cpp \
- H5DataType.cpp H5AtomType.cpp H5PredType.cpp \
+ H5DataType.cpp H5AtomType.cpp H5PredType.cpp \
H5EnumType.cpp H5IntType.cpp H5FloatType.cpp \
H5StrType.cpp H5ArrayType.cpp H5VarLenType.cpp \
- H5CompType.cpp H5DataSet.cpp H5CommonFG.cpp H5Group.cpp \
+ H5CompType.cpp H5DataSet.cpp H5CommonFG.cpp H5Group.cpp \
H5File.cpp
@@ -1450,7 +1453,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config
index e2ed648..e3a3d0e 100644
--- a/c++/src/cpp_doc_config
+++ b/c++/src/cpp_doc_config
@@ -38,7 +38,7 @@ PROJECT_NAME =
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = "1.10.5"
+PROJECT_NUMBER = "1.10.6"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
index 8e2d685..75efc3b 100644
--- a/c++/test/CMakeLists.txt
+++ b/c++/test/CMakeLists.txt
@@ -38,16 +38,22 @@ set (srcdir ${CMAKE_CURRENT_SOURCE_DIR})
configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY)
add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} )
-target_include_directories(cpp_testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories (cpp_testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_definitions(cpp_testhdf5
PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings
)
-TARGET_C_PROPERTIES (cpp_testhdf5 STATIC)
-target_link_libraries (cpp_testhdf5 PRIVATE
- ${HDF5_CPP_LIB_TARGET}
- ${HDF5_LIB_TARGET}
- ${HDF5_TEST_LIB_TARGET}
-)
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (cpp_testhdf5 STATIC)
+ target_link_libraries (cpp_testhdf5 PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (cpp_testhdf5 SHARED)
+ target_link_libraries (cpp_testhdf5 PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
+ if (MINGW)
+ target_link_options (${HDF5_CPP_LIBSH_TARGET}
+ PRIVATE -static-libgcc -static-libstdc++
+ )
+ endif ()
+endif ()
set_target_properties (cpp_testhdf5 PROPERTIES FOLDER test/cpp)
include (CMakeTests.cmake)
diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake
index 02bff3e..a25dc6b 100644
--- a/c++/test/CMakeTests.cmake
+++ b/c++/test/CMakeTests.cmake
@@ -32,9 +32,10 @@ add_test (
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME CPP_testhdf5 COMMAND $<TARGET_FILE:cpp_testhdf5>)
+ add_test (NAME CPP_testhdf5 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cpp_testhdf5>)
else ()
add_test (NAME CPP_testhdf5 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:cpp_testhdf5>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
diff --git a/c++/test/CMakeVFDTests.cmake b/c++/test/CMakeVFDTests.cmake
index 6a8ce2c..8a44767 100644
--- a/c++/test/CMakeVFDTests.cmake
+++ b/c++/test/CMakeVFDTests.cmake
@@ -15,51 +15,59 @@
### T E S T I N G ###
##############################################################################
##############################################################################
- set (VFD_LIST
- sec2
- stdio
- core
- split
- multi
- family
- )
- if (DIRECT_VFD)
- set (VFD_LIST ${VFD_LIST} direct)
- endif ()
+set (VFD_LIST
+ sec2
+ stdio
+ core
+ split
+ multi
+ family
+)
+
+if (DIRECT_VFD)
+ set (VFD_LIST ${VFD_LIST} direct)
+endif ()
+
+##############################################################################
+##############################################################################
+### T H E T E S T S M A C R O S ###
+##############################################################################
+##############################################################################
- macro (ADD_VFD_TEST vfdname resultcode)
- if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}")
- add_test (
- NAME CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- tattr_basic.h5
- tattr_compound.h5
- tattr_dtype.h5
- tattr_multi.h5
- tattr_scalar.h5
- tfattrs.h5
- titerate.h5
- )
- add_test (
+macro (ADD_VFD_TEST vfdname resultcode)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}")
+ add_test (
+ NAME CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
+ tattr_basic.h5
+ tattr_compound.h5
+ tattr_dtype.h5
+ tattr_multi.h5
+ tattr_scalar.h5
+ tfattrs.h5
+ titerate.h5
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${vfdname}
+ )
+ add_test (
NAME CPP_VFD-${vfdname}-cpp_testhdf5
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:cpp_testhdf5>"
-D "TEST_ARGS:STRING="
-D "TEST_VFD:STRING=${vfdname}"
-D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=cpp_testhdf5"
+ -D "TEST_OUTPUT=${vfdname}-cpp_testhdf5.out"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
-P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects)
- set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT})
- endif ()
- endmacro ()
+ )
+ set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects)
+ set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT})
+ endif ()
+endmacro ()
- # Run test with different Virtual File Driver
- foreach (vfd ${VFD_LIST})
- ADD_VFD_TEST (${vfd} 0)
- endforeach ()
+# Run test with different Virtual File Driver
+foreach (vfd ${VFD_LIST})
+ ADD_VFD_TEST (${vfd} 0)
+endforeach ()
diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in
index 4c0a33b..875f653 100644
--- a/c++/test/Makefile.in
+++ b/c++/test/Makefile.in
@@ -487,7 +487,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -510,9 +509,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -539,6 +541,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -593,6 +596,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -617,7 +621,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1293,7 +1296,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp
index cf4f6e4..14f1bd4 100644
--- a/c++/test/dsets.cpp
+++ b/c++/test/dsets.cpp
@@ -58,13 +58,13 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
/*-------------------------------------------------------------------------
* Function: test_create
*
- * Purpose: Attempts to create a dataset.
+ * Purpose Attempts to create a dataset.
*
- * Return: Success: 0
+ * Return Success: 0
*
* Failure: -1
*
- * Programmer: Binh-Minh Ribler (using C version)
+ * Programmer Binh-Minh Ribler (using C version)
* Friday, January 5, 2001
*-------------------------------------------------------------------------
*/
@@ -184,15 +184,15 @@ static herr_t test_create( H5File& file)
/*-------------------------------------------------------------------------
* Function: test_simple_io
*
- * Purpose: Tests simple I/O. That is, reading and writing a complete
+ * Purpose Tests simple I/O. That is, reading and writing a complete
* multi-dimensional array without data type or data space
* conversions, without compression, and stored contiguously.
*
- * Return: Success: 0
+ * Return Success: 0
*
* Failure: -1
*
- * Programmer: Binh-Minh Ribler (using C version)
+ * Programmer Binh-Minh Ribler (using C version)
* Friday, January 5, 2001
*-------------------------------------------------------------------------
*/
@@ -268,13 +268,13 @@ static herr_t test_simple_io( H5File& file)
/*-------------------------------------------------------------------------
* Function: test_datasize
*
- * Purpose: Tests DataSet::getInMemDataSize().
+ * Purpose Tests DataSet::getInMemDataSize().
*
- * Return: Success: 0
+ * Return Success: 0
*
* Failure: -1
*
- * Programmer: Binh-Minh Ribler
+ * Programmer Binh-Minh Ribler
* Thursday, March 22, 2012
*-------------------------------------------------------------------------
*/
@@ -334,13 +334,13 @@ static herr_t test_datasize(FileAccPropList &fapl)
/*-------------------------------------------------------------------------
* Function: test_tconv
*
- * Purpose: Test some simple data type conversion stuff.
+ * Purpose Test some simple data type conversion stuff.
*
- * Return: Success: 0
+ * Return Success: 0
*
* Failure: -1
*
- * Programmer: Binh-Minh Ribler (using C version)
+ * Programmer Binh-Minh Ribler (using C version)
* Friday, January 5, 2001
*-------------------------------------------------------------------------
*/
@@ -425,13 +425,13 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
/*-------------------------------------------------------------------------
* Function: bogus
*
- * Purpose: A bogus compression method that doesn't do anything.
+ * Purpose A bogus compression method that doesn't do anything.
*
- * Return: Success: Data chunk size
+ * Return Success: Data chunk size
*
* Failure: 0
*
- * Programmer: Robb Matzke
+ * Programmer Robb Matzke
* Tuesday, April 21, 1998
*-------------------------------------------------------------------------
*/
@@ -447,16 +447,16 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
/*-------------------------------------------------------------------------
* Function: test_compression
*
- * Purpose: Tests dataset compression. If compression is requested when
+ * Purpose Tests dataset compression. If compression is requested when
* it hasn't been compiled into the library (such as when
* updating an existing compressed dataset) then data is sent to
* the file uncompressed but no errors are returned.
*
- * Return: Success: 0
+ * Return Success: 0
*
* Failure: -1
*
- * Programmer: Binh-Minh Ribler (using C version)
+ * Programmer Binh-Minh Ribler (using C version)
* Friday, January 5, 2001
*-------------------------------------------------------------------------
*/
@@ -730,13 +730,13 @@ static herr_t test_compression(H5File& file)
/*-------------------------------------------------------------------------
* Function: test_nbit_methods
*
- * Purpose: Tests setting nbit compression methods.
+ * Purpose Tests setting nbit compression methods.
*
- * Return: Success: 0
+ * Return Success: 0
*
* Failure: -1
*
- * Programmer: Binh-Minh Ribler
+ * Programmer Binh-Minh Ribler
* Friday, April 22, 2016
*
*-------------------------------------------------------------------------
@@ -847,16 +847,16 @@ static herr_t test_nbit_compression(H5File& file)
/*-------------------------------------------------------------------------
* Function: test_multiopen
*
- * Purpose: Tests that a bug no longer exists. If a dataset is opened
+ * Purpose Tests that a bug no longer exists. If a dataset is opened
* twice and one of the handles is used to extend the dataset,
* then the other handle should return the new size when
* queried.
*
- * Return: Success: 0
+ * Return Success: 0
*
* Failure: -1
*
- * Programmer: Binh-Minh Ribler (using C version)
+ * Programmer Binh-Minh Ribler (using C version)
* Saturday, February 17, 2001
*-------------------------------------------------------------------------
*/
@@ -929,13 +929,13 @@ static herr_t test_multiopen (H5File& file)
/*-------------------------------------------------------------------------
* Function: test_types
*
- * Purpose: Test various types - should be moved to dtypes.cpp
+ * Purpose Test various types - should be moved to dtypes.cpp
*
- * Return: Success: 0
+ * Return Success: 0
*
* Failure: -1
*
- * Programmer: Binh-Minh Ribler (using C version)
+ * Programmer Binh-Minh Ribler (using C version)
* February 17, 2001
*-------------------------------------------------------------------------
*/
@@ -1118,9 +1118,9 @@ static herr_t test_types(H5File& file)
/*-------------------------------------------------------------------------
* Function: test_getObjinfo
*
- * Purpose: Tests getObjinfo()
+ * Purpose Tests getObjinfo()
*
- * Return: Success: 0
+ * Return Success: 0
* Failure: -1
*
* July, 2018
@@ -1178,10 +1178,10 @@ static herr_t test_getinfo(H5File& file)
/*-------------------------------------------------------------------------
* Function: test_chunk_cache
*
- * Purpose: Tests setting rdcc info on a DAPL, and interaction
+ * Purpose Tests setting rdcc info on a DAPL, and interaction
* with the corresponding properties in the file structure.
*
- * Return: Success: 0
+ * Return Success: 0
* Failure: number of errors
*
* July 2018
@@ -1290,13 +1290,13 @@ static herr_t test_chunk_cache(FileAccPropList fapl)
/*-------------------------------------------------------------------------
* Function: test_virtual
*
- * Purpose: Tests fixed, unlimited, and printf selections in the same
+ * Purpose Tests fixed, unlimited, and printf selections in the same
* VDS
*
- * Return: Success: 0
+ * Return Success: 0
* Failure: number of errors
*
- * Programmer: Binh-Minh Ribler
+ * Programmer Binh-Minh Ribler
* Friday, March 10, 2017
*
*-------------------------------------------------------------------------
@@ -1368,13 +1368,13 @@ static herr_t test_virtual()
/*-------------------------------------------------------------------------
* Function: test_dset
*
- * Purpose: Tests the dataset interface (H5D)
+ * Purpose Tests the dataset interface (H5D)
*
- * Return: Success: 0
+ * Return Success: 0
*
* Failure: -1
*
- * Programmer: Binh-Minh Ribler (using C version)
+ * Programmer Binh-Minh Ribler (using C version)
* Friday, January 5, 2001
*
* Modifications:
@@ -1438,11 +1438,11 @@ void test_dset()
/*-------------------------------------------------------------------------
* Function: cleanup_dsets
*
- * Purpose: Cleanup temporary test files
+ * Purpose Cleanup temporary test files
*
- * Return: None
+ * Return None
*
- * Programmer: (use C version)
+ * Programmer (use C version)
*-------------------------------------------------------------------------
*/
extern "C"
diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp
index a341885..fccc556 100644
--- a/c++/test/tarray.cpp
+++ b/c++/test/tarray.cpp
@@ -371,7 +371,6 @@ static void test_array_info()
s1_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; // Information read in
hsize_t sdims1[] = {SPACE1_DIM1};
hsize_t tdims1[] = {ARRAY1_DIM1};
- int nmemb; // Number of compound members
int ii; // counting variables
hsize_t idxi, idxj, idxk; // dimension indicing variables
H5T_class_t mclass; // Datatype class for field
diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp
index 537716f..232ece2 100644
--- a/c++/test/tobject.cpp
+++ b/c++/test/tobject.cpp
@@ -609,10 +609,121 @@ static void test_getobjectinfo_same_file()
catch (Exception& E)
{
cerr << " in Exception " << E.getCFuncName() << "detail: " << E.getCDetailMsg() << endl;
- issue_fail_msg("test_file_name()", __LINE__, __FILE__, E.getCDetailMsg());
+ issue_fail_msg("test_getobjectinfo_same_file()", __LINE__, __FILE__, E.getCDetailMsg());
+ }
+
+} // test_getobjectinfo_same_file
+
+/*-------------------------------------------------------------------------
+ * Function: test_intermediate_groups
+ *
+ * Purpose Test that intermediate groups are created as specified by
+ * the property setting.
+ *
+ * Return None
+ *
+ * April, 2019
+ *-------------------------------------------------------------------------
+ */
+const H5std_string FILE_INTERGRPS("tobject_intergrps.h5");
+const H5std_string GROUP10NAME("/group10");
+const H5std_string GROUP11NAME("/group10/group11");
+const H5std_string GROUP12NAME("/group10/group11/group12");
+const H5std_string GROUP13NAME("/group10/group11/group12/group13");
+const H5std_string GROUP14NAME("/group10/group11/group12/group13/group14");
+const H5std_string GROUP14FROM13NAME("group14");
+const H5std_string GROUP20NAME("/group20");
+const H5std_string GROUP21NAME("/group20/group21");
+const H5std_string GROUP22NAME("group21/group22");
+const H5std_string GROUP22FULLNAME("/group20/group21/group22");
+static void test_intermediate_groups()
+{
+ // Output message about test being performed
+ SUBTEST("Group::set/getCreateIntermediateGroup");
+
+ try {
+ // Create a new HDF5 file
+ H5File file(FILE_INTERGRPS, H5F_ACC_TRUNC);
+
+ // Create a link create property list and set the "create
+ // intermediate groups" flag
+ LinkCreatPropList lcpl;
+ lcpl.setCreateIntermediateGroup(true);
+
+ // Verify value of create missing groups flag
+ bool crt_int_grps = lcpl.getCreateIntermediateGroup();
+ verify_val(crt_int_grps, true, "LinkCreatPropList::getCreateIntermediateGroup", __LINE__, __FILE__);
+
+ // Create GROUP12NAME with creating missing groups
+ Group grp12(file.createGroup(GROUP12NAME, lcpl));
+
+ // Missing groups: GROUP10NAME and GROUP11NAME
+
+ // Create GROUP14NAME without the use of link create plist, should
+ // fail because group GROUP13NAME is missing
+ try {
+ Group grp14_nopl(file.createGroup(GROUP14NAME));
+ } catch (FileIException& expected1) {} // Failure is ignored
+
+ // Create GROUP14NAME with the flag to create missing groups set
+ // to FALSE, should fail because group GROUP13NAME is missing
+
+ // Reset flag to not create missing groups
+ lcpl.setCreateIntermediateGroup(false);
+
+ // Verify value of create missing groups flag
+ crt_int_grps = lcpl.getCreateIntermediateGroup();
+ verify_val(crt_int_grps, false, "LinkCreatPropList::getCreateIntermediateGroup", __LINE__, __FILE__);
+
+ try {
+ Group grp14_false(file.createGroup(GROUP14NAME, lcpl));
+ } catch (FileIException& expected2) {} // Failure is ignored
+
+ // Set the flag to create missing groups set to TRUE
+ lcpl.setCreateIntermediateGroup(true);
+ crt_int_grps = lcpl.getCreateIntermediateGroup();
+ verify_val(crt_int_grps, true, "LinkCreatPropList::getCreateIntermediateGroup", __LINE__, __FILE__);
+
+
+ // Create GROUP14NAME with the use of link create plist
+ Group grp14(file.createGroup(GROUP14NAME, lcpl));
+
+ // Missing groups: GROUP13NAME
+
+ // Create group GROUP20NAME
+ Group grp20(file.createGroup(GROUP20NAME));
+
+ // Create group GROUP22NAME with missing group GROUP21NAME
+ Group grp22(grp20.createGroup(GROUP22NAME, lcpl));
+
+ // Close groups and file
+ grp12.close();
+ grp14.close();
+ grp20.close();
+ grp22.close();
+ file.close();
+
+ // Reopen the file
+ file.openFile(FILE_INTERGRPS, H5F_ACC_RDWR);
+
+ // Open the missing groups and various combinations
+ Group grp10(file.openGroup(GROUP10NAME));
+ Group grp11(file.openGroup(GROUP11NAME));
+ Group grp13(file.openGroup(GROUP13NAME));
+ Group grp14from13(grp13.openGroup(GROUP14FROM13NAME));
+ Group grp21(file.openGroup(GROUP21NAME));
+ Group grp22fromfile(file.openGroup(GROUP22FULLNAME));
+
+ PASSED();
+ } // end of try block
+ // catch all other exceptions
+ catch (Exception& E)
+ {
+ cerr << " in Exception " << E.getCFuncName() << "detail: " << E.getCDetailMsg() << endl;
+ issue_fail_msg("test_intermediate_groups()", __LINE__, __FILE__, E.getCDetailMsg());
}
-} // test_h5o_getinfo_same_file
+} // test_intermediate_groups
/*-------------------------------------------------------------------------
* Function: test_object
@@ -631,12 +742,13 @@ void test_object()
// Output message about test being performed
MESSAGE(5, ("Testing Object Functions\n"));
- test_get_objname(); // Test get object name from groups/datasets
- test_existance(); // Test check for object existance
- test_get_objname_ontypes(); // Test get object name from types
- test_get_objtype(); // Test get object type
- test_open_object_header(); // Test object header functions (H5O)
- test_getobjectinfo_same_file(); // Test object info in same file
+ test_get_objname(); // Test get object name from groups/datasets
+ test_existance(); // Test check for object existance
+ test_get_objname_ontypes(); // Test get object name from types
+ test_get_objtype(); // Test get object type
+ test_open_object_header(); // Test object header functions (H5O)
+ test_getobjectinfo_same_file(); // Test object info in same file
+ test_intermediate_groups(); // Test intermediate group property
} // test_object
diff --git a/config/cmake/CMakeFindJavaCommon.cmake b/config/cmake/CMakeFindJavaCommon.cmake
index eabb622..528791d 100644
--- a/config/cmake/CMakeFindJavaCommon.cmake
+++ b/config/cmake/CMakeFindJavaCommon.cmake
@@ -16,7 +16,7 @@ else()
set(_JAVA_HOME_EXPLICIT 1)
else()
set(_CMD_JAVA_HOME "")
- if(APPLE AND EXISTS /usr/libexec/java_home)
+ if(APPLE AND EXISTS "/usr/libexec/java_home")
execute_process(COMMAND /usr/libexec/java_home
OUTPUT_VARIABLE _CMD_JAVA_HOME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake
index 2333f67..7ee5737 100644
--- a/config/cmake/CTestCustom.cmake
+++ b/config/cmake/CTestCustom.cmake
@@ -11,8 +11,8 @@
#
set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000)
# Allow full output to go to CDash set to 0
-SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 50000)
-SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 50000)
+set (CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 50000)
+set (CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 50000)
# WARNING! This could be a lot of output and could overwhelm CDash and the
# MySQL DB so this might not be a good idea!
@@ -39,29 +39,34 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
H5TEST-flush2 #designed to need flush1
H5TEST-error_test #uses runTest.cmake
H5TEST-err_compat #uses runTest.cmake
- H5TEST-links_env #uses runTest.cmake
H5TEST-testlibinfo #uses grepTest.cmake
#########
H5TEST-clear-objects
- H5TEST-clear-cache-objects
- H5TEST-clear-cache_api-objects
- H5TEST-clear-cache_image-objects
- H5TEST-clear-cache_tagging-objects
- H5TEST-clear-del_many_dense_attrs-objects
- H5TEST-clear-err_compat-objects
- H5TEST-clear-error_test-objects
- H5TEST-clear-filenotclosed-objects
- H5TEST-clear-flush-objects
- H5TEST-clear-links_env-objects
- H5TEST-clear-testflushrefresh-objects
- H5TEST-clear-testhdf5-objects
- H5TEST-clear-ttsafe-objects
+ H5TEST-cache-clear-objects
+ H5TEST-cache_image-clear-objects
+ H5TEST-del_many_dense_attrs-clear-objects
+ H5TEST-external_env-clear-objects
+ H5TEST-filenotclosed-clear-objects
+ H5TEST-flush-clear-objects
+ H5TEST-links_env-clear-objects
+ H5TEST-testflushrefresh-clear-objects
+ H5TEST-testhdf5-clear-objects
+ H5TEST-vds_env-clear-objects
PERFORM_h5perform-clear-objects
- HL_TOOLS-clear-objects
HL_test-clear-objects
HL_FORTRAN_test-clear-objects
FORTRAN_testhdf5-clear-objects
+ FORTRAN_flush1-clear-objects
CPP_testhdf5-clear-objects
+ ######### examples #########
+ EXAMPLES-clear-objects
+ CPP_ex-clear-objects
+ CPP_ex_tutr-clear-objects
+ HL_ex-clear-objects
+ f90_ex-clear-objects
+ HL_CPP_ptableTest-clear-objects
+ HL_CPP_ex_ptExampleFL-clear-objects
+ HL_FORTRAN_f90_ex-clear-objects
######### tools/h5clear #########
H5CLEAR-clearall-objects
H5CLEAR-copy_h5clear_fsm_persist_equal.h5
@@ -90,146 +95,13 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
######### tools/h5diff #########
H5DIFF-clearall-objects
######### tools/h5dump #########
- H5DUMP-clearall-objects
- H5DUMP_PACKED_BITS-clearall-objects
- H5DUMP-XML-clearall-objects
- H5DUMP_VDS-clearall-objects
+ H5DUMP-t128bit_float #uses grepTest.cmake
######### tools/h5format_convert #########
H5FC-clearall-objects
######### tools/h5import #########
H5IMPORT-h5importtest-clear-objects
H5IMPORT-clear-objects
######### tools/h5jam #########
- H5JAM-SETUP-N_twithub_u10_c-clear-objects
- H5JAM-SETUP-N_twithub_u10_c
- H5JAM-N_twithub_u10_c-clear-objects
- H5JAM-NONE_COPY-N_twithub_u10_c
- H5JAM-CHECKFILE-N_twithub_u10_c-clear-objects
- H5JAM-SETUP-N_twithub_u511_c-clear-objects
- H5JAM-SETUP-N_twithub_u511_c
- H5JAM-N_twithub_u511_c-clear-objects
- H5JAM-NONE_COPY-N_twithub_u511_c
- H5JAM-CHECKFILE-N_twithub_u511_c-clear-objects
- H5JAM-SETUP-N_twithub_u512_c-clear-objects
- H5JAM-SETUP-N_twithub_u512_c
- H5JAM-N_twithub_u512_c-clear-objects
- H5JAM-NONE_COPY-N_twithub_u512_c
- H5JAM-CHECKFILE-N_twithub_u512_c-clear-objects
- H5JAM-SETUP-N_twithub_u513_c-clear-objects
- H5JAM-SETUP-N_twithub_u513_c
- H5JAM-N_twithub_u513_c-clear-objects
- H5JAM-NONE_COPY-N_twithub_u513_c
- H5JAM-CHECKFILE-N_twithub_u513_c-clear-objects
- H5JAM-SETUP-N_twithub513_u10_c-clear-objects
- H5JAM-SETUP-N_twithub513_u10_c
- H5JAM-N_twithub513_u10_c-clear-objects
- H5JAM-NONE_COPY-N_twithub513_u10_c
- H5JAM-CHECKFILE-N_twithub513_u10_c-clear-objects
- H5JAM-SETUP-N_twithub513_u511_c-clear-objects
- H5JAM-SETUP-N_twithub513_u511_c
- H5JAM-N_twithub513_u511_c-clear-objects
- H5JAM-NONE_COPY-N_twithub513_u511_c
- H5JAM-CHECKFILE-N_twithub513_u511_c-clear-objects
- H5JAM-SETUP-N_twithub513_u512_c-clear-objects
- H5JAM-SETUP-N_twithub513_u512_c
- H5JAM-N_twithub513_u512_c-clear-objects
- H5JAM-NONE_COPY-N_twithub513_u512_c
- H5JAM-CHECKFILE-N_twithub513_u512_c-clear-objects
- H5JAM-SETUP-N_twithub513_u513_c-clear-objects
- H5JAM-SETUP-N_twithub513_u513_c
- H5JAM-N_twithub513_u513_c-clear-objects
- H5JAM-NONE_COPY-N_twithub513_u513_c
- H5JAM-CHECKFILE-N_twithub513_u513_c-clear-objects
- H5JAM-CHECKFILE-twithub_u10_c-clear-objects
- H5JAM-twithub_u511_c-clear-objects
- H5JAM-CHECKFILE-twithub_u511_c-clear-objects
- H5JAM-twithub_u512_c-clear-objects
- H5JAM-CHECKFILE-twithub_u512_c-clear-objects
- H5JAM-twithub_u513_c-clear-objects
- H5JAM-CHECKFILE-twithub_u513_c-clear-objects
- H5JAM-twithub513_u10_c-clear-objects
- H5JAM-CHECKFILE-twithub513_u10_c-clear-objects
- H5JAM-twithub513_u511_c-clear-objects
- H5JAM-CHECKFILE-twithub513_u511_c-clear-objects
- H5JAM-twithub513_u512_c-clear-objects
- H5JAM-CHECKFILE-twithub513_u512_c-clear-objects
- H5JAM-twithub513_u513_c-clear-objects
- H5JAM-CHECKFILE-twithub513_u513_c-clear-objects
- H5JAM-SETUP-twithub_tall-clear-objects
- H5JAM-SETUP-twithub_tall
- H5JAM-UNJAM-twithub_tall-clear-objects
- H5JAM-UNJAM_D-twithub_tall-clear-objects
- H5JAM-CHECKFILE-twithub_tall-clear-objects
- H5JAM-SETUP-twithub513_tall-clear-objects
- H5JAM-SETUP-twithub513_tall
- H5JAM-UNJAM-twithub513_tall-clear-objects
- H5JAM-UNJAM_D-twithub513_tall-clear-objects
- H5JAM-CHECKFILE-twithub513_tall-clear-objects
- H5JAM-SETUP-N_twithub_tall-clear-objects
- H5JAM-SETUP-N_twithub_tall
- H5JAM-UNJAM-N_twithub_tall-clear-objects
- H5JAM-UNJAM_D-N_twithub_tall-clear-objects
- H5JAM-CHECKFILE-N_twithub_tall-clear-objects
- H5JAM-SETUP-N_twithub513_tall-clear-objects
- H5JAM-SETUP-N_twithub513_tall
- H5JAM-UNJAM-N_twithub513_tall-clear-objects
- H5JAM-UNJAM_D-N_twithub513_tall-clear-objects
- H5JAM-CHECKFILE-N_twithub513_tall-clear-objects
- H5JAM-SETUP-D_twithub_tall-clear-objects
- H5JAM-SETUP-D_twithub_tall
- H5JAM-UNJAM-D_twithub_tall-clear-objects
- H5JAM-UNJAM_D-D_twithub_tall-clear-objects
- H5JAM-CHECKFILE-D_twithub_tall-clear-objects
- H5JAM-SETUP-D_twithub513_tall-clear-objects
- H5JAM-SETUP-D_twithub513_tall
- H5JAM-UNJAM-D_twithub513_tall-clear-objects
- H5JAM-UNJAM_D-D_twithub513_tall-clear-objects
- H5JAM-CHECKFILE-D_twithub513_tall-clear-objects
- H5JAM-CHECKFILE-ta_u513-clear-objects
- H5JAM-twithub_u10-clear-objects
- H5JAM-CHECKFILE-twithub_u10-clear-objects
- H5JAM-twithub_u511-clear-objects
- H5JAM-CHECKFILE-twithub_u511-clear-objects
- H5JAM-twithub_u512-clear-objects
- H5JAM-CHECKFILE-twithub_u512-clear-objects
- H5JAM-twithub_u513-clear-objects
- H5JAM-CHECKFILE-twithub_u513-clear-objects
- H5JAM-twithub513_u10-clear-objects
- H5JAM-CHECKFILE-twithub513_u10-clear-objects
- H5JAM-twithub513_u511-clear-objects
- H5JAM-CHECKFILE-twithub513_u511-clear-objects
- H5JAM-twithub513_u512-clear-objects
- H5JAM-CHECKFILE-twithub513_u512-clear-objects
- H5JAM-twithub513_u513-clear-objects
- H5JAM-CHECKFILE-twithub513_u513-clear-objects
- H5JAM-twithub_u10_c-clear-objects
- H5JAM-tall_u10-clear-objects
- H5JAM-CHECKFILE-tall_u10-clear-objects
- H5JAM-tall_u511-clear-objects
- H5JAM-CHECKFILE-tall_u511-clear-objects
- H5JAM-tall_u512-clear-objects
- H5JAM-CHECKFILE-tall_u512-clear-objects
- H5JAM-tall_u513-clear-objects
- H5JAM-CHECKFILE-tall_u513-clear-objects
- H5JAM-SETUP-ta_u10-clear-objects
- H5JAM-SETUP-ta_u10
- H5JAM-ta_u10-clear-objects
- H5JAM-NONE_COPY-ta_u10
- H5JAM-CHECKFILE-ta_u10-clear-objects
- H5JAM-SETUP-ta_u511-clear-objects
- H5JAM-SETUP-ta_u511
- H5JAM-ta_u511-clear-objects
- H5JAM-NONE_COPY-ta_u511
- H5JAM-CHECKFILE-ta_u511-clear-objects
- H5JAM-SETUP-ta_u512-clear-objects
- H5JAM-SETUP-ta_u512
- H5JAM-ta_u512-clear-objects
- H5JAM-NONE_COPY-ta_u512
- H5JAM-CHECKFILE-ta_u512-clear-objects
- H5JAM-SETUP-ta_u513-clear-objects
- H5JAM-SETUP-ta_u513
- H5JAM-ta_u513-clear-objects
- H5JAM-NONE_COPY-ta_u513
######### tools/h5ls #########
H5LS-clearall-objects
H5LS_VDS-clearall-objects
@@ -286,7 +158,6 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
H5REPACK-HDFFV-7840-clear-objects
H5REPACK_META-meta_long_N-clear-objects
H5REPACK_META-meta_short_N-clear-objects
- H5REPACK_OLD-old_style_layout_short_switches-clear-objects
H5REPACK_STAT-GS_AGGR-clear-objects
H5REPACK_STAT-S_AGGR-clear-objects
H5REPACK_STAT-SP_NONE-clear-objects
@@ -331,14 +202,7 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
H5MKGRP-clearall-objects
######### tools/perform #########
PERFORM_h5perform-clearall-objects
- ######### hl/tools/h5watch #########
+ ######### hl/tools #########
+ HL_TOOLS-clear-objects
H5WATCH-clearall-objects
- ######### examples #########
- EXAMPLES-clear-objects
- CPP_ex-clear-objects
- CPP_ex_tutr-clear-objects
- HL_ex-clear-objects
- f90_ex-clear-objects
- HL_CPP_ex_ptExampleFL-clear-objects
- HL_FORTRAN_f90_ex-clear-objects
)
diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake
index 0269ba8..e914c4d 100755
--- a/config/cmake/CTestScript.cmake
+++ b/config/cmake/CTestScript.cmake
@@ -72,7 +72,7 @@ set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
if (CTEST_USE_TAR_SOURCE)
## Uncompress source if tar or zip file provided
## --------------------------
- if (WIN32)
+ if (WIN32 AND NOT MINGW)
message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]")
execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv)
else ()
@@ -101,6 +101,11 @@ endif ()
include (ProcessorCount)
ProcessorCount (N)
if (NOT N EQUAL 0)
+ if (MAX_PROC_COUNT)
+ if (N GREATER MAX_PROC_COUNT)
+ set (N ${MAX_PROC_COUNT})
+ endif ()
+ endif ()
if (NOT WIN32)
set (CTEST_BUILD_FLAGS -j${N})
endif ()
@@ -114,8 +119,12 @@ set(CTEST_CONFIGURE_TOOLSET "")
if(CMAKE_GENERATOR_TOOLSET)
set(CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}")
endif()
+set(CTEST_CONFIGURE_ARCHITECTURE "")
+if(CMAKE_GENERATOR_ARCHITECTURE)
+ set(CTEST_CONFIGURE_ARCHITECTURE "-A${CMAKE_GENERATOR_ARCHITECTURE}")
+endif()
set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
+ "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_ARCHITECTURE}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
)
#-----------------------------------------------------------------------------
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index c1abeed..ab1fa89 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -33,7 +33,7 @@ MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS)
# conversions. If not, some hard conversions will still be prefered even
# though the data may be wrong (for example, some compilers don't
# support denormalized floating values) to maximize speed.
-#
+#-----------------------------------------------------------------------------
option (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON)
if (HDF5_WANT_DATA_ACCURACY)
set (${HDF_PREFIX}_WANT_DATA_ACCURACY 1)
@@ -45,7 +45,7 @@ MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY)
# checked and data conversion exceptions are returned. This is mainly
# for the speed optimization of hard conversions. Soft conversions can
# actually benefit little.
-#
+#-----------------------------------------------------------------------------
option (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON)
if (HDF5_WANT_DCONV_EXCEPTION)
set (${HDF_PREFIX}_WANT_DCONV_EXCEPTION 1)
@@ -54,7 +54,7 @@ MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION)
# ----------------------------------------------------------------------
# Check if they would like the function stack support compiled in
-#
+#-----------------------------------------------------------------------------
option (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF)
if (HDF5_ENABLE_CODESTACK)
set (${HDF_PREFIX}_HAVE_CODESTACK 1)
@@ -75,7 +75,7 @@ set (${HDF_PREFIX}_HAVE_TMPFILE 1)
# TODO --------------------------------------------------------------------------
# Should the Default Virtual File Driver be compiled?
# This is hard-coded now but option should added to match configure
-#
+#-----------------------------------------------------------------------------
set (${HDF_PREFIX}_DEFAULT_VFD H5FD_SEC2)
if (NOT DEFINED "${HDF_PREFIX}_DEFAULT_PLUGINDIR")
@@ -92,6 +92,7 @@ if (WINDOWS)
# Set the flag to indicate that the machine has window style pathname,
# that is, "drive-letter:\" (e.g. "C:") or "drive-letter:/" (e.g. "C:/").
# (This flag should be _unset_ for all machines, except for Windows)
+ #-----------------------------------------------------------------------
set (${HDF_PREFIX}_HAVE_WINDOW_PATH 1)
endif ()
@@ -102,7 +103,7 @@ endif ()
CHECK_FUNCTION_EXISTS (difftime ${HDF_PREFIX}_HAVE_DIFFTIME)
# Find the library containing clock_gettime()
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
CHECK_FUNCTION_EXISTS (clock_gettime CLOCK_GETTIME_IN_LIBC)
CHECK_LIBRARY_EXISTS (rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT)
CHECK_LIBRARY_EXISTS (posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4)
@@ -155,6 +156,26 @@ if (NOT WINDOWS)
endif ()
#-----------------------------------------------------------------------------
+# Check if ROS3 driver can be built
+#-----------------------------------------------------------------------------
+option (HDF5_ENABLE_ROS3_VFD "Build the ROS3 Virtual File Driver" OFF)
+ if (HDF5_ENABLE_ROS3_VFD)
+ # CMake version 3.13 fixed FindCURL module
+ if(CMAKE_VERSION VERSION_LESS "3.13.0" AND WIN32)
+ MESSAGE(FATAL_ERROR "Windows builds for this option requires a minimum of CMake 3.13")
+ endif ()
+ find_package(CURL REQUIRED)
+ find_package(OpenSSL REQUIRED)
+ if (${CURL_FOUND} AND ${OPENSSL_FOUND})
+ set (${HDF_PREFIX}_HAVE_ROS3_VFD 1)
+ list (APPEND LINK_LIBS ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
+ INCLUDE_DIRECTORIES (${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
+ else ()
+ message (STATUS "The Read-Only S3 VFD was requested but cannot be built.\nPlease check that openssl and cURL are available on your\nsystem, and/or re-configure without option HDF5_ENABLE_ROS3_VFD.")
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
# Check if C has __float128 extension
#-----------------------------------------------------------------------------
@@ -217,7 +238,7 @@ endmacro ()
# is 0x004733ce17af227f, not the same as the library's conversion to 0x004733ce17af2282.
# The machine's conversion gets the correct value. We define the macro and disable
# this kind of test until we figure out what algorithm they use.
-#
+#-----------------------------------------------------------------------------
H5ConversionTests (${HDF_PREFIX}_LDOUBLE_TO_LONG_SPECIAL "Checking IF your system converts long double to (unsigned) long values with special algorithm")
# ----------------------------------------------------------------------
# Set the flag to indicate that the machine is using a special algorithm
@@ -226,7 +247,7 @@ H5ConversionTests (${HDF_PREFIX}_LDOUBLE_TO_LONG_SPECIAL "Checking IF your syst
# when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff...,
# ..., 7fffff..., the compiler uses a unknown algorithm. We define a
# macro and skip the test for now until we know about the algorithm.
-#
+#-----------------------------------------------------------------------------
H5ConversionTests (${HDF_PREFIX}_LONG_TO_LDOUBLE_SPECIAL "Checking IF your system can convert (unsigned) long to long double values with special algorithm")
# ----------------------------------------------------------------------
# Set the flag to indicate that the machine can accurately convert
@@ -236,7 +257,7 @@ H5ConversionTests (${HDF_PREFIX}_LONG_TO_LDOUBLE_SPECIAL "Checking IF your syste
# start to go wrong on these two machines. Adjusting it higher to
# 0x4351ccf385ebc8a0dfcc... or 0x4351ccf385ebc8a0ffcc... will make the converted
# values wildly wrong. This test detects this wrong behavior and disable the test.
-#
+#-----------------------------------------------------------------------------
H5ConversionTests (${HDF_PREFIX}_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctly converting long double to (unsigned) long long values")
# ----------------------------------------------------------------------
# Set the flag to indicate that the machine can accurately convert
@@ -244,14 +265,14 @@ H5ConversionTests (${HDF_PREFIX}_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctl
# all machines, except for Mac OS 10.4, when the bit sequences are 003fff...,
# 007fff..., 00ffff..., 01ffff..., ..., 7fffff..., the converted values are twice
# as big as they should be.
-#
+#-----------------------------------------------------------------------------
H5ConversionTests (${HDF_PREFIX}_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting (unsigned) long long to long double values")
# ----------------------------------------------------------------------
# Set the flag to indicate that the machine can accurately convert
# some long double values
-#
+#-----------------------------------------------------------------------------
H5ConversionTests (${HDF_PREFIX}_DISABLE_SOME_LDOUBLE_CONV "Checking IF the cpu is power9 and cannot correctly converting long double values")
# ----------------------------------------------------------------------
# Check if pointer alignments are enforced
-#
+#-----------------------------------------------------------------------------
H5ConversionTests (${HDF_PREFIX}_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced")
diff --git a/config/cmake/FindHDFJAVA.cmake.in b/config/cmake/FindHDFJAVA.cmake.in
deleted file mode 100644
index ed2b8c2..0000000
--- a/config/cmake/FindHDFJAVA.cmake.in
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-# Copyright by The HDF Group.
-# All rights reserved.
-#
-# This file is part of HDF5. The full HDF5 copyright notice, including
-# terms governing use, modification, and redistribution, is contained in
-# the COPYING file, which can be found at the root of the source code
-# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
-# If you do not have access to either file, you may request a copy from
-# help@hdfgroup.org.
-#
-#
-# To be used by projects that make use of CMakeified hdf-java
-#
-
-#
-# Find the HDFJAVA includes and get all installed hdf-java library settings from
-# HDFJAVA-config.cmake file : Requires a CMake compatible hdf-java-@HDFJAVA_PACKAGE_VERSION@ or later
-# for this feature to work. The following vars are set if hdf-java is found.
-#
-# HDFJAVA_FOUND - True if found, otherwise all other vars are undefined
-# HDFJAVA_VERSION_STRING - full version (e.g. @HDFJAVA_PACKAGE_VERSION@)
-# HDFJAVA_VERSION_MAJOR - major part of version (e.g. @HDFJAVA_PACKAGE_VERSION_MAJOR@)
-# HDFJAVA_VERSION_MINOR - minor part (e.g. @HDFJAVA_PACKAGE_VERSION_MINOR@)
-#
-# Target names that are valid (depending on enabled options)
-# will be the following
-#
-#
-# To aid in finding HDFJAVA as part of a subproject set
-# HDFJAVA_ROOT_DIR_HINT to the location where @HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake lies
-
-INCLUDE (SelectLibraryConfigurations)
-INCLUDE (FindPackageHandleStandardArgs)
-
-# The HINTS option should only be used for values computed from the system.
-set (_HDFJAVA_HINTS
- $ENV{HOME}/.local
- $ENV{HDFJAVA_ROOT}
- $ENV{HDFJAVA_ROOT_DIR_HINT}
-)
-# Hard-coded guesses should still go in PATHS. This ensures that the user
-# environment can always override hard guesses.
-set (_HDFJAVA_PATHS
- $ENV{HOME}/.local
- $ENV{HDFJAVA_ROOT}
- $ENV{HDFJAVA_ROOT_DIR_HINT}
- /usr/lib/@HDFJAVA_PACKAGE@
- /usr/share/@HDFJAVA_PACKAGE@
- /usr/local/@HDFJAVA_PACKAGE@
- /usr/local/@HDFJAVA_PACKAGE@/share
-)
-
-FIND_PATH (HDFJAVA_ROOT_DIR "@HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake"
- HINTS ${_HDFJAVA_HINTS}
- PATHS ${_HDFJAVA_PATHS}
- PATH_SUFFIXES
- cmake/@HDFJAVA_PACKAGE@
- lib/cmake/@HDFJAVA_PACKAGE@
- share/cmake/@HDFJAVA_PACKAGE@
-)
-
-FIND_PATH (HDFJAVA_LIBRARY "jarhdf5-@HDFJAVA_PACKAGE_VERSION@.jar"
- HINTS ${_HDFJAVA_HINTS}
- PATHS ${_HDFJAVA_PATHS}
- PATH_SUFFIXES
- lib
-)
-
-if (HDFJAVA_ROOT_DIR)
- set (HDFJAVA_FOUND "YES")
- INCLUDE (${HDFJAVA_ROOT_DIR}/@HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake)
- set (HDFJAVA_LIBRARIES "${HDFJAVA_LIBRARY}")
- set (HDFJAVA_INCLUDE_DIRS
- ${HDFJAVA_LIBRARY}/jarhdf-@HDFJAVA_PACKAGE_VERSION@.jar
- ${HDFJAVA_LIBRARY}/jarhdf5-@HDFJAVA_PACKAGE_VERSION@.jar
- )
-
-endif ()
diff --git a/config/cmake/FindHDFS.cmake b/config/cmake/FindHDFS.cmake
new file mode 100644
index 0000000..e401a94
--- /dev/null
+++ b/config/cmake/FindHDFS.cmake
@@ -0,0 +1,70 @@
+
+# DerivedFrom: https://github.com/cloudera/Impala/blob/cdh5-trunk/cmake_modules/FindHDFS.cmake
+# - Find HDFS (hdfs.h and libhdfs.so)
+# This module defines
+# Hadoop_VERSION, version string of ant if found
+# HDFS_INCLUDE_DIR, directory containing hdfs.h
+# HDFS_LIBRARIES, location of libhdfs.so
+# HDFS_FOUND, whether HDFS is found.
+
+exec_program($ENV{HADOOP_HOME}/bin/hadoop ARGS version OUTPUT_VARIABLE Hadoop_VERSION
+ RETURN_VALUE Hadoop_RETURN)
+
+# currently only looking in HADOOP_HOME
+find_path(HDFS_INCLUDE_DIR hdfs.h PATHS
+ $ENV{HADOOP_HOME}/include/
+ # make sure we don't accidentally pick up a different version
+ NO_DEFAULT_PATH
+)
+
+if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
+ set(arch_hint "x64")
+elseif ("$ENV{LIB}" MATCHES "(amd64|ia64)")
+ set(arch_hint "x64")
+else ()
+ set(arch_hint "x86")
+endif()
+
+message(STATUS "Architecture: ${arch_hint}")
+
+if ("${arch_hint}" STREQUAL "x64")
+ set(HDFS_LIB_PATHS $ENV{HADOOP_HOME}/lib/native)
+else ()
+ set(HDFS_LIB_PATHS $ENV{HADOOP_HOME}/lib/native)
+endif ()
+
+message(STATUS "HDFS_LIB_PATHS: ${HDFS_LIB_PATHS}")
+
+find_library(HDFS_LIB NAMES hdfs PATHS
+ ${HDFS_LIB_PATHS}
+ # make sure we don't accidentally pick up a different version
+ NO_DEFAULT_PATH
+)
+
+if (HDFS_LIB)
+ set(HDFS_FOUND TRUE)
+ set(HDFS_LIBRARIES ${HDFS_LIB})
+ set(HDFS_STATIC_LIB ${HDFS_LIB_PATHS}/${CMAKE_STATIC_LIBRARY_PREFIX}hdfs${CMAKE_STATIC_LIBRARY_SUFFIX})
+
+ add_library(hdfs_static STATIC IMPORTED)
+ set_target_properties(hdfs_static PROPERTIES IMPORTED_LOCATION ${HDFS_STATIC_LIB})
+else ()
+ set(HDFS_FOUND FALSE)
+endif ()
+
+if (HDFS_FOUND)
+ if (NOT HDFS_FIND_QUIETLY)
+ message(STATUS "${Hadoop_VERSION}")
+ message(STATUS "HDFS_INCLUDE_DIR: ${HDFS_INCLUDE_DIR}")
+ message(STATUS "HDFS_LIBRARIES: ${HDFS_LIBRARIES}")
+ message(STATUS "hdfs_static: ${HDFS_STATIC_LIB}")
+ endif ()
+else ()
+ message(FATAL_ERROR "HDFS includes and libraries NOT found."
+ "(${HDFS_INCLUDE_DIR}, ${HDFS_LIB})")
+endif ()
+
+mark_as_advanced(
+ HDFS_LIBRARIES
+ HDFS_INCLUDE_DIR
+)
diff --git a/config/cmake/FindJNI.cmake b/config/cmake/FindJNI.cmake
deleted file mode 100644
index 1e6daf6..0000000
--- a/config/cmake/FindJNI.cmake
+++ /dev/null
@@ -1,347 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details.
-
-#.rst:
-# FindJNI
-# -------
-#
-# Find JNI java libraries.
-#
-# This module finds if Java is installed and determines where the
-# include files and libraries are. It also determines what the name of
-# the library is. The caller may set variable JAVA_HOME to specify a
-# Java installation prefix explicitly.
-#
-# This module sets the following result variables:
-#
-# ::
-#
-# JNI_INCLUDE_DIRS = the include dirs to use
-# JNI_LIBRARIES = the libraries to use
-# JNI_FOUND = TRUE if JNI headers and libraries were found.
-# JAVA_AWT_LIBRARY = the path to the jawt library
-# JAVA_JVM_LIBRARY = the path to the jvm library
-# JAVA_INCLUDE_PATH = the include path to jni.h
-# JAVA_INCLUDE_PATH2 = the include path to jni_md.h
-# JAVA_AWT_INCLUDE_PATH = the include path to jawt.h
-
-# Expand {libarch} occurences to java_libarch subdirectory(-ies) and set ${_var}
-macro(java_append_library_directories _var)
- # Determine java arch-specific library subdir
- # Mostly based on openjdk/jdk/make/common/shared/Platform.gmk as of openjdk
- # 1.6.0_18 + icedtea patches. However, it would be much better to base the
- # guess on the first part of the GNU config.guess platform triplet.
- if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
- if(CMAKE_LIBRARY_ARCHITECTURE STREQUAL "x86_64-linux-gnux32")
- set(_java_libarch "x32" "amd64" "i386")
- else()
- set(_java_libarch "amd64" "i386")
- endif()
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
- set(_java_libarch "i386")
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
- set(_java_libarch "alpha")
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
- # Subdir is "arm" for both big-endian (arm) and little-endian (armel).
- set(_java_libarch "arm" "aarch32")
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
- # mips* machines are bi-endian mostly so processor does not tell
- # endianess of the underlying system.
- set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb" "mips64" "mips64el" "mipsn32" "mipsn32el")
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64le")
- set(_java_libarch "ppc64" "ppc64le")
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
- set(_java_libarch "ppc64" "ppc")
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
- set(_java_libarch "ppc" "ppc64")
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
- # Both flavours can run on the same processor
- set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
- set(_java_libarch "parisc" "parisc64")
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
- # s390 binaries can run on s390x machines
- set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
- set(_java_libarch "sh")
- else()
- set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
- endif()
-
- # Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or
- # system is non-Linux (where the code above has not been well tested)
- if(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
- list(APPEND _java_libarch "i386" "amd64" "ppc")
- endif()
-
- # Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer
- # current value to a hardcoded list. Remove possible duplicates.
- list(REMOVE_DUPLICATES _java_libarch)
-
- foreach(_path ${ARGN})
- if(_path MATCHES "{libarch}")
- foreach(_libarch ${_java_libarch})
- string(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}")
- if(EXISTS ${_newpath})
- list(APPEND ${_var} "${_newpath}")
- endif()
- endforeach()
- else()
- if(EXISTS ${_path})
- list(APPEND ${_var} "${_path}")
- endif()
- endif()
- endforeach()
-endmacro()
-
-#include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindJavaCommon.cmake)
-INCLUDE (CMakeFindJavaCommon)
-
-# Save CMAKE_FIND_FRAMEWORK
-if(DEFINED CMAKE_FIND_FRAMEWORK)
- set(_JNI_CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK})
-else()
- unset(_JNI_CMAKE_FIND_FRAMEWORK)
-endif()
-
-if(_JAVA_HOME_EXPLICIT)
- set(CMAKE_FIND_FRAMEWORK NEVER)
-endif()
-
-set(JAVA_AWT_LIBRARY_DIRECTORIES)
-if(_JAVA_HOME)
- JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
- ${_JAVA_HOME}/jre/lib/{libarch}
- ${_JAVA_HOME}/jre/lib
- ${_JAVA_HOME}/lib/{libarch}
- ${_JAVA_HOME}/lib
- ${_JAVA_HOME}
- )
-endif()
-get_filename_component(java_install_version
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME)
-
-list(APPEND JAVA_AWT_LIBRARY_DIRECTORIES
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/lib"
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib"
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib"
- )
-JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
- /usr/java/lib
- /usr/java/jre/lib
- /usr/lib
- /usr/lib64
- /usr/local/lib
- /usr/local/lib64
- /usr/lib/jvm/java/lib
- /usr/lib64/jvm/java/lib
- /usr/lib/java/jre/lib/{libarch}
- /usr/lib64/java/jre/lib/{libarch}
- /usr/lib/jvm/jre/lib/{libarch}
- /usr/local/lib/java/jre/lib/{libarch}
- /usr/local/share/java/jre/lib/{libarch}
- /usr/lib/j2sdk1.4-sun/jre/lib/{libarch}
- /usr/lib/j2sdk1.5-sun/jre/lib/{libarch}
- /opt/sun-jdk-1.5.0.04/jre/lib/{libarch}
- /usr/lib/jvm/java-6-sun/jre/lib/{libarch}
- /usr/lib/jvm/java-1.5.0-sun/jre/lib/{libarch}
- /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch} # can this one be removed according to #8821 ? Alex
- /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
- /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch} # fedora
- # Debian specific paths for default JVM
- /usr/lib/jvm/default-java/jre/lib/{libarch}
- /usr/lib/jvm/default-java/jre/lib
- /usr/lib/jvm/default-java/lib
- # Arch Linux specific paths for default JVM
- /usr/lib/jvm/default/jre/lib/{libarch}
- /usr/lib/jvm/default/lib/{libarch}
- # Ubuntu specific paths for default JVM
- /usr/lib/jvm/java-8-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
- /usr/lib/jvm/java-7-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
- /usr/lib/jvm/java-6-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
- # OpenBSD specific paths for default JVM
- /usr/local/jdk-1.7.0/jre/lib/{libarch}
- /usr/local/jre-1.7.0/lib/{libarch}
- /usr/local/jdk-1.6.0/jre/lib/{libarch}
- /usr/local/jre-1.6.0/lib/{libarch}
- # SuSE specific paths for default JVM
- /usr/lib64/jvm/java/jre/lib/{libarch}
- /usr/lib64/jvm/jre/lib/{libarch}
- )
-
-set(JAVA_JVM_LIBRARY_DIRECTORIES)
-foreach(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
- list(APPEND JAVA_JVM_LIBRARY_DIRECTORIES
- "${dir}"
- "${dir}/client"
- "${dir}/server"
- # IBM SDK, Java Technology Edition, specific paths
- "${dir}/j9vm"
- "${dir}/default"
- )
-endforeach()
-
-set(JAVA_AWT_INCLUDE_DIRECTORIES)
-if(_JAVA_HOME)
- list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES ${_JAVA_HOME}/include)
-endif()
-list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include"
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
-)
-
-JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_INCLUDE_DIRECTORIES
- ${_JAVA_HOME}/include
- /usr/include
- /usr/java/include
- /usr/local/include
- /usr/lib/java/include
- /usr/lib64/java/include
- /usr/local/lib/java/include
- /usr/lib/jvm/java/include
- /usr/lib/jvm/java-6-sun/include
- /usr/lib/jvm/java-1.5.0-sun/include
- /usr/lib/jvm/java-6-sun-1.6.0.00/include # can this one be removed according to #8821 ? Alex
- /usr/lib/jvm/java-6-openjdk/include
- /usr/lib/jvm/java-7-openjdk/include
- /usr/lib64/jvm/java-7-openjdk/include
- /usr/lib64/jvm/java-7-openjdk-amd64/include
- /usr/lib/jvm/java-8-openjdk-{libarch}/include # ubuntu 15.10
- /usr/lib/jvm/java-7-openjdk-{libarch}/include # ubuntu 15.10
- /usr/lib/jvm/java-6-openjdk-{libarch}/include # ubuntu 15.10
- /usr/local/share/java/include
- /usr/lib/j2sdk1.4-sun/include
- /usr/lib/j2sdk1.5-sun/include
- /opt/sun-jdk-1.5.0.04/include
- # Debian specific path for default JVM
- /usr/lib/jvm/default-java/include
- # Arch specific path for default JVM
- /usr/lib/jvm/default/include
- # OpenBSD specific path for default JVM
- /usr/local/jdk-1.7.0/include
- /usr/local/jdk-1.6.0/include
- # SuSE specific paths for default JVM
- /usr/lib64/jvm/java/include
- )
-
-foreach(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
- get_filename_component(jpath "${JAVA_PROG}" PATH)
- foreach(JAVA_INC_PATH ../include ../java/include ../share/java/include)
- if(EXISTS ${jpath}/${JAVA_INC_PATH})
- list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES "${jpath}/${JAVA_INC_PATH}")
- endif()
- endforeach()
- foreach(JAVA_LIB_PATH
- ../lib ../jre/lib ../jre/lib/i386
- ../java/lib ../java/jre/lib ../java/jre/lib/i386
- ../share/java/lib ../share/java/jre/lib ../share/java/jre/lib/i386)
- if(EXISTS ${jpath}/${JAVA_LIB_PATH})
- list(APPEND JAVA_AWT_LIBRARY_DIRECTORIES "${jpath}/${JAVA_LIB_PATH}")
- endif()
- endforeach()
-endforeach()
-
-if(APPLE)
- if(CMAKE_FIND_FRAMEWORK STREQUAL "ONLY")
- set(_JNI_SEARCHES FRAMEWORK)
- elseif(CMAKE_FIND_FRAMEWORK STREQUAL "NEVER")
- set(_JNI_SEARCHES NORMAL)
- elseif(CMAKE_FIND_FRAMEWORK STREQUAL "LAST")
- set(_JNI_SEARCHES NORMAL FRAMEWORK)
- else()
- set(_JNI_SEARCHES FRAMEWORK NORMAL)
- endif()
- set(_JNI_FRAMEWORK_JVM NAMES JavaVM)
- set(_JNI_FRAMEWORK_JAWT "${_JNI_FRAMEWORK_JVM}")
-else()
- set(_JNI_SEARCHES NORMAL)
-endif()
-
-set(_JNI_NORMAL_JVM
- NAMES jvm
- PATHS ${JAVA_JVM_LIBRARY_DIRECTORIES}
- )
-
-set(_JNI_NORMAL_JAWT
- NAMES jawt
- PATHS ${JAVA_AWT_LIBRARY_DIRECTORIES}
- )
-
-foreach(search ${_JNI_SEARCHES})
- find_library(JAVA_JVM_LIBRARY ${_JNI_${search}_JVM})
- find_library(JAVA_AWT_LIBRARY ${_JNI_${search}_JAWT})
- if(JAVA_JVM_LIBRARY)
- break()
- endif()
-endforeach()
-unset(_JNI_SEARCHES)
-unset(_JNI_FRAMEWORK_JVM)
-unset(_JNI_FRAMEWORK_JAWT)
-unset(_JNI_NORMAL_JVM)
-unset(_JNI_NORMAL_JAWT)
-
-# Find headers matching the library.
-if("${JAVA_JVM_LIBRARY};${JAVA_AWT_LIBRARY};" MATCHES "(/JavaVM.framework|-framework JavaVM);")
- set(CMAKE_FIND_FRAMEWORK ONLY)
-else()
- set(CMAKE_FIND_FRAMEWORK NEVER)
-endif()
-
-# add in the include path
-find_path(JAVA_INCLUDE_PATH jni.h
- ${JAVA_AWT_INCLUDE_DIRECTORIES}
-)
-
-find_path(JAVA_INCLUDE_PATH2 NAMES jni_md.h jniport.h
- PATHS
- ${JAVA_INCLUDE_PATH}
- ${JAVA_INCLUDE_PATH}/darwin
- ${JAVA_INCLUDE_PATH}/win32
- ${JAVA_INCLUDE_PATH}/linux
- ${JAVA_INCLUDE_PATH}/freebsd
- ${JAVA_INCLUDE_PATH}/openbsd
- ${JAVA_INCLUDE_PATH}/solaris
- ${JAVA_INCLUDE_PATH}/hp-ux
- ${JAVA_INCLUDE_PATH}/alpha
- ${JAVA_INCLUDE_PATH}/aix
-)
-
-find_path(JAVA_AWT_INCLUDE_PATH jawt.h
- ${JAVA_INCLUDE_PATH}
-)
-
-# Restore CMAKE_FIND_FRAMEWORK
-if(DEFINED _JNI_CMAKE_FIND_FRAMEWORK)
- set(CMAKE_FIND_FRAMEWORK ${_JNI_CMAKE_FIND_FRAMEWORK})
- unset(_JNI_CMAKE_FIND_FRAMEWORK)
-else()
- unset(CMAKE_FIND_FRAMEWORK)
-endif()
-
-#include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-INCLUDE (FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(JNI DEFAULT_MSG JAVA_AWT_LIBRARY
- JAVA_JVM_LIBRARY
- JAVA_INCLUDE_PATH
- JAVA_INCLUDE_PATH2
- JAVA_AWT_INCLUDE_PATH)
-
-mark_as_advanced(
- JAVA_AWT_LIBRARY
- JAVA_JVM_LIBRARY
- JAVA_AWT_INCLUDE_PATH
- JAVA_INCLUDE_PATH
- JAVA_INCLUDE_PATH2
-)
-
-set(JNI_LIBRARIES
- ${JAVA_AWT_LIBRARY}
- ${JAVA_JVM_LIBRARY}
-)
-
-set(JNI_INCLUDE_DIRS
- ${JAVA_INCLUDE_PATH}
- ${JAVA_INCLUDE_PATH2}
- ${JAVA_AWT_INCLUDE_PATH}
-)
-
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index 05b0fff..6cbfd29 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -110,6 +110,9 @@
/* Define if the function stack tracing code is to be compiled in */
#cmakedefine H5_HAVE_CODESTACK @H5_HAVE_CODESTACK@
+/* Define to 1 if you have the <curl/curl.h> header file. */
+#cmakedefine H5_HAVE_CURL_H @H5_HAVE_CURL_H@
+
/* Define if Darwin or Mac OS X */
#cmakedefine H5_HAVE_DARWIN @H5_HAVE_DARWIN@
@@ -185,6 +188,9 @@
/* Define to 1 if you have the `gettimeofday' function. */
#cmakedefine H5_HAVE_GETTIMEOFDAY @H5_HAVE_GETTIMEOFDAY@
+/* Define to 1 if you have the <hdfs.h> header file. */
+#cmakedefine H5_HAVE_HDFS_H @H5_HAVE_HDFS_H@
+
/* Define if the compiler understands inline */
#cmakedefine H5_HAVE_INLINE @H5_HAVE_INLINE@
@@ -201,12 +207,24 @@
/* Define to 1 if you have the <io.h> header file. */
#cmakedefine H5_HAVE_IO_H @H5_HAVE_IO_H@
+/* Define to 1 if you have the `crypto' library (-lcrypto). */
+#cmakedefine H5_HAVE_LIBCRYPTO @H5_HAVE_LIBCRYPTO@
+
+/* Define to 1 if you have the `curl' library (-lcurl). */
+#cmakedefine H5_HAVE_LIBCURL @H5_HAVE_LIBCURL@
+
/* Define to 1 if you have the `dl' library (-ldl). */
#cmakedefine H5_HAVE_LIBDL @H5_HAVE_LIBDL@
/* Define to 1 if you have the `dmalloc' library (-ldmalloc). */
#cmakedefine H5_HAVE_LIBDMALLOC @H5_HAVE_LIBDMALLOC@
+/* Proceed to build with libhdfs */
+#cmakedefine H5_HAVE_LIBHDFS @H5_HAVE_LIBHDFS@
+
+/* Define to 1 if you have the `jvm' library (-ljvm). */
+#cmakedefine H5_HAVE_LIBJVM @H5_HAVE_LIBJVM@
+
/* Define to 1 if you have the `m' library (-lm). */
#cmakedefine H5_HAVE_LIBM @H5_HAVE_LIBM@
@@ -264,6 +282,15 @@
/* Define if MPI_Info_c2f and MPI_Info_f2c exists */
#cmakedefine H5_HAVE_MPI_MULTI_LANG_Info @H5_HAVE_MPI_MULTI_LANG_Info@
+/* Define to 1 if you have the <openssl/evp.h> header file. */
+#cmakedefine H5_HAVE_OPENSSL_EVP_H @H5_HAVE_OPENSSL_EVP_H@
+
+/* Define to 1 if you have the <openssl/hmac.h> header file. */
+#cmakedefine H5_HAVE_OPENSSL_HMAC_H @H5_HAVE_OPENSSL_HMAC_H@
+
+/* Define to 1 if you have the <openssl/sha.h> header file. */
+#cmakedefine H5_HAVE_OPENSSL_SHA_H @H5_HAVE_OPENSSL_SHA_H@
+
/* Define if we have parallel support */
#cmakedefine H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@
@@ -282,6 +309,10 @@
/* Define to 1 if you have the `rand_r' function. */
#cmakedefine H5_HAVE_RAND_R @H5_HAVE_RAND_R@
+/* Define whether the Read-Only S3 virtual file driver (VFD) should be
+ compiled */
+#cmakedefine H5_HAVE_ROS3_VFD @H5_HAVE_ROS3_VFD@
+
/* Define to 1 if you have the `round' function. */
#cmakedefine H5_HAVE_ROUND @H5_HAVE_ROUND@
@@ -390,8 +421,13 @@
/* Define to 1 if you have the <szlib.h> header file. */
#cmakedefine H5_HAVE_SZLIB_H @H5_HAVE_SZLIB_H@
+#if defined(_WIN32) && !defined(H5_BUILT_AS_DYNAMIC_LIB)
+/* Not supported on WIN32 platforms with static linking */
+/* #undef H5_HAVE_THREADSAFE */
+#else
/* Define if we have thread safe support */
-#cmakedefine H5_HAVE_THREADSAFE @H5_HAVE_THREADSAFE@
+# cmakedefine H5_HAVE_THREADSAFE @H5_HAVE_THREADSAFE@
+#endif
/* Define if timezone is a global variable */
#cmakedefine H5_HAVE_TIMEZONE @H5_HAVE_TIMEZONE@
diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake
index 03597f2..2d3d371 100644
--- a/config/cmake/HDF5UseFortran.cmake
+++ b/config/cmake/HDF5UseFortran.cmake
@@ -14,7 +14,8 @@
# This file provides functions for HDF5 specific Fortran support.
#
#-------------------------------------------------------------------------------
-ENABLE_LANGUAGE (Fortran)
+enable_language (Fortran)
+
set (HDF_PREFIX "H5")
include (CheckFortranFunctionExists)
@@ -376,11 +377,11 @@ macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR)
set (${RETURN_VAR} ${OUTPUT_VAR})
- #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
- #message ( "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ")
- #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
- #message ( "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ")
- #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
+ #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
+ #message (STATUS "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ")
+ #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
+ #message (STATUS "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ")
+ #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
if (${COMPILE_RESULT_VAR})
if (${RUN_RESULT_VAR} MATCHES 1)
diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in
index 6951b09..5c21124 100644
--- a/config/cmake/HDF5_Examples.cmake.in
+++ b/config/cmake/HDF5_Examples.cmake.in
@@ -20,6 +20,9 @@ set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
if("@CMAKE_GENERATOR_TOOLSET@")
set(CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
endif()
+if("@CMAKE_GENERATOR_ARCHITECTURE@")
+ set(CMAKE_GENERATOR_ARCHITECTURE "@CMAKE_GENERATOR_ARCHITECTURE@")
+endif()
set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
# handle input parameters to script.
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 0a39568..adace89 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -143,7 +143,7 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
#
# Technically, variable-length arrays are part of the C99 standard, but
# we should approach them a bit cautiously... -QAK
- set (H5_CFLAGS1 "${H5_CFLAGS1} -Wlogical-op -Wlarger-than=2048 -Wvla")
+ set (H5_CFLAGS1 "${H5_CFLAGS1} -Wlogical-op -Wlarger-than=2560 -Wvla")
# Append more extra warning flags that only gcc 4.4+ know about
set (H5_CFLAGS1 "${H5_CFLAGS1} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat")
@@ -195,9 +195,25 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
# Append more extra warning flags that only gcc 6.x+ know about
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
- set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa")
+ set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized")
endif ()
+ # Append more extra warning flags that only gcc 7.x+ know about
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0)
+ set (H5_CFLAGS4 "${H5_CFLAGS4} -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wrestrict")
+ endif ()
+
+ # Append more extra warning flags that only gcc 8.x+ know about
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0)
+ set (H5_CFLAGS4 "${H5_CFLAGS4} -Wattribute-alias -Wcast-align=strict -Wshift-overflow=2 -Wno-suggest-attribute=cold -Wno-suggest-attribute=malloc")
+ endif ()
+
+ # Append more extra warning flags that only gcc 9.x+ know about
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0)
+ set (H5_CFLAGS4 "${H5_CFLAGS4} -Wattribute-alias=2 -Wmissing-profile")
+ endif ()
+elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Minform=inform")
endif ()
#-----------------------------------------------------------------------------
@@ -324,3 +340,80 @@ endif ()
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
endif ()
+
+#-----------------------------------------------------------------------------
+# Option for --enable-asserts
+# By default, CMake adds NDEBUG to CMAKE_${lang}_FLAGS for Release build types
+# This option will force/override the default setting for all configurations
+#-----------------------------------------------------------------------------
+#option (HDF5_ENABLE_ASSERTS "Determines whether NDEBUG is defined to control assertions." OFF)
+set (HDF5_ENABLE_ASSERTS "OFF" CACHE STRING "Determines whether NDEBUG is defined to control assertions (OFF NO YES)")
+set_property (CACHE HDF5_ENABLE_ASSERTS PROPERTY STRINGS OFF NO YES)
+if (HDF5_ENABLE_ASSERTS MATCHES "YES")
+ add_compile_options ("-UNDEBUG")
+elseif (HDF5_ENABLE_ASSERTS MATCHES "NO")
+ add_compile_options ("-DNDEBUG")
+endif ()
+MARK_AS_ADVANCED (HDF5_ENABLE_ASSERTS)
+
+#-----------------------------------------------------------------------------
+# Option for --enable-symbols
+# This option will force/override the default setting for all configurations
+#-----------------------------------------------------------------------------
+#option (HDF5_ENABLE_SYMBOLS "Add debug symbols to the library independent of the build mode and optimization level." OFF)
+set (HDF5_ENABLE_SYMBOLS "OFF" CACHE STRING "Add debug symbols to the library independent of the build mode and optimization level (OFF NO YES)")
+set_property (CACHE HDF5_ENABLE_SYMBOLS PROPERTY STRINGS OFF NO YES)
+if (HDF5_ENABLE_SYMBOLS MATCHES "YES")
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fno-omit-frame-pointer")
+ endif ()
+ if(CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
+ endif ()
+ endif ()
+elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO")
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-s")
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s")
+ endif ()
+ if(CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wl,-s")
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s")
+ endif ()
+ endif ()
+endif ()
+MARK_AS_ADVANCED (HDF5_ENABLE_SYMBOLS)
+
+#-----------------------------------------------------------------------------
+# Option for --enable-profiling
+# This option will force/override the default setting for all configurations
+#-----------------------------------------------------------------------------
+option (HDF5_ENABLE_PROFILING "Enable profiling flags independently from the build mode." OFF)
+if (HDF5_ENABLE_PROFILING)
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PROFILE_CFLAGS}")
+ if(CMAKE_CXX_COMPILER_LOADED)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PROFILE_CXXFLAGS}")
+ endif ()
+endif ()
+MARK_AS_ADVANCED (HDF5_ENABLE_PROFILING)
+
+#-----------------------------------------------------------------------------
+# Option for --enable-optimization
+# This option will force/override the default setting for all configurations
+#-----------------------------------------------------------------------------
+option (HDF5_ENABLE_OPTIMIZATION "Enable optimization flags/settings independently from the build mode" OFF)
+if (HDF5_ENABLE_OPTIMIZATION)
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPTIMIZE_CFLAGS}")
+ if(CMAKE_CXX_COMPILER_LOADED)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPTIMIZE_CXXFLAGS}")
+ endif ()
+endif ()
+MARK_AS_ADVANCED (HDF5_ENABLE_OPTIMIZATION)
diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in
index be6ddc1..b29d50b 100644
--- a/config/cmake/README.txt.cmake.in
+++ b/config/cmake/README.txt.cmake.in
@@ -34,9 +34,9 @@ utility should be installed.
To test the installation with the examples;
Create a directory to run the examples.
Copy HDF5Examples folder to this directory.
+ Copy CTestScript.cmake to this directory.
Copy HDF5_Examples.cmake to this directory.
Copy HDF5_Examples_options.cmake to this directory.
- Copy CTestScript.cmake to this directory.
The default source folder is defined as "HDF5Examples". It can be changed
with the CTEST_SOURCE_NAME script option.
The default installation folder is defined as "@CMAKE_INSTALL_PREFIX@".
diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake
index 754d742..8efee11 100644
--- a/config/cmake/UseJava.cmake
+++ b/config/cmake/UseJava.cmake
@@ -1,437 +1,373 @@
# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details.
-#.rst:
-# UseJava
-# -------
-#
-# Use Module for Java
-#
-# This file provides functions for Java. It is assumed that
-# FindJava.cmake has already been loaded. See FindJava.cmake for
-# information on how to load Java into your CMake project.
-#
-# ::
-#
-# add_jar(target_name
-# [SOURCES] source1 [source2 ...] [resource1 ...]
-# [INCLUDE_JARS jar1 [jar2 ...]]
-# [ENTRY_POINT entry]
-# [VERSION version]
-# [OUTPUT_NAME name]
-# [OUTPUT_DIR dir]
-# [GENERATE_NATIVE_HEADERS target [DESTINATION dir]]
-# )
-#
-# This command creates a <target_name>.jar. It compiles the given
-# source files (source) and adds the given resource files (resource) to
-# the jar file. Source files can be java files or listing files
-# (prefixed by '@'). If only resource files are given then just a jar file
-# is created. The list of include jars are added to the classpath when
-# compiling the java sources and also to the dependencies of the target.
-# INCLUDE_JARS also accepts other target names created by add_jar. For
-# backwards compatibility, jar files listed as sources are ignored (as
-# they have been since the first version of this module).
-#
-# The default OUTPUT_DIR can also be changed by setting the variable
-# CMAKE_JAVA_TARGET_OUTPUT_DIR.
-#
-# Optionally, using option GENERATE_NATIVE_HEADERS, native header files can be generated
-# for methods declared as native. These files provide the connective glue that allow your
-# Java and C code to interact. An INTERFACE target will be created for an easy usage
-# of generated files. Sub-option DESTINATION can be used to specify output directory for
-# generated header files.
-#
-# GENERATE_NATIVE_HEADERS option requires, at least, version 1.8 of the JDK.
-#
-# Additional instructions:
-#
-# ::
-#
-# To add compile flags to the target you can set these flags with
-# the following variable:
-#
-#
-#
-# ::
-#
-# set(CMAKE_JAVA_COMPILE_FLAGS -nowarn)
-#
-#
-#
-# ::
-#
-# To add a path or a jar file to the class path you can do this
-# with the CMAKE_JAVA_INCLUDE_PATH variable.
-#
-#
-#
-# ::
-#
-# set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar)
-#
-#
-#
-# ::
-#
-# To use a different output name for the target you can set it with:
-#
-#
-#
-# ::
-#
-# add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar)
-#
-#
-#
-# ::
-#
-# To use a different output directory than CMAKE_CURRENT_BINARY_DIR
-# you can set it with:
-#
-#
-#
-# ::
-#
-# add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
-#
-#
-#
-# ::
-#
-# To define an entry point in your jar you can set it with the ENTRY_POINT
-# named argument:
-#
-#
-#
-# ::
-#
-# add_jar(example ENTRY_POINT com/examples/MyProject/Main)
-#
-#
-#
-# ::
-#
-# To define a custom manifest for the jar, you can set it with the manifest
-# named argument:
-#
-#
-#
-# ::
-#
-# add_jar(example MANIFEST /path/to/manifest)
-#
-#
-#
-# ::
-#
-# To add a VERSION to the target output name you can set it using
-# the VERSION named argument to add_jar. This will create a jar file with the
-# name shibboleet-1.0.0.jar and will create a symlink shibboleet.jar
-# pointing to the jar with the version information.
-#
-#
-#
-# ::
-#
-# add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
-#
-#
-#
-# ::
-#
-# If the target is a JNI library, utilize the following commands to
-# create a JNI symbolic link:
-#
-#
-#
-# ::
-#
-# set(CMAKE_JNI_TARGET TRUE)
-# add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
-# install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
-# install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
-#
-#
-#
-# ::
-#
-# If a single target needs to produce more than one jar from its
-# java source code, to prevent the accumulation of duplicate class
-# files in subsequent jars, set/reset CMAKE_JAR_CLASSES_PREFIX prior
-# to calling the add_jar() function:
-#
-#
-#
-# ::
-#
-# set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
-# add_jar(foo foo.java)
-#
-#
-#
-# ::
-#
-# set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
-# add_jar(bar bar.java)
-#
-#
-#
-# ::
-#
-# For an optimum usage of option GENERATE_NATIVE_HEADERS, it is recommended to
-# include module JNI before any call to add_jar. The produced target for native
-# headers can then be used to compile C/C++ sources with command
-# target_link_libraries.
-#
-#
-# ::
-#
-# find_package(JNI)
-# add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native)
-# add_library(bar bar.cpp)
-# target_link_libraries(bar PRIVATE foo-native)
-#
-#
-# Target Properties:
-#
-# ::
-#
-# The add_jar() function sets some target properties. You can get these
-# properties with the
-# get_property(TARGET <target_name> PROPERTY <propery_name>)
-# command.
-#
-#
-#
-# ::
-#
-# INSTALL_FILES The files which should be installed. This is used by
-# install_jar().
-# JNI_SYMLINK The JNI symlink which should be installed.
-# This is used by install_jni_symlink().
-# JAR_FILE The location of the jar file so that you can include
-# it.
-# CLASSDIR The directory where the class files can be found. For
-# example to use them with javah.
-#
-# ::
-#
-# find_jar(<VAR>
-# name | NAMES name1 [name2 ...]
-# [PATHS path1 [path2 ... ENV var]]
-# [VERSIONS version1 [version2]]
-# [DOC "cache documentation string"]
-# )
-#
-# This command is used to find a full path to the named jar. A cache
-# entry named by <VAR> is created to stor the result of this command.
-# If the full path to a jar is found the result is stored in the
-# variable and the search will not repeated unless the variable is
-# cleared. If nothing is found, the result will be <VAR>-NOTFOUND, and
-# the search will be attempted again next time find_jar is invoked with
-# the same variable. The name of the full path to a file that is
-# searched for is specified by the names listed after NAMES argument.
-# Additional search locations can be specified after the PATHS argument.
-# If you require special a version of a jar file you can specify it with
-# the VERSIONS argument. The argument after DOC will be used for the
-# documentation string in the cache.
-#
-# ::
-#
-# install_jar(target_name destination)
-# install_jar(target_name DESTINATION destination [COMPONENT component])
-#
-# This command installs the TARGET_NAME files to the given DESTINATION.
-# It should be called in the same scope as add_jar() or it will fail.
-#
-# Target Properties:
-#
-# ::
-#
-# The install_jar() function sets the INSTALL_DESTINATION target property
-# on jars so installed. This property holds the DESTINATION as described
-# above, and is used by install_jar_exports(). You can get this property
-# with the
-# get_property(TARGET <target_name> PROPERTY INSTALL_DESTINATION)
-# command.
-#
-#
-#
-# ::
-#
-# install_jni_symlink(target_name destination)
-# install_jni_symlink(target_name DESTINATION destination [COMPONENT component])
-#
-# This command installs the TARGET_NAME JNI symlinks to the given
-# DESTINATION. It should be called in the same scope as add_jar() or it
-# will fail.
-#
-# ::
-#
-# install_jar_exports(TARGETS jars...
-# [NAMESPACE <namespace>]
-# FILE <filename>
-# DESTINATION <dir> [COMPONENT <component>])
-#
-# This command installs a target export file ``<filename>`` for the named jar
-# targets to the given ``DESTINATION``. Its function is similar to that of
-# :command:`install(EXPORTS ...)`.
-#
-# ::
-#
-# export_jars(TARGETS jars...
-# [NAMESPACE <namespace>]
-# FILE <filename>)
-#
-# This command writes a target export file ``<filename>`` for the named jar
-# targets. Its function is similar to that of :command:`export(...)`.
-#
-# ::
-#
-# create_javadoc(<VAR>
-# PACKAGES pkg1 [pkg2 ...]
-# [SOURCEPATH <sourcepath>]
-# [CLASSPATH <classpath>]
-# [INSTALLPATH <install path>]
-# [DOCTITLE "the documentation title"]
-# [WINDOWTITLE "the title of the document"]
-# [AUTHOR TRUE|FALSE]
-# [USE TRUE|FALSE]
-# [VERSION TRUE|FALSE]
-# )
-#
-# Create java documentation based on files or packages. For more
-# details please read the javadoc manpage.
-#
-# There are two main signatures for create_javadoc. The first signature
-# works with package names on a path with source files:
-#
-# ::
-#
-# Example:
-# create_javadoc(my_example_doc
-# PACKAGES com.example.foo com.example.bar
-# SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
-# CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
-# WINDOWTITLE "My example"
-# DOCTITLE "<h1>My example</h1>"
-# AUTHOR TRUE
-# USE TRUE
-# VERSION TRUE
-# )
-#
-#
-#
-# The second signature for create_javadoc works on a given list of
-# files.
-#
-# ::
-#
-# create_javadoc(<VAR>
-# FILES file1 [file2 ...]
-# [CLASSPATH <classpath>]
-# [INSTALLPATH <install path>]
-# [DOCTITLE "the documentation title"]
-# [WINDOWTITLE "the title of the document"]
-# [AUTHOR TRUE|FALSE]
-# [USE TRUE|FALSE]
-# [VERSION TRUE|FALSE]
-# )
-#
-#
-#
-# Example:
-#
-# ::
-#
-# create_javadoc(my_example_doc
-# FILES ${example_SRCS}
-# CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
-# WINDOWTITLE "My example"
-# DOCTITLE "<h1>My example</h1>"
-# AUTHOR TRUE
-# USE TRUE
-# VERSION TRUE
-# )
-#
-#
-#
-# Both signatures share most of the options. These options are the same
-# as what you can find in the javadoc manpage. Please look at the
-# manpage for CLASSPATH, DOCTITLE, WINDOWTITLE, AUTHOR, USE and VERSION.
-#
-# The documentation will be by default installed to
-#
-# ::
-#
-# ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>
-#
-#
-#
-# if you don't set the INSTALLPATH.
-#
-# ::
-#
-# create_javah(TARGET <target>
-# GENERATED_FILES <VAR>
-# CLASSES <class>...
-# [CLASSPATH <classpath>...]
-# [DEPENDS <depend>...]
-# [OUTPUT_NAME <path>|OUTPUT_DIR <path>]
-# )
-#
-# Create C header files from java classes. These files provide the connective glue
-# that allow your Java and C code to interact.
-#
-# This command will no longer be supported starting with version 10 of the JDK due
-# to the `suppression of javah tool <http://openjdk.java.net/jeps/313>`_.
-# Command ``add_jar(GENERATE_NATIVE_HEADERS)`` must be used instead.
-#
-# There are two main signatures for create_javah. The first signature
-# returns generated files through variable specified by GENERATED_FILES option:
-#
-# ::
-#
-# Example:
-# Create_javah(GENERATED_FILES files_headers
-# CLASSES org.cmake.HelloWorld
-# CLASSPATH hello.jar
-# )
-#
-#
-#
-# The second signature for create_javah creates a target which encapsulates
-# header files generation.
-#
-# ::
-#
-# Example:
-# Create_javah(TARGET target_headers
-# CLASSES org.cmake.HelloWorld
-# CLASSPATH hello.jar
-# )
-#
-#
-#
-# Both signatures share same options.
-#
-# ``CLASSES <class>...``
-# Specifies Java classes used to generate headers.
-#
-# ``CLASSPATH <classpath>...``
-# Specifies various paths to look up classes. Here .class files, jar files or targets
-# created by command add_jar can be used.
-#
-# ``DEPENDS <depend>...``
-# Targets on which the javah target depends
-#
-# ``OUTPUT_NAME <path>``
-# Concatenates the resulting header files for all the classes listed by option CLASSES
-# into <path>. Same behavior as option '-o' of javah tool.
-#
-# ``OUTPUT_DIR <path>``
-# Sets the directory where the header files will be generated. Same behavior as option
-# '-d' of javah tool. If not specified, ${CMAKE_CURRENT_BINARY_DIR} is used as output directory.
+#[=======================================================================[.rst:
+UseJava
+-------
+
+Use Module for Java
+
+This file provides functions for Java. It is assumed that
+:module:`FindJava` has already been loaded. See :module:`FindJava` for
+information on how to load Java into your CMake project.
+
+Creating And Installing JARs
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: cmake
+
+ add_jar(<target_name>
+ [SOURCES] <source1> [<source2>...] [<resource1>...]
+ [INCLUDE_JARS <jar1> [<jar2>...]]
+ [ENTRY_POINT <entry>]
+ [VERSION <version>]
+ [OUTPUT_NAME <name>]
+ [OUTPUT_DIR <dir>]
+ [GENERATE_NATIVE_HEADERS <target> [DESTINATION <dir>]]
+ )
+
+This command creates a ``<target_name>.jar``. It compiles the given
+``<source>`` files and adds the given ``<resource>`` files to
+the jar file. Source files can be java files or listing files
+(prefixed by ``@``). If only resource files are given then just a jar file
+is created. The list of ``INCLUDE_JARS`` are added to the classpath when
+compiling the java sources and also to the dependencies of the target.
+``INCLUDE_JARS`` also accepts other target names created by ``add_jar()``.
+For backwards compatibility, jar files listed as sources are ignored (as
+they have been since the first version of this module).
+
+The default ``OUTPUT_DIR`` can also be changed by setting the variable
+``CMAKE_JAVA_TARGET_OUTPUT_DIR``.
+
+Optionally, using option ``GENERATE_NATIVE_HEADERS``, native header files can
+be generated for methods declared as native. These files provide the
+connective glue that allow your Java and C code to interact. An INTERFACE
+target will be created for an easy usage of generated files. Sub-option
+``DESTINATION`` can be used to specify the output directory for generated
+header files.
+
+``GENERATE_NATIVE_HEADERS`` option requires, at least, version 1.8 of the JDK.
+
+The ``add_jar()`` function sets the following target properties on
+``<target_name>``:
+
+``INSTALL_FILES``
+ The files which should be installed. This is used by ``install_jar()``.
+``JNI_SYMLINK``
+ The JNI symlink which should be installed. This is used by
+ ``install_jni_symlink()``.
+``JAR_FILE``
+ The location of the jar file so that you can include it.
+``CLASSDIR``
+ The directory where the class files can be found. For example to use them
+ with ``javah``.
+
+.. code-block:: cmake
+
+ install_jar(<target_name> <destination>)
+ install_jar(<target_name> DESTINATION <destination> [COMPONENT <component>])
+
+This command installs the ``<target_name>`` files to the given
+``<destination>``. It should be called in the same scope as ``add_jar()`` or
+it will fail.
+
+The ``install_jar()`` function sets the ``INSTALL_DESTINATION`` target
+property on jars so installed. This property holds the ``<destination>`` as
+described above, and is used by ``install_jar_exports()``. You can get this
+information with :command:`get_property` and the ``INSTALL_DESTINATION``
+property key.
+
+.. code-block:: cmake
+
+ install_jni_symlink(<target_name> <destination>)
+ install_jni_symlink(<target_name> DESTINATION <destination> [COMPONENT <component>])
+
+This command installs the ``<target_name>`` JNI symlinks to the given
+``<destination>``. It should be called in the same scope as ``add_jar()`` or
+it will fail.
+
+.. code-block:: cmake
+
+ install_jar_exports(TARGETS <jars>...
+ [NAMESPACE <namespace>]
+ FILE <filename>
+ DESTINATION <destination> [COMPONENT <component>])
+
+This command installs a target export file ``<filename>`` for the named jar
+targets to the given ``<destination>`` directory. Its function is similar to
+that of :command:`install(EXPORTS)`.
+
+.. code-block:: cmake
+
+ export_jars(TARGETS <jars>...
+ [NAMESPACE <namespace>]
+ FILE <filename>)
+
+This command writes a target export file ``<filename>`` for the named ``<jars>``
+targets. Its function is similar to that of :command:`export`.
+
+
+Examples
+""""""""
+
+To add compile flags to the target you can set these flags with the following
+variable:
+
+.. code-block:: cmake
+
+ set(CMAKE_JAVA_COMPILE_FLAGS -nowarn)
+
+
+To add a path or a jar file to the class path you can do this with the
+``CMAKE_JAVA_INCLUDE_PATH`` variable.
+
+.. code-block:: cmake
+
+ set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar)
+
+To use a different output name for the target you can set it with:
+
+.. code-block:: cmake
+
+ add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar)
+
+To use a different output directory than ``CMAKE_CURRENT_BINARY_DIR`` you can
+set it with:
+
+.. code-block:: cmake
+
+ add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
+
+To define an entry point in your jar you can set it with the ``ENTRY_POINT``
+named argument:
+
+.. code-block:: cmake
+
+ add_jar(example ENTRY_POINT com/examples/MyProject/Main)
+
+To define a custom manifest for the jar, you can set it with the ``MANIFEST``
+named argument:
+
+.. code-block:: cmake
+
+ add_jar(example MANIFEST /path/to/manifest)
+
+To add a version to the target output name you can set it using the ``VERSION``
+named argument to ``add_jar()``. The following example will create a jar file
+with the name ``shibboleet-1.0.0.jar`` and will create a symlink
+``shibboleet.jar`` pointing to the jar with the version information.
+
+.. code-block:: cmake
+
+ add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
+
+If the target is a JNI library, utilize the following commands to
+create a JNI symbolic link:
+
+.. code-block:: cmake
+
+ set(CMAKE_JNI_TARGET TRUE)
+ add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
+ install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
+ install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
+
+If a single target needs to produce more than one jar from its
+java source code, to prevent the accumulation of duplicate class
+files in subsequent jars, set/reset ``CMAKE_JAR_CLASSES_PREFIX`` prior
+to calling the ``add_jar()`` function:
+
+.. code-block:: cmake
+
+ set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
+ add_jar(foo foo.java)
+
+ set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
+ add_jar(bar bar.java)
+
+For an optimum usage of option ``GENERATE_NATIVE_HEADERS``, it is recommended to
+include module JNI before any call to ``add_jar()``. The produced target for
+native headers can then be used to compile C/C++ sources with the
+:command:`target_link_libraries` command.
+
+.. code-block:: cmake
+
+ find_package(JNI)
+ add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native)
+ add_library(bar bar.cpp)
+ target_link_libraries(bar PRIVATE foo-native)
+
+
+Finding JARs
+^^^^^^^^^^^^
+
+.. code-block:: cmake
+
+ find_jar(<VAR>
+ <name> | NAMES <name1> [<name2>...]
+ [PATHS <path1> [<path2>... ENV <var>]]
+ [VERSIONS <version1> [<version2>]]
+ [DOC "cache documentation string"]
+ )
+
+This command is used to find a full path to the named jar. A cache
+entry named by ``<VAR>`` is created to store the result of this command.
+If the full path to a jar is found the result is stored in the
+variable and the search will not repeated unless the variable is
+cleared. If nothing is found, the result will be ``<VAR>-NOTFOUND``, and
+the search will be attempted again next time ``find_jar()`` is invoked with
+the same variable. The name of the full path to a file that is
+searched for is specified by the names listed after ``NAMES`` argument.
+Additional search locations can be specified after the ``PATHS`` argument.
+If you require special a version of a jar file you can specify it with
+the ``VERSIONS`` argument. The argument after ``DOC`` will be used for the
+documentation string in the cache.
+
+
+Javadoc
+^^^^^^^
+
+The ``create_javadoc()`` command can be used to create java documentation
+based on files or packages. For more details please read the javadoc manpage.
+
+There are two main signatures for ``create_javadoc()``. The first signature
+works with package names on a path with source files.
+
+.. code-block:: cmake
+
+ create_javadoc(<VAR>
+ PACKAGES <pkg1> [<pkg2>...]
+ [SOURCEPATH <sourcepath>]
+ [CLASSPATH <classpath>]
+ [INSTALLPATH <install path>]
+ [DOCTITLE "the documentation title"]
+ [WINDOWTITLE "the title of the document"]
+ [AUTHOR TRUE|FALSE]
+ [USE TRUE|FALSE]
+ [VERSION TRUE|FALSE]
+ )
+
+For example:
+
+.. code-block:: cmake
+
+ create_javadoc(my_example_doc
+ PACKAGES com.example.foo com.example.bar
+ SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
+ CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
+ WINDOWTITLE "My example"
+ DOCTITLE "<h1>My example</h1>"
+ AUTHOR TRUE
+ USE TRUE
+ VERSION TRUE
+ )
+
+The second signature for ``create_javadoc()`` works on a given list of
+files.
+
+.. code-block:: cmake
+
+ create_javadoc(<VAR>
+ FILES <file1> [<file2>...]
+ [CLASSPATH <classpath>]
+ [INSTALLPATH <install path>]
+ [DOCTITLE "the documentation title"]
+ [WINDOWTITLE "the title of the document"]
+ [AUTHOR TRUE|FALSE]
+ [USE TRUE|FALSE]
+ [VERSION TRUE|FALSE]
+ )
+
+For example:
+
+.. code-block:: cmake
+
+ create_javadoc(my_example_doc
+ FILES ${example_SRCS}
+ CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
+ WINDOWTITLE "My example"
+ DOCTITLE "<h1>My example</h1>"
+ AUTHOR TRUE
+ USE TRUE
+ VERSION TRUE
+ )
+
+Both signatures share most of the options. These options are the same
+as what you can find in the javadoc manpage. Please look at the
+manpage for ``CLASSPATH``, ``DOCTITLE``, ``WINDOWTITLE``, ``AUTHOR``, ``USE``
+and ``VERSION``.
+
+If you don't set the ``INSTALLPATH``, then by default the documentation will
+be installed to :
+
+::
+
+ ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>
+
+
+Header Generation
+^^^^^^^^^^^^^^^^^
+
+.. code-block:: cmake
+
+ create_javah(TARGET <target> | GENERATED_FILES <VAR>
+ CLASSES <class>...
+ [CLASSPATH <classpath>...]
+ [DEPENDS <depend>...]
+ [OUTPUT_NAME <path>|OUTPUT_DIR <path>]
+ )
+
+Create C header files from java classes. These files provide the connective glue
+that allow your Java and C code to interact.
+
+.. deprecated:: 3.11
+
+.. note::
+
+ This command will no longer be supported starting with version 10 of the JDK
+ due to the `suppression of javah tool <http://openjdk.java.net/jeps/313>`_.
+ The ``add_jar(GENERATE_NATIVE_HEADERS)`` command should be used instead.
+
+There are two main signatures for ``create_javah()``. The first signature
+returns generated files through variable specified by the ``GENERATED_FILES``
+option. For example:
+
+.. code-block:: cmake
+
+ create_javah(GENERATED_FILES files_headers
+ CLASSES org.cmake.HelloWorld
+ CLASSPATH hello.jar
+ )
+
+The second signature for ``create_javah()`` creates a target which encapsulates
+header files generation. E.g.
+
+.. code-block:: cmake
+
+ create_javah(TARGET target_headers
+ CLASSES org.cmake.HelloWorld
+ CLASSPATH hello.jar
+ )
+
+Both signatures share same options.
+
+``CLASSES <class>...``
+ Specifies Java classes used to generate headers.
+
+``CLASSPATH <classpath>...``
+ Specifies various paths to look up classes. Here .class files, jar files or
+ targets created by command add_jar can be used.
+
+``DEPENDS <depend>...``
+ Targets on which the javah target depends.
+
+``OUTPUT_NAME <path>``
+ Concatenates the resulting header files for all the classes listed by option
+ ``CLASSES`` into ``<path>``. Same behavior as option ``-o`` of javah tool.
+
+``OUTPUT_DIR <path>``
+ Sets the directory where the header files will be generated. Same behavior
+ as option ``-d`` of javah tool. If not specified,
+ :variable:`CMAKE_CURRENT_BINARY_DIR` is used as the output directory.
+#]=======================================================================]
include(CMakeParseArguments)
@@ -446,7 +382,7 @@ function (__java_copy_file src dest comment)
endfunction ()
function(__java_lcat VAR)
- foreach(_line ${ARGN})
+ foreach(_line IN LISTS ARGN)
string(APPEND ${VAR} "${_line}\n")
endforeach()
@@ -568,7 +504,7 @@ function(add_jar _TARGET_NAME)
set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
endif()
- foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH})
+ foreach (JAVA_INCLUDE_DIR IN LISTS CMAKE_JAVA_INCLUDE_PATH)
string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
endforeach()
@@ -592,7 +528,7 @@ function(add_jar _TARGET_NAME)
set(_JAVA_COMPILE_DEPENDS)
set(_JAVA_RESOURCE_FILES)
set(_JAVA_RESOURCE_FILES_RELATIVE)
- foreach(_JAVA_SOURCE_FILE ${_JAVA_SOURCE_FILES})
+ foreach(_JAVA_SOURCE_FILE IN LISTS _JAVA_SOURCE_FILES)
get_filename_component(_JAVA_EXT ${_JAVA_SOURCE_FILE} EXT)
get_filename_component(_JAVA_FILE ${_JAVA_SOURCE_FILE} NAME_WE)
get_filename_component(_JAVA_PATH ${_JAVA_SOURCE_FILE} PATH)
@@ -607,7 +543,7 @@ function(add_jar _TARGET_NAME)
file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL})
string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN)
string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN)
- if (${_BIN_LEN} LESS ${_SRC_LEN})
+ if (_BIN_LEN LESS _SRC_LEN)
set(_JAVA_REL_PATH ${_JAVA_REL_BINARY_PATH})
else ()
set(_JAVA_REL_PATH ${_JAVA_REL_SOURCE_PATH})
@@ -637,14 +573,14 @@ function(add_jar _TARGET_NAME)
endif ()
endforeach()
- foreach(_JAVA_INCLUDE_JAR ${_add_jar_INCLUDE_JARS})
+ foreach(_JAVA_INCLUDE_JAR IN LISTS _add_jar_INCLUDE_JARS)
if (TARGET ${_JAVA_INCLUDE_JAR})
get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE)
if (_JAVA_JAR_PATH)
string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}")
list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH})
list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR})
- list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_INCLUDE_JAR})
+ list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_JAR_PATH})
else ()
message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar")
endif ()
@@ -698,14 +634,14 @@ function(add_jar _TARGET_NAME)
)
else ()
# create an empty java_class_filelist
- if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
+ if (NOT EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist")
file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
endif()
endif ()
# create the jar file
set(_JAVA_JAR_OUTPUT_PATH
- ${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME})
+ "${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME}")
if (CMAKE_JNI_TARGET)
add_custom_command(
OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
@@ -800,7 +736,8 @@ function(add_jar _TARGET_NAME)
# this INTERFACE library depends on jar generation
add_dependencies (${_GENERATE_NATIVE_HEADERS_TARGET} ${_TARGET_NAME})
- set_property (DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}")
+ set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES
+ "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}")
endif()
endfunction()
@@ -903,15 +840,15 @@ function (find_jar VARIABLE)
set(_state "name")
- foreach (arg ${ARGN})
- if (${_state} STREQUAL "name")
- if (${arg} STREQUAL "VERSIONS")
+ foreach (arg IN LISTS ARGN)
+ if (_state STREQUAL "name")
+ if (arg STREQUAL "VERSIONS")
set(_state "versions")
- elseif (${arg} STREQUAL "NAMES")
+ elseif (arg STREQUAL "NAMES")
set(_state "names")
- elseif (${arg} STREQUAL "PATHS")
+ elseif (arg STREQUAL "PATHS")
set(_state "paths")
- elseif (${arg} STREQUAL "DOC")
+ elseif (arg STREQUAL "DOC")
set(_state "doc")
else ()
set(_jar_names ${arg})
@@ -919,22 +856,22 @@ function (find_jar VARIABLE)
set(_jar_doc "Finding ${arg} jar")
endif ()
endif ()
- elseif (${_state} STREQUAL "versions")
- if (${arg} STREQUAL "NAMES")
+ elseif (_state STREQUAL "versions")
+ if (arg STREQUAL "NAMES")
set(_state "names")
- elseif (${arg} STREQUAL "PATHS")
+ elseif (arg STREQUAL "PATHS")
set(_state "paths")
- elseif (${arg} STREQUAL "DOC")
+ elseif (arg STREQUAL "DOC")
set(_state "doc")
else ()
set(_jar_versions ${_jar_versions} ${arg})
endif ()
- elseif (${_state} STREQUAL "names")
- if (${arg} STREQUAL "VERSIONS")
+ elseif (_state STREQUAL "names")
+ if (arg STREQUAL "VERSIONS")
set(_state "versions")
- elseif (${arg} STREQUAL "PATHS")
+ elseif (arg STREQUAL "PATHS")
set(_state "paths")
- elseif (${arg} STREQUAL "DOC")
+ elseif (arg STREQUAL "DOC")
set(_state "doc")
else ()
set(_jar_names ${_jar_names} ${arg})
@@ -942,22 +879,22 @@ function (find_jar VARIABLE)
set(_jar_doc "Finding ${arg} jar")
endif ()
endif ()
- elseif (${_state} STREQUAL "paths")
- if (${arg} STREQUAL "VERSIONS")
+ elseif (_state STREQUAL "paths")
+ if (arg STREQUAL "VERSIONS")
set(_state "versions")
- elseif (${arg} STREQUAL "NAMES")
+ elseif (arg STREQUAL "NAMES")
set(_state "names")
- elseif (${arg} STREQUAL "DOC")
+ elseif (arg STREQUAL "DOC")
set(_state "doc")
else ()
set(_jar_paths ${_jar_paths} ${arg})
endif ()
- elseif (${_state} STREQUAL "doc")
- if (${arg} STREQUAL "VERSIONS")
+ elseif (_state STREQUAL "doc")
+ if (arg STREQUAL "VERSIONS")
set(_state "versions")
- elseif (${arg} STREQUAL "NAMES")
+ elseif (arg STREQUAL "NAMES")
set(_state "names")
- elseif (${arg} STREQUAL "PATHS")
+ elseif (arg STREQUAL "PATHS")
set(_state "paths")
else ()
set(_jar_doc ${arg})
@@ -969,8 +906,8 @@ function (find_jar VARIABLE)
message(FATAL_ERROR "find_jar: No name to search for given")
endif ()
- foreach (jar_name ${_jar_names})
- foreach (version ${_jar_versions})
+ foreach (jar_name IN LISTS _jar_names)
+ foreach (version IN LISTS _jar_versions)
set(_jar_files ${_jar_files} ${jar_name}-${version}.jar)
endforeach ()
set(_jar_files ${_jar_files} ${jar_name}.jar)
@@ -998,301 +935,301 @@ function(create_javadoc _target)
set(_state "package")
- foreach (arg ${ARGN})
- if (${_state} STREQUAL "package")
- if (${arg} STREQUAL "PACKAGES")
+ foreach (arg IN LISTS ARGN)
+ if (_state STREQUAL "package")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "OVERVIEW")
+ elseif (arg STREQUAL "OVERVIEW")
set(_state "overview")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_packages ${arg})
set(_state "packages")
endif ()
- elseif (${_state} STREQUAL "packages")
- if (${arg} STREQUAL "FILES")
+ elseif (_state STREQUAL "packages")
+ if (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "OVERVIEW")
+ elseif (arg STREQUAL "OVERVIEW")
set(_state "overview")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_packages ${arg})
endif ()
- elseif (${_state} STREQUAL "files")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "files")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "OVERVIEW")
+ elseif (arg STREQUAL "OVERVIEW")
set(_state "overview")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_files ${arg})
endif ()
- elseif (${_state} STREQUAL "sourcepath")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "sourcepath")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "OVERVIEW")
+ elseif (arg STREQUAL "OVERVIEW")
set(_state "overview")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_sourcepath ${arg})
endif ()
- elseif (${_state} STREQUAL "classpath")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "classpath")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
- set(_state "sourcepath")
- elseif (${arg} STREQUAL "OVERVIEW")
+ elseif (arg STREQUAL "OVERVIEW")
set(_state "overview")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
+ set(_state "sourcepath")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_classpath ${arg})
endif ()
- elseif (${_state} STREQUAL "installpath")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "installpath")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "OVERVIEW")
+ elseif (arg STREQUAL "OVERVIEW")
set(_state "overview")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_installpath ${arg})
endif ()
- elseif (${_state} STREQUAL "doctitle")
+ elseif (_state STREQUAL "doctitle")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "OVERVIEW")
+ elseif (arg STREQUAL "OVERVIEW")
set(_state "overview")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_doctitle ${arg})
endif ()
- elseif (${_state} STREQUAL "windowtitle")
+ elseif (_state STREQUAL "windowtitle")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "OVERVIEW")
+ elseif (arg STREQUAL "OVERVIEW")
set(_state "overview")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_windowtitle ${arg})
endif ()
- elseif (${_state} STREQUAL "author")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "author")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "OVERVIEW")
+ elseif (arg STREQUAL "OVERVIEW")
set(_state "overview")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_author ${arg})
endif ()
- elseif (${_state} STREQUAL "use")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "use")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "OVERVIEW")
+ elseif (arg STREQUAL "OVERVIEW")
set(_state "overview")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_use ${arg})
endif ()
- elseif (${_state} STREQUAL "version")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "version")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "OVERVIEW")
+ elseif (arg STREQUAL "OVERVIEW")
set(_state "overview")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_version ${arg})
endif ()
- elseif (${_state} STREQUAL "overview")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "overview")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
- list(APPEND _javadoc_overview ${arg})
+ set(_javadoc_overview ${arg})
endif ()
endif ()
endforeach ()
@@ -1302,7 +1239,7 @@ function(create_javadoc _target)
if (_javadoc_sourcepath)
set(_start TRUE)
- foreach(_path ${_javadoc_sourcepath})
+ foreach(_path IN LISTS _javadoc_sourcepath)
if (_start)
set(_sourcepath ${_path})
set(_start FALSE)
@@ -1315,7 +1252,7 @@ function(create_javadoc _target)
if (_javadoc_overview)
set(_start TRUE)
- foreach(_path ${_javadoc_overview})
+ foreach(_path IN LISTS _javadoc_overview)
if (_start)
set(_overview ${_path})
set(_start FALSE)
@@ -1328,7 +1265,7 @@ function(create_javadoc _target)
if (_javadoc_classpath)
set(_start TRUE)
- foreach(_path ${_javadoc_classpath})
+ foreach(_path IN LISTS _javadoc_classpath)
if (_start)
set(_classpath ${_path})
set(_start FALSE)
@@ -1495,7 +1432,7 @@ function(export_jars)
# Set content of generated exports file
string(REPLACE ";" " " __targets__ "${_export_jars_TARGETS}")
set(__targetdefs__ "")
- foreach(_target ${_export_jars_TARGETS})
+ foreach(_target IN LISTS _export_jars_TARGETS)
get_target_property(_jarpath ${_target} JAR_FILE)
get_filename_component(_jarpath ${_jarpath} PATH)
__java_export_jar(__targetdefs__ ${_target} "${_jarpath}")
@@ -1533,7 +1470,7 @@ function(install_jar_exports)
endif()
# Determine relative path from installed export file to install prefix
- if(IS_ABSOLUTE ${_install_jar_exports_DESTINATION})
+ if(IS_ABSOLUTE "${_install_jar_exports_DESTINATION}")
file(RELATIVE_PATH _relpath
${_install_jar_exports_DESTINATION}
${CMAKE_INSTALL_PREFIX}
@@ -1552,7 +1489,7 @@ function(install_jar_exports)
# Set content of generated exports file
string(REPLACE ";" " " __targets__ "${_install_jar_exports_TARGETS}")
set(__targetdefs__ "set(_prefix \${CMAKE_CURRENT_LIST_DIR}/${_relpath})\n\n")
- foreach(_target ${_install_jar_exports_TARGETS})
+ foreach(_target IN LISTS _install_jar_exports_TARGETS)
get_target_property(_dir ${_target} INSTALL_DESTINATION)
__java_export_jar(__targetdefs__ ${_target} "\${_prefix}/${_dir}")
endforeach()
diff --git a/config/cmake/UseJavaClassFilelist.cmake b/config/cmake/UseJavaClassFilelist.cmake
index 4420550..b98276f 100644
--- a/config/cmake/UseJavaClassFilelist.cmake
+++ b/config/cmake/UseJavaClassFilelist.cmake
@@ -1,16 +1,17 @@
# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details.
-#.rst:
-# UseJavaClassFilelist
-# --------------------
-#
-#
-#
-#
-#
-# This script create a list of compiled Java class files to be added to
-# a jar file. This avoids including cmake files which get created in
-# the binary directory.
+#[=======================================================================[.rst:
+UseJavaClassFilelist
+--------------------
+
+
+
+
+
+This script create a list of compiled Java class files to be added to
+a jar file. This avoids including cmake files which get created in
+the binary directory.
+#]=======================================================================]
if (CMAKE_JAVA_CLASS_OUTPUT_PATH)
if (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
diff --git a/config/cmake/UseJavaSymlinks.cmake b/config/cmake/UseJavaSymlinks.cmake
index cd73348..a4db5c1 100644
--- a/config/cmake/UseJavaSymlinks.cmake
+++ b/config/cmake/UseJavaSymlinks.cmake
@@ -1,14 +1,15 @@
# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details.
-#.rst:
-# UseJavaSymlinks
-# ---------------
-#
-#
-#
-#
-#
-# Helper script for UseJava.cmake
+#[=======================================================================[.rst:
+UseJavaSymlinks
+---------------
+
+
+
+
+
+Helper script for UseJava.cmake
+#]=======================================================================]
if (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
if (_JAVA_TARGET_OUTPUT_NAME)
diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake
index d5c5e52..5254115 100644
--- a/config/cmake/cacheinit.cmake
+++ b/config/cmake/cacheinit.cmake
@@ -19,6 +19,8 @@ set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Framework
set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
+set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace (can be empty)" FORCE)
+
set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
set (HDF5_BUILD_GENERATORS ON CACHE BOOL "Build Test Generators" FORCE)
diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in
index 8e16725..575c1ab 100644
--- a/config/cmake/hdf5-config-version.cmake.in
+++ b/config/cmake/hdf5-config-version.cmake.in
@@ -21,38 +21,38 @@
set (PACKAGE_VERSION "@HDF5_VERSION_STRING@")
-if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
+if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
-else ()
- if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@")
+else()
+ if("@H5_VERS_MAJOR@.@H5_VERS_MINOR@" MATCHES "^([0-9]+)\\.([0-9]+)")
+ set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
+ set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
+ else()
+ set(CVF_VERSION_MAJOR "@HDF5_VERSION_STRING@")
+ set(CVF_VERSION_MINOR "")
+ endif()
+
+ if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND
+ (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR))
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ else()
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+ endif()
+
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
+ set(PACKAGE_VERSION_EXACT TRUE)
+ endif()
+endif()
- # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@
- if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@")
-
- # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x
- set (PACKAGE_VERSION_COMPATIBLE TRUE)
-
- if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@")
- set (PACKAGE_VERSION_EXACT TRUE)
-
- if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@")
- # not using this yet
- endif ()
- endif ()
- else ()
- set (PACKAGE_VERSION_COMPATIBLE FALSE)
- endif ()
- endif ()
-endif ()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
-if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
+if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
return()
-endif ()
+endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
-if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@")
+if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
-endif ()
+endif()
diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in
index 3bd9e1d..b5a12a6 100644
--- a/config/cmake/hdf5-config.cmake.in
+++ b/config/cmake/hdf5-config.cmake.in
@@ -42,9 +42,11 @@ set (${HDF5_PACKAGE_NAME}_ENABLE_THREADSAFE @HDF5_ENABLE_THREADSAFE@)
set (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
-set (${HDF5_PACKAGE_NAME}_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
+set (${HDF5_PACKAGE_NAME}_BUILD_SHARED_LIBS @H5_ENABLE_SHARED_LIB@)
+set (${HDF5_PACKAGE_NAME}_BUILD_STATIC_LIBS @H5_ENABLE_STATIC_LIB@)
set (${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@)
set (${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES @HDF5_LIBRARIES_TO_EXPORT@)
+set (${HDF5_PACKAGE_NAME}_ARCHITECTURE "@CMAKE_GENERATOR_ARCHITECTURE@")
set (${HDF5_PACKAGE_NAME}_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
set (${HDF5_PACKAGE_NAME}_DEFAULT_API_VERSION "@DEFAULT_API_VERSION@")
set (${HDF5_PACKAGE_NAME}_PARALLEL_FILTERED_WRITES "@PARALLEL_FILTERED_WRITES@")
@@ -99,19 +101,19 @@ endif ()
#-----------------------------------------------------------------------------
# Version Strings
#-----------------------------------------------------------------------------
-set (HDF5_VERSION_STRING @HDF5_VERSION_STRING@)
-set (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@)
-set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
+set (${HDF5_PACKAGE_NAME}_VERSION_STRING @HDF5_VERSION_STRING@)
+set (${HDF5_PACKAGE_NAME}_VERSION_MAJOR @HDF5_VERSION_MAJOR@)
+set (${HDF5_PACKAGE_NAME}_VERSION_MINOR @HDF5_VERSION_MINOR@)
#-----------------------------------------------------------------------------
# Don't include targets if this file is being picked up by another
# project which has already built hdf5 as a subproject
#-----------------------------------------------------------------------------
if (NOT TARGET "@HDF5_PACKAGE@")
- if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
+ if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS)
include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
endif ()
- if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip")
+ if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS)
include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
endif ()
include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
@@ -119,22 +121,28 @@ endif ()
# Handle default component(static) :
if (NOT ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
+ if (${HDF5_PACKAGE_NAME}_BUILD_STATIC_LIBS)
set (${HDF5_PACKAGE_NAME}_LIB_TYPE)
set (${HDF5_PACKAGE_NAME}_FIND_COMPONENTS C HL static)
set (${HDF5_PACKAGE_NAME}_FIND_REQUIRED_static_C true)
+ else ()
+ set (${HDF5_PACKAGE_NAME}_LIB_TYPE)
+ set (${HDF5_PACKAGE_NAME}_FIND_COMPONENTS C HL shared)
+ set (${HDF5_PACKAGE_NAME}_FIND_REQUIRED_shared_C true)
+ endif ()
endif ()
# Handle requested components:
list (REMOVE_DUPLICATES ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
- if (${comp} STREQUAL "shared")
+ if (comp STREQUAL "shared")
list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp})
set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp})
if (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN)
set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_FORTRAN "@PACKAGE_INCLUDE_INSTALL_DIR@/shared")
endif ()
- elseif (${comp} STREQUAL "static")
+ elseif (comp STREQUAL "static")
list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp})
set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp})
@@ -146,32 +154,32 @@ endforeach ()
foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE)
foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
set (hdf5_comp2)
- if (${comp} STREQUAL "C")
+ if (comp STREQUAL "C")
set (hdf5_comp "hdf5")
- elseif (${comp} STREQUAL "CXX")
+ elseif (comp STREQUAL "CXX")
set (hdf5_comp "hdf5_cpp")
- elseif (${comp} STREQUAL "HL")
+ elseif (comp STREQUAL "HL")
set (hdf5_comp "hdf5_hl")
- elseif (${comp} STREQUAL "CXX_HL")
+ elseif (comp STREQUAL "CXX_HL")
set (hdf5_comp "hdf5_hl_cpp")
- elseif (${comp} STREQUAL "Java")
+ elseif (comp STREQUAL "Java")
set (hdf5_comp "hdf5_java")
- elseif (${comp} STREQUAL "Tools")
+ elseif (comp STREQUAL "Tools")
set (hdf5_comp "hdf5_tools")
- elseif (${comp} STREQUAL "Fortran")
+ elseif (comp STREQUAL "Fortran")
set (hdf5_comp2 "hdf5_f90cstub")
set (hdf5_comp "hdf5_fortran")
- elseif (${comp} STREQUAL "Fortran_HL")
+ elseif (comp STREQUAL "Fortran_HL")
set (hdf5_comp2 "hdf5_hl_f90cstub")
set (hdf5_comp "hdf5_hl_fortran")
endif ()
- if (${comp} STREQUAL "Java")
+ if (comp STREQUAL "Java")
list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}" HAVE_COMP)
else ()
list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}-${libtype}" HAVE_COMP)
endif ()
if (${HAVE_COMP} LESS 0)
- if (${comp} STREQUAL "Java")
+ if (comp STREQUAL "Java")
set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 0)
else ()
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0)
@@ -184,16 +192,16 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE)
else ()
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)
- set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp2}-${libtype} @HDF5_PACKAGE@::${hdf5_comp}-${libtype})
+ set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF_PACKAGE_NAMESPACE@${hdf5_comp2}-${libtype} @HDF_PACKAGE_NAMESPACE@${hdf5_comp}-${libtype})
endif ()
- elseif (${comp} STREQUAL "Java")
+ elseif (comp STREQUAL "Java")
set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY)
- set (${COMP_LIBRARY} ${${COMP_LIBRARY}} hdf5::${hdf5_comp})
+ set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF_PACKAGE_NAMESPACE@${hdf5_comp})
else ()
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)
- set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp}-${libtype})
+ set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF_PACKAGE_NAMESPACE@${hdf5_comp}-${libtype})
endif ()
endif ()
endforeach ()
diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake
index 23f297c..ee4517c 100644
--- a/config/cmake/jrunTest.cmake
+++ b/config/cmake/jrunTest.cmake
@@ -9,7 +9,7 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-# runTest.cmake executes a command and captures the output in a file. File is then compared
+# jrunTest.cmake executes a command and captures the output in a file. File is then compared
# against a reference file. Exit status of command can also be compared.
cmake_policy(SET CMP0007 NEW)
@@ -24,7 +24,7 @@ if (NOT TEST_LIBRARY_DIRECTORY)
message (STATUS "Require TEST_LIBRARY_DIRECTORY to be defined")
endif ()
if (NOT TEST_FOLDER)
- message ( FATAL_ERROR "Require TEST_FOLDER to be defined")
+ message (FATAL_ERROR "Require TEST_FOLDER to be defined")
endif ()
if (NOT TEST_OUTPUT)
message (FATAL_ERROR "Require TEST_OUTPUT to be defined")
@@ -33,11 +33,11 @@ if (NOT TEST_CLASSPATH)
message (STATUS "Require TEST_CLASSPATH to be defined")
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
@@ -49,8 +49,10 @@ endif ()
message (STATUS "COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=${LOG_LEVEL} -Djava.library.path=\"${TEST_LIBRARY_DIRECTORY}\" -cp \"${TEST_CLASSPATH}\" ${TEST_ARGS} ${TEST_PROGRAM} ${ARGN}")
-if (WIN32 AND NOT MINGW)
+if (WIN32 OR MINGW)
set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}")
+else ()
+ set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
endif ()
# run the test program, capture the stdout/stderr and the result var
@@ -64,13 +66,14 @@ execute_process (
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}
ERROR_FILE ${TEST_OUTPUT}.err
+ OUTPUT_VARIABLE TEST_OUT
ERROR_VARIABLE TEST_ERROR
)
message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the .err file exists and ERRROR_APPEND is enabled
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
if (TEST_MASK_FILE)
STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
@@ -120,17 +123,32 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
# compare output files to references unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
- if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE})
- if (WIN32 AND NOT MINGW)
- file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
+ if (WIN32 OR MINGW)
+ configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
+ if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp")
+ file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ endif ()
+
+ if (NOT TEST_SORT_COMPARE)
+ # now compare the output with the reference
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
+ RESULT_VARIABLE TEST_RESULT
+ )
+ else ()
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
+ list (SORT v1)
+ list (SORT v2)
+ if (NOT v1 STREQUAL v2)
+ set(TEST_RESULT 1)
+ endif ()
endif ()
- # now compare the output with the reference
- execute_process (
- COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
- RESULT_VARIABLE TEST_RESULT
- )
if (TEST_RESULT)
set (TEST_RESULT 0)
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
@@ -142,10 +160,10 @@ if (NOT TEST_SKIP_COMPARE)
foreach (line RANGE 0 ${_FP_LEN})
list (GET test_act ${line} str_act)
list (GET test_ref ${line} str_ref)
- if (NOT ${str_act} STREQUAL ${str_ref})
- if (NOT str_act STREQUAL "")
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
set (TEST_RESULT 1)
- message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
endif ()
endif ()
endforeach ()
@@ -172,9 +190,13 @@ if (NOT TEST_SKIP_COMPARE)
# now compare the .err file with the error reference, if supplied
if (TEST_ERRREF)
- if (WIN32 AND NOT MINGW)
- file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
+ if (WIN32 OR MINGW)
+ configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF)
+ if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp")
+ file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
endif ()
# now compare the error output with the error reference
@@ -194,10 +216,10 @@ if (NOT TEST_SKIP_COMPARE)
foreach (line RANGE 0 ${_FP_LEN})
list (GET test_act ${line} str_act)
list (GET test_ref ${line} str_ref)
- if (NOT ${str_act} STREQUAL ${str_ref})
- if (NOT ${str_act} STREQUAL "")
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
set (TEST_RESULT 1)
- message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
endif ()
endif ()
endforeach ()
@@ -236,7 +258,7 @@ if (TEST_GREP_COMPARE)
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
if (TEST_EXPECT)
- # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match
+ # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
string (LENGTH "${TEST_MATCH}" TEST_RESULT)
if (TEST_RESULT)
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
@@ -245,5 +267,5 @@ if (TEST_GREP_COMPARE)
endif ()
# everything went fine...
-message ("${TEST_PROGRAM} Passed")
+message (STATUS "${TEST_PROGRAM} Passed")
diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in
index 9a534df..8397d68 100644
--- a/config/cmake/libhdf5.settings.cmake.in
+++ b/config/cmake/libhdf5.settings.cmake.in
@@ -14,10 +14,10 @@ General Information:
Compiling Options:
------------------
Build Mode: @CMAKE_BUILD_TYPE@
- Debugging Symbols: @SYMBOLS@
- Asserts: @ASSERTS@
- Profiling: @PROFILING@
- Optimization Level: @OPTIMIZATION@
+ Debugging Symbols: @HDF5_ENABLE_SYMBOLS@
+ Asserts: @HDF5_ENABLE_ASSERTS@
+ Profiling: @HDF5_ENABLE_PROFILING@
+ Optimization Level: @HDF5_ENABLE_OPTIMIZATION@
Linking Options:
----------------
@@ -32,7 +32,7 @@ Linking Options:
Languages:
----------
- C: yes
+ C: YES
C Compiler: @CMAKE_C_COMPILER@ @CMAKE_C_COMPILER_VERSION@
CPPFLAGS: @CPPFLAGS@
H5_CPPFLAGS: @H5_CPPFLAGS@
@@ -41,7 +41,7 @@ Languages:
H5_CFLAGS: @H5_CFLAGS@
AM_CFLAGS: @AM_CFLAGS@
Shared C Library: @H5_ENABLE_SHARED_LIB@
- Static C Library: YES
+ Static C Library: @H5_ENABLE_STATIC_LIB@
Fortran: @HDF5_BUILD_FORTRAN@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @CMAKE_Fortran_COMPILER@ @CMAKE_Fortran_COMPILER_VERSION@
@@ -49,7 +49,7 @@ Languages:
@BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @H5_FCFLAGS@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Shared Fortran Library: @H5_ENABLE_SHARED_LIB@
-@BUILD_FORTRAN_CONDITIONAL_TRUE@ Static Fortran Library: YES
+@BUILD_FORTRAN_CONDITIONAL_TRUE@ Static Fortran Library: @H5_ENABLE_STATIC_LIB@
C++: @HDF5_BUILD_CPP_LIB@
@BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CMAKE_CXX_COMPILER@ @CMAKE_CXX_COMPILER_VERSION@
@@ -57,10 +57,10 @@ Languages:
@BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @H5_CXXFLAGS@
@BUILD_CXX_CONDITIONAL_TRUE@ AM C++ Flags: @AM_CXXFLAGS@
@BUILD_CXX_CONDITIONAL_TRUE@ Shared C++ Library: @H5_ENABLE_SHARED_LIB@
-@BUILD_CXX_CONDITIONAL_TRUE@ Static C++ Library: YES
+@BUILD_CXX_CONDITIONAL_TRUE@ Static C++ Library: @H5_ENABLE_STATIC_LIB@
JAVA: @HDF5_BUILD_JAVA@
-@BUILD_JAVA_CONDITIONAL_TRUE@ JAVA Compiler: @CMAKE_Java_COMPILER@ @Java_VERSION@
+@BUILD_JAVA_CONDITIONAL_TRUE@ JAVA Compiler: @CMAKE_Java_COMPILER@ @Java_VERSION@
Features:
---------
@@ -68,12 +68,16 @@ Features:
Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@
Large Parallel I/O: @LARGE_PARALLEL_IO@
High-level library: @HDF5_BUILD_HL_LIB@
+ Build HDF5 Tests: @BUILD_TESTING@
+ Build HDF5 Tools: @HDF5_BUILD_TOOLS@
Threadsafety: @HDF5_ENABLE_THREADSAFE@
Default API mapping: @DEFAULT_API_VERSION@
With deprecated public symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@
I/O filters (external): @EXTERNAL_FILTERS@
MPE: @H5_HAVE_LIBLMPE@
Direct VFD: @H5_HAVE_DIRECT@
+ (Read-Only) S3 VFD: @H5_HAVE_ROS3_VFD@
+ (Read-Only) HDFS VFD: @H5_HAVE_LIBHDFS@
dmalloc: @H5_HAVE_LIBDMALLOC@
Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@
API Tracing: @HDF5_ENABLE_TRACE@
diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake
index 577144b..1608202 100644
--- a/config/cmake/mccacheinit.cmake
+++ b/config/cmake/mccacheinit.cmake
@@ -17,12 +17,12 @@
set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE)
-set (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE)
-
set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
+set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace" FORCE)
+
set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE)
set (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE)
@@ -39,7 +39,7 @@ set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE)
-set (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
+set (MPIEXEC_MAX_NUMPROCS "4" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
set (HDF5_ENABLE_USING_MEMCHECKER ON CACHE BOOL "Indicate that a memory checker is used" FORCE)
diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake
index e234057..3c85d48 100755
--- a/config/cmake/scripts/CTestScript.cmake
+++ b/config/cmake/scripts/CTestScript.cmake
@@ -50,6 +50,17 @@ if (SITE_BUILDNAME_SUFFIX)
endif ()
set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
+# Launchers work only with Makefile and Ninja generators.
+if(NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+ set(CTEST_USE_LAUNCHERS 0)
+ set(ENV{CTEST_USE_LAUNCHERS_DEFAULT} 0)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=OFF")
+else()
+ set(CTEST_USE_LAUNCHERS 1)
+ set(ENV{CTEST_USE_LAUNCHERS_DEFAULT} 1)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON")
+endif()
+
#-----------------------------------------------------------------------------
# MAC machines need special option
#-----------------------------------------------------------------------------
@@ -69,7 +80,7 @@ set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
if (CTEST_USE_TAR_SOURCE)
## Uncompress source if tar file provided
## --------------------------
- if (WIN32)
+ if (WIN32 AND NOT MINGW)
message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]")
execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv)
else ()
@@ -195,17 +206,27 @@ if (CMAKE_GENERATOR_TOOLSET)
else ()
set (CTEST_CONFIGURE_TOOLSET "")
endif()
+if (CMAKE_GENERATOR_ARCHITECTURE)
+ set (CTEST_CONFIGURE_ARCHITECTURE "-A${CMAKE_GENERATOR_ARCHITECTURE}")
+else ()
+ set (CTEST_CONFIGURE_ARCHITECTURE "")
+endif()
if (LOCAL_MEMCHECK_TEST)
- find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
+ if(LOCAL_USE_VALGRIND)
+ set (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe")
+ find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
+ endif()
set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
+ "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_ARCHITECTURE}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
)
else ()
if (LOCAL_COVERAGE_TEST)
- find_program (CTEST_COVERAGE_COMMAND NAMES gcov)
+ if(LOCAL_USE_GCOV)
+ find_program (CTEST_COVERAGE_COMMAND NAMES gcov)
+ endif ()
endif ()
set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
+ "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_ARCHITECTURE}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
)
endif ()
@@ -280,7 +301,11 @@ message (STATUS "Dashboard script configuration:\n${vars}\n")
if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "raybsub")
execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME})
else ()
- execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME})
+ if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "qsub")
+ execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME} ctestS.out)
+ else ()
+ execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME})
+ endif()
endif ()
message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml")
execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET)
@@ -299,7 +324,11 @@ message (STATUS "Dashboard script configuration:\n${vars}\n")
if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "raybsub")
execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME})
else ()
- execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME})
+ if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "qsub")
+ execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME} ctestP.out)
+ else ()
+ execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME})
+ endif ()
endif ()
message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml")
execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET)
diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake
index 07e687c..61c88dc 100755
--- a/config/cmake/scripts/HDF5config.cmake
+++ b/config/cmake/scripts/HDF5config.cmake
@@ -22,6 +22,8 @@ cmake_minimum_required (VERSION 3.10)
# where valid options for OPTION are:
# BUILD_GENERATOR - The cmake build generator:
# Unix * Unix Makefiles
+# VS2019 * Visual Studio 16 2019
+# VS201964 * Visual Studio 16 2019
# VS2017 * Visual Studio 15 2017
# VS201764 * Visual Studio 15 2017 Win64
# VS2015 * Visual Studio 14 2015
@@ -34,7 +36,7 @@ cmake_minimum_required (VERSION 3.10)
# CTEST_SOURCE_NAME - source folder
##############################################################################
-set (CTEST_SOURCE_VERSION "1.10.5")
+set (CTEST_SOURCE_VERSION "1.10.6")
set (CTEST_SOURCE_VERSEXT "")
##############################################################################
@@ -44,8 +46,8 @@ set (CTEST_SOURCE_VERSEXT "")
#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo
#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
-#MPI - enable MPI;
+#HPC - run alternate configurations for HPC machines; sbatch, bsub, raybsub, qsub
+#MPI - enable MPI
if (DEFINED CTEST_SCRIPT_ARG)
# transform ctest script arguments of the form
# script.ctest,var1=value1,var2=value2
@@ -90,7 +92,7 @@ endif ()
set (CTEST_BINARY_NAME "build")
set (CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}")
-if (WIN32)
+if (WIN32 AND NOT MINGW)
set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else ()
@@ -104,10 +106,22 @@ if (NOT DEFINED HPC)
if (NOT DEFINED BUILD_GENERATOR)
message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364")
endif ()
- if (WIN32)
+ if (WIN32 AND NOT MINGW)
set (SITE_OS_NAME "Windows")
- set (SITE_OS_VERSION "WIN7")
- if (BUILD_GENERATOR STREQUAL "VS201764")
+ set (SITE_OS_VERSION "WIN10")
+ if (BUILD_GENERATOR STREQUAL "VS201964")
+ set (CTEST_CMAKE_GENERATOR "Visual Studio 16 2019")
+ set (CMAKE_GENERATOR_ARCHITECTURE "x64")
+ set (SITE_OS_BITS "64")
+ set (SITE_COMPILER_NAME "vs2019")
+ set (SITE_COMPILER_VERSION "16")
+ elseif (BUILD_GENERATOR STREQUAL "VS2019")
+ set (CTEST_CMAKE_GENERATOR "Visual Studio 16 2019")
+ set (CMAKE_GENERATOR_ARCHITECTURE "Win32")
+ set (SITE_OS_BITS "32")
+ set (SITE_COMPILER_NAME "vs2019")
+ set (SITE_COMPILER_VERSION "16")
+ elseif (BUILD_GENERATOR STREQUAL "VS201764")
set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64")
set (SITE_OS_BITS "64")
set (SITE_COMPILER_NAME "vs2017")
@@ -177,8 +191,8 @@ if (NOT DEFINED HPC)
endif ()
endif ()
else ()
+ set (CTEST_SITE "${SITE_OS_NAME}")
set (CTEST_CMAKE_GENERATOR "Unix Makefiles")
- include (${CTEST_SOURCE_DIRECTORY}/config/cmake/scripts/HPC/${HPC}-HDF5options.cmake)
endif ()
###################################################################
@@ -203,7 +217,7 @@ endif ()
##### Following controls source update #####
#set (LOCAL_UPDATE "TRUE")
set (REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git")
-set (REPOSITORY_BRANCH "hdf5_1_10_5")
+set (REPOSITORY_BRANCH "hdf5_1_10_6")
#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows
#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}")
@@ -212,7 +226,7 @@ set (REPOSITORY_BRANCH "hdf5_1_10_5")
###################################################################
-if (WIN32)
+if (WIN32 AND NOT MINGW)
set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}")
include (${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake)
include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake)
@@ -228,6 +242,9 @@ if (WIN32)
else ()
set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}")
include (${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake)
+ if (DEFINED HPC)
+ include (${CTEST_SOURCE_DIRECTORY}/config/cmake/scripts/HPC/${HPC}-HDF5options.cmake)
+ endif ()
include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake)
if (APPLE)
if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg")
diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake
index 24eaf78..94aafac 100755
--- a/config/cmake/scripts/HDF5options.cmake
+++ b/config/cmake/scripts/HDF5options.cmake
@@ -27,7 +27,9 @@
#############################################################################################
#### Only build static libraries ####
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
-#### Add PICC option on linux/mac ####
+#### Only build shared libraries ####
+#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DONLY_SHARED_LIBS:BOOL=OFF")
+#### Add PIC option on linux/mac ####
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
#############################################################################################
@@ -69,12 +71,12 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN
#############################################################################################
### enable parallel builds
-
-#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON")
-#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF")
-#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
-#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF")
-
+if (DEFINED MPI)
+ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON")
+ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF")
+ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
+ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF")
+endif()
#############################################################################################
### enable thread-safety builds
diff --git a/config/cmake/scripts/HPC/bsub-HDF5options.cmake b/config/cmake/scripts/HPC/bsub-HDF5options.cmake
index 83c17aa..7473e8a 100644
--- a/config/cmake/scripts/HPC/bsub-HDF5options.cmake
+++ b/config/cmake/scripts/HPC/bsub-HDF5options.cmake
@@ -13,19 +13,10 @@
#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
#############################################################################################
-
-### uncomment/comment and change the following lines for other configuration options
-
-#############################################################################################
-### enable parallel builds
if (DEFINED MPI)
- # maximum parallel processor count for build and test ####
- set (MAX_PROC_COUNT 8)
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON")
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF")
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF")
-endif ()
+ # maximum parallel processor count for build and test ####
+ set (MAX_PROC_COUNT 8)
+endif()
#############################################################################################
### options to run test scripts in batch commands
set (LOCAL_BATCH_SCRIPT_COMMAND "bsub")
diff --git a/config/cmake/scripts/HPC/qsub-HDF5options.cmake b/config/cmake/scripts/HPC/qsub-HDF5options.cmake
new file mode 100644
index 0000000..34eba1b
--- /dev/null
+++ b/config/cmake/scripts/HPC/qsub-HDF5options.cmake
@@ -0,0 +1,42 @@
+#
+# Copyright by The HDF Group.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+#############################################################################################
+#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
+#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
+#############################################################################################
+if (DEFINED MPI)
+ # maximum parallel processor count for build and test ####
+ set (MAX_PROC_COUNT 8)
+endif()
+#############################################################################################
+### options to run test scripts in batch commands
+set (LOCAL_BATCH_SCRIPT_NAME "ctest.qsub")
+set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "ctest.qsub")
+if (DEFINED KNL)
+ ### some additions and alternatives to cross compile on haswell for knl
+ set (COMPUTENODE_HWCOMPILE_MODULE "craype-mic-knl")
+ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/crayle.cmake")
+endif ()
+set (LOCAL_BATCH_SCRIPT_COMMAND "qsub")
+set (LOCAL_BATCH_TEST "TRUE")
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON")
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=${LOCAL_BATCH_SCRIPT_NAME}")
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}")
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_EXECUTABLE:STRING=aprun")
+# Option to suppress writing job statistics; to avoid issues with h5diff comparisons.
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_PREFLAGS:STRING=-q")
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_NUMPROC_FLAG:STRING=-n")
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=6")
+set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DACCOUNT_ID:STRING=${LOCAL_BATCH_SCRIPT_ARGS}")
+
+#############################################################################################
+#############################################################################################
diff --git a/config/cmake/scripts/HPC/raybsub-HDF5options.cmake b/config/cmake/scripts/HPC/raybsub-HDF5options.cmake
index 4aad887..fa1ec4a 100644
--- a/config/cmake/scripts/HPC/raybsub-HDF5options.cmake
+++ b/config/cmake/scripts/HPC/raybsub-HDF5options.cmake
@@ -13,19 +13,10 @@
#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
#############################################################################################
-
-### uncomment/comment and change the following lines for other configuration options
-
-#############################################################################################
-### enable parallel builds
if (DEFINED MPI)
- # maximum parallel processor count for build and test ####
- set (MAX_PROC_COUNT 8)
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON")
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF")
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF")
-endif ()
+ # maximum parallel processor count for build and test ####
+ set (MAX_PROC_COUNT 8)
+endif()
#############################################################################################
### options to run test scripts in batch commands
set (LOCAL_BATCH_SCRIPT_COMMAND "raybsub")
diff --git a/config/cmake/scripts/HPC/sbatch-HDF5options.cmake b/config/cmake/scripts/HPC/sbatch-HDF5options.cmake
index f70526e..3205a1c 100644
--- a/config/cmake/scripts/HPC/sbatch-HDF5options.cmake
+++ b/config/cmake/scripts/HPC/sbatch-HDF5options.cmake
@@ -13,19 +13,10 @@
#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
#############################################################################################
-
-### uncomment/comment and change the following lines for other configuration options
-
-#############################################################################################
-### enable parallel builds
if (DEFINED MPI)
- # maximum parallel processor count for build and test ####
- set (MAX_PROC_COUNT 8)
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON")
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF")
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
- set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF")
-endif ()
+ # maximum parallel processor count for build and test ####
+ set (MAX_PROC_COUNT 8)
+endif()
#############################################################################################
### options to run test scripts in batch commands
if (DEFINED KNL)
diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake
index 9af7e5b..c9fc36f 100644
--- a/config/cmake/userblockTest.cmake
+++ b/config/cmake/userblockTest.cmake
@@ -20,7 +20,7 @@ if (NOT TEST_GET_PROGRAM)
message (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined")
endif ()
if (NOT TEST_FOLDER)
- message ( FATAL_ERROR "Require TEST_FOLDER to be defined")
+ message (FATAL_ERROR "Require TEST_FOLDER to be defined")
endif ()
if (NOT TEST_HFILE)
message (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined")
@@ -55,14 +55,14 @@ if (TEST_CHECKUB STREQUAL "YES")
# of the user block
#s2=`$JAM_BIN/tellub $origfile`
EXECUTE_PROCESS (
- COMMAND ${TEST_PROGRAM} ${TEST_OFILE}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_OFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_HFILE}.len.txt
OUTPUT_VARIABLE TEST_OUT
ERROR_VARIABLE TEST_ERROR
)
- if (NOT ${TEST_RESULT} STREQUAL "0")
+ if (TEST_RESULT)
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}")
endif ()
file (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN)
@@ -70,10 +70,10 @@ if (TEST_CHECKUB STREQUAL "YES")
math( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" )
- if (NOT TEST_O_STRING_LEN STREQUAL "0")
+ if (TEST_O_STRING_LEN)
#$JAM_BIN/getub -c $s2 $origfile > $cmpfile
EXECUTE_PROCESS (
- COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE}
+ COMMAND ${TEST_EMULATOR} ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_HFILE}-ub.cmp
@@ -91,7 +91,7 @@ if (TEST_CHECKUB STREQUAL "YES")
#$JAM_BIN/getub -c $size $hfile > $tfile
EXECUTE_PROCESS (
- COMMAND ${TEST_GET_PROGRAM} -c ${TEST_STRING_SIZE} ${TEST_HFILE}
+ COMMAND ${TEST_EMULATOR} ${TEST_GET_PROGRAM} -c ${TEST_STRING_SIZE} ${TEST_HFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_HFILE}.cmp
@@ -108,24 +108,24 @@ if (TEST_CHECKUB STREQUAL "YES")
message (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}")
# if the return value is !=${TEST_EXPECT} bail out
- if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
+ if (NOT TEST_RESULT EQUAL TEST_EXPECT)
message (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}")
endif ()
else ()
# call 'ubsize' to get the size of the user block
#ubsize=`$JAM_BIN/tellub $hfile`
EXECUTE_PROCESS (
- COMMAND ${TEST_PROGRAM} ${TEST_HFILE}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_HFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_H_STRING_LEN
OUTPUT_VARIABLE TEST_OUT
ERROR_VARIABLE TEST_ERROR
)
- if (NOT TEST_H_STRING_LEN STREQUAL "0")
+ if (TEST_H_STRING_LEN)
message (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty")
endif ()
endif ()
# everything went fine...
-message ("Passed: The output of CHECK matched expectation")
+message (STATUS "Passed: The output of CHECK matched expectation")
diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake
index b616958..12ee40b 100644
--- a/config/cmake/vfdTest.cmake
+++ b/config/cmake/vfdTest.cmake
@@ -17,17 +17,17 @@ if (NOT TEST_PROGRAM)
message (FATAL_ERROR "Require TEST_PROGRAM to be defined")
endif ()
if (NOT TEST_FOLDER)
- message ( FATAL_ERROR "Require TEST_FOLDER to be defined")
+ message (FATAL_ERROR "Require TEST_FOLDER to be defined")
endif ()
if (NOT TEST_VFD)
message (FATAL_ERROR "Require TEST_VFD to be defined")
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
@@ -36,13 +36,13 @@ endif ()
# set (ERROR_APPEND 1)
#endif ()
-message (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
+message (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
set (ENV{HDF5_DRIVER} "${TEST_VFD}")
# run the test program, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}_${TEST_VFD}.out
@@ -54,7 +54,7 @@ execute_process (
message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the .err file exists and ERRROR_APPEND is enabled
-if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err)
+if (ERROR_APPEND AND EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM)
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}")
endif ()
@@ -62,7 +62,7 @@ endif ()
# if the return value is !=${TEST_EXPECT} bail out
if (NOT TEST_RESULT EQUAL TEST_EXPECT)
if (NOT TEST_NOERRDISPLAY)
- if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out)
+ if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM)
message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}")
endif ()
@@ -73,4 +73,4 @@ endif ()
message (STATUS "COMMAND Error: ${TEST_ERROR}")
# everything went fine...
-message ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}")
+message (STATUS "Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}")
diff --git a/config/cmake_ext_mod/CTestCustom.cmake b/config/cmake_ext_mod/CTestCustom.cmake
index 025bce4..0111bef 100644
--- a/config/cmake_ext_mod/CTestCustom.cmake
+++ b/config/cmake_ext_mod/CTestCustom.cmake
@@ -1,5 +1,5 @@
set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000)
-
+
set (CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
"note.*expected.*void.*but argument is of type.*volatile"
@@ -10,7 +10,7 @@ set (CTEST_CUSTOM_WARNING_EXCEPTION
"warning.*implicit declaration of function"
"note: expanded from macro"
)
-
+
set (CTEST_CUSTOM_MEMCHECK_IGNORE
${CTEST_CUSTOM_MEMCHECK_IGNORE}
)
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 986280f..52cb7dd 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -28,7 +28,7 @@ if (APPLE)
list (LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH)
if (ARCH_LENGTH GREATER 1)
set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE)
- message(FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is"
+ message (FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is"
"due to technical reasons. The best approach would be build each architecture in separate directories"
"and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'"
"variable has been set to a blank value which will build the default architecture for this system.")
@@ -61,17 +61,17 @@ endmacro ()
# ----------------------------------------------------------------------
# WINDOWS Hard code Values
# ----------------------------------------------------------------------
-
set (WINDOWS)
-if (WIN32)
- if (MINGW)
- set (${HDF_PREFIX}_HAVE_MINGW 1)
- set (WINDOWS 1) # MinGW tries to imitate Windows
- set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
- endif ()
- set (${HDF_PREFIX}_HAVE_WIN32_API 1)
- set (HDF5_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib")
- if (NOT UNIX AND NOT MINGW)
+
+if (MINGW)
+ set (${HDF_PREFIX}_HAVE_MINGW 1)
+ set (WINDOWS 1) # MinGW tries to imitate Windows
+ set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
+ set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1)
+endif ()
+
+if (WIN32 AND NOT MINGW)
+ if (NOT UNIX)
set (WINDOWS 1)
set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1")
if (MSVC)
@@ -81,28 +81,24 @@ if (WIN32)
endif ()
if (WINDOWS)
- set (${HDF_PREFIX}_HAVE_STDDEF_H 1)
- set (${HDF_PREFIX}_HAVE_SYS_STAT_H 1)
- set (${HDF_PREFIX}_HAVE_SYS_TYPES_H 1)
+ set (HDF5_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib")
+ set (${HDF_PREFIX}_HAVE_WIN32_API 1)
set (${HDF_PREFIX}_HAVE_LIBM 1)
set (${HDF_PREFIX}_HAVE_STRDUP 1)
set (${HDF_PREFIX}_HAVE_SYSTEM 1)
set (${HDF_PREFIX}_HAVE_LONGJMP 1)
if (NOT MINGW)
set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1)
+ set (${HDF_PREFIX}_HAVE_FUNCTION 1)
endif ()
- if (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
+ if (NOT UNIX AND NOT CYGWIN)
set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1)
+ set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1)
+ set (${HDF_PREFIX}_HAVE_TIMEZONE 1)
+ set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1)
+ set (${HDF_PREFIX}_HAVE_LIBWS2_32 1)
+ set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1)
endif ()
- set (${HDF_PREFIX}_HAVE_FUNCTION 1)
- set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1)
- set (${HDF_PREFIX}_HAVE_TIMEZONE 1)
- set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1)
- if (MINGW)
- set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1)
- endif ()
- set (${HDF_PREFIX}_HAVE_LIBWS2_32 1)
- set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1)
endif ()
# ----------------------------------------------------------------------
@@ -188,7 +184,7 @@ endif ()
#-----------------------------------------------------------------------------
# Check for the math library "m"
#-----------------------------------------------------------------------------
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil ${HDF_PREFIX}_HAVE_LIBM)
CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen ${HDF_PREFIX}_HAVE_LIBDL)
CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup ${HDF_PREFIX}_HAVE_LIBWS2_32)
@@ -229,7 +225,7 @@ macro (HDF_FUNCTION_TEST OTHER_TEST)
endif ()
#message (STATUS "Performing ${OTHER_TEST}")
- TRY_COMPILE (${OTHER_TEST}
+ try_compile (${OTHER_TEST}
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
COMPILE_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS}"
@@ -264,7 +260,7 @@ set (LINUX_LFS 0)
set (HDF_EXTRA_C_FLAGS)
set (HDF_EXTRA_FLAGS)
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
# Might want to check explicitly for Linux and possibly Cygwin
# instead of checking for not Solaris or Darwin.
if (NOT ${HDF_PREFIX}_HAVE_SOLARIS AND NOT ${HDF_PREFIX}_HAVE_DARWIN)
@@ -274,12 +270,10 @@ if (NOT WINDOWS)
# functionality so clock_gettime and CLOCK_MONOTONIC are defined
# correctly. This was later updated to 200112L so that
# posix_memalign() is visible for the direct VFD code on Linux
- # systems. Even later, this was changed to 200809L to support
- # pread/pwrite in VFDs.
- #
+ # systems.
# POSIX feature information can be found in the gcc manual at:
# http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html
- set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200809L)
+ set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200112L)
# Need to add this so that O_DIRECT is visible for the direct
# VFD on Linux systems.
@@ -288,7 +282,7 @@ if (NOT WINDOWS)
option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON)
if (HDF_ENABLE_LARGE_FILE AND NOT DEFINED TEST_LFS_WORKS_RUN)
set (msg "Performing TEST_LFS_WORKS")
- TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE
+ try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
COMPILE_DEFINITIONS "-DTEST_LFS_WORKS"
@@ -326,7 +320,7 @@ endif ()
#-----------------------------------------------------------------------------
# Check for HAVE_OFF64_T functionality
#-----------------------------------------------------------------------------
-if (NOT WINDOWS OR MINGW)
+if (MINGW OR NOT WINDOWS)
HDF_FUNCTION_TEST (HAVE_OFF64_T)
if (${HDF_PREFIX}_HAVE_OFF64_T)
CHECK_FUNCTION_EXISTS (lseek64 ${HDF_PREFIX}_HAVE_LSEEK64)
@@ -405,7 +399,7 @@ if (NOT APPLE)
if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T)
set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0)
endif ()
- if (NOT WINDOWS)
+ if (MINGW OR NOT WINDOWS)
HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T)
endif ()
endif ()
@@ -429,7 +423,7 @@ else ()
HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)
endif ()
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
#-----------------------------------------------------------------------------
# Check if the dev_t type is a scalar type
#-----------------------------------------------------------------------------
@@ -445,7 +439,7 @@ if (NOT WINDOWS)
# Check a bunch of time functions
#-----------------------------------------------------------------------------
CHECK_FUNCTION_EXISTS (gettimeofday ${HDF_PREFIX}_HAVE_GETTIMEOFDAY)
- foreach (test
+ foreach (time_test
HAVE_TM_GMTOFF
HAVE___TM_GMTOFF
# HAVE_TIMEZONE
@@ -455,7 +449,7 @@ if (NOT WINDOWS)
HAVE_TM_ZONE
HAVE_STRUCT_TM_TM_ZONE
)
- HDF_FUNCTION_TEST (${test})
+ HDF_FUNCTION_TEST (${time_test})
endforeach ()
if (NOT CYGWIN AND NOT MINGW)
HDF_FUNCTION_TEST (HAVE_TIMEZONE)
@@ -476,7 +470,7 @@ if (NOT WINDOWS)
CHECK_FUNCTION_EXISTS (_getvideoconfig ${HDF_PREFIX}_HAVE__GETVIDEOCONFIG)
CHECK_FUNCTION_EXISTS (gettextinfo ${HDF_PREFIX}_HAVE_GETTEXTINFO)
CHECK_FUNCTION_EXISTS (_scrsize ${HDF_PREFIX}_HAVE__SCRSIZE)
- if (NOT CYGWIN AND NOT MINGW)
+ if (NOT CYGWIN)
CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo ${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO)
endif ()
CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGWINSZ)
@@ -537,7 +531,7 @@ CHECK_FUNCTION_EXISTS (vasprintf ${HDF_PREFIX}_HAVE_VASPRINTF)
CHECK_FUNCTION_EXISTS (waitpid ${HDF_PREFIX}_HAVE_WAITPID)
CHECK_FUNCTION_EXISTS (vsnprintf ${HDF_PREFIX}_HAVE_VSNPRINTF)
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
if (${HDF_PREFIX}_HAVE_VSNPRINTF)
HDF_FUNCTION_TEST (VSNPRINTF_WORKS)
endif ()
@@ -558,8 +552,8 @@ endif ()
#-----------------------------------------------------------------------------
# Check a bunch of other functions
#-----------------------------------------------------------------------------
-if (NOT WINDOWS)
- foreach (test
+if (MINGW OR NOT WINDOWS)
+ foreach (other_test
HAVE_ATTRIBUTE
HAVE_C99_FUNC
# STDC_HEADERS
@@ -568,7 +562,7 @@ if (NOT WINDOWS)
SYSTEM_SCOPE_THREADS
HAVE_SOCKLEN_T
)
- HDF_FUNCTION_TEST (${test})
+ HDF_FUNCTION_TEST (${other_test})
endforeach ()
endif ()
@@ -658,7 +652,7 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "
set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${${HDF_PREFIX}_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll")
set (PRINT_LL_FOUND 1)
else ()
- message ("Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}")
+ message (STATUS "Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}")
endif ()
else ()
file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake
index 699be85..2303d6d 100644
--- a/config/cmake_ext_mod/FindSZIP.cmake
+++ b/config/cmake_ext_mod/FindSZIP.cmake
@@ -9,136 +9,108 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
+#########################################################################
+
+# - Derived from the FindTiff.cmake and FindJPEG.cmake that is included with cmake
+# FindSZIP
-# - Find SZIP library
-# - Derived from the FindTiff.cmake that is included with cmake
# Find the native SZIP includes and library
-# This module defines
-# SZIP_INCLUDE_DIRS, where to find tiff.h, etc.
-# SZIP_LIBRARIES, libraries to link against to use SZIP.
-# SZIP_FOUND, If false, do not try to use SZIP.
-# also defined, but not for general use are
-# SZIP_LIBRARY, where to find the SZIP library.
-# SZIP_LIBRARY_DEBUG - Debug version of SZIP library
-# SZIP_LIBRARY_RELEASE - Release Version of SZIP library
-# message (STATUS "Finding SZIP library and headers..." )
+# Imported targets
+##################
-############################################
+# This module defines the following :prop_tgt:`IMPORTED` targets:
#
-# Check the existence of the libraries.
+# SZIP::SZIP
+# The SZIP library, if found.
#
-############################################
-# This macro was taken directly from the FindQt4.cmake file that is included
-# with the CMake distribution. This is NOT my work. All work was done by the
-# original authors of the FindQt4.cmake file. Only minor modifications were
-# made to remove references to Qt and make this file more generally applicable
-#########################################################################
+# Result variables
+###################
-macro (SZIP_ADJUST_LIB_VARS basename)
- if (${basename}_INCLUDE_DIR)
+# This module will set the following variables in your project:
- # if only the release version was found, set the debug variable also to the release version
- if (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG)
- set (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE})
- set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE})
- set (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE})
- endif ()
+# SZIP_FOUND, true if the SZIP headers and libraries were found.
+# SZIP_INCLUDE_DIR, the directory containing the SZIP headers.
+# SZIP_INCLUDE_DIRS, the directory containing the SZIP headers.
+# SZIP_LIBRARIES, libraries to link against to use SZIP.
- # if only the debug version was found, set the release variable also to the debug version
- if (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE)
- set (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG})
- set (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG})
- set (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG})
- endif ()
- if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE)
- # if the generator supports configuration types then set
- # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
- if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
- set (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG})
- else ()
- # if there are no configuration types and CMAKE_BUILD_TYPE has no value
- # then just use the release libraries
- set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
- endif ()
- set (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG})
- endif ()
+# Cache variables
+#################
- set (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library")
+# The following variables may also be set:
- if (${basename}_LIBRARY)
- set (${basename}_FOUND 1)
- endif ()
- endif ()
+# SZIP_LIBRARY, where to find the SZIP library.
+# SZIP_LIBRARY_DEBUG - Debug version of SZIP library
+# SZIP_LIBRARY_RELEASE - Release Version of SZIP library
- # Make variables changeble to the advanced user
- MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR )
-endmacro ()
-
-
-# Look for the header file.
-set (SZIP_INCLUDE_SEARCH_DIRS
- $ENV{SZIP_INSTALL}/include
- $ENV{SZIP_INSTALL}/include/szip
- /usr/include
- /usr/include/szip
-)
-
-set (SZIP_LIB_SEARCH_DIRS
- $ENV{SZIP_INSTALL}/lib
- /usr/lib
-)
-
-set (SZIP_BIN_SEARCH_DIRS
- $ENV{SZIP_INSTALL}/bin
- /usr/bin
-)
-
-FIND_PATH (SZIP_INCLUDE_DIR
- NAMES szlib.h
- PATHS ${SZIP_INCLUDE_SEARCH_DIRS}
- NO_DEFAULT_PATH
-)
-
-if (WIN32)
- set (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d")
- set (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip")
-else ()
- set (SZIP_SEARCH_DEBUG_NAMES "sz_d")
- set (SZIP_SEARCH_RELEASE_NAMES "sz;szip")
-endif ()
+# message (STATUS "Finding SZIP library and headers..." )
+#########################################################################
-# Look for the library.
-FIND_LIBRARY (SZIP_LIBRARY_DEBUG
- NAMES ${SZIP_SEARCH_DEBUG_NAMES}
- PATHS ${SZIP_LIB_SEARCH_DIRS}
- NO_DEFAULT_PATH
-)
-
-FIND_LIBRARY (SZIP_LIBRARY_RELEASE
- NAMES ${SZIP_SEARCH_RELEASE_NAMES}
- PATHS ${SZIP_LIB_SEARCH_DIRS}
- NO_DEFAULT_PATH
-)
-
-SZIP_ADJUST_LIB_VARS (SZIP)
-
-if (SZIP_INCLUDE_DIR AND SZIP_LIBRARY)
- set (SZIP_FOUND 1)
- set (SZIP_LIBRARIES ${SZIP_LIBRARY})
- set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR})
- if (SZIP_LIBRARY_DEBUG)
- get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_DEBUG} PATH)
- set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH})
- elseif ()
- get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_RELEASE} PATH)
- set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH})
- endif ()
-else ()
- set (SZIP_FOUND 0)
- set (SZIP_LIBRARIES)
- set (SZIP_INCLUDE_DIRS)
-endif ()
+
+find_path(SZIP_INCLUDE_DIR szlib.h)
+
+set(szip_names ${SZIP_NAMES} sz szip szip-static libsz libszip libszip-static)
+foreach(name ${szip_names})
+ list(APPEND szip_names_debug "${name}d")
+endforeach()
+
+if(NOT SZIP_LIBRARY)
+ find_library(SZIP_LIBRARY_RELEASE NAMES ${szip_names})
+ find_library(SZIP_LIBRARY_DEBUG NAMES ${szip_names_debug})
+ include(SelectLibraryConfigurations)
+ select_library_configurations(SZIP)
+ mark_as_advanced(SZIP_LIBRARY_RELEASE SZIP_LIBRARY_DEBUG)
+endif()
+unset(szip_names)
+unset(szip_names_debug)
+
+if(SZIP_INCLUDE_DIR AND EXISTS "${SZIP_INCLUDE_DIR}/SZconfig.h")
+ file(STRINGS "${SZIP_INCLUDE_DIR}/SZconfig.h" szip_version_str
+ REGEX "^#define[\t ]+SZIP_PACKAGE_VERSION[\t ]+.*")
+
+ string(REGEX REPLACE "^#define[\t ]+SZIP_PACKAGE_VERSION[\t ]+([0-9]+).*"
+ "\\1" SZIP_VERSION "${szip_version_str}")
+ unset(szip_version_str)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SZIP
+ REQUIRED_VARS SZIP_LIBRARY SZIP_INCLUDE_DIR
+ VERSION_VAR SZIP_VERSION)
+
+if(SZIP_FOUND)
+ set(SZIP_LIBRARIES ${SZIP_LIBRARY})
+ set(SZIP_INCLUDE_DIRS "${SZIP_INCLUDE_DIR}")
+
+ if(NOT TARGET SZIP::SZIP)
+ add_library(SZIP::SZIP UNKNOWN IMPORTED)
+ if(SZIP_INCLUDE_DIRS)
+ set_target_properties(SZIP::SZIP PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${SZIP_INCLUDE_DIRS}")
+ endif()
+ if(EXISTS "${SZIP_LIBRARY}")
+ set_target_properties(SZIP::SZIP PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION "${SZIP_LIBRARY}")
+ endif()
+ if(EXISTS "${SZIP_LIBRARY_RELEASE}")
+ set_property(TARGET SZIP::SZIP APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(SZIP::SZIP PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
+ IMPORTED_LOCATION_RELEASE "${SZIP_LIBRARY_RELEASE}")
+ endif()
+ if(EXISTS "${SZIP_LIBRARY_DEBUG}")
+ set_property(TARGET SZIP::SZIP APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(SZIP::SZIP PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
+ IMPORTED_LOCATION_DEBUG "${SZIP_LIBRARY_DEBUG}")
+ endif()
+ endif()
+endif()
+
+mark_as_advanced(SZIP_LIBRARY SZIP_INCLUDE_DIR)
# Report the results.
if (NOT SZIP_FOUND)
@@ -153,29 +125,3 @@ if (NOT SZIP_FOUND)
endif ()
endif ()
endif ()
-
-if (SZIP_FOUND)
- include (CheckSymbolExists)
- #############################################
- # Find out if SZIP was build using dll's
- #############################################
- # Save required variable
- set (CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
- set (CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
- # Add SZIP_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
- set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${SZIP_INCLUDE_DIRS}")
-
- # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables
- set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
- set (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
- #
- #############################################
-endif ()
-
-if (FIND_SZIP_DEBUG)
- message (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}")
- message (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}")
- message (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}")
- message (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}")
- message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
-endif ()
diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake
index 2eda66c..9df2b4b 100644
--- a/config/cmake_ext_mod/HDFLibMacros.cmake
+++ b/config/cmake_ext_mod/HDFLibMacros.cmake
@@ -14,25 +14,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
# May need to build JPEG with PIC on x64 machines with gcc
# Need to use CMAKE_ANSI_CFLAGS define so that compiler test works
- if (${compress_type} MATCHES "SVN")
- EXTERNALPROJECT_ADD (JPEG
- SVN_REPOSITORY ${JPEG_URL}
- # [SVN_REVISION rev]
- INSTALL_COMMAND ""
- CMAKE_ARGS
- -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
- -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT}
- -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF
- -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
- -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
- -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
- -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
- -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
- -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
- -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
- )
- elseif (${compress_type} MATCHES "GIT")
+ if (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (JPEG
GIT_REPOSITORY ${JPEG_URL}
GIT_TAG ${JPEG_BRANCH}
@@ -49,6 +31,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (JPEG
@@ -67,23 +50,24 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
endif ()
externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR)
##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
# Create imported target jpeg-static
- add_library(jpeg-static STATIC IMPORTED)
- HDF_IMPORT_SET_LIB_OPTIONS (jpeg-static "jpeg" STATIC "")
- add_dependencies (jpeg-static JPEG)
- set (JPEG_STATIC_LIBRARY "jpeg-static")
+ add_library(${HDF_PACKAGE_NAMESPACE}jpeg-static STATIC IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}jpeg-static "jpeg" STATIC "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-static JPEG)
+ set (JPEG_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-static")
set (JPEG_LIBRARIES ${JPEG_STATIC_LIBRARY})
if (BUILD_SHARED_LIBS)
# Create imported target jpeg-shared
- add_library(jpeg-shared SHARED IMPORTED)
- HDF_IMPORT_SET_LIB_OPTIONS (jpeg-shared "jpeg" SHARED "")
- add_dependencies (jpeg-shared JPEG)
- set (JPEG_SHARED_LIBRARY "jpeg-shared")
+ add_library(${HDF_PACKAGE_NAMESPACE}jpeg-shared SHARED IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}jpeg-shared "jpeg" SHARED "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-shared JPEG)
+ set (JPEG_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-shared")
set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_SHARED_LIBRARY})
endif ()
@@ -100,33 +84,14 @@ macro (PACKAGE_JPEG_LIBRARY compress_type)
COMMENT "Copying ${JPEG_INCLUDE_DIR_GEN}/jconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
)
set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h)
- if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
+ if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ")
add_dependencies (JPEG-GenHeader-Copy JPEG)
endif ()
endmacro ()
#-------------------------------------------------------------------------------
macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
- if (${compress_type} MATCHES "SVN")
- EXTERNALPROJECT_ADD (SZIP
- SVN_REPOSITORY ${SZIP_URL}
- # [SVN_REVISION rev]
- INSTALL_COMMAND ""
- CMAKE_ARGS
- -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
- -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT}
- -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF
- -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
- -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
- -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
- -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
- -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
- -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
- -DSZIP_ENABLE_ENCODING:BOOL=${encoding}
- -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
- )
- elseif (${compress_type} MATCHES "GIT")
+ if (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (SZIP
GIT_REPOSITORY ${SZIP_URL}
GIT_TAG ${SZIP_BRANCH}
@@ -144,6 +109,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (SZIP
@@ -163,23 +129,24 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
endif ()
externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR)
##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
# Create imported target szip-static
- add_library(szip-static STATIC IMPORTED)
- HDF_IMPORT_SET_LIB_OPTIONS (szip-static "szip" STATIC "")
- add_dependencies (szip-static SZIP)
- set (SZIP_STATIC_LIBRARY "szip-static")
+ add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-static "szip" STATIC "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-static SZIP)
+ set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-static")
set (SZIP_LIBRARIES ${SZIP_STATIC_LIBRARY})
if (BUILD_SHARED_LIBS)
# Create imported target szip-shared
- add_library(szip-shared SHARED IMPORTED)
- HDF_IMPORT_SET_LIB_OPTIONS (szip-shared "szip" SHARED "")
- add_dependencies (szip-shared SZIP)
- set (SZIP_SHARED_LIBRARY "szip-shared")
+ add_library(${HDF_PACKAGE_NAMESPACE}szip-shared SHARED IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-shared "szip" SHARED "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-shared SZIP)
+ set (SZIP_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-shared")
set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_SHARED_LIBRARY})
endif ()
@@ -196,32 +163,14 @@ macro (PACKAGE_SZIP_LIBRARY compress_type)
COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
)
set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h)
- if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
+ if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ")
add_dependencies (SZIP-GenHeader-Copy SZIP)
endif ()
endmacro ()
#-------------------------------------------------------------------------------
macro (EXTERNAL_ZLIB_LIBRARY compress_type)
- if (${compress_type} MATCHES "SVN")
- EXTERNALPROJECT_ADD (ZLIB
- SVN_REPOSITORY ${ZLIB_URL}
- # [SVN_REVISION rev]
- INSTALL_COMMAND ""
- CMAKE_ARGS
- -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
- -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT}
- -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF
- -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
- -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
- -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
- -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
- -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
- -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
- -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
- )
- elseif (${compress_type} MATCHES "GIT")
+ if (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (ZLIB
GIT_REPOSITORY ${ZLIB_URL}
GIT_TAG ${ZLIB_BRANCH}
@@ -238,6 +187,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (ZLIB
@@ -256,6 +206,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
endif ()
externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR)
@@ -267,17 +218,18 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
endif ()
##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
# Create imported target zlib-static
- add_library(zlib-static STATIC IMPORTED)
- HDF_IMPORT_SET_LIB_OPTIONS (zlib-static ${ZLIB_LIB_NAME} STATIC "")
- add_dependencies (zlib-static ZLIB)
- set (ZLIB_STATIC_LIBRARY "zlib-static")
+ add_library(${HDF_PACKAGE_NAMESPACE}zlib-static STATIC IMPORTED)
+# add_library(${HDF_PACKAGE_NAMESPACE}zlib-static ALIAS zlib-static)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-static ${ZLIB_LIB_NAME} STATIC "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-static ZLIB)
+ set (ZLIB_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-static")
set (ZLIB_LIBRARIES ${ZLIB_STATIC_LIBRARY})
if (BUILD_SHARED_LIBS)
# Create imported target zlib-shared
- add_library(zlib-shared SHARED IMPORTED)
- HDF_IMPORT_SET_LIB_OPTIONS (zlib-shared ${ZLIB_LIB_NAME} SHARED "")
- add_dependencies (zlib-shared ZLIB)
- set (ZLIB_SHARED_LIBRARY "zlib-shared")
+ add_library(${HDF_PACKAGE_NAMESPACE}zlib-shared SHARED IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-shared ${ZLIB_LIB_NAME} SHARED "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-shared ZLIB)
+ set (ZLIB_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-shared")
set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY})
endif ()
@@ -294,7 +246,7 @@ macro (PACKAGE_ZLIB_LIBRARY compress_type)
COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
)
set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h)
- if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
+ if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ")
add_dependencies (ZLIB-GenHeader-Copy ZLIB)
endif ()
endmacro ()
diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake
index 2f4ce52..d1d9a6c 100644
--- a/config/cmake_ext_mod/HDFMacros.cmake
+++ b/config/cmake_ext_mod/HDFMacros.cmake
@@ -28,7 +28,7 @@ macro (SET_HDF_BUILD_TYPE)
endif()
endif()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
- message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
+ message (STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
@@ -73,12 +73,12 @@ endmacro ()
#-------------------------------------------------------------------------------
macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent)
- if (WIN32 AND MSVC)
+ if (WIN32 AND MSVC AND NOT DISABLE_PDB_FILES)
get_target_property (target_type ${libtarget} TYPE)
if (${libtype} MATCHES "SHARED")
set (targetfilename $<TARGET_PDB_FILE:${libtarget}>)
else ()
- get_property (target_name TARGET ${libtarget} PROPERTY OUTPUT_NAME_RELWITHDEBINFO)
+ get_property (target_name TARGET ${libtarget} PROPERTY $<IF:$<CONFIG:Debug>,OUTPUT_NAME_DEBUG,OUTPUT_NAME_RELWITHDEBINFO>)
set (targetfilename $<TARGET_FILE_DIR:${libtarget}>/${target_name}.pdb)
endif ()
install (
@@ -86,9 +86,10 @@ macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent)
${targetfilename}
DESTINATION
${targetdestination}
- CONFIGURATIONS RelWithDebInfo
+ CONFIGURATIONS Debug RelWithDebInfo
COMPONENT ${targetcomponent}
- )
+ OPTIONAL
+ )
endif ()
endmacro ()
@@ -100,29 +101,25 @@ macro (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent)
$<TARGET_PDB_FILE:${progtarget}>
DESTINATION
${targetdestination}
- CONFIGURATIONS RelWithDebInfo
+ CONFIGURATIONS Debug RelWithDebInfo
COMPONENT ${targetcomponent}
- )
+ OPTIONAL
+ )
endif ()
endmacro ()
#-------------------------------------------------------------------------------
macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
- if (WIN32)
- set (LIB_DEBUG_SUFFIX "_D")
- else ()
- set (LIB_DEBUG_SUFFIX "_debug")
- endif ()
if (${libtype} MATCHES "SHARED")
set (LIB_RELEASE_NAME "${libname}")
- set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}")
+ set (LIB_DEBUG_NAME "${libname}${CMAKE_DEBUG_POSTFIX}")
else ()
- if (WIN32)
+ if (WIN32 AND NOT MINGW)
set (LIB_RELEASE_NAME "lib${libname}")
- set (LIB_DEBUG_NAME "lib${libname}${LIB_DEBUG_SUFFIX}")
+ set (LIB_DEBUG_NAME "lib${libname}${CMAKE_DEBUG_POSTFIX}")
else ()
set (LIB_RELEASE_NAME "${libname}")
- set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}")
+ set (LIB_DEBUG_NAME "${libname}${CMAKE_DEBUG_POSTFIX}")
endif ()
endif ()
@@ -130,8 +127,8 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
PROPERTIES
OUTPUT_NAME
${LIB_RELEASE_NAME}
- OUTPUT_NAME_DEBUG
- ${LIB_DEBUG_NAME}
+# OUTPUT_NAME_DEBUG
+# ${LIB_DEBUG_NAME}
OUTPUT_NAME_RELEASE
${LIB_RELEASE_NAME}
OUTPUT_NAME_MINSIZEREL
@@ -139,6 +136,11 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
OUTPUT_NAME_RELWITHDEBINFO
${LIB_RELEASE_NAME}
)
+ #get_property (target_name TARGET ${libtarget} PROPERTY OUTPUT_NAME)
+ #get_property (target_name_debug TARGET ${libtarget} PROPERTY OUTPUT_NAME_DEBUG)
+ #get_property (target_name_rwdi TARGET ${libtarget} PROPERTY OUTPUT_NAME_RELWITHDEBINFO)
+ #message (STATUS "${target_name} : ${target_name_debug} : ${target_name_rwdi}")
+
if (${libtype} MATCHES "STATIC")
if (WIN32)
set_target_properties (${libtarget}
@@ -190,7 +192,12 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
)
endif ()
else ()
- if (CYGWIN)
+ if (MINGW)
+ set_target_properties (${libtarget} PROPERTIES
+ IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}.lib"
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ )
+ elseif (CYGWIN)
set_target_properties (${libtarget} PROPERTIES
IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}"
@@ -224,10 +231,9 @@ macro (TARGET_C_PROPERTIES wintarget libtype)
$<$<C_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}>
$<$<CXX_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}>
)
- target_link_libraries(${wintarget} INTERFACE
- $<$<C_COMPILER_ID:MSVC>:${WIN_LINK_FLAGS}>
- $<$<CXX_COMPILER_ID:MSVC>:${WIN_LINK_FLAGS}>
- )
+ if(MSVC)
+ set_property(TARGET ${wintarget} APPEND PROPERTY LINK_FLAGS "${WIN_LINK_FLAGS}")
+ endif()
endmacro ()
#-----------------------------------------------------------------------------
@@ -255,6 +261,10 @@ macro (HDF_README_PROPERTIES target_fortran)
set (BINARY_PLATFORM "${BINARY_PLATFORM} Intel")
if (${CMAKE_C_COMPILER_VERSION} MATCHES "^17.*")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel 17")
+ elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^18.*")
+ set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel 18")
+ elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.*")
+ set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel 19")
else ()
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel ${CMAKE_C_COMPILER_VERSION}")
endif ()
@@ -271,8 +281,10 @@ macro (HDF_README_PROPERTIES target_fortran)
elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.*")
if (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.0.*")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015")
- else ()
+ elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.16.*")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2017")
+ else () #19.23
+ set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2019")
endif ()
else ()
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}")
@@ -294,7 +306,9 @@ macro (HDF_README_PROPERTIES target_fortran)
set (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran")
endif ()
- if (BUILD_SHARED_LIBS)
+ if (ONLY_SHARED_LIBS)
+ set (LIB_TYPE "Shared")
+ elseif (BUILD_SHARED_LIBS)
set (LIB_TYPE "Static and Shared")
else ()
set (LIB_TYPE "Static")
@@ -358,8 +372,13 @@ macro (HDF_DIR_PATHS package_prefix)
endif ()
endif ()
+ # Always use full RPATH, i.e. don't skip the full RPATH for the build tree
set (CMAKE_SKIP_BUILD_RPATH FALSE)
+ # when building, don't use the install RPATH already
+ # (but later on when installing)
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
+ # add the automatically determined parts of the RPATH
+ # which point to directories outside the build tree to the install RPATH
set (CMAKE_BUILD_WITH_INSTALL_RPATH ON)
if (APPLE)
set (CMAKE_INSTALL_NAME_DIR "@rpath")
@@ -377,6 +396,15 @@ macro (HDF_DIR_PATHS package_prefix)
set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH})
endif ()
+ #set the default debug suffix for all library targets
+ if(NOT CMAKE_DEBUG_POSTFIX)
+ if (WIN32)
+ set (CMAKE_DEBUG_POSTFIX "_D")
+ else ()
+ set (CMAKE_DEBUG_POSTFIX "_debug")
+ endif ()
+ endif ()
+
SET_HDF_BUILD_TYPE()
#-----------------------------------------------------------------------------
diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake
index efaa556..8d98147 100644
--- a/config/cmake_ext_mod/HDFUseCXX.cmake
+++ b/config/cmake_ext_mod/HDFUseCXX.cmake
@@ -96,7 +96,7 @@ endmacro ()
# Check a bunch of cxx functions
#-----------------------------------------------------------------------------
if (CMAKE_CXX_COMPILER_LOADED)
- foreach (test
+ foreach (cxx_test
OLD_HEADER_FILENAME
HDF_NO_NAMESPACE
HDF_NO_STD
@@ -104,6 +104,6 @@ if (CMAKE_CXX_COMPILER_LOADED)
NO_STATIC_CAST
CXX_HAVE_OFFSETOF
)
- HDF_CXX_FUNCTION_TEST (${test})
+ HDF_CXX_FUNCTION_TEST (${cxx_test})
endforeach ()
endif ()
diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake
index c68c921..1cce918 100644
--- a/config/cmake_ext_mod/HDFUseFortran.cmake
+++ b/config/cmake_ext_mod/HDFUseFortran.cmake
@@ -13,7 +13,7 @@
# This file provides functions for Fortran support.
#
#-------------------------------------------------------------------------------
-ENABLE_LANGUAGE (Fortran)
+enable_language (Fortran)
set (HDF_PREFIX "H5")
#-------------------------------------------------------------------------------
@@ -65,9 +65,9 @@ macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE)
OUTPUT_VARIABLE OUTPUT
)
-# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
-# message ( "Test result ${OUTPUT}")
-# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
+# message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
+# message (STATUS "Test result ${OUTPUT}")
+# message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
if (${RESULT_VAR})
set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}")
@@ -191,8 +191,8 @@ CHECK_FORTRAN_FEATURE(iso_c_binding
# Add debug information (intel Fortran : JB)
#-----------------------------------------------------------------------------
if (CMAKE_Fortran_COMPILER MATCHES ifort)
- if (WIN32)
- set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE)
- set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE)
+ if (WIN32 AND NOT MINGW)
+ set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE STRING "flags" FORCE)
+ set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE STRING "flags" FORCE)
endif ()
endif ()
diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake
index 1417204..a6f1c7f 100644
--- a/config/cmake_ext_mod/grepTest.cmake
+++ b/config/cmake_ext_mod/grepTest.cmake
@@ -20,7 +20,7 @@ endif ()
# message (STATUS "Require TEST_ARGS to be defined")
#endif ()
if (NOT TEST_FOLDER)
- message ( FATAL_ERROR "Require TEST_FOLDER to be defined")
+ message (FATAL_ERROR "Require TEST_FOLDER to be defined")
endif ()
if (NOT TEST_OUTPUT)
message (FATAL_ERROR "Require TEST_OUTPUT to be defined")
@@ -29,17 +29,38 @@ endif ()
# message (STATUS "Require TEST_EXPECT to be defined")
#endif ()
if (NOT TEST_FILTER)
- message (STATUS "Require TEST_FILTER to be defined")
+ message (STATUS "Optional TEST_FILTER to be defined")
endif ()
if (NOT TEST_REFERENCE)
message (FATAL_ERROR "Require TEST_REFERENCE to be defined")
endif ()
-message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
+ file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
+endif ()
+
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
+ file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+endif ()
+
+message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
+
+if (TEST_LIBRARY_DIRECTORY)
+ if (WIN32 OR MINGW)
+ set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
+ else ()
+ set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
+ endif ()
+endif ()
+
+if (TEST_ENV_VAR)
+ set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}")
+ #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}")
+endif ()
# run the test program, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}
@@ -49,27 +70,121 @@ execute_process (
)
message (STATUS "COMMAND Result: ${TEST_RESULT}")
+
message (STATUS "COMMAND Error: ${TEST_ERROR}")
-# now grep the output with the reference
+# remove special output
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}")
+if (TEST_FIND_RESULT GREATER 0)
+ string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
+ file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
+endif ()
-# TEST_REFERENCE should always be matched
-string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
-string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
-if (NOT TEST_RESULT)
- message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
+# if the TEST_ERRREF exists grep the error output with the error reference
+if (TEST_ERRREF)
+ # if the .err file exists grep the error output with the error reference before comparing stdout
+ if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_ERR_STREAM)
+
+ # TEST_ERRREF should always be matched
+ string (REGEX MATCH "${TEST_ERRREF}" TEST_MATCH ${TEST_ERR_STREAM})
+ string (COMPARE EQUAL "${TEST_ERRREF}" "${TEST_MATCH}" TEST_RESULT)
+ if (NOT TEST_RESULT)
+ message (FATAL_ERROR "Failed: The error output of ${TEST_PROGRAM} did not contain ${TEST_ERRREF}")
+ endif ()
+ endif ()
+
+ #always compare output file to reference unless this must be skipped
+ if (NOT TEST_SKIP_COMPARE)
+ if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
+ if (WIN32 OR MINGW)
+ configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
+ if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp")
+ file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ endif ()
+ if (NOT TEST_SORT_COMPARE)
+ # now compare the output with the reference
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
+ RESULT_VARIABLE TEST_RESULT
+ )
+ else ()
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
+ list (SORT v1)
+ list (SORT v2)
+ if (NOT v1 STREQUAL v2)
+ set(TEST_RESULT 1)
+ endif ()
+ endif ()
+
+ if (TEST_RESULT)
+ set (TEST_RESULT 0)
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
+ list (LENGTH test_act len_act)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
+ list (LENGTH test_ref len_ref)
+ if (len_act GREATER 0 AND len_ref GREATER 0)
+ math (EXPR _FP_LEN "${len_ref} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET test_act ${line} str_act)
+ list (GET test_ref ${line} str_ref)
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
+ set (TEST_RESULT 1)
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ endif ()
+ endif ()
+ endforeach ()
+ else ()
+ if (len_act EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
+ endif ()
+ if (len_ref EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
+ endif ()
+ endif ()
+ if (NOT len_act EQUAL len_ref)
+ set (TEST_RESULT 1)
+ endif ()
+ endif ()
+
+ message (STATUS "COMPARE Result: ${TEST_RESULT}")
+
+ # again, if return value is !=0 scream and shout
+ if (TEST_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
+ endif ()
+ endif ()
+ endif ()
+else ()
+ # else grep the output with the reference
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+
+ # TEST_REFERENCE should always be matched
+ string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
+ string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
+ if (NOT TEST_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
+ endif ()
endif ()
-string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
-if (TEST_EXPECT)
- # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
- string (LENGTH "${TEST_MATCH}" TEST_RESULT)
- if (TEST_RESULT)
- message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
+
+if (TEST_FILTER)
+ string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
+ if (TEST_EXPECT)
+ # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
+ string (LENGTH "${TEST_MATCH}" TEST_RESULT)
+ if (TEST_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
+ endif ()
endif ()
endif ()
# everything went fine...
-message ("Passed: The output of ${TEST_PROGRAM} matched")
+message (STATUS "Passed: The output of ${TEST_PROGRAM} matched")
diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake
index 48402a2..0c4a5a0 100644
--- a/config/cmake_ext_mod/runTest.cmake
+++ b/config/cmake_ext_mod/runTest.cmake
@@ -18,7 +18,7 @@ if (NOT TEST_PROGRAM)
message (FATAL_ERROR "Require TEST_PROGRAM to be defined")
endif ()
if (NOT TEST_FOLDER)
- message ( FATAL_ERROR "Require TEST_FOLDER to be defined")
+ message (FATAL_ERROR "Require TEST_FOLDER to be defined")
endif ()
if (NOT TEST_OUTPUT)
message (FATAL_ERROR "Require TEST_OUTPUT to be defined")
@@ -27,18 +27,18 @@ if (NOT TEST_EXPECT)
message (STATUS "Require TEST_EXPECT to be defined")
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
-message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
+message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
if (TEST_LIBRARY_DIRECTORY)
- if (WIN32 AND NOT MINGW)
+ if (WIN32 OR MINGW)
set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
else ()
set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
@@ -53,7 +53,7 @@ endif ()
if (NOT TEST_INPUT)
# run the test program, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}
@@ -64,7 +64,7 @@ if (NOT TEST_INPUT)
else ()
# run the test program with stdin, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
INPUT_FILE ${TEST_INPUT}
@@ -88,7 +88,7 @@ endif ()
message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the .err file exists and ERRROR_APPEND is enabled
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
if (TEST_MASK_FILE)
STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
@@ -113,7 +113,7 @@ endif ()
# if the return value is !=${TEST_EXPECT} bail out
if (NOT TEST_RESULT EQUAL TEST_EXPECT)
if (NOT TEST_NOERRDISPLAY)
- if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+ if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
message (STATUS "Output :\n${TEST_STREAM}")
endif ()
@@ -125,12 +125,31 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
# remove special output
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
-string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}")
-if (TEST_FIND_RESULT GREATER 0)
+string (FIND "${TEST_STREAM}" "_pmi_alps" TEST_FIND_RESULT)
+if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
endif ()
+# remove special error output
+if (NOT TEST_ERRREF)
+ # the error stack has been appended to the output file
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+else ()
+ # the error stack remains in the .err file
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
+endif ()
+string (FIND "${TEST_STREAM}" "no version information available" TEST_FIND_RESULT)
+if (TEST_FIND_RESULT GREATER -1)
+ string (REGEX REPLACE "^.*no version information available[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
+ # write back the changes to the original files
+ if (NOT TEST_ERRREF)
+ file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
+ else ()
+ file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
+ endif ()
+endif ()
+
# if the output file needs Storage text removed
if (TEST_MASK)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
@@ -185,10 +204,14 @@ endif ()
# compare output files to references unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
- if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE})
- if (WIN32 AND NOT MINGW)
- file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
+ if (WIN32 OR MINGW)
+ configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
+ if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp")
+ file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
endif ()
if (NOT TEST_SORT_COMPARE)
@@ -218,10 +241,10 @@ if (NOT TEST_SKIP_COMPARE)
foreach (line RANGE 0 ${_FP_LEN})
list (GET test_act ${line} str_act)
list (GET test_ref ${line} str_ref)
- if (NOT ${str_act} STREQUAL ${str_ref})
- if (NOT str_act STREQUAL "")
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
set (TEST_RESULT 1)
- message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
endif ()
endif ()
endforeach ()
@@ -248,9 +271,13 @@ if (NOT TEST_SKIP_COMPARE)
# now compare the .err file with the error reference, if supplied
if (TEST_ERRREF)
- if (WIN32 AND NOT MINGW)
- file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
+ if (WIN32 OR MINGW)
+ configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF)
+ if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp")
+ file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
endif ()
# now compare the error output with the error reference
@@ -270,10 +297,10 @@ if (NOT TEST_SKIP_COMPARE)
foreach (line RANGE 0 ${_FP_LEN})
list (GET test_act ${line} str_act)
list (GET test_ref ${line} str_ref)
- if (NOT ${str_act} STREQUAL ${str_ref})
- if (NOT ${str_act} STREQUAL "")
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
set (TEST_RESULT 1)
- message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
endif ()
endif ()
endforeach ()
@@ -320,6 +347,15 @@ if (TEST_GREP_COMPARE)
endif ()
endif ()
+# dump the output unless nodisplay option is set
+if (TEST_SKIP_COMPARE AND NOT TEST_NO_DISPLAY)
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E echo ${TEST_STREAM}
+ RESULT_VARIABLE TEST_RESULT
+ )
+endif ()
+
# everything went fine...
-message ("${TEST_PROGRAM} Passed")
+message (STATUS "${TEST_PROGRAM} Passed")
diff --git a/config/conclude.am b/config/conclude.am
index 27cd7ee..6e96ba2 100644
--- a/config/conclude.am
+++ b/config/conclude.am
@@ -68,7 +68,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/config/gnu-flags b/config/gnu-flags
index 225f072..6355ccf 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -1,4 +1,4 @@
-# -*- shell-script -*-
+# -*- shell-script -*-
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@@ -14,7 +14,7 @@
# This file should be sourced into configure if the compiler is the
# GNU gcc compiler or a derivative. It is careful not to do anything
-# if the compiler is not GNU; otherwise `cc_flags_set' is set to `yes'
+# if the compiler is not GNU; otherwise 'cc_flags_set' is set to 'yes'
#
# Get the compiler version in a way that works for gcc
@@ -23,7 +23,7 @@
# cc_vendor: The compiler name: gcc
# cc_version: Version number: 2.91.60, 2.7.2.1
#
-if test X = "X$cc_flags_set"; then
+if test "X-" = "X-$cc_flags_set"; then
# PathScale compiler spits out gcc version string too. Need to
# filter it out.
# icc beginning with version 12 includes a "gcc version compatiblilty"
@@ -37,26 +37,27 @@ if test X = "X$cc_flags_set"; then
cc_vendor=`echo $cc_version |sed 's/\([a-z]*\).*/\1/'`
cc_version=`echo $cc_version |sed 's/[-a-z]//g'`
if test X = "X$cc_vendor" -a X != "X$cc_version"; then
- cc_vendor=gcc
+ cc_vendor=gcc
fi
if test "-" != "$cc_vendor-$cc_version"; then
- echo "compiler '$CC' is GNU $cc_vendor-$cc_version"
+ echo "compiler '$CC' is GNU $cc_vendor-$cc_version"
fi
- # Some version numbers
+ # Get the compiler version numbers
cc_vers_major=`echo $cc_version | cut -f1 -d.`
cc_vers_minor=`echo $cc_version | cut -f2 -d.`
cc_vers_patch=`echo $cc_version | cut -f3 -d.`
test -n "$cc_vers_major" || cc_vers_major=0
test -n "$cc_vers_minor" || cc_vers_minor=0
test -n "$cc_vers_patch" || cc_vers_patch=0
- cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch`
fi
-# Common GCC flags for various situations
-case "$cc_vendor-$cc_version" in
- gcc*)
- # Architecture-specific flags
+if test "X-gcc" = "X-$cc_vendor"; then
+
+ ###############################
+ # Architecture-specific flags #
+ ###############################
+
arch=
case "$host_os-$host_cpu" in
# FreeBSD sets the information from "uname -m" to the general machine
@@ -87,7 +88,7 @@ case "$cc_vendor-$cc_version" in
case "$host_os-$host_cpu" in
# cygwin needs the "-std=c99" flag removed, so make
# a specific case for Cygwin without the flag and a default
- # case to add the flag everywhere else
+ # case to add the flag everywhere else
cygwin-*)
;;
@@ -96,377 +97,205 @@ case "$cc_vendor-$cc_version" in
;;
esac
- # Host-specific flags
- case "`hostname`" in
- sleipnir.ncsa.uiuc.edu)
- arch="$arch -pipe"
- ;;
- esac
+ H5_CFLAGS="$H5_CFLAGS $arch"
- # General flags
- #
- # Note that some of the flags listed here really should be developer
- # flags (listed in a separate variable, below) but we put them here
- # because they are not raised by the current code and we'd like to
- # know if they do start showing up.
- #
- # NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
- # warnings that are emitted. If you need it, add it from the
- # environment variable at configure time.
- H5_CFLAGS="$H5_CFLAGS $arch -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wcast-align"
- H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal"
- H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs"
- H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith"
- H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum"
- H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings"
+ ##############
+ # Production #
+ ##############
- # Production
# NDEBUG is handled explicitly by the configure script
- case "$cc_vendor-$cc_version" in
- gcc-4.*)
+ if test $cc_vers_major -le 4; then
PROD_CFLAGS=
- ;;
- gcc-[56].*)
+ else
PROD_CFLAGS="-fstdarg-opt"
- ;;
- *)
- # gcc automatically inlines based on the optimization level
- # this is just a failsafe
- PROD_CFLAGS="-finline-functions"
- ;;
- esac
+ fi
+
+ #########
+ # Debug #
+ #########
- # Debug
# NDEBUG is handled explicitly by the configure script
# -g is handled by the symbols flags
- case "$cc_vendor-$cc_version" in
- gcc-[56].*)
- DEBUG_CFLAGS="-ftrapv -fno-common"
- ;;
- *)
+ if test $cc_vers_major -le 4; then
DEBUG_CFLAGS=
- ;;
- esac
+ else
+ DEBUG_CFLAGS="-ftrapv -fno-common"
+ fi
- # Developer warnings (suggestions from gcc, not code problems)
- DEVELOPER_WARNING_CFLAGS="-Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn"
- NO_DEVELOPER_WARNING_CFLAGS="-Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn"
+ ###########
+ # Symbols #
+ ###########
- # Symbols
NO_SYMBOLS_CFLAGS="-s"
SYMBOLS_CFLAGS="-g -fno-omit-frame-pointer"
- # Profile
+ #############
+ # Profiling #
+ #############
+
PROFILE_CFLAGS="-pg"
- # Optimization
- case "$cc_vendor-$cc_version" in
- gcc-4.*)
+ ################
+ # Optimization #
+ ################
+
+ if test $cc_vers_major -le 4; then
HIGH_OPT_CFLAGS="-O3"
DEBUG_OPT_CFLAGS=
- ;;
- gcc-[56].*)
+ else
HIGH_OPT_CFLAGS="-O3"
DEBUG_OPT_CFLAGS="-Og"
- ;;
- *)
- HIGH_OPT_CFLAGS="-O"
- DEBUG_OPT_CFLAGS=
- ;;
- esac
+ fi
NO_OPT_CFLAGS="-O0"
- # Flags are set
- cc_flags_set=yes
- ;;
-esac
-
-# Version specific GCC flags
-#
-# Please follow the pattern below by adding new versions at the top, copying
-# the information from the previous version and adding modifications to that.
-case "$cc_vendor-$cc_version" in
-
-# When the gcc 7.x release is out, we should check for additional flags to
-# include and break it out into it's own section, like the other versions
-# below. -QAK
- gcc-6*)
- # Append warning flags that only gcc 4.2+ knows about
- # (none, or incorporated in -Wall / -Wextra now)
-
- # Append warning flags that only gcc 4.3+ knows about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append warning flags that only gcc 4.4+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append warning flags that only gcc 4.5+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants"
-
- # Append warning flags that only gcc 4.6+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const"
-
- # Append warning flags that only gcc 4.7+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn"
-
- # Append warning flags that only gcc 4.8+ knows about
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format"
-
- # Append warning flags that only gcc 4.9+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wdate-time"
-
- # Append warning flags that only gcc 5.x+ knows about
- H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat"
-
- # Append warning flags that only gcc 6.x+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa"
- ;;
-
- gcc-5*)
- # Append warning flags that only gcc 4.2+ knows about
- # (none, or incorporated in -Wall / -Wextra now)
-
- # Append warning flags that only gcc 4.3+ knows about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append warning flags that only gcc 4.4+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append warning flags that only gcc 4.5+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants"
-
- # Append warning flags that only gcc 4.6+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const"
-
- # Append warning flags that only gcc 4.7+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn"
-
- # Append warning flags that only gcc 4.8+ knows about
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format"
-
- # Append warning flags that only gcc 4.9+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wdate-time"
-
- # Append warning flags that only gcc 5.x+ knows about
- H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat"
- ;;
-
- gcc-4.9*)
- # Append warning flags that only gcc 4.2+ knows about
- # (none, or incorporated in -Wall / -Wextra now)
-
- # Append warning flags that only gcc 4.3+ knows about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append warning flags that only gcc 4.4+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append warning flags that only gcc 4.5+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants"
-
- # Append warning flags that only gcc 4.6+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const"
-
- # Append warning flags that only gcc 4.7+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn"
-
- # Append warning flags that only gcc 4.8+ knows about
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format"
-
- # Append warning flags that only gcc 4.9+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wdate-time"
- ;;
+ ############
+ # Warnings #
+ ############
- gcc-4.8*)
- # Append warning flags that only gcc 4.2+ knows about
- # (none, or incorporated in -Wall / -Wextra now)
+ ###########
+ # General #
+ ###########
- # Append warning flags that only gcc 4.3+ knows about
+ # Note that some of the flags listed here really should be developer
+ # flags (listed in a separate variable, below) but we put them here
+ # because they are not raised by the current code and we'd like to
+ # know if they do start showing up.
#
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append warning flags that only gcc 4.4+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append warning flags that only gcc 4.5+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init"
-
- # Append warning flags that only gcc 4.6+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const"
-
- # Append warning flags that only gcc 4.7+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn"
-
- # Append warning flags that only gcc 4.8+ knows about
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format"
- ;;
-
- gcc-4.7*)
- # Append warning flags that only gcc 4.2+ knows about
- # (none, or incorporated in -Wall / -Wextra now)
-
- # Append warning flags that only gcc 4.3+ knows about
+ # NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
+ # warnings that are emitted. If you need it, add it from the
+ # environment variable at configure time.
#
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append warning flags that only gcc 4.4+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append warning flags that only gcc 4.5+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants"
-
- # Append warning flags that only gcc 4.6+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const"
-
- # Append warning flags that only gcc 4.7+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn"
- ;;
-
- gcc-4.6*)
- # Disable warnings about using 'long long' type
- H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
-
- # Append warning flags that only gcc 4.2+ knows about
- # (none, or incorporated in -Wall / -Wextra now)
-
- # Append warning flags that only gcc 4.3+ knows about
+ # NOTE: Disable the -Wformat-nonliteral from -Wformat=2 here and re-add
+ # it to the developer flags.
#
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
+ H5_CFLAGS="$H5_CFLAGS -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wcast-align"
+ H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal"
+ H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Wno-format-nonliteral -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs"
+ H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked"
+ H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-enum -Wswitch-default"
+ H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings"
- # Append warning flags that only gcc 4.4+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
+ ######################
+ # Developer warnings #
+ ######################
- # Append warning flags that only gcc 4.5+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants"
+ # (suggestions from gcc, not code problems)
+ # NOTE: -Wformat-nonliteral added back in here (from being disabled in H5_CFLAGS)
+ DEVELOPER_WARNING_CFLAGS="-Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn -Wformat-nonliteral"
+ NO_DEVELOPER_WARNING_CFLAGS="-Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn"
- # Append warning flags that only gcc 4.6+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const"
- ;;
+ #######################
+ # gcc 4 special cases #
+ #######################
- gcc-4.5*)
- # Disable warnings about using 'long long' type
- H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
+ # Disable warnings about using the 'long long' type w/ gcc 4.6 and earlier
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
+ H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
+ fi
- # Append warning flags that only gcc 4.2+ knows about
- # (none, or incorporated in -Wall / -Wextra now)
+ # -Wvolatile-register-var was later incorporated into -Wall and
+ # only needs to be specified explicitly for gcc 4.2-4.3
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then
+ H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var"
+ fi
- # Append warning flags that only gcc 4.3+ knows about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
+ # -Wstrict-aliasing was later incorporated into -Wall and
+ # only needs to be specified explicitly for gcc 4.5-4.6
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
+ H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing"
+ fi
- # Append warning flags that only gcc 4.4+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
+ # The non-valued form of -Wstrict-overflow is used in gcc 4.2-4.4
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -a $cc_vers_major -eq 4 -a $cc_vers_minor -le 4; then
+ H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow"
+ fi
- # Append warning flags that only gcc 4.5+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants"
- ;;
+ # -Wvla was later incorporated into -Wpedantic and
+ # only needs to be specified explicitly for gcc 4
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then
+ H5_CFLAGS="$H5_CFLAGS -Wvla"
+ fi
- gcc-4.4*)
- # Disable warnings about using 'long long' type
- H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
+ #############################
+ # Version-specific warnings #
+ #############################
- # Append warning flags that only gcc 4.2+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow"
+ # gcc 4.3
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then
+ H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560"
+ fi
- # Append warning flags that only gcc 4.3+ knows about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
+ # gcc 4.4
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then
+ H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
+ fi
- # Append warning flags that only gcc 4.4+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
- ;;
+ # gcc 4.5
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then
+ H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants"
+ fi
- gcc-4.3*)
- # Disable warnings about using 'long long' type
- H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
+ # gcc 4.6
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 6; then
+ H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines"
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const"
+ NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const"
+ fi
- # Append warning flags that only gcc 4.1+ knows about
- # -Wvolatile-register-var was later incorporated into -Wall and
- # needs to be specified explicitly for gcc 4.1-4.3.
- H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var"
+ # gcc 4.7
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 7; then
+ H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance"
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
+ NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn"
+ fi
- # Append warning flags that only gcc 4.2+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow"
+ # gcc 4.8
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format"
+ NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format"
+ fi
- # Append warning flags that only gcc 4.3+ knows about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wvla"
- ;;
+ # gcc 4.9
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 9; then
+ H5_CFLAGS="$H5_CFLAGS -Wdate-time"
+ fi
- gcc-4.2*)
- # Disable warnings about using 'long long' type
- H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
+ # gcc 5
+ if test $cc_vers_major -ge 5; then
+ H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat"
+ fi
- # Append warning flags that only gcc 4.1+ knows about
- # -Wvolatile-register-var was later incorporated into -Wall and
- # needs to be specified explicitly for gcc 4.1-4.3.
- H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var"
+ # gcc 6
+ if test $cc_vers_major -ge 6; then
+ H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized"
+ fi
- # Append warning flags that only gcc 4.2+ knows about
- H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow"
- ;;
+ # gcc 7
+ if test $cc_vers_major -ge 7; then
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wstringop-overflow=2"
+ H5_CFLAGS="$H5_CFLAGS -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wrestrict"
+ fi
- gcc-4.1*)
- # Disable warnings about using 'long long' type
- H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
+ # gcc 8
+ if test $cc_vers_major -ge 8; then
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wstringop-overflow=4 -Wsuggest-attribute=cold -Wsuggest-attribute=malloc"
+ NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=cold -Wno-suggest-attribute=malloc"
+ H5_CFLAGS="$H5_CFLAGS -Wattribute-alias -Wcast-align=strict -Wshift-overflow=2"
+ fi
- # Append warning flags that only gcc 4.1+ knows about
- # -Wvolatile-register-var was later incorporated into -Wall and
- # needs to be specified explicitly for gcc 4.1-4.3.
- H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var"
- ;;
+ # gcc 9
+ if test $cc_vers_major -ge 9; then
+ H5_CFLAGS="$H5_CFLAGS -Wattribute-alias=2 -Wmissing-profile"
+ fi
-esac
+ #################
+ # Flags are set #
+ #################
+ cc_flags_set=yes
+fi
# Clear cc info if no flags set
if test "X$cc_flags_set" = "X"; then
- cc_vendor=
- cc_version=
+ cc_vendor=
+ cc_version=
fi
diff --git a/config/lt_vers.am b/config/lt_vers.am
index cba0782..0ba3bad 100644
--- a/config/lt_vers.am
+++ b/config/lt_vers.am
@@ -16,9 +16,9 @@
## See libtool versioning documentation online.
## After making changes, run bin/reconfigure to update other configure related
## files like Makefile.in.
-LT_VERS_INTERFACE = 104
+LT_VERS_INTERFACE = 105
LT_VERS_REVISION = 0
-LT_VERS_AGE = 1
+LT_VERS_AGE = 2
## If the API changes *at all*, increment LT_VERS_INTERFACE and
## reset LT_VERS_REVISION to 0.
@@ -39,31 +39,31 @@ LT_VERS_AGE = 1
## the effects of the H5_V1_x_COMPAT flag.
##
## Version numbers for wrapper shared library files.
-LT_CXX_VERS_INTERFACE = 104
+LT_CXX_VERS_INTERFACE = 105
LT_CXX_VERS_REVISION = 0
-LT_CXX_VERS_AGE = 1
+LT_CXX_VERS_AGE = 2
LT_F_VERS_INTERFACE = 102
-LT_F_VERS_REVISION = 0
+LT_F_VERS_REVISION = 1
LT_F_VERS_AGE = 0
LT_HL_VERS_INTERFACE = 101
-LT_HL_VERS_REVISION = 2
+LT_HL_VERS_REVISION = 3
LT_HL_VERS_AGE = 1
LT_HL_CXX_VERS_INTERFACE = 101
-LT_HL_CXX_VERS_REVISION = 3
+LT_HL_CXX_VERS_REVISION = 4
LT_HL_CXX_VERS_AGE = 1
LT_HL_F_VERS_INTERFACE = 100
-LT_HL_F_VERS_REVISION = 4
+LT_HL_F_VERS_REVISION = 5
LT_HL_F_VERS_AGE = 0
LT_JAVA_VERS_INTERFACE = 104
-LT_JAVA_VERS_REVISION = 0
+LT_JAVA_VERS_REVISION = 1
LT_JAVA_VERS_AGE = 4
LT_TOOLS_VERS_INTERFACE = 101
-LT_TOOLS_VERS_REVISION = 2
+LT_TOOLS_VERS_REVISION = 3
LT_TOOLS_VERS_AGE = 1
diff --git a/config/toolchain/build32.cmake b/config/toolchain/build32.cmake
new file mode 100644
index 0000000..deb5899
--- /dev/null
+++ b/config/toolchain/build32.cmake
@@ -0,0 +1,75 @@
+if (WIN32)
+ set (CMAKE_SYSTEM_NAME Windows)
+ set (CMAKE_GENERATOR_PLATFORM "x86")
+elseif(APPLE)
+ set (CMAKE_OSX_ARCHITECTURES "i386")
+elseif(MINGW)
+ set (CMAKE_SYSTEM_NAME Windows)
+ set (CMAKE_C_COMPILER i686-w64-mingw32-gcc)
+ set (CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
+ set (CMAKE_RC_COMPILER i686-w64-mingw32-windres)
+ set (CMAKE_Fortran_COMPILER i686-w64-mingw32-gfortran)
+
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
+
+ set (LIB32 /usr/lib) # Fedora
+
+ if (EXISTS "/usr/lib32")
+ set (LIB32 /usr/lib32) # Arch, Solus
+ endif ()
+
+ set (CMAKE_SYSTEM_LIBRARY_PATH ${LIB32} CACHE STRING "system library search path" FORCE)
+ set (CMAKE_LIBRARY_PATH ${LIB32} CACHE STRING "library search path" FORCE)
+
+ # this is probably unlikely to be needed, but just in case
+ set (CMAKE_EXE_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "executable linker flags" FORCE)
+ set (CMAKE_SHARED_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "shared library linker flags" FORCE)
+ set (CMAKE_MODULE_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "module linker flags" FORCE)
+
+ # on Fedora and Arch and similar, point pkgconfig at 32 bit .pc files. We have
+ # to include the regular system .pc files as well (at the end), because some
+ # are not always present in the 32 bit directory
+ if (EXISTS "${LIB32}/pkgconfig")
+ set (ENV{PKG_CONFIG_LIBDIR} ${LIB32}/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig)
+ endif ()
+
+ set (CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
+ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+ set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+ set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+ set (CMAKE_CROSSCOMPILING_EMULATOR wine32)
+else ()
+ set (CMAKE_SYSTEM_NAME Linux)
+
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
+
+ set (LIB32 /usr/lib) # Fedora
+
+ if (EXISTS "/usr/lib32")
+ set (LIB32 /usr/lib32) # Arch, Solus
+ endif ()
+
+ set (CMAKE_SYSTEM_LIBRARY_PATH ${LIB32} CACHE STRING "system library search path" FORCE)
+ set (CMAKE_LIBRARY_PATH ${LIB32} CACHE STRING "library search path" FORCE)
+
+ # this is probably unlikely to be needed, but just in case
+ set (CMAKE_EXE_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "executable linker flags" FORCE)
+ set (CMAKE_SHARED_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "shared library linker flags" FORCE)
+ set (CMAKE_MODULE_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "module linker flags" FORCE)
+
+ # on Fedora and Arch and similar, point pkgconfig at 32 bit .pc files. We have
+ # to include the regular system .pc files as well (at the end), because some
+ # are not always present in the 32 bit directory
+ if (EXISTS "${LIB32}/pkgconfig")
+ set (ENV{PKG_CONFIG_LIBDIR} ${LIB32}/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig)
+ endif ()
+# where is the target environment
+ set (CMAKE_FIND_ROOT_PATH ${LIB32})
+# search for programs in the build host directories
+ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+# for libraries and headers in the target directories
+ set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+ set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+endif () \ No newline at end of file
diff --git a/config/toolchain/clang.cmake b/config/toolchain/clang.cmake
new file mode 100644
index 0000000..5e3b13a
--- /dev/null
+++ b/config/toolchain/clang.cmake
@@ -0,0 +1,11 @@
+# Uncomment the following to use cross-compiling
+#set(CMAKE_SYSTEM_NAME Linux)
+
+set(CMAKE_COMPILER_VENDOR "clang")
+
+set(CMAKE_C_COMPILER clang)
+set(CMAKE_CXX_COMPILER clang++)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+# the following is used if cross-compiling
+set(CMAKE_CROSSCOMPILING_EMULATOR "")
diff --git a/config/toolchain/mingw64.cmake b/config/toolchain/mingw64.cmake
new file mode 100644
index 0000000..fde5e38
--- /dev/null
+++ b/config/toolchain/mingw64.cmake
@@ -0,0 +1,14 @@
+set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
+set (CMAKE_SYSTEM_NAME Windows)
+set (CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
+set (CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
+set (CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
+set (CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran)
+set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX} /usr/local/${TOOLCHAIN_PREFIX})
+set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set (CMAKE_CROSSCOMPILING_EMULATOR wine64)
+
+include_directories(/usr/local/${TOOLCHAIN_PREFIX}/include)
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On CACHE BOOL "Export windows symbols")
diff --git a/configure b/configure
index 3a4a5c4..778a005 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for HDF5 1.10.5.
+# Generated by GNU Autoconf 2.69 for HDF5 1.10.6.
#
# Report bugs to <help@hdfgroup.org>.
#
@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='HDF5'
PACKAGE_TARNAME='hdf5'
-PACKAGE_VERSION='1.10.5'
-PACKAGE_STRING='HDF5 1.10.5'
+PACKAGE_VERSION='1.10.6'
+PACKAGE_STRING='HDF5 1.10.6'
PACKAGE_BUGREPORT='help@hdfgroup.org'
PACKAGE_URL=''
@@ -645,6 +645,12 @@ enable_static
enable_shared
STATIC_SHARED
SEARCH
+BUILD_TOOLS_CONDITIONAL_FALSE
+BUILD_TOOLS_CONDITIONAL_TRUE
+BUILD_TESTS_PARALLEL_CONDITIONAL_FALSE
+BUILD_TESTS_PARALLEL_CONDITIONAL_TRUE
+BUILD_TESTS_CONDITIONAL_FALSE
+BUILD_TESTS_CONDITIONAL_TRUE
BUILD_HDF5_HL_CONDITIONAL_FALSE
BUILD_HDF5_HL_CONDITIONAL_TRUE
BUILD_JAVA_CONDITIONAL_FALSE
@@ -672,6 +678,11 @@ CONFIG_MODE
CONFIG_USER
CONFIG_DATE
H5_VERSION
+JNI_LDFLAGS
+HAVE_LIBHDFS
+ROS3_VFD_CONDITIONAL_FALSE
+ROS3_VFD_CONDITIONAL_TRUE
+ROS3_VFD
DIRECT_VFD_CONDITIONAL_FALSE
DIRECT_VFD_CONDITIONAL_TRUE
DIRECT_VFD
@@ -722,6 +733,8 @@ LD
FGREP
SED
LIBTOOL
+HDF5_TOOLS
+HDF5_TESTS
FORTRAN_SHARED_CONDITIONAL_FALSE
FORTRAN_SHARED_CONDITIONAL_TRUE
H5_FORTRAN_SHARED
@@ -732,7 +745,6 @@ JUNIT
_ACJNI_JAVAC
JAVADOC
JAR
-UUDECODE
JAVAC
JAVA
JAVAFLAGS
@@ -764,7 +776,6 @@ H5CONFIG_F_NUM_IKIND
H5CONFIG_F_RKIND_SIZEOF
H5CONFIG_F_RKIND
H5CONFIG_F_NUM_RKIND
-FORTRAN_SIZEOF_LONG_DOUBLE
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE
FORTRAN_HAVE_C_LONG_DOUBLE
HAVE_Fortran_INTEGER_SIZEOF_16
@@ -931,6 +942,8 @@ enable_java
with_java_prefix
with_javac_flags
with_java_flags
+enable_tests
+enable_tools
enable_shared
enable_static
with_pic
@@ -963,6 +976,8 @@ enable_parallel
enable_instrument
with_mpe
enable_direct_vfd
+enable_ros3_vfd
+with_libhdfs
with_default_plugindir
enable_dconv_exception
enable_dconv_accuracy
@@ -1529,7 +1544,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures HDF5 1.10.5 to adapt to many kinds of systems.
+\`configure' configures HDF5 1.10.6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1599,7 +1614,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of HDF5 1.10.5:";;
+ short | recursive ) echo "Configuration of HDF5 1.10.6:";;
esac
cat <<\_ACEOF
@@ -1631,6 +1646,8 @@ Optional Features:
--enable-hl Enable the high-level library. [default=yes (unless
build mode = clean)]
--enable-java Compile the Java JNI interface [default=no]
+ --enable-tests Compile the HDF5 tests [default=yes]
+ --enable-tools Compile the HDF5 tools [default=yes]
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
@@ -1717,6 +1734,8 @@ Optional Features:
--enable-direct-vfd Build the direct I/O virtual file driver (VFD). This
is based on the POSIX (sec2) VFD and requires the
open() call to take the O_DIRECT flag. [default=no]
+ --enable-ros3-vfd Build the Read-Only S3 virtual file driver (VFD).
+ [default=no]
--enable-dconv-exception
if exception handling functions is checked during
data conversions [default=yes]
@@ -1767,6 +1786,8 @@ Optional Packages:
--with-pthread=DIR Specify alternative path to Pthreads library when
thread-safe capability is built.
--with-mpe=DIR Use MPE instrumentation [default=no]
+ --with-libhdfs=DIR Provide libhdfs library to enable HDFS virtual file
+ driver (VFD) [default=no]
--with-default-plugindir=location
Specify default location for plugins
[default="/usr/local/hdf5/lib/plugin"]
@@ -1857,7 +1878,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-HDF5 configure 1.10.5
+HDF5 configure 1.10.6
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2772,7 +2793,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by HDF5 $as_me 1.10.5, which was
+It was created by HDF5 $as_me 1.10.6, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3644,7 +3665,7 @@ fi
# Define the identity of the package.
PACKAGE='hdf5'
- VERSION='1.10.5'
+ VERSION='1.10.6'
cat >>confdefs.h <<_ACEOF
@@ -8299,7 +8320,6 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu
-
Fortran_COMPILER_ID=none
cat >>confdefs.h <<_ACEOF
@@ -9564,7 +9584,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
-/* #line 9567 "configure" */
+/* #line 9587 "configure" */
public class Test {
}
EOF
@@ -9677,82 +9697,6 @@ done
fi
test x$JAVA = x && as_fn_error $? "no acceptable Java virtual machine found in \$PATH" "$LINENO" 5
-# Extract the first word of "uudecode", so it can be a program name with args.
-set dummy uudecode; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_UUDECODE+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $UUDECODE in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_UUDECODE="$UUDECODE" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_UUDECODE="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_UUDECODE" && ac_cv_path_UUDECODE="no"
- ;;
-esac
-fi
-UUDECODE=$ac_cv_path_UUDECODE
-if test -n "$UUDECODE"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UUDECODE" >&5
-$as_echo "$UUDECODE" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x$UUDECODE != xno; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if uudecode can decode base 64 file" >&5
-$as_echo_n "checking if uudecode can decode base 64 file... " >&6; }
-if ${ac_cv_prog_uudecode_base64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-cat << \EOF > Test.uue
-begin-base64 644 Test.class
-yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
-bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
-bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s
-YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG
-aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB
-AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB
-AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ=
-====
-EOF
-if $UUDECODE Test.uue; then
- ac_cv_prog_uudecode_base64=yes
-else
- echo "configure: 9742: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
- echo "configure: failed file was:" >&5
- cat Test.uue >&5
- ac_cv_prog_uudecode_base64=no
-fi
-rm -f Test.uue
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_uudecode_base64" >&5
-$as_echo "$ac_cv_prog_uudecode_base64" >&6; }
-fi
-if test x$ac_cv_prog_uudecode_base64 != xyes; then
- rm -f Test.class
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: I have to compile Test.class from scratch" >&5
-$as_echo "$as_me: WARNING: I have to compile Test.class from scratch" >&2;}
if test x$ac_cv_prog_javac_works = xno; then
as_fn_error $? "Cannot compile java source. $JAVAC does not work properly" "$LINENO" 5
fi
@@ -9856,7 +9800,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
-/* #line 9859 "configure" */
+/* #line 9803 "configure" */
public class Test {
}
EOF
@@ -9880,7 +9824,6 @@ $as_echo "$ac_cv_prog_javac_works" >&6; }
fi
-fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $JAVA works" >&5
$as_echo_n "checking if $JAVA works... " >&6; }
if ${ac_cv_prog_java_works+:} false; then :
@@ -9891,13 +9834,12 @@ JAVA_TEST=Test.java
CLASS_TEST=Test.class
TEST=Test
cat << \EOF > $JAVA_TEST
-/* [#]line 9894 "configure" */
+/* [#]line 9837 "configure" */
public class Test {
public static void main (String args[]) {
System.exit (0);
} }
EOF
-if test x$ac_cv_prog_uudecode_base64 != xyes; then
if { ac_try='$JAVAC $JAVACFLAGS $JAVA_TEST'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
@@ -9910,7 +9852,6 @@ if test x$ac_cv_prog_uudecode_base64 != xyes; then
cat $JAVA_TEST >&5
as_fn_error $? "The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" "$LINENO" 5
fi
-fi
if { ac_try='$JAVA -classpath . $JAVAFLAGS $TEST'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
@@ -9923,7 +9864,7 @@ else
cat $JAVA_TEST >&5
as_fn_error $? "The Java VM $JAVA failed (see config.log, check the CLASSPATH?)" "$LINENO" 5
fi
-rm -fr $JAVA_TEST $CLASS_TEST Test.uue
+rm -f $JAVA_TEST $CLASS_TEST
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_java_works" >&5
@@ -10114,6 +10055,8 @@ test "x$JAVADOC" = x && as_fn_error $? "no acceptable javadoc generator found in
## Find the include directories needed for building JNI code
+
+
JNI_INCLUDE_DIRS=""
if test "x$JAVA_HOME" != x; then
@@ -10187,14 +10130,17 @@ _ACJNI_FOLLOWED="$_cur"
fi
case "$host_os" in
- darwin*) # Apple JDK is at /System location and has headers symlinked elsewhere
- case "$_JTOPDIR" in
- /System/Library/Frameworks/JavaVM.framework/*)
- _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[^/]*$::'`
- _JINC="$_JTOPDIR/Headers";;
- *) _JINC="$_JTOPDIR/include";;
- esac;;
- *) _JINC="$_JTOPDIR/include";;
+ darwin*) # Apple Java headers are inside the Xcode bundle.
+ macos_version=$(sw_vers -productVersion | sed -n -e 's/^[0-9]*.\([0-9]*\).[0-9]*/\1/p')
+ if [ "$macos_version" -gt "7" ]; then
+ _JTOPDIR="$(xcrun --show-sdk-path)/System/Library/Frameworks/JavaVM.framework"
+ _JINC="$_JTOPDIR/Headers"
+ else
+ _JTOPDIR="/System/Library/Frameworks/JavaVM.framework"
+ _JINC="$_JTOPDIR/Headers"
+ fi
+ ;;
+ *) _JINC="$_JTOPDIR/include";;
esac
$as_echo "$as_me:${as_lineno-$LINENO}: _JTOPDIR=$_JTOPDIR" >&5
$as_echo "$as_me:${as_lineno-$LINENO}: _JINC=$_JINC" >&5
@@ -10202,53 +10148,28 @@ $as_echo "$as_me:${as_lineno-$LINENO}: _JINC=$_JINC" >&5
# On Mac OS X 10.6.4, jni.h is a symlink:
# /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/jni.h
# -> ../../CurrentJDK/Headers/jni.h.
-as_ac_File=`$as_echo "ac_cv_file_$_JINC/jni.h" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $_JINC/jni.h" >&5
-$as_echo_n "checking for $_JINC/jni.h... " >&6; }
-if eval \${$as_ac_File+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- test "$cross_compiling" = yes &&
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
-if test -r "$_JINC/jni.h"; then
- eval "$as_ac_File=yes"
-else
- eval "$as_ac_File=no"
-fi
-fi
-eval ac_res=\$$as_ac_File
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
- JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JINC"
-else
- _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[^/]*$::'`
- as_ac_File=`$as_echo "ac_cv_file_$_JTOPDIR/include/jni.h" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $_JTOPDIR/include/jni.h" >&5
-$as_echo_n "checking for $_JTOPDIR/include/jni.h... " >&6; }
-if eval \${$as_ac_File+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking jni headers" >&5
+$as_echo_n "checking jni headers... " >&6; }
+if ${ac_cv_jni_header_path+:} false; then :
$as_echo_n "(cached) " >&6
else
- test "$cross_compiling" = yes &&
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
-if test -r "$_JTOPDIR/include/jni.h"; then
- eval "$as_ac_File=yes"
-else
- eval "$as_ac_File=no"
-fi
-fi
-eval ac_res=\$$as_ac_File
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
- JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include"
-else
- as_fn_error $? "cannot find JDK header files" "$LINENO" 5
-fi
+ if test -f "$_JINC/jni.h"; then
+ ac_cv_jni_header_path="$_JINC"
+ JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
+ else
+ _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[^/]*$::'`
+ if test -f "$_JTOPDIR/include/jni.h"; then
+ ac_cv_jni_header_path="$_JTOPDIR/include"
+ JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
+ else
+ ac_cv_jni_header_path=none
+ fi
+ fi
fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_jni_header_path" >&5
+$as_echo "$ac_cv_jni_header_path" >&6; }
# get the likely subdirectories for system specific java includes
case "$host_os" in
@@ -10263,13 +10184,15 @@ cygwin*) _JNI_INC_SUBDIRS="win32";;
*) _JNI_INC_SUBDIRS="genunix";;
esac
-# add any subdirectories that are present
-for JINCSUBDIR in $_JNI_INC_SUBDIRS
-do
+if test "x$ac_cv_jni_header_path" != "xnone"; then
+ # add any subdirectories that are present
+ for JINCSUBDIR in $_JNI_INC_SUBDIRS
+ do
if test -d "$_JTOPDIR/include/$JINCSUBDIR"; then
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include/$JINCSUBDIR"
fi
-done
+ done
+fi
for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
do
@@ -10298,50 +10221,9 @@ if eval \${ax_cv_class_$ac_var_name+:} false; then :
$as_echo_n "(cached) " >&6
else
-if test x$ac_cv_prog_uudecode_base64 = xyes; then
-cat << \EOF > Test.uue
-begin-base64 644 Test.class
-yv66vgADAC0AKQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
-bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
-bWJlclRhYmxlDAAKAAsBAANlcnIBABVMamF2YS9pby9QcmludFN0cmVhbTsJ
-AA0ACQcADgEAEGphdmEvbGFuZy9TeXN0ZW0IABABABBNaXNzaW5nIGFyZ3Vt
-ZW50DAASABMBAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgAV
-ABEHABYBABNqYXZhL2lvL1ByaW50U3RyZWFtDAAYABkBAARleGl0AQAEKEkp
-VgoADQAXDAAcAB0BAAdmb3JOYW1lAQAlKExqYXZhL2xhbmcvU3RyaW5nOylM
-amF2YS9sYW5nL0NsYXNzOwoAHwAbBwAgAQAPamF2YS9sYW5nL0NsYXNzBwAi
-AQAgamF2YS9sYW5nL0NsYXNzTm90Rm91bmRFeGNlcHRpb24BAAY8aW5pdD4B
-AAMoKVYMACMAJAoAAwAlAQAKU291cmNlRmlsZQEACVRlc3QuamF2YQAhAAEA
-AwAAAAAAAgAJAAUABgABAAcAAABtAAMAAwAAACkqvgSiABCyAAwSD7YAFBBN
-uAAaKgMyuAAeTKcACE0EuAAaAUwDuAAasQABABMAGgAdACEAAQAIAAAAKgAK
-AAAACgAAAAsABgANAA4ADgATABAAEwASAB4AFgAiABgAJAAZACgAGgABACMA
-JAABAAcAAAAhAAEAAQAAAAUqtwAmsQAAAAEACAAAAAoAAgAAAAQABAAEAAEA
-JwAAAAIAKA==
-====
-EOF
- if $UUDECODE Test.uue; then
- :
- else
- echo "configure: 10324: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
- echo "configure: failed file was:" >&5
- cat Test.uue >&5
- ac_cv_prog_uudecode_base64=no
- fi
- rm -f Test.uue
- if { ac_try='$JAVA $JAVAFLAGS Test junit.textui.TestRunner'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; } >/dev/null 2>&1; then
- eval "ac_cv_class_$ac_var_name=yes"
- else
- eval "ac_cv_class_$ac_var_name=no"
- fi
- rm -f Test.class
-else
cat << \EOF > Test.java
-/* #line 10344 "configure" */
+/* #line 10226 "configure" */
import junit.textui.TestRunner;
public class Test {
@@ -10358,11 +10240,10 @@ then
else
echo "configure: failed program was:" >&5
cat Test.java >&5
- rm -fr Test.java Test.class
+ rm -f Test.java Test.class
eval "ac_cv_class_$ac_var_name=no"
fi
-rm -fr Test.java Test.class
-fi
+rm -f Test.java Test.class
eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`"
HAVE_LAST_CLASS=$ac_var_val
@@ -10540,6 +10421,52 @@ fi
## ----------------------------------------------------------------------
+## Check if they would like to disable building tests
+##
+
+## This needs to be exposed for the library info file.
+
+
+## Default is to build tests
+HDF5_TESTS=yes
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if building tests is disabled" >&5
+$as_echo_n "checking if building tests is disabled... " >&6; }
+
+# Check whether --enable-tests was given.
+if test "${enable_tests+set}" = set; then :
+ enableval=$enable_tests; HDF5_TESTS=$enableval
+fi
+
+
+if test "X$HDF5_TESTS" = "Xno"; then
+ echo "Building HDF5 tests is disabled"
+fi
+
+## ----------------------------------------------------------------------
+## Check if they would like to disable building tools
+##
+
+## This needs to be exposed for the library info file.
+
+
+## Default is to build tests and tools
+HDF5_TOOLS=yes
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if building tools is disabled" >&5
+$as_echo_n "checking if building tools is disabled... " >&6; }
+
+# Check whether --enable-tools was given.
+if test "${enable_tools+set}" = set; then :
+ enableval=$enable_tools; HDF5_TOOLS=$enableval
+fi
+
+
+if test "X$HDF5_TOOLS" = "Xno"; then
+ echo "Building HDF5 tools is disabled"
+fi
+
+## ----------------------------------------------------------------------
## Create libtool. If shared/static libraries are going to be enabled
## or disabled, it should happen before these macros.
@@ -29549,8 +29476,10 @@ esac
if test -n "$PARALLEL"; then
- ## The 'testpar' directory should participate in the build
- TESTPARALLEL=testpar
+ if test "X$HDF5_TESTS" = "Xyes"; then
+ ## The 'testpar' directory should participate in the build
+ TESTPARALLEL=testpar
+ fi
## We are building a parallel library
@@ -30154,6 +30083,517 @@ fi
## ----------------------------------------------------------------------
+## Check if Read-Only S3 virtual file driver is enabled by --enable-ros3-vfd
+##
+
+
+## Default is no Read-Only S3 VFD
+ROS3_VFD=no
+
+# Check whether --enable-ros3-vfd was given.
+if test "${enable_ros3_vfd+set}" = set; then :
+ enableval=$enable_ros3_vfd; ROS3_VFD=$enableval
+else
+ ROS3_VFD=no
+fi
+
+
+if test "X$ROS3_VFD" = "Xyes"; then
+ for ac_header in curl/curl.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "curl/curl.h" "ac_cv_header_curl_curl_h" "$ac_includes_default"
+if test "x$ac_cv_header_curl_curl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_CURL_CURL_H 1
+_ACEOF
+
+else
+ unset ROS3_VFD
+fi
+
+done
+
+ for ac_header in openssl/evp.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_evp_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_OPENSSL_EVP_H 1
+_ACEOF
+
+else
+ unset ROS3_VFD
+fi
+
+done
+
+ for ac_header in openssl/hmac.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "openssl/hmac.h" "ac_cv_header_openssl_hmac_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_hmac_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_OPENSSL_HMAC_H 1
+_ACEOF
+
+else
+ unset ROS3_VFD
+fi
+
+done
+
+ for ac_header in openssl/sha.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_sha_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_OPENSSL_SHA_H 1
+_ACEOF
+
+else
+ unset ROS3_VFD
+fi
+
+done
+
+ if test "X$ROS3_VFD" = "Xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_global_init in -lcurl" >&5
+$as_echo_n "checking for curl_global_init in -lcurl... " >&6; }
+if ${ac_cv_lib_curl_curl_global_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcurl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char curl_global_init ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+return curl_global_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_curl_curl_global_init=yes
+else
+ ac_cv_lib_curl_curl_global_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curl_curl_global_init" >&5
+$as_echo "$ac_cv_lib_curl_curl_global_init" >&6; }
+if test "x$ac_cv_lib_curl_curl_global_init" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCURL 1
+_ACEOF
+
+ LIBS="-lcurl $LIBS"
+
+else
+ unset ROS3_VFD
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha256 in -lcrypto" >&5
+$as_echo_n "checking for EVP_sha256 in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_EVP_sha256+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char EVP_sha256 ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+return EVP_sha256 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_EVP_sha256=yes
+else
+ ac_cv_lib_crypto_EVP_sha256=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha256" >&5
+$as_echo "$ac_cv_lib_crypto_EVP_sha256" >&6; }
+if test "x$ac_cv_lib_crypto_EVP_sha256" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCRYPTO 1
+_ACEOF
+
+ LIBS="-lcrypto $LIBS"
+
+else
+ unset ROS3_VFD
+fi
+
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the Read-Only S3 virtual file driver (VFD) is enabled" >&5
+$as_echo_n "checking if the Read-Only S3 virtual file driver (VFD) is enabled... " >&6; }
+ if test "X$ROS3_VFD" = "Xyes"; then
+
+$as_echo "#define HAVE_ROS3_VFD 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ROS3_VFD=no
+ as_fn_error $? "The Read-Only S3 VFD was requested but cannot be built.
+ Please check that openssl and cURL are available on your
+ system, and/or re-configure without option
+ --enable-ros3-vfd." "$LINENO" 5
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the Read-Only S3 virtual file driver (VFD) is enabled" >&5
+$as_echo_n "checking if the Read-Only S3 virtual file driver (VFD) is enabled... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ROS3_VFD=no
+
+fi
+
+## Read-only S3 files are not built if not required.
+ if test "X$ROS3_VFD" = "Xyes"; then
+ ROS3_VFD_CONDITIONAL_TRUE=
+ ROS3_VFD_CONDITIONAL_FALSE='#'
+else
+ ROS3_VFD_CONDITIONAL_TRUE='#'
+ ROS3_VFD_CONDITIONAL_FALSE=
+fi
+
+
+
+## ----------------------------------------------------------------------
+## Is libhdfs (Hadoop Distributed File System) present?
+## It might be specified with the `--with-libhdfs' command-line switch.
+## If found, enables the HDFS VFD.
+##
+
+
+# Check whether --with-libhdfs was given.
+if test "${with_libhdfs+set}" = set; then :
+ withval=$with_libhdfs;
+else
+ withval=no
+fi
+
+
+case $withval in
+ no)
+ HAVE_LIBHDFS="no"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhdfs" >&5
+$as_echo_n "checking for libhdfs... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+ ;;
+ *)
+ HAVE_LIBHDFS="yes"
+ case "$withval" in
+ *,*)
+ libhdfs_inc="`echo $withval |cut -f1 -d,`"
+ libhdfs_lib="`echo $withval |cut -f2 -d, -s`"
+ ;;
+ yes)
+ libhdfs_inc="$HADOOP_HOME/include"
+ libhdfs_lib="$HADOOP_HOME/lib"
+ ;;
+ *)
+ if test -n "$withval"; then
+ libhdfs_inc="$withval/include"
+ libhdfs_lib="$withval/lib"
+ fi
+ ;;
+ esac
+
+ if test -n "$libhdfs_inc"; then
+ CPPFLAGS="$CPPFLAGS -I$libhdfs_inc"
+ AM_CPPFLAGS="$AM_CPPFLAGS -I$libhdfs_inc"
+ fi
+ for ac_header in hdfs.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "hdfs.h" "ac_cv_header_hdfs_h" "$ac_includes_default"
+if test "x$ac_cv_header_hdfs_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_HDFS_H 1
+_ACEOF
+
+else
+ unset HAVE_LIBHDFS
+fi
+
+done
+
+
+ if test "x$HAVE_LIBHDFS" = "xyes"; then
+ JNI_LDFLAGS=""
+ if test $JAVA_HOME != ""
+ then
+ JNI_LDFLAGS="-L$JAVA_HOME/jre/lib/$OS_ARCH -L$JAVA_HOME/jre/lib/$OS_ARCH/server"
+ fi
+ ldflags_bak=$LDFLAGS
+ LDFLAGS="$LDFLAGS $JNI_LDFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JNI_GetCreatedJavaVMs in -ljvm" >&5
+$as_echo_n "checking for JNI_GetCreatedJavaVMs in -ljvm... " >&6; }
+if ${ac_cv_lib_jvm_JNI_GetCreatedJavaVMs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ljvm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char JNI_GetCreatedJavaVMs ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+return JNI_GetCreatedJavaVMs ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_jvm_JNI_GetCreatedJavaVMs=yes
+else
+ ac_cv_lib_jvm_JNI_GetCreatedJavaVMs=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jvm_JNI_GetCreatedJavaVMs" >&5
+$as_echo "$ac_cv_lib_jvm_JNI_GetCreatedJavaVMs" >&6; }
+if test "x$ac_cv_lib_jvm_JNI_GetCreatedJavaVMs" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBJVM 1
+_ACEOF
+
+ LIBS="-ljvm $LIBS"
+
+fi
+
+ LDFLAGS=$ldflags_bak
+
+ if test -n "$libhdfs_lib"; then
+ ## Hadoop distribution hides libraries down one level in 'lib/native'
+ libhdfs_lib="$libhdfs_lib/native"
+ LDFLAGS="$LDFLAGS -L$libhdfs_lib $JNI_LDFLAGS"
+ AM_LDFLAGS="$AM_LDFLAGS -L$libhdfs_lib $JNI_LDFLAGS"
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hdfsConnect in -lhdfs" >&5
+$as_echo_n "checking for hdfsConnect in -lhdfs... " >&6; }
+if ${ac_cv_lib_hdfs_hdfsConnect+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lhdfs $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char hdfsConnect ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+return hdfsConnect ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_hdfs_hdfsConnect=yes
+else
+ ac_cv_lib_hdfs_hdfsConnect=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdfs_hdfsConnect" >&5
+$as_echo "$ac_cv_lib_hdfs_hdfsConnect" >&6; }
+if test "x$ac_cv_lib_hdfs_hdfsConnect" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBHDFS 1
+_ACEOF
+
+ LIBS="-lhdfs $LIBS"
+
+else
+ unset HAVE_LIBHDFS
+fi
+
+ fi
+
+ if test -z "$HAVE_LIBHDFS"; then
+ as_fn_error $? "Set to use libhdfs library, but could not find or use
+ libhdfs. Please verify that the path to HADOOP_HOME is
+ valid, and/or reconfigure without --with-libhdfs." "$LINENO" 5
+ fi
+ ;;
+esac
+
+if test "x$HAVE_LIBHDFS" = "xyes"; then
+
+$as_echo "#define HAVE_LIBHDFS 1" >>confdefs.h
+
+fi
+
+## Checkpoint the cache
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+## ----------------------------------------------------------------------
## Enable custom plugin default path for library. It requires SHARED support.
##
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for custom plugin default path definition" >&5
@@ -30973,7 +31413,7 @@ else
BUILD_CXX_CONDITIONAL_FALSE=
fi
- if test -n "$TESTPARALLEL"; then
+ if test "X$PARALLEL" = "Xyes"; then
BUILD_PARALLEL_CONDITIONAL_TRUE=
BUILD_PARALLEL_CONDITIONAL_FALSE='#'
else
@@ -31005,6 +31445,29 @@ else
BUILD_HDF5_HL_CONDITIONAL_FALSE=
fi
+ if test "X$HDF5_TESTS" = "Xyes"; then
+ BUILD_TESTS_CONDITIONAL_TRUE=
+ BUILD_TESTS_CONDITIONAL_FALSE='#'
+else
+ BUILD_TESTS_CONDITIONAL_TRUE='#'
+ BUILD_TESTS_CONDITIONAL_FALSE=
+fi
+
+ if test -n "$TESTPARALLEL"; then
+ BUILD_TESTS_PARALLEL_CONDITIONAL_TRUE=
+ BUILD_TESTS_PARALLEL_CONDITIONAL_FALSE='#'
+else
+ BUILD_TESTS_PARALLEL_CONDITIONAL_TRUE='#'
+ BUILD_TESTS_PARALLEL_CONDITIONAL_FALSE=
+fi
+
+ if test "X$HDF5_TOOLS" = "Xyes"; then
+ BUILD_TOOLS_CONDITIONAL_TRUE=
+ BUILD_TOOLS_CONDITIONAL_FALSE='#'
+else
+ BUILD_TOOLS_CONDITIONAL_TRUE='#'
+ BUILD_TOOLS_CONDITIONAL_FALSE=
+fi
## ----------------------------------------------------------------------
@@ -31447,7 +31910,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-HDF5 config.lt 1.10.5
+HDF5 config.lt 1.10.6
configured by $0, generated by GNU Autoconf 2.69.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -32906,7 +33369,7 @@ else
fi
-ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/H5srcdir_str.h test/testabort_fail.sh test/testcheck_version.sh test/testerror.sh test/testflushrefresh.sh test/testlibinfo.sh test/testlinks_env.sh test/testswmr.sh test/testvdsswmr.sh test/test_filter_plugin.sh test/test_usecases.sh testpar/Makefile testpar/testpflush.sh tools/Makefile tools/lib/Makefile tools/src/Makefile tools/src/h5dump/Makefile tools/src/h5import/Makefile tools/src/h5diff/Makefile tools/src/h5jam/Makefile tools/src/h5repack/Makefile tools/src/h5ls/Makefile tools/src/h5copy/Makefile tools/src/misc/Makefile tools/src/misc/h5cc tools/src/h5stat/Makefile tools/test/Makefile tools/test/h5dump/Makefile tools/test/h5dump/h5dump_plugin.sh tools/test/h5dump/testh5dump.sh tools/test/h5dump/testh5dumppbits.sh tools/test/h5dump/testh5dumpvds.sh tools/test/h5dump/testh5dumpxml.sh tools/test/h5ls/Makefile tools/test/h5ls/h5ls_plugin.sh tools/test/h5ls/testh5ls.sh tools/test/h5ls/testh5lsvds.sh tools/test/h5import/Makefile tools/test/h5import/h5importtestutil.sh tools/test/h5diff/Makefile tools/test/h5diff/h5diff_plugin.sh tools/test/h5diff/testh5diff.sh tools/test/h5diff/testph5diff.sh tools/src/h5format_convert/Makefile tools/test/h5format_convert/Makefile tools/test/h5format_convert/testh5fc.sh tools/test/h5jam/Makefile tools/test/h5jam/testh5jam.sh tools/test/h5repack/Makefile tools/test/h5repack/h5repack.sh tools/test/h5repack/h5repack_plugin.sh tools/test/h5copy/Makefile tools/test/h5copy/testh5copy.sh tools/test/misc/Makefile tools/test/misc/testh5clear.sh tools/test/misc/testh5mkgrp.sh tools/test/misc/testh5repart.sh tools/test/misc/vds/Makefile tools/test/h5stat/Makefile tools/test/h5stat/testh5stat.sh tools/test/perform/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/src/H5fort_type_defines.h fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh java/Makefile java/src/Makefile java/src/jni/Makefile java/test/Makefile java/test/junit.sh java/examples/Makefile java/examples/intro/Makefile java/examples/intro/JavaIntroExample.sh java/examples/datasets/Makefile java/examples/datasets/JavaDatasetExample.sh java/examples/datatypes/Makefile java/examples/datatypes/JavaDatatypeExample.sh java/examples/groups/Makefile java/examples/groups/JavaGroupExample.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/tools/h5watch/Makefile hl/tools/h5watch/testh5watch.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh"
+ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/H5srcdir_str.h test/testabort_fail.sh test/testcheck_version.sh test/testerror.sh test/testexternal_env.sh test/testflushrefresh.sh test/testlibinfo.sh test/testlinks_env.sh test/testswmr.sh test/testvds_env.sh test/testvdsswmr.sh test/test_filter_plugin.sh test/test_usecases.sh testpar/Makefile testpar/testpflush.sh tools/Makefile tools/lib/Makefile tools/libtest/Makefile tools/src/Makefile tools/src/h5dump/Makefile tools/src/h5import/Makefile tools/src/h5diff/Makefile tools/src/h5jam/Makefile tools/src/h5repack/Makefile tools/src/h5ls/Makefile tools/src/h5copy/Makefile tools/src/misc/Makefile tools/src/h5stat/Makefile tools/test/Makefile tools/test/h5dump/Makefile tools/test/h5dump/h5dump_plugin.sh tools/test/h5dump/testh5dump.sh tools/test/h5dump/testh5dumppbits.sh tools/test/h5dump/testh5dumpvds.sh tools/test/h5dump/testh5dumpxml.sh tools/test/h5ls/Makefile tools/test/h5ls/h5ls_plugin.sh tools/test/h5ls/testh5ls.sh tools/test/h5ls/testh5lsvds.sh tools/test/h5import/Makefile tools/test/h5import/h5importtestutil.sh tools/test/h5diff/Makefile tools/test/h5diff/h5diff_plugin.sh tools/test/h5diff/testh5diff.sh tools/test/h5diff/testph5diff.sh tools/src/h5format_convert/Makefile tools/test/h5format_convert/Makefile tools/test/h5format_convert/testh5fc.sh tools/test/h5jam/Makefile tools/test/h5jam/testh5jam.sh tools/test/h5repack/Makefile tools/test/h5repack/h5repack.sh tools/test/h5repack/h5repack_plugin.sh tools/test/h5copy/Makefile tools/test/h5copy/testh5copy.sh tools/test/misc/Makefile tools/test/misc/testh5clear.sh tools/test/misc/testh5mkgrp.sh tools/test/misc/testh5repart.sh tools/test/misc/vds/Makefile tools/test/h5stat/Makefile tools/test/h5stat/testh5stat.sh tools/test/perform/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh bin/h5cc bin/Makefile c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/src/H5fort_type_defines.h fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh java/Makefile java/src/Makefile java/src/jni/Makefile java/test/Makefile java/test/junit.sh java/examples/Makefile java/examples/intro/Makefile java/examples/intro/JavaIntroExample.sh java/examples/datasets/Makefile java/examples/datasets/JavaDatasetExample.sh java/examples/datatypes/Makefile java/examples/datatypes/JavaDatatypeExample.sh java/examples/groups/Makefile java/examples/groups/JavaGroupExample.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/tools/h5watch/Makefile hl/tools/h5watch/testh5watch.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh"
ac_config_commands="$ac_config_commands .classes"
@@ -33070,6 +33533,10 @@ if test -z "${DIRECT_VFD_CONDITIONAL_TRUE}" && test -z "${DIRECT_VFD_CONDITIONAL
as_fn_error $? "conditional \"DIRECT_VFD_CONDITIONAL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${ROS3_VFD_CONDITIONAL_TRUE}" && test -z "${ROS3_VFD_CONDITIONAL_FALSE}"; then
+ as_fn_error $? "conditional \"ROS3_VFD_CONDITIONAL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${BUILD_ALL_CONDITIONAL_TRUE}" && test -z "${BUILD_ALL_CONDITIONAL_FALSE}"; then
as_fn_error $? "conditional \"BUILD_ALL_CONDITIONAL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -33094,6 +33561,18 @@ if test -z "${BUILD_HDF5_HL_CONDITIONAL_TRUE}" && test -z "${BUILD_HDF5_HL_CONDI
as_fn_error $? "conditional \"BUILD_HDF5_HL_CONDITIONAL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${BUILD_TESTS_CONDITIONAL_TRUE}" && test -z "${BUILD_TESTS_CONDITIONAL_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_TESTS_CONDITIONAL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_TESTS_PARALLEL_CONDITIONAL_TRUE}" && test -z "${BUILD_TESTS_PARALLEL_CONDITIONAL_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_TESTS_PARALLEL_CONDITIONAL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_TOOLS_CONDITIONAL_TRUE}" && test -z "${BUILD_TOOLS_CONDITIONAL_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_TOOLS_CONDITIONAL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${HAVE_SHARED_CONDITIONAL_TRUE}" && test -z "${HAVE_SHARED_CONDITIONAL_FALSE}"; then
as_fn_error $? "conditional \"HAVE_SHARED_CONDITIONAL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -33495,7 +33974,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by HDF5 $as_me 1.10.5, which was
+This file was extended by HDF5 $as_me 1.10.6, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -33561,7 +34040,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-HDF5 config.status 1.10.5
+HDF5 config.status 1.10.6
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -34177,10 +34656,12 @@ do
"test/testabort_fail.sh") CONFIG_FILES="$CONFIG_FILES test/testabort_fail.sh" ;;
"test/testcheck_version.sh") CONFIG_FILES="$CONFIG_FILES test/testcheck_version.sh" ;;
"test/testerror.sh") CONFIG_FILES="$CONFIG_FILES test/testerror.sh" ;;
+ "test/testexternal_env.sh") CONFIG_FILES="$CONFIG_FILES test/testexternal_env.sh" ;;
"test/testflushrefresh.sh") CONFIG_FILES="$CONFIG_FILES test/testflushrefresh.sh" ;;
"test/testlibinfo.sh") CONFIG_FILES="$CONFIG_FILES test/testlibinfo.sh" ;;
"test/testlinks_env.sh") CONFIG_FILES="$CONFIG_FILES test/testlinks_env.sh" ;;
"test/testswmr.sh") CONFIG_FILES="$CONFIG_FILES test/testswmr.sh" ;;
+ "test/testvds_env.sh") CONFIG_FILES="$CONFIG_FILES test/testvds_env.sh" ;;
"test/testvdsswmr.sh") CONFIG_FILES="$CONFIG_FILES test/testvdsswmr.sh" ;;
"test/test_filter_plugin.sh") CONFIG_FILES="$CONFIG_FILES test/test_filter_plugin.sh" ;;
"test/test_usecases.sh") CONFIG_FILES="$CONFIG_FILES test/test_usecases.sh" ;;
@@ -34188,6 +34669,7 @@ do
"testpar/testpflush.sh") CONFIG_FILES="$CONFIG_FILES testpar/testpflush.sh" ;;
"tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
"tools/lib/Makefile") CONFIG_FILES="$CONFIG_FILES tools/lib/Makefile" ;;
+ "tools/libtest/Makefile") CONFIG_FILES="$CONFIG_FILES tools/libtest/Makefile" ;;
"tools/src/Makefile") CONFIG_FILES="$CONFIG_FILES tools/src/Makefile" ;;
"tools/src/h5dump/Makefile") CONFIG_FILES="$CONFIG_FILES tools/src/h5dump/Makefile" ;;
"tools/src/h5import/Makefile") CONFIG_FILES="$CONFIG_FILES tools/src/h5import/Makefile" ;;
@@ -34197,7 +34679,6 @@ do
"tools/src/h5ls/Makefile") CONFIG_FILES="$CONFIG_FILES tools/src/h5ls/Makefile" ;;
"tools/src/h5copy/Makefile") CONFIG_FILES="$CONFIG_FILES tools/src/h5copy/Makefile" ;;
"tools/src/misc/Makefile") CONFIG_FILES="$CONFIG_FILES tools/src/misc/Makefile" ;;
- "tools/src/misc/h5cc") CONFIG_FILES="$CONFIG_FILES tools/src/misc/h5cc" ;;
"tools/src/h5stat/Makefile") CONFIG_FILES="$CONFIG_FILES tools/src/h5stat/Makefile" ;;
"tools/test/Makefile") CONFIG_FILES="$CONFIG_FILES tools/test/Makefile" ;;
"tools/test/h5dump/Makefile") CONFIG_FILES="$CONFIG_FILES tools/test/h5dump/Makefile" ;;
@@ -34237,6 +34718,8 @@ do
"examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
"examples/run-c-ex.sh") CONFIG_FILES="$CONFIG_FILES examples/run-c-ex.sh" ;;
"examples/testh5cc.sh") CONFIG_FILES="$CONFIG_FILES examples/testh5cc.sh" ;;
+ "bin/h5cc") CONFIG_FILES="$CONFIG_FILES bin/h5cc" ;;
+ "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
"c++/Makefile") CONFIG_FILES="$CONFIG_FILES c++/Makefile" ;;
"c++/src/Makefile") CONFIG_FILES="$CONFIG_FILES c++/src/Makefile" ;;
"c++/src/h5c++") CONFIG_FILES="$CONFIG_FILES c++/src/h5c++" ;;
@@ -35898,7 +36381,7 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-chmod 755 tools/src/misc/h5cc
+chmod 755 bin/h5cc
if test "X$HDF_CXX" = "Xyes"; then
chmod 755 c++/src/h5c++
fi
diff --git a/configure.ac b/configure.ac
index 7246485..c076104 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,7 +24,7 @@ AC_PREREQ([2.69])
## NOTE: Do not forget to change the version number here when we do a
## release!!!
##
-AC_INIT([HDF5], [1.10.5], [help@hdfgroup.org])
+AC_INIT([HDF5], [1.10.6], [help@hdfgroup.org])
AC_CONFIG_SRCDIR([src/H5.c])
AC_CONFIG_HEADERS([src/H5config.h])
@@ -564,7 +564,6 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
AC_SUBST([HAVE_Fortran_INTEGER_SIZEOF_16])
AC_SUBST([FORTRAN_HAVE_C_LONG_DOUBLE])
AC_SUBST([FORTRAN_C_LONG_DOUBLE_IS_UNIQUE])
- AC_SUBST([FORTRAN_SIZEOF_LONG_DOUBLE])
AC_SUBST([H5CONFIG_F_NUM_RKIND])
AC_SUBST([H5CONFIG_F_RKIND])
AC_SUBST([H5CONFIG_F_RKIND_SIZEOF])
@@ -944,6 +943,48 @@ fi
AM_CONDITIONAL([FORTRAN_SHARED_CONDITIONAL], [test "X$H5_FORTRAN_SHARED" = "Xyes"])
## ----------------------------------------------------------------------
+## Check if they would like to disable building tests
+##
+
+## This needs to be exposed for the library info file.
+AC_SUBST([HDF5_TESTS])
+
+## Default is to build tests
+HDF5_TESTS=yes
+
+AC_MSG_CHECKING([if building tests is disabled])
+
+AC_ARG_ENABLE([tests],
+ [AS_HELP_STRING([--enable-tests],
+ [Compile the HDF5 tests [default=yes]])],
+ [HDF5_TESTS=$enableval])
+
+if test "X$HDF5_TESTS" = "Xno"; then
+ echo "Building HDF5 tests is disabled"
+fi
+
+## ----------------------------------------------------------------------
+## Check if they would like to disable building tools
+##
+
+## This needs to be exposed for the library info file.
+AC_SUBST([HDF5_TOOLS])
+
+## Default is to build tests and tools
+HDF5_TOOLS=yes
+
+AC_MSG_CHECKING([if building tools is disabled])
+
+AC_ARG_ENABLE([tools],
+ [AS_HELP_STRING([--enable-tools],
+ [Compile the HDF5 tools [default=yes]])],
+ [HDF5_TOOLS=$enableval])
+
+if test "X$HDF5_TOOLS" = "Xno"; then
+ echo "Building HDF5 tools is disabled"
+fi
+
+## ----------------------------------------------------------------------
## Create libtool. If shared/static libraries are going to be enabled
## or disabled, it should happen before these macros.
LT_PREREQ([2.2])
@@ -2512,8 +2553,10 @@ AC_SUBST([PARALLEL_FILTERED_WRITES])
AC_SUBST([LARGE_PARALLEL_IO])
if test -n "$PARALLEL"; then
- ## The 'testpar' directory should participate in the build
- TESTPARALLEL=testpar
+ if test "X$HDF5_TESTS" = "Xyes"; then
+ ## The 'testpar' directory should participate in the build
+ TESTPARALLEL=testpar
+ fi
## We are building a parallel library
AC_DEFINE([HAVE_PARALLEL], [1], [Define if we have parallel support])
@@ -2766,6 +2809,135 @@ fi
AM_CONDITIONAL([DIRECT_VFD_CONDITIONAL], [test "X$DIRECT_VFD" = "Xyes"])
## ----------------------------------------------------------------------
+## Check if Read-Only S3 virtual file driver is enabled by --enable-ros3-vfd
+##
+AC_SUBST([ROS3_VFD])
+
+## Default is no Read-Only S3 VFD
+ROS3_VFD=no
+
+AC_ARG_ENABLE([ros3-vfd],
+ [AS_HELP_STRING([--enable-ros3-vfd],
+ [Build the Read-Only S3 virtual file driver (VFD).
+ [default=no]])],
+ [ROS3_VFD=$enableval], [ROS3_VFD=no])
+
+if test "X$ROS3_VFD" = "Xyes"; then
+ AC_CHECK_HEADERS([curl/curl.h],, [unset ROS3_VFD])
+ AC_CHECK_HEADERS([openssl/evp.h],, [unset ROS3_VFD])
+ AC_CHECK_HEADERS([openssl/hmac.h],, [unset ROS3_VFD])
+ AC_CHECK_HEADERS([openssl/sha.h],, [unset ROS3_VFD])
+ if test "X$ROS3_VFD" = "Xyes"; then
+ AC_CHECK_LIB([curl], [curl_global_init],, [unset ROS3_VFD])
+ AC_CHECK_LIB([crypto], [EVP_sha256],, [unset ROS3_VFD])
+ fi
+
+ AC_MSG_CHECKING([if the Read-Only S3 virtual file driver (VFD) is enabled])
+ if test "X$ROS3_VFD" = "Xyes"; then
+ AC_DEFINE([HAVE_ROS3_VFD], [1],
+ [Define whether the Read-Only S3 virtual file driver (VFD) should be compiled])
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ ROS3_VFD=no
+ AC_MSG_ERROR([The Read-Only S3 VFD was requested but cannot be built.
+ Please check that openssl and cURL are available on your
+ system, and/or re-configure without option
+ --enable-ros3-vfd.])
+ fi
+else
+ AC_MSG_CHECKING([if the Read-Only S3 virtual file driver (VFD) is enabled])
+ AC_MSG_RESULT([no])
+ ROS3_VFD=no
+
+fi
+
+## Read-only S3 files are not built if not required.
+AM_CONDITIONAL([ROS3_VFD_CONDITIONAL], [test "X$ROS3_VFD" = "Xyes"])
+
+
+## ----------------------------------------------------------------------
+## Is libhdfs (Hadoop Distributed File System) present?
+## It might be specified with the `--with-libhdfs' command-line switch.
+## If found, enables the HDFS VFD.
+##
+AC_SUBST([HAVE_LIBHDFS])
+AC_ARG_WITH([libhdfs],
+ [AS_HELP_STRING([--with-libhdfs=DIR],
+ [Provide libhdfs library to enable HDFS virtual file driver (VFD) [default=no]])],,
+ [withval=no])
+
+case $withval in
+ no)
+ HAVE_LIBHDFS="no"
+ AC_MSG_CHECKING([for libhdfs])
+ AC_MSG_RESULT([suppressed])
+ ;;
+ *)
+ HAVE_LIBHDFS="yes"
+ case "$withval" in
+ *,*)
+ libhdfs_inc="`echo $withval |cut -f1 -d,`"
+ libhdfs_lib="`echo $withval |cut -f2 -d, -s`"
+ ;;
+ yes)
+ libhdfs_inc="$HADOOP_HOME/include"
+ libhdfs_lib="$HADOOP_HOME/lib"
+ ;;
+ *)
+ if test -n "$withval"; then
+ libhdfs_inc="$withval/include"
+ libhdfs_lib="$withval/lib"
+ fi
+ ;;
+ esac
+
+ if test -n "$libhdfs_inc"; then
+ CPPFLAGS="$CPPFLAGS -I$libhdfs_inc"
+ AM_CPPFLAGS="$AM_CPPFLAGS -I$libhdfs_inc"
+ fi
+ AC_CHECK_HEADERS([hdfs.h],,
+ [unset HAVE_LIBHDFS])
+
+ if test "x$HAVE_LIBHDFS" = "xyes"; then
+ dnl Check for '-ljvm' needed by libhdfs
+ JNI_LDFLAGS=""
+ if test $JAVA_HOME != ""
+ then
+ JNI_LDFLAGS="-L$JAVA_HOME/jre/lib/$OS_ARCH -L$JAVA_HOME/jre/lib/$OS_ARCH/server"
+ fi
+ ldflags_bak=$LDFLAGS
+ LDFLAGS="$LDFLAGS $JNI_LDFLAGS"
+ AC_CHECK_LIB([jvm], [JNI_GetCreatedJavaVMs])
+ LDFLAGS=$ldflags_bak
+ AC_SUBST([JNI_LDFLAGS])
+ if test -n "$libhdfs_lib"; then
+ ## Hadoop distribution hides libraries down one level in 'lib/native'
+ libhdfs_lib="$libhdfs_lib/native"
+ LDFLAGS="$LDFLAGS -L$libhdfs_lib $JNI_LDFLAGS"
+ AM_LDFLAGS="$AM_LDFLAGS -L$libhdfs_lib $JNI_LDFLAGS"
+ fi
+ AC_CHECK_LIB([hdfs], [hdfsConnect],,
+ [unset HAVE_LIBHDFS])
+ fi
+
+ if test -z "$HAVE_LIBHDFS"; then
+ AC_MSG_ERROR([Set to use libhdfs library, but could not find or use
+ libhdfs. Please verify that the path to HADOOP_HOME is
+ valid, and/or reconfigure without --with-libhdfs.])
+ fi
+ ;;
+esac
+
+if test "x$HAVE_LIBHDFS" = "xyes"; then
+ AC_DEFINE([HAVE_LIBHDFS], [1],
+ [Proceed to build with libhdfs])
+fi
+
+## Checkpoint the cache
+AC_CACHE_SAVE
+
+## ----------------------------------------------------------------------
## Enable custom plugin default path for library. It requires SHARED support.
##
AC_MSG_CHECKING([for custom plugin default path definition])
@@ -3357,11 +3529,13 @@ LDFLAGS="$saved_user_LDFLAGS"
## need to be compiled
AM_CONDITIONAL([BUILD_CXX_CONDITIONAL], [test "X$HDF_CXX" = "Xyes"])
-AM_CONDITIONAL([BUILD_PARALLEL_CONDITIONAL], [test -n "$TESTPARALLEL"])
+AM_CONDITIONAL([BUILD_PARALLEL_CONDITIONAL], [test "X$PARALLEL" = "Xyes"])
AM_CONDITIONAL([BUILD_FORTRAN_CONDITIONAL], [test "X$HDF_FORTRAN" = "Xyes"])
AM_CONDITIONAL([BUILD_JAVA_CONDITIONAL], [test "X$HDF_JAVA" = "Xyes"])
AM_CONDITIONAL([BUILD_HDF5_HL_CONDITIONAL], [test "X$HDF5_HL" = "Xyes"])
-
+AM_CONDITIONAL([BUILD_TESTS_CONDITIONAL], [test "X$HDF5_TESTS" = "Xyes"])
+AM_CONDITIONAL([BUILD_TESTS_PARALLEL_CONDITIONAL], [test -n "$TESTPARALLEL"])
+AM_CONDITIONAL([BUILD_TOOLS_CONDITIONAL], [test "X$HDF5_TOOLS" = "Xyes"])
## ----------------------------------------------------------------------
## Build the Makefiles.
@@ -3473,10 +3647,12 @@ AC_CONFIG_FILES([src/libhdf5.settings
test/testabort_fail.sh
test/testcheck_version.sh
test/testerror.sh
+ test/testexternal_env.sh
test/testflushrefresh.sh
test/testlibinfo.sh
test/testlinks_env.sh
test/testswmr.sh
+ test/testvds_env.sh
test/testvdsswmr.sh
test/test_filter_plugin.sh
test/test_usecases.sh
@@ -3484,6 +3660,7 @@ AC_CONFIG_FILES([src/libhdf5.settings
testpar/testpflush.sh
tools/Makefile
tools/lib/Makefile
+ tools/libtest/Makefile
tools/src/Makefile
tools/src/h5dump/Makefile
tools/src/h5import/Makefile
@@ -3493,7 +3670,6 @@ AC_CONFIG_FILES([src/libhdf5.settings
tools/src/h5ls/Makefile
tools/src/h5copy/Makefile
tools/src/misc/Makefile
- tools/src/misc/h5cc
tools/src/h5stat/Makefile
tools/test/Makefile
tools/test/h5dump/Makefile
@@ -3533,6 +3709,8 @@ AC_CONFIG_FILES([src/libhdf5.settings
examples/Makefile
examples/run-c-ex.sh
examples/testh5cc.sh
+ bin/h5cc
+ bin/Makefile
c++/Makefile
c++/src/Makefile
c++/src/h5c++
@@ -3595,7 +3773,7 @@ AC_CONFIG_COMMANDS([.classes], [], [$MKDIR_P java/src/.classes;
AC_OUTPUT
-chmod 755 tools/src/misc/h5cc
+chmod 755 bin/h5cc
if test "X$HDF_CXX" = "Xyes"; then
chmod 755 c++/src/h5c++
fi
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 2239d64..6e1f79d 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -41,32 +41,28 @@ set (examples
foreach (example ${examples})
add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c)
- target_include_directories(${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${example} STATIC)
- target_link_libraries (${example} PRIVATE ${HDF5_LIB_TARGET})
- set_target_properties (${example} PROPERTIES FOLDER examples)
- if (BUILD_SHARED_LIBS)
- add_executable (${example}-shared ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c)
- target_include_directories(${example}-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${example}-shared SHARED)
- target_link_libraries (${example}-shared PRIVATE ${HDF5_LIBSH_TARGET})
- set_target_properties (${example}-shared PROPERTIES FOLDER examples)
+ target_include_directories (${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (${example} STATIC)
+ target_link_libraries (${example} PRIVATE ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (${example} SHARED)
+ target_link_libraries (${example} PRIVATE ${HDF5_LIBSH_TARGET})
endif ()
+ set_target_properties (${example} PROPERTIES FOLDER examples)
endforeach ()
if (H5_HAVE_PARALLEL)
add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
- target_include_directories(ph5example PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (ph5example STATIC)
- target_link_libraries (ph5example PRIVATE ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES})
- set_target_properties (ph5example PROPERTIES FOLDER examples)
- if (BUILD_SHARED_LIBS)
- add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
- target_include_directories(ph5example-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (ph5example-shared SHARED)
- target_link_libraries (ph5example-shared PRIVATE ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES})
- set_target_properties (ph5example-shared PROPERTIES FOLDER examples)
+ target_include_directories (ph5example PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (ph5example STATIC)
+ target_link_libraries (ph5example PRIVATE ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES})
+ else ()
+ TARGET_C_PROPERTIES (ph5example SHARED)
+ target_link_libraries (ph5example PRIVATE ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES})
endif ()
+ set_target_properties (ph5example PROPERTIES FOLDER examples)
endif ()
if (BUILD_TESTING)
diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake
index cb47c78..ea3b2c5 100644
--- a/examples/CMakeTests.cmake
+++ b/examples/CMakeTests.cmake
@@ -15,208 +15,103 @@
### T E S T I N G ###
##############################################################################
##############################################################################
- file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/red ${PROJECT_BINARY_DIR}/blue ${PROJECT_BINARY_DIR}/u2w)
- if (BUILD_SHARED_LIBS)
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5EX-shared")
- file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared/red ${PROJECT_BINARY_DIR}/H5EX-shared/blue ${PROJECT_BINARY_DIR}/H5EX-shared/u2w)
- endif ()
+file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/red ${PROJECT_BINARY_DIR}/blue ${PROJECT_BINARY_DIR}/u2w)
- # Remove any output file left over from previous test run
- add_test (
- NAME EXAMPLES-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- Attributes.h5
- btrees_file.h5
- cmprss.h5
- default_file.h5
- dset.h5
- extend.h5
- extlink_prefix_source.h5
- extlink_source.h5
- extlink_target.h5
- group.h5
- groups.h5
- hard_link.h5
- mount1.h5
- mount2.h5
- one_index_file.h5
- only_dspaces_and_attrs_file.h5
- only_huge_mesgs_file.h5
- REF_REG.h5
- refere.h5
- SDS.h5
- SDScompound.h5
- SDSextendible.h5
- Select.h5
- separate_indexes_file.h5
- small_lists_file.h5
- soft_link.h5
- subset.h5
- unix2win.h5
- blue/prefix_target.h5
- red/prefix_target.h5
- u2w/u2w_target.h5
- vds.h5
- vds-exc.h5
- vds-excalibur.h5
- vds-exclim.h5
- vds-percival.h5
- vds-percival-unlim.h5
- vds-percival-unlim-maxmin.h5
- a.h5
- b.h5
- c.h5
- d.h5
- vds-simpleIO.h5
- vds-eiger.h5
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "EXAMPLES-clear-objects")
+set (test_ex_CLEANFILES
+ Attributes.h5
+ btrees_file.h5
+ cmprss.h5
+ default_file.h5
+ dset.h5
+ extend.h5
+ extlink_prefix_source.h5
+ extlink_source.h5
+ extlink_target.h5
+ group.h5
+ groups.h5
+ hard_link.h5
+ mount1.h5
+ mount2.h5
+ one_index_file.h5
+ only_dspaces_and_attrs_file.h5
+ only_huge_mesgs_file.h5
+ REF_REG.h5
+ refere.h5
+ SDS.h5
+ SDScompound.h5
+ SDSextendible.h5
+ Select.h5
+ separate_indexes_file.h5
+ small_lists_file.h5
+ soft_link.h5
+ subset.h5
+ unix2win.h5
+ blue/prefix_target.h5
+ red/prefix_target.h5
+ u2w/u2w_target.h5
+ vds.h5
+ vds-exc.h5
+ vds-excalibur.h5
+ vds-exclim.h5
+ vds-percival.h5
+ vds-percival-unlim.h5
+ vds-percival-unlim-maxmin.h5
+ a.h5
+ b.h5
+ c.h5
+ d.h5
+ vds-simpleIO.h5
+ vds-eiger.h5
+)
- foreach (example ${examples})
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME EXAMPLES-${example} COMMAND $<TARGET_FILE:${example}>)
- else ()
- add_test (NAME EXAMPLES-${example} COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${example}>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=${example}.txt"
- #-D "TEST_REFERENCE=${example}.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "EXAMPLES-${example}")
- endforeach ()
+# Remove any output file left over from previous test run
+add_test (
+ NAME EXAMPLES-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_CLEANFILES}
+)
+set_tests_properties (EXAMPLES-clear-objects PROPERTIES FIXTURES_SETUP clear_EXAMPLES)
- if (BUILD_SHARED_LIBS)
- # Remove any output file left over from previous test run
- add_test (
- NAME EXAMPLES-shared-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- Attributes.h5
- btrees_file.h5
- cmprss.h5
- default_file.h5
- dset.h5
- extend.h5
- extlink_prefix_source.h5
- extlink_source.h5
- extlink_target.h5
- group.h5
- groups.h5
- hard_link.h5
- mount1.h5
- mount2.h5
- one_index_file.h5
- only_dspaces_and_attrs_file.h5
- only_huge_mesgs_file.h5
- REF_REG.h5
- refere.h5
- SDS.h5
- SDScompound.h5
- SDSextendible.h5
- Select.h5
- separate_indexes_file.h5
- small_lists_file.h5
- soft_link.h5
- subset.h5
- unix2win.h5
- vds.h5
- vds-exc.h5
- vds-excalibur.h5
- vds-exclim.h5
- vds-percival.h5
- vds-percival-unlim.h5
- vds-percival-unlim-maxmin.h5
- a.h5
- b.h5
- c.h5
- d.h5
- vds-simpleIO.h5
- vds-eiger.h5
- blue/prefix_target.h5
- red/prefix_target.h5
- u2w/u2w_target.h5
- WORKING_DIRECTORY
- ${PROJECT_BINARY_DIR}/H5EX-shared
+foreach (example ${examples})
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME EXAMPLES-${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:${example}>)
+ else ()
+ add_test (NAME EXAMPLES-${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:${example}>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=${example}.txt"
+ #-D "TEST_REFERENCE=${example}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (EXAMPLES-shared-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "EXAMPLES-shared-clear-objects")
-
- foreach (example ${examples})
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME EXAMPLES-shared-${example} COMMAND $<TARGET_FILE:${example}-shared>)
- else ()
- add_test (NAME EXAMPLES-shared-${example} COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${example}>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=${example}.txt"
- #-D "TEST_REFERENCE=${example}.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
- set_tests_properties (EXAMPLES-shared-${example} PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (EXAMPLES-shared-${example} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "EXAMPLES-shared-${example}")
- endforeach ()
endif ()
+ set_tests_properties (EXAMPLES-${example} PROPERTIES FIXTURES_REQUIRED clear_EXAMPLES)
+ if (last_test)
+ set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test})
+ endif ()
+ set (last_test "EXAMPLES-${example}")
+endforeach ()
### Windows pops up a modal permission dialog on this test
- if (H5_HAVE_PARALLEL AND NOT WIN32)
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5example> ${MPIEXEC_POSTFLAGS})
- else ()
- add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5example>;${MPIEXEC_POSTFLAGS}"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_OUTPUT=ph5example.out"
- -D "TEST_REFERENCE:STRING=PHDF5 tests finished with no errors"
- -D "TEST_FILTER:STRING=PHDF5 tests finished with no errors"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
- )
- endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (MPI_TEST_EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "MPI_TEST_EXAMPLES-ph5example")
- if (BUILD_SHARED_LIBS)
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME MPI_TEST_EXAMPLES-shared-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5example-shared> ${MPIEXEC_POSTFLAGS})
- else ()
- add_test (NAME MPI_TEST_EXAMPLES-shared-ph5example COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5example-shared>;${MPIEXEC_POSTFLAGS}"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_OUTPUT=ph5example-shared.out"
- -D "TEST_REFERENCE:STRING=PHDF5 tests finished with no errors"
- -D "TEST_FILTER:STRING=PHDF5 tests finished with no errors"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared"
- -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
- )
- endif ()
- set_tests_properties (MPI_TEST_EXAMPLES-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (MPI_TEST_EXAMPLES-shared-ph5example PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "MPI_TEST_EXAMPLES-shared-ph5example")
- endif ()
+if (H5_HAVE_PARALLEL AND NOT WIN32)
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5example> ${MPIEXEC_POSTFLAGS})
+ else ()
+ add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5example>;${MPIEXEC_POSTFLAGS}"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_OUTPUT=ph5example.out"
+ -D "TEST_REFERENCE:STRING=PHDF5 tests finished with no errors"
+ -D "TEST_FILTER:STRING=PHDF5 tests finished with no errors"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
+ )
+ endif ()
+ if (last_test)
+ set_tests_properties (MPI_TEST_EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test})
endif ()
+ set (last_test "MPI_TEST_EXAMPLES-ph5example")
+endif ()
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 8c6540f..554ee44 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -32,25 +32,25 @@ INSTALL_TOP_FILES = README
# it would try to compile them instead of using the h5cc script.
# Use the boilerplate in config/examples.am instead.
EXAMPLE_PROG = h5_write h5_read h5_extend_write h5_chunk_read h5_compound \
- h5_crtgrpd h5_subset h5_cmprss h5_rdwt h5_crtgrpar h5_extend \
- h5_crtatt h5_crtgrp h5_crtdat \
- h5_group h5_select h5_attribute h5_mount h5_reference h5_drivers \
- h5_ref2reg h5_extlink h5_elink_unix2win h5_shared_mesg h5_vds h5_vds-exc \
- h5_vds-exclim h5_vds-eiger h5_vds-simpleIO h5_vds-percival \
- h5_vds-percival-unlim h5_vds-percival-unlim-maxmin
+ h5_crtgrpd h5_subset h5_cmprss h5_rdwt h5_crtgrpar h5_extend \
+ h5_crtatt h5_crtgrp h5_crtdat \
+ h5_group h5_select h5_attribute h5_mount h5_reference h5_drivers \
+ h5_ref2reg h5_extlink h5_elink_unix2win h5_shared_mesg h5_vds h5_vds-exc \
+ h5_vds-exclim h5_vds-eiger h5_vds-simpleIO h5_vds-percival \
+ h5_vds-percival-unlim h5_vds-percival-unlim-maxmin
TEST_SCRIPT=testh5cc.sh
TEST_EXAMPLES_SCRIPT=$(INSTALL_SCRIPT_FILES)
# Install files
# List all file that should be installed in examples directory
INSTALL_FILES = h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c \
- h5_crtgrpd.c h5_subset.c h5_cmprss.c h5_rdwt.c h5_crtgrpar.c \
- h5_extend.c h5_crtatt.c h5_crtgrp.c h5_crtdat.c \
- h5_compound.c h5_group.c h5_select.c h5_attribute.c h5_mount.c \
- h5_reference.c h5_drivers.c h5_extlink.c h5_elink_unix2win.c \
- h5_ref2reg.c h5_shared_mesg.c ph5example.c h5_vds.c h5_vds-exc.c \
- h5_vds-exclim.c h5_vds-eiger.c h5_vds-simpleIO.c h5_vds-percival.c \
- h5_vds-percival-unlim.c h5_vds-percival-unlim-maxmin.c
+ h5_crtgrpd.c h5_subset.c h5_cmprss.c h5_rdwt.c h5_crtgrpar.c \
+ h5_extend.c h5_crtatt.c h5_crtgrp.c h5_crtdat.c \
+ h5_compound.c h5_group.c h5_select.c h5_attribute.c h5_mount.c \
+ h5_reference.c h5_drivers.c h5_extlink.c h5_elink_unix2win.c \
+ h5_ref2reg.c h5_shared_mesg.c ph5example.c h5_vds.c h5_vds-exc.c \
+ h5_vds-exclim.c h5_vds-eiger.c h5_vds-simpleIO.c h5_vds-percival.c \
+ h5_vds-percival-unlim.c h5_vds-percival-unlim-maxmin.c
diff --git a/examples/Makefile.in b/examples/Makefile.in
index 4f5b84d..965dd47 100644
--- a/examples/Makefile.in
+++ b/examples/Makefile.in
@@ -432,7 +432,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -455,9 +454,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -484,6 +486,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -538,6 +541,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -562,7 +566,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -690,12 +693,12 @@ INSTALL_TOP_FILES = README
# it would try to compile them instead of using the h5cc script.
# Use the boilerplate in config/examples.am instead.
EXAMPLE_PROG = h5_write h5_read h5_extend_write h5_chunk_read h5_compound \
- h5_crtgrpd h5_subset h5_cmprss h5_rdwt h5_crtgrpar h5_extend \
- h5_crtatt h5_crtgrp h5_crtdat \
- h5_group h5_select h5_attribute h5_mount h5_reference h5_drivers \
- h5_ref2reg h5_extlink h5_elink_unix2win h5_shared_mesg h5_vds h5_vds-exc \
- h5_vds-exclim h5_vds-eiger h5_vds-simpleIO h5_vds-percival \
- h5_vds-percival-unlim h5_vds-percival-unlim-maxmin
+ h5_crtgrpd h5_subset h5_cmprss h5_rdwt h5_crtgrpar h5_extend \
+ h5_crtatt h5_crtgrp h5_crtdat \
+ h5_group h5_select h5_attribute h5_mount h5_reference h5_drivers \
+ h5_ref2reg h5_extlink h5_elink_unix2win h5_shared_mesg h5_vds h5_vds-exc \
+ h5_vds-exclim h5_vds-eiger h5_vds-simpleIO h5_vds-percival \
+ h5_vds-percival-unlim h5_vds-percival-unlim-maxmin
TEST_SCRIPT = testh5cc.sh
TEST_EXAMPLES_SCRIPT = $(INSTALL_SCRIPT_FILES)
@@ -703,13 +706,13 @@ TEST_EXAMPLES_SCRIPT = $(INSTALL_SCRIPT_FILES)
# Install files
# List all file that should be installed in examples directory
INSTALL_FILES = h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c \
- h5_crtgrpd.c h5_subset.c h5_cmprss.c h5_rdwt.c h5_crtgrpar.c \
- h5_extend.c h5_crtatt.c h5_crtgrp.c h5_crtdat.c \
- h5_compound.c h5_group.c h5_select.c h5_attribute.c h5_mount.c \
- h5_reference.c h5_drivers.c h5_extlink.c h5_elink_unix2win.c \
- h5_ref2reg.c h5_shared_mesg.c ph5example.c h5_vds.c h5_vds-exc.c \
- h5_vds-exclim.c h5_vds-eiger.c h5_vds-simpleIO.c h5_vds-percival.c \
- h5_vds-percival-unlim.c h5_vds-percival-unlim-maxmin.c
+ h5_crtgrpd.c h5_subset.c h5_cmprss.c h5_rdwt.c h5_crtgrpar.c \
+ h5_extend.c h5_crtatt.c h5_crtgrp.c h5_crtdat.c \
+ h5_compound.c h5_group.c h5_select.c h5_attribute.c h5_mount.c \
+ h5_reference.c h5_drivers.c h5_extlink.c h5_elink_unix2win.c \
+ h5_ref2reg.c h5_shared_mesg.c ph5example.c h5_vds.c h5_vds-exc.c \
+ h5_vds-exclim.c h5_vds-eiger.c h5_vds-simpleIO.c h5_vds-percival.c \
+ h5_vds-percival-unlim.c h5_vds-percival-unlim-maxmin.c
# The external link examples demonstrate how to use paths; they need
@@ -1277,7 +1280,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c
index f3f6077..4abda30 100644
--- a/examples/h5_extend_write.c
+++ b/examples/h5_extend_write.c
@@ -163,9 +163,9 @@ main (void)
/*
* Resulting dataset
*
- * 1 1 1 3 3
- * 1 1 1 3 3
- * 1 1 1 0 0
+ * 1 1 1 3 3
+ * 1 1 1 3 3
+ * 1 1 1 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
diff --git a/fortran/Makefile.am b/fortran/Makefile.am
index 38084b9..99880dd 100644
--- a/fortran/Makefile.am
+++ b/fortran/Makefile.am
@@ -22,14 +22,21 @@
include $(top_srcdir)/config/commence.am
-if BUILD_PARALLEL_CONDITIONAL
+if BUILD_TESTS_PARALLEL_CONDITIONAL
TESTPARALLEL_DIR=testpar
+else
+ TESTPARALLEL_DIR=
+endif
+if BUILD_TESTS_CONDITIONAL
+ TESTSERIAL_DIR=test
+else
+ TESTSERIAL_DIR=
endif
# Subdirectories in build order, not including examples directory
## Only recurse into subdirectories if HDF5 is configured to use Fortran.
if BUILD_FORTRAN_CONDITIONAL
- SUBDIRS=src test $(TESTPARALLEL_DIR)
+ SUBDIRS=src $(TESTSERIAL_DIR) $(TESTPARALLEL_DIR)
endif
# All directories that have Makefiles
diff --git a/fortran/Makefile.in b/fortran/Makefile.in
index 6b6eb66..ff7ace5 100644
--- a/fortran/Makefile.in
+++ b/fortran/Makefile.in
@@ -488,7 +488,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -511,9 +510,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -540,6 +542,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -594,6 +597,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -618,7 +622,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -735,10 +738,13 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-@BUILD_PARALLEL_CONDITIONAL_TRUE@TESTPARALLEL_DIR = testpar
+@BUILD_TESTS_PARALLEL_CONDITIONAL_FALSE@TESTPARALLEL_DIR =
+@BUILD_TESTS_PARALLEL_CONDITIONAL_TRUE@TESTPARALLEL_DIR = testpar
+@BUILD_TESTS_CONDITIONAL_FALSE@TESTSERIAL_DIR =
+@BUILD_TESTS_CONDITIONAL_TRUE@TESTSERIAL_DIR = test
# Subdirectories in build order, not including examples directory
-@BUILD_FORTRAN_CONDITIONAL_TRUE@SUBDIRS = src test $(TESTPARALLEL_DIR)
+@BUILD_FORTRAN_CONDITIONAL_TRUE@SUBDIRS = src $(TESTSERIAL_DIR) $(TESTPARALLEL_DIR)
# All directories that have Makefiles
DIST_SUBDIRS = src test testpar examples
@@ -1290,7 +1296,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt
index 0c570c6..e8dddd3 100644
--- a/fortran/examples/CMakeLists.txt
+++ b/fortran/examples/CMakeLists.txt
@@ -35,56 +35,43 @@ set (F2003_examples
foreach (example ${examples})
add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
- target_include_directories (f90_ex_${example}
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
- )
target_compile_options(f90_ex_${example}
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
- target_link_libraries (f90_ex_${example}
- PRIVATE
- ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
- )
# set_property(TARGET f90_ex_${example} APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
# )
# set_property(TARGET f90_ex_${example} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:>
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
# )
if(MSVC)
set_property(TARGET f90_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
- set_target_properties (f90_ex_${example} PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER examples/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
- )
- if (BUILD_SHARED_LIBS)
- add_executable (f90_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
- target_include_directories (f90_ex_${example}-shared
+ if (NOT BUILD_SHARED_LIBS)
+ target_include_directories (f90_ex_${example}
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
)
- target_compile_options(f90_ex_${example}-shared
+ target_link_libraries (f90_ex_${example}
PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
+ )
+ set_target_properties (f90_ex_${example} PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER examples/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
)
- target_link_libraries (f90_ex_${example}-shared
+ else ()
+ target_include_directories (f90_ex_${example}
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
+ )
+ target_link_libraries (f90_ex_${example}
PRIVATE
${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
)
-# set_property(TARGET f90_ex_${example}-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET f90_ex_${example}-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
- if(MSVC)
- set_property(TARGET f90_ex_${example}-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
- endif()
- set_target_properties (f90_ex_${example}-shared PROPERTIES
+ set_target_properties (f90_ex_${example} PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
@@ -94,18 +81,10 @@ endforeach ()
foreach (example ${F2003_examples})
add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
- target_include_directories (f03_ex_${example}
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
- )
target_compile_options(f03_ex_${example}
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
- target_link_libraries (f03_ex_${example}
- PRIVATE
- ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
- )
# set_property(TARGET f03_ex_${example} APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
# )
@@ -115,35 +94,30 @@ foreach (example ${F2003_examples})
if(MSVC)
set_property(TARGET f03_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
- set_target_properties (f03_ex_${example} PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER examples/fortran03
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
- )
- if (BUILD_SHARED_LIBS)
- add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
- target_include_directories (f03_ex_${example}-shared
+ if (NOT ONLY_SHARED_LIBS)
+ target_include_directories (f03_ex_${example}
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
)
- target_compile_options(f03_ex_${example}-shared
+ target_link_libraries (f03_ex_${example}
PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
)
- target_link_libraries (f03_ex_${example}-shared
+ set_target_properties (f03_ex_${example} PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER examples/fortran03
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
+ )
+ else ()
+ target_include_directories (f03_ex_${example}
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
+ )
+ target_link_libraries (f03_ex_${example}
PRIVATE
${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
)
-# set_property(TARGET f03_ex_${example}-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET f03_ex_${example}-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
- if(MSVC)
- set_property(TARGET f03_ex_${example}-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
- endif()
- set_target_properties (f03_ex_${example}-shared PROPERTIES
+ set_target_properties (f03_ex_${example} PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran03
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
@@ -153,19 +127,10 @@ endforeach ()
if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90)
- target_include_directories (f90_ex_ph5example
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
- )
target_compile_options(f90_ex_ph5example
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
- target_link_libraries (f90_ex_ph5example
- PRIVATE
- ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
- $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
- )
# set_property(TARGET f90_ex_ph5example APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
# )
@@ -175,36 +140,32 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
if(MSVC)
set_property(TARGET f90_ex_ph5example PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
- set_target_properties (f90_ex_ph5example PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER examples/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
- )
- if (BUILD_SHARED_LIBS)
- add_executable (f90_ex_ph5example-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90)
- target_include_directories (f90_ex_ph5example-shared
+ if (NOT ONLY_SHARED_LIBS)
+ target_include_directories (f90_ex_ph5example
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
)
- target_compile_options(f90_ex_ph5example-shared
+ target_link_libraries (f90_ex_ph5example
PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
+ $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
+ )
+ set_target_properties (f90_ex_ph5example PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER examples/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
+ )
+ else ()
+ target_include_directories (f90_ex_ph5example
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
)
- target_link_libraries (f90_ex_ph5example-shared
+ target_link_libraries (f90_ex_ph5example
PRIVATE
${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
)
-# set_property(TARGET f90_ex_ph5example-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET f90_ex_ph5example-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
- if(MSVC)
- set_property(TARGET f90_ex_ph5example-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
- endif()
- set_target_properties (f90_ex_ph5example-shared PROPERTIES
+ set_target_properties (f90_ex_ph5example PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake
index face086..5e7dfa8 100644
--- a/fortran/examples/CMakeTests.cmake
+++ b/fortran/examples/CMakeTests.cmake
@@ -16,63 +16,37 @@
##############################################################################
##############################################################################
- # Remove any output file left over from previous test run
- add_test (
- NAME f90_ex-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- compound.h5
- copy1.h5
- copy2.h5
- dsetf.h5
- extend.h5
- FORTRAN.h5
- groupf.h5
- groupsf.h5
- h5_cmprss.h5
- mount1.h5
- mount2.h5
- sdsf.h5
- subset.h5
- SDScompound.h5
- test.h5
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "f90_ex-clear-objects")
- if (BUILD_SHARED_LIBS)
- add_test (
- NAME f90_ex-shared-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- compound.h5
- copy1.h5
- copy2.h5
- dsetf.h5
- extend.h5
- FORTRAN.h5
- groupf.h5
- groupsf.h5
- h5_cmprss.h5
- mount1.h5
- mount2.h5
- sdsf.h5
- subset.h5
- SDScompound.h5
- test.h5
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (f90_ex-shared-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "f90_ex-shared-clear-objects")
- endif ()
+set (test_ex_fortran_CLEANFILES
+ compound.h5
+ copy1.h5
+ copy2.h5
+ dsetf.h5
+ extend.h5
+ FORTRAN.h5
+ groupf.h5
+ groupsf.h5
+ h5_cmprss.h5
+ mount1.h5
+ mount2.h5
+ sdsf.h5
+ subset.h5
+ SDScompound.h5
+ test.h5
+)
+
+# Remove any output file left over from previous test run
+add_test (
+ NAME f90_ex-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_fortran_CLEANFILES}
+)
+set_tests_properties (f90_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_f90_ex)
foreach (example ${examples})
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME f90_ex_${example} COMMAND $<TARGET_FILE:f90_ex_${example}>)
+ add_test (NAME f90_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:f90_ex_${example}>)
else ()
add_test (NAME f90_ex_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:f90_ex_${example}>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -83,37 +57,19 @@ foreach (example ${examples})
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (f90_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_f90_ex)
+ if (last_test)
set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "f90_ex_${example}")
- if (BUILD_SHARED_LIBS)
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME f90_ex-shared_${example} COMMAND $<TARGET_FILE:f90_ex_${example}-shared>)
- else ()
- add_test (NAME f90_ex-shared_${example} COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:f90_ex_${example}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=f90_ex_${example}-shared.txt"
- #-D "TEST_REFERENCE=f90_ex_${example}-shared.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (f90_ex-shared_${example} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "f90_ex-shared_${example}")
- endif ()
endforeach ()
foreach (example ${F2003_examples})
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME f03_ex_${example} COMMAND $<TARGET_FILE:f03_ex_${example}>)
+ add_test (NAME f03_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:f03_ex_${example}>)
else ()
add_test (NAME f03_ex_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:f03_ex_${example}>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -124,35 +80,13 @@ foreach (example ${F2003_examples})
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (f03_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_f90_ex)
+ if (last_test)
set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "f03_ex_${example}")
- if (BUILD_SHARED_LIBS)
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME f03_ex-shared_${example} COMMAND $<TARGET_FILE:f03_ex_${example}-shared>)
- else ()
- add_test (NAME f03_ex-shared_${example} COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:f03_ex_${example}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=f03_ex_${example}-shared.txt"
- #-D "TEST_REFERENCE=f03_ex_${example}-shared.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (f03_ex-shared_${example} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "f03_ex-shared_${example}")
- endif ()
endforeach ()
if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
add_test (NAME MPI_TEST_f90_ex_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:f90_ex_ph5example> ${MPIEXEC_POSTFLAGS})
- if (BUILD_SHARED_LIBS)
- add_test (NAME MPI_TEST_f90_ex-shared_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:f90_ex_ph5example> ${MPIEXEC_POSTFLAGS})
- endif ()
endif ()
diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in
index 2307d40..6df6b3d 100644
--- a/fortran/examples/Makefile.in
+++ b/fortran/examples/Makefile.in
@@ -437,7 +437,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -460,9 +459,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -489,6 +491,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -543,6 +546,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -567,7 +571,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1265,7 +1268,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index f71e820..dda9c5a 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -40,7 +40,7 @@ set (Fortran_COMPILER_ID CMAKE_Fortran_COMPILER_ID)
#-----------------------------------------------------------------------------
add_executable (H5_buildiface ${HDF5_F90_SRC_SOURCE_DIR}/H5_buildiface.F90)
-target_include_directories(H5_buildiface
+target_include_directories (H5_buildiface
PRIVATE
"${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}"
)
@@ -69,29 +69,33 @@ if (BUILD_SHARED_LIBS)
file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared")
set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE})
endif ()
-file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static")
-set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE})
+if (NOT ONLY_SHARED_LIBS)
+ file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static")
+ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE})
+endif ()
#-----------------------------------------------------------------------------
add_executable (H5match_types
${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h
${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c
)
-target_include_directories(H5match_types PRIVATE "${HDF5_BINARY_DIR};${HDF5_SRC_DIR};${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-add_custom_command (
- OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
- ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
- COMMAND $<TARGET_FILE:H5match_types>
- WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static
- DEPENDS H5match_types
-)
-set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h PROPERTIES GENERATED TRUE)
-set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 PROPERTIES GENERATED TRUE)
+target_include_directories (H5match_types PRIVATE "${HDF5_BINARY_DIR};${HDF5_SRC_DIR};${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ add_custom_command (
+ OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
+ ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5match_types>
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static
+ DEPENDS H5match_types
+ )
+ set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h PROPERTIES GENERATED TRUE)
+ set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 PROPERTIES GENERATED TRUE)
+endif ()
if (BUILD_SHARED_LIBS)
add_custom_command (
OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h
${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90
- COMMAND $<TARGET_FILE:H5match_types>
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5match_types>
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared
DEPENDS H5match_types
)
@@ -131,24 +135,26 @@ set (f90CStub_C_SHHDRS
${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h
)
-add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS})
-target_include_directories(${HDF5_F90_C_LIB_TARGET}
- PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC)
-target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
-set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}")
-H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} STATIC 0)
-set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES
- FOLDER libraries/fortran
- LINKER_LANGUAGE C
-)
-set (install_targets ${HDF5_F90_C_LIB_TARGET})
+if (NOT ONLY_SHARED_LIBS)
+ add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS})
+ target_include_directories (${HDF5_F90_C_LIB_TARGET}
+ PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC)
+ target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
+ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}")
+ H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} STATIC 0)
+ set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES
+ FOLDER libraries/fortran
+ LINKER_LANGUAGE C
+ )
+ set (install_targets ${HDF5_F90_C_LIB_TARGET})
+endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS})
- target_include_directories(${HDF5_F90_C_LIBSH_TARGET}
+ target_include_directories (${HDF5_F90_C_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
@@ -174,22 +180,24 @@ set (f90_F_GEN_SOURCES
${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.F90
${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.F90
)
-add_custom_command (
- OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
- COMMAND $<TARGET_FILE:H5_buildiface>
- WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static
- DEPENDS ${f90_F_GEN_SOURCES}
- COMMENT "Generating the H5_gen.F90 file"
-)
-add_custom_target (H5gen ALL
- DEPENDS ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
-)
-set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 PROPERTIES GENERATED TRUE)
+if (NOT ONLY_SHARED_LIBS)
+ add_custom_command (
+ OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5_buildiface>
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static
+ DEPENDS ${f90_F_GEN_SOURCES}
+ COMMENT "Generating the H5_gen.F90 file"
+ )
+ add_custom_target (H5gen ALL
+ DEPENDS ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
+ )
+ set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 PROPERTIES GENERATED TRUE)
+endif ()
if (BUILD_SHARED_LIBS)
add_custom_command (
OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90
- COMMAND $<TARGET_FILE:H5_buildiface>
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5_buildiface>
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared
DEPENDS ${f90_F_GEN_SOURCES}
COMMENT "Generating the H5_gen.F90 shared file"
@@ -220,18 +228,20 @@ set (f90_F_BASE_SOURCES
${HDF5_F90_SRC_SOURCE_DIR}/H5Zff.F90
)
-set (f90_F_SOURCES
- # generated file
- ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
+if (NOT ONLY_SHARED_LIBS)
+ set (f90_F_SOURCES
+ # generated file
+ ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
- ${f90_F_BASE_SOURCES}
+ ${f90_F_BASE_SOURCES}
- # generated file
- ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
+ # generated file
+ ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
- # normal distribution
- ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90
-)
+ # normal distribution
+ ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90
+ )
+endif ()
if (BUILD_SHARED_LIBS)
set (f90_F_SOURCES_SHARED
# generated file
@@ -250,43 +260,45 @@ endif ()
#-----------------------------------------------------------------------------
# Add Main fortran library
#-----------------------------------------------------------------------------
-add_library (${HDF5_F90_LIB_TARGET} STATIC ${f90_F_SOURCES})
-target_include_directories (${HDF5_F90_LIB_TARGET}
- PRIVATE
- "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
- INTERFACE
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-target_compile_definitions(${HDF5_F90_LIB_TARGET}
- PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS>
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
-)
-target_link_libraries (${HDF5_F90_LIB_TARGET}
- PUBLIC
- ${HDF5_F90_C_LIB_TARGET}
- PRIVATE
- ${LINK_Fortran_LIBS}
- $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
-)
-#set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-#)
-#set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-#)
-if(MSVC)
- set_property(TARGET ${HDF5_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
-endif()
-set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES
- FOLDER libraries/fortran
- LINKER_LANGUAGE Fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
-)
-H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} STATIC 0)
-set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}")
-set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET})
-add_dependencies(${HDF5_F90_LIB_TARGET} H5gen)
+if (NOT ONLY_SHARED_LIBS)
+ add_library (${HDF5_F90_LIB_TARGET} STATIC ${f90_F_SOURCES})
+ target_include_directories (${HDF5_F90_LIB_TARGET}
+ PRIVATE
+ "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ INTERFACE
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ target_compile_definitions(${HDF5_F90_LIB_TARGET}
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS>
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
+ target_link_libraries (${HDF5_F90_LIB_TARGET}
+ PUBLIC
+ ${HDF5_F90_C_LIB_TARGET}
+ PRIVATE
+ ${LINK_Fortran_LIBS}
+ $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
+ )
+# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
+# )
+# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+# )
+ if(MSVC)
+ set_property(TARGET ${HDF5_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
+ endif()
+ set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES
+ FOLDER libraries/fortran
+ LINKER_LANGUAGE Fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
+ )
+ H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} STATIC 0)
+ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}")
+ set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET})
+ add_dependencies(${HDF5_F90_LIB_TARGET} H5gen)
+endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES_SHARED})
@@ -343,43 +355,64 @@ install (
${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h
${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h
${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h
- ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
- ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
DESTINATION
${HDF5_INSTALL_INCLUDE_DIR}
COMPONENT
fortheaders
)
+if (NOT ONLY_SHARED_LIBS)
+ install (
+ FILES
+ ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
+ ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
+ DESTINATION
+ ${HDF5_INSTALL_INCLUDE_DIR}
+ COMPONENT
+ fortheaders
+ )
+else ()
+ install (
+ FILES
+ ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h
+ ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90
+ DESTINATION
+ ${HDF5_INSTALL_INCLUDE_DIR}
+ COMPONENT
+ fortheaders
+ )
+endif ()
-set (mod_files
- ${MOD_BUILD_DIR}/h5fortran_types.mod
- ${MOD_BUILD_DIR}/hdf5.mod
- ${MOD_BUILD_DIR}/h5fortkit.mod
- ${MOD_BUILD_DIR}/h5global.mod
- ${MOD_BUILD_DIR}/h5a.mod
- ${MOD_BUILD_DIR}/h5d.mod
- ${MOD_BUILD_DIR}/h5e.mod
- ${MOD_BUILD_DIR}/h5f.mod
- ${MOD_BUILD_DIR}/h5g.mod
- ${MOD_BUILD_DIR}/h5i.mod
- ${MOD_BUILD_DIR}/h5l.mod
- ${MOD_BUILD_DIR}/h5lib.mod
- ${MOD_BUILD_DIR}/h5o.mod
- ${MOD_BUILD_DIR}/h5p.mod
- ${MOD_BUILD_DIR}/h5r.mod
- ${MOD_BUILD_DIR}/h5s.mod
- ${MOD_BUILD_DIR}/h5t.mod
- ${MOD_BUILD_DIR}/h5z.mod
- ${MOD_BUILD_DIR}/h5_gen.mod
-)
-install (
- FILES
- ${mod_files}
- DESTINATION
- ${HDF5_INSTALL_INCLUDE_DIR}/static
- COMPONENT
- fortheaders
-)
+if (NOT ONLY_SHARED_LIBS)
+ set (mod_files
+ ${MOD_BUILD_DIR}/h5fortran_types.mod
+ ${MOD_BUILD_DIR}/hdf5.mod
+ ${MOD_BUILD_DIR}/h5fortkit.mod
+ ${MOD_BUILD_DIR}/h5global.mod
+ ${MOD_BUILD_DIR}/h5a.mod
+ ${MOD_BUILD_DIR}/h5d.mod
+ ${MOD_BUILD_DIR}/h5e.mod
+ ${MOD_BUILD_DIR}/h5f.mod
+ ${MOD_BUILD_DIR}/h5g.mod
+ ${MOD_BUILD_DIR}/h5i.mod
+ ${MOD_BUILD_DIR}/h5l.mod
+ ${MOD_BUILD_DIR}/h5lib.mod
+ ${MOD_BUILD_DIR}/h5o.mod
+ ${MOD_BUILD_DIR}/h5p.mod
+ ${MOD_BUILD_DIR}/h5r.mod
+ ${MOD_BUILD_DIR}/h5s.mod
+ ${MOD_BUILD_DIR}/h5t.mod
+ ${MOD_BUILD_DIR}/h5z.mod
+ ${MOD_BUILD_DIR}/h5_gen.mod
+ )
+ install (
+ FILES
+ ${mod_files}
+ DESTINATION
+ ${HDF5_INSTALL_INCLUDE_DIR}/static
+ COMPONENT
+ fortheaders
+ )
+endif ()
if (BUILD_SHARED_LIBS)
set (modsh_files
@@ -421,8 +454,10 @@ if (HDF5_EXPORTED_TARGETS)
INSTALL_TARGET_PDB (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries)
#INSTALL_TARGET_PDB (${HDF5_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries)
endif ()
- INSTALL_TARGET_PDB (${HDF5_F90_C_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries)
- #INSTALL_TARGET_PDB (${HDF5_F90_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries)
+ if (NOT ONLY_SHARED_LIBS)
+ INSTALL_TARGET_PDB (${HDF5_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} fortlibraries)
+ #INSTALL_TARGET_PDB (${HDF5_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} fortlibraries)
+ endif ()
install (
TARGETS
@@ -436,3 +471,53 @@ if (HDF5_EXPORTED_TARGETS)
INCLUDES DESTINATION include
)
endif ()
+
+#-----------------------------------------------------------------------------
+# Create pkgconfig files
+#-----------------------------------------------------------------------------
+set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX})
+set (_PKG_CONFIG_EXEC_PREFIX \${prefix})
+set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib)
+set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include)
+set (_PKG_CONFIG_LIBNAME "${HDF5_F90_LIB_CORENAME}")
+set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}")
+
+set (_PKG_CONFIG_LIBS_PRIVATE)
+
+if (NOT ONLY_SHARED_LIBS)
+ set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_F90_LIB_CORENAME}")
+endif ()
+if (BUILD_SHARED_LIBS)
+ set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_F90_LIB_CORENAME}")
+endif ()
+
+set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}")
+set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}")
+
+configure_file (
+ ${HDF_RESOURCES_DIR}/libhdf5.pc.in
+ ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ @ONLY
+)
+install (
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig
+ COMPONENT fortlibraries
+)
+
+if (NOT WIN32 AND NOT MINGW)
+ set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER})
+ configure_file (
+ ${HDF_RESOURCES_DIR}/libh5cc.in
+ ${HDF5_BINARY_DIR}/CMakeFiles/h5fc
+ @ONLY
+ )
+ install (
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5fc
+ DESTINATION ${HDF5_INSTALL_BIN_DIR}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ COMPONENT fortlibraries
+ )
+endif ()
+
+
diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90
index 13a2953..f170e5f 100644
--- a/fortran/src/H5Pff.F90
+++ b/fortran/src/H5Pff.F90
@@ -9,7 +9,7 @@
! COPYRIGHT
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! Copyright by The HDF Group. *
-! Copyright by the Board of Trustees of the University of Illinois. *S
+! Copyright by the Board of Trustees of the University of Illinois. *
! All rights reserved. *
! *
! This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c
index 2eae0d9..0bafc58 100644
--- a/fortran/src/H5Sf.c
+++ b/fortran/src/H5Sf.c
@@ -1033,22 +1033,21 @@ h5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_
hsize_t *c_block = NULL;
H5S_seloper_t c_op;
- herr_t status;
int rank;
int i;
rank = H5Sget_simple_extent_ndims(*space_id);
if (rank < 0 ) return ret_value;
- c_start = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
+ c_start = (hsize_t *)HDmalloc(sizeof(hsize_t)*(unsigned)rank);
if (c_start == NULL) goto DONE;
- c_count = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
+ c_count = (hsize_t *)HDmalloc(sizeof(hsize_t)*(unsigned)rank);
if (c_count == NULL) goto DONE;
- c_stride = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
+ c_stride = (hsize_t *)HDmalloc(sizeof(hsize_t)*(unsigned)rank);
if (c_stride == NULL) goto DONE;
- c_block = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
+ c_block = (hsize_t *)HDmalloc(sizeof(hsize_t)*(unsigned)rank);
if (c_block == NULL) goto DONE;
diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c
index 69ba8b3..1ff499f 100644
--- a/fortran/src/H5_f.c
+++ b/fortran/src/H5_f.c
@@ -632,7 +632,6 @@ h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags,
h5s_flags[15] = (int_f)H5S_SEL_POINTS;
h5s_flags[16] = (int_f)H5S_SEL_HYPERSLABS;
h5s_flags[17] = (int_f)H5S_SEL_ALL;
-
/*
* H5T flags
*/
@@ -671,7 +670,6 @@ h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags,
h5t_flags[32] = (int_f)H5T_ARRAY;
h5t_flags[33] = (int_f)H5T_DIR_ASCEND;
h5t_flags[34] = (int_f)H5T_DIR_DESCEND;
-
/*
* H5Z flags
*/
@@ -695,10 +693,6 @@ h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags,
h5z_flags[17] = (int_f)H5Z_SO_FLOAT_ESCALE;
h5z_flags[18] = (int_f)H5Z_SO_INT;
h5z_flags[19] = (int_f)H5Z_SO_INT_MINBITS_DEFAULT;
-/*
- * H5A flags
- */
-
/*
* H5 Generic flags introduced in version 1.8
diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90
index 84529e4..7cd073d 100644
--- a/fortran/src/H5_ff.F90
+++ b/fortran/src/H5_ff.F90
@@ -129,6 +129,7 @@ MODULE H5LIB
!
INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35
INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags
+
!
! H5Z flags declaration
!
diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c
index 57f7dda..e39e85a 100644
--- a/fortran/src/H5match_types.c
+++ b/fortran/src/H5match_types.c
@@ -143,7 +143,7 @@ void writeToFilesChr(const char* c_typedef, const char* fortran_type, const char
int main(void)
{
int i;
- char chrA[32],chrB[32];
+ char chrA[64],chrB[64];
int IntKinds[] = H5_FORTRAN_INTEGER_KINDS;
int IntKinds_SizeOf[] = H5_FORTRAN_INTEGER_KINDS_SIZEOF;
@@ -347,8 +347,8 @@ int main(void)
for(i=0;i<H5_FORTRAN_NUM_REAL_KINDS;i++) {
if (RealKinds[i] > 0) {
- sprintf(chrA, "Fortran_REAL_%s", Real_C_TYPES[i]);
- sprintf(chrB, "real_%s_f", Real_C_TYPES[i]);
+ snprintf(chrA, sizeof(chrA), "Fortran_REAL_%s", Real_C_TYPES[i]);
+ snprintf(chrB, sizeof(chrB), "real_%s_f", Real_C_TYPES[i]);
writeToFiles("float",chrA, chrB, RealKinds[i]);
}
}
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index 777e777..626be47 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -525,7 +525,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -548,9 +547,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -577,6 +579,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -631,6 +634,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -655,7 +659,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -772,29 +775,29 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-LT_VERS_INTERFACE = 104
+LT_VERS_INTERFACE = 105
LT_VERS_REVISION = 0
-LT_VERS_AGE = 1
-LT_CXX_VERS_INTERFACE = 104
+LT_VERS_AGE = 2
+LT_CXX_VERS_INTERFACE = 105
LT_CXX_VERS_REVISION = 0
-LT_CXX_VERS_AGE = 1
+LT_CXX_VERS_AGE = 2
LT_F_VERS_INTERFACE = 102
-LT_F_VERS_REVISION = 0
+LT_F_VERS_REVISION = 1
LT_F_VERS_AGE = 0
LT_HL_VERS_INTERFACE = 101
-LT_HL_VERS_REVISION = 2
+LT_HL_VERS_REVISION = 3
LT_HL_VERS_AGE = 1
LT_HL_CXX_VERS_INTERFACE = 101
-LT_HL_CXX_VERS_REVISION = 3
+LT_HL_CXX_VERS_REVISION = 4
LT_HL_CXX_VERS_AGE = 1
LT_HL_F_VERS_INTERFACE = 100
-LT_HL_F_VERS_REVISION = 4
+LT_HL_F_VERS_REVISION = 5
LT_HL_F_VERS_AGE = 0
LT_JAVA_VERS_INTERFACE = 104
-LT_JAVA_VERS_REVISION = 0
+LT_JAVA_VERS_REVISION = 1
LT_JAVA_VERS_AGE = 4
LT_TOOLS_VERS_INTERFACE = 101
-LT_TOOLS_VERS_REVISION = 2
+LT_TOOLS_VERS_REVISION = 3
LT_TOOLS_VERS_AGE = 1
AM_FCLIBS = $(LIBHDF5)
@@ -1519,7 +1522,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index b862fcd..7f0e792 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -7,7 +7,7 @@ project (HDF5_FORTRAN_TESTS C Fortran)
#-----------------------------------------------------------------------------
add_executable (H5_test_buildiface ${HDF5_F90_SRC_DIR}/test/H5_test_buildiface.F90)
-target_include_directories(H5_test_buildiface
+target_include_directories (H5_test_buildiface
PRIVATE
${HDF5_BINARY_DIR} ${HDF5_F90_BINARY_DIR}
)
@@ -31,35 +31,37 @@ set_target_properties (H5_test_buildiface PROPERTIES
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
-if (BUILD_SHARED_LIBS)
+if (NOT BUILD_SHARED_LIBS)
+ file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/static")
+ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE})
+else ()
file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared")
set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE})
endif ()
-file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/static")
-set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE})
#-----------------------------------------------------------------------------
# Add Test Lib
#-----------------------------------------------------------------------------
-add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c)
-set_source_files_properties (t.c PROPERTIES LANGUAGE C)
-target_include_directories(${HDF5_F90_C_TEST_LIB_TARGET}
- PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC)
-target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE
- ${HDF5_F90_C_LIB_TARGET}
- ${HDF5_TEST_LIB_TARGET}
-)
-H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} STATIC 0)
-set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES
- FOLDER libraries/test/fortran
- LINKER_LANGUAGE C
-)
-if (BUILD_SHARED_LIBS)
+if (NOT BUILD_SHARED_LIBS)
+ add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c)
+ set_source_files_properties (t.c PROPERTIES LANGUAGE C)
+ target_include_directories (${HDF5_F90_C_TEST_LIB_TARGET}
+ PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC)
+ target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET}
+ PRIVATE ${HDF5_F90_C_LIB_TARGET}
+ PUBLIC ${HDF5_TEST_LIB_TARGET}
+ )
+ H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} STATIC 0)
+ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES
+ FOLDER libraries/test/fortran
+ LINKER_LANGUAGE C
+ )
+else ()
add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c)
- target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET}
+ target_include_directories (${HDF5_F90_C_TEST_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
@@ -67,9 +69,9 @@ if (BUILD_SHARED_LIBS)
PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
)
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED)
- target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE
- ${HDF5_F90_C_LIBSH_TARGET}
- ${HDF5_TEST_LIBSH_TARGET}
+ target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET}
+ PRIVATE ${HDF5_F90_C_LIBSH_TARGET}
+ PUBLIC ${HDF5_TEST_LIBSH_TARGET}
)
H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} SHARED "F")
set_target_properties (${HDF5_F90_C_TEST_LIBSH_TARGET} PROPERTIES
@@ -78,22 +80,22 @@ if (BUILD_SHARED_LIBS)
)
endif ()
-add_custom_command (
- OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
- COMMAND $<TARGET_FILE:H5_test_buildiface>
- WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static
- DEPENDS H5_test_buildiface
- COMMENT "Generating the tf_gen.F90 file"
-)
-add_custom_target (H5testgen ALL
- DEPENDS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
-)
-set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE)
-
-if (BUILD_SHARED_LIBS)
+if (NOT BUILD_SHARED_LIBS)
+ add_custom_command (
+ OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5_test_buildiface>
+ WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static
+ DEPENDS H5_test_buildiface
+ COMMENT "Generating the tf_gen.F90 file"
+ )
+ add_custom_target (H5testgen ALL
+ DEPENDS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
+ )
+ set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE)
+else ()
add_custom_command (
OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90
- COMMAND $<TARGET_FILE:H5_test_buildiface>
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5_test_buildiface>
WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared
DEPENDS H5_test_buildiface
COMMENT "Generating the tf_gen.F90 shared file"
@@ -104,15 +106,16 @@ if (BUILD_SHARED_LIBS)
set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 PROPERTIES GENERATED TRUE)
endif ()
-set (HDF5_F90_TF_SOURCES
- # generated files
- ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
+if (NOT BUILD_SHARED_LIBS)
+ set (HDF5_F90_TF_SOURCES
+ # generated files
+ ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
- # normal distribution
- tf.F90
-)
-set_source_files_properties (${HDF5_F90_TF_SOURCES} PROPERTIES LANGUAGE Fortran)
-if (BUILD_SHARED_LIBS)
+ # normal distribution
+ tf.F90
+ )
+ set_source_files_properties (${HDF5_F90_TF_SOURCES} PROPERTIES LANGUAGE Fortran)
+else ()
set (HDF5_F90_TF_SOURCES_SHARED
# generated file
${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90
@@ -123,40 +126,40 @@ if (BUILD_SHARED_LIBS)
set_source_files_properties (${HDF5_F90_TF_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran)
endif ()
-add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC ${HDF5_F90_TF_SOURCES})
-target_include_directories (${HDF5_F90_TEST_LIB_TARGET}
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
- INTERFACE
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-target_compile_definitions(${HDF5_F90_TEST_LIB_TARGET}
- PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS>
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
-)
-target_link_libraries (${HDF5_F90_TEST_LIB_TARGET}
- PUBLIC
- ${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
-)
-#set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-#)
-#set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-#)
-if(MSVC)
- set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
-endif()
-set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES
- FOLDER libraries/test/fortran
- LINKER_LANGUAGE Fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
-)
-H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} STATIC 0)
-add_dependencies(${HDF5_F90_TEST_LIB_TARGET} H5testgen)
-
-if (BUILD_SHARED_LIBS)
+if (NOT BUILD_SHARED_LIBS)
+ add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC ${HDF5_F90_TF_SOURCES})
+ target_include_directories (${HDF5_F90_TEST_LIB_TARGET}
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
+ INTERFACE
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ target_compile_definitions(${HDF5_F90_TEST_LIB_TARGET}
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS>
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
+ target_link_libraries (${HDF5_F90_TEST_LIB_TARGET}
+ PUBLIC
+ ${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
+ )
+# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
+# )
+# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+# )
+ if(MSVC)
+ set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
+ endif()
+ set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES
+ FOLDER libraries/test/fortran
+ LINKER_LANGUAGE Fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
+ )
+ H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} STATIC 0)
+ add_dependencies(${HDF5_F90_TEST_LIB_TARGET} H5testgen)
+else ()
add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED ${HDF5_F90_TF_SOURCES_SHARED})
target_include_directories (${HDF5_F90_TEST_LIBSH_TARGET}
PRIVATE
@@ -218,18 +221,10 @@ add_executable (testhdf5_fortran
tH5Z.F90
tHDF5.F90
)
-target_include_directories (testhdf5_fortran
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
-)
target_compile_options(testhdf5_fortran
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
-target_link_libraries (testhdf5_fortran
- PRIVATE
- ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
-)
#set_property(TARGET testhdf5_fortran APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
#)
@@ -239,58 +234,36 @@ target_link_libraries (testhdf5_fortran
if(MSVC)
set_property(TARGET testhdf5_fortran PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
-set_target_properties (testhdf5_fortran PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER test/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
-)
-add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET})
-
-if (BUILD_SHARED_LIBS)
- add_executable (testhdf5_fortran-shared
- fortranlib_test.F90
- tH5A.F90
- tH5D.F90
- tH5E.F90
- tH5F.F90
- tH5G.F90
- tH5I.F90
- tH5P.F90
- tH5R.F90
- tH5S.F90
- tH5Sselect.F90
- tH5T.F90
- tH5VL.F90
- tH5Z.F90
- tHDF5.F90
- )
- target_include_directories (testhdf5_fortran-shared
+if (NOT BUILD_SHARED_LIBS)
+ target_include_directories (testhdf5_fortran
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
)
- target_compile_options(testhdf5_fortran-shared
+ target_link_libraries (testhdf5_fortran
PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ )
+ set_target_properties (testhdf5_fortran PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER test/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
)
- target_link_libraries (testhdf5_fortran-shared
+ add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET})
+else ()
+ target_include_directories (testhdf5_fortran
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
+ )
+ target_link_libraries (testhdf5_fortran
PRIVATE
${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
)
-# set_property(TARGET testhdf5_fortran-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET testhdf5_fortran-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
- if(MSVC)
- set_property(TARGET testhdf5_fortran-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
- endif()
- set_target_properties (testhdf5_fortran-shared PROPERTIES
+ set_target_properties (testhdf5_fortran PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
)
- add_dependencies (testhdf5_fortran-shared ${HDF5_F90_TEST_LIBSH_TARGET})
+ add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIBSH_TARGET})
endif ()
#-- Adding test for testhdf5_fortran_1_8
@@ -302,18 +275,10 @@ add_executable (testhdf5_fortran_1_8
tH5MISC_1_8.F90
tHDF5_1_8.F90
)
-target_include_directories (testhdf5_fortran_1_8
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
-)
target_compile_options(testhdf5_fortran_1_8
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
-target_link_libraries (testhdf5_fortran_1_8
- PRIVATE
- ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
-)
#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
#)
@@ -323,49 +288,36 @@ target_link_libraries (testhdf5_fortran_1_8
if(MSVC)
set_property(TARGET testhdf5_fortran_1_8 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
-set_target_properties (testhdf5_fortran_1_8 PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER test/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
-)
-add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET})
-
-if (BUILD_SHARED_LIBS)
- add_executable (testhdf5_fortran_1_8-shared
- fortranlib_test_1_8.F90
- tH5O.F90
- tH5A_1_8.F90
- tH5G_1_8.F90
- tH5MISC_1_8.F90
- tHDF5_1_8.F90
- )
- target_include_directories (testhdf5_fortran_1_8-shared
+if (NOT BUILD_SHARED_LIBS)
+ target_include_directories (testhdf5_fortran_1_8
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
)
- target_compile_options(testhdf5_fortran_1_8-shared
+ target_link_libraries (testhdf5_fortran_1_8
PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ )
+ set_target_properties (testhdf5_fortran_1_8 PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER test/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
+ )
+ add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET})
+else ()
+ target_include_directories (testhdf5_fortran_1_8
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
)
- target_link_libraries (testhdf5_fortran_1_8-shared
+ target_link_libraries (testhdf5_fortran_1_8
PRIVATE
${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
)
-# set_property(TARGET testhdf5_fortran_1_8-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET testhdf5_fortran_1_8-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
- if(MSVC)
- set_property(TARGET testhdf5_fortran_1_8-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
- endif()
- set_target_properties (testhdf5_fortran_1_8-shared PROPERTIES
+ set_target_properties (testhdf5_fortran_1_8 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
)
- add_dependencies (testhdf5_fortran_1_8-shared ${HDF5_F90_TEST_LIBSH_TARGET})
+ add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIBSH_TARGET})
endif ()
#-- Adding test for fortranlib_test_F03
@@ -379,18 +331,10 @@ add_executable (fortranlib_test_F03
tH5T_F03.F90
tHDF5_F03.F90
)
-target_include_directories (fortranlib_test_F03
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
-)
target_compile_options(fortranlib_test_F03
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
-target_link_libraries (fortranlib_test_F03
- PRIVATE
- ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
-)
#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
#)
@@ -400,67 +344,44 @@ target_link_libraries (fortranlib_test_F03
if(MSVC)
set_property(TARGET fortranlib_test_F03 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
-set_target_properties (fortranlib_test_F03 PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER test/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
-)
-add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET})
-
-if (BUILD_SHARED_LIBS)
- add_executable (fortranlib_test_F03-shared
- fortranlib_test_F03.F90
- tH5E_F03.F90
- tH5F_F03.F90
- tH5L_F03.F90
- tH5O_F03.F90
- tH5P_F03.F90
- tH5T_F03.F90
- tHDF5_F03.F90
- )
- target_include_directories (fortranlib_test_F03-shared
+if (NOT BUILD_SHARED_LIBS)
+ target_include_directories (fortranlib_test_F03
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
)
- target_compile_options(fortranlib_test_F03-shared
+ target_link_libraries (fortranlib_test_F03
PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ )
+ set_target_properties (fortranlib_test_F03 PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER test/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
+ )
+ add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET})
+else ()
+ target_include_directories (fortranlib_test_F03
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
)
- target_link_libraries (fortranlib_test_F03-shared
+ target_link_libraries (fortranlib_test_F03
PRIVATE
${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
)
-# set_property(TARGET fortranlib_test_F03-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET fortranlib_test_F03-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
- if(MSVC)
- set_property(TARGET fortranlib_test_F03-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
- endif()
- set_target_properties (fortranlib_test_F03-shared PROPERTIES
+ set_target_properties (fortranlib_test_F03 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
)
- add_dependencies (fortranlib_test_F03-shared ${HDF5_F90_TEST_LIBSH_TARGET})
+ add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIBSH_TARGET})
endif ()
#-- Adding test for fflush1
add_executable (fflush1 fflush1.F90)
-target_include_directories (fflush1
- PRIVATE
- ${CMAKE_Fortran_MODULE_DIRECTORY}/static
-)
target_compile_options(fflush1
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
-target_link_libraries (fflush1
- PRIVATE
- ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
-)
#set_property(TARGET fflush1 APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
#)
@@ -470,58 +391,44 @@ target_link_libraries (fflush1
if(MSVC)
set_property(TARGET fflush1 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
-set_target_properties (fflush1 PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER test/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
-)
-add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET})
-
-if (BUILD_SHARED_LIBS)
- add_executable (fflush1-shared fflush1.F90)
- target_include_directories (fflush1-shared
+if (NOT BUILD_SHARED_LIBS)
+ target_include_directories (fflush1
PRIVATE
- ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ ${CMAKE_Fortran_MODULE_DIRECTORY}/static
)
- target_compile_options(fflush1-shared
+ target_link_libraries (fflush1
PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ )
+ set_target_properties (fflush1 PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER test/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
+ )
+ add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET})
+else ()
+ target_include_directories (fflush1
+ PRIVATE
+ ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
)
- target_link_libraries (fflush1-shared
+ target_link_libraries (fflush1
PRIVATE
${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
)
-# set_property(TARGET fflush1-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET fflush1-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
- if(MSVC)
- set_property(TARGET fflush1-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
- endif()
- set_target_properties (fflush1-shared PROPERTIES
+ set_target_properties (fflush1 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
)
- add_dependencies (fflush1-shared ${HDF5_F90_TEST_LIBSH_TARGET})
+ add_dependencies (fflush1 ${HDF5_F90_TEST_LIBSH_TARGET})
endif ()
#-- Adding test for fflush2
add_executable (fflush2 fflush2.F90)
-target_include_directories (fflush2
- PRIVATE
- ${CMAKE_Fortran_MODULE_DIRECTORY}/static
-)
target_compile_options (fflush2
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
-target_link_libraries (fflush2
- PRIVATE
- ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
-)
#set_property(TARGET fflush2 APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
#)
@@ -531,42 +438,36 @@ target_link_libraries (fflush2
if(MSVC)
set_property(TARGET fflush2 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
-set_target_properties (fflush2 PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER test/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
-)
-add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET})
-
-if (BUILD_SHARED_LIBS)
- add_executable (fflush2-shared fflush2.F90)
- target_include_directories (fflush2-shared
+if (NOT BUILD_SHARED_LIBS)
+ target_include_directories (fflush2
PRIVATE
- ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ ${CMAKE_Fortran_MODULE_DIRECTORY}/static
)
- target_compile_options(fflush2-shared
+ target_link_libraries (fflush2
PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ )
+ set_target_properties (fflush2 PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER test/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
)
- target_link_libraries (fflush2-shared
+ add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET})
+else ()
+ target_include_directories (fflush2
+ PRIVATE
+ ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ )
+ target_link_libraries (fflush2
PRIVATE
${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
)
-# set_property(TARGET fflush2-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET fflush2-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
- if(MSVC)
- set_property(TARGET fflush2-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
- endif()
- set_target_properties (fflush2-shared PROPERTIES
+ set_target_properties (fflush2 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
)
- add_dependencies (fflush2-shared ${HDF5_F90_TEST_LIBSH_TARGET})
+ add_dependencies (fflush2 ${HDF5_F90_TEST_LIBSH_TARGET})
endif ()
include (CMakeTests.cmake)
diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake
index 2824ef7..e14abec 100644
--- a/fortran/test/CMakeTests.cmake
+++ b/fortran/test/CMakeTests.cmake
@@ -15,58 +15,55 @@
### T E S T I N G ###
##############################################################################
##############################################################################
-if (BUILD_SHARED_LIBS)
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/fshared")
-endif ()
+
+set (testhdf5_fortran_CLEANFILES
+ a.h5
+ b.h5
+ c.h5
+ d.h5
+ dsetf_F03.h5
+ enum1.h5
+ extern_1a.raw
+ extern_2a.raw
+ extern_3a.raw
+ extern_4a.raw
+ extren_raw.raw
+ get_info.h5
+ nbit.h5
+ t_array_F03.h5
+ t_bit_F03.h5
+ t_controlchar_F03.h5
+ t_enum_F03.h5
+ t_objref_F03.h5
+ t_opaque_F03.h5
+ t_regref_F03.h5
+ t_string_F03.h5
+ t_vlen_F03.h5
+ t_vlstring_F03.h5
+ t_vlstringrw_F03.h5
+ tarray1.h5
+ tarray2.h5
+ tarray3.h5
+ test_create.h5
+ tget_file_image.h5
+ th5o_ref.h5
+ titerate.h5
+ vds.h5
+ visit.h5
+)
# Remove any output file left over from previous test run
add_test (
NAME FORTRAN_testhdf5-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- a.h5
- b.h5
- c.h5
- d.h5
- dsetf_F03.h5
- enum1.h5
- extern_1a.raw
- extern_2a.raw
- extern_3a.raw
- extern_4a.raw
- extren_raw.raw
- get_info.h5
- nbit.h5
- t_array_F03.h5
- t_bit_F03.h5
- t_controlchar_F03.h5
- t_enum_F03.h5
- t_objref_F03.h5
- t_opaque_F03.h5
- t_regref_F03.h5
- t_string_F03.h5
- t_vlen_F03.h5
- t_vlstring_F03.h5
- t_vlstringrw_F03.h5
- tarray1.h5
- tarray2.h5
- tarray3.h5
- test_create.h5
- tget_file_image.h5
- th5o_ref.h5
- titerate.h5
- vds.h5
- visit.h5
+ COMMAND ${CMAKE_COMMAND} -E remove ${testhdf5_fortran_CLEANFILES}
)
-if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (FORTRAN_testhdf5-clear-objects PROPERTIES DEPENDS ${last_test})
-endif ()
-set (last_test "FORTRAN_testhdf5-clear-objects")
+set_tests_properties (FORTRAN_testhdf5-clear-objects PROPERTIES FIXTURES_SETUP clear_testhdf5_fortran)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME FORTRAN_testhdf5_fortran COMMAND $<TARGET_FILE:testhdf5_fortran>)
+ add_test (NAME FORTRAN_testhdf5_fortran COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testhdf5_fortran>)
else ()
add_test (NAME FORTRAN_testhdf5_fortran COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:testhdf5_fortran>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -80,13 +77,16 @@ else ()
)
endif ()
#set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
-set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES DEPENDS FORTRAN_testhdf5-clear-objects)
+set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES
+ FIXTURES_REQUIRED clear_testhdf5_fortran
+)
#-- Adding test for testhdf5_fortran_1_8
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND $<TARGET_FILE:testhdf5_fortran_1_8>)
+ add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testhdf5_fortran_1_8>)
else ()
add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:testhdf5_fortran_1_8>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -100,13 +100,17 @@ else ()
)
endif ()
#set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
-set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran)
+set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES
+ DEPENDS FORTRAN_testhdf5_fortran
+ FIXTURES_REQUIRED clear_testhdf5_fortran
+)
#-- Adding test for fortranlib_test_F03
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $<TARGET_FILE:fortranlib_test_F03>)
+ add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:fortranlib_test_F03>)
else ()
add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:fortranlib_test_F03>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -120,123 +124,29 @@ else ()
)
endif ()
# set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
- set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8)
+set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES
+ DEPENDS FORTRAN_testhdf5_fortran_1_8
+ FIXTURES_REQUIRED clear_testhdf5_fortran
+)
#-- Adding test for fflush1
-add_test (NAME FORTRAN_fflush1 COMMAND $<TARGET_FILE:fflush1>)
-set_tests_properties (FORTRAN_fflush1 PROPERTIES DEPENDS FORTRAN_testhdf5-clear-objects)
+add_test (
+ NAME FORTRAN_flush1-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove flush.h5
+)
+add_test (
+ NAME FORTRAN_fflush1
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:fflush1>
+)
+set_tests_properties (FORTRAN_fflush1 PROPERTIES
+ DEPENDS FORTRAN_flush1-clear-objects
+)
#-- Adding test for fflush2
-add_test (NAME FORTRAN_fflush2 COMMAND $<TARGET_FILE:fflush2>)
-set_tests_properties (FORTRAN_fflush2 PROPERTIES DEPENDS FORTRAN_fflush1)
-
-if (BUILD_SHARED_LIBS)
- add_test (
- NAME FORTRAN_testhdf5-shared-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- a.h5
- b.h5
- c.h5
- d.h5
- dsetf_F03.h5
- enum1.h5
- extern_1a.raw
- extern_2a.raw
- extern_3a.raw
- extern_4a.raw
- extren_raw.raw
- get_info.h5
- nbit.h5
- t_array_F03.h5
- t_bit_F03.h5
- t_controlchar_F03.h5
- t_enum_F03.h5
- t_objref_F03.h5
- t_opaque_F03.h5
- t_regref_F03.h5
- t_string_F03.h5
- t_vlen_F03.h5
- t_vlstring_F03.h5
- t_vlstringrw_F03.h5
- tarray1.h5
- tarray2.h5
- tarray3.h5
- test_create.h5
- tget_file_image.h5
- th5o_ref.h5
- titerate.h5
- vds.h5
- visit.h5
- WORKING_DIRECTORY
- ${PROJECT_BINARY_DIR}/fshared
- )
- set_tests_properties (FORTRAN_testhdf5-shared-clear-objects PROPERTIES DEPENDS FORTRAN_testhdf5-clear-objects)
-
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND $<TARGET_FILE:testhdf5_fortran-shared>)
- else ()
- add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:testhdf5_fortran-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_REGEX= 0 error.s."
- -D "TEST_MATCH= 0 error(s)"
- -D "TEST_OUTPUT=testhdf5_fortran.txt"
- #-D "TEST_REFERENCE=testhdf5_fortran.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
-# set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
- set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES DEPENDS "FORTRAN_testhdf5_fortran;FORTRAN_testhdf5-shared-clear-objects")
-
- #-- Adding test for testhdf5_fortran_1_8
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND $<TARGET_FILE:testhdf5_fortran_1_8-shared>)
- else ()
- add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:testhdf5_fortran_1_8-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_REGEX= 0 error.s."
- -D "TEST_MATCH= 0 error(s)"
- -D "TEST_OUTPUT=testhdf5_fortran_1_8.txt"
- #-D "TEST_REFERENCE=testhdf5_fortran_1_8.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
-# set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
- set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8)
-
- #-- Adding test for fortranlib_test_F03
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND $<TARGET_FILE:fortranlib_test_F03-shared>)
- else ()
- add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:fortranlib_test_F03-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_REGEX= 0 error.s."
- -D "TEST_MATCH= 0 error(s)"
- -D "TEST_OUTPUT=fortranlib_test_F03.txt"
- #-D "TEST_REFERENCE=fortranlib_test_F03.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
-# set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
- set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES DEPENDS FORTRAN_fortranlib_test_F03)
-
- #-- Adding test for fflush1
- add_test (NAME FORTRAN_fflush1-shared COMMAND $<TARGET_FILE:fflush1-shared>)
- set_tests_properties (FORTRAN_fflush1-shared PROPERTIES DEPENDS FORTRAN_fflush2)
-
- #-- Adding test for fflush2
- add_test (NAME FORTRAN_fflush2-shared COMMAND $<TARGET_FILE:fflush2-shared>)
- set_tests_properties (FORTRAN_fflush2-shared PROPERTIES DEPENDS FORTRAN_fflush1-shared)
-endif ()
+add_test (
+ NAME FORTRAN_fflush2
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:fflush2>
+)
+set_tests_properties (FORTRAN_fflush2 PROPERTIES
+ DEPENDS FORTRAN_fflush1
+)
diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in
index 2e614bc..a3362db 100644
--- a/fortran/test/Makefile.in
+++ b/fortran/test/Makefile.in
@@ -538,7 +538,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -561,9 +560,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -590,6 +592,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -644,6 +647,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -668,7 +672,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1463,7 +1466,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/fortran/test/tH5O_F03.F90 b/fortran/test/tH5O_F03.F90
index d1a9ddb..bc3668c 100644
--- a/fortran/test/tH5O_F03.F90
+++ b/fortran/test/tH5O_F03.F90
@@ -270,12 +270,9 @@ CONTAINS
! A(8) = tm_yday int days since January 1 0-365
! A(9) = tm_isdst int Daylight Saving Time flag
!
- INTEGER(C_INT), DIMENSION(:), POINTER :: c_atime, c_btime, c_ctime, c_mtime
- INTEGER(C_INT), DIMENSION(1:8) :: atime, btime, ctime, mtime
INTEGER :: len, i
INTEGER :: idx
INTEGER :: ierr
- TYPE(C_PTR) :: cptr
visit_obj_cb = 0
diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in
index f1ae198..479cf58 100644
--- a/fortran/testpar/Makefile.in
+++ b/fortran/testpar/Makefile.in
@@ -489,7 +489,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -512,9 +511,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -541,6 +543,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -595,6 +598,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -619,7 +623,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1245,7 +1248,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/fortran/testpar/ptest.f90 b/fortran/testpar/ptest.f90
index 14ac3b2..3b07f21 100644
--- a/fortran/testpar/ptest.f90
+++ b/fortran/testpar/ptest.f90
@@ -16,7 +16,7 @@
!
PROGRAM parallel_test
- USE hdf5
+ USE HDF5
USE MPI
USE TH5_MISC
diff --git a/hl/Makefile.am b/hl/Makefile.am
index aee1f86..769340c 100644
--- a/hl/Makefile.am
+++ b/hl/Makefile.am
@@ -31,11 +31,21 @@ endif
if BUILD_CXX_CONDITIONAL
CXX_DIR = c++
endif
+if BUILD_TESTS_CONDITIONAL
+ TEST_DIR = test
+else
+ TEST_DIR =
+endif
+if BUILD_TOOLS_CONDITIONAL
+ TOOLS_DIR = tools
+else
+ TOOLS_DIR =
+endif
## Don't recurse into any subdirectories if HDF5 is not configured to
## use the HL library
if BUILD_HDF5_HL_CONDITIONAL
- SUBDIRS=src test tools $(CXX_DIR) $(FORTRAN_DIR)
+ SUBDIRS=src $(TEST_DIR) $(TOOLS_DIR) $(CXX_DIR) $(FORTRAN_DIR)
endif
DIST_SUBDIRS=src test tools c++ fortran examples
diff --git a/hl/Makefile.in b/hl/Makefile.in
index 02bacbc..b6f077a 100644
--- a/hl/Makefile.in
+++ b/hl/Makefile.in
@@ -488,7 +488,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -511,9 +510,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -540,6 +542,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -594,6 +597,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -618,7 +622,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -737,7 +740,11 @@ TRACE = perl $(top_srcdir)/bin/trace
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
@BUILD_FORTRAN_CONDITIONAL_TRUE@FORTRAN_DIR = fortran
@BUILD_CXX_CONDITIONAL_TRUE@CXX_DIR = c++
-@BUILD_HDF5_HL_CONDITIONAL_TRUE@SUBDIRS = src test tools $(CXX_DIR) $(FORTRAN_DIR)
+@BUILD_TESTS_CONDITIONAL_FALSE@TEST_DIR =
+@BUILD_TESTS_CONDITIONAL_TRUE@TEST_DIR = test
+@BUILD_TOOLS_CONDITIONAL_FALSE@TOOLS_DIR =
+@BUILD_TOOLS_CONDITIONAL_TRUE@TOOLS_DIR = tools
+@BUILD_HDF5_HL_CONDITIONAL_TRUE@SUBDIRS = src $(TEST_DIR) $(TOOLS_DIR) $(CXX_DIR) $(FORTRAN_DIR)
DIST_SUBDIRS = src test tools c++ fortran examples
# Automake needs to be taught how to build lib, progs and tests targets.
@@ -1291,7 +1298,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/c++/Makefile.am b/hl/c++/Makefile.am
index 1968bf5..f9ea328 100644
--- a/hl/c++/Makefile.am
+++ b/hl/c++/Makefile.am
@@ -18,7 +18,13 @@
include $(top_srcdir)/config/commence.am
-SUBDIRS=src test
+if BUILD_TESTS_CONDITIONAL
+ TESTSERIAL_DIR =test
+else
+ TESTSERIAL_DIR=
+endif
+
+SUBDIRS=src $(TESTSERIAL_DIR)
DIST_SUBDIRS=src test examples
# Install examples
diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in
index fdc8f5d..4af7ac6 100644
--- a/hl/c++/Makefile.in
+++ b/hl/c++/Makefile.in
@@ -484,7 +484,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -507,9 +506,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -536,6 +538,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -590,6 +593,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -614,7 +618,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -731,7 +734,9 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-SUBDIRS = src test
+@BUILD_TESTS_CONDITIONAL_FALSE@TESTSERIAL_DIR =
+@BUILD_TESTS_CONDITIONAL_TRUE@TESTSERIAL_DIR = test
+SUBDIRS = src $(TESTSERIAL_DIR)
DIST_SUBDIRS = src test examples
# Automake needs to be taught how to build lib, progs and tests targets.
@@ -1281,7 +1286,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt
index 8e64239..50e08e8 100644
--- a/hl/c++/examples/CMakeLists.txt
+++ b/hl/c++/examples/CMakeLists.txt
@@ -5,13 +5,22 @@ project (HDF5_HL_CPP_EXAMPLES CXX)
# Add in the examples for the Packet Table codes
# --------------------------------------------------------------------
add_executable (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp)
-target_include_directories(ptExampleFL PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (ptExampleFL STATIC)
-target_link_libraries (ptExampleFL PRIVATE
- ${HDF5_HL_CPP_LIB_TARGET}
- ${HDF5_HL_LIB_TARGET}
- ${HDF5_LIB_TARGET}
-)
+target_include_directories (ptExampleFL PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (ptExampleFL STATIC)
+ target_link_libraries (ptExampleFL PRIVATE
+ ${HDF5_HL_CPP_LIB_TARGET}
+ ${HDF5_HL_LIB_TARGET}
+ ${HDF5_LIB_TARGET}
+ )
+else ()
+ TARGET_C_PROPERTIES (ptExampleFL SHARED)
+ target_link_libraries (ptExampleFL PRIVATE
+ ${HDF5_HL_CPP_LIBSH_TARGET}
+ ${HDF5_HL_LIBSH_TARGET}
+ ${HDF5_LIBSH_TARGET}
+ )
+endif ()
set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp)
if (BUILD_TESTING)
diff --git a/hl/c++/examples/CMakeTests.cmake b/hl/c++/examples/CMakeTests.cmake
index 103ec2b..7bc614b 100644
--- a/hl/c++/examples/CMakeTests.cmake
+++ b/hl/c++/examples/CMakeTests.cmake
@@ -21,12 +21,14 @@ add_test (
COMMAND ${CMAKE_COMMAND}
-E remove
PTcppexampleFL.h5
+ ptExampleFL.txt
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME HL_CPP_ex_ptExampleFL COMMAND $<TARGET_FILE:ptExampleFL>)
+ add_test (NAME HL_CPP_ex_ptExampleFL COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:ptExampleFL>)
else ()
add_test (NAME HL_CPP_ex_ptExampleFL COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:ptExampleFL>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in
index 629ba83..7d9b566 100644
--- a/hl/c++/examples/Makefile.in
+++ b/hl/c++/examples/Makefile.in
@@ -431,7 +431,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -454,9 +453,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -483,6 +485,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -537,6 +540,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -561,7 +565,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1199,7 +1202,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt
index 77419c6..9964160 100644
--- a/hl/c++/src/CMakeLists.txt
+++ b/hl/c++/src/CMakeLists.txt
@@ -8,21 +8,23 @@ project (HDF5_HL_CPP_SRC CXX)
set (HDF5_HL_CPP_SOURCES ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp)
set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h)
-add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES})
-target_include_directories(${HDF5_HL_CPP_LIB_TARGET}
- PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} STATIC)
-target_link_libraries (${HDF5_HL_CPP_LIB_TARGET} PUBLIC ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}")
-H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} STATIC 0)
-set_target_properties (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl)
-set (install_targets ${HDF5_HL_CPP_LIB_TARGET})
+if (NOT ONLY_SHARED_LIBS)
+ add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES})
+ target_include_directories (${HDF5_HL_CPP_LIB_TARGET}
+ PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} STATIC)
+ target_link_libraries (${HDF5_HL_CPP_LIB_TARGET} PUBLIC ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}")
+ H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} STATIC 0)
+ set_target_properties (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl)
+ set (install_targets ${HDF5_HL_CPP_LIB_TARGET})
+endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_HL_CPP_LIBSH_TARGET} SHARED ${HDF5_HL_CPP_SOURCES})
- target_include_directories(${HDF5_HL_CPP_LIBSH_TARGET}
+ target_include_directories (${HDF5_HL_CPP_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
@@ -56,7 +58,9 @@ if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries)
endif ()
- INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries)
+ if (NOT ONLY_SHARED_LIBS)
+ INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlcpplibraries)
+ endif ()
install (
TARGETS
@@ -83,7 +87,9 @@ set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}")
set (_PKG_CONFIG_LIBS_PRIVATE)
-set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_HL_CPP_LIB_CORENAME}")
+if (NOT ONLY_SHARED_LIBS)
+ set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_HL_CPP_LIB_CORENAME}")
+endif ()
if (BUILD_SHARED_LIBS)
set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_HL_CPP_LIB_CORENAME}")
endif ()
@@ -102,7 +108,7 @@ install (
COMPONENT hlcpplibraries
)
-if (NOT WIN32)
+if (NOT WIN32 AND NOT MINGW)
set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER})
configure_file (
${HDF_RESOURCES_DIR}/libh5cc.in
diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in
index cf48b26..132f7a7 100644
--- a/hl/c++/src/Makefile.in
+++ b/hl/c++/src/Makefile.in
@@ -487,7 +487,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -510,9 +509,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -539,6 +541,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -593,6 +596,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -617,7 +621,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -734,29 +737,29 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-LT_VERS_INTERFACE = 104
+LT_VERS_INTERFACE = 105
LT_VERS_REVISION = 0
-LT_VERS_AGE = 1
-LT_CXX_VERS_INTERFACE = 104
+LT_VERS_AGE = 2
+LT_CXX_VERS_INTERFACE = 105
LT_CXX_VERS_REVISION = 0
-LT_CXX_VERS_AGE = 1
+LT_CXX_VERS_AGE = 2
LT_F_VERS_INTERFACE = 102
-LT_F_VERS_REVISION = 0
+LT_F_VERS_REVISION = 1
LT_F_VERS_AGE = 0
LT_HL_VERS_INTERFACE = 101
-LT_HL_VERS_REVISION = 2
+LT_HL_VERS_REVISION = 3
LT_HL_VERS_AGE = 1
LT_HL_CXX_VERS_INTERFACE = 101
-LT_HL_CXX_VERS_REVISION = 3
+LT_HL_CXX_VERS_REVISION = 4
LT_HL_CXX_VERS_AGE = 1
LT_HL_F_VERS_INTERFACE = 100
-LT_HL_F_VERS_REVISION = 4
+LT_HL_F_VERS_REVISION = 5
LT_HL_F_VERS_AGE = 0
LT_JAVA_VERS_INTERFACE = 104
-LT_JAVA_VERS_REVISION = 0
+LT_JAVA_VERS_REVISION = 1
LT_JAVA_VERS_AGE = 4
LT_TOOLS_VERS_INTERFACE = 101
-LT_TOOLS_VERS_REVISION = 2
+LT_TOOLS_VERS_REVISION = 3
LT_TOOLS_VERS_AGE = 1
# This is our main target
@@ -1333,7 +1336,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt
index 68c049c..cfb24a8 100644
--- a/hl/c++/test/CMakeLists.txt
+++ b/hl/c++/test/CMakeLists.txt
@@ -2,15 +2,26 @@ cmake_minimum_required (VERSION 3.10)
project (HDF5_HL_CPP_TEST CXX)
add_executable (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp)
-target_include_directories(hl_ptableTest PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (hl_ptableTest STATIC)
-target_link_libraries (hl_ptableTest PRIVATE
- ${HDF5_LIB_TARGET}
- ${HDF5_TEST_LIB_TARGET}
- ${HDF5_CPP_LIB_TARGET}
- ${HDF5_HL_LIB_TARGET}
- ${HDF5_HL_CPP_LIB_TARGET}
-)
+target_include_directories (hl_ptableTest PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (hl_ptableTest STATIC)
+ target_link_libraries (hl_ptableTest PRIVATE
+ ${HDF5_LIB_TARGET}
+ ${HDF5_TEST_LIB_TARGET}
+ ${HDF5_CPP_LIB_TARGET}
+ ${HDF5_HL_LIB_TARGET}
+ ${HDF5_HL_CPP_LIB_TARGET}
+ )
+else ()
+ TARGET_C_PROPERTIES (hl_ptableTest SHARED)
+ target_link_libraries (hl_ptableTest PRIVATE
+ ${HDF5_LIBSH_TARGET}
+ ${HDF5_TEST_LIBSH_TARGET}
+ ${HDF5_CPP_LIBSH_TARGET}
+ ${HDF5_HL_LIBSH_TARGET}
+ ${HDF5_HL_CPP_LIBSH_TARGET}
+ )
+endif ()
set_target_properties (hl_ptableTest PROPERTIES FOLDER test/hl/cpp)
include (CMakeTests.cmake)
diff --git a/hl/c++/test/CMakeTests.cmake b/hl/c++/test/CMakeTests.cmake
index 785abca..3d0f93a 100644
--- a/hl/c++/test/CMakeTests.cmake
+++ b/hl/c++/test/CMakeTests.cmake
@@ -16,10 +16,16 @@
##############################################################################
##############################################################################
+add_test (
+ NAME HL_CPP_ptableTest-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove ${example}.txt
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME HL_CPP_ptableTest COMMAND $<TARGET_FILE:hl_ptableTest>)
+ add_test (NAME HL_CPP_ptableTest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_ptableTest>)
else ()
add_test (NAME HL_CPP_ptableTest COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:hl_ptableTest>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -30,3 +36,4 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
+set_tests_properties (HL_CPP_ptableTest PROPERTIES DEPENDS HL_CPP_ptableTest-clear-objects)
diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in
index 531daab..94aea13 100644
--- a/hl/c++/test/Makefile.in
+++ b/hl/c++/test/Makefile.in
@@ -484,7 +484,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -507,9 +506,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -536,6 +538,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -590,6 +593,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -614,7 +618,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1258,7 +1261,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp
index 340912e..e873503 100644
--- a/hl/c++/test/ptableTest.cpp
+++ b/hl/c++/test/ptableTest.cpp
@@ -36,22 +36,22 @@ int main(void)
}
else {
- num_errors += BasicTest();
+ num_errors += BasicTest();
- num_errors += TestCompoundDatatype();
+ num_errors += TestCompoundDatatype();
- num_errors += TestGetPacket();
+ num_errors += TestGetPacket();
- num_errors += TestGetNext();
+ num_errors += TestGetNext();
- num_errors += TestCompress();
+ num_errors += TestCompress();
- num_errors += TestErrors();
+ num_errors += TestErrors();
- num_errors += SystemTest();
+ num_errors += SystemTest();
- /* Test data corruption in packed structs */
- num_errors += TestHDFFV_9758();
+ /* Test data corruption in packed structs */
+ num_errors += TestHDFFV_9758();
/* Terminate access to the file. */
err = H5Fclose(fileID);
@@ -81,7 +81,8 @@ int BasicTest()
hsize_t count;
int error;
- TESTING("basic functionality")
+ printf("Testing %-62s", "basic functionality");
+ HDfflush(stdout);
FL_PacketTable wrapper(fileID, H5P_DEFAULT, BASICTEST_PT, H5T_NATIVE_INT, 1);
if(! wrapper.IsValid())
@@ -137,7 +138,8 @@ int TestCompoundDatatype()
hsize_t count;
int error;
- TESTING("compound datatypes")
+ printf("Testing %-62s", "compound datatypes");
+ HDfflush(stdout);
/* Create compound datatype */
typedef struct compoundType
@@ -206,7 +208,8 @@ int TestGetNext()
int records[2];
int i;
- TESTING("GetNextPacket")
+ printf("Testing %-62s", "GetNextPacket");
+ HDfflush(stdout);
/* Create a dataset */
FL_PacketTable wrapper(fileID, H5P_DEFAULT, GETNEXT_PT, H5T_NATIVE_INT, 500);
@@ -268,20 +271,21 @@ int TestCompress()
unsigned int config = 0;
size_t cd_nelemts = 0;
- TESTING("compression")
+ printf("Testing %-62s", "compression");
+ HDfflush(stdout);
#ifdef H5_HAVE_FILTER_DEFLATE
try {
- /* Prepare property list to set compression, randomly use deflate */
- DSetCreatPropList dscreatplist;
- dscreatplist.setDeflate(6);
+ /* Prepare property list to set compression, randomly use deflate */
+ DSetCreatPropList dscreatplist;
+ dscreatplist.setDeflate(6);
/* Create packet table with compression. */
FL_PacketTable wrapper(fileID, COMPRESS_PT, H5T_NATIVE_CHAR, 100, dscreatplist.getId());
- /* Close the property list */
- dscreatplist.close();
+ /* Close the property list */
+ dscreatplist.close();
- /* Verify that the deflate filter is set */
+ /* Verify that the deflate filter is set */
/* Create an HDF5 C++ file object */
H5File file;
@@ -293,10 +297,10 @@ int TestCompress()
DSetCreatPropList dcpl = dset.getCreatePlist();
- char filter_name[8];
+ char filter_name[8];
dcpl.getFilterById(H5Z_FILTER_DEFLATE, flags, cd_nelemts, NULL, 8, filter_name, config);
- if (HDstrncmp(filter_name, "deflate", 7) != 0)
- H5_FAILED()
+ if (HDstrncmp(filter_name, "deflate", 7) != 0)
+ H5_FAILED()
} catch (Exception e) {
H5_FAILED();
return 1;
@@ -304,7 +308,7 @@ int TestCompress()
PASSED();
#else
SKIPPED();
- puts(" deflate filter not enabled");
+ HDputs(" deflate filter not enabled");
#endif /* H5_HAVE_FILTER_DEFLATE */
return 0;
}
@@ -315,7 +319,8 @@ int TestGetPacket()
int record;
int theRecs[3];
int i;
- TESTING("GetPacket")
+ printf("Testing %-62s", "GetPacket");
+ HDfflush(stdout);
/* Create a dataset. Does not need to specify property list because
there is no compression. */
@@ -353,7 +358,8 @@ const char* PT_TESTERROR = "/TestErrors";
int TestErrors()
{
- TESTING("error conditions")
+ printf("Testing %-62s", "error conditions");
+ HDfflush(stdout);
/* Create a dataset */
FL_PacketTable wrapper(fileID, PT_TESTERROR, H5T_NATIVE_INT, 1);
@@ -464,7 +470,8 @@ const char* PT_SYSTEMTST1 = "/SystemTest1";
const char* PT_SYSTEMTST2 = "/SystemTest2";
int SystemTest()
{
- TESTING("multiple datatypes")
+ printf("Testing %-62s", "multiple datatypes");
+ HDfflush(stdout);
hid_t dtypeID1, dtypeID2;
hsize_t count;
@@ -560,16 +567,16 @@ error:
/*-------------------------------------------------------------------------
* TestHDFFV_9758(): Test that a packet table with compound datatype which
- * contains string type can be created and written correctly. (HDFFV-9758)
+ * contains string type can be created and written correctly. (HDFFV-9758)
*
* Notes:
- * Previously, data of the field that follows the string was read back
- * as garbage when #pragma pack(1) is used.
+ * Previously, data of the field that follows the string was read back
+ * as garbage when #pragma pack(1) is used.
* 2016/10/20 -BMR
* Updated:
- * #pragma pack(1) caused failure on Emu because Sparc cannot
- * access misaligned data. Changed it to pack() to do the
- * default alignment.
+ * #pragma pack(1) caused failure on Emu because Sparc cannot
+ * access misaligned data. Changed it to pack() to do the
+ * default alignment.
* 2016/10/25 -BMR
*-------------------------------------------------------------------------
*/
@@ -592,57 +599,58 @@ int TestHDFFV_9758()
};
s1_t s1[NUM_PACKETS];
-
+
for (hsize_t i = 0; i < NUM_PACKETS; i++)
{
s1[i].a = i;
s1[i].b = 1.f * static_cast<float>(i * i);
s1[i].c = 1. / (i + 1);
- sprintf(s1[i].d, "string%d", (int)i);
+ HDsprintf(s1[i].d, "string%d", (int)i);
s1[i].e = 100+i;
}
- TESTING("data corruption in packed structs (HDFFV-9758)")
+ printf("Testing %-62s", "data corruption in packed structs (HDFFV-9758)");
+ HDfflush(stdout);
// Build a compound datatype
compound_type = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
if (compound_type < 0)
- goto error;
-
+ goto error;
+
err = H5Tinsert(compound_type, "a_name", HOFFSET(s1_t, a), H5T_NATIVE_INT);
if (err < 0)
- goto error;
+ goto error;
err = H5Tinsert(compound_type, "b_name", HOFFSET(s1_t, b), H5T_NATIVE_FLOAT);
if (err < 0)
- goto error;
+ goto error;
err = H5Tinsert(compound_type, "c_name", HOFFSET(s1_t, c), H5T_NATIVE_DOUBLE);
if (err < 0)
- goto error;
+ goto error;
strtype = H5Tcopy (H5T_C_S1);
if (compound_type < 0)
- goto error;
+ goto error;
err = H5Tset_size (strtype, STRING_LENGTH); /* create string */
if (err < 0)
- goto error;
+ goto error;
err = H5Tinsert(compound_type, "d_name", HOFFSET(s1_t, d), strtype);
if (err < 0)
- goto error;
+ goto error;
err = H5Tinsert(compound_type, "e_name", HOFFSET(s1_t, e), H5T_NATIVE_INT);
if (err < 0)
- goto error;
+ goto error;
{ // so ptable will go out of scope before PASSED
// Create a packet table
FL_PacketTable ptable(fileID, "/examplePacketTable", compound_type, 1);
if (!ptable.IsValid())
- goto error;
+ goto error;
// Add packets to the table
for (size_t i = 0; i < NUM_PACKETS; i++)
{
- /* Appends one packet at the current position */
+ /* Appends one packet at the current position */
err = ptable.AppendPacket(s1 + i);
if (err < 0) goto error;
}
@@ -650,11 +658,11 @@ int TestHDFFV_9758()
// Check packet count
const hsize_t count = ptable.GetPacketCount(err);
if (err < 0)
- goto error;
-
+ goto error;
+
if (count != NUM_PACKETS)
{
- std::cerr
+ std::cerr
<< "Number of packets in packet table should be " << NUM_PACKETS
<< " but is " << count << endl;
}
@@ -663,16 +671,16 @@ int TestHDFFV_9758()
ptable.ResetIndex();
for (size_t i = 0; i < NUM_PACKETS; i++)
{
- s1_t s2;
- memset(&s2, 0, sizeof(s1_t));
- err = ptable.GetNextPacket(&s2);
- if (err < 0)
- goto error;
-
- if (s2.a != s1[i].a || s2.e != s1[i].e)
- goto error;
- else if (HDstrcmp(s2.d, s1[i].d))
- goto error;
+ s1_t s2;
+ HDmemset(&s2, 0, sizeof(s1_t));
+ err = ptable.GetNextPacket(&s2);
+ if (err < 0)
+ goto error;
+
+ if (s2.a != s1[i].a || s2.e != s1[i].e)
+ goto error;
+ else if (HDstrcmp(s2.d, s1[i].d))
+ goto error;
}
} // end of ptable block
diff --git a/hl/c++/test/ptableTest.h b/hl/c++/test/ptableTest.h
index 8af7bff..e1ba950 100644
--- a/hl/c++/test/ptableTest.h
+++ b/hl/c++/test/ptableTest.h
@@ -21,9 +21,9 @@
#ifndef PTABLETEST
#define PTABLETEST
+#include "h5hltest.h"
#include "H5PacketTable.h"
#include "H5Cpp.h"
-#include "h5hltest.h"
static hid_t fileID;
diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt
index 97c6de5..86c1770 100644
--- a/hl/examples/CMakeLists.txt
+++ b/hl/examples/CMakeLists.txt
@@ -28,9 +28,14 @@ set (examples
foreach (example ${examples})
add_executable (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c)
- target_include_directories(hl_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (hl_ex_${example} STATIC)
- target_link_libraries (hl_ex_${example} PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
+ target_include_directories (hl_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (hl_ex_${example} STATIC)
+ target_link_libraries (hl_ex_${example} PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (hl_ex_${example} SHARED)
+ target_link_libraries (hl_ex_${example} PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ endif ()
set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl)
endforeach ()
diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake
index 166fa7c..d0f9018 100644
--- a/hl/examples/CMakeTests.cmake
+++ b/hl/examples/CMakeTests.cmake
@@ -26,41 +26,39 @@ foreach (h5_file ${HDF5_TEST_FILES})
endforeach ()
add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_ex_ds1 tests" DEPENDS ${hl_ex_ex_ds1_files_list})
- # Remove any output file left over from previous test run
- add_test (
- NAME HL_ex-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ex_lite1.h5
- ex_lite2.h5
- ex_lite3.h5
- packet_table_FLexample.h5
- ex_image1.h5
- ex_image2.h5
- ex_table_01.h5
- ex_table_02.h5
- ex_table_03.h5
- ex_table_04.h5
- ex_table_05.h5
- ex_table_06.h5
- ex_table_07.h5
- ex_table_08.h5
- ex_table_09.h5
- ex_table_10.h5
- ex_table_11.h5
- ex_table_12.h5
- ex_ds1.h5
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (HL_ex-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "HL_ex-clear-objects")
+# Remove any output file left over from previous test run
+add_test (
+ NAME HL_ex-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ex_lite1.h5
+ ex_lite2.h5
+ ex_lite3.h5
+ packet_table_FLexample.h5
+ ex_image1.h5
+ ex_image2.h5
+ ex_table_01.h5
+ ex_table_02.h5
+ ex_table_03.h5
+ ex_table_04.h5
+ ex_table_05.h5
+ ex_table_06.h5
+ ex_table_07.h5
+ ex_table_08.h5
+ ex_table_09.h5
+ ex_table_10.h5
+ ex_table_11.h5
+ ex_table_12.h5
+ ex_ds1.h5
+)
+set_tests_properties (HL_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_HL_ex)
foreach (example ${examples})
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME HL_ex_${example} COMMAND $<TARGET_FILE:hl_ex_${example}>)
+ add_test (NAME HL_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_ex_${example}>)
else ()
add_test (NAME HL_ex_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:hl_ex_${example}>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -71,8 +69,11 @@ foreach (example ${examples})
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (HL_ex_${example} PROPERTIES DEPENDS ${last_test})
+ if (last_test)
+ set_tests_properties (HL_ex_${example} PROPERTIES
+ DEPENDS ${last_test}
+ FIXTURES_REQUIRED clear_HL_ex
+ )
endif ()
set (last_test "HL_ex_${example}")
endforeach ()
diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in
index 580e617..24d8d71 100644
--- a/hl/examples/Makefile.in
+++ b/hl/examples/Makefile.in
@@ -431,7 +431,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -454,9 +453,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -483,6 +485,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -537,6 +540,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -561,7 +565,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1238,7 +1241,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/fortran/Makefile.am b/hl/fortran/Makefile.am
index ad18a21..7d24770 100644
--- a/hl/fortran/Makefile.am
+++ b/hl/fortran/Makefile.am
@@ -23,7 +23,13 @@
include $(top_srcdir)/config/commence.am
-SUBDIRS=src test
+if BUILD_TESTS_CONDITIONAL
+ TESTSERIAL_DIR =test
+else
+ TESTSERIAL_DIR=
+endif
+
+SUBDIRS=src $(TESTSERIAL_DIR)
DIST_SUBDIRS=src test examples
# Install examples
diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in
index b3decd8..b1aba69 100644
--- a/hl/fortran/Makefile.in
+++ b/hl/fortran/Makefile.in
@@ -488,7 +488,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -511,9 +510,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -540,6 +542,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -594,6 +597,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -618,7 +622,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -735,7 +738,9 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-SUBDIRS = src test
+@BUILD_TESTS_CONDITIONAL_FALSE@TESTSERIAL_DIR =
+@BUILD_TESTS_CONDITIONAL_TRUE@TESTSERIAL_DIR = test
+SUBDIRS = src $(TESTSERIAL_DIR)
DIST_SUBDIRS = src test examples
# Automake needs to be taught how to build lib, progs and tests targets.
@@ -1285,7 +1290,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt
index 27971b2..e41b8fe 100644
--- a/hl/fortran/examples/CMakeLists.txt
+++ b/hl/fortran/examples/CMakeLists.txt
@@ -8,18 +8,10 @@ set (examples
foreach (example ${examples})
add_executable (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
- target_include_directories (hl_f90_ex_${example}
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
- )
target_compile_options(hl_f90_ex_${example}
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
- target_link_libraries (hl_f90_ex_${example}
- PRIVATE
- ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
- )
# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
# )
@@ -29,11 +21,35 @@ foreach (example ${examples})
if(MSVC)
set_property(TARGET hl_f90_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
- set_target_properties (hl_f90_ex_${example} PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER examples/hl/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
- )
+ if (NOT BUILD_SHARED_LIBS)
+ target_include_directories (hl_f90_ex_${example}
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+ )
+ target_link_libraries (hl_f90_ex_${example}
+ PRIVATE
+ ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
+ )
+ set_target_properties (hl_f90_ex_${example} PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER examples/hl/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
+ )
+ else ()
+ target_include_directories (hl_f90_ex_${example}
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+ )
+ target_link_libraries (hl_f90_ex_${example}
+ PRIVATE
+ ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
+ )
+ set_target_properties (hl_f90_ex_${example} PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER examples/hl/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
+ )
+ endif ()
endforeach ()
if (BUILD_TESTING)
diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake
index 91cb56b..b8f40d0 100644
--- a/hl/fortran/examples/CMakeTests.cmake
+++ b/hl/fortran/examples/CMakeTests.cmake
@@ -21,16 +21,17 @@ add_test (
NAME HL_FORTRAN_f90_ex-clear-objects
COMMAND ${CMAKE_COMMAND}
-E remove
- ex_ds1.h5
- exlite.h5
+ ex_ds1.h5
+ exlite.h5
)
-
+set_tests_properties (HL_FORTRAN_f90_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_HL_FORTRAN_f90_ex)
foreach (example ${examples})
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND $<TARGET_FILE:hl_f90_ex_${example}>)
+ add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_f90_ex_${example}>)
else ()
add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:hl_f90_ex_${example}>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -41,5 +42,7 @@ foreach (example ${examples})
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- set_tests_properties (HL_FORTRAN_f90_ex_${example} PROPERTIES DEPENDS HL_FORTRAN_f90_ex-clear-objects)
+ set_tests_properties (HL_FORTRAN_f90_ex_${example} PROPERTIES
+ FIXTURES_REQUIRED clear_HL_FORTRAN_f90_ex
+ )
endforeach ()
diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in
index 0f12020..3a2005d 100644
--- a/hl/fortran/examples/Makefile.in
+++ b/hl/fortran/examples/Makefile.in
@@ -437,7 +437,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -460,9 +459,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -489,6 +491,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -543,6 +546,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -567,7 +571,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1216,7 +1219,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index 7ec3b63..e532fff 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -16,7 +16,7 @@ endif ()
#-----------------------------------------------------------------------------
add_executable (H5HL_buildiface ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5HL_buildiface.F90 )
-target_include_directories(H5HL_buildiface PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}")
+target_include_directories (H5HL_buildiface PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}")
if (WIN32 AND MSVC)
if (BUILD_SHARED_LIBS)
set_target_properties (H5HL_buildiface PROPERTIES COMPILE_FLAGS "/MT")
@@ -37,8 +37,10 @@ if (BUILD_SHARED_LIBS)
file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/shared")
set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE})
endif ()
-file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/static")
-set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE})
+if (NOT ONLY_SHARED_LIBS)
+ file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/static")
+ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE})
+endif ()
#-----------------------------------------------------------------------------
# hl_f90CStub lib
@@ -54,24 +56,25 @@ set_source_files_properties (${HDF5_HL_F90_C_SOURCES} PROPERTIES LANGUAGE C)
set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h)
-add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS})
-target_include_directories(${HDF5_HL_F90_C_LIB_TARGET}
- PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC)
-target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET})
-set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}")
-H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} STATIC 0)
-set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES
- FOLDER libraries/hl/fortran
- LINKER_LANGUAGE C
-)
-set (install_targets ${HDF5_HL_F90_C_LIB_TARGET})
-
+if (NOT ONLY_SHARED_LIBS)
+ add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS})
+ target_include_directories (${HDF5_HL_F90_C_LIB_TARGET}
+ PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC)
+ target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET})
+ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}")
+ H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} STATIC 0)
+ set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES
+ FOLDER libraries/hl/fortran
+ LINKER_LANGUAGE C
+ )
+ set (install_targets ${HDF5_HL_F90_C_LIB_TARGET})
+endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS})
- target_include_directories(${HDF5_HL_F90_C_LIBSH_TARGET}
+ target_include_directories (${HDF5_HL_F90_C_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
@@ -99,25 +102,27 @@ set (HDF5_HL_F90_F_BASE_SOURCES
${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.F90
)
-add_custom_command (
- OUTPUT ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
- COMMAND $<TARGET_FILE:H5HL_buildiface>
- WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/static
- DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
- COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files"
-)
-add_custom_target (H5HLgen ALL
- DEPENDS ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
-)
-set_source_files_properties (
- ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90
- ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
- PROPERTIES GENERATED TRUE
-)
+if (NOT ONLY_SHARED_LIBS)
+ add_custom_command (
+ OUTPUT ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5HL_buildiface>
+ WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/static
+ DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
+ COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files"
+ )
+ add_custom_target (H5HLgen ALL
+ DEPENDS ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
+ )
+ set_source_files_properties (
+ ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90
+ ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
+ PROPERTIES GENERATED TRUE
+ )
+endif ()
if (BUILD_SHARED_LIBS)
add_custom_command (
OUTPUT ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90
- COMMAND $<TARGET_FILE:H5HL_buildiface>
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5HL_buildiface>
WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/shared
DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 shared files"
@@ -132,15 +137,16 @@ if (BUILD_SHARED_LIBS)
)
endif ()
-set (HDF5_HL_F90_F_SOURCES
- ${HDF5_HL_F90_F_BASE_SOURCES}
-
- # generated files
- ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90
- ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
-)
-set_source_files_properties (${HDF5_HL_F90_F_SOURCES} PROPERTIES LANGUAGE Fortran)
+if (NOT ONLY_SHARED_LIBS)
+ set (HDF5_HL_F90_F_SOURCES
+ ${HDF5_HL_F90_F_BASE_SOURCES}
+ # generated files
+ ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90
+ ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
+ )
+ set_source_files_properties (${HDF5_HL_F90_F_SOURCES} PROPERTIES LANGUAGE Fortran)
+endif ()
if (BUILD_SHARED_LIBS)
set (HDF5_HL_F90_F_SOURCES_SHARED
${HDF5_HL_F90_F_BASE_SOURCES}
@@ -152,42 +158,43 @@ if (BUILD_SHARED_LIBS)
set_source_files_properties (${HDF5_HL_F90_F_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran)
endif ()
-add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES})
-target_include_directories (${HDF5_HL_F90_LIB_TARGET}
- PRIVATE
- "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
- INTERFACE
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-target_compile_definitions(${HDF5_HL_F90_LIB_TARGET}
- PUBLIC
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS>
- PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
-)
-target_link_libraries (${HDF5_HL_F90_LIB_TARGET}
- PUBLIC
- ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}
-)
-#set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-#)
-#set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-#)
-if(MSVC)
- set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
-endif()
-set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES
- FOLDER libraries/hl/fortran
- LINKER_LANGUAGE Fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
-)
-H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC 0)
-set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}")
-set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET})
-add_dependencies(${HDF5_HL_F90_LIB_TARGET} H5HLgen)
-
+if (NOT ONLY_SHARED_LIBS)
+ add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES})
+ target_include_directories (${HDF5_HL_F90_LIB_TARGET}
+ PRIVATE
+ "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ INTERFACE
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ target_compile_definitions(${HDF5_HL_F90_LIB_TARGET}
+ PUBLIC
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS>
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ )
+ target_link_libraries (${HDF5_HL_F90_LIB_TARGET}
+ PUBLIC
+ ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}
+ )
+# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
+# )
+# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+# )
+ if(MSVC)
+ set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
+ endif()
+ set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES
+ FOLDER libraries/hl/fortran
+ LINKER_LANGUAGE Fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
+ )
+ H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC 0)
+ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}")
+ set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET})
+ add_dependencies(${HDF5_HL_F90_LIB_TARGET} H5HLgen)
+endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES_SHARED})
target_include_directories (${HDF5_HL_F90_LIBSH_TARGET}
@@ -240,24 +247,25 @@ endif ()
#-----------------------------------------------------------------------------
-set (mod_files
- ${MOD_BUILD_DIR}/h5ds.mod
- ${MOD_BUILD_DIR}/h5tb.mod
- ${MOD_BUILD_DIR}/h5tb_const.mod
- ${MOD_BUILD_DIR}/h5lt.mod
- ${MOD_BUILD_DIR}/h5lt_const.mod
- ${MOD_BUILD_DIR}/h5im.mod
-)
-
-install (
- FILES
- ${mod_files}
- DESTINATION
- ${HDF5_INSTALL_INCLUDE_DIR}/static
- COMPONENT
- fortheaders
-)
+if (NOT ONLY_SHARED_LIBS)
+ set (mod_files
+ ${MOD_BUILD_DIR}/h5ds.mod
+ ${MOD_BUILD_DIR}/h5tb.mod
+ ${MOD_BUILD_DIR}/h5tb_const.mod
+ ${MOD_BUILD_DIR}/h5lt.mod
+ ${MOD_BUILD_DIR}/h5lt_const.mod
+ ${MOD_BUILD_DIR}/h5im.mod
+ )
+ install (
+ FILES
+ ${mod_files}
+ DESTINATION
+ ${HDF5_INSTALL_INCLUDE_DIR}/static
+ COMPONENT
+ fortheaders
+ )
+endif ()
if (BUILD_SHARED_LIBS)
set (modsh_files
${MODSH_BUILD_DIR}/h5ds.mod
@@ -285,8 +293,10 @@ if (HDF5_EXPORTED_TARGETS)
INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries)
#INSTALL_TARGET_PDB (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries)
endif ()
- INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries)
- #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries)
+ if (NOT ONLY_SHARED_LIBS)
+ INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries)
+ #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries)
+ endif ()
install (
TARGETS
diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90
index 2dca479..5488bb2 100644
--- a/hl/fortran/src/H5DSff.F90
+++ b/hl/fortran/src/H5DSff.F90
@@ -304,7 +304,7 @@ CONTAINS
IMPLICIT NONE
INTEGER(hid_t), INTENT(in) :: did ! The dataset
INTEGER , INTENT(in) :: idx ! The dimension
- CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: label ! The label
+ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: label ! The label
INTEGER(SIZE_T), INTENT(in) :: label_len ! Length of label
END FUNCTION H5DSset_label_c
END INTERFACE
@@ -337,11 +337,11 @@ CONTAINS
IMPLICIT NONE
- INTEGER(hid_t), INTENT(in) :: did ! The dataget
- INTEGER , INTENT(in) :: idx ! The dimension
- CHARACTER(LEN=*), INTENT(in) :: label ! The label
- INTEGER(size_t) , INTENT(inout) :: size ! The length of the label buffer
- INTEGER :: errcode ! Error code
+ INTEGER(hid_t), INTENT(in) :: did ! The dataget
+ INTEGER , INTENT(in) :: idx ! The dimension
+ CHARACTER(LEN=*), INTENT(INOUT) :: label ! The label
+ INTEGER(size_t) , INTENT(INOUT) :: size ! The length of the label buffer
+ INTEGER :: errcode ! Error code
INTEGER :: c_idx
INTERFACE
@@ -352,7 +352,7 @@ CONTAINS
IMPLICIT NONE
INTEGER(hid_t), INTENT(in) :: did ! The dataget
INTEGER , INTENT(in) :: idx ! The dimension
- CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: label ! The label
+ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(INOUT) :: label ! The label
INTEGER(SIZE_T), INTENT(inout) :: size ! Length of label
END FUNCTION H5DSget_label_c
END INTERFACE
@@ -386,8 +386,8 @@ CONTAINS
IMPLICIT NONE
INTEGER(hid_t), INTENT(in) :: did ! The dataget
- CHARACTER(LEN=*), INTENT(out) :: name ! The name
- INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer
+ CHARACTER(LEN=*), INTENT(INOUT) :: name ! The name
+ INTEGER(size_t) , INTENT(INOUT) :: size ! The length of the name buffer
INTEGER :: errcode ! Error code
INTERFACE
@@ -397,7 +397,7 @@ CONTAINS
IMPORT :: HID_T, SIZE_T
IMPLICIT NONE
INTEGER(hid_t), INTENT(in) :: did ! The dataget
- CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(out) :: name ! The name
+ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(INOUT) :: name ! The name
INTEGER(SIZE_T), INTENT(inout) :: size ! Length of name
END FUNCTION H5DSget_scale_name_c
END INTERFACE
@@ -426,10 +426,10 @@ CONTAINS
SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode)
IMPLICIT NONE
- INTEGER(hid_t), INTENT(in) :: did ! the dataset
- INTEGER , INTENT(in) :: idx ! the dimension of did to query
- INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did
- INTEGER :: errcode ! error code
+ INTEGER(hid_t), INTENT(in) :: did ! the dataset
+ INTEGER , INTENT(in) :: idx ! the dimension of did to query
+ INTEGER , INTENT(INOUT) :: num_scales ! the number of Dimension Scales associated with did
+ INTEGER :: errcode ! error code
INTEGER :: c_idx
INTERFACE
@@ -437,9 +437,9 @@ CONTAINS
BIND(C,NAME='h5dsget_num_scales_c')
IMPORT :: HID_T
IMPLICIT NONE
- INTEGER(hid_t), INTENT(in) :: did ! the dataset
- INTEGER , INTENT(in) :: idx ! the dimension of did to query
- INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did
+ INTEGER(hid_t), INTENT(in) :: did ! the dataset
+ INTEGER , INTENT(in) :: idx ! the dimension of did to query
+ INTEGER , INTENT(INOUT) :: num_scales ! the number of Dimension Scales associated with did
END FUNCTION H5DSget_num_scales_c
END INTERFACE
diff --git a/hl/fortran/src/H5HL_buildiface.F90 b/hl/fortran/src/H5HL_buildiface.F90
index dda8d56..1c5d9c8 100644
--- a/hl/fortran/src/H5HL_buildiface.F90
+++ b/hl/fortran/src/H5HL_buildiface.F90
@@ -293,7 +293,7 @@ PROGRAM H5HL_buildiface
WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name'
WRITE(11,'(A)') ' INTEGER(hid_t), INTENT(in) :: type_id'
WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims'
- WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf'
+ WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf'
WRITE(11,'(A)') ' INTEGER :: errcode '
WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr'
WRITE(11,'(A)') ' INTEGER(size_t) :: namelen'
@@ -354,7 +354,7 @@ PROGRAM H5HL_buildiface
WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id'
WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name'
WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims'
- WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf'
+ WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf'
WRITE(11,'(A)') ' INTEGER :: errcode '
WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr'
WRITE(11,'(A)') ' INTEGER(size_t) :: namelen'
@@ -414,7 +414,7 @@ PROGRAM H5HL_buildiface
WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id'
WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name'
WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims'
- WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf'
+ WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf'
WRITE(11,'(A)') ' INTEGER :: errcode '
WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr'
WRITE(11,'(A)') ' INTEGER(size_t) :: namelen'
@@ -510,7 +510,7 @@ PROGRAM H5HL_buildiface
WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name'
WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims'
WRITE(11,'(A)') ' INTEGER(hid_t), INTENT(in) :: type_id'
- WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf'
+ WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf'
WRITE(11,'(A)') ' INTEGER :: errcode '
WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr'
WRITE(11,'(A)') ' INTEGER(size_t) :: namelen'
@@ -540,7 +540,7 @@ PROGRAM H5HL_buildiface
WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id'
WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name'
WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims'
- WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf'
+ WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf'
WRITE(11,'(A)') ' INTEGER :: errcode '
WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr'
WRITE(11,'(A)') ' INTEGER(size_t) :: namelen'
@@ -712,7 +712,7 @@ PROGRAM H5HL_buildiface
WRITE(11,'(A)') ' INTEGER(hsize_t), INTENT(in) :: start'
WRITE(11,'(A)') ' INTEGER(hsize_t), INTENT(in) :: nrecords'
WRITE(11,'(A)') ' INTEGER(size_t), INTENT(in) :: type_size'
- WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN), DIMENSION(*), TARGET :: buf'
+ WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT), DIMENSION(*), TARGET :: buf'
WRITE(11,'(A)') ' INTEGER :: errcode '
WRITE(11,'(A)') ' INTEGER(size_t) :: namelen'
WRITE(11,'(A)') ' INTEGER(size_t) :: namelen1'
@@ -778,7 +778,7 @@ PROGRAM H5HL_buildiface
WRITE(11,'(A)') ' INTEGER(hsize_t), INTENT(in) :: start'
WRITE(11,'(A)') ' INTEGER(hsize_t), INTENT(in) :: nrecords'
WRITE(11,'(A)') ' INTEGER(size_t), INTENT(in) :: type_size'
- WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN), DIMENSION(*), TARGET :: buf'
+ WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT), DIMENSION(*), TARGET :: buf'
WRITE(11,'(A)') ' INTEGER :: errcode '
WRITE(11,'(A)') ' INTEGER(size_t) :: namelen'
WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr'
@@ -809,7 +809,7 @@ PROGRAM H5HL_buildiface
WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(in) :: field_name'
WRITE(11,'(A)') ' INTEGER(hid_t), INTENT(in) :: field_type'
WRITE(11,'(A)') ' INTEGER, INTENT(in) :: field_index'
- WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'), INTENT(in), DIMENSION(*), TARGET :: buf'
+ WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'), INTENT(IN), DIMENSION(*), TARGET :: buf'
WRITE(11,'(A)') ' INTEGER(size_t) :: namelen'
WRITE(11,'(A)') ' INTEGER(size_t) :: namelen1'
WRITE(11,'(A)') ' INTEGER :: errcode'
diff --git a/hl/fortran/src/H5IMff.F90 b/hl/fortran/src/H5IMff.F90
index 6646828..ac4b794 100644
--- a/hl/fortran/src/H5IMff.F90
+++ b/hl/fortran/src/H5IMff.F90
@@ -539,7 +539,7 @@ CONTAINS
INTEGER, INTENT(in) :: pal_number ! palette number
INTEGER(hsize_t), DIMENSION(*), INTENT(inout) :: dims ! dimensions
INTEGER :: errcode ! error code
- INTEGER(size_t) :: namelen ! name length
+ INTEGER(size_t) :: namelen ! name length
INTERFACE
INTEGER FUNCTION h5imget_palette_info_c(loc_id,namelen,dset_name,pal_number,dims) &
@@ -551,7 +551,7 @@ CONTAINS
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset
INTEGER, INTENT(in) :: pal_number ! palette number
INTEGER(hsize_t), DIMENSION(*), INTENT(inout) :: dims ! dimensions
- INTEGER(size_t) :: namelen ! name length
+ INTEGER(size_t) :: namelen ! name length
END FUNCTION h5imget_palette_info_c
END INTERFACE
diff --git a/hl/fortran/src/H5TBff.F90 b/hl/fortran/src/H5TBff.F90
index 2575b24..40adf95 100644
--- a/hl/fortran/src/H5TBff.F90
+++ b/hl/fortran/src/H5TBff.F90
@@ -532,7 +532,7 @@ CONTAINS
INTEGER(hsize_t), INTENT(in) :: start ! start record
INTEGER(hsize_t), INTENT(in) :: nrecords ! records
INTEGER(size_t), INTENT(in) :: type_size ! type size
- INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer
+ INTEGER, INTENT(INOUT), DIMENSION(*), TARGET :: buf ! data buffer
INTEGER :: errcode ! error code
INTEGER(size_t) :: namelen ! name length
INTEGER(size_t) :: namelen1
@@ -564,7 +564,7 @@ CONTAINS
INTEGER(hsize_t), INTENT(in) :: start ! start record
INTEGER(hsize_t), INTENT(in) :: nrecords ! records
INTEGER(size_t), INTENT(in) :: type_size ! type size
- CHARACTER(LEN=*), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer
+ CHARACTER(LEN=*), INTENT(INOUT), DIMENSION(*), TARGET :: buf ! data buffer
INTEGER :: errcode ! error code
INTEGER(size_t) :: namelen ! name length
INTEGER(size_t) :: namelen1 ! name length
@@ -687,7 +687,7 @@ CONTAINS
INTEGER(hsize_t), INTENT(in) :: start ! start record
INTEGER(hsize_t), INTENT(in) :: nrecords ! records
INTEGER(size_t), INTENT(in) :: type_size ! type size
- INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer
+ INTEGER, INTENT(INOUT), DIMENSION(*), TARGET :: buf ! data buffer
INTEGER :: errcode ! error code
INTEGER(size_t) :: namelen ! name length
TYPE(C_PTR) :: f_ptr
@@ -716,7 +716,7 @@ CONTAINS
INTEGER(hsize_t), INTENT(in) :: start ! start record
INTEGER(hsize_t), INTENT(in) :: nrecords ! records
INTEGER(size_t), INTENT(in) :: type_size ! type size
- CHARACTER(LEN=*), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer
+ CHARACTER(LEN=*), INTENT(INOUT), DIMENSION(*), TARGET :: buf ! data buffer
INTEGER :: errcode ! error code
INTEGER(size_t) :: namelen ! name length
TYPE(C_PTR) :: f_ptr
@@ -939,10 +939,10 @@ CONTAINS
INTEGER(size_t), DIMENSION(nfields), INTENT(inout) :: field_offsets ! field offsets
INTEGER(size_t), INTENT(inout):: type_size ! type size
INTEGER :: errcode ! error code
- INTEGER, OPTIONAL :: maxlen_out ! maximum character len of the field names
+ INTEGER(size_t), OPTIONAL :: maxlen_out ! maximum character len of the field names
INTEGER(size_t) :: namelen ! name length
INTEGER(size_t), DIMENSION(nfields) :: namelen2 ! name lengths
- INTEGER(hsize_t) :: i ! general purpose integer
+ INTEGER(hsize_t) :: i ! general purpose integer
INTEGER(size_t) :: maxlen
INTEGER(size_t) :: c_maxlen_out
diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in
index 7f8f672..6e34b95 100644
--- a/hl/fortran/src/Makefile.in
+++ b/hl/fortran/src/Makefile.in
@@ -515,7 +515,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -538,9 +537,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -567,6 +569,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -621,6 +624,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -645,7 +649,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -762,29 +765,29 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-LT_VERS_INTERFACE = 104
+LT_VERS_INTERFACE = 105
LT_VERS_REVISION = 0
-LT_VERS_AGE = 1
-LT_CXX_VERS_INTERFACE = 104
+LT_VERS_AGE = 2
+LT_CXX_VERS_INTERFACE = 105
LT_CXX_VERS_REVISION = 0
-LT_CXX_VERS_AGE = 1
+LT_CXX_VERS_AGE = 2
LT_F_VERS_INTERFACE = 102
-LT_F_VERS_REVISION = 0
+LT_F_VERS_REVISION = 1
LT_F_VERS_AGE = 0
LT_HL_VERS_INTERFACE = 101
-LT_HL_VERS_REVISION = 2
+LT_HL_VERS_REVISION = 3
LT_HL_VERS_AGE = 1
LT_HL_CXX_VERS_INTERFACE = 101
-LT_HL_CXX_VERS_REVISION = 3
+LT_HL_CXX_VERS_REVISION = 4
LT_HL_CXX_VERS_AGE = 1
LT_HL_F_VERS_INTERFACE = 100
-LT_HL_F_VERS_REVISION = 4
+LT_HL_F_VERS_REVISION = 5
LT_HL_F_VERS_AGE = 0
LT_JAVA_VERS_INTERFACE = 104
-LT_JAVA_VERS_REVISION = 0
+LT_JAVA_VERS_REVISION = 1
LT_JAVA_VERS_AGE = 4
LT_TOOLS_VERS_INTERFACE = 101
-LT_TOOLS_VERS_REVISION = 2
+LT_TOOLS_VERS_REVISION = 3
LT_TOOLS_VERS_AGE = 1
# Our main target, the high-level fortran library
@@ -1438,7 +1441,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt
index 923989d..c152142 100644
--- a/hl/fortran/test/CMakeLists.txt
+++ b/hl/fortran/test/CMakeLists.txt
@@ -13,18 +13,10 @@ set (H5_TESTS
macro (ADD_H5_FORTRAN_EXE file)
add_executable (hl_f90_${file} ${file}.F90)
- target_include_directories (hl_f90_${file}
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
- )
target_compile_options(hl_f90_${file}
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
- target_link_libraries (hl_f90_${file}
- PRIVATE
- ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}
- )
# set_property(TARGET hl_f90_${file} APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
# )
@@ -34,35 +26,30 @@ macro (ADD_H5_FORTRAN_EXE file)
if(MSVC)
set_property(TARGET hl_f90_${file} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
- set_target_properties (hl_f90_${file} PROPERTIES
- LINKER_LANGUAGE Fortran
- FOLDER test/hl/fortran
- Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
- )
- if (BUILD_SHARED_LIBS)
- add_executable (hl_f90_${file}-shared ${file}.F90)
- target_include_directories (hl_f90_${file}-shared
+ if (NOT BUILD_SHARED_LIBS)
+ target_include_directories (hl_f90_${file}
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
)
- target_compile_options(hl_f90_${file}-shared
+ target_link_libraries (hl_f90_${file}
PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}
+ )
+ set_target_properties (hl_f90_${file} PROPERTIES
+ LINKER_LANGUAGE Fortran
+ FOLDER test/hl/fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
+ )
+ else ()
+ target_include_directories (hl_f90_${file}
+ PRIVATE
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
)
- target_link_libraries (hl_f90_${file}-shared
+ target_link_libraries (hl_f90_${file}
PRIVATE
${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}
)
-# set_property(TARGET hl_f90_${file}-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET hl_f90_${file}-shared APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
- if(MSVC)
- set_property(TARGET hl_f90_${file}-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
- endif()
- set_target_properties (hl_f90_${file}-shared PROPERTIES
+ set_target_properties (hl_f90_${file} PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/hl/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
@@ -70,8 +57,8 @@ macro (ADD_H5_FORTRAN_EXE file)
endif ()
endmacro ()
-foreach (test ${H5_TESTS})
- ADD_H5_FORTRAN_EXE(${test})
+foreach (h5_test ${H5_TESTS})
+ ADD_H5_FORTRAN_EXE(${h5_test})
endforeach ()
include (CMakeTests.cmake)
diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake
index 04a49dc..0760b92 100644
--- a/hl/fortran/test/CMakeTests.cmake
+++ b/hl/fortran/test/CMakeTests.cmake
@@ -16,11 +16,32 @@
##############################################################################
##############################################################################
+set (test_hl_fortran_CLEANFILES
+ dsetf1.h5
+ dsetf2.h5
+ dsetf3.h5
+ dsetf4.h5
+ dsetf5.h5
+ f1img.h5
+ f1tab.h5
+ f2tab.h5
+ tstds.h5
+)
+
+# Remove any output file left over from previous test run
+add_test (
+ NAME HL_FORTRAN_test-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove ${test_hl_fortran_CLEANFILES}
+)
+set_tests_properties (HL_FORTRAN_test-clear-objects PROPERTIES FIXTURES_SETUP clear_HL_FORTRAN_test)
+
macro (ADD_H5_FORTRAN_TEST file)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME HL_FORTRAN_f90_${file} COMMAND $<TARGET_FILE:hl_f90_${file}>)
+ add_test (NAME HL_FORTRAN_f90_${file} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_f90_${file}>)
else ()
add_test (NAME HL_FORTRAN_f90_${file} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:hl_f90_${file}>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -31,62 +52,11 @@ macro (ADD_H5_FORTRAN_TEST file)
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- set_tests_properties (HL_FORTRAN_f90_${file} PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects)
- if (BUILD_SHARED_LIBS)
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME HL_FORTRAN_f90_${file}-shared COMMAND $<TARGET_FILE:hl_f90_${file}-shared>)
- else ()
- add_test (NAME HL_FORTRAN_f90_${file}-shared COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:hl_f90_${file}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=hl_f90_${file}-shared.txt"
- #-D "TEST_REFERENCE=hl_f90_${file}-shared.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
- set_tests_properties (HL_FORTRAN_f90_${file}-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects)
- endif ()
-endmacro ()
-
-# Remove any output file left over from previous test run
-add_test (
- NAME HL_FORTRAN_test-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- dsetf1.h5
- dsetf2.h5
- dsetf3.h5
- dsetf4.h5
- dsetf5.h5
- f1img.h5
- f1tab.h5
- f2tab.h5
- tstds.h5
-)
-
-if (BUILD_SHARED_LIBS)
- add_test (
- NAME HL_FORTRAN_test-shared-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- dsetf1.h5
- dsetf2.h5
- dsetf3.h5
- dsetf4.h5
- dsetf5.h5
- f1img.h5
- f1tab.h5
- f2tab.h5
- tstds.h5
+ set_tests_properties (HL_FORTRAN_f90_${file} PROPERTIES
+ FIXTURES_REQUIRED clear_HL_FORTRAN_test
)
- set_tests_properties (HL_FORTRAN_test-shared-clear-objects
- PROPERTIES DEPENDS "HL_FORTRAN_f90_tsttable;HL_FORTRAN_f90_tstimage;HL_FORTRAN_f90_tstlite;HL_FORTRAN_f90_tstds"
- )
-endif ()
+endmacro ()
-foreach (test ${H5_TESTS})
- ADD_H5_FORTRAN_TEST(${test})
+foreach (h5_test ${H5_TESTS})
+ ADD_H5_FORTRAN_TEST(${h5_test})
endforeach ()
diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in
index c857de9..9a9f2eb 100644
--- a/hl/fortran/test/Makefile.in
+++ b/hl/fortran/test/Makefile.in
@@ -504,7 +504,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -527,9 +526,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -556,6 +558,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -610,6 +613,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -634,7 +638,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1316,7 +1319,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/fortran/test/tstimage.F90 b/hl/fortran/test/tstimage.F90
index d6bd1e2..8586e68 100644
--- a/hl/fortran/test/tstimage.F90
+++ b/hl/fortran/test/tstimage.F90
@@ -62,7 +62,7 @@ character(len=4), parameter :: dsetname2 = "img2" ! dataset name
character(len=15), parameter :: il ="INTERLACE_PIXEL"! dataset name
integer(hid_t) :: file_id ! file identifier
integer(hsize_t), parameter :: width = 500 ! width of image
-integer(hsize_t), parameter :: height = 200 ! height of image
+integer(hsize_t), parameter :: height = 270 ! height of image
integer, parameter :: pal_entries = 9 ! palette number of entries
integer, dimension(width*height) :: buf1 ! data buffer
integer, dimension(width*height) :: bufr1 ! data buffer
diff --git a/hl/fortran/test/tsttable.F90 b/hl/fortran/test/tsttable.F90
index 38cfa86..840d33d 100644
--- a/hl/fortran/test/tsttable.F90
+++ b/hl/fortran/test/tsttable.F90
@@ -93,7 +93,7 @@ SUBROUTINE test_table1()
INTEGER(SIZE_T), DIMENSION(1:nfields) :: field_offsetr ! field offset
INTEGER(SIZE_T), DIMENSION(1:nfields) :: field_sizesr ! field sizes
INTEGER(SIZE_T) :: type_sizeout = 0 ! size of the datatype
- INTEGER :: maxlen = 0 ! max chararter length of a field name
+ INTEGER(SIZE_T) :: maxlen = 0 ! max character length of a field name
INTEGER :: Cs_sizeof_double = H5_SIZEOF_DOUBLE ! C's sizeof double
INTEGER :: SIZEOF_X
LOGICAL :: Exclude_double
diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt
index bf0f6ff..9bce694 100644
--- a/hl/src/CMakeLists.txt
+++ b/hl/src/CMakeLists.txt
@@ -32,21 +32,23 @@ set (HL_PRIVATE_HEADERS
${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.h
)
-add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS} ${HL_PRIVATE_HEADERS})
-target_include_directories(${HDF5_HL_LIB_TARGET}
- PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC)
-target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
-H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC 0)
-set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl)
-set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}")
-set (install_targets ${HDF5_HL_LIB_TARGET})
+if (NOT ONLY_SHARED_LIBS)
+ add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS} ${HL_PRIVATE_HEADERS})
+ target_include_directories (${HDF5_HL_LIB_TARGET}
+ PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC)
+ target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
+ H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC 0)
+ set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl)
+ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}")
+ set (install_targets ${HDF5_HL_LIB_TARGET})
+endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SOURCES} ${HL_HEADERS} ${HL_PRIVATE_HEADERS})
- target_include_directories(${HDF5_HL_LIBSH_TARGET}
+ target_include_directories (${HDF5_HL_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
@@ -80,7 +82,9 @@ if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_HL_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries)
endif ()
- INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries)
+ if (NOT ONLY_SHARED_LIBS)
+ INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hllibraries)
+ endif ()
install (
TARGETS
@@ -107,7 +111,9 @@ set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}")
set (_PKG_CONFIG_LIBS_PRIVATE)
-set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_HL_LIB_CORENAME}")
+if (NOT ONLY_SHARED_LIBS)
+ set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_HL_LIB_CORENAME}")
+endif ()
if (BUILD_SHARED_LIBS)
set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_HL_LIB_CORENAME}")
endif ()
@@ -126,7 +132,7 @@ install (
COMPONENT hllibraries
)
-if (NOT WIN32)
+if (NOT WIN32 AND NOT MINGW)
set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER})
configure_file (
${HDF_RESOURCES_DIR}/libh5cc.in
diff --git a/hl/src/H5LDprivate.h b/hl/src/H5LDprivate.h
index b52928b..203bcea 100644
--- a/hl/src/H5LDprivate.h
+++ b/hl/src/H5LDprivate.h
@@ -19,9 +19,9 @@
#include "H5LDpublic.h"
/* Store information for a field in <list_of_fields> for a compound data type */
-/*
+/*
* Note: This data structure is used by both H5LD.c and hl/tools/h5watch
- * This declaration is repeated in tools/lib/h5tools_str.c
+ * This declaration is repeated in tools/lib/h5tools_str.c
*/
typedef struct H5LD_memb_t {
size_t tot_offset;
@@ -30,7 +30,10 @@ typedef struct H5LD_memb_t {
char **names;
} H5LD_memb_t;
-/*
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
* Note that these two private routines are called by hl/tools/h5watch.
* Have considered the following options:
* 1) Repeat the coding in both H5LD.c and h5watch
@@ -40,8 +43,12 @@ typedef struct H5LD_memb_t {
* #2: these two routines are too specific to be made as public routines
* Decide to do #3 at this point of time after some discussion.
*/
-void H5LD_clean_vector(H5LD_memb_t *listv[]);
-int H5LD_construct_vector(char *fields, H5LD_memb_t *listv[], hid_t par_tid);
+H5_HLDLL void H5LD_clean_vector(H5LD_memb_t *listv[]);
+H5_HLDLL int H5LD_construct_vector(char *fields, H5LD_memb_t *listv[], hid_t par_tid);
+
+#ifdef __cplusplus
+}
+#endif
#endif /* end _H5LDprivate_H */
diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in
index 44c42cc..2f50c40 100644
--- a/hl/src/Makefile.in
+++ b/hl/src/Makefile.in
@@ -486,7 +486,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -509,9 +508,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -538,6 +540,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -592,6 +595,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -616,7 +620,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -733,29 +736,29 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-LT_VERS_INTERFACE = 104
+LT_VERS_INTERFACE = 105
LT_VERS_REVISION = 0
-LT_VERS_AGE = 1
-LT_CXX_VERS_INTERFACE = 104
+LT_VERS_AGE = 2
+LT_CXX_VERS_INTERFACE = 105
LT_CXX_VERS_REVISION = 0
-LT_CXX_VERS_AGE = 1
+LT_CXX_VERS_AGE = 2
LT_F_VERS_INTERFACE = 102
-LT_F_VERS_REVISION = 0
+LT_F_VERS_REVISION = 1
LT_F_VERS_AGE = 0
LT_HL_VERS_INTERFACE = 101
-LT_HL_VERS_REVISION = 2
+LT_HL_VERS_REVISION = 3
LT_HL_VERS_AGE = 1
LT_HL_CXX_VERS_INTERFACE = 101
-LT_HL_CXX_VERS_REVISION = 3
+LT_HL_CXX_VERS_REVISION = 4
LT_HL_CXX_VERS_AGE = 1
LT_HL_F_VERS_INTERFACE = 100
-LT_HL_F_VERS_REVISION = 4
+LT_HL_F_VERS_REVISION = 5
LT_HL_F_VERS_AGE = 0
LT_JAVA_VERS_INTERFACE = 104
-LT_JAVA_VERS_REVISION = 0
+LT_JAVA_VERS_REVISION = 1
LT_JAVA_VERS_AGE = 4
LT_TOOLS_VERS_INTERFACE = 101
-LT_TOOLS_VERS_REVISION = 2
+LT_TOOLS_VERS_REVISION = 3
LT_TOOLS_VERS_AGE = 1
# This library is our main target.
@@ -1339,7 +1342,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt
index 238b5e1..2959c6c 100644
--- a/hl/test/CMakeLists.txt
+++ b/hl/test/CMakeLists.txt
@@ -17,29 +17,26 @@ configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ON
# --------------------------------------------------------------------
# Macro used to add a unit test
# --------------------------------------------------------------------
-MACRO (HL_ADD_EXE hl_name)
+macro (HL_ADD_EXE hl_name)
add_executable (hl_${hl_name} ${hl_name}.c)
- 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_C_PROPERTIES (hl_${hl_name} STATIC)
- target_link_libraries (hl_${hl_name} PRIVATE
- ${HDF5_HL_LIB_TARGET}
- ${HDF5_TEST_LIB_TARGET}
- ${HDF5_LIB_TARGET}
- )
- set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl)
-ENDMACRO ()
-
-MACRO (HL_ADD_SHEXE hl_name)
- add_executable (hl_${hl_name} ${hl_name}.c)
- 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_C_PROPERTIES (hl_${hl_name} SHARED)
- target_link_libraries (hl_${hl_name} PRIVATE
- ${HDF5_HL_LIBSH_TARGET}
- ${HDF5_TEST_LIBSH_TARGET}
- ${HDF5_LIBSH_TARGET}
- )
+ 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}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (hl_${hl_name} STATIC)
+ target_link_libraries (hl_${hl_name} PRIVATE
+ ${HDF5_HL_LIB_TARGET}
+ ${HDF5_TEST_LIB_TARGET}
+ ${HDF5_LIB_TARGET}
+ )
+ else ()
+ TARGET_C_PROPERTIES (hl_${hl_name} SHARED)
+ target_link_libraries (hl_${hl_name} PRIVATE
+ ${HDF5_HL_LIBSH_TARGET}
+ ${HDF5_TEST_LIBSH_TARGET}
+ ${HDF5_LIBSH_TARGET}
+ )
+ endif ()
set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl)
-ENDMACRO ()
+endmacro ()
HL_ADD_EXE (test_lite)
HL_ADD_EXE (test_image)
@@ -52,22 +49,31 @@ 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_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_C_PROPERTIES (hl_test_packet STATIC)
-target_link_libraries (hl_test_packet PRIVATE
- ${HDF5_HL_LIB_TARGET}
- ${HDF5_TEST_LIB_TARGET}
- ${HDF5_LIB_TARGET}
-)
+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}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (hl_test_packet STATIC)
+ target_link_libraries (hl_test_packet PRIVATE
+ ${HDF5_HL_LIB_TARGET}
+ ${HDF5_TEST_LIB_TARGET}
+ ${HDF5_LIB_TARGET}
+ )
+else ()
+ TARGET_C_PROPERTIES (hl_test_packet SHARED)
+ target_link_libraries (hl_test_packet PRIVATE
+ ${HDF5_HL_LIBSH_TARGET}
+ ${HDF5_TEST_LIBSH_TARGET}
+ ${HDF5_LIBSH_TARGET}
+ )
+endif ()
set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl)
# --------------------------------------------------------------------
# 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
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (hl_gen_test_ds gen_test_ds.c)
- 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_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}
@@ -77,7 +83,7 @@ if (HDF5_BUILD_GENERATORS)
set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen)
add_executable (hl_gen_test_ld gen_test_ld.c)
- 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_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}
diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake
index 4e945bc..716a3d7 100644
--- a/hl/test/CMakeTests.cmake
+++ b/hl/test/CMakeTests.cmake
@@ -43,14 +43,53 @@ foreach (h5_file ${HL_REFERENCE_TEST_FILES})
endforeach ()
add_custom_target(hl_test_files ALL COMMENT "Copying files needed by hl_test tests" DEPENDS ${hl_test_files_list})
+# Remove any output file left over from previous test run
+set (test_hl_CLEANFILES
+ combine_tables1.h5
+ combine_tables2.h5
+ file_img1.h5
+ file_img2.h5
+ test_append.h5
+ h5do_compat.h5
+ test_detach.h5
+ test_ds1.h5
+ test_ds2.h5
+ test_ds3.h5
+ test_ds4.h5
+ test_ds5.h5
+ test_ds6.h5
+ test_ds7.h5
+ test_ds8.h5
+ test_ds9.h5
+ test_ds10.h5
+ test_image1.h5
+ test_image2.h5
+ test_image3.h5
+ test_lite1.h5
+ test_lite2.h5
+ test_lite3.h5
+ test_lite4.h5
+ test_packet_compress.h5
+ test_packet_table.h5
+ test_packet_table_vlen.h5
+ testfl_packet_table_vlen.h5
+ test_table.h5
+)
+add_test (
+ NAME HL_test-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${test_hl_CLEANFILES}
+)
+set_tests_properties (HL_test-clear-objects PROPERTIES FIXTURES_SETUP clear_test_hl)
+
# --------------------------------------------------------------------
# Macro used to add a unit test
# --------------------------------------------------------------------
macro (HL_ADD_TEST hl_name)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME HL_${hl_name} COMMAND $<TARGET_FILE:hl_${hl_name}>)
+ add_test (NAME HL_${hl_name} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_${hl_name}>)
else ()
add_test (NAME HL_${hl_name} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:hl_${hl_name}>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -61,54 +100,13 @@ macro (HL_ADD_TEST hl_name)
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (HL_${hl_name} PROPERTIES DEPENDS ${last_test}
+ set_tests_properties (HL_${hl_name} PROPERTIES
+ FIXTURES_REQUIRED clear_test_hl
ENVIRONMENT "srcdir=${HDF5_HL_TEST_BINARY_DIR}"
WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR}
- )
- endif ()
+ )
endmacro ()
-# Remove any output file left over from previous test run
-add_test (
- NAME HL_test-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- combine_tables1.h5
- combine_tables2.h5
- file_img1.h5
- file_img2.h5
- test_append.h5
- h5do_compat.h5
- test_detach.h5
- test_ds1.h5
- test_ds2.h5
- test_ds3.h5
- test_ds4.h5
- test_ds5.h5
- test_ds6.h5
- test_ds7.h5
- test_ds8.h5
- test_ds9.h5
- test_ds10.h5
- test_image1.h5
- test_image2.h5
- test_image3.h5
- test_lite1.h5
- test_lite2.h5
- test_lite3.h5
- test_lite4.h5
- test_packet_compress.h5
- test_packet_table.h5
- test_packet_table_vlen.h5
- testfl_packet_table_vlen.h5
- test_table.h5
-)
-if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (HL_test-clear-objects PROPERTIES DEPENDS ${last_test})
-endif ()
-set (last_test "HL_test-clear-objects")
-
HL_add_test (test_lite )
HL_add_test (test_image)
HL_add_test (test_file_image)
diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in
index ab221ab..00f4e9b 100644
--- a/hl/test/Makefile.in
+++ b/hl/test/Makefile.in
@@ -538,7 +538,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -561,9 +560,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -590,6 +592,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -644,6 +647,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -668,7 +672,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1446,7 +1449,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c
index f8f1d39..285ab77 100644
--- a/hl/test/gen_test_ds.c
+++ b/hl/test/gen_test_ds.c
@@ -79,12 +79,12 @@ int main(int argc , char **argv)
if (argc < 2) {
- printf("Usage: gen_test [le | be]\n");
+ HDprintf("Usage: gen_test [le | be]\n");
return 1;
}
if ( argv[1] && (strcmp("le",argv[1])!=0) && (strcmp("be",argv[1])!=0) ) {
- printf("Usage: gen_test [le | be]\n");
+ HDprintf("Usage: gen_test [le | be]\n");
return 1;
}
@@ -103,11 +103,11 @@ int main(int argc , char **argv)
nerrors += test_long_scalenames(filename) < 0 ? 1 : 0;
if(nerrors) goto error;
- printf("Dimension scales file generation passed.\n");
+ HDprintf("Dimension scales file generation passed.\n");
return 0;
error:
- printf("***** %d DIMENSION SCALES FILE GENERATION FAILED! *****\n",nerrors);
+ HDprintf("***** %d DIMENSION SCALES FILE GENERATION FAILED! *****\n",nerrors);
return 1;
}
@@ -188,11 +188,11 @@ herr_t test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int id
if(H5DSis_attached(did, dsid, idx) == 0) {
if(H5DSattach_scale(did, dsid, idx) >= 0) {
if(H5DSis_attached(did, dsid, idx) > 0) {
- /* printf(" scale attached "); */
+ /* HDprintf(" scale attached "); */
ret_value = SUCCEED;
}
else if(H5DSis_attached(did, dsid, idx) == 0) {
- printf(" scale not attached ");
+ HDprintf(" scale not attached ");
}
}
}
@@ -281,7 +281,7 @@ static int test_long_attachscales(const char *filename)
strcpy(dsname, DATASET_NAME);
strcat(dsname, "al");
- TESTING2("test_long_attachscales");
+ HL_TESTING2("test_long_attachscales");
if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
@@ -342,7 +342,7 @@ static int test_duplicatelong_attachscales(const char *filename)
strcpy(dsname, DATASET_NAME);
strcat(dsname, "al2");
- TESTING2("test_duplicatelong_attachscales");
+ HL_TESTING2("test_duplicatelong_attachscales");
if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
@@ -406,7 +406,7 @@ static int test_long_scalenames(const char *filename) {
if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
- TESTING2("set long scale/cmp scale name");
+ HL_TESTING2("set long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
strcpy(scalename, DS_1_NAME);
strcat(scalename, "al");
@@ -483,7 +483,7 @@ static int test_samelong_scalenames(const char *filename) {
if((fid = open_test_file(filename)) < 0)
goto out;
- TESTING2("set same long scale/cmp scale name");
+ HL_TESTING2("set same long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
strcpy(scalename, DS_1_NAME);
strcat(scalename, "al");
@@ -554,7 +554,7 @@ static int test_foreign_scaleattached(const char *filename)
hid_t did = -1;
hid_t dsid = -1;
- TESTING2("test_foreign_scaleattached");
+ HL_TESTING2("test_foreign_scaleattached");
if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
goto out;
diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h
index f368b8e..85f47bd 100644
--- a/hl/test/h5hltest.h
+++ b/hl/test/h5hltest.h
@@ -28,8 +28,8 @@
#include "H5HLprivate2.h"
/* Macros used in HL tests */
-#define TESTING2(WHAT) {printf("%-70s", "Testing " WHAT); fflush(stdout);}
-#define TESTING3(WHAT) {printf("%-70s", "" WHAT); fflush(stdout);}
+#define HL_TESTING2(WHAT) {HDprintf("Testing %-62s", WHAT); HDfflush(stdout);}
+#define HL_TESTING3(WHAT) {HDprintf("Testing %-62s", WHAT); HDfflush(stdout);}
/* Implements verbose 'assert' with 'goto error' exit */
#define VERIFY(condition, string) do { if (!(condition)) FAIL_PUTS_ERROR(string) } while(0)
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 95178fc..79e6f45 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -1049,7 +1049,7 @@ herr_t test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int id
ret_value = SUCCEED;
}
else if(H5DSis_attached(did, dsid, idx) == 0) {
- printf(" scale not attached ");
+ HDprintf(" scale not attached ");
}
}
}
@@ -1138,7 +1138,7 @@ static int test_detachscales(void)
int rank3 = 3;
hsize_t dims[] = {1,2,3}; /*some bogus numbers, not important for the test*/
int *buf = NULL;
- char dname[10];
+ char dname[16];
int i;
/* This tests creates two three dimensional datasets; then it creates
@@ -1146,21 +1146,21 @@ static int test_detachscales(void)
and detach them to check that at the end there is no attributes
REFERENCE_LIST on a dimension scale and DIMENSION_LIST on a dataset */
- TESTING2("test_detachscales");
+ HL_TESTING2("test_detachscales");
if((fid = H5Fcreate("test_detach.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* make datasets; they are three dimensional*/
for (i=0; i < 2; i++) {
- sprintf(dname,"D%d", i);
+ HDsprintf(dname,"D%d", i);
if(H5LTmake_dataset_int(fid, dname, rank3, dims, buf) < 0)
goto out;
}
/* create datasets and make them dim. scales */
for (i=0; i < 4; i++) {
- sprintf(dname, "DS%d", i);
+ HDsprintf(dname, "DS%d", i);
if(H5LTmake_dataset_int(fid, dname, rank1, dims, buf) < 0)
goto out;
}
@@ -1280,7 +1280,7 @@ static int test_char_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac");
- TESTING2("test_char_attachscales");
+ HL_TESTING2("test_char_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1333,7 +1333,7 @@ static int test_short_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as");
- TESTING2("test_short_attachscales");
+ HL_TESTING2("test_short_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1410,7 +1410,7 @@ static int test_int_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
- TESTING2("test_int_attachscales");
+ HL_TESTING2("test_int_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1471,7 +1471,7 @@ static int test_long_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al");
- TESTING2("test_long_attachscales");
+ HL_TESTING2("test_long_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1528,7 +1528,7 @@ static int test_duplicatelong_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2");
- TESTING2("test_duplicatelong_attachscales");
+ HL_TESTING2("test_duplicatelong_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1585,7 +1585,7 @@ static int test_float_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af");
- TESTING2("test_float_attachscales");
+ HL_TESTING2("test_float_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1647,7 +1647,7 @@ static int test_numberofscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
- TESTING2("test_numberofscales");
+ HL_TESTING2("test_numberofscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1729,7 +1729,7 @@ static int test_char_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set char scale/cmp scale name");
+ HL_TESTING2("set char scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac");
@@ -1789,7 +1789,7 @@ static int test_short_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set short scale/cmp scale name");
+ HL_TESTING2("set short scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as");
@@ -1897,7 +1897,7 @@ static int test_int_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set int scale/cmp scale name");
+ HL_TESTING2("set int scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a");
@@ -1973,7 +1973,7 @@ static int test_long_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set long scale/cmp scale name");
+ HL_TESTING2("set long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al");
@@ -2041,7 +2041,7 @@ static int test_samelong_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set same long scale/cmp scale name");
+ HL_TESTING2("set same long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al");
@@ -2109,7 +2109,7 @@ static int test_float_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set float scale/cmp scale name");
+ HL_TESTING2("set float scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af");
@@ -2181,7 +2181,7 @@ static int test_foreign_scaleattached(const char *fileforeign)
hid_t dsid = -1;
const char *filename = H5_get_srcdir_filename(fileforeign);
- TESTING2("test_foreign_scaleattached");
+ HL_TESTING2("test_foreign_scaleattached");
if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
goto out;
@@ -2255,7 +2255,7 @@ static int test_simple(void)
char snames[3];
int i, j;
- printf("Testing API functions\n");
+ HDprintf("Testing API functions\n");
/*-------------------------------------------------------------------------
* create a file for the test
@@ -2426,7 +2426,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scales ");
+ HL_TESTING2("detach scales ");
/*-------------------------------------------------------------------------
@@ -2919,7 +2919,7 @@ static int test_simple(void)
if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for(j = 0; j < 5; j++) {
- sprintf(sname, "ds_%d", j);
+ HDsprintf(sname, "ds_%d", j);
if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSdetach_scale(did, dsid, DIM0) < 0)
@@ -2942,7 +2942,7 @@ static int test_simple(void)
if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0)
goto out;
for(j=0; j<5; j++) {
- sprintf(sname,"ds_%d",j);
+ HDsprintf(sname,"ds_%d",j);
if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did,dsid,DIM0) < 0)
@@ -3013,7 +3013,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING2("set/get label");
+ HL_TESTING2("set/get label");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
@@ -3103,7 +3103,7 @@ static int test_simple(void)
*/
- TESTING2("set scale/get scale name");
+ HL_TESTING2("set scale/get scale name");
if((dsid = H5Dopen2(fid,"ds_a_1", H5P_DEFAULT)) < 0)
goto out;
if(H5DSset_scale(dsid,"Latitude set 0") < 0)
@@ -3205,7 +3205,7 @@ static int test_simple(void)
*/
- TESTING2("iterate scales");
+ HL_TESTING2("iterate scales");
/*-------------------------------------------------------------------------
@@ -3740,7 +3740,7 @@ static int test_errors(void)
hid_t sidds = -1; /* space ID */
hsize_t pal_dims[] = {9,3};
- printf("Testing error conditions\n");
+ HDprintf("Testing error conditions\n");
/*-------------------------------------------------------------------------
* create a file, spaces, dataset and group ids
@@ -3771,7 +3771,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach a dataset to itself");
+ HL_TESTING2("attach a dataset to itself");
if(H5DSattach_scale(did, did, 0) == SUCCEED)
goto out;
@@ -3782,7 +3782,7 @@ static int test_errors(void)
* attempt to attach a group with a dataset, it should fail
*-------------------------------------------------------------------------
*/
- TESTING2("attach a group with a dataset");
+ HL_TESTING2("attach a group with a dataset");
if(H5DSattach_scale(gid,dsid,0)==SUCCEED)
goto out;
@@ -3793,7 +3793,7 @@ static int test_errors(void)
* attempt to attach a dataset with a group, it should fail
*-------------------------------------------------------------------------
*/
- TESTING2("attach a dataset with a group");
+ HL_TESTING2("attach a dataset with a group");
if(H5DSattach_scale(did,gid,0)==SUCCEED)
goto out;
@@ -3804,7 +3804,7 @@ static int test_errors(void)
* attempt to set scale for a group, it should fail
*-------------------------------------------------------------------------
*/
- TESTING2("set scale for a group");
+ HL_TESTING2("set scale for a group");
if(H5DSset_scale(gid,"scale 1")==SUCCEED)
goto out;
@@ -3834,7 +3834,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach a scale that has scales");
+ HL_TESTING2("attach a scale that has scales");
/* create the data space for the scale */
if((sidds = H5Screate_simple(rankds, s1_dim, NULL)) < 0)
@@ -3903,7 +3903,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach to a dataset that is a scale");
+ HL_TESTING2("attach to a dataset that is a scale");
/* open the previous written "ds_b", that is a scale */
if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
@@ -3930,7 +3930,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach to a dataset that is a reserved class dataset");
+ HL_TESTING2("attach to a dataset that is a reserved class dataset");
/* make an image */
if(H5IMmake_image_8bit(fid,"image",(hsize_t)100,(hsize_t)50,NULL) < 0)
@@ -3965,7 +3965,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("is scale");
+ HL_TESTING2("is scale");
/* open a non scale dataset */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -3999,7 +3999,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scale from dataset it is not attached to");
+ HL_TESTING2("detach scale from dataset it is not attached to");
/* open the previous written "ds_a" */
if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
@@ -4027,7 +4027,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scale from group");
+ HL_TESTING2("detach scale from group");
/* open the previous written "ds_a" */
if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
@@ -4055,7 +4055,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scale when scale is group");
+ HL_TESTING2("detach scale when scale is group");
/* open the previous written "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4119,7 +4119,7 @@ static int test_iterators(void)
char dname[30]; /* dataset name */
int i;
- printf("Testing iterators\n");
+ HDprintf("Testing iterators\n");
/*-------------------------------------------------------------------------
* create a file, spaces, dataset and group ids
@@ -4147,7 +4147,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate when the dataset has no scales ");
+ HL_TESTING2("iterate when the dataset has no scales ");
/* get the dataset id for "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4169,7 +4169,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate on dimension that is outside the rank ");
+ HL_TESTING2("iterate on dimension that is outside the rank ");
/* get the dataset id for "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4190,7 +4190,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate for dimension with many scales ");
+ HL_TESTING2("iterate for dimension with many scales ");
/* open the previously written "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4198,7 +4198,7 @@ static int test_iterators(void)
for(i=0; i<100; i++) {
/* make a DS */
- sprintf(dname,"ds_%d",i);
+ HDsprintf(dname,"ds_%d",i);
if(H5LTmake_dataset_int(fid,dname,rankds,s1_dim,NULL) < 0)
goto out;
/* open */
@@ -4227,7 +4227,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate on group ");
+ HL_TESTING2("iterate on group ");
/* open */
if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
@@ -4249,7 +4249,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate in deleted scales ");
+ HL_TESTING2("iterate in deleted scales ");
if(H5Ldelete(fid, "ds_0", H5P_DEFAULT) < 0)
goto out;
@@ -4311,7 +4311,7 @@ static int test_rank(void)
float buff[1]={1};
int i;
- printf("Testing ranks\n");
+ HDprintf("Testing ranks\n");
/*-------------------------------------------------------------------------
* create a file, a dataset, scales
@@ -4343,13 +4343,13 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach");
+ HL_TESTING2("attach");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
for(i=0; i<3; i++) {
- sprintf(name,"ds_a_%d",i);
+ HDsprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did,dsid,(unsigned)i) < 0)
@@ -4371,13 +4371,13 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach");
+ HL_TESTING2("detach");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
for(i=0; i<3; i++) {
- sprintf(name,"ds_a_%d",i);
+ HDsprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
if(H5DSdetach_scale(did,dsid,(unsigned)i) < 0)
@@ -4397,13 +4397,13 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach, set, get names, labels");
+ HL_TESTING2("attach, set, get names, labels");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
for(i=0; i<3; i++) {
- sprintf(name,"ds_a_%d",i);
+ HDsprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
if(H5DSset_scale(dsid,name) < 0)
@@ -4436,7 +4436,7 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach a scalar scale");
+ HL_TESTING2("attach a scalar scale");
/* create the data space for the dataset */
if((sid = H5Screate_simple(2, dimss, NULL)) < 0)
@@ -4517,7 +4517,7 @@ static int test_types(void)
const char *s1_str = "ABC";
const char *s2_str = "ABCD";
- printf("Testing scales with several datatypes\n");
+ HDprintf("Testing scales with several datatypes\n");
/*-------------------------------------------------------------------------
* create a file for the test
@@ -4549,7 +4549,7 @@ static int test_types(void)
*-------------------------------------------------------------------------
*/
- TESTING2("floating point and short scales");
+ HL_TESTING2("floating point and short scales");
/* get the dataset id for "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4612,7 +4612,7 @@ static int test_types(void)
*-------------------------------------------------------------------------
*/
- TESTING2("string scales");
+ HL_TESTING2("string scales");
/* get the dataset id for "dset_b" */
if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
@@ -4694,7 +4694,7 @@ static int test_data(void)
float fill=-99; /* fill value */
- printf("Testing reading ASCII data and generate HDF5 data with scales\n");
+ HDprintf("Testing reading ASCII data and generate HDF5 data with scales\n");
/*-------------------------------------------------------------------------
* create a file for the test
@@ -4709,7 +4709,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
- TESTING2("generating scales");
+ HL_TESTING2("generating scales");
/*-------------------------------------------------------------------------
* create datasets: 1 "data" dataset and 2 dimension scales
@@ -4870,18 +4870,18 @@ static int read_data( const char* fname,
/* read first data file */
f = HDfopen(data_file, "r");
if( f == NULL ) {
- printf( "Could not open file %s\n", data_file );
+ HDprintf( "Could not open file %s\n", data_file );
return -1;
}
for(i=0, nelms=1; i < ndims; i++) {
if(fscanf( f, "%s %u", str, &j) && HDferror(f)) {
- printf( "fscanf error in file %s\n", data_file );
+ HDprintf( "fscanf error in file %s\n", data_file );
HDfclose(f);
return -1;
} /* end if */
if(fscanf( f, "%d",&n ) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s\n", data_file );
+ HDprintf( "fscanf error in file %s\n", data_file );
HDfclose(f);
return -1;
} /* end if */
@@ -4892,14 +4892,14 @@ static int read_data( const char* fname,
*buf = (float*) HDmalloc (nelms * sizeof( float ));
if ( *buf == NULL ) {
- printf( "memory allocation failed\n" );
+ HDprintf( "memory allocation failed\n" );
HDfclose(f);
return -1;
}
for(j = 0; j < nelms; j++) {
if(fscanf( f, "%f",&val ) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s\n", data_file );
+ HDprintf( "fscanf error in file %s\n", data_file );
HDfclose(f);
return -1;
} /* end if */
@@ -4930,7 +4930,7 @@ static int test_errors2(void)
int nscales; /* number of scales in DIM */
int count; /* visitor data */
- printf("Testing parameter errors\n");
+ HDprintf("Testing parameter errors\n");
/*-------------------------------------------------------------------------
* create a file, a dataset, scales
@@ -4954,7 +4954,7 @@ static int test_errors2(void)
goto out;
- TESTING2("attach scales");
+ HL_TESTING2("attach scales");
/*-------------------------------------------------------------------------
@@ -4977,7 +4977,7 @@ static int test_errors2(void)
PASSED();
- TESTING2("detach scales");
+ HL_TESTING2("detach scales");
/*-------------------------------------------------------------------------
* detach with invalid indices
@@ -4998,7 +4998,7 @@ static int test_errors2(void)
PASSED();
- TESTING2("set/get label");
+ HL_TESTING2("set/get label");
/*-------------------------------------------------------------------------
* set/get label invalid indices
@@ -5023,7 +5023,7 @@ static int test_errors2(void)
PASSED();
- TESTING2("iterate scales");
+ HL_TESTING2("iterate scales");
/*-------------------------------------------------------------------------
@@ -5122,7 +5122,7 @@ static int test_attach_detach(void)
hid_t var1_id, var2_id, var3_id; /* DS component name */
hsize_t dims[RANK1] = {DIM1};
- TESTING2("permutations of attaching and detaching");
+ HL_TESTING2("permutations of attaching and detaching");
if((fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c
index d890481..1914a08 100644
--- a/hl/test/test_dset_append.c
+++ b/hl/test/test_dset_append.c
@@ -11,38 +11,39 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#include <math.h>
#include <stdlib.h>
#include <string.h>
+
#include "h5hltest.h"
#include "H5DOpublic.h"
-#include <math.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)
-# include H5_ZLIB_HEADER /* "zlib.h" */
+#include H5_ZLIB_HEADER /* "zlib.h" */
#endif
-#define FILE "test_append.h5"
-#define DNAME_NOTSET "dataset_notset"
-#define DNAME_UNLIM "dataset_unlim"
-#define DNAME_LESS "dataset_less"
-#define DNAME_VARY "dataset_vary"
-#define DNAME_ROW "dataset_row"
-#define DNAME_COLUMN "dataset_column"
-#define DBUGNAME1 "dataset_bug1"
-#define DBUGNAME2 "dataset_bug2"
+#define FILENAME "test_append.h5"
+#define DNAME_NOTSET "dataset_notset"
+#define DNAME_UNLIM "dataset_unlim"
+#define DNAME_LESS "dataset_less"
+#define DNAME_VARY "dataset_vary"
+#define DNAME_ROW "dataset_row"
+#define DNAME_COLUMN "dataset_column"
+#define DBUGNAME1 "dataset_bug1"
+#define DBUGNAME2 "dataset_bug2"
/*-------------------------------------------------------------------------
- * Function: test_dataset_append_notset
+ * Function: test_dataset_append_notset
*
- * Purpose: Verify that H5DOappend works properly with default dapl.
- * That is, H5Pset_append_flush() is not used to set boundary
- * and callback in dapl.
+ * Purpose: Verify that H5DOappend works properly with default dapl.
+ * That is, H5Pset_append_flush() is not used to set boundary
+ * and callback in dapl.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
* Programmer: Vailin Choi; Aug 2016
*
@@ -51,68 +52,68 @@
static int
test_dataset_append_notset(hid_t fid)
{
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t dcpl = -1; /* A copy of dataset creation property */
- hid_t ffapl = -1; /* The file's file access property list */
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t dcpl = -1; /* A copy of dataset creation property */
+ hid_t ffapl = -1; /* The file's file access property list */
- hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
- hsize_t maxdims[2] = {H5S_UNLIMITED, 20}; /* Maximum dimension sizes */
- hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
- int lbuf[10]; /* The data buffers */
- int i, j; /* Local index variables */
- h5_stat_t sb1, sb2; /* File info */
+ hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
+ hsize_t maxdims[2] = {H5S_UNLIMITED, 20}; /* Maximum dimension sizes */
+ hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
+ int lbuf[10]; /* The data buffers */
+ int i, j; /* Local index variables */
+ h5_stat_t sb1, sb2; /* File info */
- TESTING("Append flush with H5DOappend()--append rows with default dapl");
+ HL_TESTING2("Append flush with H5DOappend()--append rows with default dapl");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set to create a chunked dataset with extendible dimensions */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
- FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR;
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ FAIL_STACK_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DNAME_NOTSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR;
+ if((did = H5Dcreate2(fid, DNAME_NOTSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR;
/* Append 6 rows to the dataset */
for(i = 0; i < 6; i++) {
- for(j = 0; j < 10; j++)
- lbuf[j] = (i * 10) + (j + 1);
- /* Append without boundary, callback and flush */
- if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)1, H5T_NATIVE_INT, lbuf) < 0)
- FAIL_STACK_ERROR;
+ for(j = 0; j < 10; j++)
+ lbuf[j] = (i * 10) + (j + 1);
+ /* Append without boundary, callback and flush */
+ if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)1, H5T_NATIVE_INT, lbuf) < 0)
+ FAIL_STACK_ERROR;
} /* end for */
/* File size when not flushed */
- if(HDstat(FILE, &sb1) < 0)
- TEST_ERROR;
+ if(HDstat(FILENAME, &sb1) < 0)
+ TEST_ERROR;
/* Close the dataset */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* File size after flushing */
- if(HDstat(FILE, &sb2) < 0)
- TEST_ERROR;
+ if(HDstat(FILENAME, &sb2) < 0)
+ TEST_ERROR;
/* File size before flushing should be less */
- if(sb1.st_size > sb2.st_size)
- TEST_ERROR;
+ if(sb1.st_size > sb2.st_size)
+ TEST_ERROR;
/* Closing */
if(H5Sclose(sid) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dcpl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(ffapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
PASSED();
@@ -120,10 +121,10 @@ test_dataset_append_notset(hid_t fid)
error:
H5E_BEGIN_TRY {
- H5Pclose(dcpl);
- H5Pclose(sid);
- H5Dclose(did);
- H5Pclose(ffapl);
+ H5Pclose(dcpl);
+ H5Pclose(sid);
+ H5Dclose(did);
+ H5Pclose(ffapl);
} H5E_END_TRY;
return 1;
@@ -148,14 +149,14 @@ append_func(hid_t H5_ATTR_UNUSED dset_id, hsize_t H5_ATTR_UNUSED *cur_dims, void
}
/*-------------------------------------------------------------------------
- * Function: test_dataset_append_rows_columns
+ * Function: test_dataset_append_rows_columns
*
- * Purpose: Verify that the object flush property and the append flush property
- * are working properly when appending rows and columns to a dataset
- * with 2 extendible dimensions.
+ * Purpose: Verify that the object flush property and the append flush property
+ * are working properly when appending rows and columns to a dataset
+ * with 2 extendible dimensions.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
* Programmer: Vailin Choi; Jan 2014
*
@@ -164,91 +165,91 @@ append_func(hid_t H5_ATTR_UNUSED dset_id, hsize_t H5_ATTR_UNUSED *cur_dims, void
static int
test_dataset_append_rows_columns(hid_t fid)
{
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t dcpl = -1; /* A copy of dataset creation property */
- hid_t dapl = -1; /* A copy of dataset access property */
- hid_t ffapl = -1; /* The file's file access property list */
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t dcpl = -1; /* A copy of dataset creation property */
+ hid_t dapl = -1; /* A copy of dataset access property */
+ hid_t ffapl = -1; /* The file's file access property list */
- hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
- hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */
- hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
- int lbuf[10], cbuf[6]; /* The data buffers */
- int buf[6][13], rbuf[6][13]; /* The data buffers */
+ hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
+ hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */
+ hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
+ int lbuf[10], cbuf[6]; /* The data buffers */
+ int buf[6][13], rbuf[6][13]; /* The data buffers */
- hsize_t boundary[2] = {1, 1}; /* Boundary sizes */
- unsigned append_ct = 0; /* The # of appends */
- unsigned *flush_ptr; /* Points to the flush counter */
+ hsize_t boundary[2] = {1, 1}; /* Boundary sizes */
+ unsigned append_ct = 0; /* The # of appends */
+ unsigned *flush_ptr; /* Points to the flush counter */
- int i, j; /* Local index variables */
+ int i, j; /* Local index variables */
- TESTING("Append flush with H5DOappend()--append rows & columns");
+ HL_TESTING2("Append flush with H5DOappend()--append rows & columns");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
- FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR;
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ FAIL_STACK_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
- FAIL_STACK_ERROR;
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DNAME_UNLIM, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
- TEST_ERROR;
+ if((did = H5Dcreate2(fid, DNAME_UNLIM, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR;
/* Append 6 rows to the dataset */
for(i = 0; i < 6; i++) {
- for(j = 0; j < 10; j++)
- lbuf[j] = buf[i][j] = (i * 10) + (j + 1);
- if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)1, H5T_NATIVE_INT, lbuf) < 0)
- TEST_ERROR;
+ for(j = 0; j < 10; j++)
+ lbuf[j] = buf[i][j] = (i * 10) + (j + 1);
+ if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)1, H5T_NATIVE_INT, lbuf) < 0)
+ TEST_ERROR;
} /* end for */
/* Verify the # of appends */
if(append_ct != 6)
- TEST_ERROR;
+ TEST_ERROR;
/* Retrieve and verify object flush counts */
if(H5Pget_object_flush_cb(ffapl, NULL, (void **)&flush_ptr) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(*flush_ptr != 6)
- TEST_ERROR;
+ TEST_ERROR;
/* Append 3 columns to the dataset */
for(i = 0; i < 3; i++) {
- for(j = 0; j < 6; j++)
- cbuf[j] = buf[j][i + 10] = ((i * 6) + (j + 1)) * -1;
- if(H5DOappend(did, H5P_DEFAULT, 1, (size_t)1, H5T_NATIVE_INT, cbuf) < 0)
- TEST_ERROR;
+ for(j = 0; j < 6; j++)
+ cbuf[j] = buf[j][i + 10] = ((i * 6) + (j + 1)) * -1;
+ if(H5DOappend(did, H5P_DEFAULT, 1, (size_t)1, H5T_NATIVE_INT, cbuf) < 0)
+ TEST_ERROR;
} /* end for */
/* Verify the # of appends */
if(append_ct != 9)
- TEST_ERROR;
+ TEST_ERROR;
/* Retrieve and verify object flush counts */
if(H5Pget_object_flush_cb(ffapl, NULL, (void **)&flush_ptr) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(*flush_ptr != 9)
- TEST_ERROR;
+ TEST_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
-
+ FAIL_STACK_ERROR;
+
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 13; j++)
+ for(j = 0; j < 13; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
@@ -257,33 +258,33 @@ test_dataset_append_rows_columns(hid_t fid)
/* Close the dataset */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Open the dataset again */
if((did = H5Dopen2(fid, DNAME_UNLIM, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 13; j++)
+ for(j = 0; j < 13; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
/* Closing */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Sclose(sid) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dcpl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(ffapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
PASSED();
@@ -291,25 +292,25 @@ test_dataset_append_rows_columns(hid_t fid)
error:
H5E_BEGIN_TRY {
- H5Pclose(dapl);
- H5Pclose(dcpl);
- H5Pclose(sid);
- H5Dclose(did);
- H5Pclose(ffapl);
+ H5Pclose(dapl);
+ H5Pclose(dcpl);
+ H5Pclose(sid);
+ H5Dclose(did);
+ H5Pclose(ffapl);
} H5E_END_TRY;
return 1;
} /* test_dataset_append_rows_columns() */
/*-------------------------------------------------------------------------
- * Function: test_dataset_append_rows
+ * Function: test_dataset_append_rows
*
- * Purpose: Verify that the object flush property and the append flush property
- * are working properly when appending rows to a dataset with
- * one extendible dimension (row).
+ * Purpose: Verify that the object flush property and the append flush property
+ * are working properly when appending rows to a dataset with
+ * one extendible dimension (row).
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
* Programmer: Vailin Choi; Jan 2014
*
@@ -318,71 +319,71 @@ error:
static int
test_dataset_append_rows(hid_t fid)
{
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t dcpl = -1; /* A copy of dataset creation property */
- hid_t dapl = -1; /* A copy of dataset access property */
- hid_t ffapl = -1; /* The file's file access property list */
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t dcpl = -1; /* A copy of dataset creation property */
+ hid_t dapl = -1; /* A copy of dataset access property */
+ hid_t ffapl = -1; /* The file's file access property list */
- hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
- hsize_t maxdims[2] = {H5S_UNLIMITED, 10}; /* Maximum dimension sizes */
- hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
- int lbuf[10]; /* The data buffer */
- int buf[6][10], rbuf[6][10]; /* The data buffers */
- int i, j; /* Local index variables */
+ hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
+ hsize_t maxdims[2] = {H5S_UNLIMITED, 10}; /* Maximum dimension sizes */
+ hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
+ int lbuf[10]; /* The data buffer */
+ int buf[6][10], rbuf[6][10]; /* The data buffers */
+ int i, j; /* Local index variables */
- hsize_t boundary[2] = {1, 0}; /* Boundary sizes */
- unsigned append_ct = 0; /* The # of appends */
- unsigned *flush_ptr; /* Points to the flush counter */
+ hsize_t boundary[2] = {1, 0}; /* Boundary sizes */
+ unsigned append_ct = 0; /* The # of appends */
+ unsigned *flush_ptr; /* Points to the flush counter */
- TESTING("Append flush with H5DOappend()--append rows");
+ HL_TESTING2("Append flush with H5DOappend()--append rows");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 1 extendible dimension */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
- FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR;
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ FAIL_STACK_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
- FAIL_STACK_ERROR;
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DNAME_ROW, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
- TEST_ERROR;
+ if((did = H5Dcreate2(fid, DNAME_ROW, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR;
/* Append 6 rows to the dataset */
for(i = 0; i < 6; i++) {
- for(j = 0; j < 10; j++)
- lbuf[j] = buf[i][j] = (i * 10) + (j + 1);
- if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)1, H5T_NATIVE_INT, lbuf) < 0)
- TEST_ERROR;
+ for(j = 0; j < 10; j++)
+ lbuf[j] = buf[i][j] = (i * 10) + (j + 1);
+ if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)1, H5T_NATIVE_INT, lbuf) < 0)
+ TEST_ERROR;
} /* end for */
/* Verify the # of appends */
if(append_ct != 6)
- TEST_ERROR;
+ TEST_ERROR;
if(H5Pget_object_flush_cb(ffapl, NULL, (void **)&flush_ptr) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(*flush_ptr != 6)
- TEST_ERROR;
+ TEST_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
-
+ FAIL_STACK_ERROR;
+
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 10; j++)
+ for(j = 0; j < 10; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
@@ -391,33 +392,33 @@ test_dataset_append_rows(hid_t fid)
/* Close the dataset */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Open the dataset again */
if((did = H5Dopen2(fid, DNAME_ROW, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 10; j++)
+ for(j = 0; j < 10; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
/* Closing */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Sclose(sid) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dcpl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(ffapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
PASSED();
@@ -425,25 +426,25 @@ test_dataset_append_rows(hid_t fid)
error:
H5E_BEGIN_TRY {
- H5Pclose(dapl);
- H5Pclose(dcpl);
- H5Pclose(sid);
- H5Dclose(did);
- H5Pclose(ffapl);
+ H5Pclose(dapl);
+ H5Pclose(dcpl);
+ H5Pclose(sid);
+ H5Dclose(did);
+ H5Pclose(ffapl);
} H5E_END_TRY;
return 1;
} /* test_dataset_append_rows() */
/*-------------------------------------------------------------------------
- * Function: test_dataset_append_columns
+ * Function: test_dataset_append_columns
*
- * Purpose: Verify that the object flush property and the append flush property
- * are working properly when appending columns to a dataset
- * with one extendible dimension (column).
+ * Purpose: Verify that the object flush property and the append flush property
+ * are working properly when appending columns to a dataset
+ * with one extendible dimension (column).
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
* Programmer: Vailin Choi; Jan 2014
*
@@ -452,72 +453,72 @@ error:
static int
test_dataset_append_columns(hid_t fid)
{
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t dcpl = -1; /* A copy of dataset creation property */
- hid_t dapl = -1; /* A copy of dataset access property */
- hid_t ffapl = -1; /* The file's file access property list */
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t dcpl = -1; /* A copy of dataset creation property */
+ hid_t dapl = -1; /* A copy of dataset access property */
+ hid_t ffapl = -1; /* The file's file access property list */
- hsize_t dims[2] = {6, 0}; /* Current dimension sizes */
- hsize_t maxdims[2] = {6, H5S_UNLIMITED}; /* Maximum dimension sizes */
- hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
- int cbuf[6]; /* The data buffer */
- int buf[6][3], rbuf[6][3]; /* The data buffers */
- int i, j; /* Local index variable */
+ hsize_t dims[2] = {6, 0}; /* Current dimension sizes */
+ hsize_t maxdims[2] = {6, H5S_UNLIMITED}; /* Maximum dimension sizes */
+ hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
+ int cbuf[6]; /* The data buffer */
+ int buf[6][3], rbuf[6][3]; /* The data buffers */
+ int i, j; /* Local index variable */
- hsize_t boundary[2] = {0, 1}; /* Boundary sizes */
- unsigned append_ct = 0; /* The # of appends */
- unsigned *flush_ptr; /* Points to the flush counter */
+ hsize_t boundary[2] = {0, 1}; /* Boundary sizes */
+ unsigned append_ct = 0; /* The # of appends */
+ unsigned *flush_ptr; /* Points to the flush counter */
- TESTING("Append flush with H5DOappend()--append columns");
+ HL_TESTING2("Append flush with H5DOappend()--append columns");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 1 extendible dimension */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
- FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR;
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ FAIL_STACK_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
- FAIL_STACK_ERROR;
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DNAME_COLUMN, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
- TEST_ERROR;
+ if((did = H5Dcreate2(fid, DNAME_COLUMN, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR;
/* Append 3 columns to the dataset */
for(i = 0; i < 3; i++) {
- for(j = 0; j < 6; j++)
- cbuf[j] = buf[j][i] = ((i * 6) + (j + 1)) * -1;
- if(H5DOappend(did, H5P_DEFAULT, 1, (size_t)1, H5T_NATIVE_INT, cbuf) < 0)
- TEST_ERROR;
+ for(j = 0; j < 6; j++)
+ cbuf[j] = buf[j][i] = ((i * 6) + (j + 1)) * -1;
+ if(H5DOappend(did, H5P_DEFAULT, 1, (size_t)1, H5T_NATIVE_INT, cbuf) < 0)
+ TEST_ERROR;
} /* end for */
/* Verify the # of appends */
if(append_ct != 3)
- TEST_ERROR;
+ TEST_ERROR;
/* Retrieve and verify object flush counts */
if(H5Pget_object_flush_cb(ffapl, NULL, (void **)&flush_ptr) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(*flush_ptr != 3)
- TEST_ERROR;
+ TEST_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
-
+ FAIL_STACK_ERROR;
+
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 3; j++)
+ for(j = 0; j < 3; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
@@ -526,33 +527,33 @@ test_dataset_append_columns(hid_t fid)
/* Close the dataset */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Open the dataset again */
if((did = H5Dopen2(fid, DNAME_COLUMN, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 3; j++)
+ for(j = 0; j < 3; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
/* Closing */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Sclose(sid) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dcpl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(ffapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
PASSED();
@@ -560,33 +561,34 @@ test_dataset_append_columns(hid_t fid)
error:
H5E_BEGIN_TRY {
- H5Pclose(dapl);
- H5Pclose(dcpl);
- H5Pclose(sid);
- H5Dclose(did);
- H5Pclose(ffapl);
+ H5Pclose(dapl);
+ H5Pclose(dcpl);
+ H5Pclose(sid);
+ H5Dclose(did);
+ H5Pclose(ffapl);
} H5E_END_TRY;
return 1;
} /* test_dataset_append_columns() */
/*-------------------------------------------------------------------------
- * Function: test_dataset_append_BUG1
+ * Function: test_dataset_append_BUG1
*
- * Purpose: Verify that the object flush property and the append flush property
+ * Purpose: Verify that the object flush property and the append flush property
* are working properly when appending rows and columns to an
* extendible dataset.
- * A BUG occurs:
- * when the extendible dataset is set up as follows:
- * hsize_t dims[2] = {0, 10};
- * hsize_t maxdims[2] = {H5S_UNLIMITED, 50};
- * when append 6 rows and 3 columns to the dataset;
- * The data is correct when the dataset is read at this point;
- * The data is incorrect when the dataset is closed, opened again, and read at this point;
- * NOTE: the problem does not occur when H5Dflush() is not performed for each row/column.
*
- * Return: Success: 0
- * Failure: 1
+ * A BUG occurs:
+ * when the extendible dataset is set up as follows:
+ * hsize_t dims[2] = {0, 10};
+ * hsize_t maxdims[2] = {H5S_UNLIMITED, 50};
+ * when append 6 rows and 3 columns to the dataset;
+ * The data is correct when the dataset is read at this point;
+ * The data is incorrect when the dataset is closed, opened again, and read at this point;
+ * NOTE: the problem does not occur when H5Dflush() is not performed for each row/column.
+ *
+ * Return: Success: 0
+ * Failure: 1
*
* Programmer: Vailin Choi; Jan 2014
*
@@ -595,126 +597,124 @@ error:
static int
test_dataset_append_BUG1(hid_t fid)
{
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t dcpl = -1; /* Dataset creation property */
- hid_t dapl = -1; /* Dataset access property */
- hid_t ffapl = -1; /* The file's file access property list */
-
- hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
- hsize_t maxdims[2] = {H5S_UNLIMITED, 50}; /* Maximum dimension sizes */
- hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
- int lbuf[10], cbuf[6]; /* The data buffers */
- int buf[6][13], rbuf[6][13]; /* The data buffers */
- int i, j; /* Local index variables */
-
- hsize_t boundary[2] = {1, 1}; /* Boundary sizes */
- unsigned append_ct = 0; /* The # of appends */
- unsigned *flush_ptr; /* Points to the flush counter */
-
- TESTING("Append flush with H5DOappend()--append rows & columns--BUG1");
-
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t dcpl = -1; /* Dataset creation property */
+ hid_t dapl = -1; /* Dataset access property */
+ hid_t ffapl = -1; /* The file's file access property list */
+
+ hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
+ hsize_t maxdims[2] = {H5S_UNLIMITED, 50}; /* Maximum dimension sizes */
+ hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
+ int lbuf[10], cbuf[6]; /* The data buffers */
+ int buf[6][13], rbuf[6][13]; /* The data buffers */
+ int i, j; /* Local index variables */
+
+ hsize_t boundary[2] = {1, 1}; /* Boundary sizes */
+ unsigned append_ct = 0; /* The # of appends */
+ unsigned *flush_ptr; /* Points to the flush counter */
+
+ HL_TESTING2("Append flush with H5DOappend()--append rows & columns--BUG1");
+
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
- FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR;
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ FAIL_STACK_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
- FAIL_STACK_ERROR;
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DBUGNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
- TEST_ERROR;
+ if((did = H5Dcreate2(fid, DBUGNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR;
/* Append 6 rows to the dataset */
for(i = 0; i < 6; i++) {
- for(j = 0; j < 10; j++)
- lbuf[j] = buf[i][j] = (i * 10) + (j + 1);
- if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)1, H5T_NATIVE_INT, lbuf) < 0)
- TEST_ERROR;
+ for(j = 0; j < 10; j++)
+ lbuf[j] = buf[i][j] = (i * 10) + (j + 1);
+ if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)1, H5T_NATIVE_INT, lbuf) < 0)
+ TEST_ERROR;
} /* end for */
/* Verify the # of appends */
if(append_ct != 6)
- TEST_ERROR;
+ TEST_ERROR;
/* Retrieve and verify object flush counts */
if(H5Pget_object_flush_cb(ffapl, NULL, (void **)&flush_ptr) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(*flush_ptr != 6)
- TEST_ERROR;
+ TEST_ERROR;
/* Append 3 columns to the dataset */
for(i = 0; i < 3; i++) {
- for(j = 0; j < 6; j++)
- cbuf[j] = buf[j][i+10] = ((i * 6) + (j + 1)) * -1;
- if(H5DOappend(did, H5P_DEFAULT, 1, (size_t)1, H5T_NATIVE_INT, cbuf) < 0)
- TEST_ERROR;
+ for(j = 0; j < 6; j++)
+ cbuf[j] = buf[j][i+10] = ((i * 6) + (j + 1)) * -1;
+ if(H5DOappend(did, H5P_DEFAULT, 1, (size_t)1, H5T_NATIVE_INT, cbuf) < 0)
+ TEST_ERROR;
} /* end for */
/* Verify the # of appends */
if(append_ct != 9)
- TEST_ERROR;
+ TEST_ERROR;
/* Retrieve and verify object flush counts */
if(H5Pget_object_flush_cb(ffapl, NULL, (void **)&flush_ptr) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(*flush_ptr != 9)
- TEST_ERROR;
+ TEST_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
-
+ FAIL_STACK_ERROR;
+
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 13; j++)
+ for(j = 0; j < 13; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
-#ifdef BUG1
HDmemset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Open the dataset again */
- if((did = H5Dopen(fid, DBUGNAME1, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR;
+ if((did = H5Dopen2(fid, DBUGNAME1, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 13; j++)
+ for(j = 0; j < 13; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
-#endif
/* Closing */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Sclose(sid) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dcpl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(ffapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
PASSED();
@@ -722,33 +722,34 @@ test_dataset_append_BUG1(hid_t fid)
error:
H5E_BEGIN_TRY {
- H5Pclose(dcpl);
- H5Pclose(dapl);
- H5Pclose(sid);
- H5Dclose(did);
- H5Pclose(ffapl);
+ H5Pclose(dcpl);
+ H5Pclose(dapl);
+ H5Pclose(sid);
+ H5Dclose(did);
+ H5Pclose(ffapl);
} H5E_END_TRY;
return 1;
} /* test_dataset_append_BUG1() */
/*-------------------------------------------------------------------------
- * Function: test_dataset_append_BUG2
+ * Function: test_dataset_append_BUG2
*
- * Purpose: Verify that the object flush property and the append flush property
+ * Purpose: Verify that the object flush property and the append flush property
* are working properly when appending rows and columns to an
* extendible dataset.
- * A BUG occurs:
- * when the extendible dataset is set up as follows:
- * hsize_t dims[2] = {0, 10};
- * hsize_t maxdims[2] = {50, H5S_UNLIMITED};
- * when append 6 rows and 3 columns to the dataset;
- * The data is correct when the dataset is read at this point;
- * The data is incorrect when the dataset is closed, opened again, and read at this point;
- * NOTE: the problem does not occur when H5Dflush() is not performed for each row/column.
*
- * Return: Success: 0
- * Failure: 1
+ * A BUG occurs:
+ * when the extendible dataset is set up as follows:
+ * hsize_t dims[2] = {0, 10};
+ * hsize_t maxdims[2] = {50, H5S_UNLIMITED};
+ * when append 6 rows and 3 columns to the dataset;
+ * The data is correct when the dataset is read at this point;
+ * The data is incorrect when the dataset is closed, opened again, and read at this point;
+ * NOTE: the problem does not occur when H5Dflush() is not performed for each row/column.
+ *
+ * Return: Success: 0
+ * Failure: 1
*
* Programmer: Vailin Choi; Jan 2014
*
@@ -757,127 +758,125 @@ error:
static int
test_dataset_append_BUG2(hid_t fid)
{
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t dcpl = -1; /* Dataset creation property */
- hid_t dapl = -1; /* Dataset access property */
- hid_t ffapl = -1; /* The file's file access property list */
-
- hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
- hsize_t maxdims[2] = {50, H5S_UNLIMITED}; /* Maximum dimension sizes */
- hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
- int lbuf[10], cbuf[6]; /* Data buffers */
- int buf[6][13], rbuf[6][13]; /* Data buffers */
- int i, j; /* Local index variables */
-
- hsize_t boundary[2] = {1, 1}; /* Boundary sizes */
- unsigned append_ct = 0; /* The # of appends */
- unsigned *flush_ptr; /* Points to the flush counter */
-
- TESTING("Append flush with H5DOappend()--append rows & columns--BUG2");
-
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t dcpl = -1; /* Dataset creation property */
+ hid_t dapl = -1; /* Dataset access property */
+ hid_t ffapl = -1; /* The file's file access property list */
+
+ hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
+ hsize_t maxdims[2] = {50, H5S_UNLIMITED}; /* Maximum dimension sizes */
+ hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
+ int lbuf[10], cbuf[6]; /* Data buffers */
+ int buf[6][13], rbuf[6][13]; /* Data buffers */
+ int i, j; /* Local index variables */
+
+ hsize_t boundary[2] = {1, 1}; /* Boundary sizes */
+ unsigned append_ct = 0; /* The # of appends */
+ unsigned *flush_ptr; /* Points to the flush counter */
+
+ HL_TESTING2("Append flush with H5DOappend()--append rows & columns--BUG2");
+
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
- FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR;
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ FAIL_STACK_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
- FAIL_STACK_ERROR;
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DBUGNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
- TEST_ERROR;
+ if((did = H5Dcreate2(fid, DBUGNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR;
/* Append 6 rows to the dataset */
for(i = 0; i < 6; i++) {
- for(j = 0; j < 10; j++)
- lbuf[j] = buf[i][j] = (i * 10) + (j + 1);
- if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)1, H5T_NATIVE_INT, lbuf) < 0)
- TEST_ERROR;
+ for(j = 0; j < 10; j++)
+ lbuf[j] = buf[i][j] = (i * 10) + (j + 1);
+ if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)1, H5T_NATIVE_INT, lbuf) < 0)
+ TEST_ERROR;
} /* end for */
/* Verify the # of appends */
if(append_ct != 6)
- TEST_ERROR;
+ TEST_ERROR;
/* Retrieve and verify object flush counts */
if(H5Pget_object_flush_cb(ffapl, NULL, (void **)&flush_ptr) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(*flush_ptr != 6)
- TEST_ERROR;
+ TEST_ERROR;
/* Append 3 columns to the dataset */
for(i = 0; i < 3; i++) {
- for(j = 0; j < 6; j++)
- cbuf[j] = buf[j][i+10] = ((i * 6) + (j + 1)) * -1;
- if(H5DOappend(did, H5P_DEFAULT, 1, (size_t)1, H5T_NATIVE_INT, cbuf) < 0)
- TEST_ERROR;
+ for(j = 0; j < 6; j++)
+ cbuf[j] = buf[j][i+10] = ((i * 6) + (j + 1)) * -1;
+ if(H5DOappend(did, H5P_DEFAULT, 1, (size_t)1, H5T_NATIVE_INT, cbuf) < 0)
+ TEST_ERROR;
} /* end for */
/* Verify the # of appends */
if(append_ct != 9)
- TEST_ERROR;
+ TEST_ERROR;
/* Retrieve and verify object flush counts */
if(H5Pget_object_flush_cb(ffapl, NULL, (void **)&flush_ptr) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(*flush_ptr != 9)
- TEST_ERROR;
+ TEST_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
-
+ FAIL_STACK_ERROR;
+
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 13; j++)
+ for(j = 0; j < 13; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
-#ifdef BUG2
HDmemset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Open the dataset again */
- if((did = H5Dopen(fid, DBUGNAME2, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR;
+ if((did = H5Dopen2(fid, DBUGNAME2, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 13; j++)
+ for(j = 0; j < 13; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
-#endif
/* Closing */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Sclose(sid) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dcpl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(ffapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
PASSED();
@@ -885,11 +884,11 @@ test_dataset_append_BUG2(hid_t fid)
error:
H5E_BEGIN_TRY {
- H5Pclose(dcpl);
- H5Pclose(dapl);
- H5Pclose(sid);
- H5Dclose(did);
- H5Pclose(ffapl);
+ H5Pclose(dcpl);
+ H5Pclose(dapl);
+ H5Pclose(sid);
+ H5Dclose(did);
+ H5Pclose(ffapl);
} H5E_END_TRY;
return 1;
@@ -897,15 +896,15 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_dataset_append_less
+ * Function: test_dataset_append_less
*
- * Purpose: Verify that the object flush property and the append flush property
- * are working properly when appending rows and columns to an
- * extendible dataset where the append size is less than the boundary
- * size.
+ * Purpose: Verify that the object flush property and the append flush property
+ * are working properly when appending rows and columns to an
+ * extendible dataset where the append size is less than the boundary
+ * size.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
* Programmer: Vailin Choi; Jan 2014
*
@@ -914,93 +913,93 @@ error:
static int
test_dataset_append_less(hid_t fid)
{
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t dcpl = -1; /* A copy of dataset creation property */
- hid_t dapl = -1; /* A copy of dataset access property */
- hid_t ffapl = -1; /* The file's file access property list */
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t dcpl = -1; /* A copy of dataset creation property */
+ hid_t dapl = -1; /* A copy of dataset access property */
+ hid_t ffapl = -1; /* The file's file access property list */
- hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
- hsize_t maxdims[2] = {100, 100}; /* Maximum dimension sizes */
- hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
- int lbuf[20], cbuf[6][3]; /* Data buffers */
- int buf[6][13], rbuf[6][13]; /* Data buffers */
- int i, j, k; /* Local index variables */
+ hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
+ hsize_t maxdims[2] = {100, 100}; /* Maximum dimension sizes */
+ hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
+ int lbuf[20], cbuf[6][3]; /* Data buffers */
+ int buf[6][13], rbuf[6][13]; /* Data buffers */
+ int i, j, k; /* Local index variables */
- hsize_t boundary[2] = {3, 3}; /* Boundary sizes */
- unsigned append_ct = 0; /* The # of appends */
- unsigned *flush_ptr; /* Points to the flush counter */
+ hsize_t boundary[2] = {3, 3}; /* Boundary sizes */
+ unsigned append_ct = 0; /* The # of appends */
+ unsigned *flush_ptr; /* Points to the flush counter */
- TESTING("Append flush with H5DOappend()--append size < boundary size");
+ HL_TESTING2("Append flush with H5DOappend()--append size < boundary size");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
- FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR;
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ FAIL_STACK_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
- FAIL_STACK_ERROR;
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DNAME_LESS, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
- TEST_ERROR;
+ if((did = H5Dcreate2(fid, DNAME_LESS, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR;
/* Append to the dataset 2 rows at a time for 3 times */
for(i = 0, k = 0; i < 6; i++) {
- for(j = 0; j < 10; j++, k++)
- buf[i][j] = lbuf[k] = (i * 10) + (j + 1);
-
- if((i + 1) % 2 == 0) {
- if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)2, H5T_NATIVE_INT, lbuf) < 0)
- TEST_ERROR;
- k = 0;
- } /* end if */
+ for(j = 0; j < 10; j++, k++)
+ buf[i][j] = lbuf[k] = (i * 10) + (j + 1);
+
+ if((i + 1) % 2 == 0) {
+ if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)2, H5T_NATIVE_INT, lbuf) < 0)
+ TEST_ERROR;
+ k = 0;
+ } /* end if */
} /* end for */
/* Verify the # of appends */
if(append_ct != 2)
- TEST_ERROR;
+ TEST_ERROR;
/* Retrieve and verify object flush counts */
if(H5Pget_object_flush_cb(ffapl, NULL, (void **)&flush_ptr) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(*flush_ptr != 2)
- TEST_ERROR;
+ TEST_ERROR;
/* Append 3 columns to the dataset, once */
for(i = 0; i < 3; i++)
- for(j = 0; j < 6; j++, k++)
- cbuf[j][i] = buf[j][i + 10] = ((i * 6) + (j + 1)) * -1;
+ for(j = 0; j < 6; j++, k++)
+ cbuf[j][i] = buf[j][i + 10] = ((i * 6) + (j + 1)) * -1;
if(H5DOappend(did, H5P_DEFAULT, 1, (size_t)3, H5T_NATIVE_INT, cbuf) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Verify the # of appends */
if(append_ct != 3)
- TEST_ERROR;
+ TEST_ERROR;
/* Retrieve and verify object flush counts */
if(H5Pget_object_flush_cb(ffapl, NULL, (void **)&flush_ptr) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(*flush_ptr != 3)
- TEST_ERROR;
+ TEST_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
-
+ FAIL_STACK_ERROR;
+
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 13; j++)
+ for(j = 0; j < 13; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
@@ -1009,33 +1008,33 @@ test_dataset_append_less(hid_t fid)
/* Close the dataset */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Open the dataset again */
if((did = H5Dopen2(fid, DNAME_LESS, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 13; j++)
+ for(j = 0; j < 13; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
/* Closing */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Sclose(sid) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dcpl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(ffapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
PASSED();
@@ -1043,29 +1042,29 @@ test_dataset_append_less(hid_t fid)
error:
H5E_BEGIN_TRY {
- H5Pclose(dapl);
- H5Pclose(dcpl);
- H5Pclose(sid);
- H5Dclose(did);
- H5Pclose(ffapl);
+ H5Pclose(dapl);
+ H5Pclose(dcpl);
+ H5Pclose(sid);
+ H5Dclose(did);
+ H5Pclose(ffapl);
} H5E_END_TRY;
return 1;
} /* test_dataset_append_less() */
/*-------------------------------------------------------------------------
- * Function: test_dataset_append_vary
+ * Function: test_dataset_append_vary
*
- * Purpose: Verify that the object flush property and the append flush property
- * are working properly when appending rows and columns to an
- * extendible dataset where
- * row: the append size is 3 times of the boundary size
- * the append callback/flush is performed on the 1st boundary hit
- * column: the boundary is greater than the append size
- * the boundary is not hit at all
+ * Purpose: Verify that the object flush property and the append flush property
+ * are working properly when appending rows and columns to an
+ * extendible dataset where
+ * row: the append size is 3 times of the boundary size
+ * the append callback/flush is performed on the 1st boundary hit
+ * column: the boundary is greater than the append size
+ * the boundary is not hit at all
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
* Programmer: Vailin Choi; Jan 2014
*
@@ -1074,88 +1073,88 @@ error:
static int
test_dataset_append_vary(hid_t fid)
{
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t dcpl = -1; /* A copy of dataset creation property */
- hid_t dapl = -1; /* A copy of dataset access property */
- hid_t ffapl = -1; /* The file's file access property list */
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t dcpl = -1; /* A copy of dataset creation property */
+ hid_t dapl = -1; /* A copy of dataset access property */
+ hid_t ffapl = -1; /* The file's file access property list */
- hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
- hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */
- hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
- int lbuf[60], cbuf[6][3]; /* Data buffers */
- int buf[6][13], rbuf[6][13]; /* Data buffers */
- int i, j, k; /* Local index variables */
+ hsize_t dims[2] = {0, 10}; /* Current dimension sizes */
+ hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */
+ hsize_t chunk_dims[2] = {2,5}; /* Chunk dimension sizes */
+ int lbuf[60], cbuf[6][3]; /* Data buffers */
+ int buf[6][13], rbuf[6][13]; /* Data buffers */
+ int i, j, k; /* Local index variables */
- hsize_t boundary[2] = {3, 7}; /* Boundary sizes */
- unsigned append_ct = 0; /* The # of appends */
- unsigned *flush_ptr; /* Points to the flush counter */
+ hsize_t boundary[2] = {3, 7}; /* Boundary sizes */
+ unsigned append_ct = 0; /* The # of appends */
+ unsigned *flush_ptr; /* Points to the flush counter */
- TESTING("Append flush with H5DOappend()--append & boundary size vary");
+ HL_TESTING2("Append flush with H5DOappend()--append & boundary size vary");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
- FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR;
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ FAIL_STACK_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
- FAIL_STACK_ERROR;
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DNAME_VARY, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
- TEST_ERROR;
+ if((did = H5Dcreate2(fid, DNAME_VARY, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR;
/* Append 6 rows to the dataset, once */
for(i = 0, k = 0; i < 6; i++)
- for(j = 0; j < 10; j++, k++)
- buf[i][j] = lbuf[k] = (i * 10) + (j + 1);
+ for(j = 0; j < 10; j++, k++)
+ buf[i][j] = lbuf[k] = (i * 10) + (j + 1);
if(H5DOappend(did, H5P_DEFAULT, 0, (size_t)6, H5T_NATIVE_INT, lbuf) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Verify the # of appends */
if(append_ct != 1)
- TEST_ERROR;
+ TEST_ERROR;
/* Retrieve and verify object flush counts */
if(H5Pget_object_flush_cb(ffapl, NULL, (void **)&flush_ptr) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(*flush_ptr != 1)
- TEST_ERROR;
+ TEST_ERROR;
/* Append 3 columns to the dataset, once */
for(i = 0; i < 3; i++)
- for(j = 0; j < 6; j++, k++)
- cbuf[j][i] = buf[j][i + 10] = ((i * 6) + (j + 1)) * -1;
+ for(j = 0; j < 6; j++, k++)
+ cbuf[j][i] = buf[j][i + 10] = ((i * 6) + (j + 1)) * -1;
if(H5DOappend(did, H5P_DEFAULT, 1, (size_t)3, H5T_NATIVE_INT, cbuf) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Verify the # of appends */
if(append_ct != 1)
- TEST_ERROR;
+ TEST_ERROR;
/* Retrieve and verify object flush counts */
if(H5Pget_object_flush_cb(ffapl, NULL, (void **)&flush_ptr) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(*flush_ptr != 1)
- TEST_ERROR;
+ TEST_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
-
+ FAIL_STACK_ERROR;
+
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 13; j++)
+ for(j = 0; j < 13; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
@@ -1164,33 +1163,33 @@ test_dataset_append_vary(hid_t fid)
/* Close the dataset */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Open the dataset again */
if((did = H5Dopen2(fid, DNAME_VARY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Verify the data */
for(i = 0; i < 6; i++)
- for(j = 0; j < 13; j++)
+ for(j = 0; j < 13; j++)
if(buf[i][j] != rbuf[i][j])
TEST_ERROR;
/* Closing */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Sclose(sid) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(dcpl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Pclose(ffapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
PASSED();
@@ -1198,24 +1197,23 @@ test_dataset_append_vary(hid_t fid)
error:
H5E_BEGIN_TRY {
- H5Pclose(dapl);
- H5Pclose(dcpl);
- H5Pclose(sid);
- H5Dclose(did);
- H5Pclose(ffapl);
+ H5Pclose(dapl);
+ H5Pclose(dcpl);
+ H5Pclose(sid);
+ H5Dclose(did);
+ H5Pclose(ffapl);
} H5E_END_TRY;
return 1;
} /* test_dataset_append_vary() */
/*-------------------------------------------------------------------------
- * Function: Main function
+ * Function: Main function
*
- * Purpose: Test H5Pset/get_object_flush_cb() and H5Pset/get_append_flush()
- * along with H5DOappend().
+ * Purpose: Test H5Pset/get_object_flush_cb() and H5Pset/get_append_flush()
+ * along with H5DOappend().
*
- * Return: Success: 0
- * Failure: 1
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Vailin Choi; Jan 2014
*
@@ -1223,69 +1221,67 @@ error:
*/
int main(void)
{
- hid_t fid = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- unsigned flush_ct = 0; /* The # of flushes */
- int nerrors = 0; /* The # of errors encountered */
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list */
+ unsigned flush_ct = 0; /* The # of flushes */
+ int nerrors = 0; /* The # of errors encountered */
/* Get a copy of file access property list */
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- FAIL_STACK_ERROR;
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ FAIL_STACK_ERROR;
/* Set to use the latest library format */
if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Set object flush property */
if(H5Pset_object_flush_cb(fapl, flush_func, &flush_ct) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Create the test file */
- if((fid = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- FAIL_STACK_ERROR;
+ if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR;
nerrors += test_dataset_append_notset(fid);
nerrors += test_dataset_append_rows(fid);
- flush_ct = 0; /* Reset flush counter */
+ flush_ct = 0; /* Reset flush counter */
nerrors += test_dataset_append_columns(fid);
- flush_ct = 0; /* Reset flush counter */
+ flush_ct = 0; /* Reset flush counter */
nerrors += test_dataset_append_rows_columns(fid);
-#ifdef BUG1_BUG2
/*
* The following tests illustrate the scenarios when H5DOappend does not work with extensible array indexing:
- * - when the the dataset has 1 unlimited dimension and the other dimension is fixed but extendible
- * - the dataset expands along 1 dimension and then expands along the other dimension
+ * - when the the dataset has 1 unlimited dimension and the other dimension is fixed but extendible
+ * - the dataset expands along 1 dimension and then expands along the other dimension
*/
- flush_ct = 0; /* Reset flush counter */
- nerrors += test_dataset_append_BUG1(fid);
+ flush_ct = 0; /* Reset flush counter */
+ nerrors += test_dataset_append_BUG1(fid);
- flush_ct = 0; /* Reset flush counter */
- nerrors += test_dataset_append_BUG2(fid);
-#endif
+ flush_ct = 0; /* Reset flush counter */
+ nerrors += test_dataset_append_BUG2(fid);
- flush_ct = 0; /* Reset flush counter */
+ flush_ct = 0; /* Reset flush counter */
nerrors += test_dataset_append_less(fid);
- flush_ct = 0; /* Reset flush counter */
+ flush_ct = 0; /* Reset flush counter */
nerrors += test_dataset_append_vary(fid);
/* Closing */
if(H5Pclose(fapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Fclose(fid) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Check for errors */
if(nerrors)
goto error;
- return 0;
+ return EXIT_SUCCESS;
error:
- return 1;
+ return EXIT_FAILURE;
}
diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c
index a98642c..fd2d0d2 100644
--- a/hl/test/test_file_image.c
+++ b/hl/test/test_file_image.c
@@ -44,10 +44,10 @@
extend the image, and then performs writes that extend the images. The fifth
loop reads the extended images and verify that the content are correct. The
sixth and final loop closes the file images and deallocates the image
- buffers if appropriate. */
+ buffers if appropriate. */
/*-------------------------------------------------------------------------
-* test file image operations
+* test file image operations
*-------------------------------------------------------------------------
*/
static int
@@ -67,11 +67,11 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
void **buf_ptr; /* pointer to array of pointers to image buffers */
char **filename; /* pointer to array of pointers to filenames */
unsigned *input_flags; /* pointer to array of flag combinations */
- size_t i, j, k, nrow, n_values;
+ size_t i, j, k, nrow, n_values;
herr_t status1;
void *handle_ptr = NULL; /* pointers to driver buffer */
- unsigned char **core_buf_ptr_ptr = NULL;
-
+ unsigned char **core_buf_ptr_ptr = NULL;
+
VERIFY(open_images > 1 , "The number of open images must be greater than 1");
VERIFY(nflags > 0, "The number of flag combinations must be greater than 0");
@@ -100,7 +100,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (NULL == (dset_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
- TESTING("get file images");
+ HL_TESTING2("get file images");
/* create several file images */
for (i = 0; i < open_images; i++) {
@@ -112,17 +112,17 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
filename[i] = (char *)HDmalloc(sizeof(char) * 32);
/* create file name */
- sprintf(filename[i], "image_file%d.h5", (int)i);
+ HDsprintf(filename[i], "image_file%d.h5", (int)i);
/* create file */
if ((file_id[i] = H5Fcreate(filename[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Fcreate() failed");
- /* define dataspace for the dataset */
- if ((file_space = H5Screate_simple(RANK, dims1, max_dims)) < 0)
+ /* define dataspace for the dataset */
+ if ((file_space = H5Screate_simple(RANK, dims1, max_dims)) < 0)
FAIL_PUTS_ERROR("H5Screate_simple() failed");
- /* create dataset property list */
+ /* create dataset property list */
if ((plist = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_PUTS_ERROR("H5Pcreate() failed");
@@ -133,8 +133,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* create and write an integer type dataset named "dset" */
if ((dset_id[i] = H5Dcreate2(file_id[i], DSET_NAME, H5T_NATIVE_INT, file_space, H5P_DEFAULT, plist, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Dcreate() failed");
-
- /* dataset in open image 1 is written with "wrong" data */
+
+ /* dataset in open image 1 is written with "wrong" data */
if (i == 1) {
if (H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2) < 0)
FAIL_PUTS_ERROR("H5Dwrite() failed");
@@ -144,7 +144,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1) < 0)
FAIL_PUTS_ERROR("H5Dwrite() failed");
} /* end else */
-
+
/* flush into the file */
if (H5Fflush(file_id[i], H5F_SCOPE_LOCAL) < 0)
FAIL_PUTS_ERROR("H5Fflush() failed");
@@ -152,7 +152,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* close dataset property list */
if (H5Pclose(plist) < 0)
FAIL_PUTS_ERROR("H5Pclose() failed");
-
+
/* close dataspace */
if (H5Sclose(file_space) < 0)
FAIL_PUTS_ERROR("H5Sclose() failed");
@@ -172,7 +172,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* buffer for file image 2 is filled with counter data (non-valid image) */
if (i == 2) {
for (j = 0; j < (size_t)buf_size[i]; j++)
- ((char*)(buf_ptr[i]))[j] = (char)j;
+ ((char*)(buf_ptr[i]))[j] = (char)j;
} /* end if */
/* buffers for the rest of the file images are filled with data from the respective files */
else {
@@ -187,14 +187,14 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED();
- TESTING("open file images and check image copies");
-
- /* open the file images with the core driver for data access */
+ HL_TESTING2("open file images and check image copies");
+
+ /* open the file images with the core driver for data access */
for (i = 0; i < open_images; i++) {
/* open file image 2 filled with counter data (non-valid image) */
if (i == 2) {
H5E_BEGIN_TRY {
- /* attempt to set file image in the core driver */
+ /* attempt to set file image in the core driver */
file_id[i] = H5LTopen_file_image(buf_ptr[i], (size_t)buf_size[i], input_flags[i]);
} H5E_END_TRY
@@ -202,7 +202,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
} /* end if */
/* open rest of valid file images */
else {
- /* set file image in the core driver */
+ /* set file image in the core driver */
if ((file_id[i] = H5LTopen_file_image(buf_ptr[i], (size_t)buf_size[i], input_flags[i])) < 0)
FAIL_PUTS_ERROR("H5LTopen_file_image() failed");
@@ -218,7 +218,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
else
VERIFY(*core_buf_ptr_ptr != buf_ptr[i], "vfd buffer and user buffer should be different");
- /*
+ /*
* When the vfd and user buffers are different and H5LT_FILE_IMAGE_OPEN_RW is enabled,
* status_flags in the superblock needs to be cleared in the vfd buffer for
* the comparison to proceed as expected. The user buffer as returned from H5Fget_file_image()
@@ -249,7 +249,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED();
- TESTING("read file images");
+ HL_TESTING2("read file images");
/* read open file images and verify data */
for (i = 0; i < open_images; i++) {
@@ -259,7 +259,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
continue;
} /* end if */
- /* open dataset in file image */
+ /* open dataset in file image */
if ((dset_id[i] = H5Dopen2(file_id[i], DSET_NAME, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Dopen() failed");
@@ -274,8 +274,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* read dataset */
if (H5Dread(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data3) < 0)
FAIL_PUTS_ERROR("H5Dread() failed");
-
- /* compute number of elements in dataset */
+
+ /* compute number of elements in dataset */
n_values = (size_t)(dims3[0] * dims3[1]);
/* determine the number of rows in dataset */
@@ -297,15 +297,15 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (data3[j * nrow + k ] != data1[j * nrow + k ])
FAIL_PUTS_ERROR("comparison of image values with original data failed");
} /* end else */
-
- /* close dataspace */
+
+ /* close dataspace */
if (H5Sclose (file_space) < 0)
FAIL_PUTS_ERROR("H5Sclose() failed");
} /* end for */
- PASSED();
+ PASSED();
- TESTING("write and extend file images");
+ HL_TESTING2("write and extend file images");
/* write open file images and verify data */
for (i = 0; i < open_images; i++) {
@@ -365,7 +365,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
hid_t attr_space_id = -1;
hid_t attr_id = -1;
herr_t status2;
- size_t l;
+ size_t l;
if ((attr_space_id = H5Screate_simple(attr_rank, attr_dims, attr_dims)) < 0)
FAIL_PUTS_ERROR("attr_space H5Screate_simple() failed");
@@ -396,9 +396,9 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
H5Aclose(attr_id);
} H5E_END_TRY;
#endif
- if (H5Dclose(dset_id[i]) < 0)
- FAIL_PUTS_ERROR("H5Dclose() failed");
- dset_id[i] = -1;
+ if (H5Dclose(dset_id[i]) < 0)
+ FAIL_PUTS_ERROR("H5Dclose() failed");
+ dset_id[i] = -1;
} /* end if */
else {
/* write dataset without extending it */
@@ -422,7 +422,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED();
- TESTING("read extended file images");
+ HL_TESTING2("read extended file images");
/* read open file images and verify data */
for (i = 0; i < open_images; i++) {
@@ -430,7 +430,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if ((dset_id[i] < 0) || (file_id[i] < 0) || (!(input_flags[i] & H5LT_FILE_IMAGE_OPEN_RW )))
continue;
- /* open dataset in file image */
+ /* open dataset in file image */
if ((dset_id[i] = H5Dopen2(file_id[i], DSET_NAME, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Dopen() failed");
@@ -445,8 +445,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* read dataset */
if (H5Dread(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data3) < 0)
FAIL_PUTS_ERROR("H5Dread() failed");
-
- /* compute number of elements in dataset */
+
+ /* compute number of elements in dataset */
n_values = (size_t)(dims3[0] * dims3[1]);
/* determine the number of rows in dataset */
@@ -457,8 +457,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
for (k = 0; k < nrow; k++)
if (data3[j * nrow + k ] != data4[j * nrow + k ])
FAIL_PUTS_ERROR("comparison of image values with original data failed");
-
- /* close dataspace */
+
+ /* close dataspace */
if (H5Sclose (file_space) < 0)
FAIL_PUTS_ERROR("H5Sclose() failed");
@@ -469,7 +469,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED()
- TESTING("close file images");
+ HL_TESTING2("close file images");
/* close file images and release buffer if appropriate */
for (i = 0; i < open_images; i++) {
@@ -489,7 +489,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
VERIFY(buf_ptr[i] != NULL, "buffer pointer must be non NULL");
HDfree(buf_ptr[i]);
} /* end if */
-
+
} /* end for */
/* release temporary working buffers */
@@ -521,8 +521,8 @@ int main( void )
size_t open_images = 10; /* number of open file images */
size_t nflags = 8; /* number of flag combinations */
unsigned flags[8]; /* array with flag combinations */
-
- /* set flag combinations for testing */
+
+ /* set flag combinations for testing */
flags[0] = 0;
flags[1] = H5LT_FILE_IMAGE_DONT_RELEASE;
flags[2] = H5LT_FILE_IMAGE_DONT_COPY;
@@ -536,11 +536,11 @@ int main( void )
nerrors += test_file_image(open_images, nflags, flags) < 0? 1 : 0;
if (nerrors) goto error;
- printf("File image tests passed.\n");
+ HDprintf("File image tests passed.\n");
return 0;
error:
- printf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
+ HDprintf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
return 1;
}
diff --git a/hl/test/test_h5do_compat.c b/hl/test/test_h5do_compat.c
index 4df5eef..75028fb 100644
--- a/hl/test/test_h5do_compat.c
+++ b/hl/test/test_h5do_compat.c
@@ -26,14 +26,14 @@
#define NX 8
#define CHUNK_NX 4
-
+
/*-------------------------------------------------------------------------
- * Function: test_direct_chunk_write
+ * Function: test_direct_chunk_write
*
- * Purpose: Test the basic functionality of H5DOwrite_chunk
+ * Purpose: Test the basic functionality of H5DOwrite_chunk
*
- * Return: Success: An identifer for the dataset used in the tests
- * Failure: H5I_INVALID_HID
+ * Return: Success: An identifer for the dataset used in the tests
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
@@ -65,7 +65,7 @@ create_dataset(hid_t fid)
/* Initialize the data */
for (i = 0; i < NX; i++)
- data[i] = i;
+ data[i] = i;
/* Write the initialized data */
if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
@@ -91,14 +91,14 @@ create_dataset(hid_t fid)
} /* end create_dataset() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_direct_chunk_write
+ * Function: test_direct_chunk_write
*
- * Purpose: Test the basic functionality of H5DOwrite_chunk
+ * Purpose: Test the basic functionality of H5DOwrite_chunk
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
*-------------------------------------------------------------------------
*/
@@ -111,7 +111,7 @@ test_direct_chunk_write(hid_t did)
size_t data_size;
int i;
- TESTING("H5DOwrite_chunk wrapper");
+ HL_TESTING2("H5DOwrite_chunk wrapper");
/* Set the size of the chunk data */
data_size = CHUNK_NX * sizeof(int);
@@ -120,9 +120,9 @@ test_direct_chunk_write(hid_t did)
for (i = 0; i < CHUNK_NX; i++)
chunk_data[i] = (i * 10) + i;
- /* Write the direct chunk data repeatedly to cover all the chunks in the
+ /* Write the direct chunk data repeatedly to cover all the chunks in the
* dataset, using the direct writing function.
- */
+ */
offset[0] = 0;
for (i = 0; i < NX/CHUNK_NX; i++) {
if (H5DOwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, data_size, chunk_data) < 0)
@@ -138,14 +138,14 @@ error:
return 1;
} /* test_direct_chunk_write() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_direct_chunk_read
+ * Function: test_direct_chunk_read
*
- * Purpose: Test the basic functionality of H5DOread_chunk
+ * Purpose: Test the basic functionality of H5DOread_chunk
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
*-------------------------------------------------------------------------
*/
@@ -169,7 +169,7 @@ test_direct_chunk_read(hid_t did)
int i,j;
- TESTING("H5DOread_chunk wrapper");
+ HL_TESTING2("H5DOread_chunk wrapper");
/* Create dataspaces for reading */
if ((mem_sid = H5Screate_simple(1, chunk_dims, NULL)) < 0)
@@ -232,15 +232,15 @@ error:
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test direct chunk write function H5DOwrite_chunk and
+ * Purpose: Test direct chunk write function H5DOwrite_chunk and
* chunk direct read function H5DOread_chunk
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
*-------------------------------------------------------------------------
*/
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index c30b572..6d13419 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -75,11 +75,11 @@ int main(void)
nerrors += test_generate()<0 ?1:0;
if (nerrors) goto error;
- printf("All image tests passed.\n");
+ HDprintf("All image tests passed.\n");
return 0;
error:
- printf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
+ HDprintf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
return 1;
}
@@ -169,7 +169,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING("indexed image");
+ HL_TESTING2("indexed image");
/* Write image */
if ( H5IMmake_image_8bit( fid, IMAGE1_NAME, width, height, buf1 ) < 0 )
@@ -205,7 +205,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING("true color image");
+ HL_TESTING2("true color image");
/* Write image */
if ( H5IMmake_image_24bit( fid, IMAGE2_NAME, width, height, "INTERLACE_PIXEL", buf2 ) )
@@ -232,7 +232,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING("pallete functions");
+ HL_TESTING2("pallete functions");
if ( H5IMget_npalettes( fid, IMAGE1_NAME, &npals ) < 0 )
goto out;
@@ -344,14 +344,14 @@ static int test_data(void)
if ((fid=H5Fcreate(FILE2,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
goto out;
- printf("Testing read ascii image data and generate images\n");
+ HDprintf("Testing read ascii image data and generate images\n");
/*-------------------------------------------------------------------------
* read 8bit image data
*-------------------------------------------------------------------------
*/
- TESTING2("make indexed image");
+ HL_TESTING2("make indexed image");
/* read first data file */
if (read_data(DATA_FILE1,&width,&height)<0)
@@ -364,7 +364,7 @@ static int test_data(void)
PASSED();
- TESTING2("attaching palettes");
+ HL_TESTING2("attaching palettes");
/*-------------------------------------------------------------------------
* palette #1. rainbow palette. data is contained in "pal_rgb.h"
@@ -464,7 +464,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make true color image with pixel interlace");
+ HL_TESTING2("make true color image with pixel interlace");
/* read second data file */
if ((read_data(DATA_FILE2,&width,&height))<0)
@@ -481,7 +481,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make true color image with plane interlace");
+ HL_TESTING2("make true color image with plane interlace");
/* read third data file */
if ((read_data(DATA_FILE3,&width,&height))<0)
@@ -551,7 +551,7 @@ static int test_generate(void)
if ((fid=H5Fcreate(FILE3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
goto out;
- printf("Testing read and process data and make indexed images\n");
+ HDprintf("Testing read and process data and make indexed images\n");
/*-------------------------------------------------------------------------
* read data; the file data format is described below
@@ -561,7 +561,7 @@ static int test_generate(void)
f = HDfopen( data_file, "r" ) ;
if ( f == NULL )
{
- printf( "Could not find file %s. Try set $srcdir \n", data_file );
+ HDprintf( "Could not find file %s. Try set $srcdir \n", data_file );
goto out;
}
@@ -602,11 +602,11 @@ static int test_generate(void)
if(fscanf( f, "%d %d %d", &imax, &jmax, &kmax ) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s.\n", data_file );
+ HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
if(fscanf( f, "%f %f %f", &valex, &xmin, &xmax ) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s.\n", data_file );
+ HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
@@ -627,7 +627,7 @@ static int test_generate(void)
goto out;
if(n_elements > INT_MAX / (int)sizeof(float))
goto out;
-
+
data = (float *)HDmalloc((size_t)n_elements * sizeof(float));
if(NULL == data)
goto out;
@@ -638,7 +638,7 @@ static int test_generate(void)
for ( i = 0; i < n_elements; i++ )
{
if(fscanf( f, "%f ", &value ) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s.\n", data_file );
+ HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
data[i] = value;
@@ -652,7 +652,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make indexed image from all the data");
+ HL_TESTING2("make indexed image from all the data");
for ( i = 0; i < n_elements; i++ )
image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / (xmax - xmin ));
@@ -669,7 +669,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make indexed image from land data");
+ HL_TESTING2("make indexed image from land data");
for ( i = 0; i < n_elements; i++ )
{
@@ -691,7 +691,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make indexed image from sea data");
+ HL_TESTING2("make indexed image from sea data");
for ( i = 0; i < n_elements; i++ )
{
@@ -712,7 +712,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attaching palettes");
+ HL_TESTING2("attaching palettes");
/* make a palette */
if ((H5IMmake_palette(fid,PAL1_NAME,pal_dims,pal_rgb))<0)
@@ -797,37 +797,37 @@ static int read_data(const char* fname, /*IN*/
*/
if(NULL == (f = HDfopen(data_file, "r"))) {
- printf( "Could not open file %s. Try set $srcdir \n", data_file );
+ HDprintf( "Could not open file %s. Try set $srcdir \n", data_file );
goto out;
}
if(fscanf(f, "%s", str) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s.\n", data_file );
+ HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
if(fscanf(f, "%d", &color_planes) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s.\n", data_file );
+ HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
if(fscanf(f, "%s", str) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s.\n", data_file );
+ HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
-
+
if(fscanf(f, "%d", &h) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s.\n", data_file );
+ HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
if(fscanf(f, "%s", str) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s.\n", data_file );
+ HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
if(fscanf(f, "%d", &w) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s.\n", data_file );
+ HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
@@ -861,7 +861,7 @@ static int read_data(const char* fname, /*IN*/
/* Read data elements */
for(i = 0; i < n_elements; i++) {
if(fscanf(f, "%d", &n) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s.\n", data_file );
+ HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
image_data[i] = (unsigned char)n;
@@ -870,7 +870,7 @@ static int read_data(const char* fname, /*IN*/
/* Indicate success */
ret_val = 1;
-out:
+out:
if(f)
HDfclose(f);
@@ -917,7 +917,7 @@ static int read_palette(const char* fname,
/* open the input file */
if (!(file = HDfopen(data_file, "r")))
{
- printf( "Could not open file %s. Try set $srcdir \n", data_file );
+ HDprintf( "Could not open file %s. Try set $srcdir \n", data_file );
return -1;
}
diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c
index 12a226a..e3cde5d 100644
--- a/hl/test/test_ld.c
+++ b/hl/test/test_ld.c
@@ -29,12 +29,12 @@
#define DSET_ONE "DSET_ONE"
#define DSET_ALLOC_LATE "DSET_ALLOC_LATE"
#define DSET_ALLOC_EARLY "DSET_ALLOC_EARLY"
-#define DSET_TWO "DSET_TWO"
-#define TWO_DIM_1 4
-#define TWO_DIM_2 10
-#define DSET_CMPD "DSET_CMPD"
-#define DSET_CMPD_ESC "DSET_CMPD_ESC"
-#define DSET_CMPD_TWO "DSET_CMPD_TWO"
+#define DSET_TWO "DSET_TWO"
+#define TWO_DIM_1 4
+#define TWO_DIM_2 10
+#define DSET_CMPD "DSET_CMPD"
+#define DSET_CMPD_ESC "DSET_CMPD_ESC"
+#define DSET_CMPD_TWO "DSET_CMPD_TWO"
#define DSET_NULL "DSET_NULL"
#define DSET_SCALAR "DSET_SCALAR"
@@ -53,63 +53,63 @@
#define INVALID_ESC_FIELDS2 "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\,."
#define INVALID_ESC_FIELDS3 "field2\\..\\,,b.a,field2\\..\\\\c,field4\\,.b\\,"
-/*
+/*
* Test variations (retained original) for one-dimensional dataset:
- * Varies from 10->13; 10->9, 10->10, 10->1, 10->11
+ * Varies from 10->13; 10->9, 10->10, 10->1, 10->11
*/
#define ONE_NTESTS 5
int one_tests[ONE_NTESTS] = {3, -1, 0, -9, 1};
-/*
+/*
* Test variations (retained original) for two-dimensional dataset:
- * Varies from {4,10}->{6,12}; {4,10}->{6,9}; {4,10}->{6,10};
- * {4,10}->{3,12}; {4,10}->{3,9}; {4,10}->{3,10};
- * {4,10}->{4,12}; {4,10}->{4,9}; {4,10}->{4,10}
+ * Varies from {4,10}->{6,12}; {4,10}->{6,9}; {4,10}->{6,10};
+ * {4,10}->{3,12}; {4,10}->{3,9}; {4,10}->{3,10};
+ * {4,10}->{4,12}; {4,10}->{4,9}; {4,10}->{4,10}
*/
-#define TWO_NTESTS 9
+#define TWO_NTESTS 9
int two_tests[TWO_NTESTS][2] = { {2,2}, {2,-1}, {2,0},
- {-1,2}, {-1,-1}, {-1,0},
- {0,2}, {0,-1}, {0,0} };
+ {-1,2}, {-1,-1}, {-1,0},
+ {0,2}, {0,-1}, {0,0} };
/* Verify that the two input values are the same */
-#define VERIFY_EQUAL(_x, _y) \
-{ \
- long __x = (long)_x, __y = (long)_y; \
- if(__x != __y) TEST_ERROR \
+#define VERIFY_EQUAL(_x, _y) \
+{ \
+ long __x = (long)_x, __y = (long)_y; \
+ if(__x != __y) TEST_ERROR \
}
/* Temporary buffer for reading in the test file */
-#define TMP_BUF_SIZE 2048
+#define TMP_BUF_SIZE 2048
char g_tmp_buf[TMP_BUF_SIZE];
/* Macros for verifying compound fields */
/* Verify all fields */
-#define VERIFY_ELMTS_ALL(ent1, ent2) { \
- VERIFY_EQUAL(ent1.field1, ent2.field1); \
- VERIFY_EQUAL(ent1.field2.a, ent2.field2.a); \
- VERIFY_EQUAL(ent1.field2.b.a, ent2.field2.b.a); \
- VERIFY_EQUAL(ent1.field2.b.b, ent2.field2.b.b); \
- VERIFY_EQUAL(ent1.field2.b.c, ent2.field2.b.c); \
- VERIFY_EQUAL(ent1.field2.c, ent2.field2.c); \
- VERIFY_EQUAL(ent1.field3, ent2.field3); \
- VERIFY_EQUAL(ent1.field4.a, ent2.field4.a); \
+#define VERIFY_ELMTS_ALL(ent1, ent2) { \
+ VERIFY_EQUAL(ent1.field1, ent2.field1); \
+ VERIFY_EQUAL(ent1.field2.a, ent2.field2.a); \
+ VERIFY_EQUAL(ent1.field2.b.a, ent2.field2.b.a); \
+ VERIFY_EQUAL(ent1.field2.b.b, ent2.field2.b.b); \
+ VERIFY_EQUAL(ent1.field2.b.c, ent2.field2.b.c); \
+ VERIFY_EQUAL(ent1.field2.c, ent2.field2.c); \
+ VERIFY_EQUAL(ent1.field3, ent2.field3); \
+ VERIFY_EQUAL(ent1.field4.a, ent2.field4.a); \
}
/* Verify fields selected in VALID_FIELDS1 */
-#define VERIFY_ELMTS_VALID1(ent1, ent2) { \
- VERIFY_EQUAL(ent1.field1, ent2.field1); \
- VERIFY_EQUAL(ent1.field2_a, ent2.field2.a); \
- VERIFY_EQUAL(ent1.field3, ent2.field3); \
- VERIFY_EQUAL(ent1.field4.a, ent2.field4.a); \
- VERIFY_EQUAL(ent1.field4.b, ent2.field4.b); \
+#define VERIFY_ELMTS_VALID1(ent1, ent2) { \
+ VERIFY_EQUAL(ent1.field1, ent2.field1); \
+ VERIFY_EQUAL(ent1.field2_a, ent2.field2.a); \
+ VERIFY_EQUAL(ent1.field3, ent2.field3); \
+ VERIFY_EQUAL(ent1.field4.a, ent2.field4.a); \
+ VERIFY_EQUAL(ent1.field4.b, ent2.field4.b); \
}
/* Verify fields selected in VALID_FIELDS2 */
-#define VERIFY_ELMTS_VALID2(ent1, ent2) { \
- VERIFY_EQUAL(ent1.field2_b_a, ent2.field2.b.a); \
- VERIFY_EQUAL(ent1.field2_c, ent2.field2.c); \
- VERIFY_EQUAL(ent1.field4_b, ent2.field4.b); \
+#define VERIFY_ELMTS_VALID2(ent1, ent2) { \
+ VERIFY_EQUAL(ent1.field2_b_a, ent2.field2.b.a); \
+ VERIFY_EQUAL(ent1.field2_c, ent2.field2.c); \
+ VERIFY_EQUAL(ent1.field4_b, ent2.field4.b); \
}
/* The types of 2-dimensional dataset: DSET_TWO or DSET_CMPD_TWO */
@@ -118,34 +118,34 @@ char g_tmp_buf[TMP_BUF_SIZE];
#define TWO_CMPD_VALID1 2 /* DSET_CMPD_TWO with VALID_FIELDS1 or VALID_ESC_FIELDS1 */
#define TWO_CMPD_VALID2 3 /* DSET_CMPD_TWO with VALID_FIELDS2 or VALID_ESC_FIELDS2 */
-#define VERIFY_ELMTS(type, k, ind, _ldbuf, _buf) { \
- if(type == TWO_NONE) { \
- int *iib = (int *)_ldbuf; \
- int *ib = (int *)_buf; \
- \
- VERIFY_EQUAL(iib[k], ib[ind + n]) \
- } else if(type == TWO_CMPD_NULL) { \
- set_t *ccb = (set_t *)_ldbuf; \
- set_t *cb = (set_t *)_buf; \
- \
- VERIFY_ELMTS_ALL(ccb[k], cb[ind + n]) \
- } else if(type == TWO_CMPD_VALID1) { \
- test_valid_fields1 *vb1 = (test_valid_fields1 *)_ldbuf; \
- set_t *cb = (set_t *)_buf; \
- \
- VERIFY_ELMTS_VALID1(vb1[k], cb[ind + n]) \
- } else if(type == TWO_CMPD_VALID2) { \
- test_valid_fields2 *vb2 = (test_valid_fields2 *)_ldbuf; \
- set_t *cb = (set_t *)_buf; \
- \
- VERIFY_ELMTS_VALID2(vb2[k], cb[ind + n]) \
- } \
+#define VERIFY_ELMTS(type, k, ind, _ldbuf, _buf) { \
+ if(type == TWO_NONE) { \
+ int *iib = (int *)_ldbuf; \
+ int *ib = (int *)_buf; \
+ \
+ VERIFY_EQUAL(iib[k], ib[ind + n]) \
+ } else if(type == TWO_CMPD_NULL) { \
+ set_t *ccb = (set_t *)_ldbuf; \
+ set_t *cb = (set_t *)_buf; \
+ \
+ VERIFY_ELMTS_ALL(ccb[k], cb[ind + n]) \
+ } else if(type == TWO_CMPD_VALID1) { \
+ test_valid_fields1 *vb1 = (test_valid_fields1 *)_ldbuf; \
+ set_t *cb = (set_t *)_buf; \
+ \
+ VERIFY_ELMTS_VALID1(vb1[k], cb[ind + n]) \
+ } else if(type == TWO_CMPD_VALID2) { \
+ test_valid_fields2 *vb2 = (test_valid_fields2 *)_ldbuf; \
+ set_t *cb = (set_t *)_buf; \
+ \
+ VERIFY_ELMTS_VALID2(vb2[k], cb[ind + n]) \
+ } \
}
/* Tests for test_LD_elmts_pipe() */
-#define ONE_TESTS 3
+#define ONE_TESTS 3
int onetests[ONE_TESTS] = {3, 9, 1};
-#define TWO_TESTS 5
+#define TWO_TESTS 5
int twotests[TWO_TESTS][2] = { {2,2}, {2,-1}, {2,0}, {-1,2}, {0,2} };
@@ -185,9 +185,9 @@ typedef struct set_t {
sub4_t field4;
} set_t;
-/* NOTE:
- * This will fail on heiwa and amani when VALID_FIELDS1 is "field1,field3,field4"
- * because of alignment problems:
+/* NOTE:
+ * This will fail on heiwa and amani when VALID_FIELDS1 is "field1,field3,field4"
+ * because of alignment problems:
* amani and heiwa - 8 byte alignment
* jam - 4 byte alignemnt
* This will need to be fixed in the library for H5Tget_native_type().
@@ -211,185 +211,185 @@ typedef struct test_valid_fields2 {
/* Temporary buffers for tests: test_LD_elmts_one() & test_LD_elmts_two() */
-#define TEST_BUF_SIZE 100
-int *iibuf; /* buffer for storing retrieved elements */
-int *ibuf; /* buffer for storing retrieved elements (integer) */
-set_t *cbuf; /* buffer for storing retrieved elemnets (compound) */
-set_t *ccbuf; /* buffer for storing retrieved elemnets (compound) */
-test_valid_fields1 *vbuf1; /* buffer for storing retrieved elements (FIELDS1) */
-test_valid_fields2 *vbuf2; /* buffer for storing retrieved elements (FIELDS2) */
-
-
-/*
+#define TEST_BUF_SIZE 100
+int *iibuf; /* buffer for storing retrieved elements */
+int *ibuf; /* buffer for storing retrieved elements (integer) */
+set_t *cbuf; /* buffer for storing retrieved elemnets (compound) */
+set_t *ccbuf; /* buffer for storing retrieved elemnets (compound) */
+test_valid_fields1 *vbuf1; /* buffer for storing retrieved elements (FIELDS1) */
+test_valid_fields2 *vbuf2; /* buffer for storing retrieved elements (FIELDS2) */
+
+
+/*
*********************************************************************************
*
* Testing for the High Level public routine: H5LDget_dset_dims()
- * 1) An invalid dataset id
- * 2) "DSET_ALLOC_EARLY": NULL cur_dims
- * 3) "DSET_ALLOC_LATE": nonNULL cur_dims
- * 4) "DSET_CMPD_TWO": nonNULL cur_dims
- * 5) "DSET_NULL": nonNULL cur_dims
- * 6) "DSET_SCALAR": nonNULL cur_dims
+ * 1) An invalid dataset id
+ * 2) "DSET_ALLOC_EARLY": NULL cur_dims
+ * 3) "DSET_ALLOC_LATE": nonNULL cur_dims
+ * 4) "DSET_CMPD_TWO": nonNULL cur_dims
+ * 5) "DSET_NULL": nonNULL cur_dims
+ * 6) "DSET_SCALAR": nonNULL cur_dims
*
*********************************************************************************
*/
static herr_t
test_LD_dims_params(const char *file)
{
- hid_t fid=-1; /* file identifier */
- hid_t did=-1; /* dataset identifier */
- hsize_t one_cur_dims[1]; /* current dimension sizes for 1-dimensonal dataset */
- hsize_t two_cur_dims[2]; /* current dimension sizes for 2-dimensional dataset */
+ hid_t fid=-1; /* file identifier */
+ hid_t did=-1; /* dataset identifier */
+ hsize_t one_cur_dims[1]; /* current dimension sizes for 1-dimensonal dataset */
+ hsize_t two_cur_dims[2]; /* current dimension sizes for 2-dimensional dataset */
hid_t invalid_id = -1;
- herr_t ret; /* return value */
+ herr_t ret; /* return value */
const char *filename = H5_get_srcdir_filename(file);
- TESTING("H5LDget_dset_dims");
+ HL_TESTING2("H5LDget_dset_dims");
/* Open the copied file */
if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
- /*
+ /*
* 1. Verify failure with negative dataset id
*/
H5E_BEGIN_TRY {
- ret = H5LDget_dset_dims(invalid_id, one_cur_dims);
+ ret = H5LDget_dset_dims(invalid_id, one_cur_dims);
} H5E_END_TRY;
VERIFY_EQUAL(ret, FAIL)
- /*
+ /*
* 2. Verify failure for NULL cur_dims
*/
if((did = H5Dopen2(fid, DSET_ALLOC_EARLY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
H5E_BEGIN_TRY {
- ret = H5LDget_dset_dims(did, NULL);
+ ret = H5LDget_dset_dims(did, NULL);
} H5E_END_TRY;
VERIFY_EQUAL(ret, FAIL)
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
- /*
+ /*
* 3. Verify for nonNULL cur_dims
*/
if((did = H5Dopen2(fid, DSET_ALLOC_LATE, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5LDget_dset_dims(did, one_cur_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
VERIFY_EQUAL(one_cur_dims[0], 10)
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
- /*
+ /*
* 4. Verify nonNULL cur_dims for a 2-dimensional dataset
*/
if((did = H5Dopen2(fid, DSET_CMPD_TWO, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5LDget_dset_dims(did, two_cur_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
VERIFY_EQUAL(two_cur_dims[0], TWO_DIM_1)
VERIFY_EQUAL(two_cur_dims[1], TWO_DIM_2)
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
- /*
+ /*
* 5. Verify nonNULL cur_dims for dataset with H5S_NULL dataspace
*/
one_cur_dims[0] = 0;
if((did = H5Dopen2(fid, DSET_NULL, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5LDget_dset_dims(did, one_cur_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
VERIFY_EQUAL(one_cur_dims[0], 0)
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
- /*
+ /*
* 6. Verify nonNULL cur_dims for dataset with H5S_SCALAR dataspace
*/
one_cur_dims[0] = 0;
if((did = H5Dopen2(fid, DSET_SCALAR, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5LDget_dset_dims(did, one_cur_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
VERIFY_EQUAL(one_cur_dims[0], 0)
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Close the file */
if(H5Fclose(fid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Fclose(fid);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return(-1);
} /* test_LD_dims_params() */
-
-/*
+
+/*
*********************************************************************************
*
* Testing for the High Level public routine: H5LDget_dset_dims()
* Verify that the dimension sizes retrieved via H5LDget_dset_dims() are correct
* for the following cases:
*
- * DSET_ONE: one-dimensional dataset
- * 1. Increase dims[0]
- * 2. Decrease dims[0]
- * 3. same dims[0]
- * 4. Decrease dims[0]
- * 5. Increase dims[0]
+ * DSET_ONE: one-dimensional dataset
+ * 1. Increase dims[0]
+ * 2. Decrease dims[0]
+ * 3. same dims[0]
+ * 4. Decrease dims[0]
+ * 5. Increase dims[0]
*
- * one_tests[ONE_NTESTS] = {3, -1, 0, -9, 1}
- * Varies from 10->3; 10->9, 10->10, 10->1, 10->11
+ * one_tests[ONE_NTESTS] = {3, -1, 0, -9, 1}
+ * Varies from 10->3; 10->9, 10->10, 10->1, 10->11
*
- * DSET_TWO: two-dimensional dataset
- * 1. Increase dims[0], increase dims[1]
- * 2. Increase dims[0], decrease dims[1]
- * 3. Increase dims[0], same dims[1]
- * 4. Decrease dims[0], increase dims[1]
- * 5. Decrease dims[0], decrease dims[1]
- * 6. Decrease dims[0], same dims[1]
- * 7. same dims[0], increase dims[1]
- * 8. same dims[0], decrease dims[1]
- * 9. same dims[0], same dims[1]
+ * DSET_TWO: two-dimensional dataset
+ * 1. Increase dims[0], increase dims[1]
+ * 2. Increase dims[0], decrease dims[1]
+ * 3. Increase dims[0], same dims[1]
+ * 4. Decrease dims[0], increase dims[1]
+ * 5. Decrease dims[0], decrease dims[1]
+ * 6. Decrease dims[0], same dims[1]
+ * 7. same dims[0], increase dims[1]
+ * 8. same dims[0], decrease dims[1]
+ * 9. same dims[0], same dims[1]
*
- * two_tests[TWO_NTESTS][2] = { {2,2}, {2,-1}, {2,0},
- * {-1,2}, {-1,-1}, {-1,0},
- * {0,2}, {0,-1}, {0,0} }
- * Varies from {4,10}->{6,12}; {4,10}->{6,9}; {4,10}->{6,10};
- * {4,10}->{3,12}; {4,10}->{3,9}; {4,10}->{3,10};
- * {4,10}->{4,12}; {4,10}->{4,9}; {4,10}->{4,10}
+ * two_tests[TWO_NTESTS][2] = { {2,2}, {2,-1}, {2,0},
+ * {-1,2}, {-1,-1}, {-1,0},
+ * {0,2}, {0,-1}, {0,0} }
+ * Varies from {4,10}->{6,12}; {4,10}->{6,9}; {4,10}->{6,10};
+ * {4,10}->{3,12}; {4,10}->{3,9}; {4,10}->{3,10};
+ * {4,10}->{4,12}; {4,10}->{4,9}; {4,10}->{4,10}
*
*********************************************************************************
*/
static herr_t
test_LD_dims(const char *file)
{
- hid_t fid=-1; /* file identifier */
- hid_t did=-1; /* dataset identifier */
- hsize_t one_prev_dims[1]; /* original dimension sizes for 1-dimensonal dataset */
- hsize_t one_cur_dims[1]; /* current dimension sizes for 1-dimensonal dataset */
- hsize_t one_ext_dims[1]; /* extended dimension sizes for 1-dimensonal dataset */
- hsize_t two_prev_dims[2]; /* original dimension sizes for 2-dimensional dataset */
- hsize_t two_cur_dims[2]; /* current dimension sizes for 2-dimensional dataset */
- hsize_t two_ext_dims[2]; /* extended dimension sizes for 2-dimensional dataset*/
- int i; /* local index variable */
-
- TESTING("H5LDget_dset_dims with H5Dset_extent");
+ hid_t fid=-1; /* file identifier */
+ hid_t did=-1; /* dataset identifier */
+ hsize_t one_prev_dims[1]; /* original dimension sizes for 1-dimensonal dataset */
+ hsize_t one_cur_dims[1]; /* current dimension sizes for 1-dimensonal dataset */
+ hsize_t one_ext_dims[1]; /* extended dimension sizes for 1-dimensonal dataset */
+ hsize_t two_prev_dims[2]; /* original dimension sizes for 2-dimensional dataset */
+ hsize_t two_cur_dims[2]; /* current dimension sizes for 2-dimensional dataset */
+ hsize_t two_ext_dims[2]; /* extended dimension sizes for 2-dimensional dataset*/
+ int i; /* local index variable */
+
+ HL_TESTING2("H5LDget_dset_dims with H5Dset_extent");
/* Make a copy of the test file */
if(h5_make_local_copy(file, COPY_FILENAME) < 0)
@@ -397,75 +397,75 @@ test_LD_dims(const char *file)
/* Open the copied file */
if((fid = H5Fopen(COPY_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
- /*
+ /*
* Testing with one-dimensional dataset: DSET_ONE
*/
if((did = H5Dopen2(fid, DSET_ONE, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Retrieve dimension sizes */
if(H5LDget_dset_dims(did, one_prev_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
for(i = 0; i < ONE_NTESTS; i++) {
- /* Set up the extended dimension sizes */
- one_ext_dims[0] = (hsize_t)((int)one_prev_dims[0] + one_tests[i]);
+ /* Set up the extended dimension sizes */
+ one_ext_dims[0] = (hsize_t)((int)one_prev_dims[0] + one_tests[i]);
- /* Change the dimension size */
- if(H5Dset_extent(did, one_ext_dims) < 0)
- FAIL_STACK_ERROR
+ /* Change the dimension size */
+ if(H5Dset_extent(did, one_ext_dims) < 0)
+ FAIL_STACK_ERROR
- /* Retrieve the dimension size */
- if(H5LDget_dset_dims(did, one_cur_dims) < 0)
- FAIL_STACK_ERROR
+ /* Retrieve the dimension size */
+ if(H5LDget_dset_dims(did, one_cur_dims) < 0)
+ FAIL_STACK_ERROR
- /* Verify that the retrieved dimension size is correct as expected */
- VERIFY_EQUAL(one_cur_dims[0], one_ext_dims[0])
+ /* Verify that the retrieved dimension size is correct as expected */
+ VERIFY_EQUAL(one_cur_dims[0], one_ext_dims[0])
}
/* Close the dataset */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
- /*
+ /*
* Testing with two-dimensional dataset: DSET_TWO
*/
if((did = H5Dopen2(fid, DSET_TWO, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Retrieve the dimension sizes */
if(H5LDget_dset_dims(did, two_prev_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
for(i = 0; i < TWO_NTESTS; i++) {
- /* Set up the extended dimension sizes */
- two_ext_dims[0] = (hsize_t)((int)two_prev_dims[0] + two_tests[i][0]);
- two_ext_dims[1] = (hsize_t) ((int)two_prev_dims[1] + two_tests[i][1]);
+ /* Set up the extended dimension sizes */
+ two_ext_dims[0] = (hsize_t)((int)two_prev_dims[0] + two_tests[i][0]);
+ two_ext_dims[1] = (hsize_t) ((int)two_prev_dims[1] + two_tests[i][1]);
- /* Change the dimension sizes */
- if(H5Dset_extent(did, two_ext_dims) < 0)
- FAIL_STACK_ERROR
+ /* Change the dimension sizes */
+ if(H5Dset_extent(did, two_ext_dims) < 0)
+ FAIL_STACK_ERROR
- /* Retrieve the dimension sizes */
- if(H5LDget_dset_dims(did, two_cur_dims) < 0)
- FAIL_STACK_ERROR
+ /* Retrieve the dimension sizes */
+ if(H5LDget_dset_dims(did, two_cur_dims) < 0)
+ FAIL_STACK_ERROR
- /* Verify that the retrieved dimension sizes are correct as expected */
- VERIFY_EQUAL(two_cur_dims[0], two_ext_dims[0])
- VERIFY_EQUAL(two_cur_dims[1], two_ext_dims[1])
+ /* Verify that the retrieved dimension sizes are correct as expected */
+ VERIFY_EQUAL(two_cur_dims[0], two_ext_dims[0])
+ VERIFY_EQUAL(two_cur_dims[1], two_ext_dims[1])
} /* end TWO_NTESTS */
/* Close the dataset */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Close the file */
if(H5Fclose(fid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Remove the copied file */
HDremove(COPY_FILENAME);
@@ -475,172 +475,172 @@ test_LD_dims(const char *file)
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Fclose(fid);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return(-1);
} /* test_LD_dims() */
-
-/*
+
+/*
**********************************************************************************
*
* Testing for the High Level public routine: H5LDget_dset_type_size()
* Verify that the data type size returned via H5LDget_dset_type_size()
* are correct for the following cases:
*
- * Verify failure for an invalid dataset id
+ * Verify failure for an invalid dataset id
*
- * DSET_CMPD: one-dimensional dataset with compound type
- * 1. The whole element
- * 2. VALID_FIELDS1: "field1,field2.a,field3,field4"
- * 3. VALID_FIELDS2: "field2.b.a,field2.c,field4.b"
- * 4. INVALID_FIELDS1: "field2.k.a,field2.c,field4.k"
- * 5. INVALID_FIELDS2: "field2.b.a,field2.c,field4.b."
- * 6. INVALID_FIELDS3: "field2.b.a,,field2.c,field4.b"
+ * DSET_CMPD: one-dimensional dataset with compound type
+ * 1. The whole element
+ * 2. VALID_FIELDS1: "field1,field2.a,field3,field4"
+ * 3. VALID_FIELDS2: "field2.b.a,field2.c,field4.b"
+ * 4. INVALID_FIELDS1: "field2.k.a,field2.c,field4.k"
+ * 5. INVALID_FIELDS2: "field2.b.a,field2.c,field4.b."
+ * 6. INVALID_FIELDS3: "field2.b.a,,field2.c,field4.b"
*
- * DSET_CMPD_ESC: one-dimensional dataset with compound type and
- * member names with escape/separator characters
- * 1. The whole element
- * 2. VALID_ESC_FIELDS1: "field\\,1,field2\\..\\.a,field\\\\3,field4\\,"
- * 3. VALID_ESC_FIELDS2: "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\,"
- * 4. INVALID_ESC_FIELDS1: "field2\\..\\,k.a,field2\\..\\\\c,field4\\,.k\\,"
- * 5. INVALID_ESC_FIELDS2: "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\,."
- * 6. INVALID_ESC_FIELDS3: "field2\\..\\,,b.a,field2\\..\\\\c,field4\\,.b\\,"
+ * DSET_CMPD_ESC: one-dimensional dataset with compound type and
+ * member names with escape/separator characters
+ * 1. The whole element
+ * 2. VALID_ESC_FIELDS1: "field\\,1,field2\\..\\.a,field\\\\3,field4\\,"
+ * 3. VALID_ESC_FIELDS2: "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\,"
+ * 4. INVALID_ESC_FIELDS1: "field2\\..\\,k.a,field2\\..\\\\c,field4\\,.k\\,"
+ * 5. INVALID_ESC_FIELDS2: "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\,."
+ * 6. INVALID_ESC_FIELDS3: "field2\\..\\,,b.a,field2\\..\\\\c,field4\\,.b\\,"
*
**********************************************************************************
*/
static int
test_LD_size(const char *file)
{
- hid_t fid=-1; /* file identifier */
- hid_t did=-1; /* dataset identifier */
- hid_t dtid=-1; /* dataset's datatype identifier */
+ hid_t fid=-1; /* file identifier */
+ hid_t did=-1; /* dataset identifier */
+ hid_t dtid=-1; /* dataset's datatype identifier */
hid_t invalid_id=-1;
- hid_t memb0_tid=-1; /* type identifier for a member in the compound type */
- hid_t memb1_tid=-1; /* type identifier for a member in the compound type */
- hid_t memb2_tid=-1; /* type identifier for a member in the compound type */
- hid_t memb3_tid=-1; /* type identifier for a member in the compound type */
- hid_t memb_tid=-1; /* type identifier for a member in the compound type */
- hid_t memb_tid2=-1; /* type identifier for a member in the compound type */
- size_t dsize; /* size of the dataset's datatype */
- size_t ck_dsize; /* size of the dataset's datatype to be checked against */
+ hid_t memb0_tid=-1; /* type identifier for a member in the compound type */
+ hid_t memb1_tid=-1; /* type identifier for a member in the compound type */
+ hid_t memb2_tid=-1; /* type identifier for a member in the compound type */
+ hid_t memb3_tid=-1; /* type identifier for a member in the compound type */
+ hid_t memb_tid=-1; /* type identifier for a member in the compound type */
+ hid_t memb_tid2=-1; /* type identifier for a member in the compound type */
+ size_t dsize; /* size of the dataset's datatype */
+ size_t ck_dsize; /* size of the dataset's datatype to be checked against */
const char *filename = H5_get_srcdir_filename(file);
- TESTING("H5LDget_dset_type_size");
+ HL_TESTING2("H5LDget_dset_type_size");
/* Open the file */
if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
- /*
+ /*
* Verify failure with an invalid dataset id
*/
H5E_BEGIN_TRY {
- dsize = H5LDget_dset_type_size(invalid_id, NULL);
+ dsize = H5LDget_dset_type_size(invalid_id, NULL);
} H5E_END_TRY;
VERIFY_EQUAL(dsize, 0)
- /*
+ /*
* Testing one-dimensional dataset with compound datatype:
- * DSET_CMPD
+ * DSET_CMPD
*/
/* Open dataset DSET_CMPD */
if((did = H5Dopen2(fid, DSET_CMPD, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Return size of the whole element */
if((dsize = H5LDget_dset_type_size(did, NULL)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get the dataset's datatype and then its datatype size */
if((dtid = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0)
FAIL_STACK_ERROR
if((ck_dsize = H5Tget_size(dtid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Verify case #1 */
VERIFY_EQUAL(dsize, ck_dsize)
/* Get datatype id for each member */
if((memb0_tid = H5Tget_member_type(dtid, 0)) < 0) /* "field1" */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((memb1_tid = H5Tget_member_type(dtid, 1)) < 0) /* "field2" */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((memb2_tid = H5Tget_member_type(dtid, 2)) < 0) /* "field3" */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((memb3_tid = H5Tget_member_type(dtid, 3)) < 0) /* "field4" */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Obtain size for VALID_FIELDS1: "field1,field2.a,field3,field4" */
if((dsize = H5LDget_dset_type_size(did, VALID_FIELDS1)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get the datatype size for "field1" */
if((ck_dsize = H5Tget_size(memb0_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Add the datatype size for "field2.a" */
if((memb_tid = H5Tget_member_type(memb1_tid, 0)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((ck_dsize += H5Tget_size(memb_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Add the datatype size for "field3" */
if((ck_dsize += H5Tget_size(memb2_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Add the datatype size for "field4" */
if((ck_dsize += H5Tget_size(memb3_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Verify case #2 */
VERIFY_EQUAL(dsize, ck_dsize)
/* Obtain datatype size for VALID_FIELDS2: "field2.b.a,field2.c,field4.b" */
if((dsize = H5LDget_dset_type_size(did, VALID_FIELDS2)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get the datatype size for "field2.b.a" */
if((memb_tid = H5Tget_member_type(memb1_tid, 1)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((memb_tid2 = H5Tget_member_type(memb_tid, 0)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((ck_dsize = H5Tget_size(memb_tid2)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb_tid2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Add the datatype size for "field2.c" */
if((memb_tid = H5Tget_member_type(memb1_tid, 2)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((ck_dsize += H5Tget_size(memb_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Add the datatype size for "field4.b" */
if((memb_tid = H5Tget_member_type(memb3_tid, 1)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((ck_dsize += H5Tget_size(memb_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Verify case #3 */
VERIFY_EQUAL(dsize, ck_dsize)
/*
- * Verify failure for the following invalid nested fields:
- * INVALID_FIELDS1: "field2.k.a,field2.c,field4.k"
+ * Verify failure for the following invalid nested fields:
+ * INVALID_FIELDS1: "field2.k.a,field2.c,field4.k"
* INVALID_FIELDS2: "field2.b.a,field2.c,field4.b."
* INVALID_FIELDS3: "field2.b.a,,field2.c,field4.b"
*/
@@ -655,119 +655,119 @@ test_LD_size(const char *file)
/* Verify failure for case #6 */
dsize = H5LDget_dset_type_size(did, INVALID_FIELDS3);
VERIFY_EQUAL(dsize, 0)
-
+
/* Closing */
if(H5Tclose(memb0_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb1_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb2_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb3_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(dtid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
- /*
+ /*
* Testing one-dimensional dataset with compound datatype and
- * member names consisting of escape/separator characters:
- * DSET_CMPD_ESC
+ * member names consisting of escape/separator characters:
+ * DSET_CMPD_ESC
*/
/* Open dataset DSET_CMPD_ESC */
if((did = H5Dopen2(fid, DSET_CMPD_ESC, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Return size of the whole element */
if((dsize = H5LDget_dset_type_size(did, NULL)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get the dataset's datatype and then its datatype size */
if((dtid = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0)
FAIL_STACK_ERROR
if((ck_dsize = H5Tget_size(dtid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Verify case #1 */
VERIFY_EQUAL(dsize, ck_dsize)
/* Get datatype id for each member */
if((memb0_tid = H5Tget_member_type(dtid, 0)) < 0) /* "field,1" */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((memb1_tid = H5Tget_member_type(dtid, 1)) < 0) /* "field2." */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((memb2_tid = H5Tget_member_type(dtid, 2)) < 0) /* "field\3" */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((memb3_tid = H5Tget_member_type(dtid, 3)) < 0) /* "field4," */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Obtain size for VALID_ESC_FIELDS1: "field\\,1,field2\\..\\.a,field\\\\3,field4\\," */
if((dsize = H5LDget_dset_type_size(did, VALID_ESC_FIELDS1)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get the datatype size for "field\\,1" */
if((ck_dsize = H5Tget_size(memb0_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Add the datatype size for "field2\\..\\.a" */
if((memb_tid = H5Tget_member_type(memb1_tid, 0)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((ck_dsize += H5Tget_size(memb_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Add the datatype size for "field\\\\3" */
if((ck_dsize += H5Tget_size(memb2_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Add the datatype size for "field4\\," */
if((ck_dsize += H5Tget_size(memb3_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Verify case #2 */
VERIFY_EQUAL(dsize, ck_dsize)
- /* Obtain datatype size for VALID_ESC_FIELDS2:
- "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\," */
+ /* Obtain datatype size for VALID_ESC_FIELDS2:
+ "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\," */
if((dsize = H5LDget_dset_type_size(did, VALID_ESC_FIELDS2)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get the datatype size for "field2\..,b.a" */
if((memb_tid = H5Tget_member_type(memb1_tid, 1)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((memb_tid2 = H5Tget_member_type(memb_tid, 0)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((ck_dsize = H5Tget_size(memb_tid2)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb_tid2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Add the datatype size for "field2\..\\c" */
if((memb_tid = H5Tget_member_type(memb1_tid, 2)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((ck_dsize += H5Tget_size(memb_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Add the datatype size for "field4\,.b\," */
if((memb_tid = H5Tget_member_type(memb3_tid, 1)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((ck_dsize += H5Tget_size(memb_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Verify case #3 */
VERIFY_EQUAL(dsize, ck_dsize)
/*
- * Verify failure for the following invalid nested fields:
+ * Verify failure for the following invalid nested fields:
* INVALID_ESC_FIELDS1: "field2\..\,k.a,field2\..\\c,field4\,.k\,"
* INVALID_ESC_FIELDS2: "field2\..\,b.a,field2\..\\c,field4\,.b\,."
* INVALID_ESC_FIELDS3: "field2\..\,,b.a,field2\..\\c,field4\,.b\,"
@@ -786,90 +786,90 @@ test_LD_size(const char *file)
/* Closing */
if(H5Tclose(memb0_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb1_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb2_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(memb3_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Tclose(dtid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Fclose(fid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Tclose(memb0_tid);
- H5Tclose(memb1_tid);
- H5Tclose(memb2_tid);
- H5Tclose(memb3_tid);
- H5Tclose(memb_tid);
- H5Tclose(memb_tid2);
- H5Tclose(dtid);
- H5Dclose(did);
- H5Fclose(fid);
+ H5Tclose(memb0_tid);
+ H5Tclose(memb1_tid);
+ H5Tclose(memb2_tid);
+ H5Tclose(memb3_tid);
+ H5Tclose(memb_tid);
+ H5Tclose(memb_tid2);
+ H5Tclose(dtid);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return(-1);
} /* test_LD_size() */
-
-/*
+
+/*
**************************************************************************************
* Testing for the High Level public routine: H5LDget_dset_elmts()
- * Verify failures when calling H5LDget_dset_elmts() with the following
- * invalid conditions:
+ * Verify failures when calling H5LDget_dset_elmts() with the following
+ * invalid conditions:
*
- * A. DSET_TWO: two-dimensional dataset
- * 1. CUR_DIMS and PREV_DIMS are NULL
- * 2. PREV_DIMS is NULL
- * 3. CUR_DIMS is NULL
- * 4. FIELDS is nonnull but the dataset is not compound datatype
- * 5. BUF is NULL
- * 6. CUR_DIMS is not greater than PREV_DIMS
+ * A. DSET_TWO: two-dimensional dataset
+ * 1. CUR_DIMS and PREV_DIMS are NULL
+ * 2. PREV_DIMS is NULL
+ * 3. CUR_DIMS is NULL
+ * 4. FIELDS is nonnull but the dataset is not compound datatype
+ * 5. BUF is NULL
+ * 6. CUR_DIMS is not greater than PREV_DIMS
*
- * B. DSET_CMPD: one-dimensional dataset with compound type
- * 1. Invalid dataset id
- * 2. FIELDS are not valid members in the compound type
+ * B. DSET_CMPD: one-dimensional dataset with compound type
+ * 1. Invalid dataset id
+ * 2. FIELDS are not valid members in the compound type
*
**************************************************************************************
*/
static int
test_LD_elmts_invalid(const char *file)
{
- hid_t fid=-1; /* file identifier */
- hid_t did=-1; /* dataset identifier */
- hid_t sid=-1; /* dataspace identifier */
+ hid_t fid=-1; /* file identifier */
+ hid_t did=-1; /* dataset identifier */
+ hid_t sid=-1; /* dataspace identifier */
hid_t invalid_id=-1;
- int ret; /* return value */
- hsize_t cur_dims[2]; /* current dimension sizes of the dataset */
- hsize_t prev_dims[2]; /* previous dimension sizes of the dataset */
- char tbuf[2]; /* temporary buffer for testing */
- int ndims; /* # of dimension sizes */
- int i; /* local index variable */
+ int ret; /* return value */
+ hsize_t cur_dims[2]; /* current dimension sizes of the dataset */
+ hsize_t prev_dims[2]; /* previous dimension sizes of the dataset */
+ char tbuf[2]; /* temporary buffer for testing */
+ int ndims; /* # of dimension sizes */
+ int i; /* local index variable */
const char *filename = H5_get_srcdir_filename(file);
- TESTING("H5LDget_dset_elmts on invalid conditions");
+ HL_TESTING2("H5LDget_dset_elmts on invalid conditions");
/* Open the copied file */
if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
- /*
+ /*
* Testing two-dimensional dataset: DSET_TWO
*/
/* Open dataset: DSET_TWO */
if((did = H5Dopen2(fid, DSET_TWO, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Verify failure from case #1: cur_dims and prev_dims are NULL */
ret = H5LDget_dset_elmts(did, NULL, NULL, NULL, NULL);
@@ -884,15 +884,15 @@ test_LD_elmts_invalid(const char *file)
VERIFY_EQUAL(ret, FAIL)
if((sid = H5Dget_space(did)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get the # of dimensions and current dimension sizes */
if((ndims = H5Sget_simple_extent_dims(sid, cur_dims, NULL)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Set up valid cur_dims and prev_dims */
for(i = 0; i < ndims; i++)
- prev_dims[i] = cur_dims[i] - 1;
+ prev_dims[i] = cur_dims[i] - 1;
/* Verify failure from case #4: FIELDS is nonNULL but the dataset is not compound datatype */
ret = H5LDget_dset_elmts(did, prev_dims, cur_dims, "field1", tbuf);
@@ -910,26 +910,26 @@ test_LD_elmts_invalid(const char *file)
/* Close DSET_TWO */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
- /*
+ /*
* Testing one-dimensional dataset with compound datatype:
- * DSET_CMPD
+ * DSET_CMPD
*/
/* Verify failure from case #1: an invalid dataset id */
H5E_BEGIN_TRY {
- ret = H5LDget_dset_elmts(invalid_id, prev_dims, cur_dims, NULL, tbuf);
+ ret = H5LDget_dset_elmts(invalid_id, prev_dims, cur_dims, NULL, tbuf);
} H5E_END_TRY;
VERIFY_EQUAL(ret, FAIL)
/* Open dataset: DSET_CMPD */
if((did = H5Dopen2(fid, DSET_CMPD, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Retrieve the current dimension sizes */
if(H5LDget_dset_dims(did, cur_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Set up valid cur_dims, prev_dims */
prev_dims[0] = cur_dims[0] - 1;
@@ -940,118 +940,118 @@ test_LD_elmts_invalid(const char *file)
/* Close DSET_CMPD */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Close the file */
if(H5Fclose(fid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Dclose(did);
- H5Fclose(fid);
+ H5Sclose(sid);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return(-1);
} /* test_LD_elmts_invalid() */
-
-/*
+
+/*
**************************************************************************************
* Testing for the High Level public routine: H5LDget_dset_elmts()
- * Verify elements retrieved via H5LDget_dset_elmts() are correct as expected
- * when the dataset's dimension sizes are changed according to one_tests[]:
+ * Verify elements retrieved via H5LDget_dset_elmts() are correct as expected
+ * when the dataset's dimension sizes are changed according to one_tests[]:
*
- * one-dimensional dataset :
- * DSET_ONE with NULL fields
- * DSET_CMPD with fields: NULL, VALID_FIELDS1, VALID_FIELDS2
- * DSET_CMPD_ESC with fields: NULL, VALID_ESC_FIELDS1, VALID_ESC_FIELDS2
- *
- * case #1. increase dims[0]
- * case #2. decrease dims[0] (failure)
- * case #3. same dims[0] (failure)
- * case #4. decrease dims[0] (failure)
- * case #5. increase dims[0]
+ * one-dimensional dataset :
+ * DSET_ONE with NULL fields
+ * DSET_CMPD with fields: NULL, VALID_FIELDS1, VALID_FIELDS2
+ * DSET_CMPD_ESC with fields: NULL, VALID_ESC_FIELDS1, VALID_ESC_FIELDS2
+ *
+ * case #1. increase dims[0]
+ * case #2. decrease dims[0] (failure)
+ * case #3. same dims[0] (failure)
+ * case #4. decrease dims[0] (failure)
+ * case #5. increase dims[0]
*
**************************************************************************************
*/
static herr_t
test_LD_elmts_one(const char *file, const char *dname, const char *fields)
{
- hid_t fid=-1; /* file identifier */
- hid_t did=-1; /* dataset identifier */
- hid_t dtype=-1; /* dataset's data type */
- hsize_t ext_dims[1]; /* extended dimension sizes of the dataset */
- hsize_t prev_dims[1]; /* previous dimension sizes of the dataset */
- int i, j; /* local index variable */
- int ret = 0; /* return value */
+ hid_t fid=-1; /* file identifier */
+ hid_t did=-1; /* dataset identifier */
+ hid_t dtype=-1; /* dataset's data type */
+ hsize_t ext_dims[1]; /* extended dimension sizes of the dataset */
+ hsize_t prev_dims[1]; /* previous dimension sizes of the dataset */
+ int i, j; /* local index variable */
+ int ret = 0; /* return value */
- TESTING("H5LDget_dset_elmts: one-dimensional dataset");
+ HL_TESTING2("H5LDget_dset_elmts: one-dimensional dataset");
/* Copy the test file */
if(h5_make_local_copy(file, COPY_FILENAME) < 0)
TEST_ERROR
for(i = 0; i < TEST_BUF_SIZE; i++) {
- cbuf[i].field1 = i;
- cbuf[i].field2.a = i;
- cbuf[i].field2.b.a = i;
- cbuf[i].field2.b.b = i;
- cbuf[i].field2.b.c = i;
- cbuf[i].field2.c = i;
- cbuf[i].field3 = (double)i;
- cbuf[i].field4.a = i;
- cbuf[i].field4.b = i;
- ibuf[i] = i;
+ cbuf[i].field1 = i;
+ cbuf[i].field2.a = i;
+ cbuf[i].field2.b.a = i;
+ cbuf[i].field2.b.b = i;
+ cbuf[i].field2.b.c = i;
+ cbuf[i].field2.c = i;
+ cbuf[i].field3 = (double)i;
+ cbuf[i].field4.a = i;
+ cbuf[i].field4.b = i;
+ ibuf[i] = i;
} /* end for */
/* Open the copied file */
if((fid = H5Fopen(COPY_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Open the dataset */
if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get the dataset's data type */
if((dtype = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get current dimension sizes before extending the dataset's dimension sizes */
if(H5LDget_dset_dims(did, prev_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Loop through different variations of extending the dataset */
for(i = 0; i < ONE_NTESTS; i++) {
- HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
- HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
- HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
- HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
-
- ext_dims[0] = (hsize_t)((int)prev_dims[0] + one_tests[i]);
-
- /* Change the dimension sizes of the dataset */
- if(H5Dset_extent(did, ext_dims) < 0)
- FAIL_STACK_ERROR
-
- /* Initialize data */
- if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
- if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0)
- FAIL_STACK_ERROR
- } /* end if */
+ HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
+ HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
+ HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
+ HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
+
+ ext_dims[0] = (hsize_t)((int)prev_dims[0] + one_tests[i]);
+
+ /* Change the dimension sizes of the dataset */
+ if(H5Dset_extent(did, ext_dims) < 0)
+ FAIL_STACK_ERROR
+
+ /* Initialize data */
+ if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
+ if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0)
+ FAIL_STACK_ERROR
+ } /* end if */
else if(!HDstrcmp(dname, DSET_ONE)) {
- if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
- FAIL_STACK_ERROR
- } /* end if */
-
- /* There are changes in dimension sizes */
- if(one_tests[i] > 0) {
- if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
- if(fields) {
+ if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
+ FAIL_STACK_ERROR
+ } /* end if */
+
+ /* There are changes in dimension sizes */
+ if(one_tests[i] > 0) {
+ if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
+ if(fields) {
if(!HDstrcmp(fields, VALID_FIELDS1) || !HDstrcmp(fields, VALID_ESC_FIELDS1)) {
/* Retrieve the elmemts in BUF */
if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf1) < 0)
@@ -1067,24 +1067,24 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
VERIFY_ELMTS_VALID2(vbuf2[j], cbuf[prev_dims[0] + (hsize_t)j])
} /* end else-if */
else
- TEST_ERROR
- } /* end if */
+ TEST_ERROR
+ } /* end if */
else {
- /* Retrieve the elmemts in BUF */
- if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, ccbuf) < 0)
- TEST_ERROR
- for(j = 0; j < one_tests[i]; j++)
- VERIFY_ELMTS_ALL(ccbuf[j], cbuf[prev_dims[0] + (hsize_t)j])
- } /* end else-if */
- } /* end if */
+ /* Retrieve the elmemts in BUF */
+ if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, ccbuf) < 0)
+ TEST_ERROR
+ for(j = 0; j < one_tests[i]; j++)
+ VERIFY_ELMTS_ALL(ccbuf[j], cbuf[prev_dims[0] + (hsize_t)j])
+ } /* end else-if */
+ } /* end if */
else {
- /* Retrieve the elmemts in BUF */
- if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf) < 0)
- TEST_ERROR
- for(j = 0; j < one_tests[i]; j++)
- VERIFY_EQUAL(iibuf[j], ibuf[prev_dims[0] + (hsize_t)j])
- } /* end else */
- } /* end if */
+ /* Retrieve the elmemts in BUF */
+ if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf) < 0)
+ TEST_ERROR
+ for(j = 0; j < one_tests[i]; j++)
+ VERIFY_EQUAL(iibuf[j], ibuf[prev_dims[0] + (hsize_t)j])
+ } /* end else */
+ } /* end if */
else {
/* Verify failure when changes between prev_dims and ext_dims are same/decrease */
ret = H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf);
@@ -1108,56 +1108,56 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
error:
H5E_BEGIN_TRY {
- H5Tclose(dtype);
- H5Dclose(did);
- H5Fclose(fid);
+ H5Tclose(dtype);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return(-1);
} /* test_LD_elmts_one() */
-
+
/*
**************************************************************************************
*
- * Helper routine to verify elements of a 2-dimensional dataset
- * _ldbuf contains the elements retrieved via H5LDget_dset_elmts()
- * _buf contains the data written to the dataset
+ * Helper routine to verify elements of a 2-dimensional dataset
+ * _ldbuf contains the elements retrieved via H5LDget_dset_elmts()
+ * _buf contains the data written to the dataset
*
- * e.g. prev_dims[2] = {4, 6}; ext_dims[2] = {6, 10}
- * elements marked in 'v' in _buf are compared to elements in _ldbuf
- * 0 1 2 3 4 5 | 6 7 8 9
- * 0 | v v v v
- * 1 | v v v v
- * 2 | v v v v
- * 3 | v v v v
- * ---------------------
- * 4 v v v v v v v v v v
- * 5 v v v v v v v v v v
+ * e.g. prev_dims[2] = {4, 6}; ext_dims[2] = {6, 10}
+ * elements marked in 'v' in _buf are compared to elements in _ldbuf
+ * 0 1 2 3 4 5 | 6 7 8 9
+ * 0 | v v v v
+ * 1 | v v v v
+ * 2 | v v v v
+ * 3 | v v v v
+ * ---------------------
+ * 4 v v v v v v v v v v
+ * 5 v v v v v v v v v v
*
**************************************************************************************
*/
static herr_t
verify_elmts_two(int type, hsize_t *ext_dims, hsize_t *prev_dims, void *_ldbuf, void *_buf)
{
- int k, m; /* Local index variable */
+ int k, m; /* Local index variable */
- k = 0;
+ k = 0;
for(m = 0; m < (int)ext_dims[0]; m++) {
- int n, ind; /* Local index variable */
-
- ind = m * (int)ext_dims[1];
- if(m < (int)prev_dims[0]) {
- for(n = (int)prev_dims[1]; n < (int)ext_dims[1]; n++) {
- VERIFY_ELMTS(type, k, ind, _ldbuf, _buf)
- ++k;
- } /* end for */
- } /* end if */
- else {
- for(n = 0; n < (int)ext_dims[1]; n++) {
- VERIFY_ELMTS(type, k, ind, _ldbuf, _buf)
- ++k;
- } /* end for */
- } /* end else */
+ int n, ind; /* Local index variable */
+
+ ind = m * (int)ext_dims[1];
+ if(m < (int)prev_dims[0]) {
+ for(n = (int)prev_dims[1]; n < (int)ext_dims[1]; n++) {
+ VERIFY_ELMTS(type, k, ind, _ldbuf, _buf)
+ ++k;
+ } /* end for */
+ } /* end if */
+ else {
+ for(n = 0; n < (int)ext_dims[1]; n++) {
+ VERIFY_ELMTS(type, k, ind, _ldbuf, _buf)
+ ++k;
+ } /* end for */
+ } /* end else */
} /* end for */
return(0);
@@ -1166,106 +1166,106 @@ error:
return(-1);
} /* verify_elmts_two() */
-
-/*
+
+/*
**************************************************************************************
* Testing for the High Level public routine: H5LDget_dset_elmts()
- * Verify elements retrieved via H5LDget_dset_elmts() are correct as expected when
- * the datset's dimension sizes are changed accordingly to two_tests[]:
+ * Verify elements retrieved via H5LDget_dset_elmts() are correct as expected when
+ * the datset's dimension sizes are changed accordingly to two_tests[]:
*
- * two-dimensional dataset: DSET_TWO with NULL fields
- * DSET_CMPD_TWO with fields: NULL, VALID_FIELDS1, VALID_FIELDS2
+ * two-dimensional dataset: DSET_TWO with NULL fields
+ * DSET_CMPD_TWO with fields: NULL, VALID_FIELDS1, VALID_FIELDS2
+ *
+ * dims[0] dims[1]
+ * ------- -------
+ * case #1: increase increase
+ * case #2: increase decrease
+ * case #3: increase same
+ * case #4: decrease increase
+ * case #5: decrease decrease (failure)
+ * case #6: decrease same (failure)
+ * case #7: same increase
+ * case #8: same decrease (failure)
+ * case #9: same same (failure)
*
- * dims[0] dims[1]
- * ------- -------
- * case #1: increase increase
- * case #2: increase decrease
- * case #3: increase same
- * case #4: decrease increase
- * case #5: decrease decrease (failure)
- * case #6: decrease same (failure)
- * case #7: same increase
- * case #8: same decrease (failure)
- * case #9: same same (failure)
- *
**************************************************************************************
*/
static herr_t
test_LD_elmts_two(const char *file, const char *dname, const char *fields)
{
- hid_t fid=-1; /* file identifier */
- hid_t did=-1; /* dataset identifier */
- hid_t dtype=-1; /* dataset's data type */
- hsize_t ext_dims[2]; /* extended dimension sizes of the dataset */
- hsize_t prev_dims[2]; /* previous dimension sizes of the dataset */
- int i; /* local index variable */
- int ret = 0; /* return value */
+ hid_t fid=-1; /* file identifier */
+ hid_t did=-1; /* dataset identifier */
+ hid_t dtype=-1; /* dataset's data type */
+ hsize_t ext_dims[2]; /* extended dimension sizes of the dataset */
+ hsize_t prev_dims[2]; /* previous dimension sizes of the dataset */
+ int i; /* local index variable */
+ int ret = 0; /* return value */
- TESTING("H5LDget_dset_elmts: two-dimensional dataset");
+ HL_TESTING2("H5LDget_dset_elmts: two-dimensional dataset");
/* Copy the test file */
if(h5_make_local_copy(file, COPY_FILENAME) < 0)
TEST_ERROR
for(i = 0; i < TEST_BUF_SIZE; i++) {
- cbuf[i].field1 = i;
- cbuf[i].field2.a = i;
- cbuf[i].field2.b.a = i;
- cbuf[i].field2.b.b = i;
- cbuf[i].field2.b.c = i;
- cbuf[i].field2.c = i;
- cbuf[i].field3 = (double)i;
- cbuf[i].field4.a = i;
- cbuf[i].field4.b = i;
- ibuf[i] = i;
+ cbuf[i].field1 = i;
+ cbuf[i].field2.a = i;
+ cbuf[i].field2.b.a = i;
+ cbuf[i].field2.b.b = i;
+ cbuf[i].field2.b.c = i;
+ cbuf[i].field2.c = i;
+ cbuf[i].field3 = (double)i;
+ cbuf[i].field4.a = i;
+ cbuf[i].field4.b = i;
+ ibuf[i] = i;
} /* end for */
/* Open the copied file */
if((fid = H5Fopen(COPY_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Open the dataset */
if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get the dataset's data type */
if((dtype = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get current dimension sizes before extending the dataset's dimension sizes */
if(H5LDget_dset_dims(did, prev_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Loop through different variations of extending the dataset */
for(i = 0; i < TWO_NTESTS; i++) {
- HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
- HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
- HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
- HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
-
- ext_dims[0] = (hsize_t)((int)prev_dims[0] + two_tests[i][0]);
- ext_dims[1] = (hsize_t)((int)prev_dims[1] + two_tests[i][1]);
-
- /* Change the dimension sizes of the dataset */
- if(H5Dset_extent(did, ext_dims) < 0)
- FAIL_STACK_ERROR
-
- /* Initialize data */
- if(!HDstrcmp(dname, DSET_CMPD_TWO)) {
- if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0)
- FAIL_STACK_ERROR
- } /* end if */
+ HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
+ HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
+ HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
+ HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
+
+ ext_dims[0] = (hsize_t)((int)prev_dims[0] + two_tests[i][0]);
+ ext_dims[1] = (hsize_t)((int)prev_dims[1] + two_tests[i][1]);
+
+ /* Change the dimension sizes of the dataset */
+ if(H5Dset_extent(did, ext_dims) < 0)
+ FAIL_STACK_ERROR
+
+ /* Initialize data */
+ if(!HDstrcmp(dname, DSET_CMPD_TWO)) {
+ if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0)
+ FAIL_STACK_ERROR
+ } /* end if */
else if(!HDstrcmp(dname, DSET_TWO)) {
- if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
- FAIL_STACK_ERROR
- } /* end else-if */
+ if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
+ FAIL_STACK_ERROR
+ } /* end else-if */
else
TEST_ERROR
- /* There are changes in dimension sizes */
- if(two_tests[i][0] > 0 || two_tests[i][1] > 0) {
- if(!HDstrcmp(dname, DSET_CMPD_TWO)) {
- if(fields) {
+ /* There are changes in dimension sizes */
+ if(two_tests[i][0] > 0 || two_tests[i][1] > 0) {
+ if(!HDstrcmp(dname, DSET_CMPD_TWO)) {
+ if(fields) {
if(!HDstrcmp(fields, VALID_FIELDS1) || !HDstrcmp(fields, VALID_ESC_FIELDS1)) {
/* Retrieve the elmemts in BUF */
if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf1) < 0)
@@ -1282,37 +1282,37 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
} /* end else-if */
else
TEST_ERROR
- } /* end if */
+ } /* end if */
else {
- /* Retrieve the elmemts in BUF */
- if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, ccbuf) < 0)
- TEST_ERROR
- if(verify_elmts_two(TWO_CMPD_NULL, ext_dims, prev_dims, ccbuf, cbuf) < 0)
- TEST_ERROR
- } /* end else */
- } /* end if */
+ /* Retrieve the elmemts in BUF */
+ if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, ccbuf) < 0)
+ TEST_ERROR
+ if(verify_elmts_two(TWO_CMPD_NULL, ext_dims, prev_dims, ccbuf, cbuf) < 0)
+ TEST_ERROR
+ } /* end else */
+ } /* end if */
else { /* DSET_TWO */
- /* Retrieve the elmemts in BUF */
- if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf) < 0)
- TEST_ERROR
- if(verify_elmts_two(TWO_NONE, ext_dims, prev_dims, iibuf, ibuf) < 0)
- TEST_ERROR
- } /* end else */
- } /* end if */
+ /* Retrieve the elmemts in BUF */
+ if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf) < 0)
+ TEST_ERROR
+ if(verify_elmts_two(TWO_NONE, ext_dims, prev_dims, iibuf, ibuf) < 0)
+ TEST_ERROR
+ } /* end else */
+ } /* end if */
else {
- /* Verify failure when changes between prev_dims and ext_dims are same/decrease */
- ret = H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf);
- VERIFY_EQUAL(ret, FAIL)
- } /* end else */
+ /* Verify failure when changes between prev_dims and ext_dims are same/decrease */
+ ret = H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf);
+ VERIFY_EQUAL(ret, FAIL)
+ } /* end else */
} /* end for */
/* Closing */
if(H5Tclose(dtype) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Fclose(fid) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Remove the copied file */
HDremove(COPY_FILENAME);
@@ -1322,16 +1322,16 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
error:
H5E_BEGIN_TRY {
- H5Tclose(dtype);
- H5Dclose(did);
- H5Fclose(fid);
+ H5Tclose(dtype);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return(-1);
} /* test_LD_elmts_two() */
/*
- * Tests for High Level routines:
- * H5LDget_dset_dims(), H5LDget_dset_elmts, H5LDget_dset_type_size()
+ * Tests for High Level routines:
+ * H5LDget_dset_dims(), H5LDget_dset_elmts, H5LDget_dset_type_size()
*/
int main(void)
{
@@ -1339,60 +1339,60 @@ int main(void)
/* Set up temporary buffers for tests: test_LD_elmts_one() & test_LD_elmts_two() */
if(NULL == (ibuf = (int *)HDmalloc(sizeof(int) * TEST_BUF_SIZE)))
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(NULL == (iibuf = (int *)HDmalloc(sizeof(int) * TEST_BUF_SIZE)))
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(NULL == (cbuf = (set_t *)HDmalloc(sizeof(set_t) * TEST_BUF_SIZE)))
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(NULL == (ccbuf = (set_t *)HDmalloc(sizeof(set_t) * TEST_BUF_SIZE)))
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(NULL == (vbuf1 = (test_valid_fields1 *)HDmalloc(sizeof(test_valid_fields1) * TEST_BUF_SIZE)))
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(NULL == (vbuf2 = (test_valid_fields2 *)HDmalloc(sizeof(test_valid_fields2) * TEST_BUF_SIZE)))
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
- /*
- * Testing H5LDget_dset_dims()
+ /*
+ * Testing H5LDget_dset_dims()
*/
nerrors += test_LD_dims_params(FILE);
nerrors += test_LD_dims(FILE);
- /*
- * Testing H5LDget_dset_type_size()
+ /*
+ * Testing H5LDget_dset_type_size()
*/
nerrors += test_LD_size(FILE);
- /*
+ /*
* Testing invalid conditions for H5LDget_dset_elmts()
*/
nerrors += test_LD_elmts_invalid(FILE);
- /*
- * Testing H5LDget_dset_elmts():
- * 1-dimensional dataset
+ /*
+ * Testing H5LDget_dset_elmts():
+ * 1-dimensional dataset
*/
nerrors += test_LD_elmts_one(FILE, DSET_ONE, NULL);
- /*
- * Testing H5LDget_dset_elmts():
- * 1-dimensional dataset w/ compound datatype
+ /*
+ * Testing H5LDget_dset_elmts():
+ * 1-dimensional dataset w/ compound datatype
*/
nerrors += test_LD_elmts_one(FILE, DSET_CMPD, NULL);
nerrors += test_LD_elmts_one(FILE, DSET_CMPD, VALID_FIELDS1);
nerrors += test_LD_elmts_one(FILE, DSET_CMPD, VALID_FIELDS2);
- /*
+ /*
* Testing H5LDget_dset_elmts():
- * 1-dimensional dataset with compound datatype and
- * member names with escape/separator characters
+ * 1-dimensional dataset with compound datatype and
+ * member names with escape/separator characters
*/
nerrors += test_LD_elmts_one(FILE, DSET_CMPD_ESC, NULL);
nerrors += test_LD_elmts_one(FILE, DSET_CMPD_ESC, VALID_ESC_FIELDS1);
nerrors += test_LD_elmts_one(FILE, DSET_CMPD_ESC, VALID_ESC_FIELDS2);
- /*
+ /*
* Testing H5LDget_dset_elmts() for 2-dimensional datasets
*/
nerrors += test_LD_elmts_two(FILE, DSET_TWO, NULL);
@@ -1416,7 +1416,7 @@ int main(void)
/* check for errors */
if(nerrors)
- goto error;
+ goto error;
puts("All tests for H5LD high level routines passed.");
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 51ab72b..e6b4668 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -87,7 +87,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset");
+ HL_TESTING2("H5LTmake_dataset");
/* Make dataset */
if ( H5LTmake_dataset( file_id, DSET0_NAME, rank, dims, H5T_NATIVE_INT, data_int_in ) < 0 )
@@ -118,7 +118,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTread_dataset");
+ HL_TESTING2("H5LTread_dataset");
if ( H5LTread_dataset( file_id, DSET0_NAME, H5T_NATIVE_INT, data_int_out ) < 0 )
goto out;
@@ -143,7 +143,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_char");
+ HL_TESTING2("H5LTmake_dataset_char");
/* Make dataset char */
if ( H5LTmake_dataset_char( file_id, DSET1_NAME, rank, dims, data_char_in ) < 0 )
@@ -179,7 +179,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_short");
+ HL_TESTING2("H5LTmake_dataset_short");
/* Make dataset short */
if ( H5LTmake_dataset_short( file_id, DSET2_NAME, rank, dims, data_short_in ) < 0 )
@@ -214,7 +214,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_int");
+ HL_TESTING2("H5LTmake_dataset_int");
/* Make dataset int */
if ( H5LTmake_dataset_int( file_id, DSET3_NAME, rank, dims, data_int_in ) < 0 )
@@ -250,7 +250,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_long");
+ HL_TESTING2("H5LTmake_dataset_long");
/* Make dataset long */
if ( H5LTmake_dataset_long( file_id, DSET4_NAME, rank, dims, data_long_in ) < 0 )
@@ -286,7 +286,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_float");
+ HL_TESTING2("H5LTmake_dataset_float");
/* Make dataset float */
if ( H5LTmake_dataset_float( file_id, DSET5_NAME, rank, dims, data_float_in ) < 0 )
@@ -322,7 +322,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_double");
+ HL_TESTING2("H5LTmake_dataset_double");
/* Make dataset double */
if ( H5LTmake_dataset_double( file_id, DSET6_NAME, rank, dims, data_double_in ) < 0 )
@@ -358,7 +358,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_string");
+ HL_TESTING2("H5LTmake_dataset_string");
/* Make dataset string */
if ( H5LTmake_dataset_string(file_id,DSET7_NAME,data_string_in) < 0 )
@@ -517,7 +517,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_string");
+ HL_TESTING2("H5LTset_attribute_string");
/* Set the attribute */
if ( H5LTset_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_in ) < 0 )
@@ -530,7 +530,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_string");
+ HL_TESTING2("H5LTget_attribute_string");
/* Get the attribute */
@@ -550,7 +550,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_char");
+ HL_TESTING2("H5LTset_attribute_char");
/* Set the attribute */
if ( H5LTset_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_in, (size_t)5 ) < 0 )
@@ -563,7 +563,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_char");
+ HL_TESTING2("H5LTget_attribute_char");
/* Get the attribute */
if ( H5LTget_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_out ) < 0 )
@@ -594,7 +594,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_short");
+ HL_TESTING2("H5LTset_attribute_short");
/* Set the attribute */
if ( H5LTset_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_in, (size_t)5 ) < 0 )
@@ -608,7 +608,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_short");
+ HL_TESTING2("H5LTget_attribute_short");
/* Get the attribute */
if ( H5LTget_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_out ) < 0 )
@@ -640,7 +640,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_int");
+ HL_TESTING2("H5LTset_attribute_int");
/* Set the attribute */
if ( H5LTset_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_in, (size_t)5 ) < 0 )
@@ -661,7 +661,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_int");
+ HL_TESTING2("H5LTget_attribute_int");
/* Get the attribute */
if ( H5LTget_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_out ) < 0 )
@@ -712,7 +712,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_long");
+ HL_TESTING2("H5LTset_attribute_long");
/* Set the attribute */
if ( H5LTset_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_in, (size_t)5 ) < 0 )
@@ -725,7 +725,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_long");
+ HL_TESTING2("H5LTget_attribute_long");
/* Get the attribute */
if ( H5LTget_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_out ) < 0 )
@@ -756,7 +756,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_uchar");
+ HL_TESTING2("H5LTset_attribute_uchar");
/* Set the attribute */
if ( H5LTset_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_in, (size_t)5 ) < 0 )
@@ -769,7 +769,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_uchar");
+ HL_TESTING2("H5LTget_attribute_uchar");
/* Get the attribute */
if ( H5LTget_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_out ) < 0 )
@@ -800,7 +800,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_ushort");
+ HL_TESTING2("H5LTset_attribute_ushort");
/* Set the attribute */
if ( H5LTset_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_in, (size_t)5 ) < 0 )
@@ -814,7 +814,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_ushort");
+ HL_TESTING2("H5LTget_attribute_ushort");
/* Get the attribute */
if ( H5LTget_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_out ) < 0 )
@@ -846,7 +846,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_uint");
+ HL_TESTING2("H5LTset_attribute_uint");
/* Set the attribute */
if ( H5LTset_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_in, (size_t)5 ) < 0 )
@@ -859,7 +859,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_uint");
+ HL_TESTING2("H5LTget_attribute_uint");
/* Get the attribute */
if ( H5LTget_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_out ) < 0 )
@@ -890,7 +890,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_ulong");
+ HL_TESTING2("H5LTset_attribute_ulong");
/* Set the attribute */
if ( H5LTset_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_in, (size_t)5 ) < 0 )
@@ -903,7 +903,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_ulong");
+ HL_TESTING2("H5LTget_attribute_ulong");
/* Get the attribute */
if ( H5LTget_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_out ) < 0 )
@@ -935,7 +935,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_float");
+ HL_TESTING2("H5LTset_attribute_float");
/* Set the attribute */
if ( H5LTset_attribute_float( loc_id, obj_name, ATTR10_NAME, attr_float_in, (size_t)5 ) < 0 )
@@ -948,7 +948,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_float");
+ HL_TESTING2("H5LTget_attribute_float");
/* Get the attribute */
@@ -980,7 +980,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_double");
+ HL_TESTING2("H5LTset_attribute_double");
/* Set the attribute */
if ( H5LTset_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_in, (size_t)5 ) < 0 )
@@ -993,7 +993,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_double");
+ HL_TESTING2("H5LTget_attribute_double");
/* Get the attribute */
if ( H5LTget_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_out ) < 0 )
@@ -1026,7 +1026,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*/
- TESTING("H5LTget_attribute_ndims");
+ HL_TESTING2("H5LTget_attribute_ndims");
if ( H5LTget_attribute_ndims( loc_id, obj_name, ATTR2_NAME, &rank_out ) < 0 )
return -1;
@@ -1042,7 +1042,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_info");
+ HL_TESTING2("H5LTget_attribute_info");
if(NULL==(dims_out = (hsize_t*) HDmalloc( sizeof(hsize_t) * (size_t)rank_out ))) return -1;
@@ -1079,7 +1079,7 @@ static int test_integers(void)
char* dt_str;
size_t str_len;
- TESTING3("\n text for integer types");
+ HL_TESTING3("\n text for integer types");
if((dtype = H5LTtext_to_dtype("H5T_NATIVE_INT\n", H5LT_DDL))<0)
goto out;
@@ -1136,7 +1136,7 @@ static int test_fps(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for floating-point types");
+ HL_TESTING3(" text for floating-point types");
if((dtype = H5LTtext_to_dtype("H5T_NATIVE_LDOUBLE\n", H5LT_DDL))<0)
goto out;
@@ -1197,7 +1197,7 @@ static int test_strings(void)
char* dt_str = NULL;
size_t str_len;
- TESTING3(" text for string types");
+ HL_TESTING3(" text for string types");
if((dtype = H5LTtext_to_dtype("H5T_STRING { STRSIZE 13; STRPAD H5T_STR_NULLTERM; CSET H5T_CSET_ASCII; CTYPE H5T_C_S1; }", H5LT_DDL))<0)
goto out;
@@ -1328,7 +1328,7 @@ static int test_opaques(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for opaque types");
+ HL_TESTING3(" text for opaque types");
if((dtype = H5LTtext_to_dtype("H5T_OPAQUE { OPQ_SIZE 19; OPQ_TAG \"This is a tag for opaque type\"; }", H5LT_DDL))<0)
goto out;
@@ -1385,7 +1385,7 @@ static int test_enums(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for enum types");
+ HL_TESTING3(" text for enum types");
if((dtype = H5LTtext_to_dtype("H5T_ENUM { H5T_STD_I32LE; \"RED\" 5; \"GREEN\" 6; \"BLUE\" 7; \"WHITE\" 8; }", H5LT_DDL))<0)
goto out;
@@ -1457,7 +1457,7 @@ static int test_variables(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for variable types");
+ HL_TESTING3(" text for variable types");
if((dtype = H5LTtext_to_dtype("H5T_VLEN { H5T_NATIVE_CHAR }\n", H5LT_DDL))<0)
goto out;
@@ -1518,7 +1518,7 @@ static int test_arrays(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for array types");
+ HL_TESTING3(" text for array types");
if((dtype = H5LTtext_to_dtype("H5T_ARRAY { [5][7][13] H5T_ARRAY { [17][19] H5T_COMPOUND { H5T_STD_I8BE \"arr_compound_1\"; H5T_STD_I32BE \"arr_compound_2\"; } } }", H5LT_DDL))<0)
goto out;
@@ -1579,7 +1579,7 @@ static int test_compounds(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for compound types");
+ HL_TESTING3(" text for compound types");
if((dtype = H5LTtext_to_dtype("H5T_COMPOUND { H5T_STD_I16BE \"one_field\" : 2; H5T_STD_U8LE \"two_field\" : 6; }", H5LT_DDL))<0)
goto out;
@@ -1673,7 +1673,7 @@ static int test_compound_bug(void)
" } } \"sub\" : 8;\n"
"}\n";
- TESTING3(" text for compound type of bug fix");
+ HL_TESTING3(" text for compound type of bug fix");
if((dtype = H5LTtext_to_dtype(text, H5LT_DDL))<0)
goto out;
@@ -1765,7 +1765,7 @@ static int test_complicated_compound(void)
size_t size = 1024;
const char *filename = H5_get_srcdir_filename(INPUT_FILE);
- TESTING3(" text for complicated compound types");
+ HL_TESTING3(" text for complicated compound types");
/* Open input file */
fp = HDfopen(filename, "r");
@@ -1834,7 +1834,7 @@ out:
*/
static int test_text_dtype(void)
{
- TESTING("H5LTtext_to_dtype");
+ HL_TESTING2("H5LTtext_to_dtype");
if(test_integers()<0)
goto out;
@@ -1882,7 +1882,7 @@ static int test_valid_path(void)
htri_t path_valid;
const char *data_string_in = "test";
- TESTING("H5LTpath_valid");
+ HL_TESTING2("H5LTpath_valid");
/* Create a new file using default properties. */
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index 7003b26..61aebc7 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -178,7 +178,7 @@ static int test_create_close(hid_t fid)
hid_t table;
hid_t part_t;
- TESTING("H5PTcreate_fl and H5PTclose");
+ HL_TESTING2("H5PTcreate_fl and H5PTclose");
/* Create a datatype for the particle struct */
part_t = make_particle_type();
@@ -188,11 +188,11 @@ static int test_create_close(hid_t fid)
/* Create the table */
table = H5PTcreate_fl(fid, PT_NAME, part_t, (hsize_t)100, -1);
if (H5Tclose(part_t) < 0)
- goto error;
+ goto error;
if( H5PTis_valid(table) < 0)
- goto error;
+ goto error;
if( H5PTis_varlen(table) != 0)
- goto error;
+ goto error;
/* Close the table */
err = H5PTclose(table);
@@ -219,7 +219,7 @@ static int test_open(hid_t fid)
herr_t err;
hid_t table;
- TESTING("H5PTopen");
+ HL_TESTING2("H5PTopen");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@@ -255,7 +255,7 @@ static int test_append(hid_t fid)
hid_t table;
hsize_t count = 0;
- TESTING("H5PTappend");
+ HL_TESTING2("H5PTappend");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@@ -322,7 +322,7 @@ static int test_read(hid_t fid)
particle_t readBuf[NRECORDS];
size_t c;
- TESTING("H5PTread_packets");
+ HL_TESTING2("H5PTread_packets");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@@ -383,7 +383,7 @@ static int test_get_next(hid_t fid)
particle_t readBuf2[NRECORDS];
size_t c;
- TESTING("H5PTget_next");
+ HL_TESTING2("H5PTget_next");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@@ -454,7 +454,7 @@ static int test_big_table(hid_t fid)
particle_t readPart;
hsize_t count;
- TESTING("large packet table");
+ HL_TESTING2("large packet table");
/* Create a datatype for the particle struct */
part_t = make_particle_type();
@@ -528,7 +528,7 @@ static int test_opaque(hid_t fid)
size_t c;
particle_t readBuf[NRECORDS];
- TESTING("opaque data");
+ HL_TESTING2("opaque data");
/* Create an opaque datatype for the particle struct */
if ((part_t = H5Tcreate (H5T_OPAQUE, sizeof(particle_t) )) < 0 )
@@ -602,7 +602,7 @@ test_compress(void)
particle_t readPart[1];
hsize_t count;
- TESTING("packet table compression");
+ HL_TESTING2("packet table compression");
/* Create a file. */
if((fid1 = H5Fcreate(TEST_COMPRESS_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
@@ -739,7 +739,7 @@ static int test_rw_nonnative_dt(hid_t fid)
int writeBuffer[5];
int readBuffer[5];
- TESTING("reading/writing non-native packet table");
+ HL_TESTING2("reading/writing non-native packet table");
/* Initialize buffers */
for(x=0; x<5; x++) {
@@ -794,7 +794,7 @@ static int test_rw_nonnative_dt(hid_t fid)
/* Close the packet table */
if( (err = H5PTclose(ptable)) < 0)
goto error;
-
+
PASSED();
return SUCCEED;
@@ -819,7 +819,7 @@ static int test_error(hid_t fid)
int id_open=0;
particle_t readBuf[1];
- TESTING("error conditions");
+ HL_TESTING2("error conditions");
/* Create a HL table */
if(create_hl_table(fid) < 0)
@@ -981,7 +981,7 @@ int main(void)
/* Close the file */
if (H5Fclose(fid) < 0)
- status = 1;
+ status = 1;
return status;
}
diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c
index 1d6231e..b41e73d 100644
--- a/hl/test/test_packet_vlen.c
+++ b/hl/test/test_packet_vlen.c
@@ -46,101 +46,101 @@ static int verify_attribute(hid_t fid, const char *table_name, const char *attr_
/*-------------------------------------------------------------------------
* test_VLof_atomic(): Test that a packet table with VL datatypes of atomic
- * datatypes can be created and written correctly. (HDFFV-442)
+ * datatypes can be created and written correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_VLof_atomic(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
- hsize_t count; /* Number of records in the table */
- unsigned uu, vv; /* Loop variables */
- hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
- hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
-
- TESTING3(" with vlen of atomic");
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
+ hsize_t count; /* Number of records in the table */
+ unsigned uu, vv; /* Loop variables */
+ hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
+ hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
+ char msg[80]; /* For error message */
+ herr_t ret; /* Returned status from a callee */
+
+ HL_TESTING3(" with vlen of atomic");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int));
if (writeBuf[uu].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].len = uu + 1;
for (vv = 0; vv < (uu + 1); vv++)
- ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
+ ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
} /* end for */
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a vlen type that uses an atomic datatype as its base type */
vltype = H5Tvlen_create (H5T_NATIVE_UINT);
if (vltype < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of an atomic type */
ptable = H5PTcreate(fid, PT_VLEN_ATOMIC, vltype, (hsize_t)1, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Close the vlen datatype */
if (H5Tclose(vltype) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
- sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
+ HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)NRECORDS, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
for (uu = 0; uu < NRECORDS; uu++)
for (vv = 0; vv < (uu + 1); vv++)
{
- if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
- printf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
- printf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
- }
+ if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
+ HDprintf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
+ HDprintf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
+ }
}
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf );
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -157,7 +157,7 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_VLof_comptype(): Test that a packet table with VL datatypes of
- * compound datatypes can be created and written correctly. (HDFFV-442)
+ * compound datatypes can be created and written correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -169,26 +169,26 @@ static int test_VLof_comptype(void)
unsigned u;
float f;
} VLcomp_t;
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
- hid_t cmptype=H5I_INVALID_HID; /* Compound datatype */
- hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
- hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
- hsize_t count; /* Number of records in the table */
- unsigned uu, vv; /* Loop variables */
- char msg[80]; /* For error message */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t cmptype=H5I_INVALID_HID; /* Compound datatype */
+ hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
+ hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
+ hsize_t count; /* Number of records in the table */
+ unsigned uu, vv; /* Loop variables */
+ char msg[80]; /* For error message */
herr_t ret;
- TESTING3(" with vlen of compound datatypes");
+ HL_TESTING3(" with vlen of compound datatypes");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t));
if(writeBuf[uu].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].len = uu + 1;
for (vv = 0; vv < (uu + 1); vv++) {
((VLcomp_t *)writeBuf[uu].p)[vv].u = uu + vv;
@@ -199,88 +199,88 @@ static int test_VLof_comptype(void)
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create the base compound type */
cmptype = H5Tcreate(H5T_COMPOUND, sizeof(VLcomp_t));
if (cmptype < 0)
- goto error;
+ goto error;
/* Insert fields */
ret = H5Tinsert(cmptype, "u", HOFFSET(VLcomp_t, u), H5T_NATIVE_UINT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(cmptype, "f", HOFFSET(VLcomp_t, f), H5T_NATIVE_FLOAT);
if (ret < 0)
- goto error;
+ goto error;
/* Create a variable length type that uses the VLcomp_t as its base type */
vltype = H5Tvlen_create(cmptype);
if (vltype < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of compound datatype */
ptable = H5PTcreate(fid, PT_VLEN_COMP, vltype, (hsize_t)1, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release the datatypes */
if (H5Tclose(cmptype) < 0)
- goto error;
+ goto error;
if (H5Tclose(vltype) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)5, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
- sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
+ HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)5, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].len != readBuf[uu].len) {
- fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n", __LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len);
- continue;
- } /* write len != read len */
+ HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n", __LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len);
+ continue;
+ } /* write len != read len */
for (vv = 0; vv < (uu + 1); vv++) {
if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv] ) {
- fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%d]=%d, readBuf[uu].p[%d]=%d\n", vv, (int)((unsigned int *)writeBuf[uu].p)[vv], vv, (int)((unsigned int *)readBuf[uu].p)[vv]);
+ HDfprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%d]=%d, readBuf[uu].p[%d]=%d\n", vv, (int)((unsigned int *)writeBuf[uu].p)[vv], vv, (int)((unsigned int *)readBuf[uu].p)[vv]);
continue;
- } /* write value != read value */
- }
+ } /* write value != read value */
+ }
} /* end for */
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -298,8 +298,8 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_compound_VL_VL(): Test that a packet table of compound datatypes
- * containing VL datatypes can be created and written
- * correctly. (HDFFV-442)
+ * containing VL datatypes can be created and written
+ * correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -310,23 +310,23 @@ static int test_compound_VL_VLtype(void)
typedef struct {
unsigned u;
float f;
- hvl_t v;
+ hvl_t v;
} compVLVL_t;
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
- hid_t vlofvl=H5I_INVALID_HID; /* Variable length datatype */
- hid_t comp_vlvl=H5I_INVALID_HID; /* ID of a compound datatype containing
- a VL of VL of atomic datatype */
- hsize_t count; /* Number of records in the table */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t vlofvl=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t comp_vlvl=H5I_INVALID_HID; /* ID of a compound datatype containing
+ a VL of VL of atomic datatype */
+ hsize_t count; /* Number of records in the table */
compVLVL_t writeBuf[NRECORDS];/* Buffer to hold data to be written */
compVLVL_t readBuf[NRECORDS]; /* Buffer to hold read data */
hvl_t *t1, *t2;
- unsigned uu, vv, ww; /* Loop variables */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
+ unsigned uu, vv, ww; /* Loop variables */
+ char msg[80]; /* For error message */
+ herr_t ret; /* Returned status from a callee */
- TESTING3(" with compound datatype containing vlen datatype");
+ HL_TESTING3(" with compound datatype containing vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -334,17 +334,17 @@ static int test_compound_VL_VLtype(void)
writeBuf[uu].f = (float)(uu * 20) / 3.0F;
writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t));
if (writeBuf[uu].v.p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].v.len = uu + L1_INCM;
for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++)
- {
+ {
t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int));
- if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
- goto error;
- }
+ if (t1->p == NULL) {
+ HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ goto error;
+ }
t1->len = vv + L2_INCM;
for (ww = 0; ww < vv + L2_INCM; ww++)
((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
@@ -354,91 +354,91 @@ static int test_compound_VL_VLtype(void)
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
- goto error;
+ goto error;
/* Create a VL datatype of the VL of atomic datatype */
vlofvl = H5Tvlen_create (vlatomic);
if (vlofvl < 0)
- goto error;
+ goto error;
/* Create the base compound type */
comp_vlvl = H5Tcreate(H5T_COMPOUND, sizeof(compVLVL_t));
if (comp_vlvl < 0)
- goto error;
+ goto error;
/* Insert fields: atomic, atomic, vlen */
ret = H5Tinsert(comp_vlvl, "u", HOFFSET(compVLVL_t, u), H5T_NATIVE_UINT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(comp_vlvl, "f", HOFFSET(compVLVL_t, f), H5T_NATIVE_FLOAT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(comp_vlvl, "v", HOFFSET(compVLVL_t, v), vlofvl);
if (ret < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a compound datatype of vlen datatype */
ptable = H5PTcreate(fid, PT_COMP_VLEN, comp_vlvl, (hsize_t)1, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release datatypes */
if (H5Tclose(vlatomic) < 0)
- goto error;
+ goto error;
if (H5Tclose(vlofvl) < 0)
- goto error;
+ goto error;
if (H5Tclose(comp_vlvl) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)NRECORDS, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
- sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
+ HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)NRECORDS, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].u != readBuf[uu].u) {
- fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u);
+ HDfprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u);
continue;
} /* end if */
if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f,readBuf[uu].f)) {
- fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
+ HDfprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
continue;
} /* end if */
if (writeBuf[uu].v.len != readBuf[uu].v.len) {
- fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
+ HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
continue;
} /* end if */
for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0; (size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) {
if (t1->len != t2->len) {
- fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len);
+ HDfprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len);
continue;
} /* end if */
for (ww = 0; (size_t)ww < t2->len; ww++) {
if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww] ) {
- fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
+ HDfprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
continue;
} /* end if */
} /* end for */
@@ -448,19 +448,19 @@ static int test_compound_VL_VLtype(void)
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -479,43 +479,43 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_VLof_VLtype(): Test that a packet table of VL datatype with VL
- * datatypes of atomic datatypes can be created and written
- * correctly. (HDFFV-442)
+ * datatypes of atomic datatypes can be created and written
+ * correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_VLof_VLtype(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
- hid_t vlofvl=H5I_INVALID_HID; /* VL datatype of VL datatypes */
- hsize_t count; /* Number of records in the table */
- hvl_t *t1; /* pointer to advance */
- unsigned uu, vv, ww; /* Loop variables */
- hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
- hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
-
- TESTING3(" with vlen datatype of vlen datatype");
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t vlofvl=H5I_INVALID_HID; /* VL datatype of VL datatypes */
+ hsize_t count; /* Number of records in the table */
+ hvl_t *t1; /* pointer to advance */
+ unsigned uu, vv, ww; /* Loop variables */
+ hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
+ hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
+ char msg[80]; /* For error message */
+ herr_t ret; /* Returned status from a callee */
+
+ HL_TESTING3(" with vlen datatype of vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t));
if (writeBuf[uu].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
} /* end if */
writeBuf[uu].len = uu + 1;
for (t1=(hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++)
- {
+ {
t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
- if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
- goto error;
- }
+ if (t1->p == NULL) {
+ HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ goto error;
+ }
t1->len = vv * 1;
for (ww = 0; ww < (vv * 1); ww++)
((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
@@ -525,64 +525,64 @@ static int test_VLof_VLtype(void)
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
- goto error;
+ goto error;
vlofvl = H5Tvlen_create (vlatomic);
if (vlofvl < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of vlen datatype */
ptable = H5PTcreate(fid, PT_VLEN_VLEN, vlofvl, (hsize_t)1, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release datatypes */
if (H5Tclose(vlatomic) < 0)
- goto error;
+ goto error;
if (H5Tclose(vlofvl) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)5, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
- sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
+ HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)5, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -600,41 +600,41 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* verify_ptlengthtype() - helper function, verifies that the named packet
- * table is a fixed-length or variable-length as indicated by the last
- * argument.
+ * table is a fixed-length or variable-length as indicated by the last
+ * argument.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int verify_ptlengthtype(hid_t fid, const char *table_name, herr_t expected_value)
{
- hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */
+ hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */
herr_t is_varlen = 0;
herr_t ret = FAIL;
/* Open the named packet table */
if( (ptable = H5PTopen(fid, table_name)) < 0)
- goto error;
+ goto error;
/* Verify the value returned from H5PTis_varlen is as expected */
is_varlen = H5PTis_varlen(ptable);
if (is_varlen == FAIL)
- goto error;
+ goto error;
else if (is_varlen == expected_value)
- ret = SUCCEED;
+ ret = SUCCEED;
else
{
- char lenthtype[20];
- HDstrcpy(lenthtype, "fixed-length");
- if (expected_value == 1)
- HDstrcpy(lenthtype, "variable-length");
- fprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype);
- ret = FAIL;
+ char lenthtype[20];
+ HDstrcpy(lenthtype, "fixed-length");
+ if (expected_value == 1)
+ HDstrcpy(lenthtype, "variable-length");
+ HDfprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype);
+ ret = FAIL;
}
/* Close the packet table */
if (H5PTclose(ptable) < 0)
- goto error;
+ goto error;
return ret;
@@ -645,71 +645,71 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_H5PTis_varlen(): Test that H5PTis_varlen works correctly on both
- * fixed- and variable-length packet tables.
+ * fixed- and variable-length packet tables.
*
* Description:
- * - Added a fixed-length packet table to the file for variety
- * - Use the helper funtion verify_ptlengthtype to test H5PTis_varlen
- * on each packet table.
+ * - Added a fixed-length packet table to the file for variety
+ * - Use the helper funtion verify_ptlengthtype to test H5PTis_varlen
+ * on each packet table.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_H5PTis_varlen(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- herr_t ret; /* Returned status from a callee */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ herr_t ret; /* Returned status from a callee */
- TESTING("H5PTis_varlen");
+ HL_TESTING2("H5PTis_varlen");
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a new table */
ptable = H5PTcreate(fid, PT_FIXED_LEN, H5T_STD_I32BE, (hsize_t)100, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Open each packet table, and verify that H5PTis_varlen returns correct
type for each table */
ret = verify_ptlengthtype(fid, PT_VLEN_ATOMIC, 1); /* vlen of atomic */
if (ret < 0)
- goto error;
+ goto error;
ret = verify_ptlengthtype(fid, PT_VLEN_COMP, 1); /* vlen of compound */
if (ret < 0)
- goto error;
+ goto error;
ret = verify_ptlengthtype(fid, PT_COMP_VLEN, 0); /* compound of vlen, no vlen */
if (ret < 0)
- goto error;
+ goto error;
ret = verify_ptlengthtype(fid, PT_VLEN_VLEN, 1); /* vlen of vlen */
if (ret < 0)
- goto error;
+ goto error;
ret = verify_ptlengthtype(fid, PT_FIXED_LEN, 0); /* no vlen */
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -722,11 +722,11 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* adding_attribute() - helper function, adds an attribute to the named
- * packet table.
+ * packet table.
* Note:
- * For simplicity, the attributes that are added to the packet tables
- * have the same characteristics except their names. They have the
- * same type, space, and values.
+ * For simplicity, the attributes that are added to the packet tables
+ * have the same characteristics except their names. They have the
+ * same type, space, and values.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -737,47 +737,47 @@ int attr_data[ATTR_DIM]={256,11945,-22107}; /* values to be written to attr */
static int adding_attribute(hid_t fid, const char *table_name, const char *attr_name)
{
- hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */
- hid_t space_id = H5I_INVALID_HID; /* Dataspace for the attribute */
- hid_t attr_id = H5I_INVALID_HID; /* Attribute identifier */
- hid_t dset_id = H5I_INVALID_HID; /* Dataset identifier */
- hsize_t dims[] = {ATTR_DIM}; /* Dimension for dataspace */
- int ret = FAIL; /* Returned status from a callee */
+ hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */
+ hid_t space_id = H5I_INVALID_HID; /* Dataspace for the attribute */
+ hid_t attr_id = H5I_INVALID_HID; /* Attribute identifier */
+ hid_t dset_id = H5I_INVALID_HID; /* Dataset identifier */
+ hsize_t dims[] = {ATTR_DIM}; /* Dimension for dataspace */
+ int ret = FAIL; /* Returned status from a callee */
/* Create dataspace for attribute */
space_id = H5Screate_simple(ATTR_RANK, dims, NULL);
if (space_id < 0)
- goto error;
+ goto error;
/* Open the named packet table */
if( (ptable = H5PTopen(fid, table_name)) < 0)
- goto error;
+ goto error;
dset_id = H5PTget_dataset(ptable);
if (dset_id < 0)
- goto error;
+ goto error;
/* Add the specified attribute to it */
attr_id = H5Acreate2(dset_id, attr_name, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT);
if (attr_id < 0)
- goto error;
+ goto error;
/* Write attribute values */
ret = H5Awrite(attr_id, H5T_NATIVE_INT, attr_data);
if (ret < 0)
- goto error;
+ goto error;
/* Close the attribute */
if (H5Aclose(attr_id) < 0)
- goto error;
+ goto error;
/* Close the dataspace */
if (H5Sclose(space_id) < 0)
- goto error;
+ goto error;
/* Close the packet table */
if (H5PTclose(ptable) < 0)
- goto error;
+ goto error;
return SUCCEED;
@@ -790,39 +790,39 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* verify_attribute() - helper function, verifies the named attribute can
- * be read correctly.
+ * be read correctly.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static herr_t verify_attribute(hid_t fid, const char *table_name, const char *attr_name)
{
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t attr_id=H5I_INVALID_HID; /* Attribute identifier */
- hid_t dset_id=H5I_INVALID_HID; /* Dataset associated with the pt */
- int read_data[ATTR_DIM]; /* Output buffer */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t attr_id=H5I_INVALID_HID; /* Attribute identifier */
+ hid_t dset_id=H5I_INVALID_HID; /* Dataset associated with the pt */
+ int read_data[ATTR_DIM]; /* Output buffer */
int ii;
- herr_t ret = FAIL; /* Returned status from a callee */
+ herr_t ret = FAIL; /* Returned status from a callee */
/* Open the named packet table */
ptable = H5PTopen(fid, table_name);
if (ptable < 0)
- goto error;
+ goto error;
/* Get the dataset id of this packet table */
dset_id = H5PTget_dataset(ptable);
if (dset_id < 0)
- goto error;
+ goto error;
/* Open first attribute for the dataset */
attr_id = H5Aopen(dset_id, attr_name, H5P_DEFAULT);
if (attr_id < 0)
- goto error;
+ goto error;
/* Read attribute values */
ret = H5Aread(attr_id, H5T_NATIVE_INT, read_data);
if (ret < 0)
- goto error;
+ goto error;
/* Verify values read in */
for (ii = 0; ii < ATTR_DIM; ii++)
@@ -831,11 +831,11 @@ static herr_t verify_attribute(hid_t fid, const char *table_name, const char *at
/* Close the attribute */
if (H5Aclose(attr_id) < 0)
- goto error;
+ goto error;
/* Close the packet table */
if (H5PTclose(ptable) < 0)
- goto error;
+ goto error;
return SUCCEED;
@@ -849,58 +849,58 @@ error: /* An error has occurred. Clean up and exit. */
* test_attributes(): Test adding attributes to packet tables
*
* Description:
- * Added attributes to some random packet tables in the file.
+ * Added attributes to some random packet tables in the file.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_attributes(void)
{
- hid_t fid=H5I_INVALID_HID; /* File identifier */
- hid_t attr_id=H5I_INVALID_HID; /* Attribute identifier */
- herr_t ret = FAIL; /* Returned status from a callee */
+ hid_t fid=H5I_INVALID_HID; /* File identifier */
+ hid_t attr_id=H5I_INVALID_HID; /* Attribute identifier */
+ herr_t ret = FAIL; /* Returned status from a callee */
- TESTING("adding attributes to packet tables");
+ HL_TESTING2("adding attributes to packet tables");
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Add an arbitrary attribute to a few packet tables, using helper func */
attr_id = adding_attribute(fid, PT_VLEN_ATOMIC, "Attribute 1");
if (attr_id < 0)
- goto error;
+ goto error;
attr_id = adding_attribute(fid, PT_VLEN_COMP, "Attribute 2");
if (attr_id < 0)
- goto error;
+ goto error;
attr_id = adding_attribute(fid, PT_COMP_VLEN, "Attribute 3");
if (attr_id < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
/* Open the file again */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Read each attribute and verify the values, using helper function */
ret = verify_attribute(fid, PT_VLEN_ATOMIC, "Attribute 1");
if (ret < 0)
- goto error;
+ goto error;
ret = verify_attribute(fid, PT_VLEN_COMP, "Attribute 2");
if (ret < 0)
- goto error;
+ goto error;
ret = verify_attribute(fid, PT_COMP_VLEN, "Attribute 3");
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return(ret);
@@ -913,17 +913,17 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* verify_accessors() - helper function, verifies that various info can be
- * retrieved correctly using the info returned by the accessor functions.
+ * retrieved correctly using the info returned by the accessor functions.
*
* Description:
- * Testing functions H5PTget_dataset and H5PTget_type
+ * Testing functions H5PTget_dataset and H5PTget_type
*
- * - Opens the named packet table
- * - Gets its associated dataset ID then calls a C function on that ID
- * to verify the dataset name
- * - Gets its associated datatype ID then calls a C function on that ID
- * to verify that the packet table is variable- or fixed-length as
- * indicated by the expected_value argument
+ * - Opens the named packet table
+ * - Gets its associated dataset ID then calls a C function on that ID
+ * to verify the dataset name
+ * - Gets its associated datatype ID then calls a C function on that ID
+ * to verify that the packet table is variable- or fixed-length as
+ * indicated by the expected_value argument
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -990,18 +990,18 @@ error: /* An error has occurred. Clean up and exit. */
* test_accessors(): Test the accessor functions
*
* Description:
- * Retrieves the dataset and datatype IDs and verifies various info
- * to ensure these IDs are correct.
+ * Retrieves the dataset and datatype IDs and verifies various info
+ * to ensure these IDs are correct.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_accessors(void)
{
- hid_t fid=H5I_INVALID_HID; /* File identifier */
- herr_t ret = FAIL; /* Returned status from a callee */
+ hid_t fid=H5I_INVALID_HID; /* File identifier */
+ herr_t ret = FAIL; /* Returned status from a callee */
- TESTING("accessor functions");
+ HL_TESTING2("accessor functions");
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
@@ -1031,109 +1031,109 @@ error: /* An error has occurred. Clean up and exit. */
} /* test_accessors */
/**************************************************************************
- Test set for deprecated function H5PTcreate_fl
- Each test in this set is the same as the corresponding one in the
- set for H5PTcreate, as of Mar 2016
+ Test set for deprecated function H5PTcreate_fl
+ Each test in this set is the same as the corresponding one in the
+ set for H5PTcreate, as of Mar 2016
**************************************************************************/
/*-------------------------------------------------------------------------
* testfl_VLof_atomic(): Test that a packet table with VL datatypes of atomic
- * datatypes can be created and written correctly. (HDFFV-442)
+ * datatypes can be created and written correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int testfl_VLof_atomic(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
- hsize_t count; /* Number of records in the table */
- unsigned uu, vv; /* Loop variables */
- hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
- hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
-
- TESTING3(" with vlen of atomic");
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
+ hsize_t count; /* Number of records in the table */
+ unsigned uu, vv; /* Loop variables */
+ hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
+ hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
+ char msg[80]; /* For error message */
+ herr_t ret; /* Returned status from a callee */
+
+ HL_TESTING3(" with vlen of atomic");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int));
if (writeBuf[uu].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].len = uu + 1;
for (vv = 0; vv < (uu + 1); vv++)
- ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
+ ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
} /* end for */
/* Open the file */
fid = H5Fopen(TESTFL_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a vlen type that uses an atomic datatype as its base type */
vltype = H5Tvlen_create (H5T_NATIVE_UINT);
if (vltype < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of an atomic type */
ptable = H5PTcreate_fl(fid, PT_VLEN_ATOMIC, vltype, (hsize_t)1, 0);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Close the vlen datatype */
if (H5Tclose(vltype) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
- sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
+ HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)NRECORDS, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
for (uu = 0; uu < NRECORDS; uu++)
for (vv = 0; vv < (uu + 1); vv++)
{
- if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
- printf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
- printf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
- }
+ if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
+ HDprintf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
+ HDprintf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
+ }
}
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf );
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -1150,7 +1150,7 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* testfl_VLof_comptype(): Test that a packet table with VL datatypes of
- * compound datatypes can be created and written correctly. (HDFFV-442)
+ * compound datatypes can be created and written correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -1162,26 +1162,26 @@ static int testfl_VLof_comptype(void)
unsigned u;
float f;
} VLcomp_t;
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
- hid_t cmptype=H5I_INVALID_HID; /* Compound datatype */
- hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
- hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
- hsize_t count; /* Number of records in the table */
- unsigned uu, vv; /* Loop variables */
- char msg[80]; /* For error message */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t cmptype=H5I_INVALID_HID; /* Compound datatype */
+ hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
+ hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
+ hsize_t count; /* Number of records in the table */
+ unsigned uu, vv; /* Loop variables */
+ char msg[80]; /* For error message */
herr_t ret;
- TESTING3(" with vlen of compound datatypes");
+ HL_TESTING3(" with vlen of compound datatypes");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t));
if(writeBuf[uu].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].len = uu + 1;
for (vv = 0; vv < (uu + 1); vv++) {
((VLcomp_t *)writeBuf[uu].p)[vv].u = uu + vv;
@@ -1192,88 +1192,88 @@ static int testfl_VLof_comptype(void)
/* Open the file */
fid = H5Fopen(TESTFL_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create the base compound type */
cmptype = H5Tcreate(H5T_COMPOUND, sizeof(VLcomp_t));
if (cmptype < 0)
- goto error;
+ goto error;
/* Insert fields */
ret = H5Tinsert(cmptype, "u", HOFFSET(VLcomp_t, u), H5T_NATIVE_UINT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(cmptype, "f", HOFFSET(VLcomp_t, f), H5T_NATIVE_FLOAT);
if (ret < 0)
- goto error;
+ goto error;
/* Create a variable length type that uses the VLcomp_t as its base type */
vltype = H5Tvlen_create(cmptype);
if (vltype < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of compound datatype */
ptable = H5PTcreate_fl(fid, PT_VLEN_COMP, vltype, (hsize_t)1, 0);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release the datatypes */
if (H5Tclose(cmptype) < 0)
- goto error;
+ goto error;
if (H5Tclose(vltype) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)5, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
- sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
+ HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)5, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].len != readBuf[uu].len) {
- fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n",__LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len);
- continue;
- } /* write len != read len */
+ HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n",__LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len);
+ continue;
+ } /* write len != read len */
for (vv = 0; vv < (uu + 1); vv++) {
if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv] ) {
- fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%u]=%u, readBuf[uu].p[%u]=%u\n", vv, ((unsigned int *)writeBuf[uu].p)[vv], vv, ((unsigned int *)readBuf[uu].p)[vv]);
+ HDfprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%u]=%u, readBuf[uu].p[%u]=%u\n", vv, ((unsigned int *)writeBuf[uu].p)[vv], vv, ((unsigned int *)readBuf[uu].p)[vv]);
continue;
- } /* write value != read value */
- }
+ } /* write value != read value */
+ }
} /* end for */
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -1291,8 +1291,8 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* testfl_compound_VL_VL(): Test that a packet table of compound datatypes
- * containing VL datatypes can be created and written
- * correctly. (HDFFV-442)
+ * containing VL datatypes can be created and written
+ * correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -1303,23 +1303,23 @@ static int testfl_compound_VL_VLtype(void)
typedef struct {
unsigned u;
float f;
- hvl_t v;
+ hvl_t v;
} compVLVL_t;
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
- hid_t vlofvl=H5I_INVALID_HID; /* Variable length datatype */
- hid_t comp_vlvl=H5I_INVALID_HID; /* ID of a compound datatype containing
- a VL of VL of atomic datatype */
- hsize_t count; /* Number of records in the table */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t vlofvl=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t comp_vlvl=H5I_INVALID_HID; /* ID of a compound datatype containing
+ a VL of VL of atomic datatype */
+ hsize_t count; /* Number of records in the table */
compVLVL_t writeBuf[NRECORDS];/* Buffer to hold data to be written */
compVLVL_t readBuf[NRECORDS]; /* Buffer to hold read data */
hvl_t *t1, *t2;
- unsigned uu, vv, ww; /* Loop variables */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
+ unsigned uu, vv, ww; /* Loop variables */
+ char msg[80]; /* For error message */
+ herr_t ret; /* Returned status from a callee */
- TESTING3(" with compound datatype containing vlen datatype");
+ HL_TESTING3(" with compound datatype containing vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -1327,17 +1327,17 @@ static int testfl_compound_VL_VLtype(void)
writeBuf[uu].f = (float)(uu * 20) / 3.0F;
writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t));
if (writeBuf[uu].v.p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].v.len = uu + L1_INCM;
for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++)
- {
+ {
t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int));
- if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
- goto error;
- }
+ if (t1->p == NULL) {
+ HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ goto error;
+ }
t1->len = vv + L2_INCM;
for (ww = 0; ww < vv + L2_INCM; ww++)
((unsigned int*)t1->p)[ww] = uu * 100 + vv * 10 + ww;
@@ -1347,91 +1347,91 @@ static int testfl_compound_VL_VLtype(void)
/* Open the file */
fid = H5Fopen(TESTFL_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
- goto error;
+ goto error;
/* Create a VL datatype of the VL of atomic datatype */
vlofvl = H5Tvlen_create (vlatomic);
if (vlofvl < 0)
- goto error;
+ goto error;
/* Create the base compound type */
comp_vlvl = H5Tcreate(H5T_COMPOUND, sizeof(compVLVL_t));
if (comp_vlvl < 0)
- goto error;
+ goto error;
/* Insert fields: atomic, atomic, vlen */
ret = H5Tinsert(comp_vlvl, "u", HOFFSET(compVLVL_t, u), H5T_NATIVE_UINT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(comp_vlvl, "f", HOFFSET(compVLVL_t, f), H5T_NATIVE_FLOAT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(comp_vlvl, "v", HOFFSET(compVLVL_t, v), vlofvl);
if (ret < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a compound datatype of vlen datatype */
ptable = H5PTcreate_fl(fid, PT_COMP_VLEN, comp_vlvl, (hsize_t)1, 0);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release datatypes */
if (H5Tclose(vlatomic) < 0)
- goto error;
+ goto error;
if (H5Tclose(vlofvl) < 0)
- goto error;
+ goto error;
if (H5Tclose(comp_vlvl) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)NRECORDS, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
- sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
+ HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)NRECORDS, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].u != readBuf[uu].u) {
- fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u);
+ HDfprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u);
continue;
} /* end if */
if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f, readBuf[uu].f)) {
- fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
+ HDfprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
continue;
} /* end if */
if (writeBuf[uu].v.len != readBuf[uu].v.len) {
- fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
+ HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
continue;
} /* end if */
for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0; (size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) {
if (t1->len != t2->len) {
- fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len);
+ HDfprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len);
continue;
} /* end if */
for (ww = 0; (size_t)ww < t2->len; ww++) {
if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww] ) {
- fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
+ HDfprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
continue;
} /* end if */
} /* end for */
@@ -1441,19 +1441,19 @@ static int testfl_compound_VL_VLtype(void)
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -1472,43 +1472,43 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* testfl_VLof_VLtype(): Test that a packet table of VL datatype with VL
- * datatypes of atomic datatypes can be created and written
- * correctly. (HDFFV-442)
+ * datatypes of atomic datatypes can be created and written
+ * correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int testfl_VLof_VLtype(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
- hid_t vlofvl=H5I_INVALID_HID; /* VL datatype of VL datatypes */
- hsize_t count; /* Number of records in the table */
- hvl_t *t1; /* pointer to advance */
- unsigned uu, vv, ww; /* Loop variables */
- hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
- hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
-
- TESTING3(" with vlen datatype of vlen datatype");
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t vlofvl=H5I_INVALID_HID; /* VL datatype of VL datatypes */
+ hsize_t count; /* Number of records in the table */
+ hvl_t *t1; /* pointer to advance */
+ unsigned uu, vv, ww; /* Loop variables */
+ hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
+ hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
+ char msg[80]; /* For error message */
+ herr_t ret; /* Returned status from a callee */
+
+ HL_TESTING3(" with vlen datatype of vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t));
if (writeBuf[uu].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
} /* end if */
writeBuf[uu].len = uu + 1;
for (t1 = (hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++)
- {
+ {
t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
- if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
- goto error;
- }
+ if (t1->p == NULL) {
+ HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ goto error;
+ }
t1->len = vv + 1;
for (ww = 0; ww < (vv + 1); ww++)
((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
@@ -1518,64 +1518,64 @@ static int testfl_VLof_VLtype(void)
/* Open the file */
fid = H5Fopen(TESTFL_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
- goto error;
+ goto error;
vlofvl = H5Tvlen_create (vlatomic);
if (vlofvl < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of vlen datatype */
ptable = H5PTcreate_fl(fid, PT_VLEN_VLEN, vlofvl, (hsize_t)1, 0);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release datatypes */
if (H5Tclose(vlatomic) < 0)
- goto error;
+ goto error;
if (H5Tclose(vlofvl) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)5, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
- sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
+ HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)5, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -1593,25 +1593,25 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_packet_table_with_varlen(): Invokes individual tests to ensure that
- * packet tables with variable length are created and written correctly
- * without the specific VL PT functionality. (HDFFV-442)
+ * packet tables with variable length are created and written correctly
+ * without the specific VL PT functionality. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
int test_packet_table_with_varlen(void)
{
- hid_t fid=H5I_INVALID_HID; /* File identifier */
+ hid_t fid=H5I_INVALID_HID; /* File identifier */
int status = SUCCEED;
/* Create a file using default properties */
fid = H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid < 0)
- return FAIL;
+ return FAIL;
/* Close the file. The file will be opened by each test function below */
if (H5Fclose(fid) < 0)
- return FAIL;
+ return FAIL;
HDputs("Testing packet table with various variable-length datatypes");
@@ -1620,46 +1620,46 @@ int test_packet_table_with_varlen(void)
/* Test variable length of a simple type */
if (test_VLof_atomic() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a compound type */
if (test_VLof_comptype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test compound type with variable length */
if (test_compound_VL_VLtype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a variable length */
if (test_VLof_VLtype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a variable length */
if (test_H5PTis_varlen() < 0)
- status = FAIL;
+ status = FAIL;
/* Test adding attributes to packet table */
if (test_attributes() < 0)
- status = FAIL;
+ status = FAIL;
/* Test accessor functions */
if (test_accessors() < 0)
- status = FAIL;
+ status = FAIL;
/**************************************************************************
- Calling test functions for deprecated function H5PTcreate_fl
- Mar 2016, -BMR
+ Calling test functions for deprecated function H5PTcreate_fl
+ Mar 2016, -BMR
**************************************************************************/
/* Create a file using default properties */
fid = H5Fcreate(TESTFL_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid < 0)
- return FAIL;
+ return FAIL;
/* Close the file. The file will be opened by each test function below */
if (H5Fclose(fid) < 0)
- return FAIL;
+ return FAIL;
HDputs("Testing packet table with various variable-length datatypes - H5PTcreate_fl");
@@ -1668,19 +1668,19 @@ int test_packet_table_with_varlen(void)
/* Test variable length of a simple type */
if (testfl_VLof_atomic() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a compound type */
if (testfl_VLof_comptype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test compound type with variable length */
if (testfl_compound_VL_VLtype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a variable length */
if (testfl_VLof_VLtype() < 0)
- status = FAIL;
+ status = FAIL;
return(status);
}
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 0215697..1d6bcec 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -51,8 +51,6 @@
#define NRECORDS 8
#define NRECORDS_ADD 3
-#define TESTING2(WHAT) {printf("%-70s", "Testing " WHAT); fflush(stdout);}
-
/*-------------------------------------------------------------------------
* structure used for all tests, a particle with properties
*-------------------------------------------------------------------------
@@ -117,7 +115,7 @@ typedef struct particle3_t
*-------------------------------------------------------------------------
*/
-/* Push current alignment rule forcing 4-byte alignment boundary
+/* Push current alignment rule forcing 4-byte alignment boundary
* to the internal stack ...
*/
#pragma pack(push,4)
@@ -129,7 +127,7 @@ typedef struct particle3_t
float aty[3];
float rro[2];
} particle4_t;
-/*
+/*
* ... and restore original alignment rules from stack
*/
#pragma pack(pop)
@@ -164,14 +162,14 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf )
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
- !H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
- !H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
+ !H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
{
HDfprintf(stderr,"read and write buffers have differences\n");
HDfprintf(stderr,"%s %ld %f %f %d\n",
- rbuf[i].name,rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
+ rbuf[i].name,rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
HDfprintf(stderr,"%s %ld %f %f %d\n",
- wbuf[j].name,wbuf[j].longi,(double)wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
+ wbuf[j].name,wbuf[j].longi,(double)wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
return -1;
}
return 0;
@@ -424,7 +422,7 @@ static int test_table(hid_t fid, int do_write)
sizeof( rbuf[0].lati)
};
- const char *field_names4[NFIELDS+1] =
+ const char *field_names4[NFIELDS+1] =
{ "F1", "F2", "F3", "F4", "F5", "F6"};
hid_t field_type4[NFIELDS+1];
particle4_t fill_data[1] = { {9999999, -9999999, 999999, {999,999,999},{999,999,999}, {999,999}} };
@@ -458,7 +456,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("making table");
+ HL_TESTING2("making table");
if (H5TBmake_table(TITLE,fid,"table1",FIELDS,RECORDS,type_size_mem,
field_names,field_offset,field_type,
@@ -467,7 +465,7 @@ static int test_table(hid_t fid, int do_write)
PASSED();
}
- TESTING2("reading table");
+ HL_TESTING2("reading table");
/*-------------------------------------------------------------------------
* read the table
@@ -497,7 +495,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("writing records");
+ HL_TESTING2("writing records");
/* create an empty table */
if (H5TBmake_table(TITLE,fid,"table2",FIELDS,RECORDS,type_size_mem,
@@ -540,7 +538,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
- TESTING2("reading records");
+ HL_TESTING2("reading records");
/*-------------------------------------------------------------------------
* read records, start at 0, read 8
@@ -584,7 +582,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("appending records");
+ HL_TESTING2("appending records");
/*-------------------------------------------------------------------------
* append 2 records
@@ -630,7 +628,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("inserting records");
+ HL_TESTING2("inserting records");
/*-------------------------------------------------------------------------
* insert 2 records
@@ -690,7 +688,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("deleting records");
+ HL_TESTING2("deleting records");
/*-------------------------------------------------------------------------
* Create a table
@@ -883,54 +881,54 @@ static int test_table(hid_t fid, int do_write)
/*------------------------------------------------------------------------
* Functions tested:
*
- * H5TBdelete_record -- With differing memory layout from machine memory
+ * H5TBdelete_record -- With differing memory layout from machine memory
* layout. HDFFV-8055
*
*-------------------------------------------------------------------------
*/
if (do_write)
{
- TESTING2("deleting records (differing memory layout)");
+ HL_TESTING2("deleting records (differing memory layout)");
- dims = 3;
- arry3_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
+ dims = 3;
+ arry3_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
- dims = 2;
- arry2_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
+ dims = 2;
+ arry2_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
- /* Initialize the field field_type */
- field_type4[0] = H5T_NATIVE_UINT32;
- field_type4[1] = H5T_NATIVE_DOUBLE;
- field_type4[2] = H5T_NATIVE_DOUBLE;
- field_type4[3] = arry3_32f;
- field_type4[4] = arry3_32f;
- field_type4[5] = arry2_32f;
+ /* Initialize the field field_type */
+ field_type4[0] = H5T_NATIVE_UINT32;
+ field_type4[1] = H5T_NATIVE_DOUBLE;
+ field_type4[2] = H5T_NATIVE_DOUBLE;
+ field_type4[3] = arry3_32f;
+ field_type4[4] = arry3_32f;
+ field_type4[5] = arry2_32f;
- /* Make the table */
- if (H5TBmake_table("Table Title",fid,"table",NFIELDS+1,(hsize_t)NRECORDS,
+ /* Make the table */
+ if (H5TBmake_table("Table Title",fid,"table",NFIELDS+1,(hsize_t)NRECORDS,
tbl_size, field_names4, tbl_offset, field_type4,
chunk_size, fill_data, compress, p_data)<0)
- goto out;
- /* Delete records */
- start = 3;
- nrecords = 3;
- if (H5TBdelete_record(fid, "table", start, nrecords)<0)
- goto out;;
- /* Get table info */
- if (H5TBget_table_info(fid,"table", &nfields_out, &nrecords_out)<0)
- goto out;
- /* check */
- if( (int)nfields_out != (int)NFIELDS+1)
- goto out;
-
- if( (int)nrecords_out != (int)NRECORDS-3)
- goto out;
-
- /* close type */
- H5Tclose(arry3_32f);
- H5Tclose(arry2_32f);
-
- PASSED();
+ goto out;
+ /* Delete records */
+ start = 3;
+ nrecords = 3;
+ if (H5TBdelete_record(fid, "table", start, nrecords)<0)
+ goto out;;
+ /* Get table info */
+ if (H5TBget_table_info(fid,"table", &nfields_out, &nrecords_out)<0)
+ goto out;
+ /* check */
+ if( (int)nfields_out != (int)NFIELDS+1)
+ goto out;
+
+ if( (int)nrecords_out != (int)NRECORDS-3)
+ goto out;
+
+ /* close type */
+ H5Tclose(arry3_32f);
+ H5Tclose(arry2_32f);
+
+ PASSED();
}
/*-------------------------------------------------------------------------
@@ -945,7 +943,7 @@ static int test_table(hid_t fid, int do_write)
if (do_write)
{
- TESTING2("adding records");
+ HL_TESTING2("adding records");
/* create 2 tables */
if (H5TBmake_table(TITLE,fid,"table4",FIELDS,RECORDS,type_size_mem,
@@ -1005,7 +1003,7 @@ static int test_table(hid_t fid, int do_write)
if (do_write)
{
- TESTING2("combining tables");
+ HL_TESTING2("combining tables");
/* create 2 tables */
if (H5TBmake_table(TITLE,fid,"table6",FIELDS,RECORDS,type_size_mem,
@@ -1100,7 +1098,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("writing fields by name");
+ HL_TESTING2("writing fields by name");
/* make an empty table with fill values */
if (H5TBmake_table(TITLE,fid,"table9",FIELDS,RECORDS,type_size_mem,
@@ -1138,10 +1136,10 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
- !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
{
HDfprintf(stderr,"%ld %f %d\n",
- rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati);
+ rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati);
HDfprintf(stderr,"%ld %f %d\n",
position_in[i].longi,(double)pressure_in[i],position_in[i].lati);
goto out;
@@ -1163,7 +1161,7 @@ static int test_table(hid_t fid, int do_write)
*
*-------------------------------------------------------------------------
*/
- TESTING2("reading fields by name");
+ HL_TESTING2("reading fields by name");
/*-------------------------------------------------------------------------
* write and read the "Pressure" field
@@ -1191,7 +1189,7 @@ static int test_table(hid_t fid, int do_write)
if ( H5TBread_fields_name(fid,"table10","DoesNotExist",start,nrecords,
sizeof(float),0,field_sizes_pre,pressure_out) >=0)
goto out;
-
+
/* read the "Pressure" field */
if ( H5TBread_fields_name(fid,"table10","Pressure",start,nrecords,
sizeof(float),0,field_sizes_pre,pressure_out)<0)
@@ -1263,7 +1261,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
- !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
}
}
@@ -1292,7 +1290,7 @@ static int test_table(hid_t fid, int do_write)
{
hsize_t iistart = start;
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) ||
- !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
goto out;
}
}
@@ -1311,7 +1309,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("writing fields by index");
+ HL_TESTING2("writing fields by index");
/* make an empty table */
if (H5TBmake_table(TITLE,fid,"table11",FIELDS,RECORDS,type_size_mem,
@@ -1351,7 +1349,7 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
- !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
goto out;
}
}
@@ -1369,7 +1367,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
- TESTING2("reading fields by index");
+ HL_TESTING2("reading fields by index");
if (do_write)
{
@@ -1470,8 +1468,8 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
- !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
- goto out;
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
+ goto out;
}
}
@@ -1501,7 +1499,7 @@ static int test_table(hid_t fid, int do_write)
{
int iistart = (int) start;
if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+(int)i].name ) != 0 ) ||
- !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
goto out;
}
}
@@ -1520,7 +1518,7 @@ static int test_table(hid_t fid, int do_write)
if (do_write)
{
- TESTING2("inserting fields");
+ HL_TESTING2("inserting fields");
/* make a table */
if (H5TBmake_table(TITLE,fid,"table13",FIELDS,RECORDS,type_size_mem,
@@ -1544,8 +1542,8 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) ||
rbuf2[i].lati != wbuf[i].lati ||
rbuf2[i].longi != wbuf[i].longi ||
- !H5_FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
- !H5_DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
+ !H5_FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
+ !H5_DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
rbuf2[i].new_field != buf_new[i] ) {
goto out;
}
@@ -1563,7 +1561,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("deleting fields");
+ HL_TESTING2("deleting fields");
/* make a table */
if (H5TBmake_table(TITLE,fid,"table14",FIELDS,RECORDS,type_size_mem,
@@ -1585,7 +1583,7 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) ||
rbuf3[i].lati != wbuf[i].lati ||
rbuf3[i].longi != wbuf[i].longi ||
- !H5_DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
+ !H5_DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
goto out;
}
}
@@ -1603,7 +1601,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
- TESTING2("getting table info");
+ HL_TESTING2("getting table info");
/* get table info */
if ( H5TBget_table_info (fid, "table1", &rfields, &rrecords ) < 0 )
@@ -1624,7 +1622,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
- TESTING2("getting field info");
+ HL_TESTING2("getting field info");
/* alocate */
names_out = (char**) HDmalloc( sizeof(char*) * (size_t)NFIELDS );
diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in
index 46c01f6..ca5c40b 100644
--- a/hl/tools/Makefile.in
+++ b/hl/tools/Makefile.in
@@ -485,7 +485,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -508,9 +507,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -537,6 +539,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -591,6 +594,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -615,7 +619,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1267,7 +1270,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt
index a27ab18..3cd913f 100644
--- a/hl/tools/gif2h5/CMakeLists.txt
+++ b/hl/tools/gif2h5/CMakeLists.txt
@@ -14,24 +14,58 @@ set (GIF2H5_SOURCES
)
#-- Add gif2hdf5 program
-add_executable (gif2h5 ${GIF2H5_SOURCES})
-target_include_directories(gif2h5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (gif2h5 STATIC)
-target_link_libraries (gif2h5 PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
-set_target_properties (gif2h5 PROPERTIES FOLDER tools/hl)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};gif2h5")
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (gif2h5 ${GIF2H5_SOURCES})
+ target_include_directories (gif2h5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (gif2h5 STATIC)
+ target_link_libraries (gif2h5 PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ set_target_properties (gif2h5 PROPERTIES FOLDER tools/hl)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};gif2h5")
+ set (H5_DEP_EXECUTABLES
+ gif2h5
+ )
+endif ()
+
+if (BUILD_SHARED_LIBS)
+ add_executable (gif2h5-shared ${GIF2H5_SOURCES})
+ target_include_directories (gif2h5-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (gif2h5-shared SHARED)
+ target_link_libraries (gif2h5-shared PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET})
+ set_target_properties (gif2h5-shared PROPERTIES FOLDER tools/hl)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};gif2h5-shared")
+ set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES}
+ gif2h5-shared
+ )
+endif ()
#-- Add h52gif program
set (hdf2gif_SOURCES
${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdf2gif.c
${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdfgifwr.c
)
-add_executable (h52gif ${hdf2gif_SOURCES})
-target_include_directories(h52gif PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h52gif STATIC)
-target_link_libraries (h52gif PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
-set_target_properties (h52gif PROPERTIES FOLDER tools/hl)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h52gif")
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h52gif ${hdf2gif_SOURCES})
+ target_include_directories (h52gif PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h52gif STATIC)
+ target_link_libraries (h52gif PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ set_target_properties (h52gif PROPERTIES FOLDER tools/hl)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h52gif")
+ set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES}
+ h52gif
+ )
+endif ()
+
+if (BUILD_SHARED_LIBS)
+ add_executable (h52gif-shared ${hdf2gif_SOURCES})
+ target_include_directories (h52gif-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h52gif-shared SHARED)
+ target_link_libraries (h52gif-shared PRIVATE ${HDF5_HL_LIBSH_TARGET} PRIVATE ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET})
+ set_target_properties (h52gif-shared PROPERTIES FOLDER tools/hl)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h52gif-shared")
+ set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES}
+ h52gif-shared
+ )
+endif ()
if (BUILD_TESTING)
# --------------------------------------------------------------------
@@ -39,14 +73,14 @@ if (BUILD_TESTING)
# used in the CMake Build system as we rely on the test files that are
# shipped with HDF5 source archives
# --------------------------------------------------------------------
- if (HDF5_BUILD_GENERATORS)
+ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (hl_h52gifgentest ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/h52gifgentst.c)
- target_include_directories(hl_h52gifgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (hl_h52gifgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (hl_h52gifgentest STATIC)
target_link_libraries (hl_h52gifgentest PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl)
-# add_test (NAME hl_h52gifgentest COMMAND $<TARGET_FILE:hl_h52gifgentest>)
+# add_test (NAME hl_h52gifgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_h52gifgentest>)
endif ()
include (CMakeTests.cmake)
@@ -58,8 +92,7 @@ endif ()
if (HDF5_EXPORTED_TARGETS)
install (
TARGETS
- gif2h5
- h52gif
+ ${H5_DEP_EXECUTABLES}
EXPORT
${HDF5_EXPORTED_TARGETS}
RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications
diff --git a/hl/tools/gif2h5/CMakeTests.cmake b/hl/tools/gif2h5/CMakeTests.cmake
index 61c004e..8537d7c 100644
--- a/hl/tools/gif2h5/CMakeTests.cmake
+++ b/hl/tools/gif2h5/CMakeTests.cmake
@@ -27,6 +27,12 @@ HDFTEST_COPY_FILE("${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/testfiles/h52giftst.h5" "$
HDFTEST_COPY_FILE("${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/testfiles/ex_image2.h5" "${PROJECT_BINARY_DIR}/testfiles/ex_image2.h5" "gif2h5_files")
add_custom_target(gif2h5_files ALL COMMENT "Copying files needed by gif2h5 tests" DEPENDS ${gif2h5_files_list})
+if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+else ()
+ set (tgt_ext "-shared")
+endif ()
+
# Remove any output file left over from previous test run
add_test (
NAME HL_TOOLS-clear-objects
@@ -37,20 +43,32 @@ add_test (
image.gif
image24.gif
)
+set_tests_properties (HL_TOOLS-clear-objects PROPERTIES FIXTURES_SETUP clear_tools_hl)
-add_test (NAME HL_TOOLS_gif2h5 COMMAND $<TARGET_FILE:gif2h5> testfiles/image1.gif image1.h5)
-set_tests_properties (HL_TOOLS_gif2h5 PROPERTIES DEPENDS HL_TOOLS-clear-objects)
+add_test (NAME HL_TOOLS_gif2h5 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:gif2h5${tgt_ext}> testfiles/image1.gif image1.h5)
+set_tests_properties (HL_TOOLS_gif2h5 PROPERTIES
+ FIXTURES_REQUIRED clear_tools_hl
+)
-add_test (NAME HL_TOOLS_h52gif COMMAND $<TARGET_FILE:h52gif> testfiles/h52giftst.h5 image1.gif -i image)
-set_tests_properties (HL_TOOLS_h52gif PROPERTIES DEPENDS HL_TOOLS-clear-objects)
+add_test (NAME HL_TOOLS_h52gif COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_ext}> testfiles/h52giftst.h5 image1.gif -i image)
+set_tests_properties (HL_TOOLS_h52gif PROPERTIES
+ FIXTURES_REQUIRED clear_tools_hl
+)
-add_test (NAME HL_TOOLS_h52gif_none COMMAND $<TARGET_FILE:h52gif> testfiles/h52giftst.h5 image.gif -i nosuch_image)
-set_tests_properties (HL_TOOLS_h52gif_none PROPERTIES WILL_FAIL "true")
-set_tests_properties (HL_TOOLS_h52gif_none PROPERTIES DEPENDS HL_TOOLS-clear-objects)
+add_test (NAME HL_TOOLS_h52gif_none COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_ext}> testfiles/h52giftst.h5 image.gif -i nosuch_image)
+set_tests_properties (HL_TOOLS_h52gif_none PROPERTIES
+ WILL_FAIL "true"
+ FIXTURES_REQUIRED clear_tools_hl
+)
-#add_test (NAME HL_TOOLS_h52gifpal COMMAND $<TARGET_FILE:h52gif> testfiles/h52giftst.h5 image.gif -i palette)
-#set_tests_properties (HL_TOOLS_h52gifpal PROPERTIES WILL_FAIL "true")
+#add_test (NAME HL_TOOLS_h52gifpal COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_ext}> testfiles/h52giftst.h5 image.gif -i palette)
+#set_tests_properties (HL_TOOLS_h52gifpal PROPERTIES
+# WILL_FAIL "true"
+# FIXTURES_REQUIRED clear_tools_hl
+#)
-add_test (NAME HL_TOOLS_h52gif24bits COMMAND $<TARGET_FILE:h52gif> testfiles/ex_image2.h5 image24.gif -i image24bitpixel)
-set_tests_properties (HL_TOOLS_h52gif24bits PROPERTIES WILL_FAIL "true")
-set_tests_properties (HL_TOOLS_h52gif24bits PROPERTIES DEPENDS HL_TOOLS-clear-objects)
+add_test (NAME HL_TOOLS_h52gif24bits COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h52gif${tgt_ext}> testfiles/ex_image2.h5 image24.gif -i image24bitpixel)
+set_tests_properties (HL_TOOLS_h52gif24bits PROPERTIES
+ WILL_FAIL "true"
+ FIXTURES_REQUIRED clear_tools_hl
+)
diff --git a/hl/tools/gif2h5/Makefile.am b/hl/tools/gif2h5/Makefile.am
index d30d66a..9ffde58 100644
--- a/hl/tools/gif2h5/Makefile.am
+++ b/hl/tools/gif2h5/Makefile.am
@@ -23,11 +23,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/sr
# These are our main targets, the tools
-TEST_SCRIPT=h52giftest.sh
-check_SCRIPTS=$(TEST_SCRIPT)
-
bin_PROGRAMS=gif2h5 h52gif
-noinst_PROGRAMS=h52gifgentst
# Add h52gif and gif2h5 specific linker flags here
h52gif_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
@@ -37,12 +33,18 @@ gif2h5_SOURCES=gif2hdf.c gif2mem.c decompress.c gifread.c writehdf.c
h52gif_SOURCES=hdf2gif.c hdfgifwr.c
-h52gifgentst_SOURCES=h52gifgentst.c
# Programs all depend on the hdf5 library, the tools library, and the HL
# library.
LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5)
+if BUILD_TESTS_CONDITIONAL
+ TEST_SCRIPT=h52giftest.sh
+ check_SCRIPTS=$(TEST_SCRIPT)
+ noinst_PROGRAMS=h52gifgentst
+ h52gifgentst_SOURCES=h52gifgentst.c
+endif
+
CHECK_CLEANFILES+=*.h5
CHECK_CLEANFILES+=*.gif
diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in
index 18b4040..573bb47 100644
--- a/hl/tools/gif2h5/Makefile.in
+++ b/hl/tools/gif2h5/Makefile.in
@@ -104,7 +104,7 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = gif2h5$(EXEEXT) h52gif$(EXEEXT)
-noinst_PROGRAMS = h52gifgentst$(EXEEXT)
+@BUILD_TESTS_CONDITIONAL_TRUE@noinst_PROGRAMS = h52gifgentst$(EXEEXT)
TESTS = $(TEST_SCRIPT)
subdir = hl/tools/gif2h5
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -155,7 +155,9 @@ h52gif_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5)
h52gif_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(h52gif_LDFLAGS) $(LDFLAGS) -o $@
-am_h52gifgentst_OBJECTS = h52gifgentst.$(OBJEXT)
+am__h52gifgentst_SOURCES_DIST = h52gifgentst.c
+@BUILD_TESTS_CONDITIONAL_TRUE@am_h52gifgentst_OBJECTS = \
+@BUILD_TESTS_CONDITIONAL_TRUE@ h52gifgentst.$(OBJEXT)
h52gifgentst_OBJECTS = $(am_h52gifgentst_OBJECTS)
h52gifgentst_LDADD = $(LDADD)
h52gifgentst_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5)
@@ -195,7 +197,7 @@ am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(gif2h5_SOURCES) $(h52gif_SOURCES) $(h52gifgentst_SOURCES)
DIST_SOURCES = $(gif2h5_SOURCES) $(h52gif_SOURCES) \
- $(h52gifgentst_SOURCES)
+ $(am__h52gifgentst_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -499,7 +501,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -522,9 +523,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -551,6 +555,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -605,6 +610,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -629,7 +635,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -747,20 +752,18 @@ TRACE = perl $(top_srcdir)/bin/trace
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 *.gif
-# These are our main targets, the tools
-TEST_SCRIPT = h52giftest.sh
-check_SCRIPTS = $(TEST_SCRIPT)
-
# Add h52gif and gif2h5 specific linker flags here
h52gif_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
gif2h5_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
gif2h5_SOURCES = gif2hdf.c gif2mem.c decompress.c gifread.c writehdf.c
h52gif_SOURCES = hdf2gif.c hdfgifwr.c
-h52gifgentst_SOURCES = h52gifgentst.c
# Programs all depend on the hdf5 library, the tools library, and the HL
# library.
LDADD = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5)
+@BUILD_TESTS_CONDITIONAL_TRUE@TEST_SCRIPT = h52giftest.sh
+@BUILD_TESTS_CONDITIONAL_TRUE@check_SCRIPTS = $(TEST_SCRIPT)
+@BUILD_TESTS_CONDITIONAL_TRUE@h52gifgentst_SOURCES = h52gifgentst.c
# Automake needs to be taught how to build lib, progs and tests targets.
# These will be filled in automatically for the most part (e.g.,
@@ -1341,7 +1344,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c
index ec029ea..8fb575c 100644
--- a/hl/tools/gif2h5/gif2mem.c
+++ b/hl/tools/gif2h5/gif2mem.c
@@ -295,7 +295,8 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct)
fprintf(stderr,
"Error reading Graphic Control Extension information\n");
- if (!*MemGif++ == 0)
+ (*MemGif)++;
+ if ((!*MemGif) == 0)
fprintf(stderr,
"Error reading Graphic Control Extension\n");
diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt
index 1d1c341..b3d65f7 100644
--- a/hl/tools/h5watch/CMakeLists.txt
+++ b/hl/tools/h5watch/CMakeLists.txt
@@ -9,11 +9,22 @@ set (H5WATCH_SOURCES
)
#-- Add h5watch program
-add_executable (h5watch ${H5WATCH_SOURCES})
-target_include_directories(h5watch PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5watch STATIC)
-target_link_libraries (h5watch PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
-set_target_properties (h5watch PROPERTIES FOLDER tools/hl)
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h5watch ${H5WATCH_SOURCES})
+ target_include_directories (h5watch PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5watch STATIC)
+ target_link_libraries (h5watch PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ set_target_properties (h5watch PROPERTIES FOLDER tools/hl)
+ set (H5_DEP_EXECUTABLES h5watch)
+endif ()
+if (BUILD_SHARED_LIBS)
+ add_executable (h5watch-shared ${H5WATCH_SOURCES})
+ target_include_directories (h5watch-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5watch-shared SHARED)
+ target_link_libraries (h5watch-shared PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET})
+ set_target_properties (h5watch-shared PROPERTIES FOLDER tools/hl)
+ set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5watch-shared)
+endif ()
if (BUILD_TESTING)
#-- Add swmr_check_compat_vfd program
@@ -21,9 +32,14 @@ if (BUILD_TESTING)
${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/swmr_check_compat_vfd.c
)
add_executable (hl_swmr_check_compat_vfd ${hl_swmr_check_compat_vfd_SOURCES})
- target_include_directories(hl_swmr_check_compat_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (hl_swmr_check_compat_vfd STATIC)
- target_link_libraries (hl_swmr_check_compat_vfd PRIVATE ${HDF5_LIB_TARGET})
+ target_include_directories (hl_swmr_check_compat_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (hl_swmr_check_compat_vfd STATIC)
+ target_link_libraries (hl_swmr_check_compat_vfd PRIVATE ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (hl_swmr_check_compat_vfd SHARED)
+ target_link_libraries (hl_swmr_check_compat_vfd PRIVATE ${HDF5_LIBSH_TARGET})
+ endif ()
set_target_properties (hl_swmr_check_compat_vfd PROPERTIES FOLDER tools/hl)
#-- Add extend_dset program
@@ -31,15 +47,25 @@ if (BUILD_TESTING)
${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/extend_dset.c
)
add_executable (extend_dset ${extend_dset_SOURCES})
- target_include_directories(extend_dset PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (extend_dset STATIC)
- target_link_libraries (extend_dset PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_include_directories (extend_dset PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (extend_dset STATIC)
+ target_link_libraries (extend_dset PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (extend_dset SHARED)
+ target_link_libraries (extend_dset PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET})
+ endif ()
set_target_properties (extend_dset PROPERTIES FOLDER tools/hl)
add_executable (h5watchgentest ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watchgentest.c)
- target_include_directories(h5watchgentest PRIVATE "${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (h5watchgentest STATIC)
- target_link_libraries (h5watchgentest PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
+ target_include_directories (h5watchgentest PRIVATE "${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5watchgentest STATIC)
+ target_link_libraries (h5watchgentest PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (h5watchgentest SHARED)
+ target_link_libraries (h5watchgentest PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ endif ()
set_target_properties (h5watchgentest PROPERTIES FOLDER generator/tools/hl)
include (CMakeTests.cmake)
@@ -51,7 +77,7 @@ endif ()
if (HDF5_EXPORTED_TARGETS)
install (
TARGETS
- h5watch
+ ${H5_DEP_EXECUTABLES}
EXPORT
${HDF5_EXPORTED_TARGETS}
RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications
diff --git a/hl/tools/h5watch/CMakeTests.cmake b/hl/tools/h5watch/CMakeTests.cmake
index 13d5e47..0424140 100644
--- a/hl/tools/h5watch/CMakeTests.cmake
+++ b/hl/tools/h5watch/CMakeTests.cmake
@@ -68,12 +68,19 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_H5_TEST resultfile resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5WATCH_ARGS-h5watch-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5watch>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -81,7 +88,10 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5WATCH_ARGS-h5watch-${resultfile} PROPERTIES DEPENDS ${last_test})
+ set_tests_properties (H5WATCH_ARGS-h5watch-${resultfile} PROPERTIES
+ DEPENDS ${last_test}
+ FIXTURES_REQUIRED gen_test_watch
+ )
set (last_test "H5WATCH_ARGS-h5watch-${resultfile}")
endif ()
endmacro ()
@@ -91,7 +101,8 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes
add_test (
NAME H5WATCH_ARGS-h5watch-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5watch>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -100,7 +111,10 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes
-D "TEST_ERRREF=${resultfile}.err"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5WATCH_ARGS-h5watch-${resultfile} PROPERTIES DEPENDS ${last_test})
+ set_tests_properties (H5WATCH_ARGS-h5watch-${resultfile} PROPERTIES
+ DEPENDS ${last_test}
+ FIXTURES_REQUIRED gen_test_watch
+ )
set (last_test "H5WATCH_ARGS-h5watch-${resultfile}")
endif ()
endmacro ()
@@ -110,14 +124,14 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes
add_test (
NAME H5WATCH-${resultfile}-clear-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.h5
+ -E remove ${resultfile}.h5
)
set_tests_properties (H5WATCH-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
add_test (
NAME H5WATCH-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5watch>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5watch${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -125,7 +139,11 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes
-D "TEST_REFERENCE=${resultfile}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5WATCH-${resultfile} PROPERTIES DEPENDS H5WATCH-${resultfile}-clear-objects)
+ set_tests_properties (H5WATCH-${resultfile} PROPERTIES
+ DEPENDS H5WATCH-${resultfile}-clear-objects
+ FIXTURES_REQUIRED gen_test_watch
+ )
+ set (last_test "H5WATCH-${resultfile}")
endif ()
endmacro ()
@@ -143,11 +161,9 @@ if (NOT SWMR_INCOMPAT)
# Remove any output file left over from previous test run
add_test (
NAME H5WATCH-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- WATCH.h5
+ COMMAND ${CMAKE_COMMAND} -E remove WATCH.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5WATCH-clearall-objects PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "H5WATCH-clearall-objects")
@@ -172,9 +188,12 @@ if (NOT SWMR_INCOMPAT)
# #
#################################################################################################
# create the output files to be used.
- add_test (NAME H5WATCH-h5watchgentest COMMAND $<TARGET_FILE:h5watchgentest>)
- set_tests_properties (H5WATCH-h5watchgentest PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- set_tests_properties (H5WATCH-h5watchgentest PROPERTIES DEPENDS "H5WATCH-clearall-objects")
+ add_test (NAME H5WATCH-h5watchgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5watchgentest>)
+ set_tests_properties (H5WATCH-h5watchgentest PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS "H5WATCH-clearall-objects"
+ )
+ set_tests_properties (H5WATCH-h5watchgentest PROPERTIES FIXTURES_SETUP gen_test_watch)
set (last_test "H5WATCH-h5watchgentest")
# Test on --help options
diff --git a/hl/tools/h5watch/Makefile.am b/hl/tools/h5watch/Makefile.am
index c60fceb..0bf265e 100644
--- a/hl/tools/h5watch/Makefile.am
+++ b/hl/tools/h5watch/Makefile.am
@@ -19,15 +19,12 @@
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 -I$(top_srcdir)/hl/test
+AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src
# These are our main targets, the tools
-TEST_SCRIPT=testh5watch.sh
-check_SCRIPTS=$(TEST_SCRIPT)
-SCRIPT_DEPEND=swmr_check_compat_vfd$(EXEEXT) extend_dset$(EXEEXT) h5watch$(EXEEXT)
bin_PROGRAMS=h5watch
-noinst_PROGRAMS=swmr_check_compat_vfd h5watchgentest extend_dset
+noinst_PROGRAMS=swmr_check_compat_vfd
# Add h5watch specific linker flags here
h5watch_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
@@ -36,13 +33,19 @@ h5watch_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
# library.
LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5)
-# Add extend_dset specific preprocessor flags here
-# (add the main test subdirectory to the include file path)
-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) $(LIBHDF5)
-
+if BUILD_TESTS_CONDITIONAL
+ AM_CPPFLAGS+=-I$(top_srcdir)/hl/test
+ TEST_SCRIPT=testh5watch.sh
+ check_SCRIPTS=$(TEST_SCRIPT)
+ SCRIPT_DEPEND=swmr_check_compat_vfd$(EXEEXT) extend_dset$(EXEEXT) h5watch$(EXEEXT)
+ noinst_PROGRAMS+=h5watchgentest extend_dset
+ # Add extend_dset specific preprocessor flags here
+ # (add the main test subdirectory to the include file path)
+ 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) $(LIBHDF5)
+endif
#
CHECK_CLEANFILES+=*.h5
DISTCLEANFILES=testh5watch.sh
diff --git a/hl/tools/h5watch/Makefile.in b/hl/tools/h5watch/Makefile.in
index ffc0277..e5ac094 100644
--- a/hl/tools/h5watch/Makefile.in
+++ b/hl/tools/h5watch/Makefile.in
@@ -104,8 +104,9 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = h5watch$(EXEEXT)
-noinst_PROGRAMS = swmr_check_compat_vfd$(EXEEXT) \
- h5watchgentest$(EXEEXT) extend_dset$(EXEEXT)
+noinst_PROGRAMS = swmr_check_compat_vfd$(EXEEXT) $(am__EXEEXT_1)
+@BUILD_TESTS_CONDITIONAL_TRUE@am__append_1 = -I$(top_srcdir)/hl/test
+@BUILD_TESTS_CONDITIONAL_TRUE@am__append_2 = h5watchgentest extend_dset
TESTS = $(TEST_SCRIPT)
subdir = hl/tools/h5watch
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -136,10 +137,13 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h \
CONFIG_CLEAN_FILES = testh5watch.sh
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
+@BUILD_TESTS_CONDITIONAL_TRUE@am__EXEEXT_1 = h5watchgentest$(EXEEXT) \
+@BUILD_TESTS_CONDITIONAL_TRUE@ extend_dset$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
extend_dset_SOURCES = extend_dset.c
extend_dset_OBJECTS = extend_dset-extend_dset.$(OBJEXT)
-extend_dset_DEPENDENCIES = $(LDADD) $(LIBH5TEST) $(LIBHDF5)
+@BUILD_TESTS_CONDITIONAL_TRUE@extend_dset_DEPENDENCIES = $(LDADD) \
+@BUILD_TESTS_CONDITIONAL_TRUE@ $(LIBH5TEST) $(LIBHDF5)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
@@ -441,7 +445,7 @@ AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
# Include src and tools/lib directories
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \
-I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src \
- -I$(top_srcdir)/hl/test
+ $(am__append_1)
AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
@@ -502,7 +506,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -525,9 +528,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -554,6 +560,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -608,6 +615,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -632,7 +640,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -748,28 +755,20 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chkexe files are used to mark tests that have run successfully.
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
-
#
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5
-# These are our main targets, the tools
-TEST_SCRIPT = testh5watch.sh
-check_SCRIPTS = $(TEST_SCRIPT)
-SCRIPT_DEPEND = swmr_check_compat_vfd$(EXEEXT) extend_dset$(EXEEXT) h5watch$(EXEEXT)
-
# Add h5watch specific linker flags here
h5watch_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
# Programs all depend on the hdf5 library, the tools library, and the HL
# library.
LDADD = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5)
-
-# Add extend_dset specific preprocessor flags here
-# (add the main test subdirectory to the include file path)
-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) $(LIBHDF5)
+@BUILD_TESTS_CONDITIONAL_TRUE@TEST_SCRIPT = testh5watch.sh
+@BUILD_TESTS_CONDITIONAL_TRUE@check_SCRIPTS = $(TEST_SCRIPT)
+@BUILD_TESTS_CONDITIONAL_TRUE@SCRIPT_DEPEND = swmr_check_compat_vfd$(EXEEXT) extend_dset$(EXEEXT) h5watch$(EXEEXT)
+@BUILD_TESTS_CONDITIONAL_TRUE@extend_dset_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/test
+@BUILD_TESTS_CONDITIONAL_TRUE@extend_dset_LDADD = $(LDADD) $(LIBH5TEST) $(LIBHDF5)
DISTCLEANFILES = testh5watch.sh
# Automake needs to be taught how to build lib, progs and tests targets.
@@ -1330,6 +1329,10 @@ uninstall-am: uninstall-binPROGRAMS
help:
@$(top_srcdir)/bin/makehelp
+@BUILD_TESTS_CONDITIONAL_TRUE@ # Add extend_dset specific preprocessor flags here
+@BUILD_TESTS_CONDITIONAL_TRUE@ # (add the main test subdirectory to the include file path)
+@BUILD_TESTS_CONDITIONAL_TRUE@ # Add extend_dset specific library flags here
+@BUILD_TESTS_CONDITIONAL_TRUE@ # (add the main test library to the list of libraries)
# lib/progs/tests targets recurse into subdirectories. build-* targets
# build files in this directory.
@@ -1366,7 +1369,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt
index ffc3b94..56e1695 100644
--- a/java/CMakeLists.txt
+++ b/java/CMakeLists.txt
@@ -11,12 +11,12 @@ include (${HDF_RESOURCES_DIR}/UseJava.cmake)
message (STATUS "JAVA: JAVA_HOME=$ENV{JAVA_HOME} JAVA_ROOT=$ENV{JAVA_ROOT}")
find_package (JNI)
-message ("JNI_LIBRARIES=${JNI_LIBRARIES}")
-message ("JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}")
+message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}")
+message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}")
if (WIN32)
- set (HDF_JRE_DIRECTORY "C:/Program Files/Java/jre8")
+ set (HDF_JRE_DIRECTORY "C:/Program Files/Java/jre")
else ()
set (HDF_JRE_DIRECTORY "/usr/lib/jvm/jre")
endif ()
diff --git a/java/Makefile.am b/java/Makefile.am
index 7d0e2f0..68a6e47 100644
--- a/java/Makefile.am
+++ b/java/Makefile.am
@@ -23,13 +23,21 @@
include $(top_srcdir)/config/commence.am
+if BUILD_TESTS_CONDITIONAL
+ TESTSERIAL_DIR =test
+ TESTEXAMPLES_DIR =examples
+else
+ TESTSERIAL_DIR=
+ TESTEXAMPLES_DIR=
+endif
+
## Only recurse into subdirectories if the Java (JNI) interface is enabled.
if BUILD_JAVA_CONDITIONAL
# Mark this directory as part of the JNI API
JAVA_API=yes
-SUBDIRS=src test examples
+SUBDIRS=src $(TESTSERIAL_DIR) $(TESTEXAMPLES_DIR)
endif
diff --git a/java/Makefile.in b/java/Makefile.in
index 9a3ad25..f4d3304 100644
--- a/java/Makefile.in
+++ b/java/Makefile.in
@@ -489,7 +489,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -512,9 +511,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -541,6 +543,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -595,6 +598,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -619,7 +623,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -736,10 +739,14 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
+@BUILD_TESTS_CONDITIONAL_FALSE@TESTSERIAL_DIR =
+@BUILD_TESTS_CONDITIONAL_TRUE@TESTSERIAL_DIR = test
+@BUILD_TESTS_CONDITIONAL_FALSE@TESTEXAMPLES_DIR =
+@BUILD_TESTS_CONDITIONAL_TRUE@TESTEXAMPLES_DIR = examples
# Mark this directory as part of the JNI API
@BUILD_JAVA_CONDITIONAL_TRUE@JAVA_API = yes
-@BUILD_JAVA_CONDITIONAL_TRUE@SUBDIRS = src test examples
+@BUILD_JAVA_CONDITIONAL_TRUE@SUBDIRS = src $(TESTSERIAL_DIR) $(TESTEXAMPLES_DIR)
# Automake needs to be taught how to build lib, progs and tests targets.
# These will be filled in automatically for the most part (e.g.,
@@ -1272,7 +1279,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/java/examples/Makefile.in b/java/examples/Makefile.in
index a2f844e..d6f3f32 100644
--- a/java/examples/Makefile.in
+++ b/java/examples/Makefile.in
@@ -489,7 +489,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -512,9 +511,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -541,6 +543,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -595,6 +598,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -619,7 +623,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1269,7 +1272,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt
index 1375372..8849524 100644
--- a/java/examples/datasets/CMakeLists.txt
+++ b/java/examples/datasets/CMakeLists.txt
@@ -39,7 +39,7 @@ set (HDF_JAVA_SZIP_EXAMPLES
set (${HDF_JAVA_EXAMPLES} ${HDF_JAVA_EXAMPLES} ${HDF_JAVA_SZIP_EXAMPLES})
endif (H5_HAVE_FILTER_SZIP)
-if (WIN32)
+if (WIN32 OR MINGW)
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
else ()
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
@@ -71,60 +71,49 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH})
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}")
endforeach ()
-MACRO (ADD_H5_TEST resultfile resultcode)
- set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$<TARGET_PROPERTY:${HDF5_JAVA_JNI_LIB_TARGET},OUTPUT_NAME$<$<CONFIG:Debug>:_DEBUG>>;")
- add_test (
- NAME JAVA_datasets-${resultfile}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
- -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${resultfile}_JAR_FILE}"
- -D "TEST_ARGS:STRING=${CMD_ARGS}${ARGN}"
- -D "TEST_PROGRAM=examples.datasets.${resultfile}"
- -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
- -D "TEST_FOLDER=${HDFJAVA_EXAMPLES_BINARY_DIR}"
- -D "TEST_OUTPUT=datasets/${resultfile}.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=datasets/${resultfile}.txt"
- -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (JAVA_datasets-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "JAVA_datasets-${resultfile}")
-ENDMACRO ()
-
if (BUILD_TESTING)
+ get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
+ set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
foreach (example ${HDF_JAVA_EXAMPLES})
- if ("${example}" STREQUAL "H5Ex_D_External")
+ if (example STREQUAL "H5Ex_D_External")
add_test (
NAME JAVA_datasets-${example}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.data
)
else ()
add_test (
NAME JAVA_datasets-${example}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
+ COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
)
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (JAVA_datasets-${example}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+
add_test (
NAME JAVA_datasets-${example}-copy-objects
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
${HDFJAVA_EXAMPLES_SOURCE_DIR}/testfiles/examples.datasets.${example}.txt
${HDFJAVA_EXAMPLES_DATASETS_BINARY_DIR}/${example}.txt
)
set_tests_properties (JAVA_datasets-${example}-copy-objects PROPERTIES DEPENDS JAVA_datasets-${example}-clear-objects)
- set (last_test "JAVA_datasets-${example}-copy-objects")
- ADD_H5_TEST (${example} 0)
+ add_test (
+ NAME JAVA_datasets-${example}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
+ -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${example}_JAR_FILE}"
+ -D "TEST_ARGS:STRING=${CMD_ARGS}"
+ -D "TEST_PROGRAM=examples.datasets.${example}"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
+ -D "TEST_FOLDER=${HDFJAVA_EXAMPLES_BINARY_DIR}"
+ -D "TEST_OUTPUT=datasets/${example}.out"
+ -D "TEST_EXPECT=0"
+ -D "TEST_REFERENCE=datasets/${example}.txt"
+ -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
+ )
+ set_tests_properties (JAVA_datasets-${example} PROPERTIES
+ DEPENDS JAVA_datasets-${example}-copy-objects
+ )
endforeach ()
endif ()
diff --git a/java/examples/datasets/Makefile.in b/java/examples/datasets/Makefile.in
index e7a420c..fafd5c4 100644
--- a/java/examples/datasets/Makefile.in
+++ b/java/examples/datasets/Makefile.in
@@ -429,7 +429,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -452,9 +451,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -481,6 +483,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -535,6 +538,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -559,7 +563,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1150,7 +1153,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt
index 4a8b2a4..b83da0e 100644
--- a/java/examples/datatypes/CMakeLists.txt
+++ b/java/examples/datatypes/CMakeLists.txt
@@ -24,7 +24,7 @@ set (HDF_JAVA_EXAMPLES
H5Ex_T_VLString
)
-if (WIN32)
+if (WIN32 OR MINGW)
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
else ()
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
@@ -56,48 +56,39 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH})
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}")
endforeach ()
-MACRO (ADD_H5_TEST resultfile resultcode)
- set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$<TARGET_PROPERTY:${HDF5_JAVA_JNI_LIB_TARGET},OUTPUT_NAME$<$<CONFIG:Debug>:_DEBUG>>;")
- add_test (
- NAME JAVA_datatypes-${resultfile}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
- -D "TEST_PROGRAM=examples.datatypes.${resultfile}"
- -D "TEST_ARGS:STRING=${CMD_ARGS}${ARGN}"
- -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${resultfile}_JAR_FILE}"
- -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
- -D "TEST_FOLDER=${HDFJAVA_EXAMPLES_BINARY_DIR}"
- -D "TEST_OUTPUT=datatypes/${resultfile}.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=datatypes/${resultfile}.txt"
- -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (JAVA_datatypes-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "JAVA_datatypes-${resultfile}")
-ENDMACRO ()
-
if (BUILD_TESTING)
+ get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
+ set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
+
foreach (example ${HDF_JAVA_EXAMPLES})
add_test (
NAME JAVA_datatypes-${example}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
+ COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (JAVA_datatypes-${example}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+
add_test (
NAME JAVA_datatypes-${example}-copy-objects
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
${HDFJAVA_EXAMPLES_SOURCE_DIR}/testfiles/examples.datatypes.${example}.txt
${HDFJAVA_EXAMPLES_DATATYPES_BINARY_DIR}/${example}.txt
)
set_tests_properties (JAVA_datatypes-${example}-copy-objects PROPERTIES DEPENDS JAVA_datatypes-${example}-clear-objects)
- set (last_test "JAVA_datatypes-${example}-copy-objects")
- ADD_H5_TEST (${example} 0)
+ add_test (
+ NAME JAVA_datatypes-${example}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
+ -D "TEST_PROGRAM=examples.datatypes.${example}"
+ -D "TEST_ARGS:STRING=${CMD_ARGS}"
+ -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${example}_JAR_FILE}"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
+ -D "TEST_FOLDER=${HDFJAVA_EXAMPLES_BINARY_DIR}"
+ -D "TEST_OUTPUT=datatypes/${example}.out"
+ -D "TEST_EXPECT=0"
+ -D "TEST_REFERENCE=datatypes/${example}.txt"
+ -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
+ )
+ set_tests_properties (JAVA_datatypes-${example} PROPERTIES
+ DEPENDS JAVA_datatypes-${example}-copy-objects
+ )
endforeach ()
endif ()
diff --git a/java/examples/datatypes/Makefile.in b/java/examples/datatypes/Makefile.in
index ed8988e..3ee713e 100644
--- a/java/examples/datatypes/Makefile.in
+++ b/java/examples/datatypes/Makefile.in
@@ -429,7 +429,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -452,9 +451,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -481,6 +483,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -535,6 +538,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -559,7 +563,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1150,7 +1153,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt
index 2c5d33b..9e43087 100644
--- a/java/examples/groups/CMakeLists.txt
+++ b/java/examples/groups/CMakeLists.txt
@@ -13,7 +13,7 @@ set (HDF_JAVA_EXAMPLES
H5Ex_G_Visit
)
-if (WIN32)
+if (WIN32 OR MINGW)
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
else ()
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
@@ -55,63 +55,55 @@ foreach (h5_file ${HDF_JAVA_TEST_FILES})
endforeach ()
add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G_Visit tests" DEPENDS ${H5Ex_G_Visit_files_list})
-MACRO (ADD_H5_TEST resultfile resultcode)
- set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$<TARGET_PROPERTY:${HDF5_JAVA_JNI_LIB_TARGET},OUTPUT_NAME$<$<CONFIG:Debug>:_DEBUG>>;")
- add_test (
- NAME JAVA_groups-${resultfile}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
- -D "TEST_PROGRAM=examples.groups.${resultfile}"
- -D "TEST_ARGS:STRING=${CMD_ARGS}${ARGN}"
- -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${resultfile}_JAR_FILE}"
- -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
- -D "TEST_FOLDER=${HDFJAVA_EXAMPLES_BINARY_DIR}"
- -D "TEST_OUTPUT=groups/${resultfile}.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=groups/${resultfile}.txt"
- -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (JAVA_groups-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "JAVA_groups-${resultfile}")
-ENDMACRO ()
-
if (BUILD_TESTING)
+ get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
+ set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
+
foreach (example ${HDF_JAVA_EXAMPLES})
- if (NOT "${example}" STREQUAL "H5Ex_G_Iterate" AND NOT "${example}" STREQUAL "H5Ex_G_Visit")
- if ("${example}" STREQUAL "H5Ex_G_Compact")
+ if (NOT example STREQUAL "H5Ex_G_Iterate" AND NOT example STREQUAL "H5Ex_G_Visit")
+ if (example STREQUAL "H5Ex_G_Compact")
add_test (
- NAME JAVA_groups-${example}-clear-h5s
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ NAME JAVA_groups-${example}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}1.h5
${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}2.h5
)
else ()
add_test (
- NAME JAVA_groups-${example}-clear-h5s
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
+ NAME JAVA_groups-${example}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
)
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (JAVA_groups-${example}-clear-h5s PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "JAVA_groups-${example}-clear-h5s")
+ else ()
+ add_test (
+ NAME JAVA_groups-${example}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E echo "${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 exists"
+ )
endif ()
+
add_test (
NAME JAVA_groups-${example}-copy-objects
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
${HDFJAVA_EXAMPLES_SOURCE_DIR}/testfiles/examples.groups.${example}.txt
${HDFJAVA_EXAMPLES_GROUPS_BINARY_DIR}/${example}.txt
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (JAVA_groups-${example}-copy-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "JAVA_groups-${example}-copy-objects")
- ADD_H5_TEST (${example} 0)
+ set_tests_properties (JAVA_groups-${example}-copy-objects PROPERTIES DEPENDS JAVA_groups-${example}-clear-objects)
+ add_test (
+ NAME JAVA_groups-${example}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
+ -D "TEST_PROGRAM=examples.groups.${example}"
+ -D "TEST_ARGS:STRING=${CMD_ARGS}"
+ -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${example}_JAR_FILE}"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
+ -D "TEST_FOLDER=${HDFJAVA_EXAMPLES_BINARY_DIR}"
+ -D "TEST_OUTPUT=groups/${example}.out"
+ -D "TEST_EXPECT=0"
+ -D "TEST_REFERENCE=groups/${example}.txt"
+ -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
+ )
+ set_tests_properties (JAVA_groups-${example} PROPERTIES
+ DEPENDS JAVA_groups-${example}-copy-objects
+ )
endforeach ()
endif ()
diff --git a/java/examples/groups/JavaGroupExample.sh.in b/java/examples/groups/JavaGroupExample.sh.in
index 9d4673f..acc606f 100644
--- a/java/examples/groups/JavaGroupExample.sh.in
+++ b/java/examples/groups/JavaGroupExample.sh.in
@@ -179,17 +179,9 @@ COPY_DATAFILES_TO_BLDDIR()
CLEAN_DATAFILES_AND_BLDDIR()
{
- $RM $BLDDIR/examples.groups.H5Ex_G_*.txt
- $RM $BLDDIR/H5Ex_G_*.out
- $RM $BLDDIR/H5Ex_G_*.h5
- $RM $BLDDIR/h5ex_g_*.h5
- SDIR=`$DIRNAME $tstfile`
- INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
- INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'`
- if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then SDIR=`$DIRNAME $tstfile`
- $RM $BLDDIR/h5ex_g_iterate.h5
- $RM $BLDDIR/h5ex_g_visit.h5
- fi
+ $RM $BLDDIR/examples.groups.H5Ex_G_*.txt
+ $RM $BLDDIR/H5Ex_G_*.out
+ $RM $BLDDIR/H5Ex_G_*.h5
}
COPY_ITERFILES="$LIST_ITER_FILES"
diff --git a/java/examples/groups/Makefile.in b/java/examples/groups/Makefile.in
index d2b2ff9..115d92a 100644
--- a/java/examples/groups/Makefile.in
+++ b/java/examples/groups/Makefile.in
@@ -429,7 +429,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -452,9 +451,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -481,6 +483,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -535,6 +538,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -559,7 +563,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1139,7 +1142,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt
index 8d56b86..b56e3ad 100644
--- a/java/examples/intro/CMakeLists.txt
+++ b/java/examples/intro/CMakeLists.txt
@@ -13,7 +13,7 @@ set (HDF_JAVA_EXAMPLES
H5_ReadWrite
)
-if (WIN32)
+if (WIN32 OR MINGW)
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
else ()
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
@@ -45,62 +45,41 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH})
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}")
endforeach ()
-foreach (example ${HDF_JAVA_OBJECT_EXAMPLES})
- file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt
- "Main-Class: examples.intro.${example}
-"
- )
- add_jar (${example} MANIFEST ${PROJECT_BINARY_DIR}/${example}_Manifest.txt ${example}.java)
- get_target_property (${example}_JAR_FILE ${example} JAR_FILE)
-# install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples)
- get_target_property (${example}_CLASSPATH ${example} CLASSDIR)
- add_dependencies (${example} ${HDFJAVA_H5_LIB_TARGET})
-endforeach ()
-
-MACRO (ADD_H5_TEST resultfile resultcode)
- set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$<TARGET_PROPERTY:${HDF5_JAVA_JNI_LIB_TARGET},OUTPUT_NAME$<$<CONFIG:Debug>:_DEBUG>>;")
- add_test (
- NAME JAVA_intro-${resultfile}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
- -D "TEST_PROGRAM=examples.intro.${resultfile}"
- -D "TEST_ARGS:STRING=${CMD_ARGS}${ARGN}"
- -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${resultfile}_JAR_FILE}"
- -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
- -D "TEST_FOLDER=${HDFJAVA_EXAMPLES_BINARY_DIR}"
- -D "TEST_OUTPUT=intro/${resultfile}.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=intro/${resultfile}.txt"
- -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (JAVA_intro-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "JAVA_intro-${resultfile}")
-ENDMACRO ()
-
if (BUILD_TESTING)
+ get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
+ set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
foreach (example ${HDF_JAVA_EXAMPLES})
add_test (
NAME JAVA_intro-${example}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
+ COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (JAVA_intro-${example}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+
add_test (
NAME JAVA_intro-${example}-copy-objects
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
${HDFJAVA_EXAMPLES_SOURCE_DIR}/testfiles/examples.intro.${example}.txt
${HDFJAVA_EXAMPLES_INTRO_BINARY_DIR}/${example}.txt
)
set_tests_properties (JAVA_intro-${example}-copy-objects PROPERTIES DEPENDS JAVA_intro-${example}-clear-objects)
- set (last_test "JAVA_intro-${example}-copy-objects")
- ADD_H5_TEST (${example} 0)
+
+ add_test (
+ NAME JAVA_intro-${example}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
+ -D "TEST_PROGRAM=examples.intro.${example}"
+ -D "TEST_ARGS:STRING=${CMD_ARGS}"
+ -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${example}_JAR_FILE}"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
+ -D "TEST_FOLDER=${HDFJAVA_EXAMPLES_BINARY_DIR}"
+ -D "TEST_OUTPUT=intro/${example}.out"
+ -D "TEST_EXPECT=0"
+ -D "TEST_REFERENCE=intro/${example}.txt"
+ -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
+ )
+ set_tests_properties (JAVA_intro-${example} PROPERTIES
+ DEPENDS JAVA_intro-${example}-copy-objects
+ )
endforeach ()
endif ()
diff --git a/java/examples/intro/Makefile.in b/java/examples/intro/Makefile.in
index f7a424c..e4dc0da 100644
--- a/java/examples/intro/Makefile.in
+++ b/java/examples/intro/Makefile.in
@@ -429,7 +429,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -452,9 +451,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -481,6 +483,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -535,6 +538,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -559,7 +563,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1139,7 +1142,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/java/src/Makefile.am b/java/src/Makefile.am
index bd55c39..fcdeae9 100644
--- a/java/src/Makefile.am
+++ b/java/src/Makefile.am
@@ -98,6 +98,8 @@ hdf5_java_JAVA = \
${pkgpath}/structs/H5A_info_t.java \
${pkgpath}/structs/H5E_error2_t.java \
${pkgpath}/structs/H5F_info2_t.java \
+ ${pkgpath}/structs/H5FD_hdfs_fapl_t.java \
+ ${pkgpath}/structs/H5FD_ros3_fapl_t.java \
${pkgpath}/structs/H5G_info_t.java \
${pkgpath}/structs/H5L_info_t.java \
${pkgpath}/structs/H5O_info_t.java \
diff --git a/java/src/Makefile.in b/java/src/Makefile.in
index 4c5f8df..fda8e3d 100644
--- a/java/src/Makefile.in
+++ b/java/src/Makefile.in
@@ -320,7 +320,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -343,9 +342,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -372,6 +374,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -426,6 +429,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -450,7 +454,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -633,6 +636,8 @@ hdf5_java_JAVA = \
${pkgpath}/structs/H5A_info_t.java \
${pkgpath}/structs/H5E_error2_t.java \
${pkgpath}/structs/H5F_info2_t.java \
+ ${pkgpath}/structs/H5FD_hdfs_fapl_t.java \
+ ${pkgpath}/structs/H5FD_ros3_fapl_t.java \
${pkgpath}/structs/H5G_info_t.java \
${pkgpath}/structs/H5L_info_t.java \
${pkgpath}/structs/H5O_info_t.java \
diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt
index c171ea8..be8f60a 100644
--- a/java/src/hdf/hdf5lib/CMakeLists.txt
+++ b/java/src/hdf/hdf5lib/CMakeLists.txt
@@ -73,6 +73,8 @@ set (HDF5_JAVA_HDF_HDF5_STRUCTS_SOURCES
structs/H5AC_cache_config_t.java
structs/H5E_error2_t.java
structs/H5F_info2_t.java
+ structs/H5FD_ros3_fapl_t.java
+ structs/H5FD_hdfs_fapl_t.java
structs/H5G_info_t.java
structs/H5L_info_t.java
structs/H5O_hdr_info_t.java
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index 255a8ec..2a76b89 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -50,6 +50,8 @@ import hdf.hdf5lib.structs.H5AC_cache_config_t;
import hdf.hdf5lib.structs.H5A_info_t;
import hdf.hdf5lib.structs.H5E_error2_t;
import hdf.hdf5lib.structs.H5F_info2_t;
+import hdf.hdf5lib.structs.H5FD_hdfs_fapl_t;
+import hdf.hdf5lib.structs.H5FD_ros3_fapl_t;
import hdf.hdf5lib.structs.H5G_info_t;
import hdf.hdf5lib.structs.H5L_info_t;
import hdf.hdf5lib.structs.H5O_info_t;
@@ -212,7 +214,7 @@ import hdf.hdf5lib.structs.H5O_info_t;
* exception handlers to print out the HDF-5 error stack.
* <hr>
*
- * @version HDF5 1.10.5 <BR>
+ * @version HDF5 1.10.6 <BR>
* <b>See also: <a href ="./hdf.hdf5lib.HDFArray.html"> hdf.hdf5lib.HDFArray</a> </b><BR>
* <a href ="./hdf.hdf5lib.HDF5Constants.html"> hdf.hdf5lib.HDF5Constants</a><BR>
* <a href ="./hdf.hdf5lib.HDF5CDataTypes.html"> hdf.hdf5lib.HDF5CDataTypes</a><BR>
@@ -235,7 +237,7 @@ public class H5 implements java.io.Serializable {
*
* Make sure to update the versions number when a different library is used.
*/
- public final static int LIB_VERSION[] = { 1, 10, 5 };
+ public final static int LIB_VERSION[] = { 1, 10, 6 };
public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib";
@@ -3214,6 +3216,8 @@ public class H5 implements java.io.Serializable {
* @param file_id
* IN: Identifier of the target file.
*
+ * @return true if the file-level is set to create minimized dataset object headers, false if not.
+ *
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
@@ -5004,10 +5008,9 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native void H5Orefresh(long object_id) throws HDF5LibraryException;
- // /////// unimplemented ////////
- // herr_t H5Odisable_mdc_flushes(hid_t object_id);
- // herr_t H5Oenable_mdc_flushes(hid_t object_id);
- // herr_t H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled);
+ public synchronized static native void H5Odisable_mdc_flushes(long object_id);
+ public synchronized static native void H5Oenable_mdc_flushes(long object_id);
+ public synchronized static native boolean H5Oare_mdc_flushes_disabled(long object_id);
// ////////////////////////////////////////////////////////////
// //
@@ -6945,6 +6948,8 @@ public class H5 implements java.io.Serializable {
* @param dcpl_id
* IN: Dataset creation property list
*
+ * @return true if the given dcpl is set to create minimized dataset object headers, false if not.
+ *
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
@@ -7756,6 +7761,10 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_fapl_family(long fapl_id, long memb_size, long memb_fapl_id)
throws HDF5LibraryException, NullPointerException;
+ public synchronized static native int H5Pset_fapl_hdfs(long fapl_id, H5FD_hdfs_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException;
+
+ public synchronized static native H5FD_hdfs_fapl_t H5Pget_fapl_hdfs(long fapl_id) throws HDF5LibraryException, NullPointerException;
+
/**
* H5Pget_fapl_multi Sets up use of the multi I/O driver.
*
@@ -7840,6 +7849,10 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_fapl_windows(long fapl_id) throws HDF5LibraryException, NullPointerException;
+ public synchronized static native int H5Pset_fapl_ros3(long fapl_id, H5FD_ros3_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException;
+
+ public synchronized static native H5FD_ros3_fapl_t H5Pget_fapl_ros3(long fapl_id) throws HDF5LibraryException, NullPointerException;
+
// /////// unimplemented ////////
// Generic property list routines //
diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java
index 7eddac0..3f8e5d1 100644
--- a/java/src/hdf/hdf5lib/HDF5Constants.java
+++ b/java/src/hdf/hdf5lib/HDF5Constants.java
@@ -238,6 +238,8 @@ public class HDF5Constants {
public static final long H5FD_SEC2 = H5FD_SEC2();
public static final long H5FD_STDIO = H5FD_STDIO();
public static final long H5FD_WINDOWS = H5FD_WINDOWS();
+ public static final long H5FD_ROS3 = H5FD_ROS3();
+ public static final long H5FD_HDFS = H5FD_HDFS();
public static final int H5FD_LOG_LOC_READ = H5FD_LOG_LOC_READ();
public static final int H5FD_LOG_LOC_WRITE = H5FD_LOG_LOC_WRITE();
public static final int H5FD_LOG_LOC_SEEK = H5FD_LOG_LOC_SEEK();
@@ -1072,6 +1074,10 @@ public class HDF5Constants {
private static native final long H5FD_WINDOWS();
+ private static native final long H5FD_ROS3();
+
+ private static native final long H5FD_HDFS();
+
private static native final int H5FD_LOG_LOC_READ();
private static native final int H5FD_LOG_LOC_WRITE();
diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java
index 3a1361a..17a81e9 100644
--- a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java
+++ b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java
@@ -262,7 +262,7 @@ public class HDF5LibraryException extends HDF5Exception {
return "unrecognized message";
}
else if (err_code == HDF5Constants.H5E_CANTDELETE) {
- return " Can't delete message";
+ return "Can't delete message";
}
else if (err_code == HDF5Constants.H5E_CANTOPENOBJ) {
return "Can't open object";
diff --git a/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java
new file mode 100644
index 0000000..9fcff2e
--- /dev/null
+++ b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java
@@ -0,0 +1,102 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Read-Only HDFS Virtual File Driver (VFD) *
+ * Copyright (c) 2018, The HDF Group. *
+ * *
+ * All rights reserved. *
+ * *
+ * NOTICE: *
+ * All information contained herein is, and remains, the property of The HDF *
+ * Group. The intellectual and technical concepts contained herein are *
+ * proprietary to The HDF Group. Dissemination of this information or *
+ * reproduction of this material is strictly forbidden unless prior written *
+ * permission is obtained from The HDF Group. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package hdf.hdf5lib.structs;
+
+import java.io.Serializable;
+
+/*
+ * Java representation of the HDFS VFD file access property list (fapl)
+ * structure.
+ *
+ * Used for the access of files hosted on the Hadoop Distributed File System.
+ */
+
+public class H5FD_hdfs_fapl_t implements Serializable {
+ private static final long serialVersionUID = 2072473407027648309L;
+
+ private int version;
+ private String namenode_name;
+ private int namenode_port;
+ private String user_name;
+ private String kerberos_ticket_cache;
+ private int stream_buffer_size;
+
+ /*
+ * Create a fapl_t structure with the specified components.
+ */
+ public H5FD_hdfs_fapl_t(
+ String namenode_name,
+ int namenode_port,
+ String user_name,
+ String kerberos_ticket_cache,
+ int stream_buffer_size)
+ {
+ this.version = 1;
+ this.namenode_name = namenode_name;
+ this.namenode_port = namenode_port;
+ this.user_name = user_name;
+ this.kerberos_ticket_cache = kerberos_ticket_cache;
+ this.stream_buffer_size = stream_buffer_size;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == null)
+ return false;
+ if (!(o instanceof H5FD_hdfs_fapl_t))
+ return false;
+
+ H5FD_hdfs_fapl_t other = (H5FD_hdfs_fapl_t)o;
+ if (this.version != other.version)
+ return false;
+ if (!this.namenode_name.equals(other.namenode_name))
+ return false;
+ if (this.namenode_port != other.namenode_port)
+ return false;
+ if (!this.user_name.equals(other.user_name))
+ return false;
+ if (!this.kerberos_ticket_cache.equals(other.kerberos_ticket_cache))
+ return false;
+ if (this.stream_buffer_size != other.stream_buffer_size)
+ return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ /* this is a _very bad_ hash algorithm for purposes of hashing! */
+ /* implemented to satisfy the "contract" regarding equality */
+ int k = (int)this.version;
+ k += this.namenode_name.length();
+ k += this.user_name.length();
+ k += this.kerberos_ticket_cache.length();
+ k += namenode_port;
+ k += stream_buffer_size;
+ return k;
+ }
+
+ @Override
+ public String toString() {
+ return "H5FD_hdfs_fapl_t (Version: " + this.version + ") {" +
+ "\n namenode_name: '" + this.namenode_name +
+ "'\n namenode_port: " + this.namenode_port +
+ "\n user_name: '" + this.user_name +
+ "'\n kerberos_ticket_cache: '" + this.kerberos_ticket_cache +
+ "'\n stream_buffer_size: " + this.stream_buffer_size +
+ "\n}\n";
+ }
+}
+
+
diff --git a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java
new file mode 100644
index 0000000..a899e10
--- /dev/null
+++ b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java
@@ -0,0 +1,123 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Read-Only S3 Virtual File Driver (VFD) *
+ * Copyright (c) 2017-2018, The HDF Group. *
+ * *
+ * All rights reserved. *
+ * *
+ * NOTICE: *
+ * All information contained herein is, and remains, the property of The HDF *
+ * Group. The intellectual and technical concepts contained herein are *
+ * proprietary to The HDF Group. Dissemination of this information or *
+ * reproduction of this material is strictly forbidden unless prior written *
+ * permission is obtained from The HDF Group. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package hdf.hdf5lib.structs;
+
+import java.io.Serializable;
+
+/*
+ * Java representation of the ROS3 VFD file access property list (fapl)
+ * structure.
+ *
+ * Used for the access of files hosted remotely on S3 by Amazon.
+ *
+ * For simplicity, implemented assuming that all ROS3 fapls have components:
+ * - version
+ * - authenticate
+ * - aws_region
+ * - secret_id
+ * - secret_key
+ *
+ * Future implementations may be created to enable different fapl "shapes"
+ * depending on provided version.
+ *
+ * proposed:
+ *
+ * H5FD_ros3_fapl_t (super class, has only version field)
+ * H5FD_ros3_fapl_v1_t (extends super with Version 1 components)
+ * H5FD_ros3_fapl_v2_t (extends super with Version 2 components)
+ * and so on, for each version
+ *
+ * "super" is passed around, and is version-checked and re-cast as
+ * appropriate
+ */
+
+public class H5FD_ros3_fapl_t implements Serializable {
+ private static final long serialVersionUID = 8985533001471224030L;
+
+ private int version;
+ private boolean authenticate;
+ private String aws_region;
+ private String secret_id;
+ private String secret_key;
+
+ /**
+ * Create a "default" fapl_t structure, for anonymous access.
+ */
+ public H5FD_ros3_fapl_t () {
+ /* H5FD_ros3_fapl_t("", "", ""); */ /* defer */
+ this.version = 1;
+ this.aws_region = "";
+ this.secret_id = "";
+ this.secret_key = "";
+ }
+
+ /**
+ * Create a fapl_t structure with the specified components.
+ * If all are the empty string, is anonymous (non-authenticating).
+ * Region and ID must both be supplied for authentication.
+ *
+ * @param region "aws region" for authenticating request
+ * @param id "secret id" or "access id" for authenticating request
+ * @param key "secret key" or "access key" for authenticating request
+ */
+ public H5FD_ros3_fapl_t (String region, String id, String key) {
+ this.version = 1; /* must equal H5FD_CURR_ROS3_FAPL_T_VERSION */
+ /* as found in H5FDros3.h */
+ this.aws_region = region;
+ this.secret_id = id;
+ this.secret_key = key;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == null)
+ return false;
+ if (!(o instanceof H5FD_ros3_fapl_t))
+ return false;
+
+ H5FD_ros3_fapl_t other = (H5FD_ros3_fapl_t)o;
+ if (this.version != other.version)
+ return false;
+ if (!this.aws_region.equals(other.aws_region))
+ return false;
+ if (!this.secret_key.equals(other.secret_key))
+ return false;
+ if (!this.secret_id.equals(other.secret_id))
+ return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ /* this is a _very bad_ hash algorithm for purposes of hashing! */
+ /* implemented to satisfy the "contract" regarding equality */
+ int k = (int)this.version;
+ k += this.aws_region.length();
+ k += this.secret_id.length();
+ k += this.secret_key.length();
+ return k;
+ }
+
+ @Override
+ public String toString() {
+ return "H5FD_ros3_fapl_t (Version:" + this.version + ") {" +
+ "\n aws_region : " + this.aws_region +
+ "\n secret_id : " + this.secret_id +
+ "\n secret_key : " + this.secret_key +
+ "\n}\n";
+ }
+}
+
+
diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt
index ca48fa6..366f091 100644
--- a/java/src/jni/CMakeLists.txt
+++ b/java/src/jni/CMakeLists.txt
@@ -74,8 +74,8 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
########### JNI libraries always must be built shared ###############
add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JAVA_JNI_CHDRS})
-target_include_directories(${HDF5_JAVA_JNI_LIB_TARGET}
- PRIVATE "${HDF5_BINARY_DIR};${HDF5_JAVA_JNI_SOURCE_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+target_include_directories (${HDF5_JAVA_JNI_LIB_TARGET}
+ PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_JAVA_JNI_SOURCE_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED)
target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
diff --git a/java/src/jni/Makefile.in b/java/src/jni/Makefile.in
index 76eec4e..06eb05c 100644
--- a/java/src/jni/Makefile.in
+++ b/java/src/jni/Makefile.in
@@ -491,7 +491,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -514,9 +513,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -543,6 +545,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -597,6 +600,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -621,7 +625,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -738,29 +741,29 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-LT_VERS_INTERFACE = 104
+LT_VERS_INTERFACE = 105
LT_VERS_REVISION = 0
-LT_VERS_AGE = 1
-LT_CXX_VERS_INTERFACE = 104
+LT_VERS_AGE = 2
+LT_CXX_VERS_INTERFACE = 105
LT_CXX_VERS_REVISION = 0
-LT_CXX_VERS_AGE = 1
+LT_CXX_VERS_AGE = 2
LT_F_VERS_INTERFACE = 102
-LT_F_VERS_REVISION = 0
+LT_F_VERS_REVISION = 1
LT_F_VERS_AGE = 0
LT_HL_VERS_INTERFACE = 101
-LT_HL_VERS_REVISION = 2
+LT_HL_VERS_REVISION = 3
LT_HL_VERS_AGE = 1
LT_HL_CXX_VERS_INTERFACE = 101
-LT_HL_CXX_VERS_REVISION = 3
+LT_HL_CXX_VERS_REVISION = 4
LT_HL_CXX_VERS_AGE = 1
LT_HL_F_VERS_INTERFACE = 100
-LT_HL_F_VERS_REVISION = 4
+LT_HL_F_VERS_REVISION = 5
LT_HL_F_VERS_AGE = 0
LT_JAVA_VERS_INTERFACE = 104
-LT_JAVA_VERS_REVISION = 0
+LT_JAVA_VERS_REVISION = 1
LT_JAVA_VERS_AGE = 4
LT_TOOLS_VERS_INTERFACE = 101
-LT_TOOLS_VERS_REVISION = 2
+LT_TOOLS_VERS_REVISION = 3
LT_TOOLS_VERS_AGE = 1
# Mark this directory as part of the JNI API
@@ -1352,7 +1355,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c
index 1ea549e..f9b0cfd 100644
--- a/java/src/jni/h5Constants.c
+++ b/java/src/jni/h5Constants.c
@@ -438,6 +438,14 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1DIRECT(JNIEnv *env, jclass cls) {
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5FD_1FAMILY(JNIEnv *env, jclass cls) { return H5FD_FAMILY; }
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5FD_1HDFS(JNIEnv *env, jclass cls) {
+#ifdef H5_HAVE_LIBHDFS
+ return H5FD_HDFS;
+#else
+ return -1;
+#endif
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG(JNIEnv *env, jclass cls) { return H5FD_LOG; }
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5FD_1MPIO(JNIEnv *env, jclass cls) { return H5FD_MPIO; }
@@ -446,6 +454,14 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1MULTI(JNIEnv *env, jclass cls) { return H5F
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5FD_1SEC2(JNIEnv *env, jclass cls) { return H5FD_SEC2; }
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5FD_1ROS3(JNIEnv *env, jclass cls) {
+#ifdef H5_HAVE_ROS3_VFD
+ return H5FD_ROS3;
+#else
+ return -1;
+#endif
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5FD_1STDIO(JNIEnv *env, jclass cls) { return H5FD_STDIO; }
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5FD_1WINDOWS(JNIEnv *env, jclass cls) {
diff --git a/java/src/jni/h5Imp.c b/java/src/jni/h5Imp.c
index 99c91fd..f0dd691 100644
--- a/java/src/jni/h5Imp.c
+++ b/java/src/jni/h5Imp.c
@@ -127,7 +127,7 @@ done:
if (libversionArray)
UNPIN_INT_ARRAY(ENVONLY, libversion, libversionArray, (status < 0) ? JNI_ABORT : 0);
- return (jint)status;
+ return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5get_1libversion */
/*
diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c
index 4ab00df..937323e 100644
--- a/java/src/jni/h5eImp.c
+++ b/java/src/jni/h5eImp.c
@@ -62,11 +62,11 @@ static herr_t H5E_walk_cb(int nindx, const H5E_error2_t *info, void *cb_data);
*/
JNIEXPORT jboolean JNICALL
Java_hdf_hdf5lib_H5_H5Eauto_1is_1v2
- (JNIEnv *env, jclass cls, jlong stk_id)
+ (JNIEnv *env, jclass clss, jlong stk_id)
{
unsigned int is_stack = 0;
- UNUSED(cls);
+ UNUSED(clss);
if (stk_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eauto_is_v2: invalid stack ID");
@@ -85,14 +85,14 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Eregister_1class
- (JNIEnv *env, jclass cls, jstring cls_name, jstring lib_name, jstring version)
+ (JNIEnv *env, jclass clss, jstring cls_name, jstring lib_name, jstring version)
{
const char* the_cls_name = NULL;
const char* the_lib_name = NULL;
const char* the_version = NULL;
hid_t ret_val = H5I_INVALID_HID;
- UNUSED(cls);
+ UNUSED(clss);
if (NULL == cls_name)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Eregister_class: class name is NULL");
@@ -126,9 +126,9 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Eunregister_1class
- (JNIEnv *env, jclass cls, jlong cls_id)
+ (JNIEnv *env, jclass clss, jlong cls_id)
{
- UNUSED(cls);
+ UNUSED(clss);
if (cls_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eunregister_class: invalid error class ID");
@@ -147,9 +147,9 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Eclose_1msg
- (JNIEnv *env, jclass cls, jlong err_id)
+ (JNIEnv *env, jclass clss, jlong err_id)
{
- UNUSED(cls);
+ UNUSED(clss);
if (err_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eclose_msg: invalid error message ID");
@@ -168,13 +168,13 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Ecreate_1msg
- (JNIEnv *env, jclass cls, jlong err_id, jint msg_type, jstring err_msg)
+ (JNIEnv *env, jclass clss, jlong err_id, jint msg_type, jstring err_msg)
{
H5E_type_t error_msg_type = (H5E_type_t)msg_type;
const char *the_err_msg = NULL;
hid_t ret_val = H5I_INVALID_HID;
- UNUSED(cls);
+ UNUSED(clss);
if (err_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Ecreate_msg: invalid error class ID");
@@ -200,11 +200,11 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Ecreate_1stack
- (JNIEnv *env, jclass cls)
+ (JNIEnv *env, jclass clss)
{
hid_t ret_val = H5I_INVALID_HID;
- UNUSED(cls);
+ UNUSED(clss);
if ((ret_val = H5Ecreate_stack()) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -220,11 +220,11 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Eget_1current_1stack
- (JNIEnv *env, jclass cls)
+ (JNIEnv *env, jclass clss)
{
hid_t ret_val = H5I_INVALID_HID;
- UNUSED(cls);
+ UNUSED(clss);
if ((ret_val = H5Eget_current_stack()) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -240,9 +240,9 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Eclose_1stack
- (JNIEnv *env, jclass cls, jlong stk_id)
+ (JNIEnv *env, jclass clss, jlong stk_id)
{
- UNUSED(cls);
+ UNUSED(clss);
if (stk_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eclose_stack: invalid error stack ID");
@@ -261,11 +261,11 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Eprint2
- (JNIEnv *env, jclass cls, jlong stk_id, jobject stream_obj)
+ (JNIEnv *env, jclass clss, jlong stk_id, jobject stream_obj)
{
herr_t ret_val = FAIL;
- UNUSED(cls);
+ UNUSED(clss);
if (stk_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eprint2: invalid error stack ID");
@@ -290,13 +290,13 @@ done:
*/
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5Eget_1class_1name
- (JNIEnv *env, jclass cls, jlong cls_id)
+ (JNIEnv *env, jclass clss, jlong cls_id)
{
jstring str = NULL;
ssize_t buf_size;
char *namePtr = NULL;
- UNUSED(cls);
+ UNUSED(clss);
if (cls_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eget_class_name: invalid error class ID");
@@ -332,9 +332,9 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Eset_1current_1stack
- (JNIEnv *env, jclass cls, jlong stk_id)
+ (JNIEnv *env, jclass clss, jlong stk_id)
{
- UNUSED(cls);
+ UNUSED(clss);
if (stk_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eset_current_stack: invalid error stack ID");
@@ -353,9 +353,9 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Epop
- (JNIEnv *env, jclass cls, jlong stk_id, jlong count)
+ (JNIEnv *env, jclass clss, jlong stk_id, jlong count)
{
- UNUSED(cls);
+ UNUSED(clss);
if (stk_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Epop: invalid error stack ID");
@@ -374,7 +374,7 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Epush2
- (JNIEnv *env, jclass cls, jlong stk_id, jstring filename, jstring funcname,
+ (JNIEnv *env, jclass clss, jlong stk_id, jstring filename, jstring funcname,
jint linenumber, jlong class_id, jlong major_id, jlong minor_id, jstring err_desc)
{
const char *fName = NULL;
@@ -382,7 +382,7 @@ Java_hdf_hdf5lib_H5_H5Epush2
const char *errMsg = NULL;
herr_t ret_val = FAIL;
- UNUSED(cls);
+ UNUSED(clss);
if (stk_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Epush2: invalid error stack ID");
@@ -423,9 +423,9 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Eclear2
- (JNIEnv *env, jclass cls, jlong stk_id)
+ (JNIEnv *env, jclass clss, jlong stk_id)
{
- UNUSED(cls);
+ UNUSED(clss);
if (stk_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eclear2: invalid error stack ID");
@@ -444,7 +444,7 @@ done:
*/
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5Eget_1msg
- (JNIEnv *env, jclass cls, jlong msg_id, jintArray error_msg_type_list)
+ (JNIEnv *env, jclass clss, jlong msg_id, jintArray error_msg_type_list)
{
H5E_type_t error_msg_type;
jstring str = NULL;
@@ -452,7 +452,7 @@ Java_hdf_hdf5lib_H5_H5Eget_1msg
jint *theArray = NULL;
char *namePtr = NULL;
- UNUSED(cls);
+ UNUSED(clss);
if (msg_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eget_msg: invalid error message ID");
@@ -496,11 +496,11 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Eget_1num
- (JNIEnv *env, jclass cls, jlong stk_id)
+ (JNIEnv *env, jclass clss, jlong stk_id)
{
ssize_t ret_val = -1;
- UNUSED(cls);
+ UNUSED(clss);
if (stk_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eget_num: invalid error stack ID");
@@ -587,11 +587,11 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Ewalk2
- (JNIEnv *env, jclass cls, jlong stk_id, jlong direction, jobject callback_op, jobject op_data)
+ (JNIEnv *env, jclass clss, jlong stk_id, jlong direction, jobject callback_op, jobject op_data)
{
cb_wrapper wrapper = { callback_op, op_data };
- UNUSED(cls);
+ UNUSED(clss);
ENVPTR->GetJavaVM(ENVONLY, &jvm);
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
diff --git a/java/src/jni/h5fImp.c b/java/src/jni/h5fImp.c
index 52b0970..115e8f4 100644
--- a/java/src/jni/h5fImp.c
+++ b/java/src/jni/h5fImp.c
@@ -118,13 +118,13 @@ done:
*/
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5Fget_1name
- (JNIEnv *env, jclass cls, jlong file_id)
+ (JNIEnv *env, jclass clss, jlong file_id)
{
jstring str = NULL;
ssize_t buf_size;
char *namePtr = NULL;
- UNUSED(cls);
+ UNUSED(clss);
/* Get the length of the name */
if ((buf_size = H5Fget_name((hid_t)file_id, NULL, 0)) < 0)
@@ -225,11 +225,11 @@ done:
*/
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Fget_1intent
- (JNIEnv *env, jclass cls, jlong file_id)
+ (JNIEnv *env, jclass clss, jlong file_id)
{
unsigned intent = 0;
- UNUSED(cls);
+ UNUSED(clss);
if (H5Fget_intent((hid_t)file_id, &intent) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -323,11 +323,11 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Fget_1freespace
- (JNIEnv *env, jclass cls, jlong file_id)
+ (JNIEnv *env, jclass clss, jlong file_id)
{
hssize_t ret_val = -1;
- UNUSED(cls);
+ UNUSED(clss);
if ((ret_val = H5Fget_freespace((hid_t)file_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -363,7 +363,7 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Fget_1obj_1ids
- (JNIEnv *env, jclass cls, jlong file_id, jint types, jlong maxObjs,
+ (JNIEnv *env, jclass clss, jlong file_id, jint types, jlong maxObjs,
jlongArray obj_id_list)
{
jboolean isCopy;
@@ -373,7 +373,7 @@ Java_hdf_hdf5lib_H5_H5Fget_1obj_1ids
jlong *obj_id_listP = NULL;
hid_t *id_list = NULL;
- UNUSED(cls);
+ UNUSED(clss);
if (NULL == obj_id_list)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Fget_obj_ids: obj_id_list is NULL");
@@ -411,11 +411,11 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Fget_1obj_1count
- (JNIEnv *env, jclass cls, jlong file_id, jint types)
+ (JNIEnv *env, jclass clss, jlong file_id, jint types)
{
ssize_t ret_val = -1;
- UNUSED(cls);
+ UNUSED(clss);
if ((ret_val = H5Fget_obj_count((hid_t)file_id, (unsigned int)types)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -451,11 +451,11 @@ done:
*/
JNIEXPORT jdouble JNICALL
Java_hdf_hdf5lib_H5_H5Fget_1mdc_1hit_1rate
- (JNIEnv *env, jclass cls, jlong file_id)
+ (JNIEnv *env, jclass clss, jlong file_id)
{
double rate = 0.0;
- UNUSED(cls);
+ UNUSED(clss);
if (H5Fget_mdc_hit_rate((hid_t)file_id, &rate) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -471,7 +471,7 @@ done:
*/
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Fget_1mdc_1size
- (JNIEnv *env, jclass cls, jlong file_id, jlongArray metadata_cache)
+ (JNIEnv *env, jclass clss, jlong file_id, jlongArray metadata_cache)
{
jboolean isCopy;
size_t max_size = 0, min_clean_size = 0, cur_size = 0;
@@ -479,7 +479,7 @@ Java_hdf_hdf5lib_H5_H5Fget_1mdc_1size
jsize size = 0;
int cur_num_entries = -1;
- UNUSED(cls);
+ UNUSED(clss);
if (NULL == metadata_cache)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Fget_mdc_size: metadata cache array is NULL");
@@ -557,9 +557,9 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Freset_1mdc_1hit_1rate_1stats
- (JNIEnv *env, jclass cls, jlong file_id)
+ (JNIEnv *env, jclass clss, jlong file_id)
{
- UNUSED(cls);
+ UNUSED(clss);
if (H5Freset_mdc_hit_rate_stats((hid_t)file_id) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -575,9 +575,9 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Fclear_1elink_1file_1cache
- (JNIEnv *env, jclass cls, jlong file_id)
+ (JNIEnv *env, jclass clss, jlong file_id)
{
- UNUSED(cls);
+ UNUSED(clss);
if (H5Fclear_elink_file_cache((hid_t)file_id) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -593,9 +593,9 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Fstart_1swmr_1write
- (JNIEnv *env, jclass cls, jlong file_id)
+ (JNIEnv *env, jclass clss, jlong file_id)
{
- UNUSED(cls);
+ UNUSED(clss);
if (H5Fstart_swmr_write((hid_t)file_id) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -611,9 +611,9 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Fstart_1mdc_1logging
- (JNIEnv *env, jclass cls, jlong file_id)
+ (JNIEnv *env, jclass clss, jlong file_id)
{
- UNUSED(cls);
+ UNUSED(clss);
if (H5Fstart_mdc_logging((hid_t)file_id) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -629,9 +629,9 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Fstop_1mdc_1logging
- (JNIEnv *env, jclass cls, jlong file_id)
+ (JNIEnv *env, jclass clss, jlong file_id)
{
- UNUSED(cls);
+ UNUSED(clss);
if (H5Fstop_mdc_logging((hid_t)file_id) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -647,7 +647,7 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Fget_1mdc_1logging_1status
- (JNIEnv *env, jclass cls, jlong file_id, jbooleanArray mdc_logging_status)
+ (JNIEnv *env, jclass clss, jlong file_id, jbooleanArray mdc_logging_status)
{
jboolean *mdc_logging_status_ptr = NULL;
jboolean isCopy;
@@ -655,7 +655,7 @@ Java_hdf_hdf5lib_H5_H5Fget_1mdc_1logging_1status
hbool_t is_currently_logging;
jsize size;
- UNUSED(cls);
+ UNUSED(clss);
if (NULL == mdc_logging_status)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Fget_mdc_logging_status: mdc_logging_status is NULL");
diff --git a/java/src/jni/h5gImp.c b/java/src/jni/h5gImp.c
index b579f31..79b1b65 100644
--- a/java/src/jni/h5gImp.c
+++ b/java/src/jni/h5gImp.c
@@ -148,11 +148,11 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5__1H5Gcreate_1anon
- (JNIEnv *env, jclass cls, jlong loc_id, jlong gcpl_id, jlong gapl_id)
+ (JNIEnv *env, jclass clss, jlong loc_id, jlong gcpl_id, jlong gapl_id)
{
hid_t group_id = H5I_INVALID_HID;
- UNUSED(cls);
+ UNUSED(clss);
if ((group_id = H5Gcreate_anon((hid_t)loc_id, (hid_t)gcpl_id, (hid_t)gapl_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -198,11 +198,11 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Gget_1create_1plist
- (JNIEnv *env, jclass cls, jlong loc_id)
+ (JNIEnv *env, jclass clss, jlong loc_id)
{
hid_t plist_id = H5I_INVALID_HID;
- UNUSED(cls);
+ UNUSED(clss);
if ((plist_id = H5Gget_create_plist((hid_t)loc_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -218,12 +218,12 @@ done:
*/
JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Gget_1info
- (JNIEnv *env, jclass cls, jlong loc_id)
+ (JNIEnv *env, jclass clss, jlong loc_id)
{
H5G_info_t group_info;
jobject obj = NULL;
- UNUSED(cls);
+ UNUSED(clss);
if (H5Gget_info((hid_t)loc_id, &group_info) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -242,14 +242,14 @@ done:
*/
JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1name
- (JNIEnv *env, jclass cls, jlong loc_id, jstring name, jlong lapl_id)
+ (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong lapl_id)
{
H5G_info_t group_info;
const char *grpName = NULL;
jobject obj = NULL;
herr_t ret_val = FAIL;
- UNUSED(cls);
+ UNUSED(clss);
if (NULL == name)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Gget_info_by_name: group name is NULL");
@@ -278,7 +278,7 @@ done:
*/
JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx
- (JNIEnv *env, jclass cls, jlong loc_id, jstring name, jint index_type,
+ (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jint index_type,
jint order, jlong n, jlong lapl_id)
{
H5_iter_order_t corder = (H5_iter_order_t)order;
@@ -288,7 +288,7 @@ Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx
jobject obj = NULL;
herr_t ret_val = FAIL;
- UNUSED(cls);
+ UNUSED(clss);
if (NULL == name)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Gget_info_by_idx: group name is NULL");
diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c
index 7413023..7eee3d4 100644
--- a/java/src/jni/h5lImp.c
+++ b/java/src/jni/h5lImp.c
@@ -508,11 +508,11 @@ Java_hdf_hdf5lib_H5_H5Lget_1value_1by_1idx
UNUSED(clss);
+ infobuf.type = H5L_TYPE_ERROR;
+
if (NULL == name)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Lget_val_by_idx: group name is NULL");
- infobuf.type = H5L_TYPE_ERROR;
-
PIN_JAVA_STRING(ENVONLY, name, grpName, NULL, "H5Lget_val_by_idx: group name not pinned");
/* Get the length of the link value */
diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c
index cc88b81..b49a3e9 100644
--- a/java/src/jni/h5oImp.c
+++ b/java/src/jni/h5oImp.c
@@ -856,6 +856,66 @@ done:
return;
} /* end Java_hdf_hdf5lib_H5_H5Orefresh */
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Odisable_mdc_flushes
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Odisable_1mdc_1flushes
+ (JNIEnv *env, jclass clss, jlong loc_id)
+{
+ UNUSED(clss);
+
+ if (H5Odisable_mdc_flushes((hid_t)loc_id) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ return;
+} /* end Java_hdf_hdf5lib_H5_H5Odisable_1mdc_1flushes */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Oenable_mdc_flushes
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Oenable_1mdc_1flushes
+ (JNIEnv *env, jclass clss, jlong loc_id)
+{
+ UNUSED(clss);
+
+ if (H5Oenable_mdc_flushes((hid_t)loc_id) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ return;
+} /* end Java_hdf_hdf5lib_H5_H5Oenable_1mdc_1flushes */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Oare_mdc_flushes_disabled
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Oare_1mdc_1flushes_1disabled
+ (JNIEnv *env, jclass clss, jlong loc_id)
+{
+ jboolean bval = JNI_FALSE;
+ hbool_t is_disabled = FALSE;
+
+ UNUSED(clss);
+
+ if (H5Oare_mdc_flushes_disabled((hid_t)loc_id, &is_disabled) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (is_disabled == TRUE)
+ bval = JNI_TRUE;
+
+done:
+ return bval;
+} /* end Java_hdf_hdf5lib_H5_H5Oare_1mdc_1flushes_1disabled */
+
#ifdef __cplusplus
diff --git a/java/src/jni/h5oImp.h b/java/src/jni/h5oImp.h
index cb8c776..5241aba 100644
--- a/java/src/jni/h5oImp.h
+++ b/java/src/jni/h5oImp.h
@@ -202,6 +202,33 @@ JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Orefresh
(JNIEnv*, jclass, jlong);
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Odisable_mdc_flushes
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Odisable_1mdc_1flushes
+ (JNIEnv*, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Oenable_mdc_flushes
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Oenable_1mdc_1flushes
+ (JNIEnv*, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Oare_mdc_flushes_disabled
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Oare_1mdc_1flushes_1disabled
+ (JNIEnv*, jclass, jlong);
+
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
diff --git a/java/src/jni/h5pFAPLImp.c b/java/src/jni/h5pFAPLImp.c
index acfc853..006707a 100644
--- a/java/src/jni/h5pFAPLImp.c
+++ b/java/src/jni/h5pFAPLImp.c
@@ -370,6 +370,179 @@ done:
return (jlong)offset;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1family_1offset */
+/* Class: hdf_hdf5lib_H5
+ * Method: H5Pset_fapl_hdfs
+ * Signature: (J)Lhdf/hdf5lib/structs/H5FD_hdfs_fapl_t;
+ */
+JNIEXPORT jobject JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1fapl_1hdfs
+ (JNIEnv *env, jclass clss, jlong fapl_id)
+{
+#ifdef H5_HAVE_LIBHDFS
+ H5FD_hdfs_fapl_t fa;
+ jvalue args[5];
+ jint j_namenode_port = 0;
+ jstring j_namenode_name = NULL;
+ jstring j_user_name = NULL;
+ jstring j_kerb_cache_path = NULL;
+ jint j_stream_buffer_size = 0;
+#endif /* H5_HAVE_LIBHDFS */
+ jobject ret_obj = NULL;
+
+ UNUSED(clss);
+
+#ifdef H5_HAVE_LIBHDFS
+ if (H5Pget_fapl_hdfs((hid_t)fapl_id, &fa) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL != fa.namenode_name) {
+ if (NULL == (j_namenode_name = ENVPTR->NewStringUTF(ENVONLY, fa.namenode_name))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_hdfs: out of memory - can't create namenode_name string");
+ }
+ }
+ args[0].l = j_namenode_name;
+
+ args[1].i = (jint)fa.namenode_port;
+
+ if (NULL != fa.user_name) {
+ if (NULL == (j_user_name = ENVPTR->NewStringUTF(ENVONLY, fa.user_name))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_hdfs: out of memory - can't create user_name string");
+ }
+ }
+ args[2].l = j_user_name;
+
+ if (NULL != fa.kerberos_ticket_cache) {
+ if (NULL == (j_kerb_cache_path = ENVPTR->NewStringUTF(ENVONLY, fa.kerberos_ticket_cache))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_hdfs: out of memory - can't create kerberos_ticket_cache string");
+ }
+ }
+ args[3].l = j_kerb_cache_path;
+
+ args[4].i = (jint)fa.stream_buffer_size;
+
+ CALL_CONSTRUCTOR(ENVONLY, "hdf/hdf5lib/structs/H5FD_hdfs_fapl_t", "(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;I)V", args, ret_obj);
+#else
+ H5_UNIMPLEMENTED(ENVONLY, "H5Pget_fapl_hdfs: not implemented");
+#endif /* H5_HAVE_LIBHDFS */
+
+done:
+ return ret_obj;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1fapl_1hdfs */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_fapl_hdfs
+ * Signature: (JLhdf/hdf5lib/structs/H5FD_hdfs_fapl_t;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1fapl_1hdfs
+ (JNIEnv *env, jclass clss, jlong fapl_id, jobject fapl_config)
+{
+#ifdef H5_HAVE_LIBHDFS
+ H5FD_hdfs_fapl_t instance;
+ const char *str = NULL;
+ jfieldID fid;
+ jstring j_str;
+ jclass cls;
+#endif /* H5_HAVE_LIBHDFS */
+
+ UNUSED(clss);
+
+#ifdef H5_HAVE_LIBHDFS
+ HDmemset(&instance, 0, sizeof(H5FD_hdfs_fapl_t));
+
+ if (NULL == (cls = ENVPTR->GetObjectClass(ENVONLY, fapl_config)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "version", "I")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ instance.version = ENVPTR->GetIntField(ENVONLY, fapl_config, fid);
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "namenode_name", "Ljava/lang/String;")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (j_str = (jstring)ENVPTR->GetObjectField(ENVONLY, fapl_config, fid)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (j_str) {
+ PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5FDset_fapl_hdfs: fapl_config namenode_name not pinned");
+
+ HDstrncpy(instance.namenode_name, str, H5FD__HDFS_NODE_NAME_SPACE + 1);
+ instance.namenode_name[H5FD__HDFS_NODE_NAME_SPACE] = '\0';
+
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+ str = NULL;
+ }
+ else
+ HDmemset(instance.namenode_name, 0, H5FD__HDFS_NODE_NAME_SPACE + 1);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "namenode_port", "I")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ instance.namenode_port = ENVPTR->GetIntField(ENVONLY, fapl_config, fid);
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "user_name", "Ljava/lang/String;")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (j_str = (jstring)ENVPTR->GetObjectField(ENVONLY, fapl_config, fid)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (j_str) {
+ PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5FDset_fapl_hdfs: fapl_config user_name not pinned");
+
+ HDstrncpy(instance.user_name, str, H5FD__HDFS_USER_NAME_SPACE + 1);
+ instance.user_name[H5FD__HDFS_USER_NAME_SPACE] = '\0';
+
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+ str = NULL;
+ }
+ else
+ HDmemset(instance.user_name, 0, H5FD__HDFS_USER_NAME_SPACE + 1);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "kerberos_ticket_cache", "Ljava/lang/String;")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (j_str = (jstring)ENVPTR->GetObjectField(ENVONLY, fapl_config, fid)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (j_str) {
+ PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5FDset_fapl_hdfs: fapl_config kerberos_ticket_cache not pinned");
+
+ HDstrncpy(instance.kerberos_ticket_cache, str, H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1);
+ instance.kerberos_ticket_cache[H5FD__HDFS_KERB_CACHE_PATH_SPACE] = '\0';
+
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+ str = NULL;
+ }
+ else
+ HDmemset(instance.kerberos_ticket_cache, 0, H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "stream_buffer_size", "I")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ instance.stream_buffer_size = ENVPTR->GetIntField(ENVONLY, fapl_config, fid);
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (H5Pset_fapl_hdfs((hid_t)fapl_id, &instance) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+#else
+ H5_UNIMPLEMENTED(ENVONLY, "H5Pset_fapl_hdfs: not implemented");
+#endif /* H5_HAVE_LIBHDFS */
+
+done:
+ /* NOP */;
+#ifdef H5_HAVE_LIBHDFS
+ if (str)
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+#endif /* H5_HAVE_LIBHDFS */
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1fapl_1hdfs */
+
/*
* Class: hdf_hdf5lib_H5
* Method: H5Pset_fapl_log
@@ -617,6 +790,167 @@ done:
*/
/*
+ * Class: hdf5_hdf5lib_H5
+ * Method: H5Pget_fapl_ros3
+ * Signature: (J)Lhdf/hdf5lib/structs/H5FD_ros3_fapl_t;
+ */
+JNIEXPORT jobject JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1fapl_1ros3
+ (JNIEnv *env, jclass clss, jlong fapl_id)
+{
+#ifdef H5_HAVE_ROS3_VFD
+ H5FD_ros3_fapl_t fa;
+ jvalue args[3];
+ jstring j_aws = NULL;
+ jstring j_id = NULL;
+ jstring j_key = NULL;
+#endif /* H5_HAVE_ROS3_VFD */
+ jobject ret_obj = NULL;
+
+ UNUSED(clss);
+
+#ifdef H5_HAVE_ROS3_VFD
+ /* pass fapl and fapl_t instance into library get_fapl */
+ /* store fapl details in ros3_fapl_t instance `fa` */
+ if (H5Pget_fapl_ros3((hid_t)fapl_id, &fa) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL != fa.aws_region) {
+ if (NULL == (j_aws = ENVPTR->NewStringUTF(ENVONLY, fa.aws_region))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_ros3: out of memory - can't create aws_region string");
+ }
+ }
+ args[0].l = j_aws;
+
+ if (NULL != fa.secret_id) {
+ if (NULL == (j_id = ENVPTR->NewStringUTF(ENVONLY, fa.secret_id))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_ros3: out of memory - can't create secret_id string");
+ }
+ }
+ args[1].l = j_id;
+
+ if (NULL != fa.secret_key) {
+ if (NULL == (j_key = ENVPTR->NewStringUTF(ENVONLY, fa.secret_key))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_ros3: out of memory - can't create secret_key string");
+ }
+ }
+ args[2].l = j_key;
+
+ CALL_CONSTRUCTOR(ENVONLY, "hdf/hdf5lib/structs/H5FD_ros3_fapl_t", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", args, ret_obj);
+#else
+ H5_UNIMPLEMENTED(ENVONLY, "H5Pget_fapl_ros3: not implemented");
+#endif /* H5_HAVE_ROS3_VFD */
+
+done:
+ return ret_obj;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1fapl_1ros3 */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_fapl_ros3
+ * Signature: (JLhdf/hdf5lib/structs/H5FD_ros3_fapl_t;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1fapl_1ros3
+ (JNIEnv *env, jclass clss, jlong fapl_id, jobject fapl_config)
+{
+#ifdef H5_HAVE_ROS3_VFD
+ H5FD_ros3_fapl_t instance;
+ const char *str = NULL;
+ jfieldID fid;
+ jstring j_str;
+ jclass cls;
+#endif /* H5_HAVE_ROS3_VFD */
+
+ UNUSED(clss);
+
+#ifdef H5_HAVE_ROS3_VFD
+ HDmemset(&instance, 0, sizeof(H5FD_ros3_fapl_t));
+
+ if (NULL == (cls = ENVPTR->GetObjectClass(ENVONLY, fapl_config)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "version", "I")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ instance.version = ENVPTR->GetIntField(ENVONLY, fapl_config, fid);
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "aws_region", "Ljava/lang/String;")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (j_str = (jstring)ENVPTR->GetObjectField(ENVONLY, fapl_config, fid)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (j_str) {
+ PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5Pset_fapl_ros3: fapl_config aws_region not pinned");
+
+ HDstrncpy(instance.aws_region, str, H5FD_ROS3_MAX_REGION_LEN + 1);
+ instance.aws_region[H5FD_ROS3_MAX_REGION_LEN] = '\0';
+
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+ str = NULL;
+ }
+ else
+ HDmemset(instance.aws_region, 0, H5FD_ROS3_MAX_REGION_LEN + 1);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "secret_id", "Ljava/lang/String;")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (j_str = (jstring)ENVPTR->GetObjectField(ENVONLY, fapl_config, fid)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (j_str) {
+ PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5Pset_fapl_ros3: fapl_config secret_id not pinned");
+
+ HDstrncpy(instance.secret_id, str, H5FD_ROS3_MAX_SECRET_ID_LEN + 1);
+ instance.secret_id[H5FD_ROS3_MAX_SECRET_ID_LEN] = '\0';
+
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+ str = NULL;
+ }
+ else
+ HDmemset(instance.secret_id, 0, H5FD_ROS3_MAX_SECRET_ID_LEN + 1);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "secret_key", "Ljava/lang/String;")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (j_str = (jstring)ENVPTR->GetObjectField(ENVONLY, fapl_config, fid)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (j_str) {
+ PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5Pset_fapl_ros3: fapl_config secret_key not pinned");
+
+ HDstrncpy(instance.secret_key, str, H5FD_ROS3_MAX_SECRET_KEY_LEN + 1);
+ instance.secret_key[H5FD_ROS3_MAX_SECRET_KEY_LEN] = '\0';
+
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+ str = NULL;
+ }
+ else
+ HDmemset(instance.secret_key, 0, H5FD_ROS3_MAX_SECRET_KEY_LEN + 1);
+
+ if (instance.aws_region[0] != '\0' && instance.secret_id[0] !='\0' && instance.secret_key[0] !='\0')
+ instance.authenticate = TRUE;
+
+ if (H5Pset_fapl_ros3((hid_t)fapl_id, &instance) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+#else
+ H5_UNIMPLEMENTED(ENVONLY, "H5Pset_fapl_ros3: not implemented");
+#endif /* H5_HAVE_ROS3_VFD */
+
+done:
+ /* NOP */;
+#ifdef H5_HAVE_ROS3_VFD
+ if (str)
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+#endif /* H5_HAVE_LIBHDFS */
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1fapl_1ros3 */
+
+/*
* Class: hdf_hdf5lib_H5
* Method: H5Pset_fapl_split
* Signature: (JLjava/lang/String;JLjava/lang/String;J)V
diff --git a/java/src/jni/h5pFAPLImp.h b/java/src/jni/h5pFAPLImp.h
index 28b1d95..9b353e6 100644
--- a/java/src/jni/h5pFAPLImp.h
+++ b/java/src/jni/h5pFAPLImp.h
@@ -137,6 +137,24 @@ Java_hdf_hdf5lib_H5_H5Pget_1family_1offset
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5Pget_fapl_hdfs
+ * Signature: (J)Lhdf/hdf5lib/structs/H5FD_hdfs_fapl_t;
+ */
+JNIEXPORT jobject JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1fapl_1hdfs
+(JNIEnv *, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_fapl_hdfs
+ * Signature: (JLhdf/hdf5lib/structs/H5FD_hdfs_fapl_t;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1fapl_1hdfs
+(JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5Pset_fapl_log
* Signature: (JLjava/lang/String;JJ)V
*/
@@ -188,6 +206,24 @@ Java_hdf_hdf5lib_H5_H5Pget_1fapl_1multi
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5Pget_fapl_ros3
+ * Signature: (J)Lhdf/hdf5lib/structs/H5FD_ros3_fapl_t;
+ */
+JNIEXPORT jobject JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1fapl_1ros3
+(JNIEnv *, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_fapl_ros3
+ * Signature: (JLhdf/hdf5lib/structs/H5FD_ros3_fapl_t;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1fapl_1ros3
+(JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5Pset_fapl_split
* Signature: (JLjava/lang/String;JLjava/lang/String;J)V
*/
diff --git a/java/src/jni/h5pFCPLImp.c b/java/src/jni/h5pFCPLImp.c
index 34ac065..cc7c264 100644
--- a/java/src/jni/h5pFCPLImp.c
+++ b/java/src/jni/h5pFCPLImp.c
@@ -240,7 +240,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1sym_1k
done:
if (theArray)
- UNPIN_LONG_ARRAY(ENVONLY, size, theArray, (status < 0) ? JNI_ABORT : 0);
+ UNPIN_INT_ARRAY(ENVONLY, size, theArray, (status < 0) ? JNI_ABORT : 0);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1sym_1k */
diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c
index 087cda8..3c675b8 100644
--- a/java/src/jni/h5sImp.c
+++ b/java/src/jni/h5sImp.c
@@ -1129,14 +1129,14 @@ done:
*/
JNIEXPORT jbyteArray JNICALL
Java_hdf_hdf5lib_H5_H5Sencode
- (JNIEnv *env, jclass cls, jlong obj_id)
+ (JNIEnv *env, jclass clss, jlong obj_id)
{
unsigned char *bufPtr = NULL;
size_t buf_size = 0;
herr_t status = FAIL;
jbyteArray returnedArray = NULL;
- UNUSED(cls);
+ UNUSED(clss);
if (obj_id < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sencode: invalid object ID");
@@ -1173,13 +1173,13 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Sdecode
- (JNIEnv *env, jclass cls, jbyteArray buf)
+ (JNIEnv *env, jclass clss, jbyteArray buf)
{
jboolean isCopy;
jbyte *bufP = NULL;
hid_t sid = H5I_INVALID_HID;
- UNUSED(cls);
+ UNUSED(clss);
if (NULL == buf)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Sdecode: buffer is NULL");
@@ -1203,11 +1203,11 @@ done:
*/
JNIEXPORT jboolean JNICALL
Java_hdf_hdf5lib_H5_H5Sis_1regular_1hyperslab
- (JNIEnv *env, jclass cls, jlong obj_id)
+ (JNIEnv *env, jclass clss, jlong obj_id)
{
htri_t bval = JNI_FALSE;
- UNUSED(cls);
+ UNUSED(clss);
if ((bval = H5Sis_regular_hyperslab((hid_t)obj_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
diff --git a/java/src/jni/h5tImp.c b/java/src/jni/h5tImp.c
index 313ca8b..460f12e 100644
--- a/java/src/jni/h5tImp.c
+++ b/java/src/jni/h5tImp.c
@@ -1620,7 +1620,7 @@ done:
/*
* Class: hdf_hdf5lib_H5
- * Method: H5Tarray_get_dims2
+ * Method: H5Tget_array_dims2
* Signature: (J[J)I
*/
JNIEXPORT jint JNICALL
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index 5454dce..af83caa 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -3453,7 +3453,7 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5export_1dataset
- (JNIEnv *env, jclass cls, jstring file_export_name, jstring file_name, jstring object_path, jint binary_order)
+ (JNIEnv *env, jclass clss, jstring file_export_name, jstring file_name, jstring object_path, jint binary_order)
{
const char *file_export = NULL;
const char *object_name = NULL;
@@ -3464,7 +3464,7 @@ Java_hdf_hdf5lib_H5_H5export_1dataset
hid_t dataset_id = H5I_INVALID_HID;
FILE *stream = NULL;
- UNUSED(cls);
+ UNUSED(clss);
if (NULL == file_export_name)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: file_export_name is NULL");
diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt
index b76f572..d44bc2f 100644
--- a/java/test/CMakeLists.txt
+++ b/java/test/CMakeLists.txt
@@ -50,6 +50,20 @@ if (NOT HDF5_ENABLE_DEBUG_APIS)
)
endif ()
+if (HDF5_ENABLE_ROS3_VFD)
+ set (HDF5_JAVA_TEST_SOURCES
+ ${HDF5_JAVA_TEST_SOURCES}
+ TestH5Pfapls3
+ )
+endif ()
+
+if (HDF5_ENABLE_HDFS)
+ set (HDF5_JAVA_TEST_SOURCES
+ ${HDF5_JAVA_TEST_SOURCES}
+ TestH5Pfaplhdfs
+ )
+endif ()
+
set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_LIB_DIR}/junit.jar;${HDF5_JAVA_LIB_DIR}/hamcrest-core.jar;${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_SIMPLE_JAR}")
foreach (test_file ${HDF5_JAVA_TEST_SOURCES})
@@ -81,16 +95,16 @@ HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_
add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_files_list})
-if (WIN32)
+if (WIN32 OR MINGW)
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
else ()
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
endif ()
-set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$<TARGET_PROPERTY:${HDF5_JAVA_JNI_LIB_TARGET},OUTPUT_NAME$<$<CONFIG:Debug>:_DEBUG>>;")
+get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
+set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
foreach (test_file ${HDF5_JAVA_TEST_SOURCES})
-
set (CMAKE_JAVA_CLASSPATH ".")
foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH})
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}")
@@ -99,8 +113,7 @@ foreach (test_file ${HDF5_JAVA_TEST_SOURCES})
add_test (
NAME JUnit-${test_file}-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
JUnit-${test_file}.out
JUnit-${test_file}.out.err
)
@@ -122,7 +135,6 @@ foreach (test_file ${HDF5_JAVA_TEST_SOURCES})
-D "TEST_REFERENCE=JUnit-${test_file}.txt"
-P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
)
-
set_tests_properties (JUnit-${test_file} PROPERTIES
ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir2"
DEPENDS "JUnit-${test_file}-clearall-objects"
diff --git a/java/test/Makefile.am b/java/test/Makefile.am
index 6635ef7..e6c9b16 100644
--- a/java/test/Makefile.am
+++ b/java/test/Makefile.am
@@ -61,6 +61,8 @@ noinst_JAVA = \
TestH5P.java \
TestH5PData.java \
TestH5Pfapl.java \
+ TestH5Pfaplhdfs.java \
+ TestH5Pfapls3.java \
TestH5Pvirtual.java \
TestH5Plist.java \
TestH5A.java \
diff --git a/java/test/Makefile.in b/java/test/Makefile.in
index 06080ce..092a3e8 100644
--- a/java/test/Makefile.in
+++ b/java/test/Makefile.in
@@ -428,7 +428,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -451,9 +450,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -480,6 +482,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -534,6 +537,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -558,7 +562,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -709,6 +712,8 @@ noinst_JAVA = \
TestH5P.java \
TestH5PData.java \
TestH5Pfapl.java \
+ TestH5Pfaplhdfs.java \
+ TestH5Pfapls3.java \
TestH5Pvirtual.java \
TestH5Plist.java \
TestH5A.java \
@@ -1167,7 +1172,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/java/test/TestAll.java b/java/test/TestAll.java
index 13cb597..c7c206c 100644
--- a/java/test/TestAll.java
+++ b/java/test/TestAll.java
@@ -27,6 +27,7 @@ import org.junit.runners.Suite;
TestH5Lparams.class, TestH5Lbasic.class, TestH5Lcreate.class,
TestH5R.class,
TestH5P.class, TestH5PData.class, TestH5Pfapl.class, TestH5Pvirtual.class, TestH5Plist.class,
+ TestH5Pfapls3.class, TestH5Pfaplhdfs.class,
TestH5A.class,
TestH5Oparams.class, TestH5Obasic.class, TestH5Ocopy.class, TestH5Ocreate.class,
TestH5PL.class, TestH5Z.class
diff --git a/java/test/TestH5.java b/java/test/TestH5.java
index 6122c14..bcca910 100644
--- a/java/test/TestH5.java
+++ b/java/test/TestH5.java
@@ -54,8 +54,8 @@ public class TestH5 {
/**
* Test method for {@link hdf.hdf5lib.H5#J2C(int)}.
* NOTE:
- * H5F_ACC_DEBUG no longer prints any special debug info. The symbol is
- * being retained and will be listed as deprecated in HDF5 1.10.0.
+ * H5F_ACC_DEBUG no longer prints any special debug info. Even though the symbol is
+ * being retained hdf java does not access the symbol.
*/
@Test
public void testJ2C() {
@@ -63,7 +63,6 @@ public class TestH5 {
int H5F_ACC_RDWR = 0x0001;
int H5F_ACC_TRUNC = 0x0002;
int H5F_ACC_EXCL = 0x0004;
- int H5F_ACC_DEBUG = 0x0000; // HDFFV-1074 was 0x0008;
int H5F_ACC_CREAT = 0x0010;
int H5F_OBJ_FILE = 0x0001;
int H5F_OBJ_DATASET = 0x0002;
@@ -75,13 +74,13 @@ public class TestH5 {
int H5F_OBJ_LOCAL = 0x0020;
int definedValues[] = { H5F_ACC_RDONLY, H5F_ACC_RDWR, H5F_ACC_TRUNC,
- H5F_ACC_EXCL, H5F_ACC_DEBUG, H5F_ACC_CREAT, H5F_OBJ_FILE,
+ H5F_ACC_EXCL, H5F_ACC_CREAT, H5F_OBJ_FILE,
H5F_OBJ_DATASET, H5F_OBJ_GROUP, H5F_OBJ_DATATYPE, H5F_OBJ_ATTR,
H5F_OBJ_ALL, H5F_OBJ_LOCAL };
int j2cValues[] = { HDF5Constants.H5F_ACC_RDONLY,
HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5F_ACC_TRUNC,
- HDF5Constants.H5F_ACC_EXCL, H5F_ACC_DEBUG,
+ HDF5Constants.H5F_ACC_EXCL,
HDF5Constants.H5F_ACC_CREAT, HDF5Constants.H5F_OBJ_FILE,
HDF5Constants.H5F_OBJ_DATASET, HDF5Constants.H5F_OBJ_GROUP,
HDF5Constants.H5F_OBJ_DATATYPE, HDF5Constants.H5F_OBJ_ATTR,
@@ -162,7 +161,7 @@ public class TestH5 {
*/
@Test
public void testH5get_libversion() {
- int libversion[] = { 1, 10, 5 };
+ int libversion[] = { 1, 10, 6 };
try {
H5.H5get_libversion(libversion);
@@ -177,7 +176,7 @@ public class TestH5 {
for (int i = 0; i < 2; i++)
assertFalse(libversion[i] == 0);
}
-
+
/**
* Test method for {@link hdf.hdf5lib.H5#H5get_libversion(int[])}
* to ensure a null libversion parameter causes the function to
@@ -185,14 +184,14 @@ public class TestH5 {
*/
@Test
public void testH5get_libversion_null_param() {
- try {
- H5.H5get_libversion(null);
- }
- catch (Throwable err) {
- return;
- }
-
- fail("H5.H5get_libversion: succeeded with a null libversion parameter!");
+ try {
+ H5.H5get_libversion(null);
+ }
+ catch (Throwable err) {
+ return;
+ }
+
+ fail("H5.H5get_libversion: succeeded with a null libversion parameter!");
}
/**
@@ -201,7 +200,7 @@ public class TestH5 {
*/
@Test
public void testH5check_version() {
- int majnum = 1, minnum = 10, relnum = 5;
+ int majnum = 1, minnum = 10, relnum = 6;
try {
H5.H5check_version(majnum, minnum, relnum);
diff --git a/java/test/TestH5F.java b/java/test/TestH5F.java
index e4f9a30..dddfd26 100644
--- a/java/test/TestH5F.java
+++ b/java/test/TestH5F.java
@@ -94,28 +94,12 @@ public class TestH5F {
@Test(expected = HDF5LibraryException.class)
public void testH5Fget_create_plist_closed() throws Throwable {
- long fid = -1;
-
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
- H5fid = -1;
- }
-
- try {
- fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
- HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- fail("H5.H5Fopen: " + err);
- }
- try {
- H5.H5Fclose(fid);
- }
- catch (Exception ex) {
}
// it should fail because the file was closed.
- H5.H5Fget_create_plist(fid);
+ H5.H5Fget_create_plist(H5fid);
}
@Test
@@ -134,34 +118,17 @@ public class TestH5F {
@Test(expected = HDF5LibraryException.class)
public void testH5Fget_access_plist_closed() throws Throwable {
- long fid = -1;
-
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
- H5fid = -1;
- }
-
- try {
- fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
- HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- fail("H5.H5Fopen: " + err);
- }
- try {
- H5.H5Fclose(fid);
- }
- catch (Exception ex) {
}
// it should fail because the file was closed.
- H5.H5Fget_access_plist(fid);
+ H5.H5Fget_access_plist(H5fid);
}
@Test
public void testH5Fget_intent_rdwr() {
int intent = 0;
- long fid = -1;
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
@@ -169,31 +136,24 @@ public class TestH5F {
}
try {
- fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
+ H5fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
fail("H5.H5Fopen: " + err);
}
try {
- intent = H5.H5Fget_intent(fid);
+ intent = H5.H5Fget_intent(H5fid);
}
catch (Throwable err) {
fail("H5.H5Fget_intent: " + err);
}
assertEquals(HDF5Constants.H5F_ACC_RDWR, intent);
-
- try {
- H5.H5Fclose(fid);
- }
- catch (Exception ex) {
- }
}
@Test
public void testH5Fget_intent_rdonly() {
int intent = 0;
- long fid = -1;
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
@@ -201,25 +161,19 @@ public class TestH5F {
}
try {
- fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDONLY,
+ H5fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDONLY,
HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
fail("H5.H5Fopen: " + err);
}
try {
- intent = H5.H5Fget_intent(fid);
+ intent = H5.H5Fget_intent(H5fid);
}
catch (Throwable err) {
fail("H5.H5Fget_intent: " + err);
}
assertEquals(HDF5Constants.H5F_ACC_RDONLY, intent);
-
- try {
- H5.H5Fclose(fid);
- }
- catch (Exception ex) {
- }
}
@Test
diff --git a/java/test/TestH5Fparams.java b/java/test/TestH5Fparams.java
index 54a4579..c9dbc0c 100644
--- a/java/test/TestH5Fparams.java
+++ b/java/test/TestH5Fparams.java
@@ -192,7 +192,7 @@ public class TestH5Fparams {
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
- fail("H5.H5Fopen: " + err);
+ fail("H5.H5Fcreate: " + err);
}
try {
diff --git a/java/test/TestH5Ocreate.java b/java/test/TestH5Ocreate.java
index c3e36b4..de17d8b 100644
--- a/java/test/TestH5Ocreate.java
+++ b/java/test/TestH5Ocreate.java
@@ -557,4 +557,57 @@ public class TestH5Ocreate {
}
}
+ @Test
+ public void testH5Ocork() {
+ boolean corked = false;
+
+ // Check cork status of the group: not corked
+ try {
+ corked = H5.H5Oare_mdc_flushes_disabled(H5gid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Ocork: H5.H5Oare_mdc_flushes_disabled: " + err);
+ }
+ assertFalse("H5Oare_mdc_flushes_disabled: ", corked);
+
+ // Cork the group: an object
+ try {
+ H5.H5Odisable_mdc_flushes(H5gid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Ocork: H5.H5Odisable_mdc_flushes: " + err);
+ }
+
+ // Check cork status of the group: corked
+ try {
+ corked = H5.H5Oare_mdc_flushes_disabled(H5gid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Ocork: H5.H5Oare_mdc_flushes_disabled: " + err);
+ }
+ assertTrue("H5Oare_mdc_flushes_disabled: ", corked);
+
+ // Unork the group: an object
+ try {
+ H5.H5Oenable_mdc_flushes(H5gid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Ocork: H5.H5Oenable_mdc_flushes: " + err);
+ }
+
+ // Check cork status of the group: corked
+ try {
+ corked = H5.H5Oare_mdc_flushes_disabled(H5gid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Ocork: H5.H5Oare_mdc_flushes_disabled: " + err);
+ }
+ assertFalse("H5Oare_mdc_flushes_disabled: ", corked);
+ }
+
}
diff --git a/java/test/TestH5Oparams.java b/java/test/TestH5Oparams.java
index d340ee7..cac3dcd 100644
--- a/java/test/TestH5Oparams.java
+++ b/java/test/TestH5Oparams.java
@@ -159,4 +159,19 @@ public class TestH5Oparams {
H5.H5Orefresh(-1);
}
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Odisable_mdc_flushes() throws Throwable {
+ H5.H5Odisable_mdc_flushes(-1);
+ }
+
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Oenable_mdc_flushes() throws Throwable {
+ H5.H5Oenable_mdc_flushes(-1);
+ }
+
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Oare_mdc_flushes_disabled() throws Throwable {
+ H5.H5Oare_mdc_flushes_disabled(-1);
+ }
+
}
diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java
index 981f34e..b1c29b2 100644
--- a/java/test/TestH5P.java
+++ b/java/test/TestH5P.java
@@ -209,12 +209,12 @@ public class TestH5P {
@Test(expected = HDF5FunctionArgumentException.class)
public void testH5Pset_libver_bounds_invalidlow() throws Throwable {
- H5.H5Pset_libver_bounds(fapl_id, 5, HDF5Constants.H5F_LIBVER_LATEST);
+ H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_LATEST+1, HDF5Constants.H5F_LIBVER_LATEST);
}
@Test(expected = HDF5FunctionArgumentException.class)
public void testH5Pset_libver_bounds_invalidhigh() throws Throwable {
- H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_V110, HDF5Constants.H5F_LIBVER_V110+1);
+ H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_LATEST, HDF5Constants.H5F_LIBVER_LATEST+1);
}
@Test
diff --git a/java/test/TestH5Pfaplhdfs.java b/java/test/TestH5Pfaplhdfs.java
new file mode 100644
index 0000000..b0d42d8
--- /dev/null
+++ b/java/test/TestH5Pfaplhdfs.java
@@ -0,0 +1,138 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import hdf.hdf5lib.H5;
+import hdf.hdf5lib.HDF5Constants;
+import hdf.hdf5lib.exceptions.HDF5Exception;
+import hdf.hdf5lib.exceptions.HDF5LibraryException;
+import hdf.hdf5lib.structs.H5FD_hdfs_fapl_t;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+
+public class TestH5Pfaplhdfs {
+ @Rule public TestName testname = new TestName();
+
+ long fapl_id = -1;
+ long plapl_id = -1;
+ long dapl_id = -1;
+ long plist_id = -1;
+ long btplist_id = -1;
+
+ @Before
+ public void createFileAccess() throws NullPointerException, HDF5Exception
+ {
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount() == 0);
+ System.out.print(testname.getMethodName());
+
+ try {
+ fapl_id = H5.H5Pcreate(HDF5Constants.H5P_FILE_ACCESS);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Pfapl.createFileAccess: " + err);
+ }
+ assertTrue(fapl_id > 0);
+ try {
+ plapl_id = H5.H5Pcreate(HDF5Constants.H5P_LINK_ACCESS);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Pfapl.createFileAccess: " + err);
+ }
+ assertTrue(plapl_id > 0);
+ try {
+ plist_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_XFER);
+ btplist_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_XFER);
+ dapl_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_ACCESS);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Pfapl.createFileAccess: " + err);
+ }
+ assertTrue(plist_id > 0);
+ assertTrue(btplist_id > 0);
+ assertTrue(dapl_id > 0);
+ }
+
+ @After
+ public void deleteFileAccess() throws HDF5LibraryException
+ {
+ if (fapl_id > 0)
+ try {H5.H5Pclose(fapl_id);} catch (Exception ex) {}
+ if (plapl_id > 0)
+ try {H5.H5Pclose(plapl_id);} catch (Exception ex) {}
+ if (dapl_id > 0)
+ try {H5.H5Pclose(dapl_id);} catch (Exception ex) {}
+ if (plist_id > 0)
+ try {H5.H5Pclose(plist_id);} catch (Exception ex) {}
+ if (btplist_id > 0)
+ try {H5.H5Pclose(btplist_id);} catch (Exception ex) {}
+ System.out.println();
+ }
+
+ @Test
+ public void testHDFS_fapl() throws Exception
+ {
+ if (HDF5Constants.H5FD_HDFS < 0)
+ throw new HDF5LibraryException("skip");
+
+ String nodename = "blues";
+ int nodeport = 12345;
+ String username = "sparticus";
+ String kerbcache = "/dev/null";
+ int streamsize = 1024;
+
+ final H5FD_hdfs_fapl_t config = new H5FD_hdfs_fapl_t(nodename, nodeport, username, kerbcache, streamsize);
+ assertTrue("setting fapl should succeed", -1 < H5.H5Pset_fapl_hdfs(fapl_id, config));
+
+ assertEquals("driver types should match", HDF5Constants.H5FD_HDFS, H5.H5Pget_driver(fapl_id));
+
+ H5FD_hdfs_fapl_t copy = H5.H5Pget_fapl_hdfs(fapl_id);
+ assertEquals("fapl contents should match", new H5FD_hdfs_fapl_t(nodename, nodeport, username, kerbcache, streamsize), copy);
+ }
+
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Pget_fapl_hdfs_invalid_fapl_id() throws Exception
+ {
+ if (HDF5Constants.H5FD_HDFS < 0)
+ throw new HDF5LibraryException("skip");
+ H5FD_hdfs_fapl_t fails = H5.H5Pget_fapl_hdfs(-1);
+ }
+
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Pget_fapl_hdfs_fapl_id_of_wrong_driver_type() throws Exception
+ {
+ if (HDF5Constants.H5FD_HDFS < 0)
+ throw new HDF5LibraryException("skip");
+ if (HDF5Constants.H5FD_SEC2 < 0 )
+ throw new HDF5LibraryException("skip");
+ /* TODO: for now, test against a sec2 fapl only */
+
+ H5.H5Pset_fapl_sec2(fapl_id);
+ assertEquals("fapl_id was not set properly", HDF5Constants.H5FD_SEC2, H5.H5Pget_driver(fapl_id));
+ H5FD_hdfs_fapl_t fails = H5.H5Pget_fapl_hdfs(fapl_id);
+ }
+
+}
diff --git a/java/test/TestH5Pfapls3.java b/java/test/TestH5Pfapls3.java
new file mode 100644
index 0000000..ba10524
--- /dev/null
+++ b/java/test/TestH5Pfapls3.java
@@ -0,0 +1,159 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import hdf.hdf5lib.H5;
+import hdf.hdf5lib.HDF5Constants;
+import hdf.hdf5lib.exceptions.HDF5Exception;
+import hdf.hdf5lib.exceptions.HDF5LibraryException;
+import hdf.hdf5lib.structs.H5FD_ros3_fapl_t;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+
+public class TestH5Pfapls3 {
+ @Rule public TestName testname = new TestName();
+
+ long fapl_id = -1;
+ long plapl_id = -1;
+ long dapl_id = -1;
+ long plist_id = -1;
+ long btplist_id = -1;
+
+ @Before
+ public void createFileAccess() throws NullPointerException, HDF5Exception
+ {
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount() == 0);
+ System.out.print(testname.getMethodName());
+
+ try {
+ fapl_id = H5.H5Pcreate(HDF5Constants.H5P_FILE_ACCESS);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Pfapl.createFileAccess: " + err);
+ }
+ assertTrue(fapl_id > 0);
+ try {
+ plapl_id = H5.H5Pcreate(HDF5Constants.H5P_LINK_ACCESS);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Pfapl.createFileAccess: " + err);
+ }
+ assertTrue(plapl_id > 0);
+ try {
+ plist_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_XFER);
+ btplist_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_XFER);
+ dapl_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_ACCESS);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Pfapl.createFileAccess: " + err);
+ }
+ assertTrue(plist_id > 0);
+ assertTrue(btplist_id > 0);
+ assertTrue(dapl_id > 0);
+ }
+
+ @After
+ public void deleteFileAccess() throws HDF5LibraryException
+ {
+ if (fapl_id > 0)
+ try {H5.H5Pclose(fapl_id);} catch (Exception ex) {}
+ if (plapl_id > 0)
+ try {H5.H5Pclose(plapl_id);} catch (Exception ex) {}
+ if (dapl_id > 0)
+ try {H5.H5Pclose(dapl_id);} catch (Exception ex) {}
+ if (plist_id > 0)
+ try {H5.H5Pclose(plist_id);} catch (Exception ex) {}
+ if (btplist_id > 0)
+ try {H5.H5Pclose(btplist_id);} catch (Exception ex) {}
+ System.out.println();
+ }
+
+ @Test
+ public void testH5Pset_fapl_ros3() throws Exception
+ {
+ if (HDF5Constants.H5FD_ROS3 < 0)
+ return;
+
+ final H5FD_ros3_fapl_t config = new H5FD_ros3_fapl_t();
+ assertEquals("Default fapl has unexpected contents",
+ new H5FD_ros3_fapl_t("", "", ""), config);
+
+ H5.H5Pset_fapl_ros3(fapl_id, config);
+
+ assertEquals("driver types don't match",
+ HDF5Constants.H5FD_ROS3, H5.H5Pget_driver(fapl_id));
+
+ /* get_fapl_ros3 can throw exception in error cases */
+ H5FD_ros3_fapl_t copy = H5.H5Pget_fapl_ros3(fapl_id);
+ assertEquals("contents of fapl set and get don't match",
+ new H5FD_ros3_fapl_t("", "", ""), copy);
+ }
+
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Pget_fapl_ros3_invalid_fapl_id() throws Exception
+ {
+ if (HDF5Constants.H5FD_ROS3 < 0)
+ throw new HDF5LibraryException("skip");
+ H5FD_ros3_fapl_t fails = H5.H5Pget_fapl_ros3(-1);
+ }
+
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Pget_fapl_ros3_fapl_id_of_wrong_driver_type() throws Exception
+ {
+ if (HDF5Constants.H5FD_ROS3 < 0)
+ throw new HDF5LibraryException("skip");
+ if (HDF5Constants.H5FD_SEC2 < 0 )
+ throw new HDF5LibraryException("skip");
+ /* TODO: for now, test against a sec2 fapl only */
+
+ H5.H5Pset_fapl_sec2(fapl_id);
+ assertEquals("fapl_id was not set properly",
+ HDF5Constants.H5FD_SEC2, H5.H5Pget_driver(fapl_id));
+ H5FD_ros3_fapl_t fails = H5.H5Pget_fapl_ros3(fapl_id);
+ }
+
+ @Test
+ public void testH5Pset_fapl_ros3_specified() throws Exception
+ {
+ if (HDF5Constants.H5FD_ROS3 < 0)
+ return;
+
+ String region = "us-east-1";
+ String acc_id = "my_access_id";
+ String acc_key = "my_access_key";
+
+ final H5FD_ros3_fapl_t config = new H5FD_ros3_fapl_t(region, acc_id, acc_key);
+ H5.H5Pset_fapl_ros3(fapl_id, config);
+ assertEquals("driver types don't match",
+ HDF5Constants.H5FD_ROS3, H5.H5Pget_driver(fapl_id));
+
+ H5FD_ros3_fapl_t copy = H5.H5Pget_fapl_ros3(fapl_id);
+ assertEquals("contents of fapl set and get don't match",
+ new H5FD_ros3_fapl_t(region, acc_id, acc_key), copy);
+ }
+
+}
diff --git a/java/test/TestH5Z.java b/java/test/TestH5Z.java
index 31adf22..27bda6f 100644
--- a/java/test/TestH5Z.java
+++ b/java/test/TestH5Z.java
@@ -41,8 +41,8 @@ public class TestH5Z {
@Test
public void testH5Zfilter_avail() {
try {
- int filter_found = H5.H5Zfilter_avail(HDF5Constants.H5Z_FILTER_DEFLATE);
- assertTrue("H5.H5Zfilter_avail_DEFLATE", filter_found > 0);
+ int filter_found;
+
filter_found = H5.H5Zfilter_avail(HDF5Constants.H5Z_FILTER_FLETCHER32);
assertTrue("H5.H5Zfilter_avail_FLETCHER32", filter_found > 0);
filter_found = H5.H5Zfilter_avail(HDF5Constants.H5Z_FILTER_NBIT);
@@ -51,8 +51,12 @@ public class TestH5Z {
assertTrue("H5.H5Zfilter_avail_SCALEOFFSET", filter_found > 0);
filter_found = H5.H5Zfilter_avail(HDF5Constants.H5Z_FILTER_SHUFFLE);
assertTrue("H5.H5Zfilter_avail_SHUFFLE", filter_found > 0);
-// filter_found = H5.H5Zfilter_avail(HDF5Constants.H5Z_FILTER_SZIP);
-// assertTrue("H5.H5Zfilter_avail_SZIP", filter_found > 0);
+
+ // Just make sure H5Zfilter_avail() doesn't fail with szip/zlib
+ // since there is no way for us to determine if they should be present
+ // or not.
+ filter_found = H5.H5Zfilter_avail(HDF5Constants.H5Z_FILTER_DEFLATE);
+ filter_found = H5.H5Zfilter_avail(HDF5Constants.H5Z_FILTER_SZIP);
}
catch (Throwable err) {
err.printStackTrace();
@@ -63,9 +67,8 @@ public class TestH5Z {
@Test
public void testH5Zget_filter_info() {
try {
- int filter_flag = H5.H5Zget_filter_info(HDF5Constants.H5Z_FILTER_DEFLATE);
- assertTrue("H5.H5Zget_filter_info_DEFLATE_DECODE_ENABLED", (filter_flag & HDF5Constants.H5Z_FILTER_CONFIG_DECODE_ENABLED) > 0);
- assertTrue("H5.H5Zget_filter_info_DEFLATE_ENCODE_ENABLED", (filter_flag & HDF5Constants.H5Z_FILTER_CONFIG_ENCODE_ENABLED) > 0);
+ int filter_flag;
+
filter_flag = H5.H5Zget_filter_info(HDF5Constants.H5Z_FILTER_FLETCHER32);
assertTrue("H5.H5Zget_filter_info_FLETCHER32_DECODE_ENABLED", (filter_flag & HDF5Constants.H5Z_FILTER_CONFIG_DECODE_ENABLED) > 0);
assertTrue("H5.H5Zget_filter_info_FLETCHER32_ENCODE_ENABLED", (filter_flag & HDF5Constants.H5Z_FILTER_CONFIG_ENCODE_ENABLED) > 0);
@@ -78,9 +81,19 @@ public class TestH5Z {
filter_flag = H5.H5Zget_filter_info(HDF5Constants.H5Z_FILTER_SHUFFLE);
assertTrue("H5.H5Zget_filter_info_DECODE_SHUFFLE_ENABLED", (filter_flag & HDF5Constants.H5Z_FILTER_CONFIG_DECODE_ENABLED) > 0);
assertTrue("H5.H5Zget_filter_info_ENCODE_SHUFFLE_ENABLED", (filter_flag & HDF5Constants.H5Z_FILTER_CONFIG_ENCODE_ENABLED) > 0);
-// filter_flag = H5.H5Zget_filter_info(HDF5Constants.H5Z_FILTER_SZIP);
-// assertTrue("H5.H5Zget_filter_info_DECODE_SZIP_ENABLED", (filter_flag & HDF5Constants.H5Z_FILTER_CONFIG_DECODE_ENABLED) > 0);
-// assertTrue("H5.H5Zget_filter_info_ENCODE_SZIP_ENABLED", (filter_flag & HDF5Constants.H5Z_FILTER_CONFIG_ENCODE_ENABLED) > 0);
+
+ if(1 == H5.H5Zfilter_avail(HDF5Constants.H5Z_FILTER_DEFLATE)) {
+ filter_flag = H5.H5Zget_filter_info(HDF5Constants.H5Z_FILTER_DEFLATE);
+ assertTrue("H5.H5Zget_filter_info_DEFLATE_DECODE_ENABLED", (filter_flag & HDF5Constants.H5Z_FILTER_CONFIG_DECODE_ENABLED) > 0);
+ assertTrue("H5.H5Zget_filter_info_DEFLATE_ENCODE_ENABLED", (filter_flag & HDF5Constants.H5Z_FILTER_CONFIG_ENCODE_ENABLED) > 0);
+ }
+
+ if(1 == H5.H5Zfilter_avail(HDF5Constants.H5Z_FILTER_SZIP)) {
+ filter_flag = H5.H5Zget_filter_info(HDF5Constants.H5Z_FILTER_SZIP);
+ // Decode should always be available, but we have no way of determining
+ // if encode is so don't assert on that.
+ assertTrue("H5.H5Zget_filter_info_DECODE_SZIP_ENABLED", (filter_flag & HDF5Constants.H5Z_FILTER_CONFIG_DECODE_ENABLED) > 0);
+ }
}
catch (Throwable err) {
err.printStackTrace();
diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in
index b901782..32f17cb 100644
--- a/java/test/junit.sh.in
+++ b/java/test/junit.sh.in
@@ -18,6 +18,8 @@ srcdir=@srcdir@
USE_FILTER_SZIP="@USE_FILTER_SZIP@"
USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@"
+USE_ROS3_VFD="@HAVE_ROS3_VFD@"
+USE_HDFS_VFD="@HAVE_LIBHDFS@"
TESTNAME=JUnitInterface
EXIT_SUCCESS=0
@@ -93,6 +95,8 @@ $HDFTEST_HOME/testfiles/JUnit-TestH5R.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5P.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5PData.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Pfapl.txt
+$HDFTEST_HOME/testfiles/JUnit-TestH5Pfapls3.txt
+$HDFTEST_HOME/testfiles/JUnit-TestH5Pfaplhdfs.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Pvirtual.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Plist.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5A.txt
@@ -1080,6 +1084,50 @@ if test $USE_FILTER_SZIP = "yes"; then
test yes = "$verbose" && $DIFF JUnit-TestH5Giterate.txt JUnit-TestH5Giterate.out |sed 's/^/ /'
fi
fi
+if test "X$ROS3_VFD" = "Xyes"; then
+ echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Pfapls3"
+ TESTING JUnit-TestH5Pfapls3
+ ($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Pfapls3 > JUnit-TestH5Pfapls3.ext)
+
+ # Extract file name, line number, version and thread IDs because they may be different
+ sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
+ -e 's/line [0-9]*/line (number)/' \
+ -e 's/Time: [0-9]*\.[0-9]*/Time: XXXX/' \
+ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
+ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
+ JUnit-TestH5Pfapls3.ext > JUnit-TestH5Pfapls3.out
+
+ if diff JUnit-TestH5Pfapls3.out JUnit-TestH5Pfapls3.txt > /dev/null; then
+ echo " PASSED JUnit-TestH5Pfapls3"
+ else
+ echo "**FAILED** JUnit-TestH5Pfapls3"
+ echo " Expected result differs from actual result"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF JUnit-TestH5Pfapls3.txt JUnit-TestH5Pfapls3.out |sed 's/^/ /'
+ fi
+fi
+if test "X$HAVE_LIBHDFS" = "Xyes"; then
+ echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Pfaplhdfs"
+ TESTING JUnit-TestH5Pfaplhdfs
+ ($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Pfaplhdfs > JUnit-TestH5Pfaplhdfs.ext)
+
+ # Extract file name, line number, version and thread IDs because they may be different
+ sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
+ -e 's/line [0-9]*/line (number)/' \
+ -e 's/Time: [0-9]*\.[0-9]*/Time: XXXX/' \
+ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
+ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
+ JUnit-TestH5Pfaplhdfs.ext > JUnit-TestH5Pfaplhdfs.out
+
+ if diff JUnit-TestH5Pfaplhdfs.out JUnit-TestH5Pfaplhdfs.txt > /dev/null; then
+ echo " PASSED JUnit-TestH5Pfaplhdfs"
+ else
+ echo "**FAILED** JUnit-TestH5Pfaplhdfs"
+ echo " Expected result differs from actual result"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF JUnit-TestH5Pfaplhdfs.txt JUnit-TestH5Pfaplhdfs.out |sed 's/^/ /'
+ fi
+fi
# Clean up temporary files/directories
diff --git a/java/test/testfiles/JUnit-TestH5Ocreate.txt b/java/test/testfiles/JUnit-TestH5Ocreate.txt
index c2365e5..5bc9e07 100644
--- a/java/test/testfiles/JUnit-TestH5Ocreate.txt
+++ b/java/test/testfiles/JUnit-TestH5Ocreate.txt
@@ -4,6 +4,7 @@ JUnit version 4.11
.testH5Oget_info_softlink
.testH5Oget_info_externallink
.testH5Ocopy
+.testH5Ocork
.testH5Olink
.testH5Ocomment_by_name
.testH5Oget_info_by_idx_n1_create
@@ -17,5 +18,5 @@ JUnit version 4.11
Time: XXXX
-OK (15 tests)
+OK (16 tests)
diff --git a/java/test/testfiles/JUnit-TestH5Oparams.txt b/java/test/testfiles/JUnit-TestH5Oparams.txt
index 94220b9..bc23695 100644
--- a/java/test/testfiles/JUnit-TestH5Oparams.txt
+++ b/java/test/testfiles/JUnit-TestH5Oparams.txt
@@ -3,8 +3,10 @@ JUnit version 4.11
.testH5Ovisit_by_name_nullname
.testH5Oget_info_invalid
.testH5Ovisit_by_name_null
+.testH5Odisable_mdc_flushes
.testH5Oget_comment_invalid
.testH5Oset_comment_by_name_invalid
+.testH5Oare_mdc_flushes_disabled
.testH5Oopen_null
.testH5Oclose_invalid
.testH5Oflush_invalid
@@ -22,9 +24,10 @@ JUnit version 4.11
.testH5Ocopy_null_current
.testH5Oset_comment_invalid
.testH5Oopen_invalid
+.testH5Oenable_mdc_flushes
.testH5Ovisit_null
Time: XXXX
-OK (24 tests)
+OK (27 tests)
diff --git a/java/test/testfiles/JUnit-TestH5Pfaplhdfs.txt b/java/test/testfiles/JUnit-TestH5Pfaplhdfs.txt
new file mode 100644
index 0000000..47a00a4
--- /dev/null
+++ b/java/test/testfiles/JUnit-TestH5Pfaplhdfs.txt
@@ -0,0 +1,9 @@
+JUnit version 4.11
+.testH5Pget_fapl_hdfs_invalid_fapl_id
+.testH5Pget_fapl_hdfs_fapl_id_of_wrong_driver_type
+.testHDFS_fapl
+
+Time: XXXX
+
+OK (3 tests)
+
diff --git a/java/test/testfiles/JUnit-TestH5Pfapls3.txt b/java/test/testfiles/JUnit-TestH5Pfapls3.txt
new file mode 100644
index 0000000..3f46342
--- /dev/null
+++ b/java/test/testfiles/JUnit-TestH5Pfapls3.txt
@@ -0,0 +1,10 @@
+JUnit version 4.11
+.testH5Pset_fapl_ros3_specified
+.testH5Pset_fapl_ros3
+.testH5Pget_fapl_ros3_invalid_fapl_id
+.testH5Pget_fapl_ros3_fapl_id_of_wrong_driver_type
+
+Time: XXXX
+
+OK (4 tests)
+
diff --git a/m4/ax_check_class.m4 b/m4/ax_check_class.m4
index 098aa77..e673c2d 100644
--- a/m4/ax_check_class.m4
+++ b/m4/ax_check_class.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_check_class.html
+# https://www.gnu.org/software/autoconf-archive/ax_check_class.html
# ===========================================================================
#
# SYNOPSIS
@@ -36,7 +36,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
@@ -51,83 +51,18 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 7
+#serial 12
AU_ALIAS([AC_CHECK_CLASS], [AX_CHECK_CLASS])
AC_DEFUN([AX_CHECK_CLASS],[
AC_REQUIRE([AX_PROG_JAVA])
ac_var_name=`echo $1 | sed 's/\./_/g'`
-dnl Normaly I'd use a AC_CACHE_CHECK here but since the variable name is
+dnl Normally I'd use a AC_CACHE_CHECK here but since the variable name is
dnl dynamic I need an extra level of extraction
AC_MSG_CHECKING([for $1 class])
AC_CACHE_VAL(ax_cv_class_$ac_var_name, [
-if test x$ac_cv_prog_uudecode_base64 = xyes; then
-dnl /**
-dnl * Test.java: used to test dynamicaly if a class exists.
-dnl */
-dnl public class Test
-dnl {
-dnl
-dnl public static void
-dnl main( String[] argv )
-dnl {
-dnl Class lib;
-dnl if (argv.length < 1)
-dnl {
-dnl System.err.println ("Missing argument");
-dnl System.exit (77);
-dnl }
-dnl try
-dnl {
-dnl lib = Class.forName (argv[0]);
-dnl }
-dnl catch (ClassNotFoundException e)
-dnl {
-dnl System.exit (1);
-dnl }
-dnl lib = null;
-dnl System.exit (0);
-dnl }
-dnl
-dnl }
-cat << \EOF > Test.uue
-begin-base64 644 Test.class
-yv66vgADAC0AKQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
-bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
-bWJlclRhYmxlDAAKAAsBAANlcnIBABVMamF2YS9pby9QcmludFN0cmVhbTsJ
-AA0ACQcADgEAEGphdmEvbGFuZy9TeXN0ZW0IABABABBNaXNzaW5nIGFyZ3Vt
-ZW50DAASABMBAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgAV
-ABEHABYBABNqYXZhL2lvL1ByaW50U3RyZWFtDAAYABkBAARleGl0AQAEKEkp
-VgoADQAXDAAcAB0BAAdmb3JOYW1lAQAlKExqYXZhL2xhbmcvU3RyaW5nOylM
-amF2YS9sYW5nL0NsYXNzOwoAHwAbBwAgAQAPamF2YS9sYW5nL0NsYXNzBwAi
-AQAgamF2YS9sYW5nL0NsYXNzTm90Rm91bmRFeGNlcHRpb24BAAY8aW5pdD4B
-AAMoKVYMACMAJAoAAwAlAQAKU291cmNlRmlsZQEACVRlc3QuamF2YQAhAAEA
-AwAAAAAAAgAJAAUABgABAAcAAABtAAMAAwAAACkqvgSiABCyAAwSD7YAFBBN
-uAAaKgMyuAAeTKcACE0EuAAaAUwDuAAasQABABMAGgAdACEAAQAIAAAAKgAK
-AAAACgAAAAsABgANAA4ADgATABAAEwASAB4AFgAiABgAJAAZACgAGgABACMA
-JAABAAcAAAAhAAEAAQAAAAUqtwAmsQAAAAEACAAAAAoAAgAAAAQABAAEAAEA
-JwAAAAIAKA==
-====
-EOF
- if $UUDECODE Test.uue; then
- :
- else
- echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AS_MESSAGE_LOG_FD
- echo "configure: failed file was:" >&AS_MESSAGE_LOG_FD
- cat Test.uue >&AS_MESSAGE_LOG_FD
- ac_cv_prog_uudecode_base64=no
- fi
- rm -f Test.uue
- if AC_TRY_COMMAND($JAVA $JAVAFLAGS Test $1) >/dev/null 2>&1; then
- eval "ac_cv_class_$ac_var_name=yes"
- else
- eval "ac_cv_class_$ac_var_name=no"
- fi
- rm -f Test.class
-else
AX_TRY_COMPILE_JAVA([$1], , [eval "ac_cv_class_$ac_var_name=yes"],
[eval "ac_cv_class_$ac_var_name=no"])
-fi
eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`"
HAVE_LAST_CLASS=$ac_var_val
@@ -137,7 +72,7 @@ else
ifelse([$3], , :, [$3])
fi
])
-dnl for some reason the above statment didn't fall though here?
+dnl for some reason the above statement didn't fall though here?
dnl do scripts have variable scoping?
eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
AC_MSG_RESULT($ac_var_val)
diff --git a/m4/ax_check_classpath.m4 b/m4/ax_check_classpath.m4
index 3c9081a..e08a253 100644
--- a/m4/ax_check_classpath.m4
+++ b/m4/ax_check_classpath.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_check_classpath.html
+# https://www.gnu.org/software/autoconf-archive/ax_check_classpath.html
# ===========================================================================
#
# SYNOPSIS
@@ -33,7 +33,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
@@ -48,7 +48,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 5
+#serial 6
AU_ALIAS([AC_CHECK_CLASSPATH], [AX_CHECK_CLASSPATH])
AC_DEFUN([AX_CHECK_CLASSPATH],[
diff --git a/m4/ax_check_java_home.m4 b/m4/ax_check_java_home.m4
index cfe8f58..1d60387 100644
--- a/m4/ax_check_java_home.m4
+++ b/m4/ax_check_java_home.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_check_java_home.html
+# https://www.gnu.org/software/autoconf-archive/ax_check_java_home.html
# ===========================================================================
#
# SYNOPSIS
@@ -28,7 +28,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
@@ -43,7 +43,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 6
+#serial 7
AU_ALIAS([AC_CHECK_JAVA_HOME], [AX_CHECK_JAVA_HOME])
diff --git a/m4/ax_check_junit.m4 b/m4/ax_check_junit.m4
index 39b52d1..44dd70d 100644
--- a/m4/ax_check_junit.m4
+++ b/m4/ax_check_junit.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_check_junit.html
+# https://www.gnu.org/software/autoconf-archive/ax_check_junit.html
# ===========================================================================
#
# SYNOPSIS
@@ -45,7 +45,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 5
+#serial 6
AU_ALIAS([AC_CHECK_JUNIT], [AX_CHECK_JUNIT])
AC_DEFUN([AX_CHECK_JUNIT],[
diff --git a/m4/ax_check_rqrd_class.m4 b/m4/ax_check_rqrd_class.m4
index 8f14241..baa041a 100644
--- a/m4/ax_check_rqrd_class.m4
+++ b/m4/ax_check_rqrd_class.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_check_rqrd_class.html
+# https://www.gnu.org/software/autoconf-archive/ax_check_rqrd_class.html
# ===========================================================================
#
# SYNOPSIS
@@ -35,7 +35,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
@@ -50,7 +50,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 5
+#serial 6
AU_ALIAS([AC_CHECK_RQRD_CLASS], [AX_CHECK_RQRD_CLASS])
AC_DEFUN([AX_CHECK_RQRD_CLASS],[
diff --git a/m4/ax_java_check_class.m4 b/m4/ax_java_check_class.m4
index 917638a..c9d60f7 100644
--- a/m4/ax_java_check_class.m4
+++ b/m4/ax_java_check_class.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_java_check_class.html
+# https://www.gnu.org/software/autoconf-archive/ax_java_check_class.html
# ===========================================================================
#
# SYNOPSIS
@@ -15,7 +15,7 @@
#
# The macro tries to compile a minimal program importing <class>. Some
# newer compilers moan about the failure to use this but fail or produce a
-# class file anyway. All moaing is sunk to /dev/null since I only wanted
+# class file anyway. All moaning is sunk to /dev/null since I only wanted
# to know if the class could be imported. This is a recommended followup
# to AX_CHECK_JAVA_PLUGIN with classpath appropriately adjusted.
#
@@ -34,7 +34,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
@@ -49,7 +49,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 9
+#serial 12
AU_ALIAS([DPS_JAVA_CHECK_CLASS], [AX_JAVA_CHECK_CLASS])
AC_DEFUN([AX_JAVA_CHECK_CLASS],[
diff --git a/m4/ax_java_options.m4 b/m4/ax_java_options.m4
index 36c10d9..722d788 100644
--- a/m4/ax_java_options.m4
+++ b/m4/ax_java_options.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_java_options.html
+# https://www.gnu.org/software/autoconf-archive/ax_java_options.html
# ===========================================================================
#
# SYNOPSIS
@@ -27,7 +27,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 6
+#serial 7
AU_ALIAS([AC_JAVA_OPTIONS], [AX_JAVA_OPTIONS])
AC_DEFUN([AX_JAVA_OPTIONS],[
diff --git a/m4/ax_jni_include_dir.m4 b/m4/ax_jni_include_dir.m4
index becb33a..ae7a5f0 100644
--- a/m4/ax_jni_include_dir.m4
+++ b/m4/ax_jni_include_dir.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html
+# https://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html
# ===========================================================================
#
# SYNOPSIS
@@ -32,6 +32,10 @@
#
# - at the configure level, setenv JAVAC
#
+# This macro depends on AC_CANONICAL_HOST which requires that config.guess
+# and config.sub be distributed along with the source code. See autoconf
+# manual for details.
+#
# Note: This macro can work with the autoconf M4 macros for Java programs.
# This particular macro is not part of the original set of macros.
#
@@ -44,11 +48,13 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 11
+#serial 15
AU_ALIAS([AC_JNI_INCLUDE_DIR], [AX_JNI_INCLUDE_DIR])
AC_DEFUN([AX_JNI_INCLUDE_DIR],[
+AC_REQUIRE([AC_CANONICAL_HOST])
+
JNI_INCLUDE_DIRS=""
if test "x$JAVA_HOME" != x; then
@@ -66,14 +72,17 @@ else
fi
case "$host_os" in
- darwin*) # Apple JDK is at /System location and has headers symlinked elsewhere
- case "$_JTOPDIR" in
- /System/Library/Frameworks/JavaVM.framework/*)
- _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
- _JINC="$_JTOPDIR/Headers";;
- *) _JINC="$_JTOPDIR/include";;
- esac;;
- *) _JINC="$_JTOPDIR/include";;
+ darwin*) # Apple Java headers are inside the Xcode bundle.
+ macos_version=$(sw_vers -productVersion | sed -n -e 's/^@<:@0-9@:>@*.\(@<:@0-9@:>@*\).@<:@0-9@:>@*/\1/p')
+ if @<:@ "$macos_version" -gt "7" @:>@; then
+ _JTOPDIR="$(xcrun --show-sdk-path)/System/Library/Frameworks/JavaVM.framework"
+ _JINC="$_JTOPDIR/Headers"
+ else
+ _JTOPDIR="/System/Library/Frameworks/JavaVM.framework"
+ _JINC="$_JTOPDIR/Headers"
+ fi
+ ;;
+ *) _JINC="$_JTOPDIR/include";;
esac
_AS_ECHO_LOG([_JTOPDIR=$_JTOPDIR])
_AS_ECHO_LOG([_JINC=$_JINC])
@@ -81,13 +90,21 @@ _AS_ECHO_LOG([_JINC=$_JINC])
# On Mac OS X 10.6.4, jni.h is a symlink:
# /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/jni.h
# -> ../../CurrentJDK/Headers/jni.h.
-AC_CHECK_FILE([$_JINC/jni.h],
- [JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JINC"],
- [_JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
- AC_CHECK_FILE([$_JTOPDIR/include/jni.h],
- [JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include"],
- AC_MSG_ERROR([cannot find JDK header files]))
- ])
+AC_CACHE_CHECK(jni headers, ac_cv_jni_header_path,
+[
+ if test -f "$_JINC/jni.h"; then
+ ac_cv_jni_header_path="$_JINC"
+ JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
+ else
+ _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+ if test -f "$_JTOPDIR/include/jni.h"; then
+ ac_cv_jni_header_path="$_JTOPDIR/include"
+ JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
+ else
+ ac_cv_jni_header_path=none
+ fi
+ fi
+])
# get the likely subdirectories for system specific java includes
case "$host_os" in
@@ -102,13 +119,15 @@ cygwin*) _JNI_INC_SUBDIRS="win32";;
*) _JNI_INC_SUBDIRS="genunix";;
esac
-# add any subdirectories that are present
-for JINCSUBDIR in $_JNI_INC_SUBDIRS
-do
+if test "x$ac_cv_jni_header_path" != "xnone"; then
+ # add any subdirectories that are present
+ for JINCSUBDIR in $_JNI_INC_SUBDIRS
+ do
if test -d "$_JTOPDIR/include/$JINCSUBDIR"; then
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include/$JINCSUBDIR"
fi
-done
+ done
+fi
])
# _ACJNI_FOLLOW_SYMLINKS <path>
diff --git a/m4/ax_prog_jar.m4 b/m4/ax_prog_jar.m4
index 3c60fca..d474912 100644
--- a/m4/ax_prog_jar.m4
+++ b/m4/ax_prog_jar.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_jar.html
+# https://www.gnu.org/software/autoconf-archive/ax_prog_jar.html
# ===========================================================================
#
# SYNOPSIS
@@ -37,7 +37,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 7
+#serial 8
AU_ALIAS([AC_PROG_JAR], [AX_PROG_JAR])
AC_DEFUN([AX_PROG_JAR],[
diff --git a/m4/ax_prog_java.m4 b/m4/ax_prog_java.m4
index 03961db..c2e6964 100644
--- a/m4/ax_prog_java.m4
+++ b/m4/ax_prog_java.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_java.html
+# https://www.gnu.org/software/autoconf-archive/ax_prog_java.html
# ===========================================================================
#
# SYNOPSIS
@@ -85,7 +85,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
@@ -100,7 +100,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 9
+#serial 10
AU_ALIAS([AC_PROG_JAVA], [AX_PROG_JAVA])
AC_DEFUN([AX_PROG_JAVA],[
diff --git a/m4/ax_prog_java_cc.m4 b/m4/ax_prog_java_cc.m4
index 3df064f..ce9612d 100644
--- a/m4/ax_prog_java_cc.m4
+++ b/m4/ax_prog_java_cc.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_java_cc.html
+# https://www.gnu.org/software/autoconf-archive/ax_prog_java_cc.html
# ===========================================================================
#
# SYNOPSIS
@@ -56,7 +56,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
@@ -71,7 +71,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 4
+#serial 5
# AX_PROG_JAVA_CC([COMPILER ...])
# --------------------------
diff --git a/m4/ax_prog_java_works.m4 b/m4/ax_prog_java_works.m4
index 54e132a..bc70526 100644
--- a/m4/ax_prog_java_works.m4
+++ b/m4/ax_prog_java_works.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_java_works.html
+# https://www.gnu.org/software/autoconf-archive/ax_prog_java_works.html
# ===========================================================================
#
# SYNOPSIS
@@ -32,7 +32,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
@@ -47,57 +47,16 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 9
+#serial 11
AU_ALIAS([AC_PROG_JAVA_WORKS], [AX_PROG_JAVA_WORKS])
AC_DEFUN([AX_PROG_JAVA_WORKS], [
-AC_PATH_PROG(UUDECODE, uudecode, [no])
-if test x$UUDECODE != xno; then
-AC_CACHE_CHECK([if uudecode can decode base 64 file], ac_cv_prog_uudecode_base64, [
-dnl /**
-dnl * Test.java: used to test if java compiler works.
-dnl */
-dnl public class Test
-dnl {
-dnl
-dnl public static void
-dnl main( String[] argv )
-dnl {
-dnl System.exit (0);
-dnl }
-dnl
-dnl }
-cat << \EOF > Test.uue
-begin-base64 644 Test.class
-yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
-bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
-bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s
-YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG
-aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB
-AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB
-AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ=
-====
-EOF
-if $UUDECODE Test.uue; then
- ac_cv_prog_uudecode_base64=yes
-else
- echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AS_MESSAGE_LOG_FD
- echo "configure: failed file was:" >&AS_MESSAGE_LOG_FD
- cat Test.uue >&AS_MESSAGE_LOG_FD
- ac_cv_prog_uudecode_base64=no
-fi
-rm -f Test.uue])
-fi
-if test x$ac_cv_prog_uudecode_base64 != xyes; then
- rm -f Test.class
- AC_MSG_WARN([I have to compile Test.class from scratch])
if test x$ac_cv_prog_javac_works = xno; then
AC_MSG_ERROR([Cannot compile java source. $JAVAC does not work properly])
fi
if test x$ac_cv_prog_javac_works = x; then
AX_PROG_JAVAC
fi
-fi
AC_CACHE_CHECK(if $JAVA works, ac_cv_prog_java_works, [
JAVA_TEST=Test.java
CLASS_TEST=Test.class
@@ -111,7 +70,6 @@ public static void main (String args[]) {
} }
EOF
changequote([, ])dnl
-if test x$ac_cv_prog_uudecode_base64 != xyes; then
if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
:
else
@@ -119,7 +77,6 @@ if test x$ac_cv_prog_uudecode_base64 != xyes; then
cat $JAVA_TEST >&AS_MESSAGE_LOG_FD
AC_MSG_ERROR(The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?))
fi
-fi
if AC_TRY_COMMAND($JAVA -classpath . $JAVAFLAGS $TEST) >/dev/null 2>&1; then
ac_cv_prog_java_works=yes
else
@@ -127,7 +84,7 @@ else
cat $JAVA_TEST >&AS_MESSAGE_LOG_FD
AC_MSG_ERROR(The Java VM $JAVA failed (see config.log, check the CLASSPATH?))
fi
-rm -fr $JAVA_TEST $CLASS_TEST Test.uue
+rm -f $JAVA_TEST $CLASS_TEST
])
AC_PROVIDE([$0])dnl
]
diff --git a/m4/ax_prog_javac.m4 b/m4/ax_prog_javac.m4
index d061243..8abb733 100644
--- a/m4/ax_prog_javac.m4
+++ b/m4/ax_prog_javac.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_javac.html
+# https://www.gnu.org/software/autoconf-archive/ax_prog_javac.html
# ===========================================================================
#
# SYNOPSIS
@@ -49,7 +49,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
@@ -64,7 +64,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 7
+#serial 8
AU_ALIAS([AC_PROG_JAVAC], [AX_PROG_JAVAC])
AC_DEFUN([AX_PROG_JAVAC],[
diff --git a/m4/ax_prog_javac_works.m4 b/m4/ax_prog_javac_works.m4
index 7dfa1e3..9b48149 100644
--- a/m4/ax_prog_javac_works.m4
+++ b/m4/ax_prog_javac_works.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_javac_works.html
+# https://www.gnu.org/software/autoconf-archive/ax_prog_javac_works.html
# ===========================================================================
#
# SYNOPSIS
@@ -32,7 +32,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
@@ -47,7 +47,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 6
+#serial 7
AU_ALIAS([AC_PROG_JAVAC_WORKS], [AX_PROG_JAVAC_WORKS])
AC_DEFUN([AX_PROG_JAVAC_WORKS],[
diff --git a/m4/ax_prog_javadoc.m4 b/m4/ax_prog_javadoc.m4
index bcb6045..b9fcea4 100644
--- a/m4/ax_prog_javadoc.m4
+++ b/m4/ax_prog_javadoc.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_javadoc.html
+# https://www.gnu.org/software/autoconf-archive/ax_prog_javadoc.html
# ===========================================================================
#
# SYNOPSIS
@@ -38,7 +38,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 8
+#serial 9
AU_ALIAS([AC_PROG_JAVADOC], [AX_PROG_JAVADOC])
AC_DEFUN([AX_PROG_JAVADOC],[
diff --git a/m4/ax_prog_javah.m4 b/m4/ax_prog_javah.m4
index cefc616..935ec89 100644
--- a/m4/ax_prog_javah.m4
+++ b/m4/ax_prog_javah.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_javah.html
+# https://www.gnu.org/software/autoconf-archive/ax_prog_javah.html
# ===========================================================================
#
# SYNOPSIS
@@ -21,7 +21,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 8
+#serial 11
AU_ALIAS([AC_PROG_JAVAH], [AX_PROG_JAVAH])
AC_DEFUN([AX_PROG_JAVAH],[
@@ -30,19 +30,19 @@ AC_REQUIRE([AC_PROG_CPP])dnl
AC_PATH_PROG(JAVAH,javah)
AS_IF([test -n "$ac_cv_path_JAVAH"],
[
- AC_TRY_CPP([#include <jni.h>],,[
+ AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <jni.h>]])],[],[
ac_save_CPPFLAGS="$CPPFLAGS"
- _ACJAVAH_FOLLOW_SYMLINKS("$ac_cv_path_JAVAH")
+ _ACJAVAH_FOLLOW_SYMLINKS("$ac_cv_path_JAVAH")
ax_prog_javah_bin_dir=`AS_DIRNAME([$_ACJAVAH_FOLLOWED])`
ac_dir="`AS_DIRNAME([$ax_prog_javah_bin_dir])`/include"
AS_CASE([$build_os],
- [cygwin*],
+ [cygwin*|mingw*],
[ac_machdep=win32],
[ac_machdep=`AS_ECHO($build_os) | sed 's,[[-0-9]].*,,'`])
CPPFLAGS="$ac_save_CPPFLAGS -I$ac_dir -I$ac_dir/$ac_machdep"
- AC_TRY_CPP([#include <jni.h>],
- ac_save_CPPFLAGS="$CPPFLAGS",
- AC_MSG_WARN([unable to include <jni.h>]))
+ AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <jni.h>]])],
+ [ac_save_CPPFLAGS="$CPPFLAGS"],
+ [AC_MSG_WARN([unable to include <jni.h>])])
CPPFLAGS="$ac_save_CPPFLAGS"])
])
])
diff --git a/m4/ax_try_compile_java.m4 b/m4/ax_try_compile_java.m4
index a8ed6b2..245c36c 100644
--- a/m4/ax_try_compile_java.m4
+++ b/m4/ax_try_compile_java.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_try_compile_java.html
+# https://www.gnu.org/software/autoconf-archive/ax_try_compile_java.html
# ===========================================================================
#
# SYNOPSIS
@@ -29,7 +29,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 8
+#serial 10
AU_ALIAS([AC_TRY_COMPILE_JAVA], [AX_TRY_COMPILE_JAVA])
AC_DEFUN([AX_TRY_COMPILE_JAVA],[
@@ -48,8 +48,8 @@ dnl Don't remove the temporary files here, so they can be examined.
else
echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
cat Test.java >&AS_MESSAGE_LOG_FD
-ifelse([$4], , , [ rm -fr Test.java Test.class
+ifelse([$4], , , [ rm -f Test.java Test.class
$4
])dnl
fi
-rm -fr Test.java Test.class])
+rm -f Test.java Test.class])
diff --git a/m4/ax_try_run_java.m4 b/m4/ax_try_run_java.m4
index c680f03..2ebb86d 100644
--- a/m4/ax_try_run_java.m4
+++ b/m4/ax_try_run_java.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_try_run_java.html
+# https://www.gnu.org/software/autoconf-archive/ax_try_run_java.html
# ===========================================================================
#
# SYNOPSIS
@@ -29,7 +29,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 2
+#serial 3
AU_ALIAS([AC_TRY_RUN_JAVA], [AX_TRY_RUN_JAVA])
AC_DEFUN([AX_TRY_RUN_JAVA],[
diff --git a/release_docs/HISTORY-1_10.txt b/release_docs/HISTORY-1_10.txt
index ad8beb2..17678bb 100644
--- a/release_docs/HISTORY-1_10.txt
+++ b/release_docs/HISTORY-1_10.txt
@@ -3,15 +3,719 @@ HDF5 History
This file contains development history of the HDF5 1.10 branch
+07. Release Information for hdf5-1.10.5
06. Release Information for hdf5-1.10.4
05. Release Information for hdf5-1.10.3
04. Release Information for hdf5-1.10.2
03. Release Information for hdf5-1.10.1
-02. Release Information for hdf5-1.10.0-patch1
+02. Release Information for hdf5-1.10.0-patch1
01. Release Information for hdf5-1.10.0
[Search on the string '%%%%' for section breaks of each release.]
+%%%%1.10.5%%%%
+
+HDF5 version 1.10.5 released on 2019-02-25
+================================================================================
+
+
+INTRODUCTION
+
+This document describes the differences between this release and the previous
+HDF5 release. It contains information on the platforms tested and known
+problems in this release. For more details check the HISTORY*.txt files in the
+HDF5 source.
+
+Note that documentation in the links below will be updated at the time of each
+final release.
+
+Links to HDF5 documentation can be found on The HDF5 web page:
+
+ https://portal.hdfgroup.org/display/HDF5/HDF5
+
+The official HDF5 releases can be obtained from:
+
+ https://www.hdfgroup.org/downloads/hdf5/
+
+Changes from Release to Release and New Features in the HDF5-1.10.x release series
+can be found at:
+
+ https://portal.hdfgroup.org/display/HDF5/HDF5+Application+Developer%27s+Guide
+
+If you have any questions or comments, please send them to the HDF Help Desk:
+
+ help@hdfgroup.org
+
+
+CONTENTS
+
+- New Features
+- Support for new platforms and languages
+- Bug Fixes since HDF5-1.10.4
+- Supported Platforms
+- Tested Configuration Features Summary
+- More Tested Platforms
+- Known Problems
+- CMake vs. Autotools installations
+
+
+New Features
+============
+
+ Configuration:
+ -------------
+ - Cross compile on mutrino and other Cray XC40 systems.
+
+ Added support for CMake options to use CrayLinuxEnvironment, craype-mic-knl
+ module for building with craype-haswell module for configuration, and
+ batch scripts in bin/batch for use with sbatch or bsub to run tests in
+ batch jobs on compute nodes. An instruction file README_HPC describing
+ the use of these options was added in release_docs.
+
+ (LRK - 2019/02/18, TRILABS-34)
+
+ - Rework CMake command files to fix MPI testing.
+
+ Added setup fixture to remove any test generated files and added DEPENDS
+ to test properties to execute tests in order expected.
+
+ (ADB - 2019/02/14, TRILABS-111)
+
+ - Disable SZIP or ZLIB options if TGZ files are not available.
+
+ Changed the TGZ option for SZip and ZLib to disable the options
+ if the source tar.gz files are not found.
+
+ (ADB - 2019/02/05, HDFFV-10697)
+
+ - Added a new option to enable/disable using pread/pwrite instead of
+ read/write in the sec2, log, and core VFDs.
+
+ This option is enabled by default when pread/pwrite are detected.
+
+ Autotools: --enable-preadwrite
+ CMake: HDF5_ENABLE_PREADWRITE
+
+ (DER - 2019/02/03, HDFFV-10696)
+
+ - Rework CMake versioning for OSX platforms.
+
+ Changed the current_version and compatibility_version flags from optional
+ with HDF5_BUILD_WITH_INSTALL_NAME to always setting the flags for OSX.
+
+ (ADB - 2019/01/22, HDFFV-10685)
+
+ - Rework CMake command files to eliminate developer CMP005 warning
+
+ Use variables without quotes in if () statements.
+
+ (ADB - 2019/01/18, TILABS-105)
+
+ - Rework CMake configure files to eliminate developer CMP0075 warning
+
+ Renamed varname to HDF5_REQUIRED_LIBRARIES as the contents were not
+ required for configuration. Also moved check includes calls to top of
+ files.
+
+ (ADB - 2019/01/03, HDFFV-10546)
+
+ - Keep stderr and stdout separate in tests
+
+ Changed test handling of output capture. Tests now keep the stderr
+ output separate from the stdout output. It is up to the test to decide
+ which output to check against a reference. Also added the option
+ to grep for a string in either output.
+
+ (ADB - 2018/12/12, HDFFV-10632)
+
+ - Incorrectly installed private header files were removed from
+ CMake installs.
+
+ The CMake build files incorrectly flagged the following header files
+ as public and installed them. They are private and will no longer be
+ installed.
+
+ HDF5 library private package files (H5Xpkg.h)
+ H5Edefin.h
+ H5Einit.h
+ H5Eterm.h
+ H5LTparse.h
+ h5diff.h
+ h5tools_dump.h
+ h5tools.h
+ h5tools_ref.h
+ h5tools_str.h
+ h5tools_utils.h
+ h5trav.h
+
+ (DER - 2018/10/26, HDFFV-10614, 10609)
+
+ - Autotools installs now install H5FDwindows.h
+
+ This is simply to align the installed header files between the
+ autotools and CMake. H5FDwindows.h has no functionality on
+ non-Windows systems.
+
+ (DER - 2018/10/26, HDFFV-10614)
+
+
+ Library:
+ --------
+ - The sec2, log, and core VFDs can now use pread/pwrite instead of
+ read/write.
+
+ pread and pwrite do not change the file offset, a feature that was
+ requested by a user working with a multi-threaded application.
+
+ The option to configure this feature is described above.
+
+ (DER - 2019/02/03, HDFFV-10696)
+
+ - Add ability to minimze dataset object headers.
+
+ Creation of many, very small datasets resulted in extensive file bloat
+ due to extra space in the dataset object headers -- this space is
+ allocated by default to allow for the insertion of a small number of
+ attributes within the object header and not require a continuation
+ block, an unnecessary provision in the target use case.
+
+ Inform the library to expect no attributes on created datasets, and to
+ allocate the least space possible for the object headers.
+ NOTE: A continuation block is created if attributes are added to a
+ 'minimized' dataset, which can reduce performance.
+ NOTE: Some extra space is allocated for attributes essential to the
+ correct behavior of the object header (store creation times, e.g.). This
+ does not violate the design principle, as the space is calculated and
+ allocated as needed at the time of dataset object header creation --
+ unused space is not generated.
+ New API calls:
+ H5Fget_dset_no_attrs_hint
+ H5Fset_dset_no_attrs_hint
+ H5Pget_dset_no_attrs_hint
+ H5Pset_dset_no_attrs_hint
+
+ (JOS - 2019/01/04, TRILAB-45)
+
+ - Added new chunk query functions
+
+ The following public functions were added to discover information about
+ the chunks in an HDF5 file.
+ herr_t H5Dget_num_chunks(dset_id, fspace_id, *nchunks)
+ herr_t H5Dget_chunk_info_by_coord(dset_id, *coord, *filter_mask, *addr, *size)
+ herr_t H5Dget_chunk_info(dset_id, fspace_id, index, *coord, *filter_mask, *addr, *size)
+
+ (BMR - 2018/11/07, HDFFV-10615)
+
+ - Several empty public header files where removed from the distribution
+
+ The following files were empty placeholders. They are for internal
+ packages that are unlikely to ever have public functionality and have
+ thus been removed.
+
+ H5Bpublic.h
+ H5B2public.h
+ H5FSpublic.h
+ H5HFpublic.h
+ H5HGpublic.h
+ H5HLpublic.h
+
+ They were only installed in CMake builds.
+
+ (DER - 2018/10/26, HDFFV-10614)
+
+
+ Parallel Library:
+ -----------------
+ - Changed the default behavior in parallel when reading the same dataset in its entirety
+ (i.e. H5S_ALL dataset selection) which is being read by all the processes collectively.
+ The dataset must be contiguous, less than 2GB, and of an atomic datatype.
+ The new behavior is the HDF5 library will use an MPI_Bcast to pass the data read from
+ the disk by the root process to the remain processes in the MPI communicator associated
+ with the HDF5 file.
+
+ (MSB - 2019/01/02, HDFFV-10652)
+
+ - All MPI-1 API calls have been replaced with MPI-2 equivalents.
+
+ This was done to better support OpenMPI, as default builds no longer
+ include MPI-1 support (as of OpenMPI 4.0).
+
+ (DER - 2018/12/30, HDFFV-10566)
+
+ Fortran Library:
+ ----------------
+ - Added wrappers for dataset object header minimization calls.
+ (see the note for TRILAB-45, above)
+
+ New API calls:
+
+ h5fget_dset_no_attrs_hint_f
+ h5fset_dset_no_attrs_hint_f
+ h5pget_dset_no_attrs_hint_f
+ h5pset_dset_no_attrs_hint_f
+
+ (DER - 2019/01/09, TRILAB-45)
+
+ - Added new Fortran derived type, c_h5o_info_t, which is interoperable with
+ C's h5o_info_t. This is needed for callback functions which
+ pass C's h5o_info_t data type definition.
+
+ (MSB, 2019/01/08, HDFFV-10443)
+
+ - Added new Fortran API, H5gmtime, which converts (C) 'time_t' structure
+ to Fortran DATE AND TIME storage format.
+
+ (MSB, 2019/01/08, HDFFV-10443)
+
+ - Added new Fortran 'fields' optional parameter to: h5ovisit_f, h5oget_info_by_name_f,
+ h5oget_info, h5oget_info_by_idx and h5ovisit_by_name_f.
+
+ (MSB, 2019/01/08, HDFFV-10443)
+
+ C++ Library:
+ ------------
+ - Added new function to the C++ interface
+
+ Added wrapper for H5Ovisit2:
+ H5Object::visit()
+
+ (BMR - 2019/02/14, HDFFV-10532)
+
+
+ Java Library:
+ ----------------
+ - Rewrote the JNI error handling to be much cleaner
+
+ (JTH - 2019/02/12)
+
+ - Add new functions to java interface
+
+ Added wrappers for:
+ H5Fset_libver_bounds
+ H5Fget_dset_no_attrs_hint/H5Fset_dset_no_attrs_hint
+ H5Pget_dset_no_attrs_hint/H5Pset_dset_no_attrs_hint
+
+ (ADB - 2019/01/07, HDFFV-10664)
+
+ - Fix java unit tests when Time is a natural number
+
+ Time substitution in java/test/junit.sh.in doesn't
+ handle the case when Time is a natural number. Fixed
+ the regular expression.
+
+ (ADB - 2019/01/07, HDFFV-10674)
+
+ - Duplicate the data read/write functions of Datasets for Attributes.
+
+ Region references could not be displayed for attributes as they could
+ for datasets. Datasets had overloaded read and write functions for different
+ datatypes that were not available for attributes. After adding similar
+ functions, attribute region references work normally.
+
+ (ADB - 2018/12/12, HDFVIEW-4)
+
+
+ Tools:
+ ------
+ - The h5repart -family-to-sec2 argument was changed to -family-to-single
+
+ In order to better support other single-file VFDs which could work with
+ h5repart, the -family-to-sec2 argument was renamed to -family-to-single.
+ This is just a name change and the functionality of the argument has not
+ changed.
+
+ The -family-to-sec2 argument has been kept for backwards-compatibility.
+ This argument should be considered deprecated.
+
+ (DER - 2018/11/14, HDFFV-10633)
+
+
+Bug Fixes since HDF5-1.10.4 release
+==================================
+
+ Library
+ -------
+ - Fix hangs with collective metadata reads during chunked dataset I/O
+
+ In the parallel library, it was discovered that when a particular
+ sequence of operations following a pattern of:
+
+ "write to chunked dataset" -> "flush file" -> "read from dataset"
+
+ occurred with collective metadata reads enabled, hangs could be
+ observed due to certain MPI ranks not participating in the collective
+ metadata reads.
+
+ To fix the issue, collective metadata reads are now disabled during
+ chunked dataset raw data I/O.
+
+ (JTH - 2019/02/11, HDFFV-10563, HDFFV-10688)
+
+ - Performance issue when closing an object
+
+ The slow down is due to the search of the "tag_list" to find
+ out the "corked" status of an object and "uncork" it if so.
+
+ Improve performance by skipping the search of the "tag_list"
+ if there are no "corked" objects when closing an object.
+
+ (VC - 2019/02/06)
+
+ - Uninitialized bytes from a type conversion buffer could be written
+ to disk in H5Dwrite calls where type conversion takes place
+ and the type conversion buffer was created by the HDF5 library.
+
+ When H5Dwrite is called and datatype conversion must be performed,
+ the library will create a temporary buffer for type conversion if
+ one is not provided by the user via H5Pset_buffer. This internal
+ buffer is allocated via malloc and contains uninitialized data. In
+ some datatype conversions (float to long double, possibly others),
+ some of this uninitialized data could be written to disk.
+
+ This was flagged by valgrind in the dtransform test and does not
+ appear to be a common occurrence (it is flagged in one test out
+ of the entire HDF5 test suite).
+
+ Switching to calloc fixed the problem.
+
+ (DER - 2019/02/03, HDFFV-10694)
+
+ - There was missing protection against division by zero reported to
+ The HDF Group as issue #CVE-2018-17434.
+
+ Protection against division by zero was added to address the issue
+ #CVE-2018-17434.
+
+ (BMR - 2019/01/29, HDFFV-10586)
+
+ - The issue CVE-2018-17437 was reported to The HDF Group
+
+ Although CVE-2018-17437 reported a memory leak, the actual issue
+ was invalid read. It was found that the attribute name length
+ in an attribute message was corrupted, which caused the buffer
+ pointer to be advanced too far and later caused an invalid read.
+
+ A check was added to detect when the attribute name or its length
+ was corrupted and report the potential of data corruption.
+
+ (BMR - 2019/01/29, HDFFV-10588)
+
+ - H5Ewalk did not stop when it was supposed to
+
+ H5Ewalk was supposed to stop when the callback function stopped
+ even though the errors in the stack were not all visited, but it
+ did not. This problem is now fixed.
+
+ (BMR - 2019/01/29, HDFFV-10684)
+
+ - Revert H5Oget_info* and H5Ovisit* functions
+
+ In 1.10.3 new H5Oget_info*2 and H5Ovisit*2 functions were
+ added for performance. Inadvertently, the original functions;
+ H5Oget_info,
+ H5Oget_info_by_name,
+ H5Oget_info_by_idx,
+ H5Ovisit,
+ H5Ovisit_by_name
+ were versioned to H5Oget_info*1 and H5Ovisit*1. This
+ broke the API compatibility for a maintenance release. The
+ original functions have been restored.
+
+ (ADB - 2019/01/24, HDFFV-10686)
+
+ - Fixed a potential invalid memory access and failure that could occur when
+ decoding an unknown object header message (from a future version of the
+ library).
+
+ (NAF - 2019/01/07)
+
+ - Deleting attributes in dense storage
+
+ The library aborts with "infinite loop closing library" after
+ attributes in dense storage are created and then deleted.
+
+ When deleting the attribute nodes from the name index v2 B-tree,
+ if an attribute is found in the intermediate B-tree nodes,
+ which may be merged/redistributed in the process, we need to
+ free the dynamically allocated spaces for the intermediate
+ decoded attribute.
+
+ (VC - 2018/12/26, HDFFV-10659)
+
+ - There was missing protection against division by zero reported to
+ The HDF Group as issue #CVE-2018-17233.
+
+ Protection against division by zero was added to address the issue
+ #CVE-2018-17233. In addition, several similar occurrences in the same
+ file were fixed as well.
+
+ (BMR - 2018/12/23, HDFFV-10577)
+
+ - Fixed an issue where the parallel filters tests would fail
+ if zlib was not available on the system. Until support can
+ be added in the tests for filters beyond gzip/zlib, the tests
+ will be skipped if zlib is not available.
+
+ (JTH - 2018/12/05)
+
+ - A bug was discovered in the parallel library where an application
+ would eventually consume all of the available MPI communicators
+ when continually writing to a compressed dataset in parallel. This
+ was due to internal copies of an HDF5 File Access Property List,
+ which each contained a copy of the MPI communicator, not being
+ closed at the end of each write operation. This problem was
+ exacerbated by larger numbers of processors.
+
+ (JTH - 2018/12/05, HDFFV-10629)
+
+
+ Fortran
+ --------
+ - Fixed issue with Fortran not returning h5o_info_t field values
+ meta_size%attr%index_size and meta_size%attr%heap_size.
+
+ (MSB, 2019/01/08, HDFFV-10443)
+
+ - Added symbolic links libhdf5_hl_fortran.so to libhdf5hl_fortran.so and
+ libhdf5_hl_fortran.a to libhdf5hl_fortran.a in hdf5/lib directory for
+ autotools installs. These were added to match the name of the files
+ installed by cmake and the general pattern of hl lib files. We will
+ change the names of the installed lib files to the matching name in
+ the next major release.
+
+ (LRK - 2019/01/04, HDFFV-10596)
+
+ - Made Fortran specific subroutines PRIVATE in generic procedures.
+
+ Affected generic procedures were functions in H5A, H5D, H5P, H5R and H5T.
+
+ (MSB, 2018/12/04, HDFFV-10511)
+
+
+ Testing
+ -------
+ - Fixed a test failure in testpar/t_dset.c caused by
+ the test trying to use the parallel filters feature
+ on MPI-2 implementations.
+
+ (JTH, 2019/2/7)
+
+
+Supported Platforms
+===================
+
+ Linux 2.6.32-696.16.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
+ #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
+ (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
+ IBM XL C/C++ V13.1
+ IBM XL Fortran V15.1
+
+ Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++)
+ #1 SMP x86_64 GNU/Linux compilers:
+ (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4)
+ Version 4.9.3, Version 5.2.0
+ Intel(R) C (icc), C++ (icpc), Fortran (icc)
+ compilers:
+ Version 17.0.0.098 Build 20160721
+ MPICH 3.1.4 compiled with GCC 4.9.3
+
+ SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc
+ (emu) Sun Fortran 95 8.6 SunOS_sparc
+ Sun C++ 5.12 SunOS_sparc
+
+ Windows 7 Visual Studio 2015 w/ Intel Fortran 16 (cmake)
+
+ Windows 7 x64 Visual Studio 2013
+ Visual Studio 2015 w/ Intel Fortran 16 (cmake)
+ Visual Studio 2015 w/ Intel C, Fortran 2018 (cmake)
+ Visual Studio 2015 w/ MSMPI 8 (cmake)
+
+ Windows 10 Visual Studio 2015 w/ Intel Fortran 18 (cmake)
+
+ Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 18 (cmake)
+ Visual Studio 2017 w/ Intel Fortran 18 (cmake)
+
+ Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.1 from Xcode 7.0
+ 64-bit gfortran GNU Fortran (GCC) 4.9.2
+ (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3
+
+ Mac OS X El Capitan 10.11.6 Apple clang/clang++ version 7.3.0 from Xcode 7.3
+ 64-bit gfortran GNU Fortran (GCC) 5.2.0
+ (osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2
+
+ MacOS High Sierra 10.13.6 Apple LLVM version 10.0.0 (clang/clang++-1000.10.44.4)
+ 64-bit gfortran GNU Fortran (GCC) 8.3.0
+
+
+Tested Configuration Features Summary
+=====================================
+
+ In the tables below
+ y = tested
+ n = not tested in this release
+ C = Cluster
+ W = Workstation
+ x = not working in this release
+ dna = does not apply
+ ( ) = footnote appears below second table
+ <blank> = testing incomplete on this feature or platform
+
+Platform C F90/ F90 C++ zlib SZIP
+ parallel F2003 parallel
+Solaris2.11 32-bit n y/y n y y y
+Solaris2.11 64-bit n y/n n y y y
+Windows 7 y y/y n y y y
+Windows 7 x64 y y/y y y y y
+Windows 7 Cygwin n y/n n y y y
+Windows 7 x64 Cygwin n y/n n y y y
+Windows 10 y y/y n y y y
+Windows 10 x64 y y/y n y y y
+Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y
+Mac OS X El Capitan 10.11.6 64-bit n y/y n y y y
+MacOS High Sierra 10.13.6 64-bit n y/y n y y y
+CentOS 7.2 Linux 3.10.0 x86_64 PGI n y/y n y y y
+CentOS 7.2 Linux 3.10.0 x86_64 GNU y y/y y y y y
+CentOS 7.2 Linux 3.10.0 x86_64 Intel n y/y n y y y
+Linux 2.6.32-573.18.1.el6.ppc64 n y/y n y y y
+
+
+Platform Shared Shared Shared Thread-
+ C libs F90 libs C++ libs safe
+Solaris2.11 32-bit y y y y
+Solaris2.11 64-bit y y y y
+Windows 7 y y y y
+Windows 7 x64 y y y y
+Windows 7 Cygwin n n n y
+Windows 7 x64 Cygwin n n n y
+Windows 10 y y y y
+Windows 10 x64 y y y y
+Mac OS X Yosemite 10.10.5 64-bit y y y y
+Mac OS X El Capitan 10.11.6 64-bit y y y y
+MacOS High Sierra 10.13.6 64-bit y y y y
+CentOS 7.2 Linux 3.10.0 x86_64 PGI y y y n
+CentOS 7.2 Linux 3.10.0 x86_64 GNU y y y y
+CentOS 7.2 Linux 3.10.0 x86_64 Intel y y y n
+Linux 2.6.32-573.18.1.el6.ppc64 y y y n
+
+Compiler versions for each platform are listed in the preceding
+"Supported Platforms" table.
+
+
+More Tested Platforms
+=====================
+The following configurations are not supported but have been tested for this release.
+
+ Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++)
+ #1 SMP x86_64 GNU/Linux compilers:
+ (mayll/platypus) Version 4.4.7 20120313
+ Version 4.9.3, 5.3.0, 6.2.0
+ PGI C, Fortran, C++ for 64-bit target on
+ x86-64;
+ Version 17.10-0
+ Intel(R) C (icc), C++ (icpc), Fortran (icc)
+ compilers:
+ Version 17.0.4.196 Build 20170411
+ MPICH 3.1.4 compiled with GCC 4.9.3
+
+ Linux 3.10.0-327.18.2.el7 GNU C (gcc) and C++ (g++) compilers
+ #1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4)
+ (jelly) with NAG Fortran Compiler Release 6.1(Tozai)
+ GCC Version 7.1.0
+ MPICH 3.2-GCC-4.9.3
+ MPICH 3.2.1-GCC-7.2.0-2.29
+ OpenMPI 2.1.5-GCC-7.2.0-2.29
+ Intel(R) C (icc) and C++ (icpc) compilers
+ Version 17.0.0.098 Build 20160721
+ with NAG Fortran Compiler Release 6.1(Tozai)
+
+ Linux 3.10.0-327.10.1.el7 MPICH 3.2 compiled with GCC 5.3.0
+ #1 SMP x86_64 GNU/Linux
+ (moohan)
+
+ Fedora 29 4.20.10-200.fc29.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux
+ gcc, g++ (GCC) 8.2.1 20181215
+ (Red Hat 8.2.1-6)
+ GNU Fortran (GCC) 8.2.1 20181215
+ (Red Hat 8.2.1-6)
+ (cmake and autotools)
+
+ Windows 7 x64 Visual Studio 2008
+
+
+Known Problems
+==============
+
+ At present, metadata cache images may not be generated by parallel
+ applications. Parallel applications can read files with metadata cache
+ images, but since this is a collective operation, a deadlock is possible
+ if one or more processes do not participate.
+
+ Three tests fail with OpenMPI 3.0.0/GCC-7.2.0-2.29:
+ testphdf5 (ecdsetw, selnone, cchunk1, cchunk3, cchunk4, and actualio)
+ t_shapesame (sscontig2)
+ t_pflush1/fails on exit
+ The first two tests fail attempting collective writes.
+
+ CPP ptable test fails on VS2017 with Intel compiler, JIRA issue: HDFFV-10628.
+ This test will pass with VS2015 with Intel compiler.
+
+ Older MPI libraries such as OpenMPI 2.0.1 and MPICH 2.1.5 were tested
+ while attempting to resolve the Jira issue: HDFFV-10540.
+ The known problems of reading or writing > 2GBs when using MPI-2 was
+ partially resolved with the MPICH library. The proposed support recognizes
+ IO operations > 2GB and if the datatype is not a derived type, the library
+ breaks the IO into chunks which can be input or output with the existing
+ MPI 2 limitations, i.e. size reporting and function API size/count
+ arguments are restricted to be 32 bit integers. For derived types larger
+ than 2GB, MPICH 2.1.5 fails while attempting to read or write data.
+ OpenMPI in contrast, implements MPI-3 APIs even in the older releases
+ and thus does not suffer from the 32 bit size limitation described here.
+ OpenMPI releases prior to v3.1.3 appear to have other datatype issues however,
+ e.g. within a single parallel test (testphdf5) the subtests (cdsetr, eidsetr)
+ report data verfication errors before eventually aborting.
+ The most recent versions of OpenMPI (v3.1.3 or newer) have evidently
+ resolved these isses and parallel HDF5 testing does not currently report
+ errors though occasional hangs have been observed.
+
+ Known problems in previous releases can be found in the HISTORY*.txt files
+ in the HDF5 source. Please report any new problems found to
+ help@hdfgroup.org.
+
+
+CMake vs. Autotools installations
+=================================
+While both build systems produce similar results, there are differences.
+Each system produces the same set of folders on linux (only CMake works
+on standard Windows); bin, include, lib and share. Autotools places the
+COPYING and RELEASE.txt file in the root folder, CMake places them in
+the share folder.
+
+The bin folder contains the tools and the build scripts. Additionally, CMake
+creates dynamic versions of the tools with the suffix "-shared". Autotools
+installs one set of tools depending on the "--enable-shared" configuration
+option.
+ build scripts
+ -------------
+ Autotools: h5c++, h5cc, h5fc
+ CMake: h5c++, h5cc, h5hlc++, h5hlcc
+
+The include folder holds the header files and the fortran mod files. CMake
+places the fortran mod files into separate shared and static subfolders,
+while Autotools places one set of mod files into the include folder. Because
+CMake produces a tools library, the header files for tools will appear in
+the include folder.
+
+The lib folder contains the library files, and CMake adds the pkgconfig
+subfolder with the hdf5*.pc files used by the bin/build scripts created by
+the CMake build. CMake separates the C interface code from the fortran code by
+creating C-stub libraries for each Fortran library. In addition, only CMake
+installs the tools library. The names of the szip libraries are different
+between the build systems.
+
+The share folder will have the most differences because CMake builds include
+a number of CMake specific files for support of CMake's find_package and support
+for the HDF5 Examples CMake project.
+
%%%%1.10.4%%%%
HDF5 version 1.10.4 released on 2018-10-05
diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt
index 5d76b58..57cfd7e 100644
--- a/release_docs/INSTALL_CMake.txt
+++ b/release_docs/INSTALL_CMake.txt
@@ -31,7 +31,8 @@ Obtaining HDF5 source code
CMake version
1. We suggest you obtain the latest CMake from the Kitware web site.
The HDF5 1.10."X" product requires a minimum CMake version 3.10,
- where "X" is the current HDF5 release version.
+ where "X" is the current HDF5 release version. If you are using
+ VS2019, the minimum version is 3.15.
Note:
To change the install prefix from the platform defaults initialize
@@ -90,6 +91,10 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to:
5. From the "myhdfstuff" directory execute the CTest Script with the
following options:
+ On 32-bit Windows with Visual Studio 2019, execute:
+ ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2019 -C Release -VV -O hdf5.log
+ On 64-bit Windows with Visual Studio 2019, execute:
+ ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201964 -C Release -VV -O hdf5.log
On 32-bit Windows with Visual Studio 2017, execute:
ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2017 -C Release -VV -O hdf5.log
On 64-bit Windows with Visual Studio 2017, execute:
@@ -439,12 +444,11 @@ These five steps are described in detail below.
* MinGW Makefiles
* NMake Makefiles
* Unix Makefiles
- * Visual Studio 11 2012
- * Visual Studio 11 2012 Win64
- * Visual Studio 12 2013
- * Visual Studio 12 2013 Win64
* Visual Studio 14 2015
* Visual Studio 14 2015 Win64
+ * Visual Studio 15 2017
+ * Visual Studio 15 2017 Win64
+ * Visual Studio 16 2019
<options> is:
* SZIP_INCLUDE_DIR:PATH=<path to szip includes directory>
@@ -651,10 +655,8 @@ HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries"
HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF
HDF_TEST_EXPRESS "Control testing framework (0-3)" "0"
HDF5_TEST_VFD "Execute tests with different VFDs" OFF
-HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF
-HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF
-HDF5_USE_110_API_DEFAULT "Use the HDF5 1.10.x API by default" OFF
-HDF5_USE_112_API_DEFAULT "Use the HDF5 1.12.x API by default" ON
+HDF5_TEST_PASSTHROUGH_VOL "Execute tests with different passthrough VOL connectors" OFF
+DEFAULT_API_VERSION "Enable default API (v16, v18, v110)" "v110"
HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON
HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON
HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON
@@ -667,13 +669,13 @@ if (HDF5_TEST_VFD)
HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON
---------------- External Library Options ---------------------
-HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building" "NO"
-HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF
-HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF
-ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0
-SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0
+HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO"
+HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF
+HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF
+ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0
+SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0
if (HDF5_ENABLE_SZIP_SUPPORT)
- HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF
+ HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF
if (WINDOWS)
H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin"
else ()
diff --git a/release_docs/README_HDF5_CMake b/release_docs/README_HDF5_CMake
index 484710d..8df2ef5 100644
--- a/release_docs/README_HDF5_CMake
+++ b/release_docs/README_HDF5_CMake
@@ -1,21 +1,21 @@
-This tar file contains
+This tar file contains
build-unix.sh script to build HDF5 with CMake on unix machines
build-unix-hpc.sh script to build HDF5 with CMake on unix machines and run
tests with batch scripts (sbatch).
- CTestScript.cmake
+ CTestScript.cmake
HDF5config.cmake CMake scripts for building HDF5
HDF5options.cmake
- hdf5-1.10.5-pre1 HDF5 1.10.5-pre1 source
+ hdf5-1.10.6 HDF5 1.10.6 source
SZip.tar.gz source for building SZIP
ZLib.tar.gz source for building ZLIB
For more information about building HDF5 with CMake, see USING_HDF5_CMake.txt in
-hdf5-1.10.5-pre1/release_docs, or
+hdf5-1.10.6/release_docs, or
https://portal.hdfgroup.org/display/support/Building+HDF5+with+CMake.
-For more information about building HDF5 with CMake on HPC machines, including
-cross compiling on Cray XC40, see README_HPC in hdf5-1.10.5-pre1/release_docs.
+For more information about building HDF5 with CMake on HPC machines, including
+cross compiling on Cray XC40, see README_HPC in hdf5-1.10.6/release_docs.
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 2192811..f343af1 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.10.5 released on 2019-02-25
+HDF5 version 1.10.6 released on 2019-12-23
================================================================================
@@ -34,7 +34,7 @@ CONTENTS
- New Features
- Support for new platforms and languages
-- Bug Fixes since HDF5-1.10.4
+- Bug Fixes since HDF5-1.10.5
- Supported Platforms
- Tested Configuration Features Summary
- More Tested Platforms
@@ -47,455 +47,318 @@ New Features
Configuration:
-------------
- - Cross compile on mutrino and other Cray XC40 systems.
+ - Update CMake for VS2019 support
- Added support for CMake options to use CrayLinuxEnvironment, craype-mic-knl
- module for building with craype-haswell module for configuration, and
- batch scripts in bin/batch for use with sbatch or bsub to run tests in
- batch jobs on compute nodes. An instruction file README_HPC describing
- the use of these options was added in release_docs.
+ CMake added support for VS2019 in version 3.15. Changes to the CMake
+ generator setting required changes to scripts. Also updated version
+ references in CMake files as necessary.
- (LRK - 2019/02/18, TRILABS-34)
+ (ADB - 2019/11/18, HDFFV-10962)
- - Rework CMake command files to fix MPI testing.
+ - Update CMake options to match new autotools options
- Added setup fixture to remove any test generated files and added DEPENDS
- to test properties to execute tests in order expected.
+ Add configure options (autotools - CMake):
+ enable-asserts HDF5_ENABLE_ASSERTS
+ enable-symbols HDF5_ENABLE_SYMBOLS
+ enable-profiling HDF5_ENABLE_PROFILING
+ enable-optimization HDF5_ENABLE_OPTIMIZATION
+ In addition NDEBUG is no longer forced defined and relies on the CMake
+ process.
- (ADB - 2019/02/14, TRILABS-111)
+ (ADB - 2019/10/07, HDFFV-100901, HDFFV-10637, TRILAB-97)
- - Disable SZIP or ZLIB options if TGZ files are not available.
+ - Update CMake tests to use FIXTURES
- Changed the TGZ option for SZip and ZLib to disable the options
- if the source tar.gz files are not found.
+ CMake test fixtures allow setup/cleanup tests and other dependency
+ requirements as properties for tests. This is more flexible for
+ modern CMake code.
- (ADB - 2019/02/05, HDFFV-10697)
+ (ADB - 2019/07/23, HDFFV-10529)
- - Added a new option to enable/disable using pread/pwrite instead of
- read/write in the sec2, log, and core VFDs.
+ - Windows PDB files are always installed
- This option is enabled by default when pread/pwrite are detected.
+ There are build configuration or flag settings for Windows that may not
+ generate PDB files. If those files are not generated then the install
+ utility will fail because those PDB files are not found. An optional
+ variable, DISABLE_PDB_FILES, was added to not install PDB files.
- Autotools: --enable-preadwrite
- CMake: HDF5_ENABLE_PREADWRITE
+ (ADB - 2019/07/17, HDFFV-10424)
- (DER - 2019/02/03, HDFFV-10696)
+ - Add mingw CMake support with a toolchain file
- - Rework CMake versioning for OSX platforms.
+ There have been a number of mingw issues that have been linked under
+ HDFFV-10845. It has been decided to implement the CMake cross-compiling
+ technique of toolchain files. We will use a linux platform with the mingw
+ compiler stack for testing. Only the C language is fully supported, and
+ the error tests are skipped. The C++ language works for static but shared
+ builds have a shared library issue with the mingw Standard Exception Handling
+ library, which is not available on Windows. Fortran has a common cross-compile
+ problem with the fortran configure tests.
- Changed the current_version and compatibility_version flags from optional
- with HDF5_BUILD_WITH_INSTALL_NAME to always setting the flags for OSX.
+ (ADB - 2019/07/12, HDFFV-10845, HDFFV-10595)
- (ADB - 2019/01/22, HDFFV-10685)
+ - Windows PDB files are installed incorrectly
- - Rework CMake command files to eliminate developer CMP005 warning
+ For static builds, the PDB files for windows should be installed next
+ to the static libraries in the lib folder. Also the debug versions of
+ libraries and PDB files are now correctly built using the default
+ CMAKE_DEBUG_POSTFIX setting.
- Use variables without quotes in if () statements.
+ (ADB - 2019/07/09, HDFFV-10581)
- (ADB - 2019/01/18, TILABS-105)
+ - Add option to build only shared libs
- - Rework CMake configure files to eliminate developer CMP0075 warning
+ A request was made to prevent building static libraries and only build
+ shared. A new option was added to CMake, ONLY_SHARED_LIBS, which will
+ skip building static libraries. Certain utility functions will build with
+ static libs but are not published. Tests are adjusted to use the correct
+ libraries depending on SHARED/STATIC settings.
- Renamed varname to HDF5_REQUIRED_LIBRARIES as the contents were not
- required for configuration. Also moved check includes calls to top of
- files.
+ (ADB - 2019/06/12, HDFFV-10805)
- (ADB - 2019/01/03, HDFFV-10546)
+ - Add options to enable or disable building tools and tests
- - Keep stderr and stdout separate in tests
+ Configure options --enable-tests and --enable-tools were added for
+ autotools configure. These options are enabled by default, and can be
+ disabled with either --disable-tests (or tools) or --enable-tests=no
+ (or --enable-tools=no). Build time is reduced ~20% when tools are
+ disabled, 35% when tests are disabled, 45% when both are disabled.
+ Re-enabling them after the initial build requires running configure
+ again with the option(s) enabled.
- Changed test handling of output capture. Tests now keep the stderr
- output separate from the stdout output. It is up to the test to decide
- which output to check against a reference. Also added the option
- to grep for a string in either output.
+ (LRK - 2019/06/12, HDFFV-9976)
- (ADB - 2018/12/12, HDFFV-10632)
+ - Change tools tests to search the error stack
- - Incorrectly installed private header files were removed from
- CMake installs.
+ There are some use cases which can cause the error stack of tools to be
+ different then the expected output. These tests now use grepTest.cmake;
+ this was changed to allow the error file to be searched for an expected string.
- The CMake build files incorrectly flagged the following header files
- as public and installed them. They are private and will no longer be
- installed.
-
- HDF5 library private package files (H5Xpkg.h)
- H5Edefin.h
- H5Einit.h
- H5Eterm.h
- H5LTparse.h
- h5diff.h
- h5tools_dump.h
- h5tools.h
- h5tools_ref.h
- h5tools_str.h
- h5tools_utils.h
- h5trav.h
-
- (DER - 2018/10/26, HDFFV-10614, 10609)
-
- - Autotools installs now install H5FDwindows.h
-
- This is simply to align the installed header files between the
- autotools and CMake. H5FDwindows.h has no functionality on
- non-Windows systems.
-
- (DER - 2018/10/26, HDFFV-10614)
+ (ADB - 2019/04/15, HDFFV-10741)
Library:
--------
- - The sec2, log, and core VFDs can now use pread/pwrite instead of
- read/write.
-
- pread and pwrite do not change the file offset, a feature that was
- requested by a user working with a multi-threaded application.
-
- The option to configure this feature is described above.
-
- (DER - 2019/02/03, HDFFV-10696)
-
- - Add ability to minimze dataset object headers.
-
- Creation of many, very small datasets resulted in extensive file bloat
- due to extra space in the dataset object headers -- this space is
- allocated by default to allow for the insertion of a small number of
- attributes within the object header and not require a continuation
- block, an unnecessary provision in the target use case.
-
- Inform the library to expect no attributes on created datasets, and to
- allocate the least space possible for the object headers.
- NOTE: A continuation block is created if attributes are added to a
- 'minimized' dataset, which can reduce performance.
- NOTE: Some extra space is allocated for attributes essential to the
- correct behavior of the object header (store creation times, e.g.). This
- does not violate the design principle, as the space is calculated and
- allocated as needed at the time of dataset object header creation --
- unused space is not generated.
- New API calls:
- H5Fget_dset_no_attrs_hint
- H5Fset_dset_no_attrs_hint
- H5Pget_dset_no_attrs_hint
- H5Pset_dset_no_attrs_hint
-
- (JOS - 2019/01/04, TRILAB-45)
-
- - Added new chunk query functions
-
- The following public functions were added to discover information about
- the chunks in an HDF5 file.
- herr_t H5Dget_num_chunks(dset_id, fspace_id, *nchunks)
- herr_t H5Dget_chunk_info_by_coord(dset_id, *coord, *filter_mask, *addr, *size)
- herr_t H5Dget_chunk_info(dset_id, fspace_id, index, *coord, *filter_mask, *addr, *size)
-
- (BMR - 2018/11/07, HDFFV-10615)
-
- - Several empty public header files where removed from the distribution
-
- The following files were empty placeholders. They are for internal
- packages that are unlikely to ever have public functionality and have
- thus been removed.
-
- H5Bpublic.h
- H5B2public.h
- H5FSpublic.h
- H5HFpublic.h
- H5HGpublic.h
- H5HLpublic.h
-
- They were only installed in CMake builds.
-
- (DER - 2018/10/26, HDFFV-10614)
-
-
- Parallel Library:
- -----------------
- - Changed the default behavior in parallel when reading the same dataset in its entirety
- (i.e. H5S_ALL dataset selection) which is being read by all the processes collectively.
- The dataset must be contiguous, less than 2GB, and of an atomic datatype.
- The new behavior is the HDF5 library will use an MPI_Bcast to pass the data read from
- the disk by the root process to the remain processes in the MPI communicator associated
- with the HDF5 file.
-
- (MSB - 2019/01/02, HDFFV-10652)
-
- - All MPI-1 API calls have been replaced with MPI-2 equivalents.
-
- This was done to better support OpenMPI, as default builds no longer
- include MPI-1 support (as of OpenMPI 4.0).
-
- (DER - 2018/12/30, HDFFV-10566)
-
- Fortran Library:
- ----------------
- - Added wrappers for dataset object header minimization calls.
- (see the note for TRILAB-45, above)
-
- New API calls:
-
- h5fget_dset_no_attrs_hint_f
- h5fset_dset_no_attrs_hint_f
- h5pget_dset_no_attrs_hint_f
- h5pset_dset_no_attrs_hint_f
-
- (DER - 2019/01/09, TRILAB-45)
-
- - Added new Fortran derived type, c_h5o_info_t, which is interoperable with
- C's h5o_info_t. This is needed for callback functions which
- pass C's h5o_info_t data type definition.
-
- (MSB, 2019/01/08, HDFFV-10443)
-
- - Added new Fortran API, H5gmtime, which converts (C) 'time_t' structure
- to Fortran DATE AND TIME storage format.
-
- (MSB, 2019/01/08, HDFFV-10443)
-
- - Added new Fortran 'fields' optional parameter to: h5ovisit_f, h5oget_info_by_name_f,
- h5oget_info, h5oget_info_by_idx and h5ovisit_by_name_f.
-
- (MSB, 2019/01/08, HDFFV-10443)
+ - Added S3 and HDFS Virtual File Drivers (VFDs) to HDF5
+
+ These new VFDs have been introduced in HDF5-1.10.6. Instructions to
+ enable them when configuring HDF5 on Linux and Mac may be found at
+ https://portal.hdfgroup.org/display/HDF5/Virtual+File+Drivers+-+S3+and+HDFS.
+
+ Installing on Windows requires CMake 3.13 and the following additional setup.
+ Install openssl library (with dev files);
+ from "Shining Light Productions". msi package preferred.
+
+ PATH should have been updated with the installation dir.
+ set ENV variable OPENSSL_ROOT_DIR to the installation dir.
+ set ENV variable OPENSSL_CONF to the cfg file, likely %OPENSSL_ROOT_DIR%\bin\openssl.cfg
+ Install libcurl library (with dev files);
+ download the latest released version using git: https://github.com/curl/curl.git
+
+ Open a Visual Studio Command prompt
+ change to the libcurl root folder
+ run the "buildconf.bat" batch file
+ change to the winbuild directory
+ nmake /f Makefile.vc mode=dll MACHINE=x64
+ copy libcurl-vc-x64-release-dll-ipv6-sspi-winssl dir to C:\curl (installation dir)
+ set ENV variable CURL_ROOT to C:\curl (installation dir)
+ update PATH ENV variable to %CURL_ROOT%\bin (installation bin dir).
+ the aws credentials file should be in %USERPROFILE%\.aws folder
+ set the ENV variable "HDF5_ROS3_TEST_BUCKET_URL=https://s3.us-east-2.amazonaws.com/hdf5ros3"
+
+ (ADB - 2019/09/12, HDFFV-10854)
C++ Library:
------------
- - Added new function to the C++ interface
-
- Added wrapper for H5Ovisit2:
- H5Object::visit()
+ - Added new wrappers for H5Pset/get_create_intermediate_group()
+ LinkCreatPropList::setCreateIntermediateGroup()
+ LinkCreatPropList::getCreateIntermediateGroup()
- (BMR - 2019/02/14, HDFFV-10532)
+ (BMR - 2019/04/22, HDFFV-10622)
Java Library:
----------------
- - Rewrote the JNI error handling to be much cleaner
-
- (JTH - 2019/02/12)
-
- - Add new functions to java interface
-
- Added wrappers for:
- H5Fset_libver_bounds
- H5Fget_dset_no_attrs_hint/H5Fset_dset_no_attrs_hint
- H5Pget_dset_no_attrs_hint/H5Pset_dset_no_attrs_hint
-
- (ADB - 2019/01/07, HDFFV-10664)
-
- - Fix java unit tests when Time is a natural number
-
- Time substitution in java/test/junit.sh.in doesn't
- handle the case when Time is a natural number. Fixed
- the regular expression.
-
- (ADB - 2019/01/07, HDFFV-10674)
-
- - Duplicate the data read/write functions of Datasets for Attributes.
-
- Region references could not be displayed for attributes as they could
- for datasets. Datasets had overloaded read and write functions for different
- datatypes that were not available for attributes. After adding similar
- functions, attribute region references work normally.
-
- (ADB - 2018/12/12, HDFVIEW-4)
+ - Fixed a failure in JUnit-TestH5P on 32-bit architectures
+ (JTH - 2019/04/30)
- Tools:
- ------
- - The h5repart -family-to-sec2 argument was changed to -family-to-single
- In order to better support other single-file VFDs which could work with
- h5repart, the -family-to-sec2 argument was renamed to -family-to-single.
- This is just a name change and the functionality of the argument has not
- changed.
+Support for new platforms, languages and compilers.
+=======================================
+ - CMake added support for VS2019 in version 3.15. Updated scripts.
- The -family-to-sec2 argument has been kept for backwards-compatibility.
- This argument should be considered deprecated.
+ - macOS 10.13.6 Darwin 17.7.0 with Apple clang LLVM version 10.0.0
- (DER - 2018/11/14, HDFFV-10633)
+ - macOS 10.14.6 Darwin 18.7.0 with Apple clang LLVM version 10.0.1
-Bug Fixes since HDF5-1.10.4 release
+Bug Fixes since HDF5-1.10.5 release
==================================
Library
-------
- - Fix hangs with collective metadata reads during chunked dataset I/O
+ - Improved performance when creating a large number of small datasets by
+ retrieving default property values from the API context instead of doing
+ skip list searches. More work is required to achieve parity with HDF5 1.8.
- In the parallel library, it was discovered that when a particular
- sequence of operations following a pattern of:
+ (CJH - 2019/12/10, HDFFV-10658)
- "write to chunked dataset" -> "flush file" -> "read from dataset"
+ - Fixed user-created data access properties not existing in the property list
+ returned by H5Dget_access_plist. Thanks to Steven Varga for submitting a
+ reproducer and a patch.
- occurred with collective metadata reads enabled, hangs could be
- observed due to certain MPI ranks not participating in the collective
- metadata reads.
+ (CJH - 2019/12/9, HDFFV-10934)
- To fix the issue, collective metadata reads are now disabled during
- chunked dataset raw data I/O.
+ - Inappropriate linking with deprecated MPI C++ libraries
- (JTH - 2019/02/11, HDFFV-10563, HDFFV-10688)
+ HDF5 does not define *_SKIP_MPICXX in the public headers, so applications
+ can inadvertently wind up linking to the deprecated MPI C++ wrappers.
- - Performance issue when closing an object
+ MPICH_SKIP_MPICXX and OMPI_SKIP_MPICXX have both been defined in H5public.h
+ so this should no longer be an issue. HDF5 makes no use of the deprecated
+ MPI C++ wrappers.
- The slow down is due to the search of the "tag_list" to find
- out the "corked" status of an object and "uncork" it if so.
+ (DER - 2019/09/17, HDFFV-10893)
- Improve performance by skipping the search of the "tag_list"
- if there are no "corked" objects when closing an object.
+ - fcntl(2)-based file locking incorrectly passed the lock argument struct
+ instead of a pointer to the struct, causing errors on systems where
+ flock(2) is not available.
- (VC - 2019/02/06)
+ File locking is used when files are opened to enforce SWMR semantics. A
+ lock operation takes place on all file opens unless the
+ HDF5_USE_FILE_LOCKING environment variable is set to the string "FALSE".
+ flock(2) is preferentially used, with fcntl(2) locks as a backup if
+ flock(2) is unavailable on a system (if neither is available, the lock
+ operation fails). On these systems, the file lock will often fail, which
+ causes HDF5 to not open the file and report an error.
- - Uninitialized bytes from a type conversion buffer could be written
- to disk in H5Dwrite calls where type conversion takes place
- and the type conversion buffer was created by the HDF5 library.
+ This bug only affects POSIX systems. Win32 builds on Windows use a no-op
+ locking call which always succeeds. Systems which exhibit this bug will
+ have H5_HAVE_FCNTL defined but not H5_HAVE_FLOCK in the configure output.
- When H5Dwrite is called and datatype conversion must be performed,
- the library will create a temporary buffer for type conversion if
- one is not provided by the user via H5Pset_buffer. This internal
- buffer is allocated via malloc and contains uninitialized data. In
- some datatype conversions (float to long double, possibly others),
- some of this uninitialized data could be written to disk.
+ This bug affects HDF5 1.10.0 through 1.10.5.
- This was flagged by valgrind in the dtransform test and does not
- appear to be a common occurrence (it is flagged in one test out
- of the entire HDF5 test suite).
+ fcntl(2)-based file locking now correctly passes the struct pointer.
- Switching to calloc fixed the problem.
+ (DER - 2019/08/27, HDFFV-10892)
- (DER - 2019/02/03, HDFFV-10694)
+ - Fixed a bug caused by a bad tag value when condensing object header
+ messages
- - There was missing protection against division by zero reported to
- The HDF Group as issue #CVE-2018-17434.
+ There was an assertion failure when moving messages from running a
+ user test program with library release HDF5 1.10.4. It was because
+ the tag value (object header's address) was not set up when entering
+ the library routine H5O__chunk_update_idx(), which eventually
+ verifies the metadata tag value when protecting the object header.
- Protection against division by zero was added to address the issue
- #CVE-2018-17434.
+ The problem was fixed by replacing FUNC_ENTER_PACKAGE in H5O__chunk_update_idx()
+ with FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) to set up the metadata tag.
- (BMR - 2019/01/29, HDFFV-10586)
+ (VC - 2019/08/23, HDFFV-10873)
- - The issue CVE-2018-17437 was reported to The HDF Group
+ - Fixed the test failure from test_metadata_read_retry_info() in
+ test/swmr.c
- Although CVE-2018-17437 reported a memory leak, the actual issue
- was invalid read. It was found that the attribute name length
- in an attribute message was corrupted, which caused the buffer
- pointer to be advanced too far and later caused an invalid read.
+ The test failure is due to an incorrect number of bins returned for
+ retry info (info.nbins). The # of bins expected for 101 read attempts
+ is 3 instead of 2. The routine H5F_set_retries() in src/H5Fint.c
+ calculates the # of bins by first obtaining the log10 value for
+ (read attempts - 1). For PGI/19, the log10 value for 100 read attempts
+ is 1.9999999999999998 instead of 2.00000. When casting the log10 value
+ to unsigned later on, the decimal part is chopped off causing the test
+ failure.
- A check was added to detect when the attribute name or its length
- was corrupted and report the potential of data corruption.
+ This was fixed by obtaining the rounded integer value (HDceil) for the
+ log10 value of read attempts first before casting the result to unsigned.
- (BMR - 2019/01/29, HDFFV-10588)
+ (VC - 2019/8/14, HDFFV-10813)
- - H5Ewalk did not stop when it was supposed to
+ - Fixed an issue when creating a file with non-default file space info
+ together with library high bound setting to H5F_LIBVER_V18.
- H5Ewalk was supposed to stop when the callback function stopped
- even though the errors in the stack were not all visited, but it
- did not. This problem is now fixed.
+ When setting non-default file space info in fcpl via
+ H5Pset_file_space_strategy() and then creating a file with both high and
+ low library bounds set to H5F_LIBVER_V18 in fapl, the library succeeds in
+ creating the file. File creation should fail because the feature of
+ setting non-default file space info does not exist in library release 1.8
+ or earlier.
- (BMR - 2019/01/29, HDFFV-10684)
+ This was fixed by setting and checking the proper version in the file
+ space info message based on the library low and high bounds when creating
+ and opening the HDF5 file.
- - Revert H5Oget_info* and H5Ovisit* functions
+ (VC - 2019/6/25, HDFFV-10808)
- In 1.10.3 new H5Oget_info*2 and H5Ovisit*2 functions were
- added for performance. Inadvertently, the original functions;
- H5Oget_info,
- H5Oget_info_by_name,
- H5Oget_info_by_idx,
- H5Ovisit,
- H5Ovisit_by_name
- were versioned to H5Oget_info*1 and H5Ovisit*1. This
- broke the API compatibility for a maintenance release. The
- original functions have been restored.
+ - Fixed an issue where copying a version 1.8 dataset between files using
+ H5Ocopy fails due to an incompatible fill version
- (ADB - 2019/01/24, HDFFV-10686)
+ When using the HDF5 1.10.x H5Ocopy() API call to copy a version 1.8
+ dataset to a file created with both high and low library bounds set to
+ H5F_LIBVER_V18, the H5Ocopy() call will fail with the error stack indicating
+ that the fill value version is out of bounds.
- - Fixed a potential invalid memory access and failure that could occur when
- decoding an unknown object header message (from a future version of the
- library).
+ This was fixed by changing the fill value message version to H5O_FILL_VERSION_3
+ (from H5O_FILL_VERSION_2) for H5F_LIBVER_V18.
- (NAF - 2019/01/07)
+ (VC - 2019/6/14, HDFFV-10800)
- - Deleting attributes in dense storage
+ - Fixed a bug that would cause an error or cause fill values to be
+ incorrectly read from a chunked dataset using the "single chunk" index if
+ the data was held in cache and there was no data on disk.
- The library aborts with "infinite loop closing library" after
- attributes in dense storage are created and then deleted.
+ (NAF - 2019/03/06)
- When deleting the attribute nodes from the name index v2 B-tree,
- if an attribute is found in the intermediate B-tree nodes,
- which may be merged/redistributed in the process, we need to
- free the dynamically allocated spaces for the intermediate
- decoded attribute.
+ - Fixed a bug that could cause an error or cause fill values to be
+ incorrectly read from a dataset that was written to using H5Dwrite_chunk
+ if the dataset was not closed after writing.
- (VC - 2018/12/26, HDFFV-10659)
+ (NAF - 2019/03/06, HDFFV-10716)
- - There was missing protection against division by zero reported to
- The HDF Group as issue #CVE-2018-17233.
+ - Fixed memory leak in scale offset filter
- Protection against division by zero was added to address the issue
- #CVE-2018-17233. In addition, several similar occurrences in the same
- file were fixed as well.
+ In a special case where the MinBits is the same as the number of bits in
+ the datatype's precision, the filter's data buffer was not freed, causing
+ the memory usage to grow. In general the buffer was freed correctly. The
+ Minbits are the minimal number of bits to store the data values. Please
+ see the reference manual for H5Pset_scaleoffset for the details.
- (BMR - 2018/12/23, HDFFV-10577)
+ (RL - 2019/3/4, HDFFV-10705)
- - Fixed an issue where the parallel filters tests would fail
- if zlib was not available on the system. Until support can
- be added in the tests for filters beyond gzip/zlib, the tests
- will be skipped if zlib is not available.
- (JTH - 2018/12/05)
-
- - A bug was discovered in the parallel library where an application
- would eventually consume all of the available MPI communicators
- when continually writing to a compressed dataset in parallel. This
- was due to internal copies of an HDF5 File Access Property List,
- which each contained a copy of the MPI communicator, not being
- closed at the end of each write operation. This problem was
- exacerbated by larger numbers of processors.
-
- (JTH - 2018/12/05, HDFFV-10629)
-
-
- Fortran
- --------
- - Fixed issue with Fortran not returning h5o_info_t field values
- meta_size%attr%index_size and meta_size%attr%heap_size.
-
- (MSB, 2019/01/08, HDFFV-10443)
-
- - Added symbolic links libhdf5_hl_fortran.so to libhdf5hl_fortran.so and
- libhdf5_hl_fortran.a to libhdf5hl_fortran.a in hdf5/lib directory for
- autotools installs. These were added to match the name of the files
- installed by cmake and the general pattern of hl lib files. We will
- change the names of the installed lib files to the matching name in
- the next major release.
-
- (LRK - 2019/01/04, HDFFV-10596)
-
- - Made Fortran specific subroutines PRIVATE in generic procedures.
+ Configuration
+ -------------
+ - Correct option for default API version
- Affected generic procedures were functions in H5A, H5D, H5P, H5R and H5T.
+ CMake options for default API version are not mutually exclusive.
+ Change the multiple BOOL options to a single STRING option with the
+ strings; v16, v18, v110.
- (MSB, 2018/12/04, HDFFV-10511)
+ (ADB - 2019/08/12, HDFFV-10879)
+ Tools
+ -----
+ - h5repack was fixed to repack datasets with external storage
+ to other types of storage.
- Testing
- -------
- - Fixed a test failure in testpar/t_dset.c caused by
- the test trying to use the parallel filters feature
- on MPI-2 implementations.
+ New test added to repack files and verify the correct data using h5diff.
- (JTH, 2019/2/7)
+ (JS - 2019/09/25, HDFFV-10408)
+ (ADB - 2019/10/02, HDFFV-10918)
Supported Platforms
===================
- Linux 2.6.32-696.16.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
- #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
- (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
+ Linux 2.6.32-696.20.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
+ #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
+ (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
IBM XL C/C++ V13.1
IBM XL Fortran V15.1
Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++)
#1 SMP x86_64 GNU/Linux compilers:
- (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4)
+ (jelly/kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4)
Version 4.9.3, Version 5.2.0
Intel(R) C (icc), C++ (icpc), Fortran (icc)
compilers:
@@ -506,28 +369,24 @@ Supported Platforms
(emu) Sun Fortran 95 8.6 SunOS_sparc
Sun C++ 5.12 SunOS_sparc
- Windows 7 Visual Studio 2015 w/ Intel Fortran 16 (cmake)
+ Windows 7 Visual Studio 2015 w/ Intel Fortran 18 (cmake)
- Windows 7 x64 Visual Studio 2013
- Visual Studio 2015 w/ Intel Fortran 16 (cmake)
- Visual Studio 2015 w/ Intel C, Fortran 2018 (cmake)
+ Windows 7 x64 Visual Studio 2015 w/ Intel C, Fortran 2018 (cmake)
Visual Studio 2015 w/ MSMPI 8 (cmake)
Windows 10 Visual Studio 2015 w/ Intel Fortran 18 (cmake)
Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 18 (cmake)
- Visual Studio 2017 w/ Intel Fortran 18 (cmake)
-
- Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.1 from Xcode 7.0
- 64-bit gfortran GNU Fortran (GCC) 4.9.2
- (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3
+ Visual Studio 2017 w/ Intel Fortran 19 (cmake)
+ Visual Studio 2019 w/ Intel Fortran 19 (cmake)
- Mac OS X El Capitan 10.11.6 Apple clang/clang++ version 7.3.0 from Xcode 7.3
- 64-bit gfortran GNU Fortran (GCC) 5.2.0
- (osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2
+ macOS 10.13.6, Darwin, Apple clang LLVM version 10.0.0
+ 17.7.0, x86_64 gfortran GNU Fortran (GCC) 6.3.0
+ (bear) Intel icc/icpc/ifort version 19.0.4
- MacOS High Sierra 10.13.6 Apple LLVM version 10.0.0 (clang/clang++-1000.10.44.4)
- 64-bit gfortran GNU Fortran (GCC) 8.3.0
+ macOS 10.14.6, Darwin Apple clang LLVM version 10.0.1
+ 18.7.0, x86_64 gfortran GNU Fortran (GCC) 6.3.0
+ (bobcat) Intel icc/icpc/ifort version 19.0.4
Tested Configuration Features Summary
@@ -588,7 +447,7 @@ More Tested Platforms
=====================
The following configurations are not supported but have been tested for this release.
- Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++)
+ Linux 2.6.32-754.11.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++)
#1 SMP x86_64 GNU/Linux compilers:
(mayll/platypus) Version 4.4.7 20120313
Version 4.9.3, 5.3.0, 6.2.0
@@ -602,31 +461,45 @@ The following configurations are not supported but have been tested for this rel
Linux 3.10.0-327.18.2.el7 GNU C (gcc) and C++ (g++) compilers
#1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4)
- (jelly) with NAG Fortran Compiler Release 6.1(Tozai)
+ (jelly) with NAG Fortran Compiler Release 6.2(Chiyoda)
GCC Version 7.1.0
MPICH 3.2-GCC-4.9.3
MPICH 3.2.1-GCC-7.2.0-2.29
OpenMPI 2.1.5-GCC-7.2.0-2.29
Intel(R) C (icc) and C++ (icpc) compilers
Version 17.0.0.098 Build 20160721
- with NAG Fortran Compiler Release 6.1(Tozai)
+ with NAG Fortran Compiler Release 6.2(Chiyoda)
Linux 3.10.0-327.10.1.el7 MPICH 3.2 compiled with GCC 5.3.0
#1 SMP x86_64 GNU/Linux
(moohan)
- Fedora 29 4.20.10-200.fc29.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux
- gcc, g++ (GCC) 8.2.1 20181215
- (Red Hat 8.2.1-6)
- GNU Fortran (GCC) 8.2.1 20181215
- (Red Hat 8.2.1-6)
- (cmake and autotools)
+ Linux 2.6.32-573.18.1.el6.ppc64 MPICH mpich 3.1.4 compiled with
+ #1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1
+ (ostrich) and IBM XL Fortran for Linux, V15.1
+
+ Fedora30 5.3.11-200.fc30.x86_64
+ #1 SMP x86_64 GNU/Linux GNU gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1 20190827)
+ GNU Fortran (GCC) 9.2.1 20190827 (Red Hat 9.2.1 20190827)
+ (cmake and autotools)
+
+ Mac OS X 10.11.6, Darwin, Apple clang version 7.3.0 from Xcode 7.3
+ 15.6.0, x86-64 gfortran GNU Fortran (GCC) 5.2.0
+ (osx1011test) Intel icc/icpc/ifort version 16.0.2
+
+ macOS 10.12.6, Darwin, Apple clang LLVM version 8.1.0 from Xcode 8.3
+ 16.6.0, x86_64 gfortran GNU Fortran (GCC) 7.1.0
+ (kite) Intel icc/icpc/ifort version 17.0.2
Windows 7 x64 Visual Studio 2008
Known Problems
==============
+ CMake files do not behave correctly with paths containing spaces.
+ Do not use spaces in paths because the required escaping for handling spaces
+ results in very complex and fragile build files.
+ ADB - 2019/05/07
At present, metadata cache images may not be generated by parallel
applications. Parallel applications can read files with metadata cache
@@ -639,6 +512,12 @@ Known Problems
t_pflush1/fails on exit
The first two tests fail attempting collective writes.
+ Parallel builds using OpenMPI 3.03 or later and romio fail several tests
+ with collective writes or compression that will not fail when ompio is used
+ instead of romio. This can be done by adding "--mca io ompio" to the mpirun
+ command. For example, in autotools builds RUNPARALLEL can be set to
+ "mpirun --mca io ompio -n 6" provided ompio is installed.
+
CPP ptable test fails on VS2017 with Intel compiler, JIRA issue: HDFFV-10628.
This test will pass with VS2015 with Intel compiler.
diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt
index d5fae39..21e153f 100644
--- a/release_docs/USING_CMake_Examples.txt
+++ b/release_docs/USING_CMake_Examples.txt
@@ -22,7 +22,7 @@ I. Preconditions
1. We suggest you obtain the latest CMake for windows from the Kitware
web site. The HDF5 1.10.x product requires a minimum CMake version
- of 3.2.2.
+ of 3.10.2. If you are using VS2019, the minimum version is 3.15.
2. You have installed the HDF5 library built with CMake, by executing
the HDF Install Utility (the *.msi file in the binary package for
@@ -38,12 +38,16 @@ II. Building HDF5 Examples with CMake
Files in the HDF5 install directory:
HDF5Examples folder
+ CTestScript.cmake
HDF5_Examples.cmake
+ HDF5_Examples_options.cmake
Default installation process:
Create a directory to run the examples, i.e. \test_hdf5.
Copy HDF5Examples folder to this directory.
+ Copy CTestScript.cmake to this directory.
Copy HDF5_Examples.cmake to this directory.
+ Copy HDF5_Examples_options.cmake to this directory.
The default source folder is defined as "HDF5Examples". It can be changed
with the CTEST_SOURCE_NAME script option.
The default installation folder is defined for the platform.
@@ -54,8 +58,9 @@ Default installation process:
with the CTEST_CONFIGURATION_TYPE script option. Note that this must
be the same as the value used with the -C command line option.
The default build configuration is defined to build and use static libraries.
- Shared libraries can be used with the STATIC_ONLY script option set to "NO".
- Other options can be changed by editing the HDF5_Examples.cmake file.
+
+ Shared libraries and other options can be changed by editing the
+ HDF5_Examples_options.cmake file.
If the defaults are okay, execute from this directory:
ctest -S HDF5_Examples.cmake -C Release -V -O test.log
@@ -69,9 +74,16 @@ Default installation process:
========================================================================
-III. Other changes to the HDF5_Examples.cmake file
+III. Defaults in the HDF5_Examples_options.cmake file
========================================================================
-Line 45-48: uncomment to use a source tarball or zipfile;
- Add script option "TAR_SOURCE=MySource.tar".
+#### DEFAULT: ###
+#### BUILD_SHARED_LIBS:BOOL=OFF ###
+#### HDF_BUILD_C:BOOL=ON ###
+#### HDF_BUILD_CXX:BOOL=OFF ###
+#### HDF_BUILD_FORTRAN:BOOL=OFF ###
+#### HDF_BUILD_JAVA:BOOL=OFF ###
+#### BUILD_TESTING:BOOL=OFF ###
+#### HDF_ENABLE_PARALLEL:BOOL=OFF ###
+#### HDF_ENABLE_THREADSAFE:BOOL=OFF ###
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 01434ba..0538ddd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -219,11 +219,14 @@ set (H5FD_SOURCES
${HDF5_SRC_DIR}/H5FDcore.c
${HDF5_SRC_DIR}/H5FDdirect.c
${HDF5_SRC_DIR}/H5FDfamily.c
+ ${HDF5_SRC_DIR}/H5FDhdfs.c
${HDF5_SRC_DIR}/H5FDint.c
${HDF5_SRC_DIR}/H5FDlog.c
${HDF5_SRC_DIR}/H5FDmpi.c
${HDF5_SRC_DIR}/H5FDmpio.c
${HDF5_SRC_DIR}/H5FDmulti.c
+ ${HDF5_SRC_DIR}/H5FDros3.c
+ ${HDF5_SRC_DIR}/H5FDs3comms.c
${HDF5_SRC_DIR}/H5FDsec2.c
${HDF5_SRC_DIR}/H5FDspace.c
${HDF5_SRC_DIR}/H5FDstdio.c
@@ -235,11 +238,14 @@ set (H5FD_HDRS
${HDF5_SRC_DIR}/H5FDcore.h
${HDF5_SRC_DIR}/H5FDdirect.h
${HDF5_SRC_DIR}/H5FDfamily.h
+ ${HDF5_SRC_DIR}/H5FDhdfs.h
${HDF5_SRC_DIR}/H5FDlog.h
${HDF5_SRC_DIR}/H5FDmpi.h
${HDF5_SRC_DIR}/H5FDmpio.h
${HDF5_SRC_DIR}/H5FDmulti.h
${HDF5_SRC_DIR}/H5FDpublic.h
+ ${HDF5_SRC_DIR}/H5FDros3.h
+ ${HDF5_SRC_DIR}/H5FDs3comms.h
${HDF5_SRC_DIR}/H5FDsec2.h
${HDF5_SRC_DIR}/H5FDstdio.h
${HDF5_SRC_DIR}/H5FDwindows.h
@@ -928,13 +934,13 @@ if (LOCAL_BATCH_TEST)
endif ()
endif ()
-if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c)
+if (NOT EXISTS "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c")
add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
- target_include_directories(H5detect PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (H5detect PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_definitions(H5detect PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
TARGET_C_PROPERTIES (H5detect STATIC)
target_link_libraries (H5detect
- PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
PRIVATE $<$<PLATFORM_ID:Emscripten>:"-O0">
)
@@ -975,7 +981,7 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c)
add_custom_command (
OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5detect>
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5detect>
ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
COMMAND ${CMAKE_COMMAND}
ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1
@@ -1020,18 +1026,18 @@ else ()
endif ()
add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
-target_include_directories(H5make_libsettings PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories (H5make_libsettings PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_definitions(H5make_libsettings PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
TARGET_C_PROPERTIES (H5make_libsettings STATIC)
target_link_libraries (H5make_libsettings
- PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
PRIVATE $<$<PLATFORM_ID:Emscripten>:"-O0">
)
add_custom_command (
OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
${HDF5_BINARY_DIR}/gen_SRCS.stamp2
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5make_libsettings>
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5make_libsettings>
ARGS ${HDF5_BINARY_DIR}/H5lib_settings.c
COMMAND ${CMAKE_COMMAND}
ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2
@@ -1060,42 +1066,49 @@ option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF)
#-----------------------------------------------------------------------------
# Add H5Tinit source to build - generated by H5detect/CMake at configure time
#-----------------------------------------------------------------------------
-set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c)
-add_custom_target (gen_${HDF5_LIB_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2)
-
-add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS})
-target_include_directories(${HDF5_LIB_TARGET}
- PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-target_compile_definitions(${HDF5_LIB_TARGET}
- PUBLIC
- ${HDF_EXTRA_C_FLAGS}
- ${HDF_EXTRA_FLAGS}
- $<IF:$<CONFIG:Debug>,DEBUG,NDEBUG>
- PRIVATE
- $<$<BOOL:${HDF5_ENABLE_TRACE}>:H5_DEBUG_API> # Enable tracing of the API
- $<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG>
-)
-TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC)
-target_link_libraries (${HDF5_LIB_TARGET}
- PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
- PUBLIC $<$<NOT:$<PLATFORM_ID:Windows>>:${CMAKE_DL_LIBS}>
-)
-set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET})
-H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC 0)
-set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries)
-add_dependencies (${HDF5_LIB_TARGET} gen_${HDF5_LIB_TARGET})
-
-set (install_targets ${HDF5_LIB_TARGET})
+if (NOT ONLY_SHARED_LIBS)
+ set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c)
+ add_custom_target (gen_${HDF5_LIB_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2)
+
+ add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS})
+ target_include_directories (${HDF5_LIB_TARGET}
+ PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ target_compile_definitions(${HDF5_LIB_TARGET}
+ PUBLIC
+ ${HDF_EXTRA_C_FLAGS}
+ ${HDF_EXTRA_FLAGS}
+ PRIVATE
+ $<$<BOOL:${HDF5_ENABLE_TRACE}>:H5_DEBUG_API> # Enable tracing of the API
+ $<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG>
+ )
+ TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC)
+ target_link_libraries (${HDF5_LIB_TARGET}
+ PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
+ PUBLIC $<$<NOT:$<PLATFORM_ID:Windows>>:${CMAKE_DL_LIBS}>
+ )
+ if (NOT WIN32)
+ target_link_libraries (${HDF5_LIB_TARGET}
+ PRIVATE $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>
+ )
+ endif ()
+ set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET})
+ H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC 0)
+ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries)
+ add_dependencies (${HDF5_LIB_TARGET} gen_${HDF5_LIB_TARGET})
+
+ set (install_targets ${HDF5_LIB_TARGET})
+endif ()
if (BUILD_SHARED_LIBS)
set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c)
add_custom_target (gen_${HDF5_LIBSH_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp2)
add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS})
- target_include_directories(${HDF5_LIBSH_TARGET}
+ target_include_directories (${HDF5_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ PUBLIC "$<$<BOOL:${HDF5_ENABLE_HDFS}>:${HDFS_INCLUDE_DIR}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
target_compile_definitions(${HDF5_LIBSH_TARGET}
@@ -1103,7 +1116,6 @@ if (BUILD_SHARED_LIBS)
"H5_BUILT_AS_DYNAMIC_LIB"
${HDF_EXTRA_C_FLAGS}
${HDF_EXTRA_FLAGS}
- $<IF:$<CONFIG:Debug>,DEBUG,NDEBUG>
PRIVATE
$<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:H5_HAVE_THREADSAFE>
$<$<BOOL:${HDF5_ENABLE_TRACE}>:H5_DEBUG_API> # Enable tracing of the API
@@ -1111,8 +1123,8 @@ if (BUILD_SHARED_LIBS)
)
TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_LIBSH_TARGET}
- PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
- PUBLIC $<$<NOT:$<PLATFORM_ID:Windows>>:${CMAKE_DL_LIBS}> $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>
+ PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>
+ PUBLIC $<$<NOT:$<PLATFORM_ID:Windows>>:${CMAKE_DL_LIBS}>
)
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED "LIB")
@@ -1145,7 +1157,9 @@ if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries)
endif ()
- INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries)
+ if (NOT ONLY_SHARED_LIBS)
+ INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} libraries)
+ endif ()
install (
TARGETS
@@ -1174,7 +1188,9 @@ foreach (libs ${LINK_LIBS} ${LINK_COMP_LIBS})
set (_PKG_CONFIG_LIBS_PRIVATE "${_PKG_CONFIG_LIBS_PRIVATE} -l${libs}")
endforeach ()
-set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_LIB_CORENAME}")
+if (NOT ONLY_SHARED_LIBS)
+ set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_LIB_CORENAME}")
+endif ()
if (BUILD_SHARED_LIBS)
set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_LIB_CORENAME}")
endif ()
diff --git a/src/H5.c b/src/H5.c
index 5e342ff..96b4a5b 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -262,7 +262,7 @@ H5_term_library(void)
/* Don't do anything if the library is already closed */
if(!(H5_INIT_GLOBAL))
- goto done;
+ goto done;
/* Indicate that the library is being shut down */
H5_TERM_GLOBAL = TRUE;
@@ -379,18 +379,18 @@ H5_term_library(void)
* down if any of the below code involves using the instrumentation code.
*/
if(H5_MPEinit_g) {
- int mpi_initialized;
- int mpi_finalized;
- int mpe_code;
+ int mpi_initialized;
+ int mpi_finalized;
+ int mpe_code;
- MPI_Initialized(&mpi_initialized);
- MPI_Finalized(&mpi_finalized);
+ MPI_Initialized(&mpi_initialized);
+ MPI_Finalized(&mpi_finalized);
if (mpi_initialized && !mpi_finalized) {
- mpe_code = MPE_Finish_log("h5log");
- HDassert(mpe_code >=0);
- } /* end if */
- H5_MPEinit_g = FALSE; /* turn it off no matter what */
+ mpe_code = MPE_Finish_log("h5log");
+ HDassert(mpe_code >=0);
+ } /* end if */
+ H5_MPEinit_g = FALSE; /* turn it off no matter what */
} /* end if */
#endif
diff --git a/src/H5A.c b/src/H5A.c
index a0408c3..3af0560 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -16,22 +16,22 @@
/****************/
#include "H5Amodule.h" /* This source code file is part of the H5A module */
-#define H5O_FRIEND /*suppress error about including H5Opkg */
+#define H5O_FRIEND /* Suppress error about including H5Opkg */
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Apkg.h" /* Attributes */
-#include "H5CXprivate.h" /* API Contexts */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
-#include "H5Sprivate.h" /* Dataspace functions */
-#include "H5SMprivate.h" /* Shared Object Header Messages */
+#include "H5private.h" /* Generic Functions */
+#include "H5Apkg.h" /* Attributes */
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
+#include "H5Sprivate.h" /* Dataspace functions */
+#include "H5SMprivate.h" /* Shared Object Header Messages */
/****************/
@@ -216,59 +216,64 @@ H5A_term_package(void)
/*--------------------------------------------------------------------------
- NAME
- H5Acreate2
- PURPOSE
- Creates an attribute on an object
- USAGE
- hid_t H5Acreate2(loc_id, attr_name, type_id, space_id, acpl_id,
- aapl_id)
- hid_t loc_id; IN: Object (dataset or group) to be attached to
- const char *attr_name; IN: Name of attribute to locate and open
- hid_t type_id; IN: ID of datatype for attribute
- hid_t space_id; IN: ID of dataspace for attribute
- hid_t acpl_id; IN: ID of creation property list (currently not used)
- hid_t aapl_id; IN: Attribute access property list
- RETURNS
- Non-negative on success/Negative on failure
-
- DESCRIPTION
- This function creates an attribute which is attached to the object
- specified with 'loc_id'. The name specified with 'attr_name' for
- each attribute for an object must be unique for that object. The 'type_id'
- and 'space_id' are created with the H5T and H5S interfaces respectively.
- The 'aapl_id' property list is currently unused, but will be used in the
- future for optional attribute access properties. The attribute ID returned
- from this function must be released with H5Aclose or resource leaks will
- develop.
-
---------------------------------------------------------------------------*/
+ * Function: H5Acreate2
+ *
+ * Purpose: Creates an attribute on an object
+ *
+ * Usage:
+ * hid_t H5Acreate2(loc_id, attr_name, type_id, space_id, acpl_id,
+ * aapl_id)
+ *
+ * Description: This function creates an attribute which is attached to the
+ * object specified with 'loc_id'. The name specified with
+ * 'attr_name' for each attribute for an object must be unique
+ * for that object. The 'type_id' and 'space_id' are created
+ * with the H5T and H5S interfaces respectively. The 'aapl_id'
+ * property list is currently unused, but will be used in the
+ * future for optional attribute access properties. The
+ * attribute ID returned from this function must be released
+ * with H5Aclose or resource leaks will develop.
+ *
+ * Parameters:
+ * hid_t loc_id; IN: Object (dataset or group) to be attached to
+ * const char *attr_name; IN: Name of attribute to locate and open
+ * hid_t type_id; IN: ID of datatype for attribute
+ * hid_t space_id; IN: ID of dataspace for attribute
+ * hid_t acpl_id; IN: ID of creation property list (currently not used)
+ * hid_t aapl_id; IN: Attribute access property list
+ *
+ * Return: Success: An ID for the created attribute
+ *
+ * Failure: H5I_INVALID_HID
+ *
+ *-------------------------------------------------------------------------
+ */
hid_t
H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id,
hid_t acpl_id, hid_t aapl_id)
{
- H5A_t *attr = NULL; /* Attribute created */
- H5G_loc_t loc; /* Object location */
- H5T_t *type; /* Datatype to use for attribute */
- H5S_t *space; /* Dataspace to use for attribute */
- hid_t ret_value; /* Return value */
+ H5A_t *attr = NULL; /* Attribute created */
+ H5G_loc_t loc; /* Object location */
+ H5T_t *type; /* Datatype to use for attribute */
+ H5S_t *space; /* Dataspace to use for attribute */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE6("i", "i*siiii", loc_id, attr_name, type_id, space_id, acpl_id, aapl_id);
- /* check arguments */
+ /* Check arguments */
if(H5I_ATTR == H5I_get_type(loc_id))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
if(H5G_loc(loc_id, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(0 == (H5F_INTENT(loc.oloc->file) & H5F_ACC_RDWR))
- HGOTO_ERROR(H5E_ARGS, H5E_WRITEERROR, FAIL, "no write intent on file")
+ HGOTO_ERROR(H5E_ARGS, H5E_WRITEERROR, FAIL, "no write intent on file")
if(!attr_name || !*attr_name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name")
if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type")
if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0)
@@ -336,7 +341,7 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name,
H5TRACE8("i", "i*s*siiiii", loc_id, obj_name, attr_name, type_id, space_id,
acpl_id, aapl_id, lapl_id);
- /* check arguments */
+ /* Check arguments */
if(H5I_ATTR == H5I_get_type(loc_id))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
if(H5G_loc(loc_id, &loc) < 0)
diff --git a/src/H5AC.c b/src/H5AC.c
index 6714bed..a1b096c 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -134,16 +134,16 @@ static const H5AC_class_t *const H5AC_class_s[] = {
};
-
+
/*-------------------------------------------------------------------------
- * Function: H5AC_init
+ * Function: H5AC_init
*
- * Purpose: Initialize the interface from some other layer.
+ * Purpose: Initialize the interface from some other layer.
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 18, 2003
*
*-------------------------------------------------------------------------
@@ -160,15 +160,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5AC_init() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5AC__init_package
+ * Function: H5AC__init_package
*
- * Purpose: Initialize interface-specific information
+ * Purpose: Initialize interface-specific information
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, July 18, 2002
*
*-------------------------------------------------------------------------
@@ -196,17 +196,17 @@ H5AC__init_package(void)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5AC__init_package() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5AC_term_package
+ * Function: H5AC_term_package
*
- * Purpose: Terminate this interface.
+ * Purpose: Terminate this interface.
*
- * Return: Success: Positive if anything was done that might
- * affect other interfaces; zero otherwise.
- * Failure: Negative.
+ * Return: Success: Positive if anything was done that might
+ * affect other interfaces; zero otherwise.
+ * Failure: Negative.
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, July 18, 2002
*
*-------------------------------------------------------------------------
@@ -223,15 +223,15 @@ H5AC_term_package(void)
FUNC_LEAVE_NOAPI(0)
} /* end H5AC_term_package() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5AC_cache_image_pending()
*
- * Purpose: Debugging function that tests to see if the load of a
+ * Purpose: Debugging function that tests to see if the load of a
* metadata cache image load is pending (i.e. will be executed
* on the next protect or insert)
- *
+ *
* Returns TRUE if a cache image load is pending, and FALSE
* if not. Throws an assertion failure on error.
*
@@ -261,7 +261,7 @@ H5AC_cache_image_pending(const H5F_t *f)
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_cache_image_pending() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_create
*
@@ -284,7 +284,7 @@ herr_t
H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_config_t * image_config_ptr)
{
#ifdef H5_HAVE_PARALLEL
- char prefix[H5C__PREFIX_LEN] = "";
+ char prefix[H5C__PREFIX_LEN] = "";
H5AC_aux_t * aux_ptr = NULL;
#endif /* H5_HAVE_PARALLEL */
struct H5C_cache_image_ctl_t int_ci_config = H5C__DEFAULT_CACHE_IMAGE_CTL;
@@ -309,9 +309,9 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co
#ifdef H5_HAVE_PARALLEL
if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) {
- MPI_Comm mpi_comm;
- int mpi_rank;
- int mpi_size;
+ MPI_Comm mpi_comm;
+ int mpi_rank;
+ int mpi_size;
if(MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(f)))
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator")
@@ -349,7 +349,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co
aux_ptr->sync_point_done = NULL;
aux_ptr->p0_image_len = 0;
- sprintf(prefix, "%d:", mpi_rank);
+ HDsprintf(prefix, "%d:", mpi_rank);
if(mpi_rank == 0) {
if(NULL == (aux_ptr->d_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
@@ -400,7 +400,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co
#endif /* H5_HAVE_PARALLEL */
if(NULL == f->shared->cache)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed")
#ifdef H5_HAVE_PARALLEL
if(aux_ptr != NULL)
@@ -421,8 +421,8 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co
HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "auto resize configuration failed")
/* Don't need to get the current H5C image config here since the
- * cache has just been created, and thus f->shared->cache->image_ctl
- * must still set to its initial value (H5C__DEFAULT_CACHE_IMAGE_CTL).
+ * cache has just been created, and thus f->shared->cache->image_ctl
+ * must still set to its initial value (H5C__DEFAULT_CACHE_IMAGE_CTL).
* Note that this not true as soon as control returns to the application
* program, as some test code modifies f->shared->cache->image_ctl.
*/
@@ -458,7 +458,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_create() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_dest
*
@@ -517,10 +517,10 @@ H5AC_dest(H5F_t *f)
/* Sanity check */
HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
- /* If the file was opened R/W, attempt to flush all entries
+ /* If the file was opened R/W, attempt to flush all entries
* from rank 0 & Bcast clean list to other ranks.
*
- * Must not flush in the R/O case, as this will trigger the
+ * Must not flush in the R/O case, as this will trigger the
* free space manager settle routines.
*/
if(H5F_ACC_RDWR & H5F_INTENT(f))
@@ -556,17 +556,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_dest() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_evict
*
* Purpose: Evict all entries except the pinned entries
- * in the cache.
+ * in the cache.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Vailin Choi
- * Dec 2013
+ * Dec 2013
*
*-------------------------------------------------------------------------
*/
@@ -596,13 +596,13 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_evict() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_expunge_entry
*
- * Purpose: Expunge the target entry from the cache without writing it
- * to disk even if it is dirty. The entry must not be either
- * pinned or protected.
+ * Purpose: Expunge the target entry from the cache without writing it
+ * to disk even if it is dirty. The entry must not be either
+ * pinned or protected.
*
* Return: Non-negative on success/Negative on failure
*
@@ -639,17 +639,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_expunge_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_flush
*
- * Purpose: Flush (and possibly destroy) the metadata cache associated
- * with the specified file.
+ * Purpose: Flush (and possibly destroy) the metadata cache associated
+ * with the specified file.
*
- * If the cache contains protected entries, the function will
- * fail, as protected entries cannot be flushed. However
- * all unprotected entries should be flushed before the
- * function returns failure.
+ * If the cache contains protected entries, the function will
+ * fail, as protected entries cannot be flushed. However
+ * all unprotected entries should be flushed before the
+ * function returns failure.
*
* Return: Non-negative on success/Negative on failure if there was a
* request to flush all items and something was protected.
@@ -696,18 +696,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_flush() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_force_cache_image_load()
*
- * Purpose: On rare occasions, it is necessary to run
+ * Purpose: On rare occasions, it is necessary to run
* H5MF_tidy_self_referential_fsm_hack() prior to the first
- * metadata cache access. This is a problem as if there is a
- * cache image at the end of the file, that routine will
+ * metadata cache access. This is a problem as if there is a
+ * cache image at the end of the file, that routine will
* discard it.
*
* We solve this issue by calling this function, which will
- * load the cache image and then call
+ * load the cache image and then call
* H5MF_tidy_self_referential_fsm_hack() to discard it.
*
* Return: SUCCEED on success, and FAIL on failure.
@@ -736,20 +736,20 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_force_cache_image_load() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_get_entry_status
*
* Purpose: Given a file address, determine whether the metadata
- * cache contains an entry at that location. If it does,
- * also determine whether the entry is dirty, protected,
- * pinned, etc. and return that information to the caller
- * in *status.
+ * cache contains an entry at that location. If it does,
+ * also determine whether the entry is dirty, protected,
+ * pinned, etc. and return that information to the caller
+ * in *status.
*
- * If the specified entry doesn't exist, set *status_ptr
- * to zero.
+ * If the specified entry doesn't exist, set *status_ptr
+ * to zero.
*
- * On error, the value of *status is undefined.
+ * On error, the value of *status is undefined.
*
* Return: Non-negative on success/Negative on failure
*
@@ -761,14 +761,14 @@ done:
herr_t
H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status)
{
- hbool_t in_cache; /* Entry @ addr is in the cache */
- hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */
- hbool_t is_protected; /* Entry @ addr is in the cache and protected */
- hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */
- hbool_t is_corked;
- hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */
- hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */
- hbool_t image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */
+ hbool_t in_cache; /* Entry @ addr is in the cache */
+ hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */
+ hbool_t is_protected; /* Entry @ addr is in the cache and protected */
+ hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */
+ hbool_t is_corked;
+ hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */
+ hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */
+ hbool_t image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -781,21 +781,21 @@ H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed")
if(in_cache) {
- *status |= H5AC_ES__IN_CACHE;
- if(is_dirty)
- *status |= H5AC_ES__IS_DIRTY;
- if(is_protected)
- *status |= H5AC_ES__IS_PROTECTED;
- if(is_pinned)
- *status |= H5AC_ES__IS_PINNED;
- if(is_corked)
- *status |= H5AC_ES__IS_CORKED;
- if(is_flush_dep_parent)
- *status |= H5AC_ES__IS_FLUSH_DEP_PARENT;
- if(is_flush_dep_child)
- *status |= H5AC_ES__IS_FLUSH_DEP_CHILD;
- if(image_is_up_to_date)
- *status |= H5AC_ES__IMAGE_IS_UP_TO_DATE;
+ *status |= H5AC_ES__IN_CACHE;
+ if(is_dirty)
+ *status |= H5AC_ES__IS_DIRTY;
+ if(is_protected)
+ *status |= H5AC_ES__IS_PROTECTED;
+ if(is_pinned)
+ *status |= H5AC_ES__IS_PINNED;
+ if(is_corked)
+ *status |= H5AC_ES__IS_CORKED;
+ if(is_flush_dep_parent)
+ *status |= H5AC_ES__IS_FLUSH_DEP_PARENT;
+ if(is_flush_dep_child)
+ *status |= H5AC_ES__IS_FLUSH_DEP_CHILD;
+ if(image_is_up_to_date)
+ *status |= H5AC_ES__IMAGE_IS_UP_TO_DATE;
} /* end if */
else
*status = 0;
@@ -804,7 +804,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_get_entry_status() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_insert_entry
*
@@ -876,7 +876,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_insert_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_load_cache_image_on_next_protect
*
@@ -911,12 +911,12 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_load_cache_image_on_next_protect() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_mark_entry_dirty
*
- * Purpose: Mark a pinned or protected entry as dirty. The target
- * entry MUST be either pinned, protected, or both.
+ * Purpose: Mark a pinned or protected entry as dirty. The target
+ * entry MUST be either pinned, protected, or both.
*
* Return: Non-negative on success/Negative on failure
*
@@ -965,12 +965,12 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_mark_entry_dirty() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_mark_entry_clean
*
- * Purpose: Mark a pinned entry as clean. The target
- * entry MUST be pinned.
+ * Purpose: Mark a pinned entry as clean. The target
+ * entry MUST be pinned.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1018,12 +1018,12 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_mark_entry_clean() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_mark_entry_unserialized
*
- * Purpose: Mark a pinned or protected entry as unserialized. The target
- * entry MUST be either pinned, protected, or both.
+ * Purpose: Mark a pinned or protected entry as unserialized. The target
+ * entry MUST be either pinned, protected, or both.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1060,12 +1060,12 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_mark_entry_unserialized() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_mark_entry_serialized
*
- * Purpose: Mark a pinned entry as serialized. The target
- * entry MUST be pinned.
+ * Purpose: Mark a pinned entry as serialized. The target
+ * entry MUST be pinned.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1101,7 +1101,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_mark_entry_serialized() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_move_entry
*
@@ -1160,11 +1160,11 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_move_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_pin_protected_entry()
*
- * Purpose: Pin a protected cache entry. The entry must be protected
+ * Purpose: Pin a protected cache entry. The entry must be protected
* at the time of call, and must be unpinned.
*
* Return: Non-negative on success/Negative on failure
@@ -1203,7 +1203,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_pin_protected_entry() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5AC_prep_for_file_close
@@ -1241,11 +1241,11 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_prep_for_file_close() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_create_flush_dependency()
*
- * Purpose: Create a flush dependency between two entries in the metadata
+ * Purpose: Create a flush dependency between two entries in the metadata
* cache.
*
* Return: Non-negative on success/Negative on failure
@@ -1285,21 +1285,21 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_create_flush_dependency() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_protect
*
* Purpose: If the target entry is not in the cache, load it. If
- * necessary, attempt to evict one or more entries to keep
- * the cache within its maximum size.
+ * necessary, attempt to evict one or more entries to keep
+ * the cache within its maximum size.
*
- * Mark the target entry as protected, and return its address
- * to the caller. The caller must call H5AC_unprotect() when
- * finished with the entry.
+ * Mark the target entry as protected, and return its address
+ * to the caller. The caller must call H5AC_unprotect() when
+ * finished with the entry.
*
- * While it is protected, the entry may not be either evicted
- * or flushed -- nor may it be accessed by another call to
- * H5AC_protect. Any attempt to do so will result in a failure.
+ * While it is protected, the entry may not be either evicted
+ * or flushed -- nor may it be accessed by another call to
+ * H5AC_protect. Any attempt to do so will result in a failure.
*
* Return: Success: Ptr to the object.
* Failure: NULL
@@ -1341,7 +1341,7 @@ H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *udata,
/* Check for invalid access request */
if((0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) && (0 == (flags & H5C__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file")
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file")
#if H5AC_DO_TAGGING_SANITY_CHECKS
if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(type) < 0)
@@ -1367,11 +1367,11 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_protect() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_resize_entry
*
- * Purpose: Resize a pinned or protected entry.
+ * Purpose: Resize a pinned or protected entry.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1420,12 +1420,12 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_resize_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_unpin_entry()
*
- * Purpose: Unpin a cache entry. The entry must be unprotected at
- * the time of call, and must be pinned.
+ * Purpose: Unpin a cache entry. The entry must be unprotected at
+ * the time of call, and must be pinned.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1463,11 +1463,11 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_unpin_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_destroy_flush_dependency()
*
- * Purpose: Destroy a flush dependency between two entries.
+ * Purpose: Destroy a flush dependency between two entries.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1506,31 +1506,31 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_destroy_flush_dependency() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_unprotect
*
- * Purpose: Undo an H5AC_protect() call -- specifically, mark the
- * entry as unprotected, remove it from the protected list,
- * and give it back to the replacement policy.
+ * Purpose: Undo an H5AC_protect() call -- specifically, mark the
+ * entry as unprotected, remove it from the protected list,
+ * and give it back to the replacement policy.
*
- * The TYPE and ADDR arguments must be the same as those in
- * the corresponding call to H5AC_protect() and the THING
- * argument must be the value returned by that call to
- * H5AC_protect().
+ * The TYPE and ADDR arguments must be the same as those in
+ * the corresponding call to H5AC_protect() and the THING
+ * argument must be the value returned by that call to
+ * H5AC_protect().
*
- * If the deleted flag is TRUE, simply remove the target entry
- * from the cache, clear it, and free it without writing it to
- * disk.
+ * If the deleted flag is TRUE, simply remove the target entry
+ * from the cache, clear it, and free it without writing it to
+ * disk.
*
- * This version of the function is a complete re-write to
- * use the new metadata cache. While there isn't all that
- * much difference between the old and new Purpose sections,
- * the original version is given below.
+ * This version of the function is a complete re-write to
+ * use the new metadata cache. While there isn't all that
+ * much difference between the old and new Purpose sections,
+ * the original version is given below.
*
- * Original purpose section:
+ * Original purpose section:
*
- * This function should be called to undo the effect of
+ * This function should be called to undo the effect of
* H5AC_protect(). The TYPE and ADDR arguments should be the
* same as the corresponding call to H5AC_protect() and the
* THING argument should be the value returned by H5AC_protect().
@@ -1549,8 +1549,8 @@ herr_t
H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing,
unsigned flags)
{
- hbool_t dirtied;
- hbool_t deleted;
+ hbool_t dirtied;
+ hbool_t deleted;
#ifdef H5_HAVE_PARALLEL
H5AC_aux_t * aux_ptr = NULL;
#endif /* H5_HAVE_PARALLEL */
@@ -1571,14 +1571,14 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing,
HDassert( ((H5AC_info_t *)thing)->type == type );
dirtied = (hbool_t)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) ||
- (((H5AC_info_t *)thing)->dirtied));
+ (((H5AC_info_t *)thing)->dirtied));
deleted = (hbool_t)((flags & H5C__DELETED_FLAG) == H5C__DELETED_FLAG);
/* Check if the size changed out from underneath us, if we're not deleting
* the entry.
*/
if(dirtied && !deleted) {
- size_t curr_size = 0;
+ size_t curr_size = 0;
if((type->image_len)(thing, &curr_size) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing")
@@ -1618,7 +1618,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_unprotect() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_get_cache_auto_resize_config
*
@@ -1665,7 +1665,7 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr,
if(internal_config.rpt_fcn == NULL)
config_ptr->rpt_fcn_enabled = FALSE;
else
- config_ptr->rpt_fcn_enabled = TRUE;
+ config_ptr->rpt_fcn_enabled = TRUE;
config_ptr->open_trace_file = FALSE;
config_ptr->close_trace_file = FALSE;
config_ptr->trace_file_name[0] = '\0';
@@ -1698,12 +1698,12 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr,
if(NULL != (aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr))) {
config_ptr->dirty_bytes_threshold = aux_ptr->dirty_bytes_threshold;
- config_ptr->metadata_write_strategy = aux_ptr->metadata_write_strategy;
+ config_ptr->metadata_write_strategy = aux_ptr->metadata_write_strategy;
} /* end if */
else {
#endif /* H5_HAVE_PARALLEL */
config_ptr->dirty_bytes_threshold = H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD;
- config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY;
+ config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY;
#ifdef H5_HAVE_PARALLEL
} /* end else */
}
@@ -1713,7 +1713,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_get_cache_auto_resize_config() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_get_cache_size
*
@@ -1742,7 +1742,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_get_cache_size() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_get_cache_hit_rate
*
@@ -1769,7 +1769,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_get_cache_hit_rate() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5AC_reset_cache_hit_rate_stats()
@@ -1796,7 +1796,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_reset_cache_hit_rate_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_set_cache_auto_resize_config
*
@@ -1813,7 +1813,7 @@ herr_t
H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr)
{
H5C_auto_size_ctl_t internal_config;
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1888,21 +1888,21 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_set_cache_auto_resize_config() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_validate_config()
*
* Purpose: Run a sanity check on the contents of the supplied
- * instance of H5AC_cache_config_t.
+ * instance of H5AC_cache_config_t.
*
* Do nothing and return SUCCEED if no errors are detected,
* and flag an error and return FAIL otherwise.
*
- * At present, this function operates by packing the data
- * from the instance of H5AC_cache_config_t into an instance
- * of H5C_auto_size_ctl_t, and then calling
- * H5C_validate_resize_config(). As H5AC_cache_config_t and
- * H5C_auto_size_ctl_t diverge, we may have to change this.
+ * At present, this function operates by packing the data
+ * from the instance of H5AC_cache_config_t into an instance
+ * of H5C_auto_size_ctl_t, and then calling
+ * H5C_validate_resize_config(). As H5AC_cache_config_t and
+ * H5C_auto_size_ctl_t diverge, we may have to change this.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1927,7 +1927,7 @@ H5AC_validate_config(H5AC_cache_config_t *config_ptr)
/* don't bother to test trace_file_name unless open_trace_file is TRUE */
if(config_ptr->open_trace_file) {
- size_t name_len;
+ size_t name_len;
/* Can't really test the trace_file_name field without trying to
* open the file, so we will content ourselves with a couple of
@@ -1965,22 +1965,22 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_validate_config() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_validate_cache_image_config()
*
* Purpose: Run a sanity check on the contents of the supplied
- * instance of H5AC_cache_image_config_t.
+ * instance of H5AC_cache_image_config_t.
*
* Do nothing and return SUCCEED if no errors are detected,
* and flag an error and return FAIL otherwise.
*
- * At present, this function operates by packing the data
- * from the instance of H5AC_cache_image_config_t into an
- * instance of H5C_cache_image_ctl_t, and then calling
- * H5C_validate_cache_image_config(). If and when
- * H5AC_cache_image_config_t and H5C_cache_image_ctl_t
- * diverge, we may have to change this.
+ * At present, this function operates by packing the data
+ * from the instance of H5AC_cache_image_config_t into an
+ * instance of H5C_cache_image_ctl_t, and then calling
+ * H5C_validate_cache_image_config(). If and when
+ * H5AC_cache_image_config_t and H5C_cache_image_ctl_t
+ * diverge, we may have to change this.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2005,7 +2005,7 @@ H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr)
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown image config version")
/* don't need to get the current H5C image config here since the
- * default values of fields not in the H5AC config will always be
+ * default values of fields not in the H5AC config will always be
* valid.
*/
internal_config.version = config_ptr->version;
@@ -2020,19 +2020,19 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_validate_cache_image_config() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5AC__check_if_write_permitted
*
* Purpose: Determine if a write is permitted under the current
- * circumstances, and set *write_permitted_ptr accordingly.
- * As a general rule it is, but when we are running in parallel
- * mode with collective I/O, we must ensure that a read cannot
- * cause a write.
+ * circumstances, and set *write_permitted_ptr accordingly.
+ * As a general rule it is, but when we are running in parallel
+ * mode with collective I/O, we must ensure that a read cannot
+ * cause a write.
*
- * In the event of failure, the value of *write_permitted_ptr
- * is undefined.
+ * In the event of failure, the value of *write_permitted_ptr
+ * is undefined.
*
* Return: Non-negative on success/Negative on failure.
*
@@ -2048,9 +2048,9 @@ H5_ATTR_UNUSED
*f, hbool_t *write_permitted_ptr)
{
#ifdef H5_HAVE_PARALLEL
- H5AC_aux_t * aux_ptr = NULL;
+ H5AC_aux_t * aux_ptr = NULL;
#endif /* H5_HAVE_PARALLEL */
- hbool_t write_permitted = TRUE;
+ hbool_t write_permitted = TRUE;
FUNC_ENTER_STATIC_NOERR
@@ -2064,9 +2064,9 @@ H5_ATTR_UNUSED
HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
if((aux_ptr->mpi_rank == 0) || (aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED))
- write_permitted = aux_ptr->write_permitted;
+ write_permitted = aux_ptr->write_permitted;
else
- write_permitted = FALSE;
+ write_permitted = FALSE;
} /* end if */
#endif /* H5_HAVE_PARALLEL */
@@ -2075,17 +2075,17 @@ H5_ATTR_UNUSED
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5AC__check_if_write_permitted() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC__ext_config_2_int_config()
*
* Purpose: Utility function to translate an instance of
- * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t.
+ * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t.
*
- * Places translation in *int_conf_ptr and returns SUCCEED
- * if successful. Returns FAIL on failure.
+ * Places translation in *int_conf_ptr and returns SUCCEED
+ * if successful. Returns FAIL on failure.
*
- * Does only minimal sanity checking.
+ * Does only minimal sanity checking.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2141,15 +2141,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC__ext_config_2_int_config() */
-
+
/*------------------------------------------------------------------------------
* Function: H5AC_ignore_tags()
*
- * Purpose: Override all assertion frameworks and force application of
+ * Purpose: Override all assertion frameworks and force application of
* global tag everywhere. This should really only be used in the
- * tests that need to access functions without going through
+ * tests that need to access functions without going through
* API paths.
- *
+ *
* Return: SUCCEED on success, FAIL otherwise.
*
* Programmer: Mike McGreevy
@@ -2172,17 +2172,17 @@ H5AC_ignore_tags(const H5F_t *f)
/* Set up a new metadata tag */
if(H5C_ignore_tags(f->shared->cache) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "H5C_ignore_tags() failed")
-
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_ignore_tags() */
-
+
/*------------------------------------------------------------------------------
* Function: H5AC_tag()
*
* Purpose: Sets the metadata tag property in the provided property list.
- *
+ *
* Return: SUCCEED on success, FAIL otherwise.
*
* Programmer: Mike McGreevy
@@ -2205,14 +2205,14 @@ H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag)
FUNC_LEAVE_NOAPI_VOID
} /* H5AC_tag */
-
+
/*------------------------------------------------------------------------------
* Function: H5AC_retag_copied_metadata()
*
* Purpose: Searches through cache index for all entries with the
- * H5AC__COPIED_TAG, indicating that it was created as a
+ * H5AC__COPIED_TAG, indicating that it was created as a
* result of an object copy, and applies the provided tag.
- *
+ *
* Return: SUCCEED on success, FAIL otherwise.
*
* Programmer: Mike McGreevy
@@ -2221,7 +2221,7 @@ H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag)
*------------------------------------------------------------------------------
*/
herr_t
-H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag)
+H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2230,7 +2230,7 @@ H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag)
/* Sanity checks */
HDassert(f);
HDassert(f->shared);
-
+
/* Call cache-level function to re-tag entries with the COPIED tag */
if(H5C_retag_entries(f->shared->cache, H5AC__COPIED_TAG, metadata_tag) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "Can't retag metadata")
@@ -2239,13 +2239,13 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_retag_copied_metadata() */
-
+
/*------------------------------------------------------------------------------
* Function: H5AC_flush_tagged_metadata()
*
* Purpose: Wrapper for cache level function which flushes all metadata
- * that contains the specific tag.
- *
+ * that contains the specific tag.
+ *
* Return: SUCCEED on success, FAIL otherwise.
*
* Programmer: Mike McGreevy
@@ -2258,8 +2258,8 @@ H5AC_flush_tagged_metadata(H5F_t *f, haddr_t metadata_tag)
{
/* Variable Declarations */
herr_t ret_value = SUCCEED;
-
- /* Function Enter Macro */
+
+ /* Function Enter Macro */
FUNC_ENTER_NOAPI(FAIL)
/* Assertions */
@@ -2274,13 +2274,13 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_flush_tagged_metadata */
-
+
/*------------------------------------------------------------------------------
* Function: H5AC_evict_tagged_metadata()
*
* Purpose: Wrapper for cache level function which flushes all metadata
- * that contains the specific tag.
- *
+ * that contains the specific tag.
+ *
* Return: SUCCEED on success, FAIL otherwise.
*
* Programmer: Mike McGreevy
@@ -2293,8 +2293,8 @@ H5AC_evict_tagged_metadata(H5F_t *f, haddr_t metadata_tag, hbool_t match_global)
{
/* Variable Declarations */
herr_t ret_value = SUCCEED;
-
- /* Function Enter Macro */
+
+ /* Function Enter Macro */
FUNC_ENTER_NOAPI(FAIL)
/* Assertions */
@@ -2309,13 +2309,13 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_evict_tagged_metadata() */
-
+
/*------------------------------------------------------------------------------
* Function: H5AC_expunge_tag_type_metadata()
*
* Purpose: Wrapper for cache level function which expunge entries with
* a specific tag and type id.
- *
+ *
* Return: SUCCEED on success, FAIL otherwise.
*
* Programmer: Vailin Choi; May 2016
@@ -2327,8 +2327,8 @@ H5AC_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flag
{
/* Variable Declarations */
herr_t ret_value = SUCCEED;
-
- /* Function Enter Macro */
+
+ /* Function Enter Macro */
FUNC_ENTER_NOAPI(FAIL)
/* Assertions */
@@ -2343,12 +2343,12 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_expunge_tag_type_metadata*/
-
+
/*------------------------------------------------------------------------------
* Function: H5AC_get_tag()
*
* Purpose: Get the tag for a metadata cache entry.
- *
+ *
* Return: SUCCEED/FAIL
*
* Programmer: Dana Robinson
@@ -2361,8 +2361,8 @@ H5AC_get_tag(const void *thing, haddr_t *tag)
{
/* Variable Declarations */
herr_t ret_value = SUCCEED;
-
- /* Function Enter Macro */
+
+ /* Function Enter Macro */
FUNC_ENTER_NOAPI(FAIL)
/* Assertions */
@@ -2377,7 +2377,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5AC_get_tag() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_cork
*
@@ -2424,7 +2424,7 @@ done:
} /* H5AC_cork() */
#if H5AC_DO_TAGGING_SANITY_CHECKS
-
+
/*-------------------------------------------------------------------------
*
* Function: H5AC__verify_tag
@@ -2459,14 +2459,14 @@ done:
} /* H5AC__verify_tag */
#endif /* H5AC_DO_TAGGING_SANITY_CHECKS */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_get_entry_ring
*
* Purpose: Given a file address, retrieve the ring for an entry at that
* address.
*
- * On error, the value of *ring is not modified.
+ * On error, the value of *ring is not modified.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2495,15 +2495,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_get_entry_ring() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_set_ring
*
* Purpose: Routine to set the ring on a DXPL (for passing through
* to the metadata cache).
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* Tuesday, September 8, 2015
@@ -2525,7 +2525,7 @@ H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring)
FUNC_LEAVE_NOAPI_VOID
} /* end H5AC_set_ring() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_unsettle_entry_ring()
*
@@ -2543,11 +2543,11 @@ H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring)
* are in the process of a file shutdown, post an error
* message, and return FAIL.
*
- * Note that this function simply passes the call on to
- * the metadata cache proper, and returns the result.
+ * Note that this function simply passes the call on to
+ * the metadata cache proper, and returns the result.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* September 17, 2016
@@ -2573,7 +2573,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_unsettle_entry_ring() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_unsettle_ring()
*
@@ -2615,12 +2615,12 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_unsettle_ring() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_remove_entry()
*
* Purpose: Remove an entry from the cache. Must be not protected, pinned,
- * dirty, involved in flush dependencies, etc.
+ * dirty, involved in flush dependencies, etc.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2656,7 +2656,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_remove_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: H5AC_get_mdc_image_info
*
diff --git a/src/H5Adense.c b/src/H5Adense.c
index 40a7a9a..c6aa8e0 100644
--- a/src/H5Adense.c
+++ b/src/H5Adense.c
@@ -915,6 +915,7 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name,
H5HF_t *fheap = NULL; /* Fractal heap handle */
H5HF_t *shared_fheap = NULL; /* Fractal heap handle for shared header messages */
H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */
+ H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order ndex */
H5A_t *attr_copy = NULL; /* Copy of attribute to rename */
htri_t attr_sharable; /* Flag indicating attributes are sharable */
htri_t shared_mesg; /* Should this message be stored in the Shared Message table? */
@@ -994,6 +995,33 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name,
if(H5A__set_version(f, attr_copy) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "unable to update attribute version")
+ /* Need to remove the attribute from the creation order index v2 B-tree */
+ if(ainfo->index_corder) {
+ htri_t corder_attr_exists; /* Attribute exists in v2 B-tree */
+
+ /* Open the creation order index v2 B-tree */
+ HDassert(H5F_addr_defined(ainfo->corder_bt2_addr));
+ if(NULL == (bt2_corder = H5B2_open(f, ainfo->corder_bt2_addr, NULL)))
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation index")
+
+ /* Set up the creation order to search for */
+ udata.corder = attr_copy->shared->crt_idx;
+
+ if((corder_attr_exists = H5B2_find(bt2_corder, &udata, NULL, NULL)) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index")
+
+ if(corder_attr_exists) {
+ H5A_bt2_ud_rm_t rm_udata;
+
+ /* Set up the creation order in user data for the v2 B-tree 'record remove' callback */
+ rm_udata.common.corder = attr_copy->shared->crt_idx;
+
+ /* Remove the record from the creation order index v2 B-tree */
+ if(H5B2_remove(bt2_corder, &rm_udata, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from creation order index v2 B-tree")
+ }
+ }
+
/* Insert renamed attribute back into dense storage */
/* (Possibly making it shared) */
if(H5A__dense_insert(f, ainfo, attr_copy) < 0)
@@ -1041,6 +1069,8 @@ done:
HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap")
if(bt2_name && H5B2_close(bt2_name) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index")
+ if(bt2_corder && H5B2_close(bt2_corder) < 0)
+ HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index")
if(attr_copy)
H5O_msg_free(H5O_ATTR_ID, attr_copy);
diff --git a/src/H5B.c b/src/H5B.c
index 53d5529..16772a8 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -13,79 +13,79 @@
/*-------------------------------------------------------------------------
*
- * Created: H5B.c
- * Jul 10 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Created: H5B.c
+ * Jul 10 1997
+ * Robb Matzke <matzke@llnl.gov>
*
- * Purpose: Implements balanced, sibling-linked, N-ary trees
- * capable of storing any type of data with unique key
- * values.
+ * Purpose: Implements balanced, sibling-linked, N-ary trees
+ * capable of storing any type of data with unique key
+ * values.
*
- * A B-link-tree is a balanced tree where each node has
- * a pointer to its left and right siblings. A
- * B-link-tree is a rooted tree having the following
- * properties:
+ * A B-link-tree is a balanced tree where each node has
+ * a pointer to its left and right siblings. A
+ * B-link-tree is a rooted tree having the following
+ * properties:
*
- * 1. Every node, x, has the following fields:
+ * 1. Every node, x, has the following fields:
*
- * a. level[x], the level in the tree at which node
- * x appears. Leaf nodes are at level zero.
+ * a. level[x], the level in the tree at which node
+ * x appears. Leaf nodes are at level zero.
*
- * b. n[x], the number of children pointed to by the
- * node. Internal nodes point to subtrees while
- * leaf nodes point to arbitrary data.
+ * b. n[x], the number of children pointed to by the
+ * node. Internal nodes point to subtrees while
+ * leaf nodes point to arbitrary data.
*
- * c. The child pointers themselves, child[x,i] such
- * that 0 <= i < n[x].
+ * c. The child pointers themselves, child[x,i] such
+ * that 0 <= i < n[x].
*
- * d. n[x]+1 key values stored in increasing
- * order:
+ * d. n[x]+1 key values stored in increasing
+ * order:
*
- * key[x,0] < key[x,1] < ... < key[x,n[x]].
+ * key[x,0] < key[x,1] < ... < key[x,n[x]].
*
- * e. left[x] is a pointer to the node's left sibling
- * or the null pointer if this is the left-most
- * node at this level in the tree.
+ * e. left[x] is a pointer to the node's left sibling
+ * or the null pointer if this is the left-most
+ * node at this level in the tree.
*
- * f. right[x] is a pointer to the node's right
- * sibling or the null pointer if this is the
- * right-most node at this level in the tree.
+ * f. right[x] is a pointer to the node's right
+ * sibling or the null pointer if this is the
+ * right-most node at this level in the tree.
*
- * 3. The keys key[x,i] partition the key spaces of the
- * children of x:
+ * 3. The keys key[x,i] partition the key spaces of the
+ * children of x:
*
- * key[x,i] <= key[child[x,i],j] <= key[x,i+1]
+ * key[x,i] <= key[child[x,i],j] <= key[x,i+1]
*
- * for any valid combination of i and j.
+ * for any valid combination of i and j.
*
- * 4. There are lower and upper bounds on the number of
- * child pointers a node can contain. These bounds
- * can be expressed in terms of a fixed integer k>=2
- * called the `minimum degree' of the B-tree.
+ * 4. There are lower and upper bounds on the number of
+ * child pointers a node can contain. These bounds
+ * can be expressed in terms of a fixed integer k>=2
+ * called the `minimum degree' of the B-tree.
*
- * a. Every node other than the root must have at least
- * k child pointers and k+1 keys. If the tree is
- * nonempty, the root must have at least one child
- * pointer and two keys.
+ * a. Every node other than the root must have at least
+ * k child pointers and k+1 keys. If the tree is
+ * nonempty, the root must have at least one child
+ * pointer and two keys.
*
- * b. Every node can contain at most 2k child pointers
- * and 2k+1 keys. A node is `full' if it contains
- * exactly 2k child pointers and 2k+1 keys.
+ * b. Every node can contain at most 2k child pointers
+ * and 2k+1 keys. A node is `full' if it contains
+ * exactly 2k child pointers and 2k+1 keys.
*
- * 5. When searching for a particular value, V, and
- * key[V] = key[x,i] for some node x and entry i,
- * then:
+ * 5. When searching for a particular value, V, and
+ * key[V] = key[x,i] for some node x and entry i,
+ * then:
*
- * a. If i=0 the child[0] is followed.
+ * a. If i=0 the child[0] is followed.
*
- * b. If i=n[x] the child[n[x]-1] is followed.
+ * b. If i=n[x] the child[n[x]-1] is followed.
*
- * c. Otherwise, the child that is followed
- * (either child[x,i-1] or child[x,i]) is
- * determined by the type of object to which the
- * leaf nodes of the tree point and is controlled
- * by the key comparison function registered for
- * that type of B-tree.
+ * c. Otherwise, the child that is followed
+ * (either child[x,i-1] or child[x,i]) is
+ * determined by the type of object to which the
+ * leaf nodes of the tree point and is controlled
+ * by the key comparison function registered for
+ * that type of B-tree.
*
*
*-------------------------------------------------------------------------
@@ -101,22 +101,22 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Bpkg.h" /* B-link trees */
+#include "H5private.h" /* Generic Functions */
+#include "H5Bpkg.h" /* B-link trees */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MFprivate.h" /* File memory management */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MFprivate.h" /* File memory management */
#include "H5Pprivate.h" /* Property lists */
/****************/
/* Local Macros */
/****************/
-#define H5B_SIZEOF_HDR(F) \
- (H5_SIZEOF_MAGIC + /*magic number */ \
- 4 + /*type, level, num entries */ \
- 2*H5F_SIZEOF_ADDR(F)) /*left and right sibling addresses */
+#define H5B_SIZEOF_HDR(F) \
+ (H5_SIZEOF_MAGIC + /*magic number */ \
+ 4 + /*type, level, num entries */ \
+ 2*H5F_SIZEOF_ADDR(F)) /*left and right sibling addresses */
/* Default initializer for H5B_ins_ud_t */
#define H5B_INS_UD_T_NULL {NULL, HADDR_UNDEF, H5AC__NO_FLAGS_SET}
@@ -149,7 +149,7 @@ static H5B_ins_t H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud,
H5B_ins_ud_t *split_bt_ud/*out*/);
static herr_t H5B__insert_child(H5B_t *bt, unsigned *bt_flags,
unsigned idx, haddr_t child,
- H5B_ins_t anchor, const void *md_key);
+ H5B_ins_t anchor, const void *md_key);
static herr_t H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx,
void *udata, H5B_ins_ud_t *split_bt_ud/*out*/);
static H5B_t * H5B__copy(const H5B_t *old_bt);
@@ -191,31 +191,31 @@ H5FL_BLK_DEFINE_STATIC(page);
H5FL_SEQ_DEFINE_STATIC(size_t);
-
+
/*-------------------------------------------------------------------------
- * Function: H5B_create
+ * Function: H5B_create
*
- * Purpose: Creates a new empty B-tree leaf node. The UDATA pointer is
- * passed as an argument to the sizeof_rkey() method for the
- * B-tree.
+ * Purpose: Creates a new empty B-tree leaf node. The UDATA pointer is
+ * passed as an argument to the sizeof_rkey() method for the
+ * B-tree.
*
- * Return: Success: Non-negative, and the address of new node is
- * returned through the ADDR_P argument.
+ * Return: Success: Non-negative, and the address of new node is
+ * returned through the ADDR_P argument.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 23 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 23 1997
*
*-------------------------------------------------------------------------
*/
herr_t
H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p/*out*/)
{
- H5B_t *bt = NULL;
+ H5B_t *bt = NULL;
H5B_shared_t *shared=NULL; /* Pointer to shared B-tree info */
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI(FAIL)
@@ -230,20 +230,20 @@ H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p/*out*
* Allocate file and memory data structures.
*/
if(NULL == (bt = H5FL_MALLOC(H5B_t)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for B-tree root node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for B-tree root node")
HDmemset(&bt->cache_info, 0, sizeof(H5AC_info_t));
bt->level = 0;
bt->left = HADDR_UNDEF;
bt->right = HADDR_UNDEF;
bt->nchildren = 0;
if(NULL == (bt->rc_shared = (type->get_shared)(f, udata)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree node buffer")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree node buffer")
H5UC_INC(bt->rc_shared);
shared=(H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared);
HDassert(shared);
if(NULL == (bt->native = H5FL_BLK_MALLOC(native_block, shared->sizeof_keys)) ||
NULL == (bt->child = H5FL_SEQ_MALLOC(haddr_t, (size_t)shared->two_k)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for B-tree root node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for B-tree root node")
if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, (hsize_t)shared->sizeof_rnode)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "file allocation failed for B-tree root node")
@@ -251,7 +251,7 @@ H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p/*out*
* Cache the new B-tree node.
*/
if(H5AC_insert_entry(f, H5AC_BT, *addr_p, bt, H5AC__NO_FLAGS_SET) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree root node to cache")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree root node to cache")
#ifdef H5B_DEBUG
H5B__assert(f, *addr_p, shared->type, udata);
#endif
@@ -262,7 +262,7 @@ done:
H5_CHECK_OVERFLOW(shared->sizeof_rnode,size_t,hsize_t);
(void)H5MF_xfree(f, H5FD_MEM_BTREE, *addr_p, (hsize_t)shared->sizeof_rnode);
} /* end if */
- if(bt)
+ if(bt)
/* Destroy B-tree node */
if(H5B__node_dest(bt) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node")
@@ -271,40 +271,40 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_create() */ /*lint !e818 Can't make udata a pointer to const */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B_find
+ * Function: H5B_find
*
- * Purpose: Locate the specified information in a B-tree and return
- * that information by filling in fields of the caller-supplied
- * UDATA pointer depending on the type of leaf node
- * requested. The UDATA can point to additional data passed
- * to the key comparison function.
+ * Purpose: Locate the specified information in a B-tree and return
+ * that information by filling in fields of the caller-supplied
+ * UDATA pointer depending on the type of leaf node
+ * requested. The UDATA can point to additional data passed
+ * to the key comparison function.
*
- * Note: This function does not follow the left/right sibling
- * pointers since it assumes that all nodes can be reached
- * from the parent node.
+ * Note: This function does not follow the left/right sibling
+ * pointers since it assumes that all nodes can be reached
+ * from the parent node.
*
- * Return: Non-negative (TRUE/FALSE) on success (if found, values returned
+ * Return: Non-negative (TRUE/FALSE) on success (if found, values returned
* through the UDATA argument). Negative on failure (if not found,
* UDATA is undefined).
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 23 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 23 1997
*
*-------------------------------------------------------------------------
*/
htri_t
H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
{
- H5B_t *bt = NULL;
- H5UC_t *rc_shared; /* Ref-counted shared info */
+ H5B_t *bt = NULL;
+ H5UC_t *rc_shared; /* Ref-counted shared info */
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
unsigned idx = 0, lt = 0, rt; /* Final, left & right key indices */
- int cmp = 1; /* Key comparison value */
- htri_t ret_value = FAIL; /* Return value */
+ int cmp = 1; /* Key comparison value */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -336,16 +336,16 @@ H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
rt = bt->nchildren;
while(lt < rt && cmp) {
- idx = (lt + rt) / 2;
- /* compare */
- if((cmp = (type->cmp3)(H5B_NKEY(bt, shared, idx), udata, H5B_NKEY(bt, shared, (idx + 1)))) < 0)
- rt = idx;
- else
- lt = idx + 1;
+ idx = (lt + rt) / 2;
+ /* compare */
+ if((cmp = (type->cmp3)(H5B_NKEY(bt, shared, idx), udata, H5B_NKEY(bt, shared, (idx + 1)))) < 0)
+ rt = idx;
+ else
+ lt = idx + 1;
} /* end while */
/* Check if not found */
if(cmp)
- HGOTO_DONE(FALSE)
+ HGOTO_DONE(FALSE)
/*
* Follow the link to the subtree or to the data node.
@@ -353,41 +353,41 @@ H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
HDassert(idx < bt->nchildren);
if(bt->level > 0) {
- if((ret_value = H5B_find(f, type, bt->child[idx], udata)) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "can't lookup key in subtree")
+ if((ret_value = H5B_find(f, type, bt->child[idx], udata)) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "can't lookup key in subtree")
} /* end if */
else {
- if((ret_value = (type->found)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), udata)) < 0)
+ if((ret_value = (type->found)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), udata)) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "can't lookup key in leaf node")
} /* end else */
done:
if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0)
- HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release node")
+ HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_find() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B__split
+ * Function: H5B__split
*
- * Purpose: Split a single node into two nodes. The old node will
- * contain the left children and the new node will contain the
- * right children.
+ * Purpose: Split a single node into two nodes. The old node will
+ * contain the left children and the new node will contain the
+ * right children.
*
- * The UDATA pointer is passed to the sizeof_rkey() method but is
- * otherwise unused.
+ * The UDATA pointer is passed to the sizeof_rkey() method but is
+ * otherwise unused.
*
- * The BT_UD argument is a pointer to a protected B-tree
- * node.
+ * The BT_UD argument is a pointer to a protected B-tree
+ * node.
*
- * Return: Non-negative on success (The address of the new node is
+ * Return: Non-negative on success (The address of the new node is
* returned through the NEW_ADDR argument). Negative on failure.
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 3 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jul 3 1997
*
*-------------------------------------------------------------------------
*/
@@ -397,9 +397,9 @@ H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx,
{
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
- unsigned nleft, nright; /* Number of keys in left & right halves */
+ unsigned nleft, nright; /* Number of keys in left & right halves */
double split_ratios[3]; /* B-tree split ratios */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -426,18 +426,18 @@ H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx,
#ifdef H5B_DEBUG
if(H5DEBUG(B)) {
- const char *side;
-
- if(!H5F_addr_defined(bt_ud->bt->left) && !H5F_addr_defined(bt_ud->bt->right))
- side = "ONLY";
- else if(!H5F_addr_defined(bt_ud->bt->right))
- side = "RIGHT";
- else if(!H5F_addr_defined(bt_ud->bt->left))
- side = "LEFT";
- else
- side = "MIDDLE";
- fprintf(H5DEBUG(B), "H5B__split: %3u {%5.3f,%5.3f,%5.3f} %6s",
- shared->two_k, split_ratios[0], split_ratios[1], split_ratios[2], side);
+ const char *side;
+
+ if(!H5F_addr_defined(bt_ud->bt->left) && !H5F_addr_defined(bt_ud->bt->right))
+ side = "ONLY";
+ else if(!H5F_addr_defined(bt_ud->bt->right))
+ side = "RIGHT";
+ else if(!H5F_addr_defined(bt_ud->bt->left))
+ side = "LEFT";
+ else
+ side = "MIDDLE";
+ HDfprintf(H5DEBUG(B), "H5B__split: %3u {%5.3f,%5.3f,%5.3f} %6s",
+ shared->two_k, split_ratios[0], split_ratios[1], split_ratios[2], side);
}
#endif
@@ -446,11 +446,11 @@ H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx,
* and the new node.
*/
if(!H5F_addr_defined(bt_ud->bt->right))
- nleft = (unsigned)((double)shared->two_k * split_ratios[2]); /*right*/
+ nleft = (unsigned)((double)shared->two_k * split_ratios[2]); /*right*/
else if(!H5F_addr_defined(bt_ud->bt->left))
- nleft = (unsigned)((double)shared->two_k * split_ratios[0]); /*left*/
+ nleft = (unsigned)((double)shared->two_k * split_ratios[0]); /*left*/
else
- nleft = (unsigned)((double)shared->two_k * split_ratios[1]); /*middle*/
+ nleft = (unsigned)((double)shared->two_k * split_ratios[1]); /*middle*/
/*
* Keep the new child in the same node as the child that split. This can
@@ -458,25 +458,25 @@ H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx,
* sequentially, but it simplifies stuff below.
*/
if(idx < nleft && nleft == shared->two_k)
- --nleft;
+ --nleft;
else if(idx >= nleft && 0 == nleft)
- nleft++;
+ nleft++;
nright = shared->two_k - nleft;
#ifdef H5B_DEBUG
if(H5DEBUG(B))
- fprintf(H5DEBUG(B), " split %3d/%-3d\n", nleft, nright);
+ HDfprintf(H5DEBUG(B), " split %3d/%-3d\n", nleft, nright);
#endif
/*
* Create the new B-tree node.
*/
if(H5B_create(f, shared->type, udata, &split_bt_ud->addr/*out*/) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create B-tree")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create B-tree")
cache_udata.f = f;
cache_udata.type = shared->type;
cache_udata.rc_shared = bt_ud->bt->rc_shared;
if(NULL == (split_bt_ud->bt = (H5B_t *)H5AC_protect(f, H5AC_BT, split_bt_ud->addr, &cache_udata, H5AC__NO_FLAGS_SET)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree")
split_bt_ud->bt->level = bt_ud->bt->level;
/*
@@ -485,8 +485,8 @@ H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx,
split_bt_ud->cache_flags = H5AC__DIRTIED_FLAG;
HDmemcpy(split_bt_ud->bt->native,
- bt_ud->bt->native + nleft * shared->type->sizeof_nkey,
- (nright + 1) * shared->type->sizeof_nkey);
+ bt_ud->bt->native + nleft * shared->type->sizeof_nkey,
+ (nright + 1) * shared->type->sizeof_nkey);
HDmemcpy(split_bt_ud->bt->child,
&bt_ud->bt->child[nleft],
nright * sizeof(haddr_t));
@@ -532,17 +532,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B__split() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B_insert
+ * Function: H5B_insert
*
- * Purpose: Adds a new item to the B-tree.
+ * Purpose: Adds a new item to the B-tree.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 23 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 23 1997
*
*-------------------------------------------------------------------------
*/
@@ -552,22 +552,22 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
/*
* These are defined this way to satisfy alignment constraints.
*/
- uint64_t _lt_key[128], _md_key[128], _rt_key[128];
- uint8_t *lt_key=(uint8_t*)_lt_key;
- uint8_t *md_key=(uint8_t*)_md_key;
- uint8_t *rt_key=(uint8_t*)_rt_key;
+ uint64_t _lt_key[128], _md_key[128], _rt_key[128];
+ uint8_t *lt_key=(uint8_t*)_lt_key;
+ uint8_t *md_key=(uint8_t*)_md_key;
+ uint8_t *rt_key=(uint8_t*)_rt_key;
- hbool_t lt_key_changed = FALSE, rt_key_changed = FALSE;
+ hbool_t lt_key_changed = FALSE, rt_key_changed = FALSE;
haddr_t old_root_addr = HADDR_UNDEF;
- unsigned level;
+ unsigned level;
H5B_ins_ud_t bt_ud = H5B_INS_UD_T_NULL; /* (Old) root node */
H5B_ins_ud_t split_bt_ud = H5B_INS_UD_T_NULL; /* Split B-tree node */
H5B_t *new_root_bt = NULL; /* New root node */
- H5UC_t *rc_shared; /* Ref-counted shared info */
+ H5UC_t *rc_shared; /* Ref-counted shared info */
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
- H5B_ins_t my_ins = H5B_INS_ERROR;
- herr_t ret_value = SUCCEED;
+ H5B_ins_t my_ins = H5B_INS_ERROR;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI(FAIL)
@@ -595,7 +595,7 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
if((int)(my_ins = H5B__insert_helper(f, &bt_ud, type, lt_key,
&lt_key_changed, md_key, udata, rt_key, &rt_key_changed,
&split_bt_ud/*out*/)) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to insert key")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to insert key")
/* Check if the root node split */
if(H5B_INS_NOOP == my_ins) {
@@ -612,9 +612,9 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
/* update left and right keys */
if(!lt_key_changed)
- HDmemcpy(lt_key, H5B_NKEY(bt_ud.bt,shared,0), type->sizeof_nkey);
+ HDmemcpy(lt_key, H5B_NKEY(bt_ud.bt,shared,0), type->sizeof_nkey);
if(!rt_key_changed)
- HDmemcpy(rt_key, H5B_NKEY(split_bt_ud.bt,shared,split_bt_ud.bt->nchildren), type->sizeof_nkey);
+ HDmemcpy(rt_key, H5B_NKEY(split_bt_ud.bt,shared,split_bt_ud.bt->nchildren), type->sizeof_nkey);
/*
* Copy the old root node to some other file location and make the new root
@@ -623,7 +623,7 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
*/
H5_CHECK_OVERFLOW(shared->sizeof_rnode,size_t,hsize_t);
if(HADDR_UNDEF == (old_root_addr = H5MF_alloc(f, H5FD_MEM_BTREE, (hsize_t)shared->sizeof_rnode)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move root")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move root")
/*
* Move the node to the new location
@@ -636,12 +636,12 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
/* Unprotect the old root so we can move it. Also force it to be marked
* dirty so it is written to the new location. */
if(H5AC_unprotect(f, H5AC_BT, bt_ud.addr, bt_ud.bt, H5AC__DIRTIED_FLAG) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release old root")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release old root")
bt_ud.bt = NULL; /* Make certain future references will be caught */
/* Move the location of the old root on the disk */
if(H5AC_move_entry(f, H5AC_BT, bt_ud.addr, old_root_addr) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node")
bt_ud.addr = old_root_addr;
/* Update the split b-tree's left pointer to point to the new location */
@@ -688,19 +688,19 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_insert() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B__insert_child
+ * Function: H5B__insert_child
*
- * Purpose: Insert a child to the left or right of child[IDX] depending
- * on whether ANCHOR is H5B_INS_LEFT or H5B_INS_RIGHT. The BT
- * argument is a pointer to a protected B-tree node.
+ * Purpose: Insert a child to the left or right of child[IDX] depending
+ * on whether ANCHOR is H5B_INS_LEFT or H5B_INS_RIGHT. The BT
+ * argument is a pointer to a protected B-tree node.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 8 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jul 8 1997
*
*-------------------------------------------------------------------------
*/
@@ -761,35 +761,35 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx,
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5B_insert_child() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B__insert_helper
+ * Function: H5B__insert_helper
*
- * Purpose: Inserts the item UDATA into the tree rooted at ADDR and having
- * the specified type.
+ * Purpose: Inserts the item UDATA into the tree rooted at ADDR and having
+ * the specified type.
*
- * On return, if LT_KEY_CHANGED is non-zero, then LT_KEY is
- * the new native left key. Similarly for RT_KEY_CHANGED
- * and RT_KEY.
+ * On return, if LT_KEY_CHANGED is non-zero, then LT_KEY is
+ * the new native left key. Similarly for RT_KEY_CHANGED
+ * and RT_KEY.
*
- * If the node splits, then MD_KEY contains the key that
- * was split between the two nodes (that is, the key that
- * appears as the max key in the left node and the min key
- * in the right node).
+ * If the node splits, then MD_KEY contains the key that
+ * was split between the two nodes (that is, the key that
+ * appears as the max key in the left node and the min key
+ * in the right node).
*
- * Return: Success: A B-tree operation. The address of the new
- * node, if the node splits, is returned through
- * the NEW_NODE_P argument. The new node is always
- * to the right of the previous node. This
- * function is called recursively and the return
- * value influences the behavior of the caller.
- * See also, declaration of H5B_ins_t.
+ * Return: Success: A B-tree operation. The address of the new
+ * node, if the node splits, is returned through
+ * the NEW_NODE_P argument. The new node is always
+ * to the right of the previous node. This
+ * function is called recursively and the return
+ * value influences the behavior of the caller.
+ * See also, declaration of H5B_ins_t.
*
- * Failure: H5B_INS_ERROR
+ * Failure: H5B_INS_ERROR
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 9 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jul 9 1997
*
*-------------------------------------------------------------------------
*/
@@ -799,15 +799,15 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type,
uint8_t *rt_key, hbool_t *rt_key_changed, H5B_ins_ud_t *split_bt_ud/*out*/)
{
H5B_t *bt; /* Convenience pointer to B-tree */
- H5UC_t *rc_shared; /* Ref-counted shared info */
+ H5UC_t *rc_shared; /* Ref-counted shared info */
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
- unsigned lt = 0, idx = 0, rt; /* Left, final & right index values */
+ unsigned lt = 0, idx = 0, rt; /* Left, final & right index values */
int cmp = -1; /* Key comparison value */
H5B_ins_ud_t child_bt_ud = H5B_INS_UD_T_NULL; /* Child B-tree */
H5B_ins_ud_t new_child_bt_ud = H5B_INS_UD_T_NULL; /* Newly split child B-tree */
- H5B_ins_t my_ins = H5B_INS_ERROR;
- H5B_ins_t ret_value = H5B_INS_ERROR; /* Return value */
+ H5B_ins_t my_ins = H5B_INS_ERROR;
+ H5B_ins_t ret_value = H5B_INS_ERROR; /* Return value */
FUNC_ENTER_STATIC
@@ -838,7 +838,7 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type,
/* Get shared info for B-tree */
if(NULL == (rc_shared = (type->get_shared)(f, udata)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, H5B_INS_ERROR, "can't retrieve B-tree's shared ref. count object")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, H5B_INS_ERROR, "can't retrieve B-tree's shared ref. count object")
shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared);
HDassert(shared);
@@ -850,11 +850,11 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type,
rt = bt->nchildren;
while(lt < rt && cmp) {
- idx = (lt + rt) / 2;
- if((cmp = (type->cmp3)(H5B_NKEY(bt, shared, idx), udata, H5B_NKEY(bt, shared, idx + 1))) < 0)
- rt = idx;
- else
- lt = idx + 1;
+ idx = (lt + rt) / 2;
+ if((cmp = (type->cmp3)(H5B_NKEY(bt, shared, idx), udata, H5B_NKEY(bt, shared, idx + 1))) < 0)
+ rt = idx;
+ else
+ lt = idx + 1;
} /* end while */
/* Set up user data for cache callbacks */
@@ -863,26 +863,26 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type,
cache_udata.rc_shared = rc_shared;
if(0 == bt->nchildren) {
- /*
- * The value being inserted will be the only value in this tree. We
- * must necessarily be at level zero.
- */
- HDassert(0 == bt->level);
- if((type->new_node)(f, H5B_INS_FIRST, H5B_NKEY(bt, shared, 0), udata,
- H5B_NKEY(bt, shared, 1), bt->child + 0/*out*/) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, H5B_INS_ERROR, "unable to create leaf node")
- bt->nchildren = 1;
+ /*
+ * The value being inserted will be the only value in this tree. We
+ * must necessarily be at level zero.
+ */
+ HDassert(0 == bt->level);
+ if((type->new_node)(f, H5B_INS_FIRST, H5B_NKEY(bt, shared, 0), udata,
+ H5B_NKEY(bt, shared, 1), bt->child + 0/*out*/) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, H5B_INS_ERROR, "unable to create leaf node")
+ bt->nchildren = 1;
bt_ud->cache_flags |= H5AC__DIRTIED_FLAG;
- idx = 0;
+ idx = 0;
- if(type->follow_min) {
- if((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx),
+ if(type->follow_min) {
+ if((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx),
lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1),
rt_key_changed, &new_child_bt_ud.addr/*out*/)) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "unable to insert first leaf node")
- } /* end if */
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "unable to insert first leaf node")
+ } /* end if */
else
- my_ins = H5B_INS_NOOP;
+ my_ins = H5B_INS_NOOP;
} else if(cmp < 0 && idx == 0) {
if(bt->level > 0) {
/*
@@ -977,36 +977,36 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type,
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "internal error: likely corrupt key values")
#endif /* H5_STRICT_FORMAT_CHECKS */
} else if(cmp) {
- /*
- * We couldn't figure out which branch to follow out of this node. THIS
- * IS A MAJOR PROBLEM THAT NEEDS TO BE FIXED --rpm.
- */
- HDassert("INTERNAL HDF5 ERROR (contact rpm)" && 0);
+ /*
+ * We couldn't figure out which branch to follow out of this node. THIS
+ * IS A MAJOR PROBLEM THAT NEEDS TO BE FIXED --rpm.
+ */
+ HDassert("INTERNAL HDF5 ERROR (contact rpm)" && 0);
#ifdef NDEBUG
- HDabort();
+ HDabort();
#endif /* NDEBUG */
} else if(bt->level > 0) {
- /*
- * Follow a branch out of this node to another subtree.
- */
- HDassert(idx < bt->nchildren);
- child_bt_ud.addr = bt->child[idx];
+ /*
+ * Follow a branch out of this node to another subtree.
+ */
+ HDassert(idx < bt->nchildren);
+ child_bt_ud.addr = bt->child[idx];
if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node")
- if((int)(my_ins = H5B__insert_helper(f, &child_bt_ud, type,
+ if((int)(my_ins = H5B__insert_helper(f, &child_bt_ud, type,
H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata,
H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert subtree")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert subtree")
} else {
- /*
- * Follow a branch out of this node to a leaf node of some other type.
- */
- HDassert(idx < bt->nchildren);
- if((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx),
+ /*
+ * Follow a branch out of this node to a leaf node of some other type.
+ */
+ HDassert(idx < bt->nchildren);
+ if((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx),
lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1),
rt_key_changed, &new_child_bt_ud.addr/*out*/)) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert leaf node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert leaf node")
}
HDassert((int)my_ins >= 0);
@@ -1039,40 +1039,40 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type,
*/
HDassert(!(bt->level == 0) != !(child_bt_ud.bt));
if(H5B_INS_CHANGE == my_ins) {
- /*
- * The insertion simply changed the address for the child.
- */
- HDassert(!child_bt_ud.bt);
- HDassert(bt->level == 0);
- bt->child[idx] = new_child_bt_ud.addr;
+ /*
+ * The insertion simply changed the address for the child.
+ */
+ HDassert(!child_bt_ud.bt);
+ HDassert(bt->level == 0);
+ bt->child[idx] = new_child_bt_ud.addr;
bt_ud->cache_flags |= H5AC__DIRTIED_FLAG;
} else if(H5B_INS_LEFT == my_ins || H5B_INS_RIGHT == my_ins) {
unsigned *tmp_bt_flags_ptr = NULL;
- H5B_t *tmp_bt;
-
- /*
- * If this node is full then split it before inserting the new child.
- */
- if(bt->nchildren == shared->two_k) {
- if(H5B__split(f, bt_ud, idx, udata, split_bt_ud/*out*/) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, H5B_INS_ERROR, "unable to split node")
- if(idx < bt->nchildren) {
- tmp_bt = bt;
+ H5B_t *tmp_bt;
+
+ /*
+ * If this node is full then split it before inserting the new child.
+ */
+ if(bt->nchildren == shared->two_k) {
+ if(H5B__split(f, bt_ud, idx, udata, split_bt_ud/*out*/) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, H5B_INS_ERROR, "unable to split node")
+ if(idx < bt->nchildren) {
+ tmp_bt = bt;
tmp_bt_flags_ptr = &bt_ud->cache_flags;
- } else {
- idx -= bt->nchildren;
- tmp_bt = split_bt_ud->bt;
+ } else {
+ idx -= bt->nchildren;
+ tmp_bt = split_bt_ud->bt;
tmp_bt_flags_ptr = &split_bt_ud->cache_flags;
- }
- } /* end if */
+ }
+ } /* end if */
else {
- tmp_bt = bt;
+ tmp_bt = bt;
tmp_bt_flags_ptr = &bt_ud->cache_flags;
- } /* end else */
+ } /* end else */
- /* Insert the child */
- if(H5B__insert_child(tmp_bt, tmp_bt_flags_ptr, idx, new_child_bt_ud.addr, my_ins, md_key) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert child")
+ /* Insert the child */
+ if(H5B__insert_child(tmp_bt, tmp_bt_flags_ptr, idx, new_child_bt_ud.addr, my_ins, md_key) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert child")
} /* end else-if */
/*
@@ -1080,20 +1080,20 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type,
* by the left and right node).
*/
if(split_bt_ud->bt) {
- HDmemcpy(md_key, H5B_NKEY(split_bt_ud->bt, shared, 0), type->sizeof_nkey);
- ret_value = H5B_INS_RIGHT;
+ HDmemcpy(md_key, H5B_NKEY(split_bt_ud->bt, shared, 0), type->sizeof_nkey);
+ ret_value = H5B_INS_RIGHT;
#ifdef H5B_DEBUG
- /*
- * The max key in the original left node must be equal to the min key
- * in the new node.
- */
- cmp = (type->cmp2)(H5B_NKEY(bt, shared, bt->nchildren), udata,
- H5B_NKEY(split_bt_ud->bt, shared, 0));
- HDassert(0 == cmp);
+ /*
+ * The max key in the original left node must be equal to the min key
+ * in the new node.
+ */
+ cmp = (type->cmp2)(H5B_NKEY(bt, shared, bt->nchildren), udata,
+ H5B_NKEY(split_bt_ud->bt, shared, 0));
+ HDassert(0 == cmp);
#endif
} /* end if */
else
- ret_value = H5B_INS_NOOP;
+ ret_value = H5B_INS_NOOP;
done:
if(child_bt_ud.bt)
@@ -1107,18 +1107,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_insert_helper() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B__iterate_helper
+ * Function: H5B__iterate_helper
*
- * Purpose: Calls the list callback for each leaf node of the
- * B-tree, passing it the caller's UDATA structure.
+ * Purpose: Calls the list callback for each leaf node of the
+ * B-tree, passing it the caller's UDATA structure.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 23 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 23 1997
*
*-------------------------------------------------------------------------
*/
@@ -1127,7 +1127,7 @@ H5B__iterate_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr,
H5B_operator_t op, void *udata)
{
H5B_t *bt = NULL; /* Pointer to current B-tree node */
- H5UC_t *rc_shared; /* Ref-counted shared info */
+ H5UC_t *rc_shared; /* Ref-counted shared info */
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
unsigned u; /* Local index variable */
@@ -1174,18 +1174,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B__iterate_helper() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B_iterate
+ * Function: H5B_iterate
*
- * Purpose: Calls the list callback for each leaf node of the
- * B-tree, passing it the UDATA structure.
+ * Purpose: Calls the list callback for each leaf node of the
+ * B-tree, passing it the UDATA structure.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 23 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 23 1997
*
*-------------------------------------------------------------------------
*/
@@ -1213,27 +1213,27 @@ H5B_iterate(H5F_t *f, const H5B_class_t *type, haddr_t addr,
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_iterate() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B__remove_helper
+ * Function: H5B__remove_helper
*
- * Purpose: The recursive part of removing an item from a B-tree. The
- * sub B-tree that is being considered is located at ADDR and
- * the item to remove is described by UDATA. If the removed
- * item falls at the left or right end of the current level then
- * it might be necessary to adjust the left and/or right keys
- * (LT_KEY and/or RT_KEY) to to indicate that they changed by
- * setting LT_KEY_CHANGED and/or RT_KEY_CHANGED.
+ * Purpose: The recursive part of removing an item from a B-tree. The
+ * sub B-tree that is being considered is located at ADDR and
+ * the item to remove is described by UDATA. If the removed
+ * item falls at the left or right end of the current level then
+ * it might be necessary to adjust the left and/or right keys
+ * (LT_KEY and/or RT_KEY) to to indicate that they changed by
+ * setting LT_KEY_CHANGED and/or RT_KEY_CHANGED.
*
- * Return: Success: A B-tree operation, see comments for
- * H5B_ins_t declaration. This function is
- * called recursively and the return value
- * influences the actions of the caller. It is
- * also called by H5B_remove().
+ * Return: Success: A B-tree operation, see comments for
+ * H5B_ins_t declaration. This function is
+ * called recursively and the return value
+ * influences the actions of the caller. It is
+ * also called by H5B_remove().
*
- * Failure: H5B_INS_ERROR, a negative value.
+ * Failure: H5B_INS_ERROR, a negative value.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, September 16, 1998
*
*-------------------------------------------------------------------------
@@ -1243,14 +1243,14 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level,
uint8_t *lt_key/*out*/, hbool_t *lt_key_changed/*out*/, void *udata,
uint8_t *rt_key/*out*/, hbool_t *rt_key_changed/*out*/)
{
- H5B_t *bt = NULL, *sibling = NULL;
- unsigned bt_flags = H5AC__NO_FLAGS_SET;
- H5UC_t *rc_shared; /* Ref-counted shared info */
+ H5B_t *bt = NULL, *sibling = NULL;
+ unsigned bt_flags = H5AC__NO_FLAGS_SET;
+ H5UC_t *rc_shared; /* Ref-counted shared info */
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
unsigned idx = 0, lt = 0, rt; /* Final, left & right indices */
int cmp = 1; /* Key comparison value */
- H5B_ins_t ret_value = H5B_INS_ERROR;
+ H5B_ins_t ret_value = H5B_INS_ERROR;
FUNC_ENTER_STATIC
@@ -1265,7 +1265,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level,
/* Get shared info for B-tree */
if(NULL == (rc_shared = (type->get_shared)(f, udata)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, H5B_INS_ERROR, "can't retrieve B-tree's shared ref. count object")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, H5B_INS_ERROR, "can't retrieve B-tree's shared ref. count object")
shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared);
HDassert(shared);
@@ -1277,18 +1277,18 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level,
cache_udata.type = type;
cache_udata.rc_shared = rc_shared;
if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load B-tree node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load B-tree node")
rt = bt->nchildren;
while(lt < rt && cmp) {
- idx = (lt + rt) / 2;
- if((cmp = (type->cmp3)(H5B_NKEY(bt, shared, idx), udata, H5B_NKEY(bt, shared, idx + 1))) < 0)
- rt = idx;
- else
- lt = idx + 1;
+ idx = (lt + rt) / 2;
+ if((cmp = (type->cmp3)(H5B_NKEY(bt, shared, idx), udata, H5B_NKEY(bt, shared, idx + 1))) < 0)
+ rt = idx;
+ else
+ lt = idx + 1;
} /* end while */
if(cmp)
- HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "B-tree key not found")
+ HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "B-tree key not found")
/*
* Follow the link to the subtree or to the data node. The return value
@@ -1296,31 +1296,31 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level,
*/
HDassert(idx < bt->nchildren);
if(bt->level > 0) {
- /* We're at an internal node -- call recursively */
- if((int)(ret_value = H5B__remove_helper(f, bt->child[idx], type,
+ /* We're at an internal node -- call recursively */
+ if((int)(ret_value = H5B__remove_helper(f, bt->child[idx], type,
level + 1, H5B_NKEY(bt, shared, idx)/*out*/,
lt_key_changed/*out*/, udata, H5B_NKEY(bt, shared, idx + 1)/*out*/,
rt_key_changed/*out*/)) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "key not found in subtree")
+ HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "key not found in subtree")
} else if(type->remove) {
- /*
- * We're at a leaf node but the leaf node points to an object that
- * has a removal method. Pass the removal request to the pointed-to
- * object and let it decide how to progress.
- */
- if((int)(ret_value = (type->remove)(f, bt->child[idx],
+ /*
+ * We're at a leaf node but the leaf node points to an object that
+ * has a removal method. Pass the removal request to the pointed-to
+ * object and let it decide how to progress.
+ */
+ if((int)(ret_value = (type->remove)(f, bt->child[idx],
H5B_NKEY(bt, shared, idx), lt_key_changed, udata,
H5B_NKEY(bt, shared, idx + 1), rt_key_changed)) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "key not found in leaf node")
+ HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "key not found in leaf node")
} else {
- /*
- * We're at a leaf node which points to an object that has no removal
- * method. The best we can do is to leave the object alone but
- * remove the B-tree reference to the object.
- */
- *lt_key_changed = FALSE;
- *rt_key_changed = FALSE;
- ret_value = H5B_INS_REMOVE;
+ /*
+ * We're at a leaf node which points to an object that has no removal
+ * method. The best we can do is to leave the object alone but
+ * remove the B-tree reference to the object.
+ */
+ *lt_key_changed = FALSE;
+ *rt_key_changed = FALSE;
+ ret_value = H5B_INS_REMOVE;
}
/*
@@ -1416,7 +1416,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level,
bt->nchildren = 0;
/* Delete the node from disk (via the metadata cache) */
- bt_flags |= H5AC__DIRTIED_FLAG | H5AC__FREE_FILE_SPACE_FLAG;
+ bt_flags |= H5AC__DIRTIED_FLAG | H5AC__FREE_FILE_SPACE_FLAG;
H5_CHECK_OVERFLOW(shared->sizeof_rnode, size_t, hsize_t);
if(H5AC_unprotect(f, H5AC_BT, addr, bt, bt_flags | H5AC__DELETED_FLAG) < 0) {
bt = NULL;
@@ -1541,24 +1541,24 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level,
done:
if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, bt_flags) < 0)
- HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node")
+ HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B__remove_helper() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B_remove
+ * Function: H5B_remove
*
- * Purpose: Removes an item from a B-tree.
+ * Purpose: Removes an item from a B-tree.
*
- * Note: The current version does not attempt to rebalance the tree.
+ * Note: The current version does not attempt to rebalance the tree.
* (Read the paper Yao & Lehman paper for details on why)
*
- * Return: Non-negative on success/Negative on failure (failure includes
- * not being able to find the object which is to be removed).
+ * Return: Non-negative on success/Negative on failure (failure includes
+ * not being able to find the object which is to be removed).
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, September 16, 1998
*
*-------------------------------------------------------------------------
@@ -1567,11 +1567,11 @@ herr_t
H5B_remove(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
{
/* These are defined this way to satisfy alignment constraints */
- uint64_t _lt_key[128], _rt_key[128];
- uint8_t *lt_key = (uint8_t*)_lt_key; /*left key*/
- uint8_t *rt_key = (uint8_t*)_rt_key; /*right key*/
- hbool_t lt_key_changed = FALSE; /*left key changed?*/
- hbool_t rt_key_changed = FALSE; /*right key changed?*/
+ uint64_t _lt_key[128], _rt_key[128];
+ uint8_t *lt_key = (uint8_t*)_lt_key; /*left key*/
+ uint8_t *rt_key = (uint8_t*)_rt_key; /*right key*/
+ hbool_t lt_key_changed = FALSE; /*left key changed?*/
+ hbool_t rt_key_changed = FALSE; /*right key changed?*/
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1584,7 +1584,7 @@ H5B_remove(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
/* The actual removal */
if(H5B_INS_ERROR == H5B__remove_helper(f, addr, type, 0, lt_key, &lt_key_changed, udata, rt_key, &rt_key_changed))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to remove entry from B-tree")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to remove entry from B-tree")
#ifdef H5B_DEBUG
H5B__assert(f, addr, type, udata);
@@ -1593,16 +1593,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_remove() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B_delete
+ * Function: H5B_delete
*
- * Purpose: Deletes an entire B-tree from the file, calling the 'remove'
+ * Purpose: Deletes an entire B-tree from the file, calling the 'remove'
* callbacks for each node.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, March 20, 2003
*
*-------------------------------------------------------------------------
@@ -1610,8 +1610,8 @@ done:
herr_t
H5B_delete(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
{
- H5B_t *bt = NULL; /* B-tree node being operated on */
- H5UC_t *rc_shared; /* Ref-counted shared info */
+ H5B_t *bt = NULL; /* B-tree node being operated on */
+ H5UC_t *rc_shared; /* Ref-counted shared info */
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
unsigned u; /* Local index variable */
@@ -1668,18 +1668,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_delete() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B_shared_new
+ * Function: H5B_shared_new
*
- * Purpose: Allocates & constructs a shared v1 B-tree struct for client.
+ * Purpose: Allocates & constructs a shared v1 B-tree struct for client.
*
- * Return: Success: non-NULL pointer to struct allocated
- * Failure: NULL
+ * Return: Success: non-NULL pointer to struct allocated
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * May 27 2008
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * May 27 2008
*
*-------------------------------------------------------------------------
*/
@@ -1687,7 +1687,7 @@ H5B_shared_t *
H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey)
{
H5B_shared_t *shared = NULL; /* New shared B-tree struct */
- size_t u; /* Local index variable */
+ size_t u; /* Local index variable */
H5B_shared_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1699,7 +1699,7 @@ H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey)
/* Allocate space for the shared structure */
if(NULL == (shared = H5FL_CALLOC(H5B_shared_t)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for shared B-tree info")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for shared B-tree info")
/* Set up the "global" information for this file's groups */
shared->type = type;
@@ -1709,9 +1709,9 @@ H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey)
shared->sizeof_rkey = sizeof_rkey;
HDassert(shared->sizeof_rkey);
shared->sizeof_keys = (shared->two_k + 1) * type->sizeof_nkey;
- shared->sizeof_rnode = ((size_t)H5B_SIZEOF_HDR(f) + /*node header */
- shared->two_k * H5F_SIZEOF_ADDR(f) + /*child pointers */
- (shared->two_k + 1) * shared->sizeof_rkey); /*keys */
+ shared->sizeof_rnode = ((size_t)H5B_SIZEOF_HDR(f) + /*node header */
+ shared->two_k * H5F_SIZEOF_ADDR(f) + /*child pointers */
+ (shared->two_k + 1) * shared->sizeof_rkey); /*keys */
HDassert(shared->sizeof_rnode);
/* Allocate and clear shared buffers */
@@ -1742,15 +1742,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_shared_new() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B_shared_free
+ * Function: H5B_shared_free
*
- * Purpose: Free B-tree shared info
+ * Purpose: Free B-tree shared info
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 27, 2008
*
*-------------------------------------------------------------------------
@@ -1774,28 +1774,28 @@ H5B_shared_free(void *_shared)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5B_shared_free() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B__copy
+ * Function: H5B__copy
*
- * Purpose: Deep copies an existing H5B_t node.
+ * Purpose: Deep copies an existing H5B_t node.
*
- * Return: Success: Pointer to H5B_t object.
+ * Return: Success: Pointer to H5B_t object.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Apr 18 2000
+ * Programmer: Quincey Koziol
+ * koziol@ncsa.uiuc.edu
+ * Apr 18 2000
*
*-------------------------------------------------------------------------
*/
static H5B_t *
H5B__copy(const H5B_t *old_bt)
{
- H5B_t *new_node = NULL;
+ H5B_t *new_node = NULL;
H5B_shared_t *shared; /* Pointer to shared B-tree info */
- H5B_t *ret_value = NULL; /* Return value */
+ H5B_t *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -1833,26 +1833,26 @@ H5B__copy(const H5B_t *old_bt)
done:
if(NULL == ret_value) {
if(new_node) {
- new_node->native = H5FL_BLK_FREE(native_block, new_node->native);
- new_node->child = H5FL_SEQ_FREE(haddr_t, new_node->child);
- new_node = H5FL_FREE(H5B_t, new_node);
+ new_node->native = H5FL_BLK_FREE(native_block, new_node->native);
+ new_node->child = H5FL_SEQ_FREE(haddr_t, new_node->child);
+ new_node = H5FL_FREE(H5B_t, new_node);
} /* end if */
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B__copy() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B__get_info_helper
+ * Function: H5B__get_info_helper
*
- * Purpose: Walks the B-tree nodes, getting information for all of them.
+ * Purpose: Walks the B-tree nodes, getting information for all of them.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Jun 3 2008
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * Jun 3 2008
*
*-------------------------------------------------------------------------
*/
@@ -1864,8 +1864,8 @@ H5B__get_info_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr,
H5UC_t *rc_shared; /* Ref-counted shared info */
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
- unsigned level; /* Node level */
- size_t sizeof_rnode; /* Size of raw (disk) node */
+ unsigned level; /* Node level */
+ size_t sizeof_rnode; /* Size of raw (disk) node */
haddr_t next_addr; /* Address of next node to the right */
haddr_t left_child; /* Address of left-most child in node */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1884,7 +1884,7 @@ H5B__get_info_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr,
/* Get shared info for B-tree */
if(NULL == (rc_shared = (type->get_shared)(f, info_udata->udata)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared);
HDassert(shared);
@@ -1896,7 +1896,7 @@ H5B__get_info_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr,
cache_udata.type = type;
cache_udata.rc_shared = rc_shared;
if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node")
/* Cache information from this node */
left_child = bt->child[0];
@@ -1937,9 +1937,9 @@ H5B__get_info_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr,
/* Check for another "row" of B-tree nodes to iterate over */
if(level > 0) {
- /* Keep following the left-most child until we reach a leaf node. */
- if(H5B__get_info_helper(f, type, left_child, info_udata) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "unable to list B-tree node")
+ /* Keep following the left-most child until we reach a leaf node. */
+ if(H5B__get_info_helper(f, type, left_child, info_udata) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "unable to list B-tree node")
} /* end if */
done:
@@ -1949,7 +1949,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B__get_info_helper() */
-
+
/*-------------------------------------------------------------------------
* Function: H5B_get_info
*
@@ -1967,7 +1967,7 @@ H5B_get_info(H5F_t *f, const H5B_class_t *type, haddr_t addr,
H5B_info_t *bt_info, H5B_operator_t op, void *udata)
{
H5B_info_ud_t info_udata; /* User-data for B-tree size iteration */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -2001,7 +2001,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_get_info() */
-
+
/*-------------------------------------------------------------------------
* Function: H5B_valid
*
@@ -2021,7 +2021,7 @@ H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr)
H5UC_t *rc_shared; /* Ref-counted shared info */
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
- htri_t ret_value = SUCCEED; /* Return value */
+ htri_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -2036,7 +2036,7 @@ H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr)
/* Get shared info for B-tree */
if(NULL == (rc_shared = (type->get_shared)(f, NULL)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared);
HDassert(shared);
@@ -2047,7 +2047,7 @@ H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr)
cache_udata.type = type;
cache_udata.rc_shared = rc_shared;
if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree node")
done:
/* Release the node */
@@ -2057,7 +2057,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_valid() */
-
+
/*-------------------------------------------------------------------------
* Function: H5B__node_dest
*
diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c
index 5cad81b..f15fe79 100644
--- a/src/H5Bdbg.c
+++ b/src/H5Bdbg.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Bdbg.c
- * Dec 11 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5Bdbg.c
+ * Dec 11 2008
+ * Quincey Koziol <koziol@hdfgroup.org>
*
- * Purpose: Debugging routines for B-link tree package.
+ * Purpose: Debugging routines for B-link tree package.
*
*-------------------------------------------------------------------------
*/
@@ -32,35 +32,35 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Bpkg.h" /* B-link trees */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5Bpkg.h" /* B-link trees */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5MMprivate.h" /* Memory management */
+
-
/*-------------------------------------------------------------------------
- * Function: H5B_debug
+ * Function: H5B_debug
*
- * Purpose: Prints debugging info about a B-tree.
+ * Purpose: Prints debugging info about a B-tree.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Aug 4 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Aug 4 1997
*
*-------------------------------------------------------------------------
*/
herr_t
H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
- const H5B_class_t *type, void *udata)
+ const H5B_class_t *type, void *udata)
{
- H5B_t *bt = NULL;
- H5UC_t *rc_shared; /* Ref-counted shared info */
+ H5B_t *bt = NULL;
+ H5UC_t *rc_shared; /* Ref-counted shared info */
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
- unsigned u; /* Local index variable */
+ unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -80,7 +80,7 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
/* Get shared info for B-tree */
if(NULL == (rc_shared = (type->get_shared)(f, udata)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared);
HDassert(shared);
@@ -91,61 +91,61 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
cache_udata.type = type;
cache_udata.rc_shared = rc_shared;
if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node")
/*
* Print the values.
*/
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Tree type ID:",
- ((shared->type->id) == H5B_SNODE_ID ? "H5B_SNODE_ID" :
+ "Tree type ID:",
+ ((shared->type->id) == H5B_SNODE_ID ? "H5B_SNODE_ID" :
((shared->type->id) == H5B_CHUNK_ID ? "H5B_CHUNK_ID" : "Unknown!")));
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "Size of node:",
- shared->sizeof_rnode);
+ "Size of node:",
+ shared->sizeof_rnode);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "Size of raw (disk) key:",
- shared->sizeof_rkey);
+ "Size of raw (disk) key:",
+ shared->sizeof_rkey);
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Dirty flag:",
- bt->cache_info.is_dirty ? "True" : "False");
+ "Dirty flag:",
+ bt->cache_info.is_dirty ? "True" : "False");
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Level:",
- bt->level);
+ "Level:",
+ bt->level);
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
- "Address of left sibling:",
- bt->left);
+ "Address of left sibling:",
+ bt->left);
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
- "Address of right sibling:",
- bt->right);
+ "Address of right sibling:",
+ bt->right);
HDfprintf(stream, "%*s%-*s %u (%u)\n", indent, "", fwidth,
- "Number of children (max):",
- bt->nchildren, shared->two_k);
+ "Number of children (max):",
+ bt->nchildren, shared->two_k);
/*
* Print the child addresses
*/
for(u = 0; u < bt->nchildren; u++) {
- HDfprintf(stream, "%*sChild %d...\n", indent, "", u);
- HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3),
- "Address:", bt->child[u]);
+ HDfprintf(stream, "%*sChild %d...\n", indent, "", u);
+ HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3),
+ "Address:", bt->child[u]);
/* If there is a key debugging routine, use it to display the left & right keys */
- if(type->debug_key) {
+ if(type->debug_key) {
/* Decode the 'left' key & print it */
HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3),
"Left Key:");
HDassert(H5B_NKEY(bt,shared,u));
- (void)(type->debug_key)(stream, indent + 6, MAX(0, fwidth - 6),
- H5B_NKEY(bt, shared, u), udata);
+ (void)(type->debug_key)(stream, indent + 6, MAX(0, fwidth - 6),
+ H5B_NKEY(bt, shared, u), udata);
/* Decode the 'right' key & print it */
HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3),
"Right Key:");
HDassert(H5B_NKEY(bt, shared, u + 1));
- (void)(type->debug_key)(stream, indent + 6, MAX (0, fwidth - 6),
- H5B_NKEY(bt, shared, u + 1), udata);
- } /* end if */
+ (void)(type->debug_key)(stream, indent + 6, MAX (0, fwidth - 6),
+ H5B_NKEY(bt, shared, u + 1), udata);
+ } /* end if */
} /* end for */
done:
@@ -155,18 +155,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_debug() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5B__assert
+ * Function: H5B__assert
*
- * Purpose: Verifies that the tree is structured correctly.
+ * Purpose: Verifies that the tree is structured correctly.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: aborts if something is wrong.
+ * Failure: aborts if something is wrong.
*
- * Programmer: Robb Matzke
- * Tuesday, November 4, 1997
+ * Programmer: Robb Matzke
+ * Tuesday, November 4, 1997
*
*-------------------------------------------------------------------------
*/
@@ -174,32 +174,32 @@ done:
herr_t
H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata)
{
- H5B_t *bt = NULL;
- H5UC_t *rc_shared; /* Ref-counted shared info */
+ H5B_t *bt = NULL;
+ H5UC_t *rc_shared; /* Ref-counted shared info */
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
- int ncell, cmp;
- static int ncalls = 0;
- herr_t status;
+ int ncell, cmp;
+ static int ncalls = 0;
+ herr_t status;
herr_t ret_value = SUCCEED; /* Return value */
/* A queue of child data */
struct child_t {
- haddr_t addr;
- unsigned level;
- struct child_t *next;
+ haddr_t addr;
+ unsigned level;
+ struct child_t *next;
} *head = NULL, *tail = NULL, *prev = NULL, *cur = NULL, *tmp = NULL;
FUNC_ENTER_PACKAGE
if(0 == ncalls++) {
- if(H5DEBUG(B))
- fprintf(H5DEBUG(B), "H5B: debugging B-trees (expensive)\n");
+ if(H5DEBUG(B))
+ HDfprintf(H5DEBUG(B), "H5B: debugging B-trees (expensive)\n");
} /* end if */
/* Get shared info for B-tree */
if(NULL == (rc_shared = (type->get_shared)(f, udata)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared);
HDassert(shared);
@@ -228,60 +228,60 @@ H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata)
* test.
*/
for(ncell = 0; cur; ncell++) {
- bt = (H5B_t *)H5AC_protect(f, H5AC_BT, cur->addr, &cache_udata, H5AC__READ_ONLY_FLAG);
- HDassert(bt);
-
- /* Check node header */
- HDassert(bt->level == cur->level);
- if(cur->next && cur->next->level == bt->level)
- HDassert(H5F_addr_eq(bt->right, cur->next->addr));
- else
- HDassert(!H5F_addr_defined(bt->right));
- if(prev && prev->level == bt->level)
- HDassert(H5F_addr_eq(bt->left, prev->addr));
- else
- HDassert(!H5F_addr_defined(bt->left));
-
- if(cur->level > 0) {
+ bt = (H5B_t *)H5AC_protect(f, H5AC_BT, cur->addr, &cache_udata, H5AC__READ_ONLY_FLAG);
+ HDassert(bt);
+
+ /* Check node header */
+ HDassert(bt->level == cur->level);
+ if(cur->next && cur->next->level == bt->level)
+ HDassert(H5F_addr_eq(bt->right, cur->next->addr));
+ else
+ HDassert(!H5F_addr_defined(bt->right));
+ if(prev && prev->level == bt->level)
+ HDassert(H5F_addr_eq(bt->left, prev->addr));
+ else
+ HDassert(!H5F_addr_defined(bt->left));
+
+ if(cur->level > 0) {
unsigned u;
- for(u = 0; u < bt->nchildren; u++) {
- /*
- * Check that child nodes haven't already been seen. If they
- * have then the tree has a cycle.
- */
- for(tmp = head; tmp; tmp = tmp->next)
- HDassert(H5F_addr_ne(tmp->addr, bt->child[u]));
-
- /* Add the child node to the end of the queue */
- tmp = (struct child_t *)H5MM_calloc(sizeof(struct child_t));
- HDassert(tmp);
- tmp->addr = bt->child[u];
- tmp->level = bt->level - 1;
- tail->next = tmp;
- tail = tmp;
-
- /* Check that the keys are monotonically increasing */
- cmp = (type->cmp2)(H5B_NKEY(bt, shared, u), udata, H5B_NKEY(bt, shared, u + 1));
- HDassert(cmp < 0);
- } /* end for */
- } /* end if */
-
- /* Release node */
- status = H5AC_unprotect(f, H5AC_BT, cur->addr, bt, H5AC__NO_FLAGS_SET);
- HDassert(status >= 0);
+ for(u = 0; u < bt->nchildren; u++) {
+ /*
+ * Check that child nodes haven't already been seen. If they
+ * have then the tree has a cycle.
+ */
+ for(tmp = head; tmp; tmp = tmp->next)
+ HDassert(H5F_addr_ne(tmp->addr, bt->child[u]));
+
+ /* Add the child node to the end of the queue */
+ tmp = (struct child_t *)H5MM_calloc(sizeof(struct child_t));
+ HDassert(tmp);
+ tmp->addr = bt->child[u];
+ tmp->level = bt->level - 1;
+ tail->next = tmp;
+ tail = tmp;
+
+ /* Check that the keys are monotonically increasing */
+ cmp = (type->cmp2)(H5B_NKEY(bt, shared, u), udata, H5B_NKEY(bt, shared, u + 1));
+ HDassert(cmp < 0);
+ } /* end for */
+ } /* end if */
+
+ /* Release node */
+ status = H5AC_unprotect(f, H5AC_BT, cur->addr, bt, H5AC__NO_FLAGS_SET);
+ HDassert(status >= 0);
bt = NULL; /* Make certain future references will be caught */
- /* Advance current location in queue */
- prev = cur;
- cur = cur->next;
+ /* Advance current location in queue */
+ prev = cur;
+ cur = cur->next;
} /* end for */
/* Free all entries from queue */
while(head) {
- tmp = head->next;
- H5MM_xfree(head);
- head = tmp;
+ tmp = head->next;
+ H5MM_xfree(head);
+ head = tmp;
} /* end while */
done:
diff --git a/src/H5CX.c b/src/H5CX.c
index 6b5e510..3101e64 100644
--- a/src/H5CX.c
+++ b/src/H5CX.c
@@ -182,10 +182,26 @@ typedef struct H5CX_t {
hid_t dxpl_id; /* DXPL ID for API operation */
H5P_genplist_t *dxpl; /* Dataset Transfer Property List */
+ /* LCPL */
+ hid_t lcpl_id; /* LCPL ID for API operation */
+ H5P_genplist_t *lcpl; /* Link Creation Property List */
+
/* LAPL */
hid_t lapl_id; /* LAPL ID for API operation */
H5P_genplist_t *lapl; /* Link Access Property List */
+ /* DCPL */
+ hid_t dcpl_id; /* DCPL ID for API operation */
+ H5P_genplist_t *dcpl; /* Dataset Creation Property List */
+
+ /* DAPL */
+ hid_t dapl_id; /* DAPL ID for API operation */
+ H5P_genplist_t *dapl; /* Dataset Access Property List */
+
+ /* FAPL */
+ hid_t fapl_id; /* FAPL ID for API operation */
+ H5P_genplist_t *fapl; /* File Access Property List */
+
/* Internal: Object tagging info */
haddr_t tag; /* Current object's tag (ohdr chunk #0 address) */
@@ -267,9 +283,33 @@ typedef struct H5CX_t {
#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */
#endif /* H5_HAVE_PARALLEL */
+ /* Cached LCPL properties */
+ H5T_cset_t encoding; /* Link name character encoding */
+ hbool_t encoding_valid; /* Whether link name character encoding is valid */
+ unsigned intermediate_group; /* Whether to create intermediate groups */
+ hbool_t intermediate_group_valid; /* Whether create intermediate group flag is valid */
+
/* Cached LAPL properties */
size_t nlinks; /* Number of soft / UD links to traverse (H5L_ACS_NLINKS_NAME) */
hbool_t nlinks_valid; /* Whether number of soft / UD links to traverse is valid */
+
+ /* Cached DCPL properties */
+ hbool_t do_min_dset_ohdr; /* Whether to minimize dataset object header */
+ hbool_t do_min_dset_ohdr_valid; /* Whether minimize dataset object header flag is valid */
+ uint8_t ohdr_flags; /* Object header flags */
+ hbool_t ohdr_flags_valid; /* Whether the object headers flags are valid */
+
+ /* Cached DAPL properties */
+ char *extfile_prefix; /* Prefix for external file */
+ hbool_t extfile_prefix_valid; /* Whether the prefix for external file is valid */
+ char *vds_prefix; /* Prefix for VDS */
+ hbool_t vds_prefix_valid; /* Whether the prefix for VDS is valid */
+
+ /* Cached FAPL properties */
+ H5F_libver_t low_bound; /* low_bound property for H5Pset_libver_bounds() */
+ hbool_t low_bound_valid; /* Whether low_bound property is valid */
+ H5F_libver_t high_bound; /* high_bound property for H5Pset_libver_bounds */
+ hbool_t high_bound_valid; /* Whether high_bound property is valid */
} H5CX_t;
/* Typedef for nodes on the API context stack */
@@ -313,12 +353,40 @@ typedef struct H5CX_dxpl_cache_t {
H5T_conv_cb_t dt_conv_cb; /* Datatype conversion struct (H5D_XFER_CONV_CB_NAME) */
} H5CX_dxpl_cache_t;
+/* Typedef for cached default link creation property list information */
+/* (Same as the cached DXPL struct, above, except for the default LCPL) */
+typedef struct H5CX_lcpl_cache_t {
+ H5T_cset_t encoding; /* Link name character encoding */
+ unsigned intermediate_group; /* Whether to create intermediate groups */
+} H5CX_lcpl_cache_t;
+
/* Typedef for cached default link access property list information */
/* (Same as the cached DXPL struct, above, except for the default LAPL) */
typedef struct H5CX_lapl_cache_t {
size_t nlinks; /* Number of soft / UD links to traverse (H5L_ACS_NLINKS_NAME) */
} H5CX_lapl_cache_t;
+/* Typedef for cached default dataset creation property list information */
+/* (Same as the cached DXPL struct, above, except for the default DCPL) */
+typedef struct H5CX_dcpl_cache_t {
+ hbool_t do_min_dset_ohdr; /* Whether to minimize dataset object header */
+ uint8_t ohdr_flags; /* Object header flags */
+} H5CX_dcpl_cache_t;
+
+/* Typedef for cached default dataset access property list information */
+/* (Same as the cached DXPL struct, above, except for the default DXPL) */
+typedef struct H5CX_dapl_cache_t {
+ char *extfile_prefix; /* Prefix for external file */
+ char *vds_prefix; /* Prefix for VDS */
+} H5CX_dapl_cache_t;
+
+/* Typedef for cached default file access property list information */
+/* (Same as the cached DXPL struct, above, except for the default DCPL) */
+typedef struct H5CX_fapl_cache_t {
+ H5F_libver_t low_bound; /* low_bound property for H5Pset_libver_bounds() */
+ H5F_libver_t high_bound; /* high_bound property for H5Pset_libver_bounds */
+} H5CX_fapl_cache_t;
+
/********************/
/* Local Prototypes */
@@ -347,9 +415,21 @@ static H5CX_node_t *H5CX_head_g = NULL; /* Pointer to head of context st
/* Define a "default" dataset transfer property list cache structure to use for default DXPLs */
static H5CX_dxpl_cache_t H5CX_def_dxpl_cache;
+/* Define a "default" link creation property list cache structure to use for default LCPLs */
+static H5CX_lcpl_cache_t H5CX_def_lcpl_cache;
+
/* Define a "default" link access property list cache structure to use for default LAPLs */
static H5CX_lapl_cache_t H5CX_def_lapl_cache;
+/* Define a "default" dataset creation property list cache structure to use for default DCPLs */
+static H5CX_dcpl_cache_t H5CX_def_dcpl_cache;
+
+/* Define a "default" dataset access property list cache structure to use for default DAPLs */
+static H5CX_dapl_cache_t H5CX_def_dapl_cache;
+
+/* Define a "default" file access property list cache structure to use for default FAPLs */
+static H5CX_fapl_cache_t H5CX_def_fapl_cache;
+
/* Declare a static free list to manage H5CX_node_t structs */
H5FL_DEFINE_STATIC(H5CX_node_t);
@@ -369,7 +449,11 @@ herr_t
H5CX__init_package(void)
{
H5P_genplist_t *dx_plist; /* Data transfer property list */
+ H5P_genplist_t *lc_plist; /* Link creation property list */
H5P_genplist_t *la_plist; /* Link access property list */
+ H5P_genplist_t *dc_plist; /* Dataset creation property list */
+ H5P_genplist_t *da_plist; /* Dataset access property list */
+ H5P_genplist_t *fa_plist; /* File access property list */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -456,6 +540,23 @@ H5CX__init_package(void)
if(H5P_get(dx_plist, H5D_XFER_CONV_CB_NAME, &H5CX_def_dxpl_cache.dt_conv_cb) < 0)
HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve datatype conversion exception callback")
+ /* Reset the "default LCPL cache" information */
+ HDmemset(&H5CX_def_lcpl_cache, 0, sizeof(H5CX_lcpl_cache_t));
+
+ /* Get the default LCPL cache information */
+
+ /* Get the default link creation property list */
+ if(NULL == (lc_plist = (H5P_genplist_t *)H5I_object(H5P_LINK_CREATE_DEFAULT)))
+ HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not a link creation property list")
+
+ /* Get link name character encoding */
+ if(H5P_get(lc_plist, H5P_STRCRT_CHAR_ENCODING_NAME, &H5CX_def_lcpl_cache.encoding) < 0)
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve link name encoding")
+
+ /* Get flag whether to create intermediate groups */
+ if(H5P_get(lc_plist, H5L_CRT_INTERMEDIATE_GROUP_NAME, &H5CX_def_lcpl_cache.intermediate_group) < 0)
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve intermediate group creation flag")
+
/* Reset the "default LAPL cache" information */
HDmemset(&H5CX_def_lapl_cache, 0, sizeof(H5CX_lapl_cache_t));
@@ -469,6 +570,56 @@ H5CX__init_package(void)
if(H5P_get(la_plist, H5L_ACS_NLINKS_NAME, &H5CX_def_lapl_cache.nlinks) < 0)
HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve number of soft / UD links to traverse")
+ /* Reset the "default DCPL cache" information */
+ HDmemset(&H5CX_def_dcpl_cache, 0, sizeof(H5CX_dcpl_cache_t));
+
+ /* Get the default DCPL cache information */
+
+ /* Get the default link access property list */
+ if(NULL == (dc_plist = (H5P_genplist_t *)H5I_object(H5P_DATASET_CREATE_DEFAULT)))
+ HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not a dataset create property list")
+
+ /* Get flag to indicate whether to minimize dataset object header */
+ if(H5P_get(dc_plist, H5D_CRT_MIN_DSET_HDR_SIZE_NAME, &H5CX_def_dcpl_cache.do_min_dset_ohdr) < 0)
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve dataset minimize flag")
+
+ /* Get object header flags */
+ if(H5P_get(dc_plist, H5O_CRT_OHDR_FLAGS_NAME, &H5CX_def_dcpl_cache.ohdr_flags) < 0)
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve object header flags")
+
+ /* Reset the "default DAPL cache" information */
+ HDmemset(&H5CX_def_dapl_cache, 0, sizeof(H5CX_dapl_cache_t));
+
+ /* Get the default DAPL cache information */
+
+ /* Get the default dataset access property list */
+ if(NULL == (da_plist = (H5P_genplist_t *)H5I_object(H5P_DATASET_ACCESS_DEFAULT)))
+ HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not a dataset create property list")
+
+ /* Get the prefix for the external file */
+ if(H5P_peek(da_plist, H5D_ACS_EFILE_PREFIX_NAME, &H5CX_def_dapl_cache.extfile_prefix) < 0)
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve prefix for external file")
+
+ /* Get the prefix for the VDS file */
+ if(H5P_peek(da_plist, H5D_ACS_VDS_PREFIX_NAME, &H5CX_def_dapl_cache.vds_prefix) < 0)
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve prefix for VDS")
+
+ /* Reset the "default FAPL cache" information */
+ HDmemset(&H5CX_def_fapl_cache, 0, sizeof(H5CX_fapl_cache_t));
+
+ /* Get the default FAPL cache information */
+
+ /* Get the default file access property list */
+ if(NULL == (fa_plist = (H5P_genplist_t *)H5I_object(H5P_FILE_ACCESS_DEFAULT)))
+ HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not a dataset create property list")
+
+ /* Get low_bound */
+ if(H5P_get(fa_plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &H5CX_def_fapl_cache.low_bound) < 0)
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve dataset minimize flag")
+
+ if(H5P_get(fa_plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &H5CX_def_fapl_cache.high_bound) < 0)
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve dataset minimize flag")
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5CX__init_package() */
@@ -592,7 +743,10 @@ H5CX__push_common(H5CX_node_t *cnode)
/* Set non-zero context info */
cnode->ctx.dxpl_id = H5P_DATASET_XFER_DEFAULT;
+ cnode->ctx.lcpl_id = H5P_LINK_CREATE_DEFAULT;
cnode->ctx.lapl_id = H5P_LINK_ACCESS_DEFAULT;
+ cnode->ctx.dapl_id = H5P_DATASET_ACCESS_DEFAULT;
+ cnode->ctx.fapl_id = H5P_FILE_ACCESS_DEFAULT;
cnode->ctx.tag = H5AC__INVALID_TAG;
cnode->ctx.ring = H5AC_RING_USER;
@@ -724,6 +878,101 @@ H5CX_set_dxpl(hid_t dxpl_id)
/*-------------------------------------------------------------------------
+ * Function: H5CX_set_dcpl
+ *
+ * Purpose: Sets the DCPL for the current API call context.
+ *
+ * Return: <none>
+ *
+ * Programmer: Quincey Koziol
+ * March 6, 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+void
+H5CX_set_dcpl(hid_t dcpl_id)
+{
+ H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ /* Sanity check */
+ HDassert(*head);
+
+ /* Set the API context's DCPL to a new value */
+ (*head)->ctx.dcpl_id = dcpl_id;
+
+ FUNC_LEAVE_NOAPI_VOID
+} /* end H5CX_set_dcpl() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5CX_set_libver_bounds
+ *
+ * Purpose: Sets the low/high bounds according to "f" for the current API call context.
+ * When "f" is NULL, the low/high bounds are set to latest format.
+ *
+ * Return: Non-negative on success / Negative on failure
+ *
+ * Programmer: Vailin Choi
+ * March 27, 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5CX_set_libver_bounds(H5F_t *f)
+{
+ H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(head && *head);
+
+ /* Set the API context value */
+ (*head)->ctx.low_bound = (f == NULL) ? H5F_LIBVER_LATEST : H5F_LOW_BOUND(f);
+ (*head)->ctx.high_bound = (f == NULL) ? H5F_LIBVER_LATEST : H5F_HIGH_BOUND(f);
+
+ /* Mark the values as valid */
+ (*head)->ctx.low_bound_valid = TRUE;
+ (*head)->ctx.high_bound_valid = TRUE;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5CX_set_libver_bounds() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5CX_set_lcpl
+ *
+ * Purpose: Sets the LCPL for the current API call context.
+ *
+ * Return: <none>
+ *
+ * Programmer: Chris Hogan
+ * November 27, 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+void
+H5CX_set_lcpl(hid_t lcpl_id)
+{
+ H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ /* Sanity check */
+ HDassert(*head);
+
+ /* Set the API context's LCPL to a new value */
+ (*head)->ctx.lcpl_id = lcpl_id;
+
+ FUNC_LEAVE_NOAPI_VOID
+} /* end H5CX_set_lcpl() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5CX_set_lapl
*
* Purpose: Sets the LAPL for the current API call context.
@@ -792,6 +1041,8 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass,
*acspl_id = *libclass->def_plist_id;
else {
htri_t is_lapl; /* Whether the access property list is (or is derived from) a link access property list */
+ htri_t is_dapl; /* Whether the access property list is (or is derived from) a dataset access property list */
+ htri_t is_fapl; /* Whether the access property list is (or is derived from) a file access property list */
#ifdef H5CX_DEBUG
/* Sanity check the access property list class */
@@ -805,6 +1056,18 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass,
else if(is_lapl)
(*head)->ctx.lapl_id = *acspl_id;
+ /* Check for dataset access property and set API context if so */
+ if((is_dapl = H5P_class_isa(*libclass->pclass, *H5P_CLS_DACC->pclass)) < 0)
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "can't check for dataset access class")
+ else if(is_dapl)
+ (*head)->ctx.dapl_id = *acspl_id;
+
+ /* Check for file access property and set API context if so */
+ if((is_fapl = H5P_class_isa(*libclass->pclass, *H5P_CLS_FACC->pclass)) < 0)
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "can't check for file access class")
+ else if(is_fapl)
+ (*head)->ctx.fapl_id = *acspl_id;
+
#ifdef H5_HAVE_PARALLEL
/* If this routine is not guaranteed to be collective (i.e. it doesn't
* modify the structural metadata in a file), check if the application
@@ -1818,6 +2081,76 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5CX_get_encoding
+ *
+ * Purpose: Retrieves the character encoding for the current API call context.
+ *
+ * Return: Non-negative on success / Negative on failure
+ *
+ * Programmer: Gerd Heber
+ * October 21, 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5CX_get_encoding(H5T_cset_t* encoding)
+{
+ H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(encoding);
+ HDassert(head && *head);
+ HDassert(H5P_DEFAULT != (*head)->ctx.lcpl_id);
+
+ H5CX_RETRIEVE_PROP_VALID(lcpl, H5P_LINK_CREATE_DEFAULT, H5P_STRCRT_CHAR_ENCODING_NAME, encoding)
+
+ /* Get the value */
+ *encoding = (*head)->ctx.encoding;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5CX_get_encoding() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5CX_get_intermediate_group
+ *
+ * Purpose: Retrieves the create intermediate group flag for the current API call context.
+ *
+ * Return: Non-negative on success / Negative on failure
+ *
+ * Programmer: Gerd Heber
+ * October 21, 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5CX_get_intermediate_group(unsigned* crt_intermed_group)
+{
+ H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(crt_intermed_group);
+ HDassert(head && *head);
+ HDassert(H5P_DEFAULT != (*head)->ctx.lcpl_id);
+
+ H5CX_RETRIEVE_PROP_VALID(lcpl, H5P_LINK_CREATE_DEFAULT, H5L_CRT_INTERMEDIATE_GROUP_NAME, intermediate_group)
+
+ /* Get the value */
+ *crt_intermed_group = (*head)->ctx.intermediate_group;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5CX_get_create_intermediate_group() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5CX_get_nlinks
*
* Purpose: Retrieves the # of soft / UD links to traverse for the current API call context.
@@ -1853,6 +2186,193 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5CX_get_dset_min_ohdr_flag
+ *
+ * Purpose: Retrieves the flag that indicates whether the dataset object
+ * header should be minimized
+ *
+ * Return: Non-negative on success / Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * March 6, 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5CX_get_dset_min_ohdr_flag(hbool_t *dset_min_ohdr_flag)
+{
+ H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(dset_min_ohdr_flag);
+ HDassert(head && *head);
+ HDassert(H5P_DEFAULT != (*head)->ctx.dcpl_id);
+
+ H5CX_RETRIEVE_PROP_VALID(dcpl, H5P_DATASET_CREATE_DEFAULT, H5D_CRT_MIN_DSET_HDR_SIZE_NAME, do_min_dset_ohdr)
+
+ /* Get the value */
+ *dset_min_ohdr_flag = (*head)->ctx.do_min_dset_ohdr;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5CX_get_dset_min_ohdr_flag() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5CX_get_libver_bounds
+ *
+ * Purpose: Retrieves the low/high bounds for the current API call context.
+ *
+ * Return: Non-negative on success / Negative on failure
+ *
+ * Programmer: Vailin Choi
+ * March 27, 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5CX_get_libver_bounds(H5F_libver_t *low_bound, H5F_libver_t *high_bound)
+{
+ H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(low_bound);
+ HDassert(high_bound);
+ HDassert(head && *head);
+ HDassert(H5P_DEFAULT != (*head)->ctx.fapl_id);
+
+ H5CX_RETRIEVE_PROP_VALID(fapl, H5P_FILE_ACCESS_DEFAULT, H5F_ACS_LIBVER_LOW_BOUND_NAME, low_bound)
+ H5CX_RETRIEVE_PROP_VALID(fapl, H5P_FILE_ACCESS_DEFAULT, H5F_ACS_LIBVER_HIGH_BOUND_NAME, high_bound)
+
+ /* Get the values */
+ *low_bound = (*head)->ctx.low_bound;
+ *high_bound = (*head)->ctx.high_bound;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5CX_get_libver_bounds() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5CX_get_ext_file_prefix
+ *
+ * Purpose: Retrieves the prefix for external file
+ *
+ * Return: Non-negative on success / Negative on failure
+ *
+ * Programmer: Raymond Lu
+ * March 6, 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5CX_get_ext_file_prefix(char **extfile_prefix)
+{
+ H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(extfile_prefix);
+ HDassert(head && *head);
+ HDassert(H5P_DEFAULT != (*head)->ctx.dapl_id);
+
+ /* Check if the value has been retrieved already */
+ if(!(*head)->ctx.extfile_prefix_valid) {
+ /* Check for default DAPL */
+ if((*head)->ctx.dapl_id == H5P_DATASET_ACCESS_DEFAULT)
+ (*head)->ctx.extfile_prefix = H5CX_def_dapl_cache.extfile_prefix;
+ else {
+ /* Check if the property list is already available */
+ if(NULL == (*head)->ctx.dapl)
+ /* Get the dataset access property list pointer */
+ if(NULL == ((*head)->ctx.dapl = (H5P_genplist_t *)H5I_object((*head)->ctx.dapl_id)))
+ HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset access property list")
+
+ /* Get the prefix for the external file */
+ /* (Note: 'peek', not 'get' - if this turns out to be a problem, we may need
+ * to copy it and free this in the H5CX pop routine. -QAK)
+ */
+ if(H5P_peek((*head)->ctx.dapl, H5D_ACS_EFILE_PREFIX_NAME, &(*head)->ctx.extfile_prefix) < 0)
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve external file prefix")
+ } /* end else */
+
+ /* Mark the value as valid */
+ (*head)->ctx.extfile_prefix_valid = TRUE;
+ } /* end if */
+
+ /* Get the value */
+ *extfile_prefix = (*head)->ctx.extfile_prefix;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5CX_get_ext_file_prefix() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5CX_get_vds_prefix
+ *
+ * Purpose: Retrieves the prefix for VDS
+ *
+ * Return: Non-negative on success / Negative on failure
+ *
+ * Programmer: Raymond Lu
+ * March 6, 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5CX_get_vds_prefix(char **vds_prefix)
+{
+ H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(vds_prefix);
+ HDassert(head && *head);
+ HDassert(H5P_DEFAULT != (*head)->ctx.dapl_id);
+
+ /* Check if the value has been retrieved already */
+ if(!(*head)->ctx.vds_prefix_valid) {
+ /* Check for default DAPL */
+ if((*head)->ctx.dapl_id == H5P_DATASET_ACCESS_DEFAULT)
+ (*head)->ctx.vds_prefix = H5CX_def_dapl_cache.vds_prefix;
+ else {
+ /* Check if the property list is already available */
+ if(NULL == (*head)->ctx.dapl)
+ /* Get the dataset access property list pointer */
+ if(NULL == ((*head)->ctx.dapl = (H5P_genplist_t *)H5I_object((*head)->ctx.dapl_id)))
+ HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset access property list")
+
+ /* Get the prefix for the VDS */
+ /* (Note: 'peek', not 'get' - if this turns out to be a problem, we may need
+ * to copy it and free this in the H5CX pop routine. -QAK)
+ */
+ if(H5P_peek((*head)->ctx.dapl, H5D_ACS_VDS_PREFIX_NAME, &(*head)->ctx.vds_prefix) < 0)
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VDS prefix")
+ } /* end else */
+
+ /* Mark the value as valid */
+ (*head)->ctx.vds_prefix_valid = TRUE;
+ } /* end if */
+
+ /* Get the value */
+ *vds_prefix = (*head)->ctx.vds_prefix;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5CX_get_vds_prefix() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5CX_set_tag
*
* Purpose: Sets the object tag for the current API call context.
@@ -2544,6 +3064,41 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5CX_get_ohdr_flags
+ *
+ * Purpose: Retrieves the object header flags for the current API call context.
+ *
+ * Return: Non-negative on success / Negative on failure
+ *
+ * Programmer: Chris Hogan
+ * November 15, 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5CX_get_ohdr_flags(uint8_t *ohdr_flags)
+{
+ H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(ohdr_flags);
+ HDassert(head && *head);
+ HDassert(H5P_DEFAULT != (*head)->ctx.dcpl_id);
+
+ H5CX_RETRIEVE_PROP_VALID(dcpl, H5P_DATASET_CREATE_DEFAULT, H5O_CRT_OHDR_FLAGS_NAME, ohdr_flags)
+
+ /* Get the value */
+ *ohdr_flags = (*head)->ctx.ohdr_flags;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* End H5CX_get_ohdr_flags() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5CX__pop_common
*
* Purpose: Common code for popping the context for an API call.
diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h
index a091292..3d1ee5a 100644
--- a/src/H5CXprivate.h
+++ b/src/H5CXprivate.h
@@ -59,7 +59,10 @@ H5_DLL hbool_t H5CX_is_def_dxpl(void);
/* "Setter" routines for API context info */
H5_DLL void H5CX_set_dxpl(hid_t dxpl_id);
+H5_DLL void H5CX_set_lcpl(hid_t lcpl_id);
H5_DLL void H5CX_set_lapl(hid_t lapl_id);
+H5_DLL void H5CX_set_dcpl(hid_t dcpl_id);
+H5_DLL herr_t H5CX_set_libver_bounds(H5F_t *f);
H5_DLL herr_t H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass,
hid_t loc_id, hbool_t is_collective);
H5_DLL herr_t H5CX_set_loc(hid_t loc_id);
@@ -98,9 +101,24 @@ H5_DLL herr_t H5CX_get_data_transform(H5Z_data_xform_t **data_transform);
H5_DLL herr_t H5CX_get_vlen_alloc_info(H5T_vlen_alloc_info_t *vl_alloc_info);
H5_DLL herr_t H5CX_get_dt_conv_cb(H5T_conv_cb_t *cb_struct);
+/* "Getter" routines for LCPL properties cached in API context */
+H5_DLL herr_t H5CX_get_encoding(H5T_cset_t* encoding);
+H5_DLL herr_t H5CX_get_intermediate_group(unsigned* crt_intermed_group);
+
/* "Getter" routines for LAPL properties cached in API context */
H5_DLL herr_t H5CX_get_nlinks(size_t *nlinks);
+/* "Getter" routines for DCPL properties cached in API context */
+H5_DLL herr_t H5CX_get_dset_min_ohdr_flag(hbool_t *dset_min_ohdr_flag);
+H5_DLL herr_t H5CX_get_ohdr_flags(uint8_t *ohdr_flags);
+
+/* "Getter" routines for DAPL properties cached in API context */
+H5_DLL herr_t H5CX_get_ext_file_prefix(char **prefix_extfile);
+H5_DLL herr_t H5CX_get_vds_prefix(char **prefix_vds);
+
+/* "Getter" routines for FAPL properties cached in API context */
+H5_DLL herr_t H5CX_get_libver_bounds(H5F_libver_t *low_bound, H5F_libver_t *high_bound);
+
/* "Setter" routines for API context info */
H5_DLL void H5CX_set_tag(haddr_t tag);
H5_DLL void H5CX_set_ring(H5AC_ring_t ring);
diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c
index ecaed62..3cae564 100644
--- a/src/H5Cmpio.c
+++ b/src/H5Cmpio.c
@@ -18,7 +18,7 @@
* Quincey Koziol
*
* Purpose: Functions in this file implement support for parallel I/O for
- * generic cache code.
+ * generic cache code.
*
*-------------------------------------------------------------------------
*/
@@ -28,20 +28,20 @@
/****************/
#include "H5Cmodule.h" /* This source code file is part of the H5C module */
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
-#include "H5Cpkg.h" /* Cache */
+#include "H5Cpkg.h" /* Cache */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fpkg.h" /* Files */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fpkg.h" /* Files */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5MMprivate.h" /* Memory management */
#ifdef H5_HAVE_PARALLEL
@@ -60,7 +60,7 @@
/* Local Prototypes */
/********************/
static herr_t H5C__collective_write(H5F_t *f);
-static herr_t H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES],
+static herr_t H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES],
unsigned entries_to_clear[H5C_RING_NTYPES]);
static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring,
unsigned entries_to_flush, unsigned entries_to_clear);
@@ -81,80 +81,80 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring,
/*******************/
-
+
/*-------------------------------------------------------------------------
* Function: H5C_apply_candidate_list
*
* Purpose: Apply the supplied candidate list.
*
- * We used to do this by simply having each process write
- * every mpi_size-th entry in the candidate list, starting
- * at index mpi_rank, and mark all the others clean.
+ * We used to do this by simply having each process write
+ * every mpi_size-th entry in the candidate list, starting
+ * at index mpi_rank, and mark all the others clean.
+ *
+ * However, this can cause unnecessary contention in a file
+ * system by increasing the number of processes writing to
+ * adjacent locations in the HDF5 file.
*
- * However, this can cause unnecessary contention in a file
- * system by increasing the number of processes writing to
- * adjacent locations in the HDF5 file.
+ * To attempt to minimize this, we now arange matters such
+ * that each process writes n adjacent entries in the
+ * candidate list, and marks all others clean. We must do
+ * this in such a fashion as to guarantee that each entry
+ * on the candidate list is written by exactly one process,
+ * and marked clean by all others.
*
- * To attempt to minimize this, we now arange matters such
- * that each process writes n adjacent entries in the
- * candidate list, and marks all others clean. We must do
- * this in such a fashion as to guarantee that each entry
- * on the candidate list is written by exactly one process,
- * and marked clean by all others.
+ * To do this, first construct a table mapping mpi_rank
+ * to the index of the first entry in the candidate list to
+ * be written by the process of that mpi_rank, and then use
+ * the table to control which entries are written and which
+ * are marked as clean as a function of the mpi_rank.
*
- * To do this, first construct a table mapping mpi_rank
- * to the index of the first entry in the candidate list to
- * be written by the process of that mpi_rank, and then use
- * the table to control which entries are written and which
- * are marked as clean as a function of the mpi_rank.
+ * Note that the table must be identical on all processes, as
+ * all see the same candidate list, mpi_size, and mpi_rank --
+ * the inputs used to construct the table.
*
- * Note that the table must be identical on all processes, as
- * all see the same candidate list, mpi_size, and mpi_rank --
- * the inputs used to construct the table.
+ * We construct the table as follows. Let:
*
- * We construct the table as follows. Let:
+ * n = num_candidates / mpi_size;
*
- * n = num_candidates / mpi_size;
+ * m = num_candidates % mpi_size;
*
- * m = num_candidates % mpi_size;
+ * Now allocate an array of integers of length mpi_size + 1,
+ * and call this array candidate_assignment_table.
*
- * Now allocate an array of integers of length mpi_size + 1,
- * and call this array candidate_assignment_table.
+ * Conceptually, if the number of candidates is a multiple
+ * of the mpi_size, we simply pass through the candidate list
+ * and assign n entries to each process to flush, with the
+ * index of the first entry to flush in the location in
+ * the candidate_assignment_table indicated by the mpi_rank
+ * of the process.
*
- * Conceptually, if the number of candidates is a multiple
- * of the mpi_size, we simply pass through the candidate list
- * and assign n entries to each process to flush, with the
- * index of the first entry to flush in the location in
- * the candidate_assignment_table indicated by the mpi_rank
- * of the process.
+ * In the more common case in which the candidate list isn't
+ * isn't a multiple of the mpi_size, we pretend it is, and
+ * give num_candidates % mpi_size processes one extra entry
+ * each to make things work out.
*
- * In the more common case in which the candidate list isn't
- * isn't a multiple of the mpi_size, we pretend it is, and
- * give num_candidates % mpi_size processes one extra entry
- * each to make things work out.
+ * Once the table is constructed, we determine the first and
+ * last entry this process is to flush as follows:
*
- * Once the table is constructed, we determine the first and
- * last entry this process is to flush as follows:
+ * first_entry_to_flush = candidate_assignment_table[mpi_rank]
*
- * first_entry_to_flush = candidate_assignment_table[mpi_rank]
+ * last_entry_to_flush =
+ * candidate_assignment_table[mpi_rank + 1] - 1;
*
- * last_entry_to_flush =
- * candidate_assignment_table[mpi_rank + 1] - 1;
- *
- * With these values determined, we simply scan through the
- * candidate list, marking all entries in the range
- * [first_entry_to_flush, last_entry_to_flush] for flush,
- * and all others to be cleaned.
+ * With these values determined, we simply scan through the
+ * candidate list, marking all entries in the range
+ * [first_entry_to_flush, last_entry_to_flush] for flush,
+ * and all others to be cleaned.
*
- * Finally, we scan the LRU from tail to head, flushing
- * or marking clean the candidate entries as indicated.
- * If necessary, we scan the pinned list as well.
+ * Finally, we scan the LRU from tail to head, flushing
+ * or marking clean the candidate entries as indicated.
+ * If necessary, we scan the pinned list as well.
*
- * Note that this function will fail if any protected or
- * clean entries appear on the candidate list.
+ * Note that this function will fail if any protected or
+ * clean entries appear on the candidate list.
*
- * This function is used in managing sync points, and
- * shouldn't be used elsewhere.
+ * This function is used in managing sync points, and
+ * shouldn't be used elsewhere.
*
* Return: Success: SUCCEED
*
@@ -174,22 +174,22 @@ H5C_apply_candidate_list(H5F_t * f,
int mpi_size)
{
int i;
- int m;
- int n;
- unsigned first_entry_to_flush;
- unsigned last_entry_to_flush;
- unsigned total_entries_to_clear = 0;
- unsigned total_entries_to_flush = 0;
+ int m;
+ int n;
+ unsigned first_entry_to_flush;
+ unsigned last_entry_to_flush;
+ unsigned total_entries_to_clear = 0;
+ unsigned total_entries_to_flush = 0;
int * candidate_assignment_table = NULL;
unsigned entries_to_flush[H5C_RING_NTYPES];
unsigned entries_to_clear[H5C_RING_NTYPES];
- haddr_t addr;
- H5C_cache_entry_t * entry_ptr = NULL;
+ haddr_t addr;
+ H5C_cache_entry_t * entry_ptr = NULL;
#if H5C_DO_SANITY_CHECKS
- haddr_t last_addr;
+ haddr_t last_addr;
#endif /* H5C_DO_SANITY_CHECKS */
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
- char tbl_buf[1024];
+ char tbl_buf[1024];
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
@@ -214,10 +214,10 @@ H5C_apply_candidate_list(H5F_t * f,
HDmemset(tbl_buf, 0, sizeof(tbl_buf));
- sprintf(&(tbl_buf[0]), "candidate list = ");
+ HDsprintf(&(tbl_buf[0]), "candidate list = ");
for(u = 0; u < num_candidates; u++)
- sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx", (long long)(*(candidates_list_ptr + u)));
- sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
+ HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx", (long long)(*(candidates_list_ptr + u)));
+ HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
HDfprintf(stdout, "%s", tbl_buf);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
@@ -245,7 +245,7 @@ H5C_apply_candidate_list(H5F_t * f,
for(i = 1; i < mpi_size; i++)
candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n;
} /* end if */
- else {
+ else {
for(i = 1; i <= m; i++)
candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n + 1;
@@ -280,13 +280,13 @@ H5C_apply_candidate_list(H5F_t * f,
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
for ( i = 0; i < 1024; i++ )
tbl_buf[i] = '\0';
- sprintf(&(tbl_buf[0]), "candidate assignment table = ");
+ HDsprintf(&(tbl_buf[0]), "candidate assignment table = ");
for(i = 0; i <= mpi_size; i++)
- sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %d", candidate_assignment_table[i]);
- sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
+ HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %d", candidate_assignment_table[i]);
+ HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
HDfprintf(stdout, "%s", tbl_buf);
- HDfprintf(stdout, "%s:%d: flush entries [%u, %u].\n",
+ HDfprintf(stdout, "%s:%d: flush entries [%u, %u].\n",
FUNC, mpi_rank, first_entry_to_flush, last_entry_to_flush);
HDfprintf(stdout, "%s:%d: marking entries.\n", FUNC, mpi_rank);
@@ -315,7 +315,7 @@ H5C_apply_candidate_list(H5F_t * f,
if(entry_ptr->is_protected)
/* For now at least, we can't deal with protected entries.
* If we encounter one, scream and die. If it becomes an
- * issue, we should be able to work around this.
+ * issue, we should be able to work around this.
*/
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry is protected?!?!?")
@@ -327,9 +327,9 @@ H5C_apply_candidate_list(H5F_t * f,
HDassert(!entry_ptr->clear_on_unprotect);
/* Determine whether the entry is to be cleared or flushed,
- * and mark it accordingly. We will scan the protected and
+ * and mark it accordingly. We will scan the protected and
* pinned list shortly, and clear or flush according to these
- * markings.
+ * markings.
*/
if(u >= first_entry_to_flush && u <= last_entry_to_flush) {
total_entries_to_flush++;
@@ -346,7 +346,7 @@ H5C_apply_candidate_list(H5F_t * f,
* candidate list to clear from the cache have to be
* removed from the coll list. This is OK since the
* candidate list is collective and uniform across all
- * ranks.
+ * ranks.
*/
if(entry_ptr->coll_access) {
entry_ptr->coll_access = FALSE;
@@ -367,14 +367,14 @@ H5C_apply_candidate_list(H5F_t * f,
#endif /* H5C_DO_SANITY_CHECKS */
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
- HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%u/%u.\n",
+ HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%u/%u.\n",
FUNC, mpi_rank, num_candidates, total_entries_to_clear,
total_entries_to_flush);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
- /* We have now marked all the entries on the candidate list for
+ /* We have now marked all the entries on the candidate list for
* either flush or clear -- now scan the LRU and the pinned list
- * for these entries and do the deed. Do this via a call to
+ * for these entries and do the deed. Do this via a call to
* H5C__flush_candidate_entries().
*
* Note that we are doing things in this round about manner so as
@@ -407,15 +407,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_apply_candidate_list() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_construct_candidate_list__clean_cache
*
- * Purpose: Construct the list of entries that should be flushed to
- * clean all entries in the cache.
+ * Purpose: Construct the list of entries that should be flushed to
+ * clean all entries in the cache.
*
- * This function is used in managing sync points, and
- * shouldn't be used elsewhere.
+ * This function is used in managing sync points, and
+ * shouldn't be used elsewhere.
*
* Return: Success: SUCCEED
*
@@ -447,21 +447,21 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr)
* point, it is possible that some dirty entries may reside on the
* pinned list at this point.
*/
- HDassert( cache_ptr->slist_size <=
+ HDassert( cache_ptr->slist_size <=
(cache_ptr->dLRU_list_size + cache_ptr->pel_size) );
- HDassert( cache_ptr->slist_len <=
+ HDassert( cache_ptr->slist_len <=
(cache_ptr->dLRU_list_len + cache_ptr->pel_len) );
if(space_needed > 0) { /* we have work to do */
H5C_cache_entry_t *entry_ptr;
unsigned nominated_entries_count = 0;
size_t nominated_entries_size = 0;
- haddr_t nominated_addr;
+ haddr_t nominated_addr;
HDassert( cache_ptr->slist_len > 0 );
/* Scan the dirty LRU list from tail forward and nominate sufficient
- * entries to free up the necessary space.
+ * entries to free up the necessary space.
*/
entry_ptr = cache_ptr->dLRU_tail_ptr;
while((nominated_entries_size < space_needed) &&
@@ -483,7 +483,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr)
} /* end while */
HDassert( entry_ptr == NULL );
- /* it is possible that there are some dirty entries on the
+ /* it is possible that there are some dirty entries on the
* protected entry list as well -- scan it too if necessary
*/
entry_ptr = cache_ptr->pel_head_ptr;
@@ -516,15 +516,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_construct_candidate_list__clean_cache() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C_construct_candidate_list__min_clean
*
- * Purpose: Construct the list of entries that should be flushed to
- * get the cache back within its min clean constraints.
+ * Purpose: Construct the list of entries that should be flushed to
+ * get the cache back within its min clean constraints.
*
- * This function is used in managing sync points, and
- * shouldn't be used elsewhere.
+ * This function is used in managing sync points, and
+ * shouldn't be used elsewhere.
*
* Return: Success: SUCCEED
*
@@ -546,7 +546,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr)
HDassert( cache_ptr != NULL );
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
- /* compute the number of bytes (if any) that must be flushed to get the
+ /* compute the number of bytes (if any) that must be flushed to get the
* cache back within its min clean constraints.
*/
if(cache_ptr->max_cache_size > cache_ptr->index_size) {
@@ -574,14 +574,14 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr)
HDassert( cache_ptr->slist_len > 0 );
/* Scan the dirty LRU list from tail forward and nominate sufficient
- * entries to free up the necessary space.
+ * entries to free up the necessary space.
*/
entry_ptr = cache_ptr->dLRU_tail_ptr;
while((nominated_entries_size < space_needed) &&
(nominated_entries_count < cache_ptr->slist_len) &&
(entry_ptr != NULL) &&
(!entry_ptr->flush_me_last)) {
- haddr_t nominated_addr;
+ haddr_t nominated_addr;
HDassert( ! (entry_ptr->is_protected) );
HDassert( ! (entry_ptr->is_read_only) );
@@ -605,30 +605,30 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_construct_candidate_list__min_clean() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_mark_entries_as_clean
*
* Purpose: When the H5C code is used to implement the metadata caches
- * in PHDF5, only the cache with MPI_rank 0 is allowed to
- * actually write entries to disk -- all other caches must
- * retain dirty entries until they are advised that the
- * entries are clean.
+ * in PHDF5, only the cache with MPI_rank 0 is allowed to
+ * actually write entries to disk -- all other caches must
+ * retain dirty entries until they are advised that the
+ * entries are clean.
*
- * This function exists to allow the H5C code to receive these
- * notifications.
+ * This function exists to allow the H5C code to receive these
+ * notifications.
*
- * The function receives a list of entry base addresses
- * which must refer to dirty entries in the cache. If any
- * of the entries are either clean or don't exist, the
- * function flags an error.
+ * The function receives a list of entry base addresses
+ * which must refer to dirty entries in the cache. If any
+ * of the entries are either clean or don't exist, the
+ * function flags an error.
*
- * The function scans the list of entries and flushes all
- * those that are currently unprotected with the
- * H5C__FLUSH_CLEAR_ONLY_FLAG. Those that are currently
- * protected are flagged for clearing when they are
- * unprotected.
+ * The function scans the list of entries and flushes all
+ * those that are currently unprotected with the
+ * H5C__FLUSH_CLEAR_ONLY_FLAG. Those that are currently
+ * protected are flagged for clearing when they are
+ * unprotected.
*
* Return: Non-negative on success/Negative on failure
*
@@ -643,22 +643,22 @@ H5C_mark_entries_as_clean(H5F_t * f,
haddr_t * ce_array_ptr)
{
H5C_t * cache_ptr;
- unsigned entries_cleared;
+ unsigned entries_cleared;
unsigned pinned_entries_cleared;
hbool_t progress;
- unsigned entries_examined;
- unsigned initial_list_len;
- haddr_t addr;
- unsigned pinned_entries_marked = 0;
+ unsigned entries_examined;
+ unsigned initial_list_len;
+ haddr_t addr;
+ unsigned pinned_entries_marked = 0;
#if H5C_DO_SANITY_CHECKS
- unsigned protected_entries_marked = 0;
- unsigned other_entries_marked = 0;
- haddr_t last_addr;
+ unsigned protected_entries_marked = 0;
+ unsigned other_entries_marked = 0;
+ haddr_t last_addr;
#endif /* H5C_DO_SANITY_CHECKS */
- H5C_cache_entry_t * clear_ptr = NULL;
- H5C_cache_entry_t * entry_ptr = NULL;
+ H5C_cache_entry_t * clear_ptr = NULL;
+ H5C_cache_entry_t * entry_ptr = NULL;
unsigned u;
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -705,7 +705,7 @@ H5C_mark_entries_as_clean(H5F_t * f,
if(entry_ptr == NULL) {
#if H5C_DO_SANITY_CHECKS
- HDfprintf(stdout,
+ HDfprintf(stdout,
"H5C_mark_entries_as_clean: entry[%u] = %a not in cache.\n",
u,
addr);
@@ -714,7 +714,7 @@ H5C_mark_entries_as_clean(H5F_t * f,
} /* end if */
else if(!entry_ptr->is_dirty) {
#if H5C_DO_SANITY_CHECKS
- HDfprintf(stdout,
+ HDfprintf(stdout,
"H5C_mark_entries_as_clean: entry %a is not dirty!?!\n",
addr);
#endif /* H5C_DO_SANITY_CHECKS */
@@ -734,13 +734,13 @@ H5C_mark_entries_as_clean(H5F_t * f,
} /* end if */
entry_ptr->clear_on_unprotect = TRUE;
- if(entry_ptr->is_pinned)
- pinned_entries_marked++;
+ if(entry_ptr->is_pinned)
+ pinned_entries_marked++;
#if H5C_DO_SANITY_CHECKS
- else if(entry_ptr->is_protected)
- protected_entries_marked++;
- else
- other_entries_marked++;
+ else if(entry_ptr->is_protected)
+ protected_entries_marked++;
+ else
+ other_entries_marked++;
#endif /* H5C_DO_SANITY_CHECKS */
}
}
@@ -750,25 +750,25 @@ H5C_mark_entries_as_clean(H5F_t * f,
* any protected entries will not be on the LRU, and therefore
* will not be flushed at this time.
*
- * Note that unlike H5C_apply_candidate_list(),
- * H5C_mark_entries_as_clean() makes all its calls to
- * H5C__flush_single_entry() with the H5C__FLUSH_CLEAR_ONLY_FLAG
- * set. As a result, the pre_serialize() and serialize calls are
+ * Note that unlike H5C_apply_candidate_list(),
+ * H5C_mark_entries_as_clean() makes all its calls to
+ * H5C__flush_single_entry() with the H5C__FLUSH_CLEAR_ONLY_FLAG
+ * set. As a result, the pre_serialize() and serialize calls are
* not made.
*
- * This then implies that (assuming such actions were
- * permitted in the parallel case) no loads, dirties,
- * resizes, or removals of other entries can occur as
+ * This then implies that (assuming such actions were
+ * permitted in the parallel case) no loads, dirties,
+ * resizes, or removals of other entries can occur as
* a side effect of the flush. Hence, there is no need
- * for the checks for entry removal / status change
+ * for the checks for entry removal / status change
* that I ported to H5C_apply_candidate_list().
*
* However, if (in addition to allowing such operations
* in the parallel case), we allow such operations outside
- * of the pre_serialize / serialize routines, this may
- * cease to be the case -- requiring a review of this
+ * of the pre_serialize / serialize routines, this may
+ * cease to be the case -- requiring a review of this
* point.
- * JRM -- 4/7/15
+ * JRM -- 4/7/15
*/
entries_cleared = 0;
entries_examined = 0;
@@ -812,7 +812,7 @@ H5C_mark_entries_as_clean(H5F_t * f,
pinned_entries_cleared++;
progress = TRUE;
- if(H5C__flush_single_entry(f, clear_ptr,
+ if(H5C__flush_single_entry(f, clear_ptr,
(H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__UPDATE_PAGE_BUFFER_FLAG)) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear entry")
} /* end if */
@@ -854,12 +854,12 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_mark_entries_as_clean() */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C_clear_coll_entries
*
- * Purpose: Clear half or the entire list of collective entries and
+ * Purpose: Clear half or the entire list of collective entries and
* mark them as independent.
*
* Return: FAIL if error is detected, SUCCEED otherwise.
@@ -871,9 +871,9 @@ done:
*/
herr_t
H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial)
-{
- uint32_t clear_cnt;
- H5C_cache_entry_t * entry_ptr = NULL;
+{
+ uint32_t clear_cnt;
+ H5C_cache_entry_t * entry_ptr = NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT
@@ -901,7 +901,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_clear_coll_entries */
-
+
/*-------------------------------------------------------------------------
*
* Function: H5C__collective_write
@@ -1041,8 +1041,8 @@ H5C__collective_write(H5F_t *f)
info = *info_p;
- /* just to match up with the 1st MPI_File_set_view from
- * H5FD_mpio_write()
+ /* just to match up with the 1st MPI_File_set_view from
+ * H5FD_mpio_write()
*/
if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", info)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code)
@@ -1052,8 +1052,8 @@ H5C__collective_write(H5F_t *f)
if(MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(mpi_fh, (MPI_Offset)0, NULL, 0, MPI_BYTE, &mpi_stat)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code)
- /* just to match up with the 2nd MPI_File_set_view (reset) in
- * H5FD_mpio_write()
+ /* just to match up with the 2nd MPI_File_set_view (reset) in
+ * H5FD_mpio_write()
*/
if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", info)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code)
@@ -1079,11 +1079,11 @@ done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5C__collective_write() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C__flush_candidate_entries
*
- * Purpose: Flush or clear (as indicated) the candidate entries that
+ * Purpose: Flush or clear (as indicated) the candidate entries that
* have been marked in the metadata cache. In so doing,
* observe rings and flush dependencies.
*
@@ -1112,9 +1112,9 @@ done:
* Return: Non-negative on success/Negative on failure.
*
* Programmer: John Mainzer
- * 2/10/17
+ * 2/10/17
*
- * Changes: None.
+ * Changes: None.
*
*-------------------------------------------------------------------------
*/
@@ -1123,17 +1123,17 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES
unsigned entries_to_clear[H5C_RING_NTYPES])
{
#if H5C_DO_SANITY_CHECKS
- int i;
- uint32_t index_len = 0;
- size_t index_size = (size_t)0;
- size_t clean_index_size = (size_t)0;
- size_t dirty_index_size = (size_t)0;
- size_t slist_size = (size_t)0;
- uint32_t slist_len = 0;
+ int i;
+ uint32_t index_len = 0;
+ size_t index_size = (size_t)0;
+ size_t clean_index_size = (size_t)0;
+ size_t dirty_index_size = (size_t)0;
+ size_t slist_size = (size_t)0;
+ uint32_t slist_len = 0;
#endif /* H5C_DO_SANITY_CHECKS */
- H5C_ring_t ring;
+ H5C_ring_t ring;
H5C_t * cache_ptr;
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
@@ -1163,7 +1163,7 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES
clean_index_size += cache_ptr->clean_index_ring_size[i];
dirty_index_size += cache_ptr->dirty_index_ring_size[i];
- slist_len += cache_ptr->slist_ring_len[i];
+ slist_len += cache_ptr->slist_ring_len[i];
slist_size += cache_ptr->slist_ring_size[i];
} /* end for */
@@ -1201,11 +1201,11 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C__flush_candidate_entries() */
-
+
/*-------------------------------------------------------------------------
* Function: H5C__flush_candidates_in_ring
*
- * Purpose: Flush or clear (as indicated) the candidate entries
+ * Purpose: Flush or clear (as indicated) the candidate entries
* contained in the specified cache and ring. All candidate
* entries in rings outside the specified ring must have been
* flushed (or cleared) on entry.
@@ -1234,7 +1234,7 @@ done:
* Return: Non-negative on success/Negative on failure.
*
* Programmer: John Mainzer
- * 2/10/17
+ * 2/10/17
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5D.c b/src/H5D.c
index c02959a..f49a8a3 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -136,6 +136,12 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID")
+ /* Set the DCPL for the API context */
+ H5CX_set_dcpl(dcpl_id);
+
+ /* Set the LCPL for the API context */
+ H5CX_set_lcpl(lcpl_id);
+
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info")
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 553d75c..5a5f35c 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -11,31 +11,31 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
- * Thursday, April 24, 2008
- *
- * Purpose: Abstract indexed (chunked) I/O functions. The logical
- * multi-dimensional dataspace is regularly partitioned into
- * same-sized "chunks", the first of which is aligned with the
- * logical origin. The chunks are indexed by different methods,
- * that map a chunk index to disk address. Each chunk can be
+/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Thursday, April 24, 2008
+ *
+ * Purpose: Abstract indexed (chunked) I/O functions. The logical
+ * multi-dimensional dataspace is regularly partitioned into
+ * same-sized "chunks", the first of which is aligned with the
+ * logical origin. The chunks are indexed by different methods,
+ * that map a chunk index to disk address. Each chunk can be
* compressed independently and the chunks may move around in the
* file as their storage requirements change.
*
- * Cache: Disk I/O is performed in units of chunks and H5MF_alloc()
- * contains code to optionally align chunks on disk block
- * boundaries for performance.
- *
- * The chunk cache is an extendible hash indexed by a function
- * of storage B-tree address and chunk N-dimensional offset
- * within the dataset. Collisions are not resolved -- one of
- * the two chunks competing for the hash slot must be preempted
- * from the cache. All entries in the hash also participate in
- * a doubly-linked list and entries are penalized by moving them
- * toward the front of the list. When a new chunk is about to
- * be added to the cache the heap is pruned by preempting
- * entries near the front of the list to make room for the new
- * entry which is added to the end of the list.
+ * Cache: Disk I/O is performed in units of chunks and H5MF_alloc()
+ * contains code to optionally align chunks on disk block
+ * boundaries for performance.
+ *
+ * The chunk cache is an extendible hash indexed by a function
+ * of storage B-tree address and chunk N-dimensional offset
+ * within the dataset. Collisions are not resolved -- one of
+ * the two chunks competing for the hash slot must be preempted
+ * from the cache. All entries in the hash also participate in
+ * a doubly-linked list and entries are penalized by moving them
+ * toward the front of the list. When a new chunk is about to
+ * be added to the cache the heap is pruned by preempting
+ * entries near the front of the list to make room for the new
+ * entry which is added to the end of the list.
*/
/****************/
@@ -48,19 +48,19 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
#ifdef H5_HAVE_PARALLEL
-#include "H5ACprivate.h" /* Metadata cache */
+#include "H5ACprivate.h" /* Metadata cache */
#endif /* H5_HAVE_PARALLEL */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Dpkg.h" /* Dataset functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File functions */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5Dpkg.h" /* Dataset functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File functions */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
#include "H5MFprivate.h" /* File memory management */
-#include "H5VMprivate.h" /* Vector and array functions */
+#include "H5VMprivate.h" /* Vector and array functions */
/****************/
@@ -83,26 +83,26 @@
/*
* Feature: If this constant is defined then every cache preemption and load
- * causes a character to be printed on the standard error stream:
+ * causes a character to be printed on the standard error stream:
*
* `.': Entry was preempted because it has been completely read or
- * completely written but not partially read and not partially
- * written. This is often a good reason for preemption because such
- * a chunk will be unlikely to be referenced in the near future.
+ * completely written but not partially read and not partially
+ * written. This is often a good reason for preemption because such
+ * a chunk will be unlikely to be referenced in the near future.
*
* `:': Entry was preempted because it hasn't been used recently.
*
* `#': Entry was preempted because another chunk collided with it. This
- * is usually a relatively bad thing. If there are too many of
- * these then the number of entries in the cache can be increased.
+ * is usually a relatively bad thing. If there are too many of
+ * these then the number of entries in the cache can be increased.
*
* c: Entry was preempted because the file is closing.
*
- * w: A chunk read operation was eliminated because the library is
- * about to write new values to the entire chunk. This is a good
- * thing, especially on files where the chunk size is the same as
- * the disk block size, chunks are aligned on disk block boundaries,
- * and the operating system can also eliminate a read operation.
+ * w: A chunk read operation was eliminated because the library is
+ * about to write new values to the entire chunk. This is a good
+ * thing, especially on files where the chunk size is the same as
+ * the disk block size, chunks are aligned on disk block boundaries,
+ * and the operating system can also eliminate a read operation.
*/
/*#define H5D_CHUNK_DEBUG */
@@ -119,19 +119,19 @@
/* Raw data chunks are cached. Each entry in the cache is: */
typedef struct H5D_rdcc_ent_t {
- hbool_t locked; /*entry is locked in cache */
- hbool_t dirty; /*needs to be written to disk? */
- hbool_t deleted; /*chunk about to be deleted */
+ hbool_t locked; /*entry is locked in cache */
+ hbool_t dirty; /*needs to be written to disk? */
+ hbool_t deleted; /*chunk about to be deleted */
unsigned edge_chunk_state; /*states related to edge chunks (see above) */
- hsize_t scaled[H5O_LAYOUT_NDIMS]; /*scaled chunk 'name' (coordinates) */
- uint32_t rd_count; /*bytes remaining to be read */
- uint32_t wr_count; /*bytes remaining to be written */
+ hsize_t scaled[H5O_LAYOUT_NDIMS]; /*scaled chunk 'name' (coordinates) */
+ uint32_t rd_count; /*bytes remaining to be read */
+ uint32_t wr_count; /*bytes remaining to be written */
H5F_block_t chunk_block; /*offset/length of chunk in file */
- hsize_t chunk_idx; /*index of chunk in dataset */
- uint8_t *chunk; /*the unfiltered chunk data */
- unsigned idx; /*index in hash table */
- struct H5D_rdcc_ent_t *next;/*next item in doubly-linked list */
- struct H5D_rdcc_ent_t *prev;/*previous item in doubly-linked list */
+ hsize_t chunk_idx; /*index of chunk in dataset */
+ uint8_t *chunk; /*the unfiltered chunk data */
+ unsigned idx; /*index in hash table */
+ struct H5D_rdcc_ent_t *next;/*next item in doubly-linked list */
+ struct H5D_rdcc_ent_t *prev;/*previous item in doubly-linked list */
struct H5D_rdcc_ent_t *tmp_next;/*next item in temporary doubly-linked list */
struct H5D_rdcc_ent_t *tmp_prev;/*previous item in temporary doubly-linked list */
} H5D_rdcc_ent_t;
@@ -142,7 +142,7 @@ typedef struct H5D_chunk_it_ud1_t {
H5D_chunk_common_ud_t common; /* Common info for B-tree user data (must be first) */
const H5D_chk_idx_info_t *idx_info; /* Chunked index info */
const H5D_io_info_t *io_info; /* I/O info for dataset operation */
- const hsize_t *space_dim; /* New dataset dimensions */
+ const hsize_t *space_dim; /* New dataset dimensions */
const hbool_t *shrunk_dim; /* Dimensions which have been shrunk */
H5S_t *chunk_space; /* Dataspace for a chunk */
uint32_t elmts_per_chunk;/* Elements in chunk */
@@ -192,12 +192,12 @@ typedef struct H5D_chunk_it_ud3_t {
/* needed for getting raw data from chunk cache */
hbool_t chunk_in_cache;
- uint8_t *chunk; /* the unfiltered chunk data */
+ uint8_t *chunk; /* the unfiltered chunk data */
} H5D_chunk_it_ud3_t;
/* Callback info for iteration to dump index */
typedef struct H5D_chunk_it_ud4_t {
- FILE *stream; /* Output stream */
+ FILE *stream; /* Output stream */
hbool_t header_displayed; /* Node's header is displayed? */
unsigned ndims; /* Number of dimensions for chunk/dataset */
uint32_t *chunk_dim; /* Chunk dimensions */
@@ -207,7 +207,7 @@ typedef struct H5D_chunk_it_ud4_t {
typedef struct H5D_chunk_it_ud5_t {
H5D_chk_idx_info_t *new_idx_info; /* Dest. chunk index info object */
unsigned dset_ndims; /* Number of dimensions in dataset */
- hsize_t *dset_dims; /* Dataset dimensions */
+ hsize_t *dset_dims; /* Dataset dimensions */
} H5D_chunk_it_ud5_t;
/* Callback info for nonexistent readvv operation */
@@ -315,7 +315,7 @@ static herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info,
static herr_t H5D__chunk_cache_prune(const H5D_t *dset, size_t size);
static herr_t H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk);
#ifdef H5_HAVE_PARALLEL
-static herr_t H5D__chunk_collective_fill(const H5D_t *dset,
+static herr_t H5D__chunk_collective_fill(const H5D_t *dset,
H5D_chunk_coll_info_t *chunk_info, size_t chunk_size, const void *fill_buf);
#endif /* H5_HAVE_PARALLEL */
@@ -331,6 +331,7 @@ const H5D_layout_ops_t H5D_LOPS_CHUNK[1] = {{
H5D__chunk_construct,
H5D__chunk_init,
H5D__chunk_is_space_alloc,
+ H5D__chunk_is_data_cached,
H5D__chunk_io_init,
H5D__chunk_read,
H5D__chunk_write,
@@ -358,6 +359,7 @@ const H5D_layout_ops_t H5D_LOPS_NONEXISTENT[1] = {{
NULL,
NULL,
NULL,
+ NULL,
#ifdef H5_HAVE_PARALLEL
NULL,
NULL,
@@ -384,15 +386,15 @@ H5FL_BLK_DEFINE_STATIC(chunk);
/* Declare extern free list to manage the H5S_sel_iter_t struct */
H5FL_EXTERN(H5S_sel_iter_t);
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_direct_write
+ * Function: H5D__chunk_direct_write
*
- * Purpose: Internal routine to write a chunk directly into the file.
+ * Purpose: Internal routine to write a chunk directly into the file.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 30 July 2012
*
*-------------------------------------------------------------------------
@@ -412,10 +414,13 @@ H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset,
FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr)
+ /* Sanity checks */
+ HDassert(layout->type == H5D_CHUNKED);
+
io_info.dset = dset;
/* Allocate dataspace and initialize it if it hasn't been. */
- if(!(*layout->ops->is_space_alloc)(&layout->storage))
+ if(!H5D__chunk_is_space_alloc(&layout->storage))
/* Allocate storage */
if(H5D__alloc_storage(&io_info, H5D_ALLOC_WRITE, FALSE, NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage")
@@ -429,7 +434,7 @@ H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset,
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
/* Sanity check */
- HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) ||
+ HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) ||
(!H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0));
/* Set the file block information for the old chunk */
@@ -453,13 +458,17 @@ H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset,
if(0 == idx_info.pline->nused && H5F_addr_defined(old_chunk.offset))
/* If there are no filters and we are overwriting the chunk we can just set values */
need_insert = FALSE;
- else
+ else {
/* Otherwise, create the chunk it if it doesn't exist, or reallocate the chunk
* if its size has changed.
*/
if(H5D__chunk_file_alloc(&idx_info, &old_chunk, &udata.chunk_block, &need_insert, scaled) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk")
+ /* Cache the new chunk information */
+ H5D__chunk_cinfo_cache_update(&dset->shared->cache.chunk.last, &udata);
+ } /* end else */
+
/* Make sure the address of the chunk is returned. */
if(!H5F_addr_defined(udata.chunk_block.offset))
HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "chunk address isn't defined")
@@ -467,7 +476,7 @@ H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset,
/* Evict the (old) entry from the cache if present, but do not flush
* it to disk */
if(UINT_MAX != udata.idx_hint) {
- const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */
+ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */
if(H5D__chunk_cache_evict(dset, rdcc->slot[udata.idx_hint], FALSE) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk")
@@ -490,7 +499,7 @@ done:
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5D__chunk_direct_write() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__chunk_direct_read
*
@@ -524,7 +533,8 @@ H5D__chunk_direct_read(const H5D_t *dset, hsize_t *offset, uint32_t* filters,
*filters = 0;
/* Allocate dataspace and initialize it if it hasn't been. */
- if(!(*layout->ops->is_space_alloc)(&layout->storage))
+ if(!H5D__chunk_is_space_alloc(&layout->storage)
+ && !H5D__chunk_is_data_cached(dset->shared))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "storage is not initialized")
/* Calculate the index of this chunk */
@@ -578,7 +588,7 @@ H5D__chunk_direct_read(const H5D_t *dset, hsize_t *offset, uint32_t* filters,
/* Read the chunk data into the supplied buffer */
if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, udata.chunk_block.length, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk")
-
+
/* Return the filter mask */
*filters = udata.filter_mask;
@@ -586,7 +596,7 @@ done:
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5D__chunk_direct_read() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__get_chunk_storage_size
*
@@ -684,15 +694,15 @@ done:
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* H5D__get_chunk_storage_size */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_set_info_real
+ * Function: H5D__chunk_set_info_real
*
- * Purpose: Internal routine to set the information about chunks for a dataset
+ * Purpose: Internal routine to set the information about chunks for a dataset
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, June 30, 2009
*
*-------------------------------------------------------------------------
@@ -738,15 +748,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_set_info_real() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_set_info
+ * Function: H5D__chunk_set_info
*
- * Purpose: Sets the information about chunks for a dataset
+ * Purpose: Sets the information about chunks for a dataset
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, June 30, 2009
*
*-------------------------------------------------------------------------
@@ -763,7 +773,7 @@ H5D__chunk_set_info(const H5D_t *dset)
/* Set the base layout information */
if(H5D__chunk_set_info_real(&dset->shared->layout.u.chunk, dset->shared->ndims, dset->shared->curr_dims, dset->shared->max_dims) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout's chunk info")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout's chunk info")
/* Call the index's "resize" callback */
if(dset->shared->layout.storage.u.chunk.ops->resize && (dset->shared->layout.storage.u.chunk.ops->resize)(&dset->shared->layout.u.chunk) < 0)
@@ -773,15 +783,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_set_info() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_set_sizes
+ * Function: H5D__chunk_set_sizes
*
* Purpose: Sets chunk and type sizes.
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
+ * Programmer: Dana Robinson
* December 2015
*
*-------------------------------------------------------------------------
@@ -836,15 +846,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_set_sizes */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_construct
+ * Function: H5D__chunk_construct
*
- * Purpose: Constructs new chunked layout information for dataset
+ * Purpose: Constructs new chunked layout information for dataset
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, May 22, 2008
*
*-------------------------------------------------------------------------
@@ -899,16 +909,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_construct() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_init
+ * Function: H5D__chunk_init
*
- * Purpose: Initialize the raw data chunk cache for a dataset. This is
- * called when the dataset is initialized.
+ * Purpose: Initialize the raw data chunk cache for a dataset. This is
+ * called when the dataset is initialized.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, May 18, 1998
*
*-------------------------------------------------------------------------
@@ -917,7 +927,7 @@ static herr_t
H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id)
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
- H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Convenience pointer to dataset's chunk cache */
+ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Convenience pointer to dataset's chunk cache */
H5P_genplist_t *dapl; /* Data access property list object pointer */
H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk);
herr_t ret_value = SUCCEED; /* Return value */
@@ -994,7 +1004,7 @@ H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id)
/* Allocate any indexing structures */
if(dset->shared->layout.storage.u.chunk.ops->init && (dset->shared->layout.storage.u.chunk.ops->init)(&idx_info, dset->shared->space, dset->oloc.addr) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information")
/* Set the number of chunks in dataset, etc. */
if(H5D__chunk_set_info(dset) < 0)
@@ -1004,15 +1014,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_init() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_is_space_alloc
+ * Function: H5D__chunk_is_space_alloc
*
- * Purpose: Query if space is allocated for layout
+ * Purpose: Query if space is allocated for layout
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 15, 2009
*
*-------------------------------------------------------------------------
@@ -1035,15 +1045,39 @@ H5D__chunk_is_space_alloc(const H5O_storage_t *storage)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_is_space_alloc() */
-
+
+/*-------------------------------------------------------------------------
+ * Function: H5D__chunk_is_data_cached
+ *
+ * Purpose: Query if raw data is cached for dataset
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Neil Fortner
+ * Wednessday, March 6, 2016
+ *
+ *-------------------------------------------------------------------------
+ */
+hbool_t
+H5D__chunk_is_data_cached(const H5D_shared_t *shared_dset)
+{
+ FUNC_ENTER_PACKAGE_NOERR
+
+ /* Sanity checks */
+ HDassert(shared_dset);
+
+ FUNC_LEAVE_NOAPI(shared_dset->cache.chunk.nused > 0)
+} /* end H5D__chunk_is_data_cached() */
+
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_io_init
+ * Function: H5D__chunk_io_init
*
- * Purpose: Performs initialization before any sort of I/O on the raw data
+ * Purpose: Performs initialization before any sort of I/O on the raw data
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, March 20, 2008
*
*-------------------------------------------------------------------------
@@ -1065,7 +1099,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
H5SL_node_t *curr_node; /* Current node in skip list */
char bogus; /* "bogus" buffer to pass to selection iterator */
unsigned u; /* Local index variable */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1273,7 +1307,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "datatype size invalid")
if(H5S_select_iter_init(&(fm->mem_iter), mem_space, elmt_size) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator")
- iter_init = TRUE; /* Selection iteration info has been initialized */
+ iter_init = TRUE; /* Selection iteration info has been initialized */
iter_op.op_type = H5S_SEL_ITER_OP_LIB;
iter_op.u.lib_op = H5D__chunk_mem_cb;
@@ -1333,17 +1367,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_io_init() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_mem_alloc
+ * Function: H5D__chunk_mem_alloc
*
- * Purpose: Allocate space for a chunk in memory. This routine allocates
+ * Purpose: Allocate space for a chunk in memory. This routine allocates
* memory space for non-filtered chunks from a block free list
* and uses malloc()/free() for filtered chunks.
*
- * Return: Pointer to memory for chunk on success/NULL on failure
+ * Return: Pointer to memory for chunk on success/NULL on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* April 22, 2004
*
*-------------------------------------------------------------------------
@@ -1351,7 +1385,7 @@ done:
static void *
H5D__chunk_mem_alloc(size_t size, const H5O_pline_t *pline)
{
- void *ret_value = NULL; /* Return value */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC_NOERR
@@ -1365,17 +1399,17 @@ H5D__chunk_mem_alloc(size_t size, const H5O_pline_t *pline)
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__chunk_mem_alloc() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_mem_xfree
+ * Function: H5D__chunk_mem_xfree
*
- * Purpose: Free space for a chunk in memory. This routine allocates
+ * Purpose: Free space for a chunk in memory. This routine allocates
* memory space for non-filtered chunks from a block free list
* and uses malloc()/free() for filtered chunks.
*
- * Return: NULL (never fails)
+ * Return: NULL (never fails)
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* April 22, 2004
*
*-------------------------------------------------------------------------
@@ -1395,7 +1429,7 @@ H5D__chunk_mem_xfree(void *chk, const H5O_pline_t *pline)
FUNC_LEAVE_NOAPI(NULL)
} /* H5D__chunk_mem_xfree() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__chunk_mem_realloc
*
@@ -1428,7 +1462,7 @@ H5D__chunk_mem_realloc(void *chk, size_t size, const H5O_pline_t *pline)
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__chunk_mem_realloc() */
-
+
/*--------------------------------------------------------------------------
NAME
H5D__free_chunk_info
@@ -1471,16 +1505,16 @@ H5D__free_chunk_info(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *
FUNC_LEAVE_NOAPI(0)
} /* H5D__free_chunk_info() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__create_chunk_map_single
+ * Function: H5D__create_chunk_map_single
*
- * Purpose: Create chunk selections when appending a single record
+ * Purpose: Create chunk selections when appending a single record
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Tuesday, November 20, 2007
+ * Programmer: Quincey Koziol
+ * Tuesday, November 20, 2007
*
*-------------------------------------------------------------------------
*/
@@ -1496,7 +1530,7 @@ H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t
hsize_t sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */
hsize_t sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */
unsigned u; /* Local index variable */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1555,16 +1589,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__create_chunk_map_single() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__create_chunk_file_map_hyper
+ * Function: H5D__create_chunk_file_map_hyper
*
- * Purpose: Create all chunk selections in file.
+ * Purpose: Create all chunk selections in file.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, May 29, 2003
+ * Programmer: Quincey Koziol
+ * Thursday, May 29, 2003
*
*-------------------------------------------------------------------------
*/
@@ -1583,10 +1617,10 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
hsize_t end[H5O_LAYOUT_NDIMS]; /* Final coordinates of chunk */
hsize_t chunk_index; /* Index of chunk */
hsize_t start_scaled[H5S_MAX_RANK]; /* Starting scaled coordinates of selection */
- hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */
+ hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */
int curr_dim; /* Current dimension to increment */
unsigned u; /* Local index variable */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1675,11 +1709,11 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
new_chunk_info->mspace_shared = FALSE;
/* Copy the chunk's scaled coordinates */
- HDmemcpy(new_chunk_info->scaled, scaled, sizeof(hsize_t) * fm->f_ndims);
+ HDmemcpy(new_chunk_info->scaled, scaled, sizeof(hsize_t) * fm->f_ndims);
new_chunk_info->scaled[fm->f_ndims] = 0;
/* Copy the chunk's scaled coordinates */
- HDmemcpy(new_chunk_info->scaled, scaled, sizeof(hsize_t) * fm->f_ndims);
+ HDmemcpy(new_chunk_info->scaled, scaled, sizeof(hsize_t) * fm->f_ndims);
/* Insert the new chunk into the skip list */
if(H5SL_insert(fm->sel_chunks, new_chunk_info, &new_chunk_info->index) < 0) {
@@ -1738,18 +1772,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__create_chunk_file_map_hyper() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__create_chunk_mem_map_hyper
+ * Function: H5D__create_chunk_mem_map_hyper
*
- * Purpose: Create all chunk selections in memory by copying the file
+ * Purpose: Create all chunk selections in memory by copying the file
* chunk selections and adjusting their offsets to be correct
* for the memory.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, May 29, 2003
+ * Programmer: Quincey Koziol
+ * Thursday, May 29, 2003
*
* Assumptions: That the file and memory selections are the same shape.
*
@@ -1766,7 +1800,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm)
hssize_t adjust[H5O_LAYOUT_NDIMS]; /* Adjustment to make to all file chunks */
hssize_t chunk_adjust[H5O_LAYOUT_NDIMS]; /* Adjustment to make to a particular chunk */
unsigned u; /* Local index variable */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1856,17 +1890,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__create_chunk_mem_map_hyper() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_file_cb
+ * Function: H5D__chunk_file_cb
*
- * Purpose: Callback routine for file selection iterator. Used when
+ * Purpose: Callback routine for file selection iterator. Used when
* creating selections in file for each point selected.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Wednesday, July 23, 2003
+ * Programmer: Quincey Koziol
+ * Wednesday, July 23, 2003
*
*-------------------------------------------------------------------------
*/
@@ -1878,9 +1912,9 @@ H5D__chunk_file_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type,
H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */
hsize_t coords_in_chunk[H5O_LAYOUT_NDIMS]; /* Coordinates of element in chunk */
hsize_t chunk_index; /* Chunk index */
- hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */
+ hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */
unsigned u; /* Local index variable */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1973,17 +2007,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_file_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_mem_cb
+ * Function: H5D__chunk_mem_cb
*
- * Purpose: Callback routine for file selection iterator. Used when
+ * Purpose: Callback routine for file selection iterator. Used when
* creating selections in memory for each chunk.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Thursday, April 10, 2003
+ * Programmer: Raymond Lu
+ * Thursday, April 10, 2003
*
*-------------------------------------------------------------------------
*/
@@ -1994,7 +2028,7 @@ H5D__chunk_mem_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, u
H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */
hsize_t coords_in_mem[H5O_LAYOUT_NDIMS]; /* Coordinates of element in memory */
hsize_t chunk_index; /* Chunk index */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -2043,24 +2077,24 @@ H5D__chunk_mem_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, u
} /* end else */
/* Move memory selection iterator to next element in selection */
- if(H5S_SELECT_ITER_NEXT(&fm->mem_iter, (hsize_t)1) < 0)
+ if(H5S_SELECT_ITER_NEXT(&fm->mem_iter, (size_t)1) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTNEXT, FAIL, "unable to move to next iterator location")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_mem_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_cacheable
+ * Function: H5D__chunk_cacheable
*
- * Purpose: A small internal function to if it's possible to load the
+ * Purpose: A small internal function to if it's possible to load the
* chunk into cache.
*
- * Return: TRUE or FALSE
+ * Return: TRUE or FALSE
*
- * Programmer: Raymond Lu
- * 17 July 2007
+ * Programmer: Raymond Lu
+ * 17 July 2007
*
*-------------------------------------------------------------------------
*/
@@ -2142,16 +2176,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_cacheable() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_read
+ * Function: H5D__chunk_read
*
- * Purpose: Read from a chunked dataset.
+ * Purpose: Read from a chunked dataset.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Thursday, April 10, 2003
+ * Programmer: Raymond Lu
+ * Thursday, April 10, 2003
*
*-------------------------------------------------------------------------
*/
@@ -2169,7 +2203,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */
uint32_t src_accessed_bytes = 0; /* Total accessed size in a chunk */
hbool_t skip_missing_chunks = FALSE; /* Whether to skip missing chunks */
- herr_t ret_value = SUCCEED; /*return value */
+ herr_t ret_value = SUCCEED; /*return value */
FUNC_ENTER_STATIC
@@ -2221,7 +2255,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
chunk_node = H5D_CHUNK_GET_FIRST_NODE(fm);
while(chunk_node) {
H5D_chunk_info_t *chunk_info; /* Chunk information */
- H5D_chunk_ud_t udata; /* Chunk index pass-through */
+ H5D_chunk_ud_t udata; /* Chunk index pass-through */
/* Get the actual chunk information from the skip list node */
chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node);
@@ -2231,7 +2265,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
/* Sanity check */
- HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) ||
+ HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) ||
(!H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0));
/* Check for non-existant chunk & skip it if appropriate */
@@ -2294,16 +2328,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__chunk_read() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_write
+ * Function: H5D__chunk_write
*
- * Purpose: Writes to a chunked dataset.
+ * Purpose: Writes to a chunked dataset.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Thursday, April 10, 2003
+ * Programmer: Raymond Lu
+ * Thursday, April 10, 2003
*
*-------------------------------------------------------------------------
*/
@@ -2319,7 +2353,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
H5D_storage_t cpt_store; /* Chunk storage information as compact dataset */
hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */
uint32_t dst_accessed_bytes = 0; /* Total accessed size in a chunk */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -2349,10 +2383,10 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
chunk_node = H5D_CHUNK_GET_FIRST_NODE(fm);
while(chunk_node) {
H5D_chunk_info_t *chunk_info; /* Chunk information */
- H5D_chk_idx_info_t idx_info; /* Chunked index info */
+ H5D_chk_idx_info_t idx_info; /* Chunked index info */
H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */
void *chunk; /* Pointer to locked chunk buffer */
- H5D_chunk_ud_t udata; /* Index pass-through */
+ H5D_chunk_ud_t udata; /* Index pass-through */
htri_t cacheable; /* Whether the chunk is cacheable */
hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */
@@ -2364,11 +2398,11 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
/* Sanity check */
- HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) ||
+ HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) ||
(!H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0));
- /* Set chunk's [scaled] coordinates */
- io_info->store->chunk.scaled = chunk_info->scaled;
+ /* Set chunk's [scaled] coordinates */
+ io_info->store->chunk.scaled = chunk_info->scaled;
/* Determine if we should use the chunk cache */
if((cacheable = H5D__chunk_cacheable(io_info, udata.chunk_block.offset, TRUE)) < 0)
@@ -2385,7 +2419,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
/* Determine if we will access all the data in the chunk */
if(dst_accessed_bytes != ctg_store.contig.dset_size ||
(chunk_info->chunk_points * type_info->src_type_size) != ctg_store.contig.dset_size ||
- fm->fsel_type == H5S_SEL_POINTS)
+ fm->fsel_type == H5S_SEL_POINTS)
entire_chunk = FALSE;
/* Lock the chunk into the cache */
@@ -2411,8 +2445,8 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
udata.chunk_block.length = io_info->dset->shared->layout.u.chunk.size;
/* Allocate the chunk */
- if(H5D__chunk_file_alloc(&idx_info, NULL, &udata.chunk_block, &need_insert, chunk_info->scaled) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk on chunk level")
+ if(H5D__chunk_file_alloc(&idx_info, NULL, &udata.chunk_block, &need_insert, chunk_info->scaled) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk on chunk level")
/* Make sure the address of the chunk is returned. */
if(!H5F_addr_defined(udata.chunk_block.offset))
@@ -2437,16 +2471,16 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
(hsize_t)chunk_info->chunk_points, chunk_info->fspace, chunk_info->mspace) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed")
- /* Release the cache lock on the chunk, or insert chunk into index. */
- if(chunk) {
- if(H5D__chunk_unlock(io_info, &udata, TRUE, chunk, dst_accessed_bytes) < 0)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk")
- } /* end if */
- else {
+ /* Release the cache lock on the chunk, or insert chunk into index. */
+ if(chunk) {
+ if(H5D__chunk_unlock(io_info, &udata, TRUE, chunk, dst_accessed_bytes) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk")
+ } /* end if */
+ else {
if(need_insert && io_info->dset->shared->layout.storage.u.chunk.ops->insert)
if((io_info->dset->shared->layout.storage.u.chunk.ops->insert)(&idx_info, &udata, NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk addr into index")
- } /* end else */
+ } /* end else */
/* Advance to next chunk in list */
chunk_node = H5D_CHUNK_GET_NEXT_NODE(fm, chunk_node);
@@ -2456,16 +2490,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__chunk_write() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_flush
+ * Function: H5D__chunk_flush
*
- * Purpose: Writes all dirty chunks to disk and optionally preempts them
- * from the cache.
+ * Purpose: Writes all dirty chunks to disk and optionally preempts them
+ * from the cache.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, May 21, 1998
*
*-------------------------------------------------------------------------
@@ -2474,8 +2508,8 @@ static herr_t
H5D__chunk_flush(H5D_t *dset)
{
H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk);
- H5D_rdcc_ent_t *ent, *next;
- unsigned nerrors = 0; /* Count of any errors encountered when flushing chunks */
+ H5D_rdcc_ent_t *ent, *next;
+ unsigned nerrors = 0; /* Count of any errors encountered when flushing chunks */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -2485,34 +2519,34 @@ H5D__chunk_flush(H5D_t *dset)
/* Loop over all entries in the chunk cache */
for(ent = rdcc->head; ent; ent = next) {
- next = ent->next;
+ next = ent->next;
if(H5D__chunk_flush_entry(dset, ent, FALSE) < 0)
nerrors++;
} /* end for */
if(nerrors)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_flush() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_io_term
+ * Function: H5D__chunk_io_term
*
- * Purpose: Destroy I/O operation information.
+ * Purpose: Destroy I/O operation information.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Saturday, May 17, 2003
+ * Programmer: Quincey Koziol
+ * Saturday, May 17, 2003
*
*-------------------------------------------------------------------------
*/
static herr_t
H5D__chunk_io_term(const H5D_chunk_map_t *fm)
{
- herr_t ret_value = SUCCEED; /*return value */
+ herr_t ret_value = SUCCEED; /*return value */
FUNC_ENTER_STATIC
@@ -2547,16 +2581,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_io_term() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_dest
+ * Function: H5D__chunk_dest
*
- * Purpose: Destroy the entire chunk cache by flushing dirty entries,
- * preempting all entries, and freeing the cache itself.
+ * Purpose: Destroy the entire chunk cache by flushing dirty entries,
+ * preempting all entries, and freeing the cache itself.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, May 21, 1998
*
*-------------------------------------------------------------------------
@@ -2565,9 +2599,9 @@ static herr_t
H5D__chunk_dest(H5D_t *dset)
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
- H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Dataset's chunk cache */
- H5D_rdcc_ent_t *ent = NULL, *next = NULL; /* Pointer to current & next cache entries */
- int nerrors = 0; /* Accumulated count of errors */
+ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Dataset's chunk cache */
+ H5D_rdcc_ent_t *ent = NULL, *next = NULL; /* Pointer to current & next cache entries */
+ int nerrors = 0; /* Accumulated count of errors */
H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk);
herr_t ret_value = SUCCEED; /* Return value */
@@ -2583,7 +2617,7 @@ H5D__chunk_dest(H5D_t *dset)
if(H5D__chunk_cache_evict(dset, ent, TRUE) < 0)
nerrors++;
} /* end for */
-
+
/* Continue even if there are failures. */
if(nerrors)
HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks")
@@ -2602,21 +2636,21 @@ H5D__chunk_dest(H5D_t *dset)
/* Free any index structures */
if(dset->shared->layout.storage.u.chunk.ops->dest &&
(dset->shared->layout.storage.u.chunk.ops->dest)(&idx_info) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
done:
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5D__chunk_dest() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D_chunk_idx_reset
+ * Function: H5D_chunk_idx_reset
*
- * Purpose: Reset index information
+ * Purpose: Reset index information
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 15, 2009
*
*-------------------------------------------------------------------------
@@ -2635,21 +2669,21 @@ H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
/* Reset index structures */
if((storage->ops->reset)(storage, reset_addr) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset chunk index info")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset chunk index info")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_chunk_idx_reset() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_cinfo_cache_reset
+ * Function: H5D__chunk_cinfo_cache_reset
*
- * Purpose: Reset the cached chunk info
+ * Purpose: Reset the cached chunk info
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* November 27, 2007
*
*-------------------------------------------------------------------------
@@ -2668,15 +2702,15 @@ H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5D__chunk_cinfo_cache_reset() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_cinfo_cache_update
+ * Function: H5D__chunk_cinfo_cache_update
*
- * Purpose: Update the cached chunk info
+ * Purpose: Update the cached chunk info
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* November 27, 2007
*
*-------------------------------------------------------------------------
@@ -2705,15 +2739,15 @@ H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *ud
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5D__chunk_cinfo_cache_update() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_cinfo_cache_found
+ * Function: H5D__chunk_cinfo_cache_found
*
- * Purpose: Look for chunk info in cache
+ * Purpose: Look for chunk info in cache
*
- * Return: TRUE/FALSE/FAIL
+ * Return: TRUE/FALSE/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* November 27, 2007
*
*-------------------------------------------------------------------------
@@ -2754,19 +2788,19 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__chunk_cinfo_cache_found() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_create
+ * Function: H5D__chunk_create
*
- * Purpose: Creates a new chunked storage index and initializes the
- * layout information with information about the storage. The
- * layout info should be immediately written to the object header.
+ * Purpose: Creates a new chunked storage index and initializes the
+ * layout information with information about the storage. The
+ * layout info should be immediately written to the object header.
*
- * Return: Non-negative on success (with the layout information initialized
- * and ready to write to an object header). Negative on failure.
+ * Return: Non-negative on success (with the layout information initialized
+ * and ready to write to an object header). Negative on failure.
*
- * Programmer: Quincey Koziol
- * Thursday, May 22, 2008
+ * Programmer: Quincey Koziol
+ * Thursday, May 22, 2008
*
*-------------------------------------------------------------------------
*/
@@ -2790,7 +2824,7 @@ H5D__chunk_create(const H5D_t *dset /*in,out*/)
unsigned u; /* Local index variable */
for(u = 0; u < dset->shared->layout.u.chunk.ndims; u++)
- HDassert(dset->shared->layout.u.chunk.dim[u] > 0);
+ HDassert(dset->shared->layout.u.chunk.dim[u] > 0);
}
#endif
@@ -2802,22 +2836,22 @@ H5D__chunk_create(const H5D_t *dset /*in,out*/)
/* Create the index for the chunks */
if((dset->shared->layout.storage.u.chunk.ops->create)(&idx_info) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create chunk index")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create chunk index")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_create() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_hash_val
+ * Function: H5D__chunk_hash_val
*
- * Purpose: To calculate an index based on the dataset's scaled coordinates and
- * sizes of the faster dimensions.
+ * Purpose: To calculate an index based on the dataset's scaled coordinates and
+ * sizes of the faster dimensions.
*
- * Return: Hash value index
+ * Return: Hash value index
*
- * Programmer: Vailin Choi; Nov 2014
+ * Programmer: Vailin Choi; Nov 2014
*
*-------------------------------------------------------------------------
*/
@@ -2850,16 +2884,16 @@ H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled)
FUNC_LEAVE_NOAPI(ret)
} /* H5D__chunk_hash_val() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_lookup
+ * Function: H5D__chunk_lookup
*
- * Purpose: Loops up a chunk in cache and on disk, and retrieves
+ * Purpose: Loops up a chunk in cache and on disk, and retrieves
* information about that chunk.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* June 27, 1998
*
*-------------------------------------------------------------------------
@@ -2872,7 +2906,7 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled,
H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk);
unsigned idx; /* Index of chunk in cache, if present */
hbool_t found = FALSE; /* In cache? */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -2992,18 +3026,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__chunk_lookup() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_flush_entry
+ * Function: H5D__chunk_flush_entry
*
- * Purpose: Writes a chunk to disk. If RESET is non-zero then the
- * entry is cleared -- it's slightly faster to flush a chunk if
- * the RESET flag is turned on because it results in one fewer
- * memory copy.
+ * Purpose: Writes a chunk to disk. If RESET is non-zero then the
+ * entry is cleared -- it's slightly faster to flush a chunk if
+ * the RESET flag is turned on because it results in one fewer
+ * memory copy.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, May 21, 1998
*
*-------------------------------------------------------------------------
@@ -3011,10 +3045,10 @@ done:
static herr_t
H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset)
{
- void *buf = NULL; /* Temporary buffer */
- hbool_t point_of_no_return = FALSE;
+ void *buf = NULL; /* Temporary buffer */
+ hbool_t point_of_no_return = FALSE;
H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk);
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC_TAG(dset->oloc.addr)
@@ -3027,7 +3061,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset)
buf = ent->chunk;
if(ent->dirty) {
H5D_chk_idx_info_t idx_info; /* Chunked index info */
- H5D_chunk_ud_t udata; /* pass through B-tree */
+ H5D_chunk_ud_t udata; /* pass through B-tree */
hbool_t must_alloc = FALSE; /* Whether the chunk must be allocated */
hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */
@@ -3045,7 +3079,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset)
&& !(ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS)) {
H5Z_EDC_t err_detect; /* Error detection info */
H5Z_cb_t filter_cb; /* I/O filter callback function */
- size_t alloc = udata.chunk_block.length; /* Bytes allocated for BUF */
+ size_t alloc = udata.chunk_block.length; /* Bytes allocated for BUF */
size_t nbytes; /* Chunk size (in bytes) */
/* Retrieve filter settings from API context */
@@ -3183,7 +3217,7 @@ done:
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5D__chunk_flush_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__chunk_cache_evict
*
@@ -3263,17 +3297,17 @@ H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent,
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_cache_evict() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_cache_prune
+ * Function: H5D__chunk_cache_prune
*
- * Purpose: Prune the cache by preempting some things until the cache has
- * room for something which is SIZE bytes. Only unlocked
- * entries are considered for preemption.
+ * Purpose: Prune the cache by preempting some things until the cache has
+ * room for something which is SIZE bytes. Only unlocked
+ * entries are considered for preemption.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, May 21, 1998
*
*-------------------------------------------------------------------------
@@ -3281,13 +3315,13 @@ H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent,
static herr_t
H5D__chunk_cache_prune(const H5D_t *dset, size_t size)
{
- const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk);
- size_t total = rdcc->nbytes_max;
- const int nmeth = 2; /*number of methods */
- int w[1]; /*weighting as an interval */
- H5D_rdcc_ent_t *p[2], *cur; /*list pointers */
- H5D_rdcc_ent_t *n[2]; /*list next pointers */
- int nerrors = 0; /* Accumulated error count during preemptions */
+ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk);
+ size_t total = rdcc->nbytes_max;
+ const int nmeth = 2; /*number of methods */
+ int w[1]; /*weighting as an interval */
+ H5D_rdcc_ent_t *p[2], *cur; /*list pointers */
+ H5D_rdcc_ent_t *n[2]; /*list next pointers */
+ int nerrors = 0; /* Accumulated error count during preemptions */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -3309,91 +3343,91 @@ H5D__chunk_cache_prune(const H5D_t *dset, size_t size)
while((p[0] || p[1]) && (rdcc->nbytes_used + size) > total) {
int i; /* Local index variable */
- /* Introduce new pointers */
- for(i = 0; i < nmeth - 1; i++)
+ /* Introduce new pointers */
+ for(i = 0; i < nmeth - 1; i++)
if(0 == w[i])
p[i + 1] = rdcc->head;
- /* Compute next value for each pointer */
- for(i = 0; i < nmeth; i++)
+ /* Compute next value for each pointer */
+ for(i = 0; i < nmeth; i++)
n[i] = p[i] ? p[i]->next : NULL;
- /* Give each method a chance */
- for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) {
- if(0 == i && p[0] && !p[0]->locked &&
+ /* Give each method a chance */
+ for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) {
+ if(0 == i && p[0] && !p[0]->locked &&
((0 == p[0]->rd_count && 0 == p[0]->wr_count) ||
(0 == p[0]->rd_count && dset->shared->layout.u.chunk.size == p[0]->wr_count) ||
(dset->shared->layout.u.chunk.size == p[0]->rd_count && 0 == p[0]->wr_count))) {
- /*
- * Method 0: Preempt entries that have been completely written
- * and/or completely read but not entries that are partially
- * written or partially read.
- */
- cur = p[0];
- } else if(1 == i && p[1] && !p[1]->locked) {
- /*
- * Method 1: Preempt the entry without regard to
- * considerations other than being locked. This is the last
- * resort preemption.
- */
- cur = p[1];
- } else {
- /* Nothing to preempt at this point */
- cur = NULL;
- }
-
- if(cur) {
+ /*
+ * Method 0: Preempt entries that have been completely written
+ * and/or completely read but not entries that are partially
+ * written or partially read.
+ */
+ cur = p[0];
+ } else if(1 == i && p[1] && !p[1]->locked) {
+ /*
+ * Method 1: Preempt the entry without regard to
+ * considerations other than being locked. This is the last
+ * resort preemption.
+ */
+ cur = p[1];
+ } else {
+ /* Nothing to preempt at this point */
+ cur = NULL;
+ }
+
+ if(cur) {
int j; /* Local index variable */
- for(j = 0; j < nmeth; j++) {
- if(p[j] == cur)
+ for(j = 0; j < nmeth; j++) {
+ if(p[j] == cur)
p[j] = NULL;
- if(n[j] == cur)
+ if(n[j] == cur)
n[j] = cur->next;
- } /* end for */
- if(H5D__chunk_cache_evict(dset, cur, TRUE) < 0)
+ } /* end for */
+ if(H5D__chunk_cache_evict(dset, cur, TRUE) < 0)
nerrors++;
- } /* end if */
- } /* end for */
+ } /* end if */
+ } /* end for */
- /* Advance pointers */
- for(i = 0; i < nmeth; i++)
+ /* Advance pointers */
+ for(i = 0; i < nmeth; i++)
p[i] = n[i];
- for(i = 0; i < nmeth - 1; i++)
+ for(i = 0; i < nmeth - 1; i++)
w[i] -= 1;
} /* end while */
if(nerrors)
- HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry")
+ HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_cache_prune() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_lock
+ * Function: H5D__chunk_lock
*
- * Purpose: Return a pointer to a dataset chunk. The pointer points
- * directly into the chunk cache and should not be freed
- * by the caller but will be valid until it is unlocked. The
- * input value IDX_HINT is used to speed up cache lookups and
- * it's output value should be given to H5D__chunk_unlock().
- * IDX_HINT is ignored if it is out of range, and if it points
- * to the wrong entry then we fall back to the normal search
- * method.
+ * Purpose: Return a pointer to a dataset chunk. The pointer points
+ * directly into the chunk cache and should not be freed
+ * by the caller but will be valid until it is unlocked. The
+ * input value IDX_HINT is used to speed up cache lookups and
+ * it's output value should be given to H5D__chunk_unlock().
+ * IDX_HINT is ignored if it is out of range, and if it points
+ * to the wrong entry then we fall back to the normal search
+ * method.
*
- * If RELAX is non-zero and the chunk isn't in the cache then
- * don't try to read it from the file, but just allocate an
- * uninitialized buffer to hold the result. This is intended
- * for output functions that are about to overwrite the entire
- * chunk.
+ * If RELAX is non-zero and the chunk isn't in the cache then
+ * don't try to read it from the file, but just allocate an
+ * uninitialized buffer to hold the result. This is intended
+ * for output functions that are about to overwrite the entire
+ * chunk.
*
- * Return: Success: Ptr to a file chunk.
+ * Return: Success: Ptr to a file chunk.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, May 21, 1998
*
*-------------------------------------------------------------------------
@@ -3409,12 +3443,12 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata,
const H5O_fill_t *fill = &(dset->shared->dcpl_cache.fill); /* Fill value info */
H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */
hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */
- H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache*/
- H5D_rdcc_ent_t *ent; /*cache entry */
- size_t chunk_size; /*size of a chunk */
+ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache*/
+ H5D_rdcc_ent_t *ent; /*cache entry */
+ size_t chunk_size; /*size of a chunk */
hbool_t disable_filters = FALSE; /* Whether to disable filters (when adding to cache) */
- void *chunk = NULL; /*the file chunk */
- void *ret_value = NULL; /* Return value */
+ void *chunk = NULL; /*the file chunk */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -3441,7 +3475,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata,
#ifndef NDEBUG
{
- unsigned u; /*counters */
+ unsigned u; /*counters */
/* Make sure this is the right chunk */
for(u = 0; u < layout->u.chunk.ndims - 1; u++)
@@ -3599,8 +3633,8 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata,
/* Check if the chunk exists on disk */
if(H5F_addr_defined(chunk_addr)) {
- size_t my_chunk_alloc = chunk_alloc; /* Allocated buffer size */
- size_t buf_alloc = chunk_alloc; /* [Re-]allocated buffer size */
+ size_t my_chunk_alloc = chunk_alloc; /* Allocated buffer size */
+ size_t buf_alloc = chunk_alloc; /* [Re-]allocated buffer size */
/* Chunk size on disk isn't [likely] the same size as the final chunk
* size in memory, so allocate memory big enough. */
@@ -3640,7 +3674,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata,
rdcc->stats.nmisses++;
} /* end if */
else {
- H5D_fill_value_t fill_status;
+ H5D_fill_value_t fill_status;
/* Sanity check */
HDassert(fill->alloc_time != H5D_ALLOC_TIME_EARLY);
@@ -3774,25 +3808,25 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_lock() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_unlock
+ * Function: H5D__chunk_unlock
*
- * Purpose: Unlocks a previously locked chunk. The LAYOUT, COMP, and
- * OFFSET arguments should be the same as for H5D__chunk_lock().
- * The DIRTY argument should be set to non-zero if the chunk has
- * been modified since it was locked. The IDX_HINT argument is
- * the returned index hint from the lock operation and BUF is
- * the return value from the lock.
+ * Purpose: Unlocks a previously locked chunk. The LAYOUT, COMP, and
+ * OFFSET arguments should be the same as for H5D__chunk_lock().
+ * The DIRTY argument should be set to non-zero if the chunk has
+ * been modified since it was locked. The IDX_HINT argument is
+ * the returned index hint from the lock operation and BUF is
+ * the return value from the lock.
*
- * The NACCESSED argument should be the number of bytes accessed
- * for reading or writing (depending on the value of DIRTY).
- * It's only purpose is to provide additional information to the
- * preemption policy.
+ * The NACCESSED argument should be the number of bytes accessed
+ * for reading or writing (depending on the value of DIRTY).
+ * It's only purpose is to provide additional information to the
+ * preemption policy.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, May 21, 1998
*
*-------------------------------------------------------------------------
@@ -3802,7 +3836,7 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata,
hbool_t dirty, void *chunk, uint32_t naccessed)
{
const H5O_layout_t *layout = &(io_info->dset->shared->layout); /* Dataset layout */
- const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk);
+ const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk);
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -3840,9 +3874,9 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata,
fake_ent.edge_chunk_state = H5D_RDCC_DISABLE_FILTERS;
if(udata->new_unfilt_chunk)
fake_ent.edge_chunk_state |= H5D_RDCC_NEWLY_DISABLED_FILTERS;
- HDmemcpy(fake_ent.scaled, udata->common.scaled, sizeof(hsize_t) * layout->u.chunk.ndims);
+ HDmemcpy(fake_ent.scaled, udata->common.scaled, sizeof(hsize_t) * layout->u.chunk.ndims);
HDassert(layout->u.chunk.size > 0);
- fake_ent.chunk_idx = udata->chunk_idx;
+ fake_ent.chunk_idx = udata->chunk_idx;
fake_ent.chunk_block.offset = udata->chunk_block.offset;
fake_ent.chunk_block.length = udata->chunk_block.length;
fake_ent.chunk = (uint8_t *)chunk;
@@ -3853,16 +3887,16 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata,
else {
if(chunk)
chunk = H5D__chunk_mem_xfree(chunk, (is_unfiltered_edge_chunk ? NULL
- : &(io_info->dset->shared->dcpl_cache.pline)));
+ : &(io_info->dset->shared->dcpl_cache.pline)));
} /* end else */
} /* end if */
else {
- H5D_rdcc_ent_t *ent; /* Chunk's entry in the cache */
+ H5D_rdcc_ent_t *ent; /* Chunk's entry in the cache */
/* Sanity check */
- HDassert(udata->idx_hint < rdcc->nslots);
- HDassert(rdcc->slot[udata->idx_hint]);
- HDassert(rdcc->slot[udata->idx_hint]->chunk == chunk);
+ HDassert(udata->idx_hint < rdcc->nslots);
+ HDassert(rdcc->slot[udata->idx_hint]);
+ HDassert(rdcc->slot[udata->idx_hint]->chunk == chunk);
/*
* It's in the cache so unlock it.
@@ -3882,16 +3916,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_unlock() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_allocated_cb
+ * Function: H5D__chunk_allocated_cb
*
- * Purpose: Simply counts the number of chunks for a dataset.
+ * Purpose: Simply counts the number of chunks for a dataset.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 21, 1999
*
*-------------------------------------------------------------------------
@@ -3908,17 +3942,17 @@ H5D__chunk_allocated_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
FUNC_LEAVE_NOAPI(H5_ITER_CONT)
} /* H5D__chunk_allocated_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_allocated
+ * Function: H5D__chunk_allocated
*
- * Purpose: Return the number of bytes allocated in the file for storage
- * of raw data in the chunked dataset
+ * Purpose: Return the number of bytes allocated in the file for storage
+ * of raw data in the chunked dataset
*
- * Return: Success: Number of bytes stored in all chunks.
- * Failure: 0
+ * Return: Success: Number of bytes stored in all chunks.
+ * Failure: 0
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 20, 2008
*
*-------------------------------------------------------------------------
@@ -3927,7 +3961,7 @@ herr_t
H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes)
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
- const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Raw data chunk cache */
+ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Raw data chunk cache */
H5D_rdcc_ent_t *ent; /* Cache entry */
hsize_t chunk_bytes = 0; /* Number of bytes allocated for chunks */
H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk);
@@ -3962,18 +3996,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_allocated() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_allocate
+ * Function: H5D__chunk_allocate
*
- * Purpose: Allocate file space for all chunks that are not allocated yet.
- * Return SUCCEED if all needed allocation succeed, otherwise
- * FAIL.
+ * Purpose: Allocate file space for all chunks that are not allocated yet.
+ * Return SUCCEED if all needed allocation succeed, otherwise
+ * FAIL.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Albert Cheng
- * June 26, 1998
+ * Programmer: Albert Cheng
+ * June 26, 1998
*
*-------------------------------------------------------------------------
*/
@@ -3985,8 +4019,8 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
const H5D_chunk_ops_t *ops = dset->shared->layout.storage.u.chunk.ops; /* Chunk operations */
hsize_t min_unalloc[H5O_LAYOUT_NDIMS]; /* First chunk in each dimension that is unallocated (in scaled coordinates) */
hsize_t max_unalloc[H5O_LAYOUT_NDIMS]; /* Last chunk in each dimension that is unallocated (in scaled coordinates) */
- hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Offset of current chunk (in scaled coordinates) */
- size_t orig_chunk_size; /* Original size of chunk in bytes */
+ hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Offset of current chunk (in scaled coordinates) */
+ size_t orig_chunk_size; /* Original size of chunk in bytes */
size_t chunk_size; /* Actual size of chunk in bytes, possibly filtered */
unsigned filter_mask = 0; /* Filter mask for chunks that have them */
const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */
@@ -4002,7 +4036,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
hbool_t using_mpi = FALSE; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */
H5D_chunk_coll_info_t chunk_info; /* chunk address information for doing I/O */
#endif /* H5_HAVE_PARALLEL */
- hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */
+ hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */
unsigned space_ndims; /* Dataset's space rank */
const hsize_t *space_dim; /* Dataset's dataspace dimensions */
const uint32_t *chunk_dim = layout->u.chunk.dim; /* Convenience pointer to chunk dimensions */
@@ -4014,7 +4048,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
hsize_t edge_chunk_scaled[H5O_LAYOUT_NDIMS]; /* Offset of the unfiltered edge chunks at the edge of each dimension */
unsigned nunfilt_edge_chunk_dims = 0; /* Number of dimensions on an edge */
const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk);
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr)
@@ -4217,13 +4251,13 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
while(!carry) {
hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */
- /* Look up this chunk */
- if(H5D__chunk_lookup(dset, scaled, &udata) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
+ /* Look up this chunk */
+ if(H5D__chunk_lookup(dset, scaled, &udata) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
#ifndef NDEBUG
/* None of the chunks should be allocated */
- if(H5D_CHUNK_IDX_NONE != layout->storage.u.chunk.idx_type)
- HDassert(!H5F_addr_defined(udata.chunk_block.offset));
+ if(H5D_CHUNK_IDX_NONE != layout->storage.u.chunk.idx_type)
+ HDassert(!H5F_addr_defined(udata.chunk_block.offset));
/* Make sure the chunk is really in the dataset and outside the
* original dimensions */
@@ -4302,8 +4336,8 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
udata.filter_mask = filter_mask;
/* Allocate the chunk (with all processes) */
- if(H5D__chunk_file_alloc(&idx_info, NULL, &udata.chunk_block, &need_insert, scaled) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk on chunk level")
+ if(H5D__chunk_file_alloc(&idx_info, NULL, &udata.chunk_block, &need_insert, scaled) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk on chunk level")
HDassert(H5F_addr_defined(udata.chunk_block.offset));
/* Check if fill values should be written to chunks */
@@ -4342,7 +4376,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
} /* end if */
/* Insert the chunk record into the index */
- if(need_insert && ops->insert)
+ if(need_insert && ops->insert)
if((ops->insert)(&idx_info, &udata, dset) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk addr into index")
@@ -4421,7 +4455,7 @@ done:
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5D__chunk_allocate() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__chunk_update_old_edge_chunks
*
@@ -4508,12 +4542,12 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[])
/* Calculate offset of first previously incomplete chunk in this
* dimension */
- old_edge_chunk_sc[op_dim] = (old_dim[op_dim] / chunk_dim[op_dim]);
+ old_edge_chunk_sc[op_dim] = (old_dim[op_dim] / chunk_dim[op_dim]);
/* Calculate the largest offset of chunks that might need to be
* modified in this dimension */
- max_edge_chunk_sc[op_dim] = MIN((old_dim[op_dim] - 1) / chunk_dim[op_dim],
- MAX((space_dim[op_dim] / chunk_dim[op_dim]), 1) - 1);
+ max_edge_chunk_sc[op_dim] = MIN((old_dim[op_dim] - 1) / chunk_dim[op_dim],
+ MAX((space_dim[op_dim] / chunk_dim[op_dim]), 1) - 1);
/* Check for old_dim aligned with chunk boundary in this dimension, if
* so we do not need to modify chunks along the edge in this dimension
@@ -4523,7 +4557,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[])
/* Check if the dataspace expanded enough to cause the old edge chunks
* in this dimension to become full */
- if((space_dim[op_dim]/chunk_dim[op_dim]) >= (old_edge_chunk_sc[op_dim] + 1))
+ if((space_dim[op_dim]/chunk_dim[op_dim]) >= (old_edge_chunk_sc[op_dim] + 1))
new_full_dim[op_dim] = TRUE;
} /* end for */
@@ -4571,7 +4605,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[])
carry = TRUE;
for(i = ((int)space_ndims - 1); i >= 0; --i) {
if((unsigned)i != op_dim) {
- ++chunk_sc[i];
+ ++chunk_sc[i];
if(chunk_sc[i] > (hsize_t) max_edge_chunk_sc[i])
chunk_sc[i] = 0;
else {
@@ -4599,18 +4633,18 @@ done:
} /* end H5D__chunk_update_old_edge_chunks() */
#ifdef H5_HAVE_PARALLEL
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_collective_fill
+ * Function: H5D__chunk_collective_fill
*
* Purpose: Use MPIO collective write to fill the chunks (if number of
- * chunks to fill is greater than the number of MPI procs;
+ * chunks to fill is greater than the number of MPI procs;
* otherwise use independent I/O).
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
- * July 30, 2014
+ * Programmer: Mohamad Chaarawi
+ * July 30, 2014
*
*-------------------------------------------------------------------------
*/
@@ -4618,7 +4652,7 @@ static herr_t
H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info,
size_t chunk_size, const void *fill_buf)
{
- MPI_Comm mpi_comm = MPI_COMM_NULL; /* MPI communicator for file */
+ MPI_Comm mpi_comm = MPI_COMM_NULL; /* MPI communicator for file */
int mpi_rank = (-1); /* This process's rank */
int mpi_size = (-1); /* MPI Comm size */
int mpi_code; /* MPI return code */
@@ -4686,13 +4720,13 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info,
distributing. If there are, then round robin the distribution
to processes 0 -> leftover. */
if(leftover && leftover > mpi_rank) {
- chunk_disp_array[blocks] = (MPI_Aint)chunk_info->addr[blocks*mpi_size + mpi_rank];
+ chunk_disp_array[blocks] = (MPI_Aint)chunk_info->addr[blocks*mpi_size + mpi_rank];
block_lens[blocks] = block_len;
blocks++;
}
- /* MSC
- * should use this if MPI_type_create_hindexed block is working
+ /* MSC
+ * should use this if MPI_type_create_hindexed block is working
* mpi_code = MPI_Type_create_hindexed_block(blocks, block_len, chunk_disp_array, MPI_BYTE, &file_type);
*/
mpi_code = MPI_Type_create_hindexed(blocks, block_lens, chunk_disp_array, MPI_BYTE, &file_type);
@@ -4748,17 +4782,17 @@ done:
} /* end H5D__chunk_collective_fill() */
#endif /* H5_HAVE_PARALLEL */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_prune_fill
+ * Function: H5D__chunk_prune_fill
*
- * Purpose: Write the fill value to the parts of the chunk that are no
+ * Purpose: Write the fill value to the parts of the chunk that are no
* longer part of the dataspace
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- * March 26, 2002
+ * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * March 26, 2002
*
*-------------------------------------------------------------------------
*/
@@ -4775,7 +4809,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk)
hssize_t sel_nelmts; /* Number of elements in selection */
hsize_t count[H5O_LAYOUT_NDIMS]; /* Element count of hyperslab */
size_t chunk_size; /*size of a chunk */
- void *chunk; /* The file chunk */
+ void *chunk; /* The file chunk */
H5D_chunk_ud_t chk_udata; /* User data for locking chunk */
uint32_t bytes_accessed; /* Bytes accessed in chunk */
unsigned u; /* Local index variable */
@@ -4875,18 +4909,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__chunk_prune_fill */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_prune_by_extent
+ * Function: H5D__chunk_prune_by_extent
*
- * Purpose: This function searches for chunks that are no longer necessary
+ * Purpose: This function searches for chunks that are no longer necessary
* both in the raw data cache and in the chunk index.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- * Algorithm: Robb Matzke
- * March 27, 2002
+ * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Algorithm: Robb Matzke
+ * March 27, 2002
*
* The algorithm is:
*
@@ -4988,7 +5022,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
H5D_io_info_t chk_io_info; /* Chunked I/O info object */
H5D_storage_t chk_store; /* Chunk storage information */
const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */
- const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */
+ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */
unsigned space_ndims; /* Dataset's space rank */
const hsize_t *space_dim; /* Current dataspace dimensions */
unsigned op_dim; /* Current operating dimension */
@@ -5003,7 +5037,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
uint32_t elmts_per_chunk; /* Elements in chunk */
hbool_t disable_edge_filters = FALSE; /* Whether to disable filters on partial edge chunks */
hbool_t new_unfilt_chunk = FALSE; /* Whether the chunk is newly unfiltered */
- unsigned u; /* Local index variable */
+ unsigned u; /* Local index variable */
const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk);
herr_t ret_value = SUCCEED; /* Return value */
@@ -5037,13 +5071,13 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
elmts_per_chunk = 1;
for(u = 0; u < space_ndims; u++) {
elmts_per_chunk *= layout->u.chunk.dim[u];
- chunk_dim[u] = layout->u.chunk.dim[u];
- shrunk_dim[u] = (space_dim[u] < old_dim[u]);
+ chunk_dim[u] = layout->u.chunk.dim[u];
+ shrunk_dim[u] = (space_dim[u] < old_dim[u]);
} /* end for */
/* Create a dataspace for a chunk & set the extent */
if(NULL == (chunk_space = H5S_create_simple(space_ndims, chunk_dim, NULL)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
/* Reset hyperslab start array */
/* (hyperslabs will always start from origin) */
@@ -5166,11 +5200,11 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
} /* end if */
else
dims_outside_fill[u] = FALSE;
- } /* end if */
+ } /* end if */
carry = FALSE;
while(!carry) {
- int i; /* Local index variable */
+ int i; /* Local index variable */
udata.common.scaled = scaled;
@@ -5231,7 +5265,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
/* Remove the chunk from disk, if present */
if(H5F_addr_defined(chk_udata.chunk_block.offset)) {
/* Update the offset in idx_udata */
- idx_udata.scaled = udata.common.scaled;
+ idx_udata.scaled = udata.common.scaled;
/* Remove the chunk from disk */
if((layout->storage.u.chunk.ops->remove)(&idx_info, &idx_udata) < 0)
@@ -5299,16 +5333,16 @@ done:
} /* end H5D__chunk_prune_by_extent() */
#ifdef H5_HAVE_PARALLEL
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_addrmap_cb
+ * Function: H5D__chunk_addrmap_cb
*
* Purpose: Callback when obtaining the chunk addresses for all existing chunks
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Kent Yang
+ * Programmer: Kent Yang
* Tuesday, November 15, 2005
*
*-------------------------------------------------------------------------
@@ -5316,7 +5350,7 @@ done:
static int
H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
{
- H5D_chunk_it_ud2_t *udata = (H5D_chunk_it_ud2_t *)_udata; /* User data for callback */
+ H5D_chunk_it_ud2_t *udata = (H5D_chunk_it_ud2_t *)_udata; /* User data for callback */
unsigned rank = udata->common.layout->ndims - 1; /* # of dimensions of dataset */
hsize_t chunk_index;
int ret_value = H5_ITER_CONT; /* Return value */
@@ -5333,14 +5367,14 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__chunk_addrmap_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_addrmap
+ * Function: H5D__chunk_addrmap
*
* Purpose: Obtain the chunk addresses for all existing chunks
*
- * Return: Success: Non-negative on succeed.
- * Failure: negative value
+ * Return: Success: Non-negative on succeed.
+ * Failure: negative value
*
* Programmer: Kent Yang
* November 15, 2005
@@ -5352,7 +5386,7 @@ H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[])
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
const H5D_t *dset = io_info->dset; /* Local pointer to dataset info */
- H5D_chunk_it_ud2_t udata; /* User data for iteration callback */
+ H5D_chunk_it_ud2_t udata; /* User data for iteration callback */
H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk);
herr_t ret_value = SUCCEED; /* Return value */
@@ -5384,16 +5418,16 @@ done:
} /* end H5D__chunk_addrmap() */
#endif /* H5_HAVE_PARALLEL */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_delete
+ * Function: H5D__chunk_delete
*
- * Purpose: Delete raw data storage for entire dataset (i.e. all chunks)
+ * Purpose: Delete raw data storage for entire dataset (i.e. all chunks)
*
- * Return: Success: Non-negative
- * Failure: negative
+ * Return: Success: Non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, March 20, 2003
*
*-------------------------------------------------------------------------
@@ -5406,7 +5440,7 @@ H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage)
hbool_t layout_read = FALSE; /* Whether the layout message was read from the file */
H5O_pline_t pline; /* I/O pipeline message */
hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read from the file */
- htri_t exists; /* Flag if header message of interest exists */
+ htri_t exists; /* Flag if header message of interest exists */
H5O_storage_chunk_t *sc = &(storage->u.chunk);
herr_t ret_value = SUCCEED; /* Return value */
@@ -5462,17 +5496,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_delete() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_update_cache
+ * Function: H5D__chunk_update_cache
*
- * Purpose: Update any cached chunks index values after the dataspace
+ * Purpose: Update any cached chunks index values after the dataspace
* size has changed
*
- * Return: Success: Non-negative
- * Failure: negative
+ * Return: Success: Non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, May 29, 2004
*
*-------------------------------------------------------------------------
@@ -5480,8 +5514,8 @@ done:
herr_t
H5D__chunk_update_cache(H5D_t *dset)
{
- H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */
- H5D_rdcc_ent_t *ent, *next; /*cache entry */
+ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */
+ H5D_rdcc_ent_t *ent, *next; /*cache entry */
H5D_rdcc_ent_t tmp_head; /* Sentinel entry for temporary entry list */
H5D_rdcc_ent_t *tmp_tail; /* Tail pointer for temporary entry list */
herr_t ret_value = SUCCEED; /* Return value */
@@ -5502,7 +5536,7 @@ H5D__chunk_update_cache(H5D_t *dset)
/* Recompute the index for each cached chunk that is in a dataset */
for(ent = rdcc->head; ent; ent = next) {
- unsigned old_idx; /* Previous index number */
+ unsigned old_idx; /* Previous index number */
/* Get the pointer to the next cache entry */
next = ent->next;
@@ -5512,7 +5546,7 @@ H5D__chunk_update_cache(H5D_t *dset)
ent->idx = H5D__chunk_hash_val(dset->shared, ent->scaled);
if(old_idx != ent->idx) {
- H5D_rdcc_ent_t *old_ent; /* Old cache entry */
+ H5D_rdcc_ent_t *old_ent; /* Old cache entry */
/* Check if there is already a chunk at this chunk's new location */
old_ent = rdcc->slot[ent->idx];
@@ -5575,7 +5609,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_update_cache() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__chunk_copy_cb
*
@@ -5624,7 +5658,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
if(pline && pline->nused) {
must_filter = TRUE;
if( (udata->common.layout->flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) &&
- (H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, udata->common.layout->dim,
+ (H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, udata->common.layout->dim,
chunk_rec->scaled, udata->dset_dims)) )
must_filter = FALSE;
}
@@ -5789,8 +5823,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
udata->chunk_in_cache = FALSE;
- udata_dst.chunk_idx = H5VM_array_offset_pre(udata_dst.common.layout->ndims - 1,
- udata_dst.common.layout->max_down_chunks, udata_dst.common.scaled);
+ udata_dst.chunk_idx = H5VM_array_offset_pre(udata_dst.common.layout->ndims - 1,
+ udata_dst.common.layout->max_down_chunks, udata_dst.common.scaled);
/* Allocate chunk in the file */
if(H5D__chunk_file_alloc(udata->idx_info_dst, NULL, &udata_dst.chunk_block, &need_insert, udata_dst.common.scaled) < 0)
@@ -5816,17 +5850,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_copy_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_copy
+ * Function: H5D__chunk_copy
*
- * Purpose: Copy chunked storage from SRC file to DST file.
+ * Purpose: Copy chunked storage from SRC file to DST file.
*
- * Return: Success: Non-negative
- * Failure: negative
+ * Return: Success: Non-negative
+ * Failure: negative
*
* Programmer: Peter Cao
- * August 20, 2005
+ * August 20, 2005
*
*-------------------------------------------------------------------------
*/
@@ -6100,7 +6134,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_copy() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__chunk_bh_info
*
@@ -6160,18 +6194,18 @@ H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout,
/* Allocate any indexing structures */
if(layout->storage.u.chunk.ops->init && (layout->storage.u.chunk.ops->init)(&idx_info, space, loc->addr) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information")
idx_info_init = TRUE;
/* Get size of index structure */
if(layout->storage.u.chunk.ops->size && (layout->storage.u.chunk.ops->size)(&idx_info, index_size) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve chunk index info")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve chunk index info")
done:
/* Free resources, if they've been initialized */
if(idx_info_init && layout->storage.u.chunk.ops->dest &&
(layout->storage.u.chunk.ops->dest)(&idx_info) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
+ HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
if(pline_read && H5O_msg_reset(H5O_PLINE_ID, &pline) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset I/O pipeline message")
if(space && H5S_close(space) < 0)
@@ -6180,18 +6214,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_bh_info() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_dump_index_cb
+ * Function: H5D__chunk_dump_index_cb
*
- * Purpose: If the UDATA.STREAM member is non-null then debugging
+ * Purpose: If the UDATA.STREAM member is non-null then debugging
* information is written to that stream.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 21, 1999
*
*-------------------------------------------------------------------------
@@ -6199,7 +6233,7 @@ done:
static int
H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
{
- H5D_chunk_it_ud4_t *udata = (H5D_chunk_it_ud4_t *)_udata; /* User data from caller */
+ H5D_chunk_it_ud4_t *udata = (H5D_chunk_it_ud4_t *)_udata; /* User data from caller */
FUNC_ENTER_STATIC_NOERR
@@ -6225,17 +6259,17 @@ H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
FUNC_LEAVE_NOAPI(H5_ITER_CONT)
} /* H5D__chunk_dump_index_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_dump_index
+ * Function: H5D__chunk_dump_index
*
- * Purpose: Prints information about the storage index to the specified
- * stream.
+ * Purpose: Prints information about the storage index to the specified
+ * stream.
*
- * Return: Success: Non-negative
- * Failure: negative
+ * Return: Success: Non-negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 28, 1999
*
*-------------------------------------------------------------------------
@@ -6283,17 +6317,17 @@ done:
} /* end H5D__chunk_dump_index() */
#ifdef H5D_CHUNK_DEBUG
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__chunk_stats
+ * Function: H5D__chunk_stats
*
- * Purpose: Print raw data cache statistics to the debug stream. If
- * HEADERS is non-zero then print table column headers,
- * otherwise assume that the H5AC layer has already printed them.
+ * Purpose: Print raw data cache statistics to the debug stream. If
+ * HEADERS is non-zero then print table column headers,
+ * otherwise assume that the H5AC layer has already printed them.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, May 21, 1998
*
*-------------------------------------------------------------------------
@@ -6301,9 +6335,9 @@ done:
herr_t
H5D__chunk_stats(const H5D_t *dset, hbool_t headers)
{
- H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk);
- double miss_rate;
- char ascii[32];
+ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk);
+ double miss_rate;
+ char ascii[32];
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE_NOERR
@@ -6312,10 +6346,10 @@ H5D__chunk_stats(const H5D_t *dset, hbool_t headers)
HGOTO_DONE(SUCCEED)
if (headers) {
- fprintf(H5DEBUG(AC), "H5D: raw data cache statistics\n");
- fprintf(H5DEBUG(AC), " %-18s %8s %8s %8s %8s+%-8s\n",
+ HDfprintf(H5DEBUG(AC), "H5D: raw data cache statistics\n");
+ HDfprintf(H5DEBUG(AC), " %-18s %8s %8s %8s %8s+%-8s\n",
"Layer", "Hits", "Misses", "MissRate", "Inits", "Flushes");
- fprintf(H5DEBUG(AC), " %-18s %8s %8s %8s %8s-%-8s\n",
+ HDfprintf(H5DEBUG(AC), " %-18s %8s %8s %8s %8s-%-8s\n",
"-----", "----", "------", "--------", "-----", "-------");
}
@@ -6331,12 +6365,12 @@ H5D__chunk_stats(const H5D_t *dset, hbool_t headers)
miss_rate = 0.0;
}
if (miss_rate > 100) {
- sprintf(ascii, "%7d%%", (int) (miss_rate + 0.5));
+ HDsprintf(ascii, "%7d%%", (int) (miss_rate + 0.5));
} else {
- sprintf(ascii, "%7.2f%%", miss_rate);
+ HDsprintf(ascii, "%7.2f%%", miss_rate);
}
- fprintf(H5DEBUG(AC), " %-18s %8u %8u %7s %8d+%-9ld\n",
+ HDfprintf(H5DEBUG(AC), " %-18s %8u %8u %7s %8d+%-9ld\n",
"raw data chunks", rdcc->stats.nhits, rdcc->stats.nmisses, ascii,
rdcc->stats.ninits, (long)(rdcc->stats.nflushes)-(long)(rdcc->stats.ninits));
}
@@ -6346,22 +6380,22 @@ done:
} /* end H5D__chunk_stats() */
#endif /* H5D_CHUNK_DEBUG */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__nonexistent_readvv_cb
+ * Function: H5D__nonexistent_readvv_cb
*
- * Purpose: Callback operation for performing fill value I/O operation
+ * Purpose: Callback operation for performing fill value I/O operation
* on memory buffer.
*
- * Note: This algorithm is pretty inefficient about initializing and
+ * Note: This algorithm is pretty inefficient about initializing and
* terminating the fill buffer info structure and it would be
* faster to refactor this into a "real" initialization routine,
* and a "vectorized fill" routine. -QAK
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * 30 Sep 2010
+ * Programmer: Quincey Koziol
+ * 30 Sep 2010
*
*-------------------------------------------------------------------------
*/
@@ -6395,24 +6429,24 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__nonexistent_readvv_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__nonexistent_readvv
+ * Function: H5D__nonexistent_readvv
*
- * Purpose: When the chunk doesn't exist on disk and the chunk is bigger
+ * Purpose: When the chunk doesn't exist on disk and the chunk is bigger
* than the cache size, performs fill value I/O operation on
* memory buffer, advancing through two I/O vectors, until one
* runs out.
*
- * Note: This algorithm is pretty inefficient about initializing and
+ * Note: This algorithm is pretty inefficient about initializing and
* terminating the fill buffer info structure and it would be
* faster to refactor this into a "real" initialization routine,
* and a "vectorized fill" routine. -QAK
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * 6 Feb 2009
+ * Programmer: Raymond Lu
+ * 6 Feb 2009
*
*-------------------------------------------------------------------------
*/
@@ -6449,7 +6483,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__nonexistent_readvv() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__chunk_is_partial_edge_chunk
*
@@ -6488,14 +6522,14 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__chunk_is_partial_edge_chunk() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__chunk_file_alloc()
*
- * Purpose: Chunk allocation:
- * Create the chunk if it doesn't exist, or reallocate the
+ * Purpose: Chunk allocation:
+ * Create the chunk if it doesn't exist, or reallocate the
* chunk if its size changed.
- * The coding is moved and modified from each index structure.
+ * The coding is moved and modified from each index structure.
*
* Return: Non-negative on success/Negative on failure
*
@@ -6507,8 +6541,8 @@ herr_t
H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old_chunk,
H5F_block_t *new_chunk, hbool_t *need_insert, hsize_t scaled[])
{
- hbool_t alloc_chunk = FALSE; /* Whether to allocate chunk */
- herr_t ret_value = SUCCEED; /* Return value */
+ hbool_t alloc_chunk = FALSE; /* Whether to allocate chunk */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -6526,7 +6560,7 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old
/* Check for filters on chunks */
if(idx_info->pline->nused > 0) {
/* Sanity/error checking block */
- HDassert(idx_info->storage->idx_type != H5D_CHUNK_IDX_NONE);
+ HDassert(idx_info->storage->idx_type != H5D_CHUNK_IDX_NONE);
{
unsigned allow_chunk_size_len; /* Allowed size of encoded chunk size */
unsigned new_chunk_size_len; /* Size of encoded chunk size */
@@ -6548,37 +6582,37 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old
HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk size can't be encoded")
} /* end block */
- if(old_chunk && H5F_addr_defined(old_chunk->offset)) {
- /* Sanity check */
+ if(old_chunk && H5F_addr_defined(old_chunk->offset)) {
+ /* Sanity check */
HDassert(!H5F_addr_defined(new_chunk->offset) || H5F_addr_eq(new_chunk->offset, old_chunk->offset));
/* Check for chunk being same size */
- if(new_chunk->length != old_chunk->length) {
- /* Release previous chunk */
- /* Only free the old location if not doing SWMR writes - otherwise
+ if(new_chunk->length != old_chunk->length) {
+ /* Release previous chunk */
+ /* Only free the old location if not doing SWMR writes - otherwise
* we must keep the old chunk around in case a reader has an
* outdated version of the B-tree node
*/
- if(!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE))
- if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, old_chunk->offset, old_chunk->length) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk")
- alloc_chunk = TRUE;
- } /* end if */
+ if(!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE))
+ if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, old_chunk->offset, old_chunk->length) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk")
+ alloc_chunk = TRUE;
+ } /* end if */
else {
- /* Don't need to reallocate chunk, but send its address back up */
+ /* Don't need to reallocate chunk, but send its address back up */
if(!H5F_addr_defined(new_chunk->offset))
new_chunk->offset = old_chunk->offset;
- } /* end else */
- } /* end if */
+ } /* end else */
+ } /* end if */
else {
HDassert(!H5F_addr_defined(new_chunk->offset));
- alloc_chunk = TRUE;
+ alloc_chunk = TRUE;
} /* end else */
} /* end if */
else {
- HDassert(!H5F_addr_defined(new_chunk->offset));
- HDassert(new_chunk->length == idx_info->layout->size);
- alloc_chunk = TRUE;
+ HDassert(!H5F_addr_defined(new_chunk->offset));
+ HDassert(new_chunk->length == idx_info->layout->size);
+ alloc_chunk = TRUE;
} /* end else */
/* Actually allocate space for the chunk in the file */
@@ -6618,11 +6652,11 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old
HDassert(H5F_addr_defined(new_chunk->offset));
-done:
+done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__chunk_file_alloc() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__chunk_format_convert_cb
*
@@ -6640,13 +6674,13 @@ done:
static int
H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
{
- H5D_chunk_it_ud5_t *udata = (H5D_chunk_it_ud5_t *)_udata; /* User data */
- H5D_chk_idx_info_t *new_idx_info; /* The new chunk index information */
- H5D_chunk_ud_t insert_udata; /* Chunk information to be inserted */
- haddr_t chunk_addr; /* Chunk address */
- size_t nbytes; /* Chunk size */
- void *buf = NULL; /* Pointer to buffer of chunk data */
- int ret_value = H5_ITER_CONT; /* Return value */
+ H5D_chunk_it_ud5_t *udata = (H5D_chunk_it_ud5_t *)_udata; /* User data */
+ H5D_chk_idx_info_t *new_idx_info; /* The new chunk index information */
+ H5D_chunk_ud_t insert_udata; /* Chunk information to be inserted */
+ haddr_t chunk_addr; /* Chunk address */
+ size_t nbytes; /* Chunk size */
+ void *buf = NULL; /* Pointer to buffer of chunk data */
+ int ret_value = H5_ITER_CONT; /* Return value */
FUNC_ENTER_STATIC
@@ -6664,7 +6698,7 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
unsigned filter_mask = chunk_rec->filter_mask;
H5Z_cb_t filter_cb; /* Filter failure callback struct */
- size_t read_size = nbytes; /* Bytes to read */
+ size_t read_size = nbytes; /* Bytes to read */
HDassert(read_size == new_idx_info->layout->size);
@@ -6719,12 +6753,12 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__chunk_format_convert_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__chunk_format_convert
*
* Purpose: Iterate over the chunks for the current chunk index and insert the
- * the chunk addresses into v1 B-tree chunk index via callback.
+ * the chunk addresses into v1 B-tree chunk index via callback.
*
* Return: Non-negative on success/Negative on failure
*
@@ -6736,7 +6770,7 @@ done:
herr_t
H5D__chunk_format_convert(H5D_t *dset, H5D_chk_idx_info_t *idx_info, H5D_chk_idx_info_t *new_idx_info)
{
- H5D_chunk_it_ud5_t udata; /* User data */
+ H5D_chunk_it_ud5_t udata; /* User data */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -6751,13 +6785,13 @@ H5D__chunk_format_convert(H5D_t *dset, H5D_chk_idx_info_t *idx_info, H5D_chk_idx
/* terate over the chunks in the current index and insert the chunk addresses into version 1 B-tree index */
if((idx_info->storage->ops->iterate)(idx_info, H5D__chunk_format_convert_cb, &udata) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk index to chunk info")
+ HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk index to chunk info")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_format_convert() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__get_num_chunks_cb
*
@@ -6789,7 +6823,7 @@ H5D__get_num_chunks_cb(const H5D_chunk_rec_t H5_ATTR_UNUSED *chunk_rec, void *_u
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__get_num_chunks_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__get_num_chunks
*
@@ -6854,7 +6888,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__get_num_chunks() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__get_chunk_info_cb
*
@@ -6900,7 +6934,7 @@ H5D__get_chunk_info_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__get_chunk_info_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__get_chunk_info
*
@@ -6990,7 +7024,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__get_chunk_info() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__get_chunk_info_by_coord_cb
*
@@ -7038,7 +7072,7 @@ H5D__get_chunk_info_by_coord_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__get_chunk_info_by_coord_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__get_chunk_info_by_coord
*
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c
index c0c2a80..651aaf4 100644
--- a/src/H5Dcompact.c
+++ b/src/H5Dcompact.c
@@ -80,6 +80,7 @@ const H5D_layout_ops_t H5D_LOPS_COMPACT[1] = {{
H5D__compact_construct,
NULL,
H5D__compact_is_space_alloc,
+ NULL,
H5D__compact_io_init,
H5D__contig_read,
H5D__contig_write,
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index ad12ba0..c2e9bfc 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -118,6 +118,7 @@ const H5D_layout_ops_t H5D_LOPS_CONTIG[1] = {{
H5D__contig_construct,
H5D__contig_init,
H5D__contig_is_space_alloc,
+ H5D__contig_is_data_cached,
H5D__contig_io_init,
H5D__contig_read,
H5D__contig_write,
@@ -538,6 +539,30 @@ H5D__contig_is_space_alloc(const H5O_storage_t *storage)
/*-------------------------------------------------------------------------
+ * Function: H5D__contig_is_data_cached
+ *
+ * Purpose: Query if raw data is cached for dataset
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Neil Fortner
+ * Wednessday, March 6, 2016
+ *
+ *-------------------------------------------------------------------------
+ */
+hbool_t
+H5D__contig_is_data_cached(const H5D_shared_t *shared_dset)
+{
+ FUNC_ENTER_PACKAGE_NOERR
+
+ /* Sanity checks */
+ HDassert(shared_dset);
+
+ FUNC_LEAVE_NOAPI(shared_dset->cache.contig.sieve_size > 0)
+} /* end H5D__contig_is_data_cached() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5D__contig_io_init
*
* Purpose: Performs initialization before any sort of I/O on the raw data
diff --git a/src/H5Dearray.c b/src/H5Dearray.c
index a20145a..e77d968 100644
--- a/src/H5Dearray.c
+++ b/src/H5Dearray.c
@@ -11,10 +11,10 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
- * Tuesday, January 27, 2009
+/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Tuesday, January 27, 2009
*
- * Purpose: Extensible array indexed (chunked) I/O functions. The chunks
+ * Purpose: Extensible array indexed (chunked) I/O functions. The chunks
* are given a single-dimensional index which is used as the
* offset in an extensible array that maps a chunk coordinate to
* a disk address.
@@ -31,13 +31,13 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Dpkg.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5EAprivate.h" /* Extensible arrays */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5MFprivate.h" /* File space management */
-#include "H5VMprivate.h" /* Vector functions */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dpkg.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5EAprivate.h" /* Extensible arrays */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5MFprivate.h" /* File space management */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -182,7 +182,7 @@ const H5EA_class_t H5EA_CLS_CHUNK[1]={{
H5D__earray_fill, /* Fill block of missing elements callback */
H5D__earray_encode, /* Element encoding callback */
H5D__earray_decode, /* Element decoding callback */
- H5D__earray_debug, /* Element debugging callback */
+ H5D__earray_debug, /* Element debugging callback */
H5D__earray_crt_dbg_context, /* Create debugging context */
H5D__earray_dst_dbg_context /* Destroy debugging context */
}};
@@ -213,16 +213,16 @@ H5FL_DEFINE_STATIC(H5D_earray_ctx_t);
H5FL_DEFINE_STATIC(H5D_earray_ctx_ud_t);
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_crt_context
+ * Function: H5D__earray_crt_context
*
- * Purpose: Create context for callbacks
+ * Purpose: Create context for callbacks
*
- * Return: Success: non-NULL
- * Failure: NULL
+ * Return: Success: non-NULL
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 29, 2009
*
*-------------------------------------------------------------------------
@@ -262,16 +262,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_crt_context() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_dst_context
+ * Function: H5D__earray_dst_context
*
- * Purpose: Destroy context for callbacks
+ * Purpose: Destroy context for callbacks
*
- * Return: Success: non-NULL
- * Failure: NULL
+ * Return: Success: non-NULL
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 29, 2009
*
*-------------------------------------------------------------------------
@@ -292,16 +292,16 @@ H5D__earray_dst_context(void *_ctx)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_dst_context() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_fill
+ * Function: H5D__earray_fill
*
- * Purpose: Fill "missing elements" in block of elements
+ * Purpose: Fill "missing elements" in block of elements
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, January 27, 2009
*
*-------------------------------------------------------------------------
@@ -322,16 +322,16 @@ H5D__earray_fill(void *nat_blk, size_t nelmts)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_fill() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_encode
+ * Function: H5D__earray_encode
*
- * Purpose: Encode an element from "native" to "raw" form
+ * Purpose: Encode an element from "native" to "raw" form
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, January 27, 2009
*
*-------------------------------------------------------------------------
@@ -366,16 +366,16 @@ H5D__earray_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_encode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_decode
+ * Function: H5D__earray_decode
*
- * Purpose: Decode an element from "raw" to "native" form
+ * Purpose: Decode an element from "raw" to "native" form
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 29, 2009
*
*-------------------------------------------------------------------------
@@ -410,16 +410,16 @@ H5D__earray_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_decode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_debug
+ * Function: H5D__earray_debug
*
- * Purpose: Display an element for debugging
+ * Purpose: Display an element for debugging
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 29, 2009
*
*-------------------------------------------------------------------------
@@ -437,23 +437,23 @@ H5D__earray_debug(FILE *stream, int indent, int fwidth, hsize_t idx,
HDassert(elmt);
/* Print element */
- sprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
+ HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, temp_str,
*(const haddr_t *)elmt);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_debug() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_filt_fill
+ * Function: H5D__earray_filt_fill
*
- * Purpose: Fill "missing elements" in block of elements
+ * Purpose: Fill "missing elements" in block of elements
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 31, 2009
*
*-------------------------------------------------------------------------
@@ -475,16 +475,16 @@ H5D__earray_filt_fill(void *nat_blk, size_t nelmts)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_filt_fill() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_filt_encode
+ * Function: H5D__earray_filt_encode
*
- * Purpose: Encode an element from "native" to "raw" form
+ * Purpose: Encode an element from "native" to "raw" form
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 31, 2009
*
*-------------------------------------------------------------------------
@@ -522,16 +522,16 @@ H5D__earray_filt_encode(void *_raw, const void *_elmt, size_t nelmts, void *_ctx
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_filt_encode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_filt_decode
+ * Function: H5D__earray_filt_decode
*
- * Purpose: Decode an element from "raw" to "native" form
+ * Purpose: Decode an element from "raw" to "native" form
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 31, 2009
*
*-------------------------------------------------------------------------
@@ -568,16 +568,16 @@ H5D__earray_filt_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_filt_decode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_filt_debug
+ * Function: H5D__earray_filt_debug
*
- * Purpose: Display an element for debugging
+ * Purpose: Display an element for debugging
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 31, 2009
*
*-------------------------------------------------------------------------
@@ -596,31 +596,31 @@ H5D__earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx,
HDassert(elmt);
/* Print element */
- sprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
+ HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
HDfprintf(stream, "%*s%-*s {%a, %u, %0x}\n", indent, "", fwidth, temp_str,
elmt->addr, elmt->nbytes, elmt->filter_mask);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_filt_debug() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_crt_dbg_context
+ * Function: H5D__earray_crt_dbg_context
*
- * Purpose: Create context for debugging callback
- * (get the layout message in the specified object header)
+ * Purpose: Create context for debugging callback
+ * (get the layout message in the specified object header)
*
- * Return: Success: non-NULL
- * Failure: NULL
+ * Return: Success: non-NULL
+ * Failure: NULL
+ *
+ * Programmer: Vailin Choi; July 2010
*
- * Programmer: Vailin Choi; July 2010
- *
*-------------------------------------------------------------------------
*/
static void *
H5D__earray_crt_dbg_context(H5F_t *f, haddr_t obj_addr)
{
- H5D_earray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */
+ H5D_earray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */
H5O_loc_t obj_loc; /* Pointer to an object's location */
hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */
H5O_layout_t layout; /* Layout message */
@@ -677,24 +677,24 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_crt_dbg_context() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_dst_dbg_context
+ * Function: H5D__earray_dst_dbg_context
*
- * Purpose: Destroy context for debugging callback
- * (free the layout message from the specified object header)
+ * Purpose: Destroy context for debugging callback
+ * (free the layout message from the specified object header)
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi; July 2010
+ * Programmer: Vailin Choi; July 2010
*
*-------------------------------------------------------------------------
*/
static herr_t
H5D__earray_dst_dbg_context(void *_dbg_ctx)
{
- H5D_earray_ctx_ud_t *dbg_ctx = (H5D_earray_ctx_ud_t *)_dbg_ctx; /* Context for extensible array callback */
+ H5D_earray_ctx_ud_t *dbg_ctx = (H5D_earray_ctx_ud_t *)_dbg_ctx; /* Context for extensible array callback */
FUNC_ENTER_STATIC_NOERR
@@ -707,18 +707,18 @@ H5D__earray_dst_dbg_context(void *_dbg_ctx)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_dst_dbg_context() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_depend
+ * Function: H5D__earray_idx_depend
*
- * Purpose: Create flush dependency between extensible array and dataset's
+ * Purpose: Create flush dependency between extensible array and dataset's
* object header.
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
- * Tuesday, June 2, 2009
+ * Programmer: Quincey Koziol
+ * Tuesday, June 2, 2009
*
*-------------------------------------------------------------------------
*/
@@ -769,22 +769,22 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_idx_depend() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_open
+ * Function: H5D__earray_idx_open
*
- * Purpose: Opens an existing extensible array.
+ * Purpose: Opens an existing extensible array.
*
- * Note: This information is passively initialized from each index
+ * Note: This information is passively initialized from each index
* operation callback because those abstract chunk index operations
* are designed to work with the v1 B-tree chunk indices also,
* which don't require an 'open' for the data structure.
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
- * Thursday, January 29, 2009
+ * Programmer: Quincey Koziol
+ * Thursday, January 29, 2009
*
*-------------------------------------------------------------------------
*/
@@ -813,7 +813,7 @@ H5D__earray_idx_open(const H5D_chk_idx_info_t *idx_info)
/* Open the extensible array for the chunk index */
if(NULL == (idx_info->storage->u.earray.ea = H5EA_open(idx_info->f, idx_info->storage->idx_addr, &udata)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open extensible array")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open extensible array")
/* Check for SWMR writes to the file */
if(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)
@@ -824,15 +824,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_idx_open() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_init
+ * Function: H5D__earray_idx_init
*
- * Purpose: Initialize the indexing information for a dataset.
+ * Purpose: Initialize the indexing information for a dataset.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, May 27, 2009
*
*-------------------------------------------------------------------------
@@ -861,7 +861,7 @@ H5D__earray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space,
/* Get the dim info for dataset */
if((sndims = H5S_get_simple_extent_dims(space, NULL, max_dims)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataspace dimensions")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataspace dimensions")
H5_CHECKED_ASSIGN(ndims, unsigned, sndims, int);
/* Find the rank of the unlimited dimension */
@@ -892,22 +892,22 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_idx_init() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_create
+ * Function: H5D__earray_idx_create
*
- * Purpose: Creates a new indexed-storage extensible array and initializes
+ * Purpose: Creates a new indexed-storage extensible array and initializes
* the layout struct with information about the storage. The
- * struct should be immediately written to the object header.
+ * struct should be immediately written to the object header.
*
- * This function must be called before passing LAYOUT to any of
- * the other indexed storage functions!
+ * This function must be called before passing LAYOUT to any of
+ * the other indexed storage functions!
*
- * Return: Non-negative on success (with the LAYOUT argument initialized
- * and ready to write to an object header). Negative on failure.
+ * Return: Non-negative on success (with the LAYOUT argument initialized
+ * and ready to write to an object header). Negative on failure.
*
- * Programmer: Quincey Koziol
- * Tuesday, January 27, 2009
+ * Programmer: Quincey Koziol
+ * Tuesday, January 27, 2009
*
*-------------------------------------------------------------------------
*/
@@ -932,7 +932,7 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info)
/* General parameters */
if(idx_info->pline->nused > 0) {
unsigned chunk_size_len; /* Size of encoded chunk size */
-
+
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
*/
@@ -964,11 +964,11 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info)
/* Create the extensible array for the chunk index */
if(NULL == (idx_info->storage->u.earray.ea = H5EA_create(idx_info->f, &cparam, &udata)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create extensible array")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create extensible array")
/* Get the address of the extensible array in file */
if(H5EA_get_addr(idx_info->storage->u.earray.ea, &(idx_info->storage->idx_addr)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array address")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array address")
/* Check for SWMR writes to the file */
if(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)
@@ -979,16 +979,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_idx_create() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_is_space_alloc
+ * Function: H5D__earray_idx_is_space_alloc
*
- * Purpose: Query if space is allocated for index method
+ * Purpose: Query if space is allocated for index method
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, January 29, 2009
+ * Programmer: Quincey Koziol
+ * Thursday, January 29, 2009
*
*-------------------------------------------------------------------------
*/
@@ -1003,15 +1003,15 @@ H5D__earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
FUNC_LEAVE_NOAPI((hbool_t)H5F_addr_defined(storage->idx_addr))
} /* end H5D__earray_idx_is_space_alloc() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_insert
+ * Function: H5D__earray_idx_insert
*
- * Purpose: Insert chunk address into the indexing structure.
+ * Purpose: Insert chunk address into the indexing structure.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi; May 2014
+ * Programmer: Vailin Choi; May 2014
*
*-------------------------------------------------------------------------
*/
@@ -1020,7 +1020,7 @@ H5D__earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata
const H5D_t H5_ATTR_UNUSED *dset)
{
H5EA_t *ea; /* Pointer to extensible array structure */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1045,43 +1045,43 @@ H5D__earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata
ea = idx_info->storage->u.earray.ea;
if(!H5F_addr_defined(udata->chunk_block.offset))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "The chunk should have allocated already")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "The chunk should have allocated already")
if(udata->chunk_idx != (udata->chunk_idx & 0xffffffff)) /* negative value */
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "chunk index must be less than 2^32")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "chunk index must be less than 2^32")
/* Check for filters on chunks */
if(idx_info->pline->nused > 0) {
- H5D_earray_filt_elmt_t elmt; /* Extensible array element */
+ H5D_earray_filt_elmt_t elmt; /* Extensible array element */
- elmt.addr = udata->chunk_block.offset;
+ elmt.addr = udata->chunk_block.offset;
H5_CHECKED_ASSIGN(elmt.nbytes, uint32_t, udata->chunk_block.length, hsize_t);
- elmt.filter_mask = udata->filter_mask;
+ elmt.filter_mask = udata->filter_mask;
- /* Set the info for the chunk */
- if(H5EA_set(ea, udata->chunk_idx, &elmt) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk info")
+ /* Set the info for the chunk */
+ if(H5EA_set(ea, udata->chunk_idx, &elmt) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk info")
} /* end if */
else {
- /* Set the address for the chunk */
- if(H5EA_set(ea, udata->chunk_idx, &udata->chunk_block.offset) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk address")
+ /* Set the address for the chunk */
+ if(H5EA_set(ea, udata->chunk_idx, &udata->chunk_block.offset) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk address")
} /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__earray_idx_insert() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_get_addr
+ * Function: H5D__earray_idx_get_addr
*
- * Purpose: Get the file address of a chunk if file space has been
- * assigned. Save the retrieved information in the udata
- * supplied.
+ * Purpose: Get the file address of a chunk if file space has been
+ * assigned. Save the retrieved information in the udata
+ * supplied.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 29, 2009
*
*-------------------------------------------------------------------------
@@ -1091,7 +1091,7 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda
{
H5EA_t *ea; /* Pointer to extensible array structure */
hsize_t idx; /* Array index of chunk */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1117,13 +1117,13 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda
/* Check for unlimited dim. not being the slowest-changing dim. */
if(idx_info->layout->u.earray.unlim_dim > 0) {
- hsize_t swizzled_coords[H5O_LAYOUT_NDIMS]; /* swizzled chunk coordinates */
+ hsize_t swizzled_coords[H5O_LAYOUT_NDIMS]; /* swizzled chunk coordinates */
unsigned ndims = (idx_info->layout->ndims - 1); /* Number of dimensions */
- unsigned u;
+ unsigned u;
- /* Compute coordinate offset from scaled offset */
- for(u = 0; u < ndims; u++)
- swizzled_coords[u] = udata->common.scaled[u] * idx_info->layout->dim[u];
+ /* Compute coordinate offset from scaled offset */
+ for(u = 0; u < ndims; u++)
+ swizzled_coords[u] = udata->common.scaled[u] * idx_info->layout->dim[u];
H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
@@ -1156,27 +1156,27 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address")
/* Update the other (constant) information for the chunk */
- udata->chunk_block.length = idx_info->layout->size;
+ udata->chunk_block.length = idx_info->layout->size;
udata->filter_mask = 0;
} /* end else */
if(!H5F_addr_defined(udata->chunk_block.offset))
- udata->chunk_block.length = 0;
+ udata->chunk_block.length = 0;
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__earray_idx_get_addr() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_resize
+ * Function: H5D__earray_idx_resize
*
- * Purpose: Calculate/setup the swizzled down chunk array, used for chunk
+ * Purpose: Calculate/setup the swizzled down chunk array, used for chunk
* index calculations.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, July 23, 2009
*
*-------------------------------------------------------------------------
@@ -1221,15 +1221,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_idx_resize() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_iterate_cb
+ * Function: H5D__earray_idx_iterate_cb
*
- * Purpose: Callback routine for extensible array element iteration.
+ * Purpose: Callback routine for extensible array element iteration.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi; Feb 2015
+ * Programmer: Vailin Choi; Feb 2015
*
*-------------------------------------------------------------------------
*/
@@ -1256,8 +1256,8 @@ H5D__earray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *
/* Make "generic chunk" callback */
if(H5F_addr_defined(udata->chunk_rec.chunk_addr))
- if((ret_value = (udata->cb)(&udata->chunk_rec, udata->udata)) < 0)
- HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback");
+ if((ret_value = (udata->cb)(&udata->chunk_rec, udata->udata)) < 0)
+ HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback");
/* Update coordinates of chunk in dataset */
ndims = udata->common.layout->ndims - 1;
@@ -1280,20 +1280,20 @@ H5D__earray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__earray_idx_iterate_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_iterate
+ * Function: H5D__earray_idx_iterate
*
- * Purpose: Iterate over the chunks in an index, making a callback
+ * Purpose: Iterate over the chunks in an index, making a callback
* for each one.
*
- * Note: This implementation is slow, particularly for sparse
+ * Note: This implementation is slow, particularly for sparse
* extensible arrays, replace it with call to H5EA_iterate()
* when that's available.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 29, 2009
*
*-------------------------------------------------------------------------
@@ -1331,42 +1331,42 @@ H5D__earray_idx_iterate(const H5D_chk_idx_info_t *idx_info,
/* Get the extensible array statistics */
if(H5EA_get_stats(ea, &ea_stat) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array statistics")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array statistics")
if(ea_stat.stored.max_idx_set > 0) {
H5D_earray_it_ud_t udata; /* User data for iteration callback */
- /* Initialize userdata */
- HDmemset(&udata, 0, sizeof udata);
- udata.common.layout = idx_info->layout;
- udata.common.storage = idx_info->storage;
+ /* Initialize userdata */
+ HDmemset(&udata, 0, sizeof udata);
+ udata.common.layout = idx_info->layout;
+ udata.common.storage = idx_info->storage;
HDmemset(&udata.chunk_rec, 0, sizeof(udata.chunk_rec));
udata.filtered = (idx_info->pline->nused > 0);
if(!udata.filtered) {
udata.chunk_rec.nbytes = idx_info->layout->size;
udata.chunk_rec.filter_mask = 0;
} /* end if */
- udata.cb = chunk_cb;
- udata.udata = chunk_udata;
-
+ udata.cb = chunk_cb;
+ udata.udata = chunk_udata;
+
/* Iterate over the extensible array elements */
- if((ret_value = H5EA_iterate(ea, H5D__earray_idx_iterate_cb, &udata)) < 0)
- HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index");
+ if((ret_value = H5EA_iterate(ea, H5D__earray_idx_iterate_cb, &udata)) < 0)
+ HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index");
} /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_idx_iterate() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_remove
+ * Function: H5D__earray_idx_remove
*
- * Purpose: Remove chunk from index.
+ * Purpose: Remove chunk from index.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 29, 2009
*
*-------------------------------------------------------------------------
@@ -1376,7 +1376,7 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t
{
H5EA_t *ea; /* Pointer to extensible array structure */
hsize_t idx; /* Array index of chunk */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1403,13 +1403,13 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t
/* Check for unlimited dim. not being the slowest-changing dim. */
if(idx_info->layout->u.earray.unlim_dim > 0) {
- hsize_t swizzled_coords[H5O_LAYOUT_NDIMS]; /* swizzled chunk coordinates */
+ hsize_t swizzled_coords[H5O_LAYOUT_NDIMS]; /* swizzled chunk coordinates */
unsigned ndims = (idx_info->layout->ndims - 1); /* Number of dimensions */
- unsigned u;
+ unsigned u;
- /* Compute coordinate offset from scaled offset */
- for(u = 0; u < ndims; u++)
- swizzled_coords[u] = udata->scaled[u] * idx_info->layout->dim[u];
+ /* Compute coordinate offset from scaled offset */
+ for(u = 0; u < ndims; u++)
+ swizzled_coords[u] = udata->scaled[u] * idx_info->layout->dim[u];
H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
@@ -1469,16 +1469,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__earray_idx_remove() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_delete_cb
+ * Function: H5D__earray_idx_delete_cb
*
- * Purpose: Delete space for chunk in file
+ * Purpose: Delete space for chunk in file
*
- * Return: Success: Non-negative
- * Failure: negative
+ * Return: Success: Non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 31, 2009
*
*-------------------------------------------------------------------------
@@ -1506,21 +1506,21 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_idx_delete_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_delete
+ * Function: H5D__earray_idx_delete
*
- * Purpose: Delete index and raw data storage for entire dataset
+ * Purpose: Delete index and raw data storage for entire dataset
* (i.e. all chunks)
*
- * Note: This implementation is slow, particularly for sparse
+ * Note: This implementation is slow, particularly for sparse
* extensible arrays, replace it with call to H5EA_iterate()
* when that's available.
*
- * Return: Success: Non-negative
- * Failure: negative
+ * Return: Success: Non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 29, 2009
*
*-------------------------------------------------------------------------
@@ -1568,15 +1568,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_idx_delete() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_copy_setup
+ * Function: H5D__earray_idx_copy_setup
*
- * Purpose: Set up any necessary information for copying chunks
+ * Purpose: Set up any necessary information for copying chunks
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 31, 2009
*
*-------------------------------------------------------------------------
@@ -1623,15 +1623,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_idx_copy_setup() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_copy_shutdown
+ * Function: H5D__earray_idx_copy_shutdown
*
- * Purpose: Shutdown any information from copying chunks
+ * Purpose: Shutdown any information from copying chunks
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 31, 2009
*
*-------------------------------------------------------------------------
@@ -1662,7 +1662,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_idx_copy_shutdown() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__earray_idx_size
*
@@ -1703,7 +1703,7 @@ H5D__earray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
/* Get the extensible array statistics */
if(H5EA_get_stats(ea, &ea_stat) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array statistics")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array statistics")
/* Set the size of the extensible array */
*index_size = ea_stat.computed.hdr_size + ea_stat.computed.index_blk_size
@@ -1719,15 +1719,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_idx_size() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_reset
+ * Function: H5D__earray_idx_reset
*
- * Purpose: Reset indexing information.
+ * Purpose: Reset indexing information.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 31, 2009
*
*-------------------------------------------------------------------------
@@ -1742,7 +1742,7 @@ H5D__earray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
/* Reset index info */
if(reset_addr) {
- storage->idx_addr = HADDR_UNDEF;
+ storage->idx_addr = HADDR_UNDEF;
storage->u.earray.dset_ohdr_addr = HADDR_UNDEF;
} /* end if */
storage->u.earray.ea = NULL;
@@ -1750,15 +1750,15 @@ H5D__earray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_idx_reset() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_dump
+ * Function: H5D__earray_idx_dump
*
- * Purpose: Dump indexing information to a stream.
+ * Purpose: Dump indexing information to a stream.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 31, 2009
*
*-------------------------------------------------------------------------
@@ -1777,15 +1777,15 @@ H5D__earray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_idx_dump() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__earray_idx_dest
+ * Function: H5D__earray_idx_dest
*
- * Purpose: Release indexing information in memory.
+ * Purpose: Release indexing information in memory.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 31, 2009
*
*-------------------------------------------------------------------------
@@ -1805,7 +1805,7 @@ H5D__earray_idx_dest(const H5D_chk_idx_info_t *idx_info)
/* Check if the extensible array is open */
if(idx_info->storage->u.earray.ea) {
- /* Patch the top level file pointer contained in ea if needed */
+ /* Patch the top level file pointer contained in ea if needed */
if(H5EA_patch_file(idx_info->storage->u.earray.ea, idx_info->f) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch earray file pointer")
diff --git a/src/H5Defl.c b/src/H5Defl.c
index b2f9b29..ce0bb80 100644
--- a/src/H5Defl.c
+++ b/src/H5Defl.c
@@ -91,6 +91,7 @@ const H5D_layout_ops_t H5D_LOPS_EFL[1] = {{
H5D__efl_construct,
NULL,
H5D__efl_is_space_alloc,
+ NULL,
H5D__efl_io_init,
H5D__contig_read,
H5D__contig_write,
@@ -476,7 +477,6 @@ H5D__efl_readvv(const H5D_io_info_t *io_info,
HDassert(io_info->u.rbuf);
HDassert(io_info->dset);
HDassert(io_info->dset->shared);
- HDassert(io_info->dset->shared->extfile_prefix);
HDassert(dset_curr_seq);
HDassert(dset_len_arr);
HDassert(dset_off_arr);
@@ -560,7 +560,6 @@ H5D__efl_writevv(const H5D_io_info_t *io_info,
HDassert(io_info->u.wbuf);
HDassert(io_info->dset);
HDassert(io_info->dset->shared);
- HDassert(io_info->dset->shared->extfile_prefix);
HDassert(dset_curr_seq);
HDassert(dset_len_arr);
HDassert(dset_off_arr);
diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c
index 372ae26..5972f10 100644
--- a/src/H5Dfarray.c
+++ b/src/H5Dfarray.c
@@ -11,12 +11,12 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Vailin Choi <vchoi@hdfgroup.org>
- * Thursday, April 30, 2009
+/* Programmer: Vailin Choi <vchoi@hdfgroup.org>
+ * Thursday, April 30, 2009
*
- * Purpose: Fixed array indexed (chunked) I/O functions.
- * The chunk coordinate is mapped as an index into an array of
- * disk addresses for the chunks.
+ * Purpose: Fixed array indexed (chunked) I/O functions.
+ * The chunk coordinate is mapped as an index into an array of
+ * disk addresses for the chunks.
*
*/
@@ -30,13 +30,13 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Dpkg.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FAprivate.h" /* Fixed arrays */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5MFprivate.h" /* File space management */
-#include "H5VMprivate.h" /* Vector functions */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dpkg.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FAprivate.h" /* Fixed arrays */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5MFprivate.h" /* File space management */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -210,16 +210,16 @@ H5FL_DEFINE_STATIC(H5D_farray_ctx_t);
/* Declare a free list to manage the H5D_farray_ctx_ud_t struct */
H5FL_DEFINE_STATIC(H5D_farray_ctx_ud_t);
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_crt_context
+ * Function: H5D__farray_crt_context
*
- * Purpose: Create context for callbacks
+ * Purpose: Create context for callbacks
*
- * Return: Success: non-NULL
- * Failure: NULL
+ * Return: Success: non-NULL
+ * Failure: NULL
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -259,16 +259,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__farray_crt_context() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_dst_context
+ * Function: H5D__farray_dst_context
*
- * Purpose: Destroy context for callbacks
+ * Purpose: Destroy context for callbacks
*
- * Return: Success: non-NULL
- * Failure: NULL
+ * Return: Success: non-NULL
+ * Failure: NULL
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -289,16 +289,16 @@ H5D__farray_dst_context(void *_ctx)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_dst_context() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_fill
+ * Function: H5D__farray_fill
*
- * Purpose: Fill "missing elements" in block of elements
+ * Purpose: Fill "missing elements" in block of elements
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -319,16 +319,16 @@ H5D__farray_fill(void *nat_blk, size_t nelmts)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_fill() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_encode
+ * Function: H5D__farray_encode
*
- * Purpose: Encode an element from "native" to "raw" form
+ * Purpose: Encode an element from "native" to "raw" form
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -363,16 +363,16 @@ H5D__farray_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_encode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_decode
+ * Function: H5D__farray_decode
*
- * Purpose: Decode an element from "raw" to "native" form
+ * Purpose: Decode an element from "raw" to "native" form
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -407,16 +407,16 @@ H5D__farray_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_decode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_debug
+ * Function: H5D__farray_debug
*
- * Purpose: Display an element for debugging
+ * Purpose: Display an element for debugging
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -434,32 +434,32 @@ H5D__farray_debug(FILE *stream, int indent, int fwidth, hsize_t idx,
HDassert(elmt);
/* Print element */
- sprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
+ HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, temp_str,
*(const haddr_t *)elmt);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_debug() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_crt_dbg_context
+ * Function: H5D__farray_crt_dbg_context
*
- * Purpose: Create context for debugging callback
- * (get the layout message in the specified object header)
+ * Purpose: Create context for debugging callback
+ * (get the layout message in the specified object header)
*
- * Return: Success: non-NULL
- * Failure: NULL
+ * Return: Success: non-NULL
+ * Failure: NULL
*
- * Programmer: Vailin Choi
- * 5th August, 2009
+ * Programmer: Vailin Choi
+ * 5th August, 2009
*
*-------------------------------------------------------------------------
*/
static void *
H5D__farray_crt_dbg_context(H5F_t *f, haddr_t obj_addr)
{
- H5D_farray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */
+ H5D_farray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */
H5O_loc_t obj_loc; /* Pointer to an object's location */
hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */
H5O_layout_t layout; /* Layout message */
@@ -516,25 +516,25 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__farray_crt_dbg_context() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_dst_dbg_context
+ * Function: H5D__farray_dst_dbg_context
*
- * Purpose: Destroy context for debugging callback
- * (free the layout message from the specified object header)
+ * Purpose: Destroy context for debugging callback
+ * (free the layout message from the specified object header)
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
- * 24th September, 2009
+ * Programmer: Quincey Koziol
+ * 24th September, 2009
*
*-------------------------------------------------------------------------
*/
static herr_t
H5D__farray_dst_dbg_context(void *_dbg_ctx)
{
- H5D_farray_ctx_ud_t *dbg_ctx = (H5D_farray_ctx_ud_t *)_dbg_ctx; /* Context for fixed array callback */
+ H5D_farray_ctx_ud_t *dbg_ctx = (H5D_farray_ctx_ud_t *)_dbg_ctx; /* Context for fixed array callback */
FUNC_ENTER_STATIC_NOERR
@@ -547,16 +547,16 @@ H5D__farray_dst_dbg_context(void *_dbg_ctx)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_dst_dbg_context() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_filt_fill
+ * Function: H5D__farray_filt_fill
*
- * Purpose: Fill "missing elements" in block of elements
+ * Purpose: Fill "missing elements" in block of elements
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -578,16 +578,16 @@ H5D__farray_filt_fill(void *nat_blk, size_t nelmts)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_filt_fill() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_filt_encode
+ * Function: H5D__farray_filt_encode
*
- * Purpose: Encode an element from "native" to "raw" form
+ * Purpose: Encode an element from "native" to "raw" form
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -612,7 +612,7 @@ H5D__farray_filt_encode(void *_raw, const void *_elmt, size_t nelmts, void *_ctx
/* Encode element */
/* (advances 'raw' pointer) */
H5F_addr_encode_len(ctx->file_addr_len, &raw, elmt->addr);
- UINT64ENCODE_VAR(raw, elmt->nbytes, ctx->chunk_size_len);
+ UINT64ENCODE_VAR(raw, elmt->nbytes, ctx->chunk_size_len);
UINT32ENCODE(raw, elmt->filter_mask);
/* Advance native element pointer */
@@ -625,16 +625,16 @@ H5D__farray_filt_encode(void *_raw, const void *_elmt, size_t nelmts, void *_ctx
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_filt_encode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_filt_decode
+ * Function: H5D__farray_filt_decode
*
- * Purpose: Decode an element from "raw" to "native" form
+ * Purpose: Decode an element from "raw" to "native" form
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -658,7 +658,7 @@ H5D__farray_filt_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx
/* Decode element */
/* (advances 'raw' pointer) */
H5F_addr_decode_len(ctx->file_addr_len, &raw, &elmt->addr);
- UINT64DECODE_VAR(raw, elmt->nbytes, ctx->chunk_size_len);
+ UINT64DECODE_VAR(raw, elmt->nbytes, ctx->chunk_size_len);
UINT32DECODE(raw, elmt->filter_mask);
/* Advance native element pointer */
@@ -671,16 +671,16 @@ H5D__farray_filt_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_filt_decode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_filt_debug
+ * Function: H5D__farray_filt_debug
*
- * Purpose: Display an element for debugging
+ * Purpose: Display an element for debugging
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -699,24 +699,24 @@ H5D__farray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx,
HDassert(elmt);
/* Print element */
- sprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
+ HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
HDfprintf(stream, "%*s%-*s {%a, %u, %0x}\n", indent, "", fwidth, temp_str,
elmt->addr, elmt->nbytes, elmt->filter_mask);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_filt_debug() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_depend
+ * Function: H5D__farray_idx_depend
*
- * Purpose: Create flush dependency between fixed array and dataset's
+ * Purpose: Create flush dependency between fixed array and dataset's
* object header.
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -768,7 +768,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__farray_idx_depend() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__farray_idx_init
*
@@ -796,17 +796,17 @@ H5D__farray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t H5_ATTR_UNU
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_idx_init() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_open
+ * Function: H5D__farray_idx_open
*
- * Purpose: Opens an existing fixed array and initializes
+ * Purpose: Opens an existing fixed array and initializes
* the layout struct with information about the storage.
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -836,7 +836,7 @@ H5D__farray_idx_open(const H5D_chk_idx_info_t *idx_info)
/* Open the fixed array for the chunk index */
if(NULL == (idx_info->storage->u.farray.fa = H5FA_open(idx_info->f, idx_info->storage->idx_addr, &udata)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open fixed array")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open fixed array")
/* Check for SWMR writes to the file */
if(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)
@@ -847,21 +847,21 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__farray_idx_open() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_create
+ * Function: H5D__farray_idx_create
*
- * Purpose: Creates a new indexed-storage fixed array and initializes
+ * Purpose: Creates a new indexed-storage fixed array and initializes
* the layout struct with information about the storage. The
- * struct should be immediately written to the object header.
+ * struct should be immediately written to the object header.
*
- * This function must be called before passing LAYOUT to any of
- * the other indexed storage functions!
+ * This function must be called before passing LAYOUT to any of
+ * the other indexed storage functions!
*
- * Return: Non-negative on success (with the LAYOUT argument initialized
- * and ready to write to an object header). Negative on failure.
+ * Return: Non-negative on success (with the LAYOUT argument initialized
+ * and ready to write to an object header). Negative on failure.
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -869,9 +869,9 @@ done:
static herr_t
H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info)
{
- H5FA_create_t cparam; /* Fixed array creation parameters */
+ H5FA_create_t cparam; /* Fixed array creation parameters */
H5D_farray_ctx_ud_t udata; /* User data for fixed array create call */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -887,7 +887,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info)
/* General parameters */
if(idx_info->pline->nused > 0) {
- unsigned chunk_size_len; /* Size of encoded chunk size */
+ unsigned chunk_size_len; /* Size of encoded chunk size */
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
@@ -910,14 +910,14 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info)
/* Set up the user data */
udata.f = idx_info->f;
udata.chunk_size = idx_info->layout->size;
-
+
/* Create the fixed array for the chunk index */
if(NULL == (idx_info->storage->u.farray.fa = H5FA_create(idx_info->f, &cparam, &udata)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create fixed array")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create fixed array")
/* Get the address of the fixed array in file */
if(H5FA_get_addr(idx_info->storage->u.farray.fa, &(idx_info->storage->idx_addr)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array address")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array address")
/* Check for SWMR writes to the file */
if(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)
@@ -928,15 +928,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__farray_idx_create() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_is_space_alloc
+ * Function: H5D__farray_idx_is_space_alloc
*
- * Purpose: Query if space is allocated for index method
+ * Purpose: Query if space is allocated for index method
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -952,24 +952,24 @@ H5D__farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
FUNC_LEAVE_NOAPI((hbool_t)H5F_addr_defined(storage->idx_addr))
} /* end H5D__farray_idx_is_space_alloc() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_insert
+ * Function: H5D__farray_idx_insert
*
- * Purpose: Insert chunk address into the indexing structure.
+ * Purpose: Insert chunk address into the indexing structure.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; 5 May 2014
*
- * Programmer: Vailin Choi; 5 May 2014
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata,
const H5D_t H5_ATTR_UNUSED *dset)
{
- H5FA_t *fa; /* Pointer to fixed array structure */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5FA_t *fa; /* Pointer to fixed array structure */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -988,7 +988,7 @@ H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata
if(H5D__farray_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open fixed array")
} else /* Patch the top level file pointer contained in fa if needed */
- H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f);
+ H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f);
/* Set convenience pointer to fixed array structure */
fa = idx_info->storage->u.farray.fa;
@@ -1002,13 +1002,13 @@ H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata
if(idx_info->pline->nused > 0) {
H5D_farray_filt_elmt_t elmt; /* Fixed array element */
- elmt.addr = udata->chunk_block.offset;
+ elmt.addr = udata->chunk_block.offset;
H5_CHECKED_ASSIGN(elmt.nbytes, uint32_t, udata->chunk_block.length, hsize_t);
elmt.filter_mask = udata->filter_mask;
/* Set the info for the chunk */
if(H5FA_set(fa, udata->chunk_idx, &elmt) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk info")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk info")
} /* end if */
else {
/* Set the address for the chunk */
@@ -1020,17 +1020,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__farray_idx_insert() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_get_addr
+ * Function: H5D__farray_idx_get_addr
*
- * Purpose: Get the file address of a chunk if file space has been
- * assigned. Save the retrieved information in the udata
- * supplied.
+ * Purpose: Get the file address of a chunk if file space has been
+ * assigned. Save the retrieved information in the udata
+ * supplied.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -1038,9 +1038,9 @@ done:
static herr_t
H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
{
- H5FA_t *fa; /* Pointer to fixed array structure */
- hsize_t idx; /* Array index of chunk */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5FA_t *fa; /* Pointer to fixed array structure */
+ hsize_t idx; /* Array index of chunk */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1059,7 +1059,7 @@ H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda
if(H5D__farray_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open fixed array")
} else /* Patch the top level file pointer contained in fa if needed */
- H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f);
+ H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f);
/* Set convenience pointer to fixed array structure */
fa = idx_info->storage->u.farray.fa;
@@ -1088,26 +1088,26 @@ H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address")
/* Update the other (constant) information for the chunk */
- udata->chunk_block.length = idx_info->layout->size;
+ udata->chunk_block.length = idx_info->layout->size;
udata->filter_mask = 0;
} /* end else */
if(!H5F_addr_defined(udata->chunk_block.offset))
- udata->chunk_block.length = 0;
+ udata->chunk_block.length = 0;
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__farray_idx_get_addr() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_iterate_cb
+ * Function: H5D__farray_idx_iterate_cb
*
- * Purpose: Callback routine for fixed array element iteration.
+ * Purpose: Callback routine for fixed array element iteration.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -1135,8 +1135,8 @@ H5D__farray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *
/* Make "generic chunk" callback */
if(H5F_addr_defined(udata->chunk_rec.chunk_addr))
- if((ret_value = (udata->cb)(&udata->chunk_rec, udata->udata)) < 0)
- HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback");
+ if((ret_value = (udata->cb)(&udata->chunk_rec, udata->udata)) < 0)
+ HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback");
/* Update coordinates of chunk in dataset */
ndims = udata->common.layout->ndims - 1;
@@ -1159,16 +1159,16 @@ H5D__farray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__farray_idx_iterate_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_iterate
+ * Function: H5D__farray_idx_iterate
*
- * Purpose: Iterate over the chunks in an index, making a callback
+ * Purpose: Iterate over the chunks in an index, making a callback
* for each one.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -1199,50 +1199,50 @@ H5D__farray_idx_iterate(const H5D_chk_idx_info_t *idx_info,
if(H5D__farray_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open fixed array")
} else /* Patch the top level file pointer contained in fa if needed */
- H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f);
+ H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f);
/* Set convenience pointer to fixed array structure */
fa = idx_info->storage->u.farray.fa;
/* Get the fixed array statistics */
if(H5FA_get_stats(fa, &fa_stat) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array statistics")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array statistics")
/* Check if there are any array elements */
if(fa_stat.nelmts > 0) {
H5D_farray_it_ud_t udata; /* User data for iteration callback */
- /* Initialize userdata */
- HDmemset(&udata, 0, sizeof udata);
- udata.common.layout = idx_info->layout;
- udata.common.storage = idx_info->storage;
+ /* Initialize userdata */
+ HDmemset(&udata, 0, sizeof udata);
+ udata.common.layout = idx_info->layout;
+ udata.common.storage = idx_info->storage;
HDmemset(&udata.chunk_rec, 0, sizeof(udata.chunk_rec));
udata.filtered = (idx_info->pline->nused > 0);
if(!udata.filtered) {
udata.chunk_rec.nbytes = idx_info->layout->size;
udata.chunk_rec.filter_mask = 0;
} /* end if */
- udata.cb = chunk_cb;
- udata.udata = chunk_udata;
-
+ udata.cb = chunk_cb;
+ udata.udata = chunk_udata;
+
/* Iterate over the fixed array elements */
- if((ret_value = H5FA_iterate(fa, H5D__farray_idx_iterate_cb, &udata)) < 0)
- HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index");
+ if((ret_value = H5FA_iterate(fa, H5D__farray_idx_iterate_cb, &udata)) < 0)
+ HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index");
} /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__farray_idx_iterate() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_remove
+ * Function: H5D__farray_idx_remove
*
- * Purpose: Remove chunk from index.
+ * Purpose: Remove chunk from index.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -1250,9 +1250,9 @@ done:
static herr_t
H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata)
{
- H5FA_t *fa; /* Pointer to fixed array structure */
- hsize_t idx; /* Array index of chunk */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5FA_t *fa; /* Pointer to fixed array structure */
+ hsize_t idx; /* Array index of chunk */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1271,7 +1271,7 @@ H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t
if(H5D__farray_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open fixed array")
} else /* Patch the top level file pointer contained in fa if needed */
- if(H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f) < 0)
+ if(H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch fixed array file pointer")
/* Set convenience pointer to fixed array structure */
@@ -1328,16 +1328,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__farray_idx_remove() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_delete_cb
+ * Function: H5D__farray_idx_delete_cb
*
- * Purpose: Delete space for chunk in file
+ * Purpose: Delete space for chunk in file
*
- * Return: Success: Non-negative
- * Failure: negative
+ * Return: Success: Non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -1365,17 +1365,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__farray_idx_delete_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_delete
+ * Function: H5D__farray_idx_delete
*
- * Purpose: Delete index and raw data storage for entire dataset
+ * Purpose: Delete index and raw data storage for entire dataset
* (i.e. all chunks)
*
- * Return: Success: Non-negative
- * Failure: negative
+ * Return: Success: Non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -1398,7 +1398,7 @@ H5D__farray_idx_delete(const H5D_chk_idx_info_t *idx_info)
if(H5F_addr_defined(idx_info->storage->idx_addr)) {
H5D_farray_ctx_ud_t ctx_udata; /* User data for fixed array open call */
- /* Iterate over the chunk addresses in the fixed array, deleting each chunk */
+ /* Iterate over the chunk addresses in the fixed array, deleting each chunk */
if(H5D__farray_idx_iterate(idx_info, H5D__farray_idx_delete_cb, idx_info->f) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk addresses")
@@ -1423,15 +1423,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__farray_idx_delete() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_copy_setup
+ * Function: H5D__farray_idx_copy_setup
*
- * Purpose: Set up any necessary information for copying chunks
+ * Purpose: Set up any necessary information for copying chunks
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -1478,15 +1478,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__farray_idx_copy_setup() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_copy_shutdown
+ * Function: H5D__farray_idx_copy_shutdown
*
- * Purpose: Shutdown any information from copying chunks
+ * Purpose: Shutdown any information from copying chunks
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -1517,7 +1517,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__farray_idx_copy_shutdown() */
-
+
/*-------------------------------------------------------------------------
* Function: H5D__farray_idx_size
*
@@ -1526,7 +1526,7 @@ done:
* Return: Success: Non-negative
* Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -1558,7 +1558,7 @@ H5D__farray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
/* Get the fixed array statistics */
if(H5FA_get_stats(fa, &fa_stat) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array statistics")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array statistics")
*index_size = fa_stat.hdr_size;
*index_size += fa_stat.dblk_size;
@@ -1573,15 +1573,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__farray_idx_size() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_reset
+ * Function: H5D__farray_idx_reset
*
- * Purpose: Reset indexing information.
+ * Purpose: Reset indexing information.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -1596,21 +1596,21 @@ H5D__farray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
/* Reset index info */
if(reset_addr)
- storage->idx_addr = HADDR_UNDEF;
+ storage->idx_addr = HADDR_UNDEF;
storage->u.farray.fa = NULL;
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_idx_reset() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_dump
+ * Function: H5D__farray_idx_dump
*
- * Purpose: Dump indexing information to a stream.
+ * Purpose: Dump indexing information to a stream.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -1629,15 +1629,15 @@ H5D__farray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_idx_dump() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5D__farray_idx_dest
+ * Function: H5D__farray_idx_dest
*
- * Purpose: Release indexing information in memory.
+ * Purpose: Release indexing information in memory.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -1657,8 +1657,8 @@ H5D__farray_idx_dest(const H5D_chk_idx_info_t *idx_info)
/* Check if the fixed array is open */
if(idx_info->storage->u.farray.fa) {
- /* Patch the top level file pointer contained in fa if needed */
- if(H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f) < 0)
+ /* Patch the top level file pointer contained in fa if needed */
+ if(H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch fixed array file pointer")
/* Close fixed array */
diff --git a/src/H5Dint.c b/src/H5Dint.c
index ea4245b..6b7cb2c 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -48,14 +48,14 @@
/********************/
/* General stuff */
-static H5D_shared_t *H5D__new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type);
+static H5D_shared_t *H5D__new(hid_t dcpl_id, hid_t dapl_id, hbool_t creating, hbool_t vl_type);
static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id,
const H5T_t *type);
static herr_t H5D__cache_dataspace_info(const H5D_t *dset);
static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space);
static herr_t H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id);
-static herr_t H5D__build_file_prefix(const H5D_t *dset, hid_t dapl_id,
- const char *prefix_type, char **file_prefix);
+static herr_t H5D__build_file_prefix(const H5D_t *dset, H5F_prefix_open_t prefix_type,
+ char **file_prefix);
static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id);
static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite,
hsize_t old_dim[]);
@@ -112,6 +112,10 @@ static const H5I_class_t H5I_DATASET_CLS[1] = {{
/* Flag indicating "top" of interface has been initialized */
static hbool_t H5D_top_package_initialize_s = FALSE;
+/* Prefixes of VDS and external file from the environment variables
+ * HDF5_EXTFILE_PREFIX and HDF5_VDS_PREFIX */
+const static char *H5D_prefix_ext_env = NULL;
+const static char *H5D_prefix_vds_env = NULL;
/*-------------------------------------------------------------------------
@@ -188,6 +192,10 @@ H5D__init_package(void)
/* Mark "top" of interface as initialized, too */
H5D_top_package_initialize_s = TRUE;
+ /* Retrieve the prefixes of VDS and external file from the environment variable */
+ H5D_prefix_vds_env = HDgetenv("HDF5_VDS_PREFIX");
+ H5D_prefix_ext_env = HDgetenv("HDF5_EXTFILE_PREFIX");
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__init_package() */
@@ -420,7 +428,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5D_shared_t *
-H5D__new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type)
+H5D__new(hid_t dcpl_id, hid_t dapl_id, hbool_t creating, hbool_t vl_type)
{
H5D_shared_t *new_dset = NULL; /* New dataset object */
H5P_genplist_t *plist; /* Property list created */
@@ -451,6 +459,22 @@ H5D__new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type)
new_dset->dcpl_id = H5P_copy_plist(plist, FALSE);
} /* end else */
+ /* Set the DCPL for the API context */
+ H5CX_set_dcpl(new_dset->dcpl_id);
+
+ if(!vl_type && creating && dapl_id == H5P_DATASET_ACCESS_DEFAULT) {
+ if(H5I_inc_ref(dapl_id, FALSE) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't increment default DAPL ID")
+ new_dset->dapl_id = dapl_id;
+ } /* end if */
+ else {
+ /* Get the property list */
+ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dapl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list")
+
+ new_dset->dapl_id = H5P_copy_plist(plist, FALSE);
+ } /* end else */
+
/* Set return value */
ret_value = new_dset;
@@ -459,6 +483,8 @@ done:
if(new_dset != NULL) {
if(new_dset->dcpl_id != 0 && H5I_dec_ref(new_dset->dcpl_id) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "can't decrement temporary datatype ID")
+ if(new_dset->dapl_id != 0 && H5I_dec_ref(new_dset->dapl_id) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "can't decrement temporary datatype ID")
new_dset = H5FL_FREE(H5D_shared_t, new_dset);
} /* end if */
@@ -649,11 +675,9 @@ H5D__use_minimized_dset_headers(H5F_t *file, H5D_t *dset, hbool_t *minimize)
HDassert(dset);
HDassert(minimize);
- plist = H5P_object_verify(dset->shared->dcpl_id, H5P_DATASET_CREATE);
- if(NULL == plist)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "problem getting dcpl")
- if(H5P_get(plist, H5D_CRT_MIN_DSET_HDR_SIZE_NAME, minimize) == FAIL)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get minimize value from dcpl")
+ /* Get the dataset object header minimize flag for this call */
+ if(H5CX_get_dset_min_ohdr_flag(minimize) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset object header minimize flag from API context")
if(FALSE == *minimize)
*minimize = H5F_get_min_dset_ohdr(file);
@@ -1045,8 +1069,7 @@ done:
*--------------------------------------------------------------------------
*/
static herr_t
-H5D__build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type,
- char **file_prefix /*out*/)
+H5D__build_file_prefix(const H5D_t *dset, H5F_prefix_open_t prefix_type, char **file_prefix /*out*/)
{
char *prefix = NULL; /* prefix used to look for the file */
char *filepath = NULL; /* absolute path of directory the HDF5 file is in */
@@ -1067,20 +1090,22 @@ H5D__build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type
/* XXX: Future thread-safety note - getenv is not required
* to be reentrant.
*/
- if(HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0)
- prefix = HDgetenv("HDF5_VDS_PREFIX");
- else if (HDstrcmp(prefix_type, H5D_ACS_EFILE_PREFIX_NAME) == 0)
- prefix = HDgetenv("HDF5_EXTFILE_PREFIX");
- else
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "prefix name is not sensible")
-
- if(prefix == NULL || *prefix == '\0') {
- /* Set prefix to value of prefix_type property */
- if(NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
- if(H5P_peek(plist, prefix_type, &prefix) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file prefix")
- } /* end if */
+ if(H5F_PREFIX_VDS == prefix_type) {
+ prefix = (char *)H5D_prefix_vds_env;
+
+ if(prefix == NULL || *prefix == '\0') {
+ if(H5CX_get_vds_prefix(&prefix) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get the prefix for vds file")
+ }
+ } else if(H5F_PREFIX_EFILE == prefix_type) {
+ prefix = (char *)H5D_prefix_ext_env;
+
+ if(prefix == NULL || *prefix == '\0') {
+ if(H5CX_get_ext_file_prefix(&prefix) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get the prefix for the external file")
+ }
+ } else
+ HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "prefix name is not sensible")
/* Prefix has to be checked for NULL / empty string again because the
* code above might have updated it.
@@ -1089,8 +1114,7 @@ H5D__build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type
/* filename is interpreted as relative to the current directory,
* does not need to be expanded
*/
- if(NULL == (*file_prefix = (char *)H5MM_strdup("")))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ *file_prefix = NULL;
} /* end if */
else {
if (HDstrncmp(prefix, "${ORIGIN}", HDstrlen("${ORIGIN}")) == 0) {
@@ -1179,7 +1203,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id,
H5G_loc_reset(&dset_loc);
/* Initialize the shared dataset space */
- if(NULL == (new_dset->shared = H5D__new(dcpl_id, TRUE, has_vl_type)))
+ if(NULL == (new_dset->shared = H5D__new(dcpl_id, dapl_id, TRUE, has_vl_type)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Copy & initialize datatype for dataset */
@@ -1274,22 +1298,22 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id,
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to construct layout information")
/* Update the dataset's object header info. */
- if(H5D__update_oh_info(file, new_dset, dapl_id) < 0)
+ if(H5D__update_oh_info(file, new_dset, new_dset->shared->dapl_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't update the metadata cache")
/* Indicate that the layout information was initialized */
layout_init = TRUE;
/* Set up append flush parameters for the dataset */
- if(H5D__append_flush_setup(new_dset, dapl_id) < 0)
+ if(H5D__append_flush_setup(new_dset, new_dset->shared->dapl_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property")
/* Set the external file prefix */
- if(H5D__build_file_prefix(new_dset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &new_dset->shared->extfile_prefix) < 0)
+ if(H5D__build_file_prefix(new_dset, H5F_PREFIX_EFILE, &new_dset->shared->extfile_prefix) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix")
/* Set the VDS file prefix */
- if(H5D__build_file_prefix(new_dset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &new_dset->shared->vds_prefix) < 0)
+ if(H5D__build_file_prefix(new_dset, H5F_PREFIX_VDS, &new_dset->shared->vds_prefix) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize VDS prefix")
/* Add the dataset to the list of opened objects in the file */
@@ -1336,6 +1360,8 @@ done:
} /* end if */
if(new_dset->shared->dcpl_id != 0 && H5I_dec_ref(new_dset->shared->dcpl_id) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list")
+ if(new_dset->shared->dapl_id != 0 && H5I_dec_ref(new_dset->shared->dapl_id) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list")
new_dset->shared->extfile_prefix = (char *)H5MM_xfree(new_dset->shared->extfile_prefix);
new_dset->shared->vds_prefix = (char *)H5MM_xfree(new_dset->shared->vds_prefix);
new_dset->shared = H5FL_FREE(H5D_shared_t, new_dset->shared);
@@ -1444,11 +1470,11 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy path")
/* Get the external file prefix */
- if(H5D__build_file_prefix(dataset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &extfile_prefix) < 0)
+ if(H5D__build_file_prefix(dataset, H5F_PREFIX_EFILE, &extfile_prefix) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix")
/* Get the VDS prefix */
- if(H5D__build_file_prefix(dataset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &vds_prefix) < 0)
+ if(H5D__build_file_prefix(dataset, H5F_PREFIX_VDS, &vds_prefix) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize VDS prefix")
/* Check if dataset was already open */
@@ -1492,8 +1518,13 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id)
/* Check whether the external file prefix of the already open dataset
* matches the new external file prefix
*/
- if(HDstrcmp(extfile_prefix, dataset->shared->extfile_prefix) != 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, NULL, "new external file prefix does not match external file prefix of already open dataset")
+ if(extfile_prefix && dataset->shared->extfile_prefix) {
+ if(HDstrcmp(extfile_prefix, dataset->shared->extfile_prefix) != 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, NULL, "new external file prefix does not match external file prefix of already open dataset")
+ } else {
+ if(extfile_prefix || dataset->shared->extfile_prefix)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, NULL, "new external file prefix does not match external file prefix of already open dataset")
+ }
/* Check if the object has been opened through the top file yet */
if(H5FO_top_count(dataset->oloc.file, dataset->oloc.addr) == 0) {
@@ -1635,7 +1666,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id)
HDassert(dataset);
/* (Set the 'vl_type' parameter to FALSE since it doesn't matter from here) */
- if(NULL == (dataset->shared = H5D__new(H5P_DATASET_CREATE_DEFAULT, FALSE, FALSE)))
+ if(NULL == (dataset->shared = H5D__new(H5P_DATASET_CREATE_DEFAULT, dapl_id, FALSE, FALSE)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Open the dataset object */
@@ -1947,13 +1978,13 @@ H5D_close(H5D_t *dataset)
if(H5AC_cork(dataset->oloc.file, dataset->oloc.addr, H5AC__UNCORK, NULL) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTUNCORK, FAIL, "unable to uncork an object")
- /*
- * Release datatype, dataspace and creation property list -- there isn't
+ /* Release datatype, dataspace, creation and access property lists -- there isn't
* much we can do if one of these fails, so we just continue.
*/
free_failed |= (H5I_dec_ref(dataset->shared->type_id) < 0) ||
(H5S_close(dataset->shared->space) < 0) ||
- (H5I_dec_ref(dataset->shared->dcpl_id) < 0);
+ (H5I_dec_ref(dataset->shared->dcpl_id) < 0) ||
+ (H5I_dec_ref(dataset->shared->dapl_id) < 0);
/* Remove the dataset from the list of opened objects in the file */
if(H5FO_top_decr(dataset->oloc.file, dataset->oloc.addr) < 0)
@@ -2878,7 +2909,8 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size)
*-------------------------------------------------------------------------
*/
if(H5D_CHUNKED == dset->shared->layout.type) {
- if(shrink && (*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage))
+ if(shrink && ((*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)
+ || (dset->shared->layout.ops->is_data_cached && (*dset->shared->layout.ops->is_data_cached)(dset->shared))))
/* Remove excess chunks */
if(H5D__chunk_prune_by_extent(dset, curr_dims) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to remove chunks")
@@ -3465,22 +3497,26 @@ done:
hid_t
H5D_get_access_plist(const H5D_t *dset)
{
- H5P_genplist_t *old_plist; /* Default DAPL */
+ H5P_genplist_t *old_plist; /* Stored DAPL from dset */
H5P_genplist_t *new_plist; /* New DAPL */
+ H5P_genplist_t *def_fapl; /* Default FAPL */
+ H5D_append_flush_t def_append_flush_info = {0}; /* Default append flush property */
+ H5D_rdcc_t def_chunk_info; /* Default chunk cache property */
hid_t new_dapl_id = FAIL;
hid_t ret_value = FAIL;
FUNC_ENTER_NOAPI_NOINIT
- /* Make a copy of the default dataset access property list */
- if(NULL == (old_plist = (H5P_genplist_t *)H5I_object(H5P_LST_DATASET_ACCESS_ID_g)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
+ /* Make a copy of the dataset's dataset access property list */
+ if(NULL == (old_plist = (H5P_genplist_t *)H5I_object(dset->shared->dapl_id)))
+ HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "can't get property list")
if((new_dapl_id = H5P_copy_plist(old_plist, TRUE)) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "can't copy dataset access property list")
if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_dapl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
- /* If the dataset is chunked then copy the rdcc & append flush parameters */
+ /* If the dataset is chunked then copy the rdcc & append flush parameters.
+ * Otherwise, use the default values. */
if(dset->shared->layout.type == H5D_CHUNKED) {
if(H5P_set(new_plist, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, &(dset->shared->cache.chunk.nslots)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data cache number of slots")
@@ -3490,7 +3526,33 @@ H5D_get_access_plist(const H5D_t *dset)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set preempt read chunks")
if(H5P_set(new_plist, H5D_ACS_APPEND_FLUSH_NAME, &dset->shared->append_flush) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set append flush property")
- } /* end if */
+ } else {
+ /* Get the default FAPL */
+ if(NULL == (def_fapl = (H5P_genplist_t *)H5I_object(H5P_LST_FILE_ACCESS_ID_g)))
+ HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a property list")
+
+ /* Set the data cache number of slots to the value of the default FAPL */
+ if (H5P_get(def_fapl, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, &def_chunk_info.nslots) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET,FAIL, "can't get data number of slots");
+ if(H5P_set(new_plist, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, &def_chunk_info.nslots) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set data cache number of slots")
+
+ /* Set the data cache byte size to the value of the default FAPL */
+ if (H5P_get(def_fapl, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, &def_chunk_info.nbytes_max) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET,FAIL, "can't get data cache byte size");
+ if(H5P_set(new_plist, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, &def_chunk_info.nbytes_max) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set data cache byte size")
+
+ /* Set the preempt read chunks property to the value of the default FAPL */
+ if (H5P_get(def_fapl, H5D_ACS_PREEMPT_READ_CHUNKS_NAME, &def_chunk_info.w0) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET,FAIL, "can't get preempt read chunks");
+ if(H5P_set(new_plist, H5D_ACS_PREEMPT_READ_CHUNKS_NAME, &def_chunk_info.w0) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set preempt read chunks")
+
+ /* Set the append flush property to its default value */
+ if(H5P_set(new_plist, H5D_ACS_APPEND_FLUSH_NAME, &def_append_flush_info) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set append flush property")
+ }/* end if-else */
/* Set the VDS view & printf gap options */
if(H5P_set(new_plist, H5D_ACS_VDS_VIEW_NAME, &(dset->shared->layout.storage.u.virt.view)) < 0)
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 8abcd81..a03f780 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -546,7 +546,8 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
* has been overwritten. So just proceed in reading.
*/
if(nelmts > 0 && dataset->shared->dcpl_cache.efl.nused == 0 &&
- !(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage)) {
+ !(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage) &&
+ !(dataset->shared->layout.ops->is_data_cached && (*dataset->shared->layout.ops->is_data_cached)(dataset->shared))) {
H5D_fill_value_t fill_status; /* Whether/How the fill value is defined */
/* Retrieve dataset's fill-value properties */
@@ -578,6 +579,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
/* Sanity check that space is allocated, if there are elements */
if(nelmts > 0)
HDassert((*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage)
+ || (dataset->shared->layout.ops->is_data_cached && (*dataset->shared->layout.ops->is_data_cached)(dataset->shared))
|| dataset->shared->dcpl_cache.efl.nused > 0
|| dataset->shared->layout.type == H5D_COMPACT);
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 6803b60..930e9ca 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -2728,7 +2728,6 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty
int *send_displacements = NULL;
int scatter_recvcount_int;
int mpi_rank, mpi_size, mpi_code;
- hid_t fapl_id = -1; /* File access property list for H5S_encode() */
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
@@ -2742,9 +2741,9 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty
HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank")
if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0)
HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size")
-
- if((fapl_id = H5F_get_access_plist(io_info->dset->oloc.file, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fapl")
+
+ /* Set to latest format for encoding dataspace */
+ H5CX_set_libver_bounds(NULL);
if (*local_chunk_array_num_entries)
if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(*local_chunk_array_num_entries * sizeof(MPI_Request))))
@@ -2851,7 +2850,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty
/* Determine size of serialized chunk file dataspace, plus the size of
* the data being written
*/
- if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size, fapl_id) < 0)
+ if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size")
if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0)
@@ -2864,7 +2863,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty
/* Serialize the chunk's file dataspace into the buffer */
mod_data_p = mod_data[num_send_requests];
- if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size, fapl_id) < 0)
+ if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to encode dataspace")
/* Initialize iterator for memory selection */
@@ -2969,8 +2968,6 @@ done:
H5MM_free(num_assigned_chunks_array);
if (shared_chunks_info_array)
H5MM_free(shared_chunks_info_array);
- if (H5Pclose(fapl_id) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "couldn't close FAPL")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_redistribute_shared_chunks() */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index da74d11..f44b250 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -113,12 +113,14 @@ typedef struct H5D_type_info_t {
/* Forward declaration of structs used below */
struct H5D_io_info_t;
struct H5D_chunk_map_t;
+typedef struct H5D_shared_t H5D_shared_t;
/* Function pointers for I/O on particular types of dataset layouts */
typedef herr_t (*H5D_layout_construct_func_t)(H5F_t *f, H5D_t *dset);
typedef herr_t (*H5D_layout_init_func_t)(H5F_t *f, const H5D_t *dset,
hid_t dapl_id);
typedef hbool_t (*H5D_layout_is_space_alloc_func_t)(const H5O_storage_t *storage);
+typedef hbool_t (*H5D_layout_is_data_cached_func_t)(const H5D_shared_t *shared_dset);
typedef herr_t (*H5D_layout_io_init_func_t)(const struct H5D_io_info_t *io_info,
const H5D_type_info_t *type_info,
hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
@@ -144,6 +146,7 @@ typedef struct H5D_layout_ops_t {
H5D_layout_construct_func_t construct; /* Layout constructor for new datasets */
H5D_layout_init_func_t init; /* Layout initializer for dataset */
H5D_layout_is_space_alloc_func_t is_space_alloc; /* Query routine to determine if storage is allocated */
+ H5D_layout_is_data_cached_func_t is_data_cached; /* Query routine to determine if any raw data is cached. If routine is not present then the layout type never caches raw data. */
H5D_layout_io_init_func_t io_init; /* I/O initialization routine */
H5D_layout_read_func_t ser_read; /* High-level I/O routine for reading data in serial */
H5D_layout_write_func_t ser_write; /* High-level I/O routine for writing data in serial */
@@ -429,13 +432,14 @@ typedef struct H5D_rdcdc_t {
* created once for a given dataset. Thus, if a dataset is opened twice,
* there will be two IDs and two H5D_t structs, both sharing one H5D_shared_t.
*/
-typedef struct H5D_shared_t {
+struct H5D_shared_t {
size_t fo_count; /* Reference count */
hbool_t closing; /* Flag to indicate dataset is closing */
hid_t type_id; /* ID for dataset's datatype */
H5T_t *type; /* Datatype for this dataset */
H5S_t *space; /* Dataspace of this dataset */
hid_t dcpl_id; /* Dataset creation property id */
+ hid_t dapl_id; /* Dataset access property id */
H5D_dcpl_cache_t dcpl_cache; /* Cached DCPL values */
H5O_layout_t layout; /* Data layout */
hbool_t checked_filters;/* TRUE if dataset passes can_apply check */
@@ -459,7 +463,7 @@ typedef struct H5D_shared_t {
H5D_append_flush_t append_flush; /* Append flush property information */
char *extfile_prefix; /* expanded external file prefix */
char *vds_prefix; /* expanded vds prefix */
-} H5D_shared_t;
+};
struct H5D_t {
H5O_loc_t oloc; /* Object header location */
@@ -624,6 +628,7 @@ H5_DLL herr_t H5D__layout_oh_write(const H5D_t *dataset, H5O_t *oh, unsigned upd
/* Functions that operate on contiguous storage */
H5_DLL herr_t H5D__contig_alloc(H5F_t *f, H5O_storage_contig_t *storage);
H5_DLL hbool_t H5D__contig_is_space_alloc(const H5O_storage_t *storage);
+H5_DLL hbool_t H5D__contig_is_data_cached(const H5D_shared_t *shared_dset);
H5_DLL herr_t H5D__contig_fill(const H5D_io_info_t *io_info);
H5_DLL herr_t H5D__contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
@@ -642,6 +647,7 @@ H5_DLL htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr,
H5_DLL herr_t H5D__chunk_create(const H5D_t *dset /*in,out*/);
H5_DLL herr_t H5D__chunk_set_info(const H5D_t *dset);
H5_DLL hbool_t H5D__chunk_is_space_alloc(const H5O_storage_t *storage);
+H5_DLL hbool_t H5D__chunk_is_data_cached(const H5D_shared_t *shared_dset);
H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled,
H5D_chunk_ud_t *udata);
H5_DLL herr_t H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes);
diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c
index 1d2b191..e591440 100644
--- a/src/H5Dvirtual.c
+++ b/src/H5Dvirtual.c
@@ -78,6 +78,7 @@
/********************/
/* Layout operation callbacks */
+static hbool_t H5D__virtual_is_data_cached(const H5D_shared_t *shared_dset);
static herr_t H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t
*type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
H5D_chunk_map_t *fm);
@@ -121,6 +122,7 @@ const H5D_layout_ops_t H5D_LOPS_VIRTUAL[1] = {{
NULL,
H5D__virtual_init,
H5D__virtual_is_space_alloc,
+ H5D__virtual_is_data_cached,
NULL,
H5D__virtual_read,
H5D__virtual_write,
@@ -417,11 +419,6 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout)
hsize_t tmp_nentries; /* Temp. variable for # of VDS entries */
uint32_t chksum; /* Checksum for heap data */
size_t i; /* Local index variable */
- H5P_genplist_t *fapl_plist; /* The file access property list */
- hid_t new_fapl_id; /* The file access property list ID */
- H5F_libver_t low_bound = H5F_LIBVER_V110; /* Set the low bound in fapl to latest */
- H5F_libver_t high_bound = H5F_LIBVER_V110; /* Set the high bound in fapl to latest */
- H5F_t *tmp_f = NULL; /* Pointer to faked file structure */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -434,22 +431,8 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout)
/* Create block if # of used entries > 0 */
if(layout->storage.u.virt.list_nused > 0) {
- /* Make a copy of the default file access property list */
- if(NULL == (fapl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_FILE_ACCESS_ID_g)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
-
- /* Set latest format in fapl_plist for virtual layout encoding */
- if(H5P_set(fapl_plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &low_bound) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'low' bound for library format versions")
- if(H5P_set(fapl_plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &high_bound) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'high' bound for library format versions")
- /* Copy and return the fapl id */
- if((new_fapl_id = H5P_copy_plist(fapl_plist, FALSE)) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "can't copy file access property list")
-
- /* Allocate "fake" file structure with the fapl setting */
- if(NULL == (tmp_f = H5F_fake_alloc((uint8_t)0, new_fapl_id)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct")
+ /* Set the low/high bounds according to 'f' for the API context */
+ H5CX_set_libver_bounds(f);
/* Allocate array for caching results of strlen */
if(NULL == (str_size = (size_t *)H5MM_malloc(2 * layout->storage.u.virt.list_nused * sizeof(size_t))))
@@ -480,12 +463,12 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout)
block_size += str_size[(2 * i) + 1];
/* Source selection */
- if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_select, tmp_f)) < 0)
+ if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_select)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size")
block_size += (size_t)select_serial_size;
/* Virtual dataset selection */
- if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_dset.virtual_select, tmp_f)) < 0)
+ if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_dset.virtual_select)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size")
block_size += (size_t)select_serial_size;
} /* end for */
@@ -522,11 +505,11 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout)
heap_block_p += str_size[(2 * i) + 1];
/* Source selection */
- if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_select, &heap_block_p, tmp_f) < 0)
+ if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_select, &heap_block_p) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize source selection")
/* Virtual selection */
- if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_dset.virtual_select, &heap_block_p, tmp_f) < 0)
+ if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_dset.virtual_select, &heap_block_p) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize virtual selection")
} /* end for */
@@ -540,10 +523,6 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout)
} /* end if */
done:
- /* Release fake file structure */
- if(tmp_f && H5F_fake_free(tmp_f) < 0)
- HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release fake file struct")
-
heap_block = (uint8_t *)H5MM_xfree(heap_block);
str_size = (size_t *)H5MM_xfree(str_size);
@@ -2235,6 +2214,54 @@ H5D__virtual_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage)
/*-------------------------------------------------------------------------
+ * Function: H5D__virtual_is_data_cached
+ *
+ * Purpose: Query if raw data is cached for dataset
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Neil Fortner
+ * Wednessday, March 6, 2016
+ *
+ *-------------------------------------------------------------------------
+ */
+static hbool_t
+H5D__virtual_is_data_cached(const H5D_shared_t *shared_dset)
+{
+ const H5O_storage_virtual_t *storage; /* Convenience pointer */
+ size_t i, j; /* Local index variables */
+ hbool_t ret_value = FALSE; /* Return value */
+
+ FUNC_ENTER_PACKAGE_NOERR
+
+ /* Sanity checks */
+ HDassert(shared_dset);
+ storage = &shared_dset->layout.storage.u.virt;
+
+ /* Iterate over mappings */
+ for(i = 0; i < storage->list_nused; i++)
+ /* Check for "printf" source dataset resolution */
+ if(storage->list[i].psfn_nsubs || storage->list[i].psdn_nsubs) {
+ /* Iterate over sub-source dsets */
+ for(j = storage->list[i].sub_dset_io_start; j < storage->list[i].sub_dset_io_end; j++)
+ /* Check for cahced data in source dset */
+ if(storage->list[i].sub_dset[j].dset
+ && storage->list[i].sub_dset[j].dset->shared->layout.ops->is_data_cached
+ && storage->list[i].sub_dset[j].dset->shared->layout.ops->is_data_cached(storage->list[i].sub_dset[j].dset->shared))
+ HGOTO_DONE(TRUE);
+ } /* end if */
+ else
+ if(storage->list[i].source_dset.dset
+ && storage->list[i].source_dset.dset->shared->layout.ops->is_data_cached
+ && storage->list[i].source_dset.dset->shared->layout.ops->is_data_cached(storage->list[i].source_dset.dset->shared))
+ HGOTO_DONE(TRUE);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5D__virtual_is_data_cached() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5D__virtual_pre_io
*
* Purpose: Project all virtual mappings onto mem_space, with the
diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c
index 1a2b973..46e87c5 100644
--- a/src/H5EAdbg.c
+++ b/src/H5EAdbg.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5EAdbg.c
- * Sep 11 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5EAdbg.c
+ * Sep 11 2008
+ * Quincey Koziol <koziol@hdfgroup.org>
*
- * Purpose: Dump debugging information about an extensible array.
+ * Purpose: Dump debugging information about an extensible array.
*
*-------------------------------------------------------------------------
*/
@@ -37,9 +37,9 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5EApkg.h" /* Extensible Arrays */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5EApkg.h" /* Extensible Arrays */
/****************/
@@ -77,17 +77,17 @@
/*******************/
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA__hdr_debug
+ * Function: H5EA__hdr_debug
*
- * Purpose: Prints debugging info about a extensible array header.
+ * Purpose: Prints debugging info about a extensible array header.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Sep 11 2008
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * Sep 11 2008
*
*-------------------------------------------------------------------------
*/
@@ -97,7 +97,7 @@ H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent,
int fwidth, const H5EA_class_t *cls, haddr_t obj_addr))
/* Local variables */
- H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */
+ H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */
void *dbg_ctx = NULL; /* Extensible array debugging context */
/* Check arguments */
@@ -117,73 +117,73 @@ H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent,
/* Load the extensible array header */
if(NULL == (hdr = H5EA__hdr_protect(f, addr, dbg_ctx, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
+ H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
/* Print opening message */
HDfprintf(stream, "%*sExtensible Array Header...\n", indent, "");
/* Print the values */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Array class ID:", hdr->cparam.cls->name);
+ "Array class ID:", hdr->cparam.cls->name);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "Header size:",
- hdr->size);
+ "Header size:",
+ hdr->size);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Raw Element Size:",
- (unsigned)hdr->cparam.raw_elmt_size);
+ "Raw Element Size:",
+ (unsigned)hdr->cparam.raw_elmt_size);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "Native Element Size (on this platform):",
- hdr->cparam.cls->nat_elmt_size);
+ "Native Element Size (on this platform):",
+ hdr->cparam.cls->nat_elmt_size);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Log2(Max. # of elements in array):",
- (unsigned)hdr->cparam.max_nelmts_bits);
+ "Log2(Max. # of elements in array):",
+ (unsigned)hdr->cparam.max_nelmts_bits);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "# of elements in index block:",
- (unsigned)hdr->cparam.idx_blk_elmts);
+ "# of elements in index block:",
+ (unsigned)hdr->cparam.idx_blk_elmts);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Min. # of elements per data block:",
- (unsigned)hdr->cparam.data_blk_min_elmts);
+ "Min. # of elements per data block:",
+ (unsigned)hdr->cparam.data_blk_min_elmts);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Min. # of data block pointers for a super block:",
- (unsigned)hdr->cparam.sup_blk_min_data_ptrs);
+ "Min. # of data block pointers for a super block:",
+ (unsigned)hdr->cparam.sup_blk_min_data_ptrs);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Log2(Max. # of elements in data block page):",
- (unsigned)hdr->cparam.max_dblk_page_nelmts_bits);
+ "Log2(Max. # of elements in data block page):",
+ (unsigned)hdr->cparam.max_dblk_page_nelmts_bits);
HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
- "Highest element index stored (+1):",
- hdr->stats.stored.max_idx_set);
+ "Highest element index stored (+1):",
+ hdr->stats.stored.max_idx_set);
HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
- "Number of super blocks created:",
- hdr->stats.stored.nsuper_blks);
+ "Number of super blocks created:",
+ hdr->stats.stored.nsuper_blks);
HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
- "Number of data blocks created:",
- hdr->stats.stored.ndata_blks);
+ "Number of data blocks created:",
+ hdr->stats.stored.ndata_blks);
HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
- "Number of elements 'realized':",
- hdr->stats.stored.nelmts);
+ "Number of elements 'realized':",
+ hdr->stats.stored.nelmts);
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
- "Index Block Address:",
- hdr->idx_blk_addr);
+ "Index Block Address:",
+ hdr->idx_blk_addr);
CATCH
if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0)
H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context")
if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
+ H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
END_FUNC(PKG) /* end H5EA__hdr_debug() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA__iblock_debug
+ * Function: H5EA__iblock_debug
*
- * Purpose: Prints debugging info about a extensible array index block.
+ * Purpose: Prints debugging info about a extensible array index block.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Sep 11 2008
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * Sep 11 2008
*
*-------------------------------------------------------------------------
*/
@@ -215,7 +215,7 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde
/* Load the extensible array header */
if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
+ H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
/* Sanity check */
HDassert(H5F_addr_eq(hdr->idx_blk_addr, addr));
@@ -229,16 +229,16 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde
/* Print the values */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Array class ID:", hdr->cparam.cls->name);
+ "Array class ID:", hdr->cparam.cls->name);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "Index Block size:",
- iblock->size);
+ "Index Block size:",
+ iblock->size);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "# of data block addresses in index block:",
- iblock->ndblk_addrs);
+ "# of data block addresses in index block:",
+ iblock->ndblk_addrs);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "# of super block addresses in index block:",
- iblock->nsblk_addrs);
+ "# of super block addresses in index block:",
+ iblock->nsblk_addrs);
/* Check if there are any elements in index block */
if(hdr->cparam.idx_blk_elmts > 0) {
@@ -264,7 +264,7 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde
HDfprintf(stream, "%*sData Block Addresses in Index Block:\n", indent, "");
for(u = 0; u < iblock->ndblk_addrs; u++) {
/* Print address */
- sprintf(temp_str, "Address #%u:", u);
+ HDsprintf(temp_str, "Address #%u:", u);
HDfprintf(stream, "%*s%-*s %a\n", (indent + 3), "", MAX(0, (fwidth - 3)),
temp_str,
iblock->dblk_addrs[u]);
@@ -280,7 +280,7 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde
HDfprintf(stream, "%*sSuper Block Addresses in Index Block:\n", indent, "");
for(u = 0; u < iblock->nsblk_addrs; u++) {
/* Print address */
- sprintf(temp_str, "Address #%u:", u);
+ HDsprintf(temp_str, "Address #%u:", u);
HDfprintf(stream, "%*s%-*s %a\n", (indent + 3), "", MAX(0, (fwidth - 3)),
temp_str,
iblock->sblk_addrs[u]);
@@ -293,21 +293,21 @@ CATCH
if(iblock && H5EA__iblock_unprotect(iblock, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block")
if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
+ H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
END_FUNC(PKG) /* end H5EA__iblock_debug() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA__sblock_debug
+ * Function: H5EA__sblock_debug
*
- * Purpose: Prints debugging info about a extensible array super block.
+ * Purpose: Prints debugging info about a extensible array super block.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Sep 30 2008
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * Sep 30 2008
*
*-------------------------------------------------------------------------
*/
@@ -339,7 +339,7 @@ H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent,
/* Load the extensible array header */
if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
+ H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
/* Protect super block */
/* (Note: setting parent of super block to 'hdr' for this operation should be OK -QAK) */
@@ -351,16 +351,16 @@ H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent,
/* Print the values */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Array class ID:", hdr->cparam.cls->name);
+ "Array class ID:", hdr->cparam.cls->name);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "Super Block size:",
- sblock->size);
+ "Super Block size:",
+ sblock->size);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "# of data block addresses in super block:",
- sblock->ndblks);
+ "# of data block addresses in super block:",
+ sblock->ndblks);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "# of elements in data blocks from this super block:",
- sblock->dblk_nelmts);
+ "# of elements in data blocks from this super block:",
+ sblock->dblk_nelmts);
/* Check if there are any data block addresses in super block */
if(sblock->ndblks > 0) {
@@ -371,7 +371,7 @@ H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent,
HDfprintf(stream, "%*sData Block Addresses in Super Block:\n", indent, "");
for(u = 0; u < sblock->ndblks; u++) {
/* Print address */
- sprintf(temp_str, "Address #%u:", u);
+ HDsprintf(temp_str, "Address #%u:", u);
HDfprintf(stream, "%*s%-*s %a\n", (indent + 3), "", MAX(0, (fwidth - 3)),
temp_str,
sblock->dblk_addrs[u]);
@@ -384,21 +384,21 @@ CATCH
if(sblock && H5EA__sblock_unprotect(sblock, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block")
if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
+ H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
END_FUNC(PKG) /* end H5EA__sblock_debug() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA__dblock_debug
+ * Function: H5EA__dblock_debug
*
- * Purpose: Prints debugging info about a extensible array data block.
+ * Purpose: Prints debugging info about a extensible array data block.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Sep 22 2008
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * Sep 22 2008
*
*-------------------------------------------------------------------------
*/
@@ -432,7 +432,7 @@ H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent,
/* Load the extensible array header */
if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
+ H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
/* Protect data block */
/* (Note: setting parent of data block to 'hdr' for this operation should be OK -QAK) */
@@ -444,10 +444,10 @@ H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent,
/* Print the values */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Array class ID:", hdr->cparam.cls->name);
+ "Array class ID:", hdr->cparam.cls->name);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "Data Block size:",
- dblock->size);
+ "Data Block size:",
+ dblock->size);
/* Print the elements in the index block */
@@ -466,7 +466,7 @@ CATCH
if(dblock && H5EA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block")
if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
+ H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
END_FUNC(PKG) /* end H5EA__dblock_debug() */
diff --git a/src/H5EAtest.c b/src/H5EAtest.c
index 3da7996..dccc007 100644
--- a/src/H5EAtest.c
+++ b/src/H5EAtest.c
@@ -14,7 +14,7 @@
/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
* Thursday, August 28, 2008
*
- * Purpose: Extensible array testing functions.
+ * Purpose: Extensible array testing functions.
*
*/
@@ -34,11 +34,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5EApkg.h" /* Extensible Arrays */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5VMprivate.h" /* Vector functions */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5EApkg.h" /* Extensible Arrays */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -115,16 +115,16 @@ H5FL_DEFINE_STATIC(H5EA__test_ctx_t);
H5FL_DEFINE_STATIC(H5EA__ctx_cb_t);
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA__test_crt_context
+ * Function: H5EA__test_crt_context
*
- * Purpose: Create context for callbacks
+ * Purpose: Create context for callbacks
*
- * Return: Success: non-NULL
- * Failure: NULL
+ * Return: Success: non-NULL
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, January 27, 2009
*
*-------------------------------------------------------------------------
@@ -141,7 +141,7 @@ H5EA__test_crt_context(void *_udata))
/* Allocate new context structure */
if(NULL == (ctx = H5FL_MALLOC(H5EA__test_ctx_t)))
- H5E_THROW(H5E_CANTALLOC, "can't allocate extensible array client callback context")
+ H5E_THROW(H5E_CANTALLOC, "can't allocate extensible array client callback context")
/* Initialize the context */
ctx->bogus = H5EA__TEST_BOGUS_VAL;
@@ -154,16 +154,16 @@ CATCH
END_FUNC(STATIC) /* end H5EA__test_crt_context() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA__test_dst_context
+ * Function: H5EA__test_dst_context
*
- * Purpose: Destroy context for callbacks
+ * Purpose: Destroy context for callbacks
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, January 27, 2009
*
*-------------------------------------------------------------------------
@@ -183,16 +183,16 @@ H5EA__test_dst_context(void *_ctx))
END_FUNC(STATIC) /* end H5EA__test_dst_context() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA__test_fill
+ * Function: H5EA__test_fill
*
- * Purpose: Fill "missing elements" in block of elements
+ * Purpose: Fill "missing elements" in block of elements
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
@@ -212,16 +212,16 @@ H5EA__test_fill(void *nat_blk, size_t nelmts))
END_FUNC(STATIC) /* end H5EA__test_fill() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA__test_encode
+ * Function: H5EA__test_encode
*
- * Purpose: Encode an element from "native" to "raw" form
+ * Purpose: Encode an element from "native" to "raw" form
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
@@ -263,16 +263,16 @@ CATCH
END_FUNC(STATIC) /* end H5EA__test_encode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA__test_decode
+ * Function: H5EA__test_decode
*
- * Purpose: Decode an element from "raw" to "native" form
+ * Purpose: Decode an element from "raw" to "native" form
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
@@ -309,16 +309,16 @@ H5EA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx))
END_FUNC(STATIC) /* end H5EA__test_decode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA__test_debug
+ * Function: H5EA__test_debug
*
- * Purpose: Display an element for debugging
+ * Purpose: Display an element for debugging
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
@@ -336,7 +336,7 @@ H5EA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx,
HDassert(elmt);
/* Print element */
- sprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
+ HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
HDfprintf(stream, "%*s%-*s %llu\n", indent, "", fwidth, temp_str,
(unsigned long long)*(const uint64_t *)elmt);
@@ -346,21 +346,21 @@ END_FUNC(STATIC) /* end H5EA__test_debug() */
* Function: H5EA__test_crt_dbg_context
*
* Purpose: Create context for debugging callback
- *
+ *
* Return: Success: non-NULL
* Failure: NULL
- *
- * Programmer: Vailin Choi; August 2010
+ *
+ * Programmer: Vailin Choi; August 2010
*
*-------------------------------------------------------------------------
*/
BEGIN_FUNC(STATIC, ERR,
void *, NULL, NULL,
H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr))
-
+
/* Local variables */
H5EA__ctx_cb_t *ctx; /* Context for callbacks */
-
+
/* Allocate new context structure */
if(NULL == (ctx = H5FL_MALLOC(H5EA__ctx_cb_t)))
H5E_THROW(H5E_CANTALLOC, "can't allocate extensible array client callback context")
@@ -372,16 +372,16 @@ CATCH
END_FUNC(STATIC) /* end H5EA__test_crt_dbg_context() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA__test_dst_dbg_context
+ * Function: H5EA__test_dst_dbg_context
*
- * Purpose: Destroy context for callbacks
+ * Purpose: Destroy context for callbacks
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi; August 2010
+ * Programmer: Vailin Choi; August 2010
*
*-------------------------------------------------------------------------
*/
@@ -399,16 +399,16 @@ H5EA__test_dst_dbg_context(void *_ctx))
END_FUNC(STATIC) /* end H5EA__test_dst_dbg_context() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA_get_cparam_test
+ * Function: H5EA_get_cparam_test
*
- * Purpose: Retrieve the parameters used to create the extensible array
+ * Purpose: Retrieve the parameters used to create the extensible array
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
@@ -431,16 +431,16 @@ H5EA_get_cparam_test(const H5EA_t *ea, H5EA_create_t *cparam))
END_FUNC(PRIV) /* end H5EA_get_cparam_test() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5EA_cmp_cparam_test
+ * Function: H5EA_cmp_cparam_test
*
- * Purpose: Compare the parameters used to create the extensible array
+ * Purpose: Compare the parameters used to create the extensible array
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5Einit.h b/src/H5Einit.h
index 713b2fb..57d7e32 100644
--- a/src/H5Einit.h
+++ b/src/H5Einit.h
@@ -22,177 +22,177 @@
/* Major error codes */
/*********************/
-assert(H5E_FUNC_g==(-1));
+HDassert(H5E_FUNC_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Function entry/exit"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_FUNC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_FILE_g==(-1));
+HDassert(H5E_FILE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "File accessibilty"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_FILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_SOHM_g==(-1));
+HDassert(H5E_SOHM_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Shared Object Header Messages"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_SOHM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_SYM_g==(-1));
+HDassert(H5E_SYM_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Symbol table"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_SYM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_PLUGIN_g==(-1));
+HDassert(H5E_PLUGIN_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Plugin for dynamically loaded library"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_PLUGIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_VFL_g==(-1));
+HDassert(H5E_VFL_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Virtual File Layer"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_VFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_INTERNAL_g==(-1));
+HDassert(H5E_INTERNAL_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Internal error (too specific to document in detail)"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_INTERNAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_BTREE_g==(-1));
+HDassert(H5E_BTREE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "B-Tree node"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_BTREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_REFERENCE_g==(-1));
+HDassert(H5E_REFERENCE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "References"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_REFERENCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_DATASPACE_g==(-1));
+HDassert(H5E_DATASPACE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataspace"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_DATASPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_RESOURCE_g==(-1));
+HDassert(H5E_RESOURCE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Resource unavailable"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_RESOURCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_RS_g==(-1));
+HDassert(H5E_RS_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Reference Counted Strings"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_RS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_FARRAY_g==(-1));
+HDassert(H5E_FARRAY_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Fixed Array"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_FARRAY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_HEAP_g==(-1));
+HDassert(H5E_HEAP_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Heap"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_HEAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_ATTR_g==(-1));
+HDassert(H5E_ATTR_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Attribute"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_ATTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_IO_g==(-1));
+HDassert(H5E_IO_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Low-level I/O"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_IO_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_EFL_g==(-1));
+HDassert(H5E_EFL_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "External file list"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_EFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_TST_g==(-1));
+HDassert(H5E_TST_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Ternary Search Trees"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_TST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_PAGEBUF_g==(-1));
+HDassert(H5E_PAGEBUF_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Page Buffering"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_PAGEBUF_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_FSPACE_g==(-1));
+HDassert(H5E_FSPACE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Free Space Manager"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_FSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_DATASET_g==(-1));
+HDassert(H5E_DATASET_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataset"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_DATASET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_STORAGE_g==(-1));
+HDassert(H5E_STORAGE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data storage"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_STORAGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_LINK_g==(-1));
+HDassert(H5E_LINK_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Links"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_LINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_PLIST_g==(-1));
+HDassert(H5E_PLIST_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Property lists"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_PLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_DATATYPE_g==(-1));
+HDassert(H5E_DATATYPE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Datatype"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_DATATYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_OHDR_g==(-1));
+HDassert(H5E_OHDR_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object header"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_OHDR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_ATOM_g==(-1));
+HDassert(H5E_ATOM_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object atom"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_ATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_NONE_MAJOR_g==(-1));
+HDassert(H5E_NONE_MAJOR_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "No error"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_NONE_MAJOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_SLIST_g==(-1));
+HDassert(H5E_SLIST_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Skip Lists"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_SLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_ARGS_g==(-1));
+HDassert(H5E_ARGS_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Invalid arguments to routine"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_ARGS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CONTEXT_g==(-1));
+HDassert(H5E_CONTEXT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "API Context"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CONTEXT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_EARRAY_g==(-1));
+HDassert(H5E_EARRAY_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Extensible Array"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_EARRAY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_PLINE_g==(-1));
+HDassert(H5E_PLINE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data filters"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_PLINE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_ERROR_g==(-1));
+HDassert(H5E_ERROR_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Error API"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_ERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CACHE_g==(-1));
+HDassert(H5E_CACHE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object cache"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
@@ -204,702 +204,702 @@ if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
/* Generic low-level file I/O errors */
-assert(H5E_SEEKERROR_g==(-1));
+HDassert(H5E_SEEKERROR_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Seek failed"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_SEEKERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_READERROR_g==(-1));
+HDassert(H5E_READERROR_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Read failed"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_READERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_WRITEERROR_g==(-1));
+HDassert(H5E_WRITEERROR_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Write failed"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_WRITEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CLOSEERROR_g==(-1));
+HDassert(H5E_CLOSEERROR_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Close failed"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CLOSEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_OVERFLOW_g==(-1));
+HDassert(H5E_OVERFLOW_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Address overflowed"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_OVERFLOW_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_FCNTL_g==(-1));
+HDassert(H5E_FCNTL_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "File control (fcntl) failed"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_FCNTL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Resource errors */
-assert(H5E_NOSPACE_g==(-1));
+HDassert(H5E_NOSPACE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "No space available for allocation"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_NOSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTALLOC_g==(-1));
+HDassert(H5E_CANTALLOC_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't allocate space"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTALLOC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTCOPY_g==(-1));
+HDassert(H5E_CANTCOPY_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to copy object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTCOPY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTFREE_g==(-1));
+HDassert(H5E_CANTFREE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to free object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTFREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_ALREADYEXISTS_g==(-1));
+HDassert(H5E_ALREADYEXISTS_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_ALREADYEXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTLOCK_g==(-1));
+HDassert(H5E_CANTLOCK_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to lock object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTUNLOCK_g==(-1));
+HDassert(H5E_CANTUNLOCK_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to unlock object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTUNLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTGC_g==(-1));
+HDassert(H5E_CANTGC_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to garbage collect"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTGC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTGETSIZE_g==(-1));
+HDassert(H5E_CANTGETSIZE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to compute size"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTGETSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_OBJOPEN_g==(-1));
+HDassert(H5E_OBJOPEN_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Object is already open"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_OBJOPEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Heap errors */
-assert(H5E_CANTRESTORE_g==(-1));
+HDassert(H5E_CANTRESTORE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't restore condition"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTRESTORE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTCOMPUTE_g==(-1));
+HDassert(H5E_CANTCOMPUTE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't compute value"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTCOMPUTE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTEXTEND_g==(-1));
+HDassert(H5E_CANTEXTEND_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't extend heap's space"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTEXTEND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTATTACH_g==(-1));
+HDassert(H5E_CANTATTACH_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't attach object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTATTACH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTUPDATE_g==(-1));
+HDassert(H5E_CANTUPDATE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't update object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTUPDATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTOPERATE_g==(-1));
+HDassert(H5E_CANTOPERATE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't operate on object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTOPERATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Function entry/exit interface errors */
-assert(H5E_CANTINIT_g==(-1));
+HDassert(H5E_CANTINIT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to initialize object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTINIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_ALREADYINIT_g==(-1));
+HDassert(H5E_ALREADYINIT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already initialized"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_ALREADYINIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTRELEASE_g==(-1));
+HDassert(H5E_CANTRELEASE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to release object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTRELEASE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Property list errors */
-assert(H5E_CANTGET_g==(-1));
+HDassert(H5E_CANTGET_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't get value"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTGET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTSET_g==(-1));
+HDassert(H5E_CANTSET_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't set value"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTSET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_DUPCLASS_g==(-1));
+HDassert(H5E_DUPCLASS_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Duplicate class name in parent class"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_DUPCLASS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_SETDISALLOWED_g==(-1));
+HDassert(H5E_SETDISALLOWED_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Disallowed operation"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_SETDISALLOWED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Free space errors */
-assert(H5E_CANTMERGE_g==(-1));
+HDassert(H5E_CANTMERGE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't merge objects"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTMERGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTREVIVE_g==(-1));
+HDassert(H5E_CANTREVIVE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't revive object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTREVIVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTSHRINK_g==(-1));
+HDassert(H5E_CANTSHRINK_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't shrink container"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTSHRINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Object header related errors */
-assert(H5E_LINKCOUNT_g==(-1));
+HDassert(H5E_LINKCOUNT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad object header link count"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_LINKCOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_VERSION_g==(-1));
+HDassert(H5E_VERSION_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Wrong version number"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_VERSION_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_ALIGNMENT_g==(-1));
+HDassert(H5E_ALIGNMENT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Alignment error"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_ALIGNMENT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_BADMESG_g==(-1));
+HDassert(H5E_BADMESG_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unrecognized message"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_BADMESG_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTDELETE_g==(-1));
+HDassert(H5E_CANTDELETE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't delete message"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTDELETE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_BADITER_g==(-1));
+HDassert(H5E_BADITER_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Iteration failed"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_BADITER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTPACK_g==(-1));
+HDassert(H5E_CANTPACK_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't pack messages"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTPACK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTRESET_g==(-1));
+HDassert(H5E_CANTRESET_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't reset object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTRESET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTRENAME_g==(-1));
+HDassert(H5E_CANTRENAME_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to rename object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTRENAME_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* System level errors */
-assert(H5E_SYSERRSTR_g==(-1));
+HDassert(H5E_SYSERRSTR_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "System error message"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_SYSERRSTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* I/O pipeline errors */
-assert(H5E_NOFILTER_g==(-1));
+HDassert(H5E_NOFILTER_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Requested filter is not available"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_NOFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CALLBACK_g==(-1));
+HDassert(H5E_CALLBACK_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Callback failed"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CALLBACK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANAPPLY_g==(-1));
+HDassert(H5E_CANAPPLY_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'can apply' callback"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANAPPLY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_SETLOCAL_g==(-1));
+HDassert(H5E_SETLOCAL_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'set local' callback"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_SETLOCAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_NOENCODER_g==(-1));
+HDassert(H5E_NOENCODER_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter present but encoding disabled"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_NOENCODER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTFILTER_g==(-1));
+HDassert(H5E_CANTFILTER_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter operation failed"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Group related errors */
-assert(H5E_CANTOPENOBJ_g==(-1));
+HDassert(H5E_CANTOPENOBJ_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTOPENOBJ_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTCLOSEOBJ_g==(-1));
+HDassert(H5E_CANTCLOSEOBJ_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't close object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTCLOSEOBJ_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_COMPLEN_g==(-1));
+HDassert(H5E_COMPLEN_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Name component is too long"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_COMPLEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_PATH_g==(-1));
+HDassert(H5E_PATH_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Problem with path to object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_PATH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* No error */
-assert(H5E_NONE_MINOR_g==(-1));
+HDassert(H5E_NONE_MINOR_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "No error"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Plugin errors */
-assert(H5E_OPENERROR_g==(-1));
+HDassert(H5E_OPENERROR_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open directory or file"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_OPENERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* File accessibilty errors */
-assert(H5E_FILEEXISTS_g==(-1));
+HDassert(H5E_FILEEXISTS_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "File already exists"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_FILEEXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_FILEOPEN_g==(-1));
+HDassert(H5E_FILEOPEN_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "File already open"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_FILEOPEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTCREATE_g==(-1));
+HDassert(H5E_CANTCREATE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to create file"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTCREATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTOPENFILE_g==(-1));
+HDassert(H5E_CANTOPENFILE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to open file"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTOPENFILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTCLOSEFILE_g==(-1));
+HDassert(H5E_CANTCLOSEFILE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to close file"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTCLOSEFILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_NOTHDF5_g==(-1));
+HDassert(H5E_NOTHDF5_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Not an HDF5 file"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_NOTHDF5_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_BADFILE_g==(-1));
+HDassert(H5E_BADFILE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad file ID accessed"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_BADFILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_TRUNCATED_g==(-1));
+HDassert(H5E_TRUNCATED_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "File has been truncated"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_TRUNCATED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_MOUNT_g==(-1));
+HDassert(H5E_MOUNT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "File mount error"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_MOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Object atom related errors */
-assert(H5E_BADATOM_g==(-1));
+HDassert(H5E_BADATOM_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find atom information (already closed?)"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_BADATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_BADGROUP_g==(-1));
+HDassert(H5E_BADGROUP_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find ID group information"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_BADGROUP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTREGISTER_g==(-1));
+HDassert(H5E_CANTREGISTER_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to register new atom"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTREGISTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTINC_g==(-1));
+HDassert(H5E_CANTINC_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to increment reference count"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTINC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTDEC_g==(-1));
+HDassert(H5E_CANTDEC_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decrement reference count"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTDEC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_NOIDS_g==(-1));
+HDassert(H5E_NOIDS_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of IDs for group"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_NOIDS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Cache related errors */
-assert(H5E_CANTFLUSH_g==(-1));
+HDassert(H5E_CANTFLUSH_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to flush data from cache"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTFLUSH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTUNSERIALIZE_g==(-1));
+HDassert(H5E_CANTUNSERIALIZE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark metadata as unserialized"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTUNSERIALIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTSERIALIZE_g==(-1));
+HDassert(H5E_CANTSERIALIZE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to serialize data from cache"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTSERIALIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTTAG_g==(-1));
+HDassert(H5E_CANTTAG_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to tag metadata in the cache"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTTAG_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTLOAD_g==(-1));
+HDassert(H5E_CANTLOAD_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to load metadata into cache"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTLOAD_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_PROTECT_g==(-1));
+HDassert(H5E_PROTECT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Protected metadata error"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_PROTECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_NOTCACHED_g==(-1));
+HDassert(H5E_NOTCACHED_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Metadata not currently cached"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_NOTCACHED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_SYSTEM_g==(-1));
+HDassert(H5E_SYSTEM_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Internal error detected"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_SYSTEM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTINS_g==(-1));
+HDassert(H5E_CANTINS_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to insert metadata into cache"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTINS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTPROTECT_g==(-1));
+HDassert(H5E_CANTPROTECT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to protect metadata"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTPROTECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTUNPROTECT_g==(-1));
+HDassert(H5E_CANTUNPROTECT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to unprotect metadata"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTUNPROTECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTPIN_g==(-1));
+HDassert(H5E_CANTPIN_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to pin cache entry"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTPIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTUNPIN_g==(-1));
+HDassert(H5E_CANTUNPIN_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to un-pin cache entry"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTUNPIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTMARKDIRTY_g==(-1));
+HDassert(H5E_CANTMARKDIRTY_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark a pinned entry as dirty"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTMARKDIRTY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTMARKCLEAN_g==(-1));
+HDassert(H5E_CANTMARKCLEAN_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark a pinned entry as clean"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTMARKCLEAN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTMARKUNSERIALIZED_g==(-1));
+HDassert(H5E_CANTMARKUNSERIALIZED_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark an entry as unserialized"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTMARKUNSERIALIZED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTMARKSERIALIZED_g==(-1));
+HDassert(H5E_CANTMARKSERIALIZED_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark an entry as serialized"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTMARKSERIALIZED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTDIRTY_g==(-1));
+HDassert(H5E_CANTDIRTY_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark metadata as dirty"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTDIRTY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTCLEAN_g==(-1));
+HDassert(H5E_CANTCLEAN_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark metadata as clean"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTCLEAN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTEXPUNGE_g==(-1));
+HDassert(H5E_CANTEXPUNGE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to expunge a metadata cache entry"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTEXPUNGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTRESIZE_g==(-1));
+HDassert(H5E_CANTRESIZE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to resize a metadata cache entry"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTRESIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTDEPEND_g==(-1));
+HDassert(H5E_CANTDEPEND_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to create a flush dependency"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTDEPEND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTUNDEPEND_g==(-1));
+HDassert(H5E_CANTUNDEPEND_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to destroy a flush dependency"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTUNDEPEND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTNOTIFY_g==(-1));
+HDassert(H5E_CANTNOTIFY_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to notify object about action"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTNOTIFY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_LOGGING_g==(-1));
+HDassert(H5E_LOGGING_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Failure in the cache logging framework"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_LOGGING_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_LOGFAIL_g==(-1));
+HDassert(H5E_LOGFAIL_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "old H5E_LOGGING_g (maintained for binary compatibility)"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_LOGFAIL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTCORK_g==(-1));
+HDassert(H5E_CANTCORK_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to cork an object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTCORK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTUNCORK_g==(-1));
+HDassert(H5E_CANTUNCORK_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to uncork an object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTUNCORK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Link related errors */
-assert(H5E_TRAVERSE_g==(-1));
+HDassert(H5E_TRAVERSE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Link traversal failure"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_TRAVERSE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_NLINKS_g==(-1));
+HDassert(H5E_NLINKS_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Too many soft links in path"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_NLINKS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_NOTREGISTERED_g==(-1));
+HDassert(H5E_NOTREGISTERED_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Link class not registered"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_NOTREGISTERED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTMOVE_g==(-1));
+HDassert(H5E_CANTMOVE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't move object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTSORT_g==(-1));
+HDassert(H5E_CANTSORT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't sort objects"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTSORT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Parallel MPI errors */
-assert(H5E_MPI_g==(-1));
+HDassert(H5E_MPI_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Some MPI function failed"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_MPI_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_MPIERRSTR_g==(-1));
+HDassert(H5E_MPIERRSTR_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "MPI Error String"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_MPIERRSTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTRECV_g==(-1));
+HDassert(H5E_CANTRECV_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't receive data"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTRECV_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTGATHER_g==(-1));
+HDassert(H5E_CANTGATHER_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't gather data"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTGATHER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_NO_INDEPENDENT_g==(-1));
+HDassert(H5E_NO_INDEPENDENT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't perform independent IO"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_NO_INDEPENDENT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Dataspace errors */
-assert(H5E_CANTCLIP_g==(-1));
+HDassert(H5E_CANTCLIP_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't clip hyperslab region"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTCLIP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTCOUNT_g==(-1));
+HDassert(H5E_CANTCOUNT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't count elements"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTCOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTSELECT_g==(-1));
+HDassert(H5E_CANTSELECT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't select hyperslab"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTSELECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTNEXT_g==(-1));
+HDassert(H5E_CANTNEXT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't move to next iterator location"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTNEXT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_BADSELECT_g==(-1));
+HDassert(H5E_BADSELECT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Invalid selection"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_BADSELECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTCOMPARE_g==(-1));
+HDassert(H5E_CANTCOMPARE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't compare objects"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTCOMPARE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTAPPEND_g==(-1));
+HDassert(H5E_CANTAPPEND_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't append object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTAPPEND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Argument errors */
-assert(H5E_UNINITIALIZED_g==(-1));
+HDassert(H5E_UNINITIALIZED_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Information is uinitialized"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_UNINITIALIZED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_UNSUPPORTED_g==(-1));
+HDassert(H5E_UNSUPPORTED_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Feature is unsupported"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_UNSUPPORTED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_BADTYPE_g==(-1));
+HDassert(H5E_BADTYPE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Inappropriate type"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_BADTYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_BADRANGE_g==(-1));
+HDassert(H5E_BADRANGE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of range"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_BADRANGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_BADVALUE_g==(-1));
+HDassert(H5E_BADVALUE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad value"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_BADVALUE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* B-tree related errors */
-assert(H5E_NOTFOUND_g==(-1));
+HDassert(H5E_NOTFOUND_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Object not found"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_NOTFOUND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_EXISTS_g==(-1));
+HDassert(H5E_EXISTS_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_EXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTENCODE_g==(-1));
+HDassert(H5E_CANTENCODE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to encode value"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTENCODE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTDECODE_g==(-1));
+HDassert(H5E_CANTDECODE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decode value"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTDECODE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTSPLIT_g==(-1));
+HDassert(H5E_CANTSPLIT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to split node"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTSPLIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTREDISTRIBUTE_g==(-1));
+HDassert(H5E_CANTREDISTRIBUTE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to redistribute records"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTREDISTRIBUTE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTSWAP_g==(-1));
+HDassert(H5E_CANTSWAP_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to swap records"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTSWAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTINSERT_g==(-1));
+HDassert(H5E_CANTINSERT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to insert object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTINSERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTLIST_g==(-1));
+HDassert(H5E_CANTLIST_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to list node"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTMODIFY_g==(-1));
+HDassert(H5E_CANTMODIFY_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to modify record"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTMODIFY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_CANTREMOVE_g==(-1));
+HDassert(H5E_CANTREMOVE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to remove object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTREMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Datatype conversion errors */
-assert(H5E_CANTCONVERT_g==(-1));
+HDassert(H5E_CANTCONVERT_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't convert datatypes"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTCONVERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
-assert(H5E_BADSIZE_g==(-1));
+HDassert(H5E_BADSIZE_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad size for object"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_BADSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
diff --git a/src/H5Eint.c b/src/H5Eint.c
index ff2a860..166803b 100644
--- a/src/H5Eint.c
+++ b/src/H5Eint.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Eint.c
- * April 11 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5Eint.c
+ * April 11 2007
+ * Quincey Koziol <koziol@hdfgroup.org>
*
- * Purpose: General use, "internal" routines for error handling.
+ * Purpose: General use, "internal" routines for error handling.
*
*-------------------------------------------------------------------------
*/
@@ -32,11 +32,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Epkg.h" /* Error handling */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5Epkg.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
/****************/
@@ -107,21 +107,21 @@ hid_t H5E_ERR_CLS_g = FAIL;
/*
* variables used for MPI error reporting
*/
-char H5E_mpi_error_str[MPI_MAX_ERROR_STRING];
-int H5E_mpi_error_str_len;
+char H5E_mpi_error_str[MPI_MAX_ERROR_STRING];
+int H5E_mpi_error_str_len;
#endif /* H5_HAVE_PARALLEL */
-
+
/*-------------------------------------------------------------------------
- * Function: H5E_get_msg
+ * Function: H5E_get_msg
*
- * Purpose: Private function to retrieve an error message.
+ * Purpose: Private function to retrieve an error message.
*
* Return: Non-negative for name length if succeeds(zero means no name);
* otherwise returns negative value.
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Friday, July 14, 2003
*
*-------------------------------------------------------------------------
@@ -155,37 +155,37 @@ H5E_get_msg(const H5E_msg_t *msg, H5E_type_t *type, char *msg_str, size_t size)
} /* end H5E_get_msg() */
#ifndef H5_NO_DEPRECATED_SYMBOLS
-
+
/*-------------------------------------------------------------------------
- * Function: H5E_walk1_cb
+ * Function: H5E_walk1_cb
*
- * Purpose: This function is for backward compatibility.
+ * Purpose: This function is for backward compatibility.
* This is a default error stack traversal callback function
- * that prints error messages to the specified output stream.
- * This function is for backward compatibility with v1.6.
- * It is not meant to be called directly but rather as an
- * argument to the H5Ewalk() function. This function is called
- * also by H5Eprint(). Application writers are encouraged to
- * use this function as a model for their own error stack
- * walking functions.
+ * that prints error messages to the specified output stream.
+ * This function is for backward compatibility with v1.6.
+ * It is not meant to be called directly but rather as an
+ * argument to the H5Ewalk() function. This function is called
+ * also by H5Eprint(). Application writers are encouraged to
+ * use this function as a model for their own error stack
+ * walking functions.
*
- * N is a counter for how many times this function has been
- * called for this particular traversal of the stack. It always
- * begins at zero for the first error on the stack (either the
- * top or bottom error, or even both, depending on the traversal
- * direction and the size of the stack).
+ * N is a counter for how many times this function has been
+ * called for this particular traversal of the stack. It always
+ * begins at zero for the first error on the stack (either the
+ * top or bottom error, or even both, depending on the traversal
+ * direction and the size of the stack).
*
- * ERR_DESC is an error description. It contains all the
- * information about a particular error.
+ * ERR_DESC is an error description. It contains all the
+ * information about a particular error.
*
- * CLIENT_DATA is the same pointer that was passed as the
- * CLIENT_DATA argument of H5Ewalk(). It is expected to be a
- * file pointer (or stderr if null).
+ * CLIENT_DATA is the same pointer that was passed as the
+ * CLIENT_DATA argument of H5Ewalk(). It is expected to be a
+ * file pointer (or stderr if null).
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Raymond Lu
- * Thursday, May 11, 2006
+ * Thursday, May 11, 2006
*
*-------------------------------------------------------------------------
*/
@@ -193,12 +193,12 @@ static herr_t
H5E_walk1_cb(int n, H5E_error1_t *err_desc, void *client_data)
{
H5E_print_t *eprint = (H5E_print_t *)client_data;
- FILE *stream; /* I/O stream to print output to */
+ FILE *stream; /* I/O stream to print output to */
H5E_cls_t *cls_ptr; /* Pointer to error class */
H5E_msg_t *maj_ptr; /* Pointer to major error info */
H5E_msg_t *min_ptr; /* Pointer to minor error info */
- const char *maj_str = "No major description"; /* Major error description */
- const char *min_str = "No minor description"; /* Minor error description */
+ const char *maj_str = "No major description"; /* Major error description */
+ const char *min_str = "No minor description"; /* Minor error description */
unsigned have_desc = 1; /* Flag to indicate whether the error has a "real" description */
herr_t ret_value = SUCCEED;
@@ -239,7 +239,7 @@ H5E_walk1_cb(int n, H5E_error1_t *err_desc, void *client_data)
if(cls_ptr->lib_vers)
eprint->cls.lib_vers = cls_ptr->lib_vers;
- fprintf(stream, "%s-DIAG: Error detected in %s (%s) ",
+ HDfprintf(stream, "%s-DIAG: Error detected in %s (%s) ",
(cls_ptr->cls_name ? cls_ptr->cls_name : "(null)"),
(cls_ptr->lib_name ? cls_ptr->lib_name : "(null)"),
(cls_ptr->lib_vers ? cls_ptr->lib_vers : "(null)"));
@@ -249,22 +249,22 @@ H5E_walk1_cb(int n, H5E_error1_t *err_desc, void *client_data)
{
int mpi_rank, mpi_initialized, mpi_finalized;
- MPI_Initialized(&mpi_initialized);
+ MPI_Initialized(&mpi_initialized);
MPI_Finalized(&mpi_finalized);
if(mpi_initialized && !mpi_finalized) {
- MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
- fprintf(stream, "MPI-process %d", mpi_rank);
- } /* end if */
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+ HDfprintf(stream, "MPI-process %d", mpi_rank);
+ } /* end if */
else
- fprintf(stream, "thread 0");
+ HDfprintf(stream, "thread 0");
} /* end block */
#elif defined(H5_HAVE_THREADSAFE)
- fprintf(stream, "thread %lu", (unsigned long)HDpthread_self_ulong());
+ HDfprintf(stream, "thread %lu", (unsigned long)HDpthread_self_ulong());
#else
- fprintf(stream, "thread 0");
+ HDfprintf(stream, "thread 0");
#endif
- fprintf(stream, ":\n");
+ HDfprintf(stream, ":\n");
} /* end if */
/* Check for "real" error description - used to format output more nicely */
@@ -272,47 +272,47 @@ H5E_walk1_cb(int n, H5E_error1_t *err_desc, void *client_data)
have_desc=0;
/* Print error message */
- fprintf(stream, "%*s#%03d: %s line %u in %s()%s%s\n",
- H5E_INDENT, "", n, err_desc->file_name, err_desc->line,
- err_desc->func_name, (have_desc ? ": " : ""),
+ HDfprintf(stream, "%*s#%03d: %s line %u in %s()%s%s\n",
+ H5E_INDENT, "", n, err_desc->file_name, err_desc->line,
+ err_desc->func_name, (have_desc ? ": " : ""),
(have_desc ? err_desc->desc : ""));
- fprintf(stream, "%*smajor: %s\n", (H5E_INDENT * 2), "", maj_str);
- fprintf(stream, "%*sminor: %s\n", (H5E_INDENT * 2), "", min_str);
+ HDfprintf(stream, "%*smajor: %s\n", (H5E_INDENT * 2), "", maj_str);
+ HDfprintf(stream, "%*sminor: %s\n", (H5E_INDENT * 2), "", min_str);
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5E_walk1_cb() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
+
/*-------------------------------------------------------------------------
- * Function: H5E_walk2_cb
+ * Function: H5E_walk2_cb
*
- * Purpose: This is a default error stack traversal callback function
- * that prints error messages to the specified output stream.
- * It is not meant to be called directly but rather as an
- * argument to the H5Ewalk2() function. This function is
- * called also by H5Eprint2(). Application writers are
- * encouraged to use this function as a model for their own
- * error stack walking functions.
+ * Purpose: This is a default error stack traversal callback function
+ * that prints error messages to the specified output stream.
+ * It is not meant to be called directly but rather as an
+ * argument to the H5Ewalk2() function. This function is
+ * called also by H5Eprint2(). Application writers are
+ * encouraged to use this function as a model for their own
+ * error stack walking functions.
*
- * N is a counter for how many times this function has been
- * called for this particular traversal of the stack. It always
- * begins at zero for the first error on the stack (either the
- * top or bottom error, or even both, depending on the traversal
- * direction and the size of the stack).
+ * N is a counter for how many times this function has been
+ * called for this particular traversal of the stack. It always
+ * begins at zero for the first error on the stack (either the
+ * top or bottom error, or even both, depending on the traversal
+ * direction and the size of the stack).
*
- * ERR_DESC is an error description. It contains all the
- * information about a particular error.
+ * ERR_DESC is an error description. It contains all the
+ * information about a particular error.
*
- * CLIENT_DATA is the same pointer that was passed as the
- * CLIENT_DATA argument of H5Ewalk(). It is expected to be a
- * file pointer (or stderr if null).
+ * CLIENT_DATA is the same pointer that was passed as the
+ * CLIENT_DATA argument of H5Ewalk(). It is expected to be a
+ * file pointer (or stderr if null).
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Friday, December 12, 1997
+ * Programmer: Robb Matzke
+ * Friday, December 12, 1997
*
*-------------------------------------------------------------------------
*/
@@ -320,12 +320,12 @@ static herr_t
H5E_walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data)
{
H5E_print_t *eprint = (H5E_print_t *)client_data;
- FILE *stream; /* I/O stream to print output to */
+ FILE *stream; /* I/O stream to print output to */
H5E_cls_t *cls_ptr; /* Pointer to error class */
H5E_msg_t *maj_ptr; /* Pointer to major error info */
H5E_msg_t *min_ptr; /* Pointer to minor error info */
- const char *maj_str = "No major description"; /* Major error description */
- const char *min_str = "No minor description"; /* Minor error description */
+ const char *maj_str = "No major description"; /* Major error description */
+ const char *min_str = "No minor description"; /* Minor error description */
unsigned have_desc = 1; /* Flag to indicate whether the error has a "real" description */
herr_t ret_value = SUCCEED;
@@ -371,7 +371,7 @@ H5E_walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data)
if(cls_ptr->lib_vers)
eprint->cls.lib_vers = cls_ptr->lib_vers;
- fprintf(stream, "%s-DIAG: Error detected in %s (%s) ",
+ HDfprintf(stream, "%s-DIAG: Error detected in %s (%s) ",
(cls_ptr->cls_name ? cls_ptr->cls_name : "(null)"),
(cls_ptr->lib_name ? cls_ptr->lib_name : "(null)"),
(cls_ptr->lib_vers ? cls_ptr->lib_vers : "(null)"));
@@ -381,22 +381,22 @@ H5E_walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data)
{
int mpi_rank, mpi_initialized, mpi_finalized;
- MPI_Initialized(&mpi_initialized);
+ MPI_Initialized(&mpi_initialized);
MPI_Finalized(&mpi_finalized);
if(mpi_initialized && !mpi_finalized) {
- MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
- fprintf(stream, "MPI-process %d", mpi_rank);
- } /* end if */
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+ HDfprintf(stream, "MPI-process %d", mpi_rank);
+ } /* end if */
else
- fprintf(stream, "thread 0");
+ HDfprintf(stream, "thread 0");
} /* end block */
#elif defined(H5_HAVE_THREADSAFE)
- fprintf(stream, "thread %lu", (unsigned long)HDpthread_self_ulong());
+ HDfprintf(stream, "thread %lu", (unsigned long)HDpthread_self_ulong());
#else
- fprintf(stream, "thread 0");
+ HDfprintf(stream, "thread 0");
#endif
- fprintf(stream, ":\n");
+ HDfprintf(stream, ":\n");
} /* end if */
/* Check for "real" error description - used to format output more nicely */
@@ -404,20 +404,20 @@ H5E_walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data)
have_desc = 0;
/* Print error message */
- fprintf(stream, "%*s#%03u: %s line %u in %s()%s%s\n",
- H5E_INDENT, "", n, err_desc->file_name, err_desc->line,
- err_desc->func_name, (have_desc ? ": " : ""),
+ HDfprintf(stream, "%*s#%03u: %s line %u in %s()%s%s\n",
+ H5E_INDENT, "", n, err_desc->file_name, err_desc->line,
+ err_desc->func_name, (have_desc ? ": " : ""),
(have_desc ? err_desc->desc : ""));
- fprintf(stream, "%*smajor: %s\n", (H5E_INDENT * 2), "", maj_str);
- fprintf(stream, "%*sminor: %s\n", (H5E_INDENT * 2), "", min_str);
+ HDfprintf(stream, "%*smajor: %s\n", (H5E_INDENT * 2), "", maj_str);
+ HDfprintf(stream, "%*sminor: %s\n", (H5E_INDENT * 2), "", min_str);
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5E_walk2_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5E_print
+ * Function: H5E_print
*
* Purpose: Private function to print the error stack in some default
* way. This is just a convenience function for H5Ewalk() and
@@ -427,7 +427,7 @@ done:
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, February 27, 1998
*
*-------------------------------------------------------------------------
@@ -475,34 +475,34 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5E_print() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5E_walk
+ * Function: H5E_walk
*
- * Purpose: Private function for H5Ewalk.
+ * Purpose: Private function for H5Ewalk.
* Walks the error stack, calling the specified function for
- * each error on the stack. The DIRECTION argument determines
- * whether the stack is walked from the inside out or the
- * outside in. The value H5E_WALK_UPWARD means begin with the
- * most specific error and end at the API; H5E_WALK_DOWNWARD
- * means to start at the API and end at the inner-most function
- * where the error was first detected.
+ * each error on the stack. The DIRECTION argument determines
+ * whether the stack is walked from the inside out or the
+ * outside in. The value H5E_WALK_UPWARD means begin with the
+ * most specific error and end at the API; H5E_WALK_DOWNWARD
+ * means to start at the API and end at the inner-most function
+ * where the error was first detected.
*
- * The function pointed to by STACK_FUNC will be called for
- * each error record in the error stack. It's arguments will
- * include an index number (beginning at zero regardless of
- * stack traversal direction), an error stack entry, and the
- * CLIENT_DATA pointer passed to H5E_print.
+ * The function pointed to by STACK_FUNC will be called for
+ * each error record in the error stack. It's arguments will
+ * include an index number (beginning at zero regardless of
+ * stack traversal direction), an error stack entry, and the
+ * CLIENT_DATA pointer passed to H5E_print.
*
- * The function FUNC is also provided for backward compatibility.
- * When BK_COMPATIBLE is set to be TRUE, FUNC is used to be
- * compatible with older library. If BK_COMPATIBLE is FALSE,
- * STACK_FUNC is used.
+ * The function FUNC is also provided for backward compatibility.
+ * When BK_COMPATIBLE is set to be TRUE, FUNC is used to be
+ * compatible with older library. If BK_COMPATIBLE is FALSE,
+ * STACK_FUNC is used.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Friday, December 12, 1997
+ * Programmer: Robb Matzke
+ * Friday, December 12, 1997
*
*-------------------------------------------------------------------------
*/
@@ -510,7 +510,7 @@ herr_t
H5E_walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *op,
void *client_data)
{
- int i; /* Local index variable */
+ int i; /* Local index variable */
herr_t ret_value = H5_ITER_CONT; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -521,7 +521,7 @@ H5E_walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *op
/* check args, but rather than failing use some default value */
if(direction != H5E_WALK_UPWARD && direction != H5E_WALK_DOWNWARD)
- direction = H5E_WALK_UPWARD;
+ direction = H5E_WALK_UPWARD;
/* Walk the stack if a callback function was given */
if(op->vers == 1) {
@@ -586,18 +586,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5E_walk() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5E_get_auto
+ * Function: H5E_get_auto
*
- * Purpose: Private function to return the current settings for the
+ * Purpose: Private function to return the current settings for the
* automatic error stack traversal function and its data
* for specific error stack. Either (or both) arguments may
* be null in which case the value is not returned.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* July 18, 2003
*
*-------------------------------------------------------------------------
@@ -618,26 +618,26 @@ H5E_get_auto(const H5E_t *estack, H5E_auto_op_t *op, void **client_data)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5E_get_auto2() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5E_set_auto
+ * Function: H5E_set_auto
*
- * Purpose: Private function to turn on or off automatic printing of
+ * Purpose: Private function to turn on or off automatic printing of
* errors for certain error stack. When turned on (non-null
* FUNC pointer) any API function which returns an error
* indication will first call FUNC passing it CLIENT_DATA
* as an argument.
*
- * The default values before this function is called are
- * H5Eprint2() with client data being the standard error stream,
- * stderr.
+ * The default values before this function is called are
+ * H5Eprint2() with client data being the standard error stream,
+ * stderr.
*
- * Automatic stack traversal is always in the H5E_WALK_DOWNWARD
- * direction.
+ * Automatic stack traversal is always in the H5E_WALK_DOWNWARD
+ * direction.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, February 27, 1998
*
*-------------------------------------------------------------------------
@@ -656,16 +656,16 @@ H5E_set_auto(H5E_t *estack, const H5E_auto_op_t *op, void *client_data)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5E_set_auto() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5E_printf_stack
+ * Function: H5E_printf_stack
*
- * Purpose: Printf-like wrapper around H5E__push_stack.
+ * Purpose: Printf-like wrapper around H5E__push_stack.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Tuesday, August 12, 2008
+ * Programmer: Quincey Koziol
+ * Tuesday, August 12, 2008
*
*-------------------------------------------------------------------------
*/
@@ -680,14 +680,14 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin
#endif /* H5_HAVE_VASPRINTF */
char *tmp = NULL; /* Buffer to place formatted description in */
hbool_t va_started = FALSE; /* Whether the variable argument list is open */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
/*
* WARNING: We cannot call HERROR() from within this function or else we
- * could enter infinite recursion. Furthermore, we also cannot
- * call any other HDF5 macro or function which might call
- * HERROR(). HERROR() is called by HRETURN_ERROR() which could
- * be called by FUNC_ENTER().
+ * could enter infinite recursion. Furthermore, we also cannot
+ * call any other HDF5 macro or function which might call
+ * HERROR(). HERROR() is called by HRETURN_ERROR() which could
+ * be called by FUNC_ENTER().
*/
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -753,24 +753,24 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5E_printf_stack() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5E__push_stack
+ * Function: H5E__push_stack
*
- * Purpose: Pushes a new error record onto error stack for the current
- * thread. The error has major and minor IDs MAJ_ID and
- * MIN_ID, the name of a function where the error was detected,
- * the name of the file where the error was detected, the
- * line within that file, and an error description string. The
- * function name, file name, and error description strings must
- * be statically allocated (the FUNC_ENTER() macro takes care of
- * the function name and file name automatically, but the
- * programmer is responsible for the description string).
+ * Purpose: Pushes a new error record onto error stack for the current
+ * thread. The error has major and minor IDs MAJ_ID and
+ * MIN_ID, the name of a function where the error was detected,
+ * the name of the file where the error was detected, the
+ * line within that file, and an error description string. The
+ * function name, file name, and error description strings must
+ * be statically allocated (the FUNC_ENTER() macro takes care of
+ * the function name and file name automatically, but the
+ * programmer is responsible for the description string).
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Friday, December 12, 1997
+ * Programmer: Robb Matzke
+ * Friday, December 12, 1997
*
*-------------------------------------------------------------------------
*/
@@ -778,14 +778,14 @@ herr_t
H5E__push_stack(H5E_t *estack, const char *file, const char *func, unsigned line,
hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
/*
* WARNING: We cannot call HERROR() from within this function or else we
- * could enter infinite recursion. Furthermore, we also cannot
- * call any other HDF5 macro or function which might call
- * HERROR(). HERROR() is called by HRETURN_ERROR() which could
- * be called by FUNC_ENTER().
+ * could enter infinite recursion. Furthermore, we also cannot
+ * call any other HDF5 macro or function which might call
+ * HERROR(). HERROR() is called by HRETURN_ERROR() which could
+ * be called by FUNC_ENTER().
*/
FUNC_ENTER_PACKAGE_NOERR
@@ -796,7 +796,7 @@ H5E__push_stack(H5E_t *estack, const char *file, const char *func, unsigned line
/* Check for 'default' error stack */
if(estack == NULL)
- if(NULL == (estack = H5E_get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */
+ if(NULL == (estack = H5E_get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */
HGOTO_DONE(FAIL)
/*
@@ -819,37 +819,37 @@ H5E__push_stack(H5E_t *estack, const char *file, const char *func, unsigned line
/* Increment the IDs to indicate that they are used in this stack */
if(H5I_inc_ref(cls_id, FALSE) < 0)
HGOTO_DONE(FAIL)
- estack->slot[estack->nused].cls_id = cls_id;
+ estack->slot[estack->nused].cls_id = cls_id;
if(H5I_inc_ref(maj_id, FALSE) < 0)
HGOTO_DONE(FAIL)
- estack->slot[estack->nused].maj_num = maj_id;
+ estack->slot[estack->nused].maj_num = maj_id;
if(H5I_inc_ref(min_id, FALSE) < 0)
HGOTO_DONE(FAIL)
- estack->slot[estack->nused].min_num = min_id;
- if(NULL == (estack->slot[estack->nused].func_name = H5MM_xstrdup(func)))
+ estack->slot[estack->nused].min_num = min_id;
+ if(NULL == (estack->slot[estack->nused].func_name = H5MM_xstrdup(func)))
HGOTO_DONE(FAIL)
- if(NULL == (estack->slot[estack->nused].file_name = H5MM_xstrdup(file)))
+ if(NULL == (estack->slot[estack->nused].file_name = H5MM_xstrdup(file)))
HGOTO_DONE(FAIL)
- estack->slot[estack->nused].line = line;
- if(NULL == (estack->slot[estack->nused].desc = H5MM_xstrdup(desc)))
+ estack->slot[estack->nused].line = line;
+ if(NULL == (estack->slot[estack->nused].desc = H5MM_xstrdup(desc)))
HGOTO_DONE(FAIL)
- estack->nused++;
+ estack->nused++;
} /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5E__push_stack() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5E_clear_entries
+ * Function: H5E_clear_entries
*
- * Purpose: Private function to clear the error stack entries for the
+ * Purpose: Private function to clear the error stack entries for the
* specified error stack.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, August 6, 2003
*
*-------------------------------------------------------------------------
@@ -896,16 +896,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5E_clear_entries() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5E_clear_stack
+ * Function: H5E_clear_stack
*
- * Purpose: Private function to clear the error stack for the
+ * Purpose: Private function to clear the error stack for the
* specified error stack.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Wednesday, July 16, 2003
*
*-------------------------------------------------------------------------
@@ -919,7 +919,7 @@ H5E_clear_stack(H5E_t *estack)
/* Check for 'default' error stack */
if(estack == NULL)
- if(NULL == (estack = H5E_get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */
+ if(NULL == (estack = H5E_get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */
HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack")
/* Empty the error stack */
@@ -932,16 +932,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5E_clear_stack() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5E_pop
+ * Function: H5E_pop
*
- * Purpose: Private function to delete some error messages from the top
+ * Purpose: Private function to delete some error messages from the top
* of error stack.
*
- * Return: Non-negative value on success/Negative on failure
+ * Return: Non-negative value on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Friday, July 16, 2003
*
*-------------------------------------------------------------------------
@@ -965,17 +965,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5E_pop() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5E_dump_api_stack
+ * Function: H5E_dump_api_stack
*
- * Purpose: Private function to dump the error stack during an error in
+ * Purpose: Private function to dump the error stack during an error in
* an API function if a callback function is defined for the
* current error stack.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, August 6, 2003
*
*-------------------------------------------------------------------------
@@ -996,7 +996,7 @@ H5E_dump_api_stack(hbool_t is_api)
#ifdef H5_NO_DEPRECATED_SYMBOLS
if(estack->auto_op.func2)
(void)((estack->auto_op.func2)(H5E_DEFAULT, estack->auto_data));
-#else /* H5_NO_DEPRECATED_SYMBOLS */
+#else /* H5_NO_DEPRECATED_SYMBOLS */
if(estack->auto_op.vers == 1) {
if(estack->auto_op.func1)
(void)((estack->auto_op.func1)(estack->auto_data));
diff --git a/src/H5FAtest.c b/src/H5FAtest.c
index 4b03036..1531fa3 100644
--- a/src/H5FAtest.c
+++ b/src/H5FAtest.c
@@ -32,11 +32,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FApkg.h" /* Fixed Arrays */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5VMprivate.h" /* Vector functions */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FApkg.h" /* Fixed Arrays */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -112,7 +112,7 @@ const H5FA_class_t H5FA_CLS_TEST[1]={{
H5FL_DEFINE_STATIC(H5FA__test_ctx_t);
-
+
/*-------------------------------------------------------------------------
* Function: H5FA__test_crt_context
*
@@ -147,7 +147,7 @@ CATCH
END_FUNC(STATIC) /* end H5FA__test_crt_context() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FA__test_dst_context
*
@@ -175,7 +175,7 @@ H5FA__test_dst_context(void *_ctx))
END_FUNC(STATIC) /* end H5FA__test_dst_context() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FA__test_fill
*
@@ -203,7 +203,7 @@ H5FA__test_fill(void *nat_blk, size_t nelmts))
END_FUNC(STATIC) /* end H5FA__test_fill() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FA__test_encode
*
@@ -247,7 +247,7 @@ H5FA__test_encode(void *raw, const void *_elmt, size_t nelmts, void H5_ATTR_UNUS
END_FUNC(STATIC) /* end H5FA__test_encode() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FA__test_decode
*
@@ -292,7 +292,7 @@ H5FA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void H5_ATTR_UNU
END_FUNC(STATIC) /* end H5FA__test_decode() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FA__test_debug
*
@@ -318,13 +318,13 @@ H5FA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx,
HDassert(elmt);
/* Print element */
- sprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
+ HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
HDfprintf(stream, "%*s%-*s %llu\n", indent, "", fwidth, temp_str,
(unsigned long long)*(const uint64_t *)elmt);
END_FUNC(STATIC) /* end H5FA__test_debug() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FA__test_crt_dbg_context
*
@@ -359,7 +359,7 @@ CATCH
END_FUNC(STATIC) /* end H5FA__test_crt_dbg_context() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FA_get_cparam_test
*
@@ -386,7 +386,7 @@ H5FA_get_cparam_test(const H5FA_t *fa, H5FA_create_t *cparam))
END_FUNC(PRIV) /* end H5FA_get_cparam_test() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FA_cmp_cparam_test
*
diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c
new file mode 100644
index 0000000..819d200
--- /dev/null
+++ b/src/H5FDhdfs.c
@@ -0,0 +1,2167 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Read-Only HDFS Virtual File Driver (VFD) *
+ * Copyright (c) 2018, The HDF Group. *
+ * *
+ * All rights reserved. *
+ * *
+ * NOTICE: *
+ * All information contained herein is, and remains, the property of The HDF *
+ * Group. The intellectual and technical concepts contained herein are *
+ * proprietary to The HDF Group. Dissemination of this information or *
+ * reproduction of this material is strictly forbidden unless prior written *
+ * permission is obtained from The HDF Group. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Jacob Smith
+ * 2018-04-23
+ *
+ * Purpose: Provide read-only access to files on the Hadoop Distributed
+ * File System (HDFS).
+ */
+
+/* This source code file is part of the H5FD driver module */
+#include "H5FDdrvr_module.h"
+
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDhdfs.h" /* hdfs file driver */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+
+#ifdef H5_HAVE_LIBHDFS
+#include "hdfs.h"
+#endif
+
+/* toggle function call prints: 1 turns on */
+#define HDFS_DEBUG 0
+
+/* toggle stats collection and reporting */
+#define HDFS_STATS 0
+
+/* The driver identification number, initialized at runtime */
+static hid_t H5FD_HDFS_g = 0;
+
+#if HDFS_STATS
+
+/* arbitrarily large value, such that any reasonable size read will be "less"
+ * than this value and set a true minimum
+ * not 0 because that may be a valid recorded minimum in degenerate cases
+ */
+#define HDFS_STATS_STARTING_MIN 0xfffffffful
+
+/* Configuration definitions for stats collection and breakdown
+ *
+ * 2^10 = 1024
+ * Reads up to 1024 bytes (1 kB) fall in bin 0
+ * 2^(10+(1*16)) = 2^26 = 64MB
+ * Reads of 64MB or greater fall in "overflow" bin[BIN_COUNT]
+ */
+#define HDFS_STATS_BASE 2
+#define HDFS_STATS_INTERVAL 1
+#define HDFS_STATS_START_POWER 10
+#define HDFS_STATS_BIN_COUNT 16 /* MUST BE GREATER THAN 0 */
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Calculate `BASE ^ (START_POWER + (INTERVAL * bin_i))`
+ * Stores result at `(unsigned long long *) out_ptr`.
+ * Used in computing boundaries between stats bins.
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+#define HDFS_STATS_POW(bin_i, out_ptr) { \
+ unsigned long long donotshadowresult = 1; \
+ unsigned donotshadowindex = 0; \
+ for (donotshadowindex = 0; \
+ donotshadowindex < (((bin_i) * HDFS_STATS_INTERVAL) + \
+ HDFS_STATS_START_POWER); \
+ donotshadowindex++) \
+ { \
+ donotshadowresult *= HDFS_STATS_BASE; \
+ } \
+ *(out_ptr) = donotshadowresult; \
+}
+
+/* array to hold pre-computed boundaries for stats bins */
+static unsigned long long hdfs_stats_boundaries[HDFS_STATS_BIN_COUNT];
+
+
+/***************************************************************************
+ *
+ * Structure: hdfs_statsbin
+ *
+ * Purpose:
+ *
+ * Structure for storing per-file hdfs VFD usage statistics.
+ *
+ *
+ *
+ * `count` (unsigned long long)
+ *
+ * Number of reads with size in this bin's range.
+ *
+ * `bytes` (unsigned long long)
+ *
+ * Total number of bytes read through this bin.
+ *
+ * `min` (unsigned long long)
+ *
+ * Smallest read size in this bin.
+ *
+ * `max` (unsigned long long)
+ *
+ * Largest read size in this bin.
+ *
+ *
+ *
+ * Programmer: Jacob Smith
+ *
+ * Changes: None
+ *
+ ***************************************************************************/
+typedef struct {
+ unsigned long long count;
+ unsigned long long bytes;
+ unsigned long long min;
+ unsigned long long max;
+} hdfs_statsbin;
+
+#endif /* HDFS_STATS */
+
+#ifdef H5_HAVE_LIBHDFS
+
+/* "unique" identifier for `hdfs_t` structures.
+ * Randomly generated by unweighted dice rolls.
+ */
+#define HDFS_HDFST_MAGIC 0x1AD5DE84
+
+
+/***************************************************************************
+ *
+ * Structure: hdfs_t
+ *
+ * Purpose:
+ *
+ * Contain/retain information associated with a file hosted on Hadoop
+ * Distributed File System (HDFS). Instantiated and populated via
+ * `H5FD_hdfs_handle_open()` and cleaned up via `H5FD_hdfs_handle_close()`.
+ *
+ *
+ *
+ * `magic` (unisgned long)
+ *
+ * Number to indicate that this structure is of the promised
+ * type and should still be valid; should be HDFS_HDFST_MAGIC throughout
+ * the lifespan of the structure. Upon deletion of the structure, the
+ * programmer should set magic to anything but HDFS_HDFST_MAGIC, to
+ * indicate that the structure is to no longer be trusted.
+ *
+ * `filesystem` (hdfsFS)
+ *
+ * A libhdfs file system handle.
+ *
+ * `fileinfo` (hdfsFileInfo*)
+ *
+ * A pointer to a libhdfs file info structure.
+ *
+ * `file` (hdfsFile)
+ *
+ * A libhdfs file handle.
+ *
+ *
+ *
+ * Programmer: Jacob Smith
+ * May 2018
+ *
+ * Changes: None
+ *
+ ***************************************************************************
+ */
+typedef struct {
+ unsigned long magic;
+ hdfsFS filesystem;
+ hdfsFileInfo *fileinfo;
+ hdfsFile file;
+} hdfs_t;
+
+
+/*--------------------------------------------------------------------------
+ * Function: H5FD_hdfs_handle_open
+ *
+ * Purpose: Create a HDFS file handle, 'opening' the target file.
+ *
+ * Return: Success: Pointer to HDFS container/handle of opened file.
+ * Failure: NULL
+ *
+ * Programmer: Gerd Herber
+ * May 2018
+ *
+ * Changes: None.
+ *--------------------------------------------------------------------------
+ */
+static hdfs_t *
+H5FD_hdfs_handle_open(
+ const char *path,
+ const char *namenode_name,
+ const int32_t namenode_port,
+ const char *user_name,
+ const char *kerberos_ticket_cache,
+ const int32_t stream_buffer_size)
+{
+ struct hdfsBuilder *builder = NULL;
+ hdfs_t *handle = NULL;
+ hdfs_t *ret_value = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "called H5FD_hdfs_handle_open.\n");
+#endif
+
+ if (path == NULL || path[0] == '\0') {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "path cannot be null.\n")
+ }
+ if (namenode_name == NULL /* || namenode_name[0] == '\0' */ ) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "namenode name cannot be null.\n")
+ }
+ if (namenode_port < 0 || namenode_port > 65535) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "namenode port must be non-negative and <= 65535.\n")
+ }
+ if (stream_buffer_size < 0) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "buffer size must non-negative.\n")
+ }
+
+ handle = (hdfs_t *)H5MM_malloc(sizeof(hdfs_t));
+ if (handle == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL,
+ "could not malloc space for handle.\n")
+ }
+
+ handle->magic = (unsigned long)HDFS_HDFST_MAGIC;
+ handle->filesystem = NULL; /* TODO: not a pointer; NULL may cause bug */
+ handle->fileinfo = NULL;
+ handle->file = NULL; /* TODO: not a pointer; NULL may cause bug */
+
+ builder = hdfsNewBuilder();
+ if (!builder) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "(hdfs) failed to create builder")
+ }
+ hdfsBuilderSetNameNode(builder, namenode_name);
+ hdfsBuilderSetNameNodePort(builder, (tPort)namenode_port);
+ if (user_name != NULL && user_name[0] != '\0') {
+ hdfsBuilderSetUserName(builder, user_name);
+ }
+ if (kerberos_ticket_cache != NULL && kerberos_ticket_cache[0] != '\0') {
+ hdfsBuilderSetKerbTicketCachePath(builder, kerberos_ticket_cache);
+ }
+ /* Call to `hdfsBuilderConnect` releases builder, regardless of success. */
+ handle->filesystem = hdfsBuilderConnect(builder);
+ if (!handle->filesystem) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "(hdfs) could not connect to default namenode")
+ }
+ handle->fileinfo = hdfsGetPathInfo(handle->filesystem, path);
+ if (!handle->fileinfo) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "hdfsGetPathInfo failed")
+ }
+ handle->file = hdfsOpenFile(
+ handle->filesystem,
+ path,
+ O_RDONLY,
+ stream_buffer_size,
+ 0,
+ 0);
+ if (!handle->file) {
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL,
+ "(hdfs) could not open")
+ }
+
+ ret_value = handle;
+
+done:
+ if (ret_value == NULL && handle != NULL) {
+ /* error; clean up */
+ HDassert(handle->magic == HDFS_HDFST_MAGIC);
+ handle->magic++;
+ if (handle->file != NULL) {
+ if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) {
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL,
+ "unable to close hdfs file handle")
+ }
+ }
+ if (handle->fileinfo != NULL) {
+ hdfsFreeFileInfo(handle->fileinfo, 1);
+ }
+ if (handle->filesystem != NULL) {
+ if (FAIL == (hdfsDisconnect(handle->filesystem))) {
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL,
+ "unable to disconnect from hdfs")
+ }
+ }
+ H5MM_xfree(handle);
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5FD_hdfs_handle_open() */
+
+
+/*--------------------------------------------------------------------------
+ * Function: H5FD_hdfs_handle_close
+ *
+ * Purpose: 'Close' an HDFS file container/handle, releasing underlying
+ * resources.
+ *
+ * Return: Success: `SUCCEED` (0)
+ * Failure: `FAIL` (-1)
+ *
+ * Programmer: Gerd Herber
+ * May 2018
+ *
+ * Changes: None.
+ *--------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_hdfs_handle_close(hdfs_t *handle)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "called H5FD_hdfs_close.\n");
+#endif
+
+ if (handle == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle cannot be null.\n")
+ }
+ if (handle->magic != HDFS_HDFST_MAGIC) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle has invalid magic.\n")
+ }
+
+ handle->magic++;
+ if (handle->file != NULL) {
+ if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) {
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
+ "unable to close hdfs file handle")
+ }
+ }
+ if (handle->fileinfo != NULL) {
+ hdfsFreeFileInfo(handle->fileinfo, 1);
+ }
+ if (handle->filesystem != NULL) {
+ if (FAIL == (hdfsDisconnect(handle->filesystem))) {
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
+ "unable to disconnect hdfs file system")
+ }
+ }
+
+ H5MM_xfree(handle);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5FD_hdfs_close() */
+
+#endif /* H5_HAVE_LIBHDFS */
+
+
+/***************************************************************************
+ *
+ * Structure: H5FD_hdfs_t
+ *
+ * Purpose:
+ *
+ * H5FD_hdfs_t is a structure used to store all information needed to
+ * maintain R/O access to a single HDF5 file in an HDFS file system.
+ * This structure is created when such a file is "opened" and
+ * discarded when it is "closed".
+ *
+ *
+ * `pub` (H5FD_t)
+ *
+ * Instance of H5FD_t which contains all fields common to all VFDs.
+ * It must be the first item in this structure, since at higher levels,
+ * this structure will be treated as an instance of H5FD_t.
+ *
+ * `fa` (H5FD_hdfs_fapl_t)
+ *
+ * Instance of `H5FD_hdfs_fapl_t` containing the HDFS configuration data
+ * needed to "open" the HDF5 file.
+ *
+ * `eoa` (haddr_t)
+ *
+ * End of addressed space in file. After open, it should always
+ * equal the file size.
+ *
+ * `hdfs_handle` (hdfs_t *)
+ *
+ * Instance of HDFS Request handle associated with the target resource.
+ * Responsible for communicating with remote host and presenting file
+ * contents as indistinguishable from a file on the local filesystem.
+ *
+ * *** present only if HDFS_SATS is flagged to enable stats collection ***
+ *
+ * `meta` (hdfs_statsbin[])
+ * `raw` (hdfs_statsbin[])
+ *
+ * Only present if hdfs stats collection is enabled.
+ *
+ * Arrays of `hdfs_statsbin` structures to record raw- and metadata reads.
+ *
+ * Records count and size of reads performed by the VFD, and is used to
+ * print formatted usage statistics to stdout upon VFD shutdown.
+ *
+ * Reads of each raw- and metadata type are recorded in an individual bin
+ * determined by the size of the read. The last bin of each type is
+ * reserved for "big" reads, with no defined upper bound.
+ *
+ * *** end HDFS_STATS ***
+ *
+ *
+ *
+ * Programmer: Jacob Smith
+ *
+ * Changes: None.
+ *
+ ***************************************************************************
+ */
+typedef struct H5FD_hdfs_t {
+ H5FD_t pub;
+ H5FD_hdfs_fapl_t fa;
+ haddr_t eoa;
+#ifdef H5_HAVE_LIBHDFS
+ hdfs_t *hdfs_handle;
+#endif
+#if HDFS_STATS
+ hdfs_statsbin meta[HDFS_STATS_BIN_COUNT + 1];
+ hdfs_statsbin raw[HDFS_STATS_BIN_COUNT + 1];
+#endif
+} H5FD_hdfs_t;
+
+/*
+ * These macros check for overflow of various quantities. These macros
+ * assume that HDoff_t is signed and haddr_t and size_t are unsigned.
+ *
+ * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t'
+ * is too large to be represented by the second argument
+ * of the file seek function.
+ * Only included if HDFS code should compile.
+ *
+ */
+#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1)
+#ifdef H5_HAVE_LIBHDFS
+#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR))
+#endif /* H5_HAVE_LIBHDFS */
+
+/* Prototypes */
+static herr_t H5FD_hdfs_term(void);
+static void *H5FD_hdfs_fapl_get(H5FD_t *_file);
+static void *H5FD_hdfs_fapl_copy(const void *_old_fa);
+static herr_t H5FD_hdfs_fapl_free(void *_fa);
+static H5FD_t *H5FD_hdfs_open(const char *name, unsigned flags, hid_t fapl_id,
+ haddr_t maxaddr);
+static herr_t H5FD_hdfs_close(H5FD_t *_file);
+static int H5FD_hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD_hdfs_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD_hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD_hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD_hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD_hdfs_get_handle(H5FD_t *_file, hid_t fapl,
+ void** file_handle);
+static herr_t H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
+ haddr_t addr, size_t size, void *buf);
+static herr_t H5FD_hdfs_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
+ haddr_t addr, size_t size, const void *buf);
+static herr_t H5FD_hdfs_truncate(H5FD_t *_file, hid_t dxpl_id,
+ hbool_t closing);
+static herr_t H5FD_hdfs_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD_hdfs_unlock(H5FD_t *_file);
+static herr_t H5FD_hdfs_validate_config(const H5FD_hdfs_fapl_t * fa);
+
+static const H5FD_class_t H5FD_hdfs_g = {
+ "hdfs", /* name */
+ MAXADDR, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD_hdfs_term, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ sizeof(H5FD_hdfs_fapl_t), /* fapl_size */
+ H5FD_hdfs_fapl_get, /* fapl_get */
+ H5FD_hdfs_fapl_copy, /* fapl_copy */
+ H5FD_hdfs_fapl_free, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD_hdfs_open, /* open */
+ H5FD_hdfs_close, /* close */
+ H5FD_hdfs_cmp, /* cmp */
+ H5FD_hdfs_query, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD_hdfs_get_eoa, /* get_eoa */
+ H5FD_hdfs_set_eoa, /* set_eoa */
+ H5FD_hdfs_get_eof, /* get_eof */
+ H5FD_hdfs_get_handle, /* get_handle */
+ H5FD_hdfs_read, /* read */
+ H5FD_hdfs_write, /* write */
+ NULL, /* flush */
+ H5FD_hdfs_truncate, /* truncate */
+ H5FD_hdfs_lock, /* lock */
+ H5FD_hdfs_unlock, /* unlock */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
+};
+
+#ifdef H5_HAVE_LIBHDFS
+/* Declare a free list to manage the H5FD_hdfs_t struct */
+H5FL_DEFINE_STATIC(H5FD_hdfs_t);
+#endif /* H5_HAVE_LIBHDFS */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD__init_package
+ *
+ * Purpose: Initializes any interface-specific data or routines.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Changes: Rename as appropriate for hdfs vfd.
+ * Jacob Smith 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__init_package(void)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
+
+ if (H5FD_hdfs_init() < 0) {
+ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL,
+ "unable to initialize hdfs VFD")
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5FD__init_package() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_hdfs_init
+ *
+ * Purpose: Initialize this driver by registering the driver with the
+ * library.
+ *
+ * Return: Success: The driver ID for the hdfs driver.
+ * Failure: Negative
+ *
+ * Programmer: Robb Matzke
+ * Thursday, July 29, 1999
+ *
+ * Changes: Rename as appropriate for hdfs vfd.
+ * Jacob Smith 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+H5FD_hdfs_init(void)
+{
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ unsigned int bin_i;
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_init() called.\n");
+#endif
+
+ if (H5I_VFL != H5I_get_type(H5FD_HDFS_g)) {
+ H5FD_HDFS_g = H5FD_register(
+ &H5FD_hdfs_g,
+ sizeof(H5FD_class_t),
+ FALSE);
+ }
+
+#if HDFS_STATS
+ /* pre-compute statsbin boundaries
+ */
+ for (bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++) {
+ unsigned long long value = 0;
+ HDFS_STATS_POW(bin_i, &value)
+ hdfs_stats_boundaries[bin_i] = value;
+ }
+#endif
+
+ ret_value = H5FD_HDFS_g;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* end H5FD_hdfs_init() */
+
+
+/*---------------------------------------------------------------------------
+ * Function: H5FD_hdfs_term
+ *
+ * Purpose: Shut down the VFD
+ *
+ * Returns: SUCCEED (Can't fail)
+ *
+ * Programmer: Quincey Koziol
+ * Friday, Jan 30, 2004
+ *
+ * Changes: Rename as appropriate for hdfs vfd.
+ * Jacob Smith 2018
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_hdfs_term(void)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_term() called.\n");
+#endif
+
+ /* Reset VFL ID */
+ H5FD_HDFS_g = 0;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FD_hdfs_term() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_fapl_hdfs
+ *
+ * Purpose: Modify the file access property list to use the H5FD_HDFS
+ * driver defined in this source file. All driver specfic
+ * properties are passed in as a pointer to a suitably
+ * initialized instance of H5FD_hdfs_fapl_t
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: John Mainzer
+ * 9/10/17
+ *
+ * Changes: Rename as appropriate for hdfs vfd.
+ * Jacob Smith 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_fapl_hdfs(hid_t fapl_id,
+ H5FD_hdfs_fapl_t *fa)
+{
+ H5P_genplist_t *plist = NULL; /* Property list pointer */
+ herr_t ret_value = FAIL;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "i*x", fapl_id, fa);
+
+ HDassert(fa != NULL);
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5Pset_fapl_hdfs() called.\n");
+#endif
+
+ plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
+ if (plist == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \
+ "not a file access property list")
+ }
+
+ if (FAIL == H5FD_hdfs_validate_config(fa)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "invalid hdfs config")
+ }
+
+ ret_value = H5P_set_driver(plist, H5FD_HDFS, (void *)fa);
+
+done:
+ FUNC_LEAVE_API(ret_value)
+
+} /* H5Pset_fapl_hdfs() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_hdfs_validate_config()
+ *
+ * Purpose: Test to see if the supplied instance of H5FD_hdfs_fapl_t
+ * contains internally consistant data. Return SUCCEED if so,
+ * and FAIL otherwise.
+ *
+ * Note the difference between internally consistant and
+ * correct. As we will have to try to access the target
+ * object to determine whether the supplied data is correct,
+ * we will settle for internal consistancy at this point
+ *
+ * Return: SUCCEED if instance of H5FD_hdfs_fapl_t contains internally
+ * consistant data, FAIL otherwise.
+ *
+ * Programmer: Jacob Smith
+ * 9/10/17
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_hdfs_validate_config(const H5FD_hdfs_fapl_t * fa)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ HDassert(fa != NULL);
+
+ if ( fa->version != H5FD__CURR_HDFS_FAPL_T_VERSION ) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "Unknown H5FD_hdfs_fapl_t version");
+ }
+
+ if ( fa->namenode_port > 65535 ) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "Invalid namenode port number");
+ }
+ if ( fa->namenode_port < 0 ) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "Invalid namenode port number");
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5FD_hdfs_validate_config() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_fapl_hdfs
+ *
+ * Purpose: Returns information about the hdfs file access property
+ * list though the function arguments.
+ *
+ * Return: Success: Non-negative
+ *
+ * Failure: Negative
+ *
+ * Programmer: John Mainzer
+ * 9/10/17
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_fapl_hdfs(hid_t fapl_id,
+ H5FD_hdfs_fapl_t *fa_out)
+{
+ const H5FD_hdfs_fapl_t *fa = NULL;
+ H5P_genplist_t *plist = NULL;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "i*x", fapl_id, fa_out);
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5Pget_fapl_hdfs() called.\n");
+#endif
+
+ if (fa_out == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "fa_out is NULL")
+ }
+ plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
+ if (plist == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a file access list")
+ }
+ if (H5FD_HDFS != H5P_peek_driver(plist)) {
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL,
+ "incorrect VFL driver")
+ }
+
+ fa = (const H5FD_hdfs_fapl_t *)H5P_peek_driver_info(plist);
+ if (fa == NULL) {
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL,
+ "bad VFL driver info")
+ }
+
+ /* Copy the hdfs fapl data out */
+ HDmemcpy(fa_out, fa, sizeof(H5FD_hdfs_fapl_t));
+
+done:
+ FUNC_LEAVE_API(ret_value)
+
+} /* H5Pget_fapl_hdfs() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_hdfs_fapl_get
+ *
+ * Purpose: Gets a file access property list which could be used to
+ * create an identical file.
+ *
+ * Return: Success: Ptr to new file access property list value.
+ *
+ * Failure: NULL
+ *
+ * Programmer: John Mainzer
+ * 9/8/17
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5FD_hdfs_fapl_get(H5FD_t *_file)
+{
+ H5FD_hdfs_t *file = (H5FD_hdfs_t*)_file;
+ H5FD_hdfs_fapl_t *fa = NULL;
+ void *ret_value = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ fa = (H5FD_hdfs_fapl_t *)H5MM_calloc(sizeof(H5FD_hdfs_fapl_t));
+ if (fa == NULL) {
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
+ "memory allocation failed")
+ }
+
+ /* Copy the fields of the structure */
+ HDmemcpy(fa, &(file->fa), sizeof(H5FD_hdfs_fapl_t));
+
+ ret_value = fa;
+
+done:
+ if (ret_value == NULL && fa != NULL) {
+ H5MM_xfree(fa); /* clean up on error */
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5FD_hdfs_fapl_get() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_hdfs_fapl_copy
+ *
+ * Purpose: Copies the hdfs-specific file access properties.
+ *
+ * Return: Success: Ptr to a new property list
+ *
+ * Failure: NULL
+ *
+ * Programmer: John Mainzer
+ * 9/8/17
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5FD_hdfs_fapl_copy(const void *_old_fa)
+{
+ const H5FD_hdfs_fapl_t *old_fa = (const H5FD_hdfs_fapl_t*)_old_fa;
+ H5FD_hdfs_fapl_t *new_fa = NULL;
+ void *ret_value = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ new_fa = (H5FD_hdfs_fapl_t *)H5MM_malloc(sizeof(H5FD_hdfs_fapl_t));
+ if (new_fa == NULL) {
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
+ "memory allocation failed")
+ }
+
+ HDmemcpy(new_fa, old_fa, sizeof(H5FD_hdfs_fapl_t));
+ ret_value = new_fa;
+
+done:
+ if (ret_value == NULL && new_fa != NULL) {
+ H5MM_xfree(new_fa); /* clean up on error */
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5FD_hdfs_fapl_copy() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_hdfs_fapl_free
+ *
+ * Purpose: Frees the hdfs-specific file access properties.
+ *
+ * Return: SUCCEED (cannot fail)
+ *
+ * Programmer: John Mainzer
+ * 9/8/17
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_hdfs_fapl_free(void *_fa)
+{
+ H5FD_hdfs_fapl_t *fa = (H5FD_hdfs_fapl_t*)_fa;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ HDassert(fa != NULL); /* sanity check */
+
+ H5MM_xfree(fa);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+
+} /* H5FD_hdfs_fapl_free() */
+
+#if HDFS_STATS
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: hdfs_reset_stats()
+ *
+ * Purpose:
+ *
+ * Reset the stats collection elements in this virtual file structure.
+ *
+ * Clears any set data in stats bins; initializes/zeroes values.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ * - Occurs if the file is invalid somehow
+ *
+ * Programmer: Jacob Smith
+ * 2017-12-08
+ *
+ * Changes: None.
+ *
+ *----------------------------------------------------------------------------
+ */
+static herr_t
+hdfs_reset_stats(H5FD_hdfs_t *file)
+{
+ unsigned i = 0;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDprintf("hdfs_reset_stats() called\n");
+#endif
+
+ if (file == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "file was null")
+ }
+
+ for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
+ file->raw[i].bytes = 0;
+ file->raw[i].count = 0;
+ file->raw[i].min = (unsigned long long)HDFS_STATS_STARTING_MIN;
+ file->raw[i].max = 0;
+
+ file->meta[i].bytes = 0;
+ file->meta[i].count = 0;
+ file->meta[i].min = (unsigned long long)HDFS_STATS_STARTING_MIN;
+ file->meta[i].max = 0;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+
+} /* hdfs_reset_stats */
+#endif /* HDFS_STATS */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_open()
+ *
+ * Purpose:
+ *
+ * Create and/or opens a file as an HDF5 file.
+ *
+ * Any flag except H5F_ACC_RDONLY will cause an error.
+ *
+ * Return:
+ *
+ * Success: A pointer to a new file data structure.
+ * The public fields will be initialized by the caller, which is
+ * always H5FD_open().
+ *
+ * Failure: NULL
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-02
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_LIBHDFS
+static H5FD_t *
+H5FD_hdfs_open(
+ const char *path,
+ unsigned flags,
+ hid_t fapl_id,
+ haddr_t maxaddr)
+{
+ H5FD_t *ret_value = NULL;
+ H5FD_hdfs_t *file = NULL;
+ hdfs_t *handle = NULL;
+ H5FD_hdfs_fapl_t fa;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_open() called.\n");
+#endif /* HDFS_DEBUG */
+
+ /* Sanity check on file offsets */
+ HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t));
+
+ /* Check arguments */
+ if (!path || !*path) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "invalid file name")
+ }
+ if (0 == maxaddr || HADDR_UNDEF == maxaddr) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL,
+ "bogus maxaddr")
+ }
+ if (ADDR_OVERFLOW(maxaddr)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL,
+ "bogus maxaddr")
+ }
+ if (flags != H5F_ACC_RDONLY) {
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL,
+ "only Read-Only access allowed")
+ }
+ if (fapl_id == H5P_DEFAULT || fapl_id == H5P_FILE_ACCESS_DEFAULT) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "fapl cannot be H5P_DEFAULT")
+ }
+ if (FAIL == H5Pget_fapl_hdfs(fapl_id, &fa)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "can't get property list")
+ }
+
+ handle = H5FD_hdfs_handle_open(
+ path,
+ fa.namenode_name,
+ fa.namenode_port,
+ fa.user_name,
+ fa.kerberos_ticket_cache,
+ fa.stream_buffer_size);
+
+ if (handle == NULL) {
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL,
+ "could not open")
+ }
+
+ HDassert(handle->magic == HDFS_HDFST_MAGIC);
+
+ /* create new file struct
+ */
+ file = H5FL_CALLOC(H5FD_hdfs_t);
+ if (file == NULL) {
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
+ "unable to allocate file struct")
+ }
+ file->hdfs_handle = handle;
+ HDmemcpy(&(file->fa), &fa, sizeof(H5FD_hdfs_fapl_t));
+
+#if HDFS_STATS
+ if (FAIL == hdfs_reset_stats(file)) {
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL,
+ "unable to reset file statistics")
+ }
+#endif /* HDFS_STATS */
+
+ ret_value = (H5FD_t*)file;
+
+done:
+ if (ret_value == NULL) {
+ if (handle != NULL) {
+ if (FAIL == H5FD_hdfs_handle_close(handle)) {
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL,
+ "unable to close HDFS file handle")
+ }
+ }
+ if (file != NULL) {
+ file = H5FL_FREE(H5FD_hdfs_t, file);
+ }
+ } /* end if null return value (error) */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5FD_hdfs_open() */
+
+#else /* H5_HAVE_LIBHDFS not defined */
+
+static H5FD_t *
+H5FD_hdfs_open(
+ const char H5_ATTR_UNUSED *path,
+ unsigned H5_ATTR_UNUSED flags,
+ hid_t H5_ATTR_UNUSED fapl_id,
+ haddr_t H5_ATTR_UNUSED maxaddr)
+{
+ H5FD_t *ret_value = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL,
+ "Illegal open of unsupported virtual file (hdfs)");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5FD_hdfs_open() */
+
+#endif /* H5_HAVE_LIBHDFS */
+
+#if HDFS_STATS
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: hdfs_fprint_stats()
+ *
+ * Purpose:
+ *
+ * Tabulate and pretty-print statistics for this virtual file.
+ *
+ * Should be called upon file close.
+ *
+ * Shows number of reads and bytes read, broken down by
+ * "raw" (H5FD_MEM_DRAW)
+ * or "meta" (any other flag)
+ *
+ * Prints filename and listing of total number of reads and bytes read,
+ * both as a grand total and separate meta- and rawdata reads.
+ *
+ * If any reads were done, prints out two tables:
+ *
+ * 1. overview of raw- and metadata reads
+ * - min (smallest size read)
+ * - average of size read
+ * - k,M,G suffixes by powers of 1024 (2^10)
+ * - max (largest size read)
+ * 2. tabulation of "bins", sepraring reads into exponentially-larger
+ * ranges of size.
+ * - columns for number of reads, total bytes, and average size, with
+ * separate sub-colums for raw- and metadata reads.
+ * - each row represents one bin, identified by the top of its range
+ *
+ * Bin ranges can be modified with pound-defines at the top of this file.
+ *
+ * Bins without any reads in their bounds are not printed.
+ *
+ * An "overflow" bin is also present, to catch "big" reads.
+ *
+ * Output for all bins (and range ceiling and average size report)
+ * is divied by powers of 1024. By corollary, four digits before the decimal
+ * is valid.
+ *
+ * - 41080 bytes is represented by 40.177k, not 41.080k
+ * - 1004.831M represents approx. 1052642000 bytes
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ * - occurs if the file passed in is invalid
+ * - TODO: if stream is invalid? how can we check this?
+ *
+ * Programmer: Jacob Smith
+ *
+ * Changes: None.
+ *
+ *----------------------------------------------------------------------------
+ */
+static herr_t
+hdfs_fprint_stats(
+ FILE *stream,
+ const H5FD_hdfs_t *file)
+{
+ herr_t ret_value = SUCCEED;
+ parsed_url_t *purl = NULL;
+ unsigned i = 0;
+ unsigned long count_meta = 0;
+ unsigned long count_raw = 0;
+ double average_meta = 0.0;
+ double average_raw = 0.0;
+ unsigned long long min_meta = (unsigned long long)HDFS_STATS_STARTING_MIN;
+ unsigned long long min_raw = (unsigned long long)HDFS_STATS_STARTING_MIN;
+ unsigned long long max_meta = 0;
+ unsigned long long max_raw = 0;
+ unsigned long long bytes_raw = 0;
+ unsigned long long bytes_meta = 0;
+ double re_dub = 0.0; /* re-usable double variable */
+ unsigned suffix_i = 0;
+ const char suffixes[] = { ' ', 'K', 'M', 'G', 'T', 'P' };
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ if (stream == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "file stream cannot be null" )
+ }
+ if (file == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "file cannot be null")
+ }
+ if (file->hdfs_handle == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "hdfs handle cannot be null")
+ }
+ if (file->hdfs_handle->magic != HDFS_HDFST_MAGIC) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "hdfs handle has invalid magic")
+ }
+
+ /*******************
+ * AGGREGATE STATS *
+ *******************/
+
+ for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
+ const hdfs_statsbin *r = &file->raw[i];
+ const hdfs_statsbin *m = &file->meta[i];
+
+ if (m->min < min_meta) { min_meta = m->min; }
+ if (r->min < min_raw) { min_raw = r->min; }
+ if (m->max > max_meta) { max_meta = m->max; }
+ if (r->max > max_raw) { max_raw = r->max; }
+
+ count_raw += r->count;
+ count_meta += m->count;
+ bytes_raw += r->bytes;
+ bytes_meta += m->bytes;
+ }
+ if (count_raw > 0) {
+ average_raw = (double)bytes_raw / (double)count_raw;
+ }
+ if (count_meta > 0) {
+ average_meta = (double)bytes_meta / (double)count_meta;
+ }
+
+ /******************
+ * PRINT OVERVIEW *
+ ******************/
+
+ HDfprintf(stream, "TOTAL READS: %llu (%llu meta, %llu raw)\n",
+ count_raw + count_meta, count_meta, count_raw);
+ HDfprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n",
+ bytes_raw + bytes_meta, bytes_meta, bytes_raw);
+
+ if (count_raw + count_meta == 0) {
+ goto done;
+ }
+
+ /*************************
+ * PRINT AGGREGATE STATS *
+ *************************/
+
+ HDfprintf(stream, "SIZES meta raw\n");
+ HDfprintf(stream, " min ");
+ if (count_meta == 0) {
+ HDfprintf(stream, " 0.000 ");
+ } else {
+ re_dub = (double)min_meta;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ re_dub /= 1024.0;
+ }
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
+ }
+
+ if (count_raw == 0) {
+ HDfprintf(stream, " 0.000 \n");
+ } else {
+ re_dub = (double)min_raw;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ re_dub /= 1024.0;
+ }
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
+ }
+
+ HDfprintf(stream, " avg ");
+ re_dub = (double)average_meta;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ re_dub /= 1024.0;
+ }
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
+
+ re_dub = (double)average_raw;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ re_dub /= 1024.0;
+ }
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
+
+ HDfprintf(stream, " max ");
+ re_dub = (double)max_meta;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ re_dub /= 1024.0;
+ }
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
+
+ re_dub = (double)max_raw;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ re_dub /= 1024.0;
+ }
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
+
+ /******************************
+ * PRINT INDIVIDUAL BIN STATS *
+ ******************************/
+
+ HDfprintf(stream,
+ "BINS # of reads total bytes average size\n");
+ HDfprintf(stream,
+ " up-to meta raw meta raw meta raw\n");
+
+ for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
+ const hdfs_statsbin *m;
+ const hdfs_statsbin *r;
+ unsigned long long range_end = 0;
+ char bm_suffix = ' '; /* bytes-meta */
+ double bm_val = 0.0;
+ char br_suffix = ' '; /* bytes-raw */
+ double br_val = 0.0;
+ char am_suffix = ' '; /* average-meta */
+ double am_val = 0.0;
+ char ar_suffix = ' '; /* average-raw */
+ double ar_val = 0.0;
+
+ m = &file->meta[i];
+ r = &file->raw[i];
+ if (r->count == 0 && m->count == 0) {
+ continue;
+ }
+
+ range_end = hdfs_stats_boundaries[i];
+
+ if (i == HDFS_STATS_BIN_COUNT) {
+ range_end = hdfs_stats_boundaries[i-1];
+ HDfprintf(stream, ">");
+ } else {
+ HDfprintf(stream, " ");
+ }
+
+ bm_val = (double)m->bytes;
+ for (suffix_i = 0; bm_val >= 1024.0; suffix_i++) {
+ bm_val /= 1024.0;
+ }
+ HDassert(suffix_i < sizeof(suffixes));
+ bm_suffix = suffixes[suffix_i];
+
+ br_val = (double)r->bytes;
+ for (suffix_i = 0; br_val >= 1024.0; suffix_i++) {
+ br_val /= 1024.0;
+ }
+ HDassert(suffix_i < sizeof(suffixes));
+ br_suffix = suffixes[suffix_i];
+
+ if (m->count > 0) {
+ am_val = (double)(m->bytes) / (double)(m->count);
+ }
+ for (suffix_i = 0; am_val >= 1024.0; suffix_i++) {
+ am_val /= 1024.0;
+ }
+ HDassert(suffix_i < sizeof(suffixes));
+ am_suffix = suffixes[suffix_i];
+
+ if (r->count > 0) {
+ ar_val = (double)(r->bytes) / (double)(r->count);
+ }
+ for (suffix_i = 0; ar_val >= 1024.0; suffix_i++) {
+ ar_val /= 1024.0;
+ }
+ HDassert(suffix_i < sizeof(suffixes));
+ ar_suffix = suffixes[suffix_i];
+
+ re_dub = (double)range_end;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ re_dub /= 1024.0;
+ }
+ HDassert(suffix_i < sizeof(suffixes));
+
+ HDfprintf(
+ stream,
+ " %8.3f%c %7d %7d %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n",
+ re_dub, suffixes[suffix_i], /* bin ceiling */
+ m->count, /* metadata reads */
+ r->count, /* rawdata reads */
+ bm_val, bm_suffix, /* metadata bytes */
+ br_val, br_suffix, /* rawdata bytes */
+ am_val, am_suffix, /* metadata average */
+ ar_val, ar_suffix); /* rawdata average */
+ fflush(stream);
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* hdfs_fprint_stats */
+#endif /* HDFS_STATS */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_close()
+ *
+ * Purpose:
+ *
+ * Close an HDF5 file.
+ *
+ * Return:
+ *
+ * SUCCEED/FAIL
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-02
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_LIBHDFS
+
+static herr_t
+H5FD_hdfs_close(H5FD_t *_file)
+{
+ herr_t ret_value = SUCCEED;
+ H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_close() called.\n");
+#endif
+
+ /* Sanity checks
+ */
+ HDassert(file != NULL);
+ HDassert(file->hdfs_handle != NULL);
+ HDassert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC);
+
+ /* Close the underlying request handle
+ */
+ if (file->hdfs_handle != NULL) {
+ if (FAIL == H5FD_hdfs_handle_close(file->hdfs_handle)) {
+ HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
+ "unable to close HDFS file handle")
+ }
+ }
+
+#if HDFS_STATS
+ /* TODO: mechanism to re-target stats printout */
+ if (FAIL == hdfs_fprint_stats(stdout, file)) {
+ HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL,
+ "problem while writing file statistics")
+ }
+#endif /* HDFS_STATS */
+
+ /* Release the file info
+ */
+ file = H5FL_FREE(H5FD_hdfs_t, file);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_hdfs_close() */
+
+#else /* H5_HAVE_LIBHDFS not defined */
+
+static herr_t
+H5FD_hdfs_close(H5FD_t H5_ATTR_UNUSED *_file)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
+ "Illegal close of unsupported Virtual File (hdfs)")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_hdfs_close() */
+
+#endif /* H5_HAVE_LIBHDFS */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_cmp()
+ *
+ * Purpose:
+ *
+ * Compares two files using this driver by their HDFS-provided file info,
+ * field-by-field.
+ *
+ * Return:
+ * + Equivalent: 0
+ * + Not Equivalent: -1
+ *
+ * Programmer: Gerd Herber
+ * May 2018
+ *
+ * Changes:
+ *
+ * + Replace `if (ret_value == 0)` chain with `HGOTO_DONE` jumps.
+ * Jacob Smith 17 May 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_LIBHDFS
+
+static int
+H5FD_hdfs_cmp(
+ const H5FD_t *_f1,
+ const H5FD_t *_f2)
+{
+ int ret_value = 0;
+ const H5FD_hdfs_t *f1 = (const H5FD_hdfs_t *)_f1;
+ const H5FD_hdfs_t *f2 = (const H5FD_hdfs_t *)_f2;
+ hdfsFileInfo *finfo1 = NULL;
+ hdfsFileInfo *finfo2 = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_cmp() called.\n");
+#endif /* HDFS_DEBUG */
+
+ HDassert(f1->hdfs_handle != NULL);
+ HDassert(f2->hdfs_handle != NULL);
+ HDassert(f1->hdfs_handle->magic == HDFS_HDFST_MAGIC);
+ HDassert(f2->hdfs_handle->magic == HDFS_HDFST_MAGIC);
+
+ finfo1 = f1->hdfs_handle->fileinfo;
+ finfo2 = f2->hdfs_handle->fileinfo;
+ HDassert(finfo1 != NULL);
+ HDassert(finfo2 != NULL);
+
+ if (finfo1->mKind != finfo2->mKind) { HGOTO_DONE(-1); }
+ if (finfo1->mName != finfo2->mName) { HGOTO_DONE(-1); }
+ if (finfo1->mLastMod != finfo2->mLastMod) { HGOTO_DONE(-1); }
+ if (finfo1->mSize != finfo2->mSize) { HGOTO_DONE(-1); }
+ if (finfo1->mReplication != finfo2->mReplication) { HGOTO_DONE(-1); }
+ if (finfo1->mBlockSize != finfo2->mBlockSize) { HGOTO_DONE(-1); }
+ if (strcmp(finfo1->mOwner, finfo2->mOwner)) { HGOTO_DONE(-1); }
+ if (strcmp(finfo1->mGroup, finfo2->mGroup)) { HGOTO_DONE(-1); }
+ if (finfo1->mPermissions != finfo2->mPermissions) { HGOTO_DONE(-1); }
+ if (finfo1->mLastAccess != finfo2->mLastAccess) { HGOTO_DONE(-1); }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD_hdfs_cmp() */
+
+#else /* H5_HAVE_LIBHDFS not defined */
+
+static int
+H5FD_hdfs_cmp(
+ const H5FD_t H5_ATTR_UNUSED *_f1,
+ const H5FD_t H5_ATTR_UNUSED *_f2)
+{
+ int ret_value = 0;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD_hdfs_cmp() */
+
+#endif /* H5_HAVE_LIBHDFS */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_hdfs_query
+ *
+ * Purpose: Set the flags that this VFL driver is capable of supporting.
+ * (listed in H5FDpublic.h)
+ *
+ * Note that since the HDFS VFD is read only, most flags
+ * are irrelevant.
+ *
+ * The term "set" is highly misleading...
+ * stores/copies the supported flags in the out-pointer `flags`.
+ *
+ * Return: SUCCEED (Can't fail)
+ *
+ * Programmer: John Mainzer
+ * 9/11/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_hdfs_query(
+ const H5FD_t H5_ATTR_UNUSED *_file,
+ unsigned long *flags) /* out variable */
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_query() called.\n");
+#endif
+
+ if (flags) {
+ *flags = 0;
+ *flags |= H5FD_FEAT_DATA_SIEVE;
+ }
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5FD_hdfs_query() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_get_eoa()
+ *
+ * Purpose:
+ *
+ * Gets the end-of-address marker for the file. The EOA marker
+ * is the first address past the last byte allocated in the
+ * format address space.
+ *
+ * Return:
+ *
+ * The end-of-address marker.
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-02
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_LIBHDFS
+
+static haddr_t
+H5FD_hdfs_get_eoa(
+ const H5FD_t *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type)
+{
+ const H5FD_hdfs_t *file = (const H5FD_hdfs_t *)_file;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_get_eoa() called.\n");
+#endif
+
+ FUNC_LEAVE_NOAPI(file->eoa)
+} /* end H5FD_hdfs_get_eoa() */
+
+#else /* H5_HAVE_LIBHDFS not defined */
+
+static haddr_t
+H5FD_hdfs_get_eoa(
+ const H5FD_t H5_ATTR_UNUSED *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_get_eoa() called.\n");
+#endif
+
+ FUNC_LEAVE_NOAPI(0)
+} /* end H5FD_hdfs_get_eoa() */
+
+#endif /* H5_HAVE_LIBHDFS */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_set_eoa()
+ *
+ * Purpose:
+ *
+ * Set the end-of-address marker for the file.
+ *
+ * Return:
+ *
+ * SUCCEED (can't fail)
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-03
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_LIBHDFS
+
+static herr_t
+H5FD_hdfs_set_eoa(
+ H5FD_t *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type,
+ haddr_t addr)
+{
+ H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_set_eoa() called.\n");
+#endif
+
+ file->eoa = addr;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5FD_hdfs_set_eoa() */
+
+#else /* H5_HAVE_LIBHDFS not defined */
+
+static herr_t
+H5FD_hdfs_set_eoa(
+ H5FD_t H5_ATTR_UNUSED *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type,
+ haddr_t H5_ATTR_UNUSED addr)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_set_eoa() called.\n");
+#endif
+
+ FUNC_LEAVE_NOAPI(FAIL)
+} /* H5FD_hdfs_set_eoa() */
+
+#endif /* H5_HAVE_LIBHDFS */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_get_eof()
+ *
+ * Purpose:
+ *
+ * Returns the end-of-file marker.
+ *
+ * Return:
+ *
+ * EOF: the first address past the end of the "file", either the
+ * filesystem file or the HDF5 file.
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-02
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_LIBHDFS
+
+static haddr_t
+H5FD_hdfs_get_eof(
+ const H5FD_t *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type)
+{
+ const H5FD_hdfs_t *file = (const H5FD_hdfs_t *)_file;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_get_eof() called.\n");
+#endif
+
+ HDassert(file->hdfs_handle != NULL);
+ HDassert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC);
+
+ FUNC_LEAVE_NOAPI((size_t) file->hdfs_handle->fileinfo->mSize)
+} /* end H5FD_hdfs_get_eof() */
+
+#else /* H5_HAVE_LIBHDFS not defined */
+
+static haddr_t
+H5FD_hdfs_get_eof(
+ const H5FD_t H5_ATTR_UNUSED *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_get_eof() called.\n");
+#endif
+
+ FUNC_LEAVE_NOAPI((size_t)0)
+} /* end H5FD_hdfs_get_eof() */
+
+#endif /* H5_HAVE_LIBHDFS */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_get_handle()
+ *
+ * Purpose:
+ *
+ * Returns the HDFS handle (hdfs_t) of hdfs file driver.
+ *
+ * Returns:
+ *
+ * SUCCEED/FAIL
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-02
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_LIBHDFS
+
+static herr_t
+H5FD_hdfs_get_handle(
+ H5FD_t *_file,
+ hid_t H5_ATTR_UNUSED fapl,
+ void **file_handle)
+{
+ herr_t ret_value = SUCCEED;
+ H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_get_handle() called.\n");
+#endif /* HDFS_DEBUG */
+
+ if (!file_handle) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "file handle not valid")
+ }
+
+ *file_handle = file->hdfs_handle;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_hdfs_get_handle() */
+
+#else /* H5_HAVE_LIBHDFS not defined */
+
+static herr_t
+H5FD_hdfs_get_handle(
+ H5FD_t H5_ATTR_UNUSED *_file,
+ hid_t H5_ATTR_UNUSED fapl,
+ void H5_ATTR_UNUSED **file_handle)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_get_handle() called.\n");
+#endif /* HDFS_DEBUG */
+
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL,
+ "Illegal get-handle of unsupported virtual file (hdfs)");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_hdfs_get_handle() */
+
+#endif /* H5_HAVE_LIBHDFS */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_read()
+ *
+ * Purpose:
+ *
+ * Reads SIZE bytes of data from FILE beginning at address ADDR
+ * into buffer BUF according to data transfer properties in DXPL_ID.
+ *
+ * Return:
+ *
+ * Success: `SUCCEED`
+ * - Result is stored in caller-supplied buffer BUF.
+ * Failure: `FAIL`
+ * - Unable to complete read.
+ * - Contents of buffer `buf` are undefined.
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-??
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_LIBHDFS
+
+static herr_t
+H5FD_hdfs_read(
+ H5FD_t *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type,
+ hid_t H5_ATTR_UNUSED dxpl_id,
+ haddr_t addr, /* start offset */
+ size_t size, /* length of read */
+ void *buf) /* out */
+{
+ herr_t ret_value = SUCCEED;
+ H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
+ size_t filesize = 0;
+#if HDFS_STATS
+ /* working variables for storing stats */
+ hdfs_statsbin *bin = NULL;
+ unsigned bin_i = 0;
+#endif /* HDFS_STATS */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_read() called.\n");
+#endif /* HDFS_DEBUG */
+
+ HDassert(file != NULL);
+ HDassert(file->hdfs_handle != NULL);
+ HDassert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC);
+ HDassert(buf != NULL);
+
+ filesize = (size_t) file->hdfs_handle->fileinfo->mSize;
+
+ if ((addr > filesize) || ((addr + size) > filesize)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL,
+ "range exceeds file address")
+ }
+
+ if (FAIL == hdfsPread(
+ file->hdfs_handle->filesystem,
+ file->hdfs_handle->file,
+ (tOffset)addr,
+ buf,
+ (tSize)size))
+ {
+ HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL,
+ "unable to execute read")
+ }
+
+#if HDFS_STATS
+
+ /* Find which "bin" this read fits in. Can be "overflow" bin.
+ */
+ for (bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++) {
+ if ((unsigned long long)size < hdfs_stats_boundaries[bin_i]) {
+ break;
+ }
+ }
+ bin = (type == H5FD_MEM_DRAW)
+ ? &file->raw[bin_i]
+ : &file->meta[bin_i];
+
+ /* Store collected stats in appropriate bin
+ */
+ if (bin->count == 0) {
+ bin->min = size;
+ bin->max = size;
+ }
+ else {
+ if (size < bin->min) { bin->min = size; }
+ if (size > bin->max) { bin->max = size; }
+ }
+ bin->count++;
+ bin->bytes += (unsigned long long)size;
+
+#endif /* HDFS_STATS */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_hdfs_read() */
+
+#else /* H5_HAVE_LIBHDFS not defined */
+
+static herr_t
+H5FD_hdfs_read(
+ H5FD_t H5_ATTR_UNUSED *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type,
+ hid_t H5_ATTR_UNUSED dxpl_id,
+ haddr_t H5_ATTR_UNUSED addr,
+ size_t H5_ATTR_UNUSED size,
+ void H5_ATTR_UNUSED *buf)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_read() called.\n");
+#endif /* HDFS_DEBUG */
+
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL,
+ "Illegal get-handle of unsupported virtual file (hdfs)");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_hdfs_read() */
+
+#endif /* H5_HAVE_LIBHDFS */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_write()
+ *
+ * Purpose:
+ *
+ * Write bytes to file.
+ * UNSUPPORTED IN READ-ONLY HDFS VFD.
+ *
+ * Return:
+ *
+ * FAIL (Not possible with Read-Only S3 file.)
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-23
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_hdfs_write(
+ H5FD_t H5_ATTR_UNUSED *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type,
+ hid_t H5_ATTR_UNUSED dxpl_id,
+ haddr_t H5_ATTR_UNUSED addr,
+ size_t H5_ATTR_UNUSED size,
+ const void H5_ATTR_UNUSED *buf)
+{
+ herr_t ret_value = FAIL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_write() called.\n");
+#endif
+
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL,
+ "cannot write to read-only file.")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD_hdfs_write() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_truncate()
+ *
+ * Purpose:
+ *
+ * Makes sure that the true file size is the same (or larger)
+ * than the end-of-address.
+ *
+ * NOT POSSIBLE ON READ-ONLY S3 FILES.
+ *
+ * Return:
+ *
+ * FAIL (Not possible on Read-Only S3 files.)
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-23
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_hdfs_truncate(
+ H5FD_t H5_ATTR_UNUSED *_file,
+ hid_t H5_ATTR_UNUSED dxpl_id,
+ hbool_t H5_ATTR_UNUSED closing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "H5FD_hdfs_truncate() called.\n");
+#endif
+
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL,
+ "cannot truncate read-only file.")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_hdfs_truncate() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_lock()
+ *
+ * Purpose:
+ *
+ * Place an advisory lock on a file.
+ * No effect on Read-Only S3 file.
+ *
+ * Suggestion: remove lock/unlock from class
+ * > would result in error at H5FD_[un]lock() (H5FD.c)
+ *
+ * Return:
+ *
+ * SUCCEED (No-op always succeeds)
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-03
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_hdfs_lock(
+ H5FD_t H5_ATTR_UNUSED *_file,
+ hbool_t H5_ATTR_UNUSED rw)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FD_hdfs_lock() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_unlock()
+ *
+ * Purpose:
+ *
+ * Remove the existing lock on the file.
+ * No effect on Read-Only S3 file.
+ *
+ * Return:
+ *
+ * SUCCEED (No-op always succeeds)
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-03
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_hdfs_unlock(H5FD_t H5_ATTR_UNUSED *_file)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FD_hdfs_unlock() */
+
diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h
new file mode 100644
index 0000000..3d4128d
--- /dev/null
+++ b/src/H5FDhdfs.h
@@ -0,0 +1,122 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Read-Only HDFS Virtual File Driver (VFD) *
+ * Copyright (c) 2018, The HDF Group. *
+ * *
+ * All rights reserved. *
+ * *
+ * NOTICE: *
+ * All information contained herein is, and remains, the property of The HDF *
+ * Group. The intellectual and technical concepts contained herein are *
+ * proprietary to The HDF Group. Dissemination of this information or *
+ * reproduction of this material is strictly forbidden unless prior written *
+ * permission is obtained from The HDF Group. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Jacob Smith
+ * 2018-04-23
+ *
+ * Purpose: The public header file for the hdfs driver.
+ */
+
+#ifndef H5FDhdfs_H
+#define H5FDhdfs_H
+
+#define H5FD_HDFS (H5FD_hdfs_init())
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/****************************************************************************
+ *
+ * Structure: H5FD_hdfs_fapl_t
+ *
+ * Purpose:
+ *
+ * H5FD_hdfs_fapl_t is a public structure that is used to pass
+ * configuration information to the appropriate HDFS VFD via the FAPL.
+ * A pointer to an instance of this structure is a parameter to
+ * H5Pset_fapl_hdfs() and H5Pget_fapl_hdfs().
+ *
+ *
+ *
+ * `version` (int32_t)
+ *
+ * Version number of the `H5FD_hdfs_fapl_t` structure. Any instance passed
+ * to the above calls must have a recognized version number, or an error
+ * will be flagged.
+ *
+ * This field should be set to `H5FD__CURR_HDFS_FAPL_T_VERSION`.
+ *
+ * `namenode_name` (const char[])
+ *
+ * Name of "Name Node" to access as the HDFS server.
+ *
+ * Must not be longer than `H5FD__HDFS_NODE_NAME_SPACE`.
+ *
+ * TBD: Can be NULL.
+ *
+ * `namenode_port` (int32_t) TBD
+ *
+ * Port number to use to connect with Name Node.
+ *
+ * TBD: If 0, uses a default port.
+ *
+ * `kerberos_ticket_cache` (const char[])
+ *
+ * Path to the location of the Kerberos authentication cache.
+ *
+ * Must not be longer than `H5FD__HDFS_KERB_CACHE_PATH_SPACE`.
+ *
+ * TBD: Can be NULL.
+ *
+ * `user_name` (const char[])
+ *
+ * Username to use when accessing file.
+ *
+ * Must not be longer than `H5FD__HDFS_USER_NAME_SPACE`.
+ *
+ * TBD: Can be NULL.
+ *
+ * `stream_buffer_size` (int32_t)
+ *
+ * Size (in bytes) of the file read stream buffer.
+ *
+ * TBD: If -1, relies on a default value.
+ *
+ *
+ *
+ * Programmer: Jacob Smith
+ * 2018-04-23
+ *
+ * Changes: None
+ *
+ ****************************************************************************/
+
+#define H5FD__CURR_HDFS_FAPL_T_VERSION 1
+
+#define H5FD__HDFS_NODE_NAME_SPACE 128
+#define H5FD__HDFS_USER_NAME_SPACE 128
+#define H5FD__HDFS_KERB_CACHE_PATH_SPACE 128
+
+typedef struct H5FD_hdfs_fapl_t {
+ int32_t version;
+ char namenode_name[H5FD__HDFS_NODE_NAME_SPACE + 1];
+ int32_t namenode_port;
+ char user_name[H5FD__HDFS_USER_NAME_SPACE + 1];
+ char kerberos_ticket_cache[H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1];
+ int32_t stream_buffer_size;
+} H5FD_hdfs_fapl_t;
+
+H5_DLL hid_t H5FD_hdfs_init(void);
+H5_DLL herr_t H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out);
+H5_DLL herr_t H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ifndef H5FDhdfs_H */
+
+
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index efbdafe..8878c25 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -15,22 +15,22 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Thursday, July 29, 1999
*
- * Purpose: This is the MPI-2 I/O driver.
+ * Purpose: This is the MPI-2 I/O driver.
*
*/
#include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Dprivate.h" /* Dataset functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5FDmpi.h" /* MPI-based file drivers */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5Dprivate.h" /* Dataset functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDmpi.h" /* MPI-based file drivers */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
#include "H5Pprivate.h" /* Property lists */
#ifdef H5_HAVE_PARALLEL
@@ -58,16 +58,16 @@ static char H5FD_mpi_native_g[] = "native";
* driver doesn't bother to keep it updated since it's an expensive operation.
*/
typedef struct H5FD_mpio_t {
- H5FD_t pub; /*public stuff, must be first */
- MPI_File f; /*MPIO file handle */
- MPI_Comm comm; /*communicator */
- MPI_Info info; /*file information */
+ H5FD_t pub; /*public stuff, must be first */
+ MPI_File f; /*MPIO file handle */
+ MPI_Comm comm; /*communicator */
+ MPI_Info info; /*file information */
int mpi_rank; /* This process's rank */
int mpi_size; /* Total number of processes */
- haddr_t eof; /*end-of-file marker */
- haddr_t eoa; /*end-of-address marker */
- haddr_t last_eoa; /* Last known end-of-address marker */
- haddr_t local_eof; /* Local end-of-file address for each process */
+ haddr_t eof; /*end-of-file marker */
+ haddr_t eoa; /*end-of-address marker */
+ haddr_t last_eoa; /* Last known end-of-address marker */
+ haddr_t local_eof; /* Local end-of-file address for each process */
} H5FD_mpio_t;
/* Private Prototypes */
@@ -78,7 +78,7 @@ static void *H5FD_mpio_fapl_get(H5FD_t *_file);
static void *H5FD_mpio_fapl_copy(const void *_old_fa);
static herr_t H5FD_mpio_fapl_free(void *_fa);
static H5FD_t *H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id,
- haddr_t maxaddr);
+ haddr_t maxaddr);
static herr_t H5FD_mpio_close(H5FD_t *_file);
static herr_t H5FD_mpio_query(const H5FD_t *_f1, unsigned long *flags);
static haddr_t H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
@@ -99,35 +99,35 @@ static herr_t H5FD_mpio_get_info(H5FD_t *_file, void** mpi_info);
/* The MPIO file driver information */
static const H5FD_class_mpi_t H5FD_mpio_g = {
{ /* Start of superclass information */
- "mpio", /*name */
- HADDR_MAX, /*maxaddr */
- H5F_CLOSE_SEMI, /* fc_degree */
+ "mpio", /*name */
+ HADDR_MAX, /*maxaddr */
+ H5F_CLOSE_SEMI, /* fc_degree */
H5FD_mpio_term, /*terminate */
- NULL, /*sb_size */
- NULL, /*sb_encode */
- NULL, /*sb_decode */
- sizeof(H5FD_mpio_fapl_t), /*fapl_size */
- H5FD_mpio_fapl_get, /*fapl_get */
- H5FD_mpio_fapl_copy, /*fapl_copy */
- H5FD_mpio_fapl_free, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD_mpio_open, /*open */
- H5FD_mpio_close, /*close */
- NULL, /*cmp */
- H5FD_mpio_query, /*query */
- NULL, /*get_type_map */
- NULL, /*alloc */
- NULL, /*free */
- H5FD_mpio_get_eoa, /*get_eoa */
- H5FD_mpio_set_eoa, /*set_eoa */
- H5FD_mpio_get_eof, /*get_eof */
+ NULL, /*sb_size */
+ NULL, /*sb_encode */
+ NULL, /*sb_decode */
+ sizeof(H5FD_mpio_fapl_t), /*fapl_size */
+ H5FD_mpio_fapl_get, /*fapl_get */
+ H5FD_mpio_fapl_copy, /*fapl_copy */
+ H5FD_mpio_fapl_free, /*fapl_free */
+ 0, /*dxpl_size */
+ NULL, /*dxpl_copy */
+ NULL, /*dxpl_free */
+ H5FD_mpio_open, /*open */
+ H5FD_mpio_close, /*close */
+ NULL, /*cmp */
+ H5FD_mpio_query, /*query */
+ NULL, /*get_type_map */
+ NULL, /*alloc */
+ NULL, /*free */
+ H5FD_mpio_get_eoa, /*get_eoa */
+ H5FD_mpio_set_eoa, /*set_eoa */
+ H5FD_mpio_get_eof, /*get_eof */
H5FD_mpio_get_handle, /*get_handle */
- H5FD_mpio_read, /*read */
- H5FD_mpio_write, /*write */
- H5FD_mpio_flush, /*flush */
- H5FD_mpio_truncate, /*truncate */
+ H5FD_mpio_read, /*read */
+ H5FD_mpio_write, /*write */
+ H5FD_mpio_flush, /*flush */
+ H5FD_mpio_truncate, /*truncate */
NULL, /*lock */
NULL, /*unlock */
H5FD_FLMAP_DICHOTOMY /*fl_map */
@@ -158,7 +158,7 @@ static int H5FD_mpio_Debug[256] =
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
#endif
-
+
/*--------------------------------------------------------------------------
NAME
H5FD__init_package -- Initialize interface-specific information
@@ -185,17 +185,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FD__init_package() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_init
+ * Function: H5FD_mpio_init
*
- * Purpose: Initialize this driver by registering the driver with the
- * library.
+ * Purpose: Initialize this driver by registering the driver with the
+ * library.
*
- * Return: Success: The driver ID for the mpio driver.
- * Failure: Negative.
+ * Return: Success: The driver ID for the mpio driver.
+ * Failure: Negative.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, August 5, 1999
*
*-------------------------------------------------------------------------
@@ -207,7 +207,7 @@ H5FD_mpio_init(void)
static int H5FD_mpio_Debug_inited = 0;
#endif /* H5FDmpio_DEBUG */
const char *s; /* String for environment variables */
- hid_t ret_value; /* Return value */
+ hid_t ret_value; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -226,12 +226,12 @@ H5FD_mpio_init(void)
s = HDgetenv("H5FD_mpio_Debug");
if(s) {
/* Set debug mask */
- while(*s) {
- H5FD_mpio_Debug[(int)*s]++;
- s++;
- } /* end while */
+ while(*s) {
+ H5FD_mpio_Debug[(int)*s]++;
+ s++;
+ } /* end while */
} /* end if */
- H5FD_mpio_Debug_inited++;
+ H5FD_mpio_Debug_inited++;
} /* end if */
#endif /* H5FDmpio_DEBUG */
@@ -242,11 +242,11 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_mpio_init() */
-
+
/*---------------------------------------------------------------------------
- * Function: H5FD_mpio_term
+ * Function: H5FD_mpio_term
*
- * Purpose: Shut down the VFD
+ * Purpose: Shut down the VFD
*
* Returns: Non-negative on success or negative on failure
*
@@ -266,43 +266,43 @@ H5FD_mpio_term(void)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_mpio_term() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5Pset_fapl_mpio
+ * Function: H5Pset_fapl_mpio
*
- * Purpose: Store the user supplied MPIO communicator comm and info in
- * the file access property list FAPL_ID which can then be used
- * to create and/or open the file. This function is available
- * only in the parallel HDF5 library and is not collective.
+ * Purpose: Store the user supplied MPIO communicator comm and info in
+ * the file access property list FAPL_ID which can then be used
+ * to create and/or open the file. This function is available
+ * only in the parallel HDF5 library and is not collective.
*
- * comm is the MPI communicator to be used for file open as
- * defined in MPI_FILE_OPEN of MPI-2. This function makes a
- * duplicate of comm. Any modification to comm after this function
- * call returns has no effect on the access property list.
+ * comm is the MPI communicator to be used for file open as
+ * defined in MPI_FILE_OPEN of MPI-2. This function makes a
+ * duplicate of comm. Any modification to comm after this function
+ * call returns has no effect on the access property list.
*
- * info is the MPI Info object to be used for file open as
- * defined in MPI_FILE_OPEN of MPI-2. This function makes a
- * duplicate of info. Any modification to info after this
- * function call returns has no effect on the access property
- * list.
+ * info is the MPI Info object to be used for file open as
+ * defined in MPI_FILE_OPEN of MPI-2. This function makes a
+ * duplicate of info. Any modification to info after this
+ * function call returns has no effect on the access property
+ * list.
*
* If fapl_id has previously set comm and info values, they
* will be replaced and the old communicator and Info object
* are freed.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Albert Cheng
- * Feb 3, 1998
+ * Programmer: Albert Cheng
+ * Feb 3, 1998
*
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info)
{
- H5FD_mpio_fapl_t fa;
+ H5FD_mpio_fapl_t fa;
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value;
@@ -316,7 +316,7 @@ H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info)
if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list")
if(MPI_COMM_NULL == comm)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a valid communicator")
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a valid communicator")
/* Initialize driver specific properties */
fa.comm = comm;
@@ -329,28 +329,28 @@ done:
FUNC_LEAVE_API(ret_value)
} /* H5Pset_fapl_mpio() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5Pget_fapl_mpio
+ * Function: H5Pget_fapl_mpio
*
- * Purpose: If the file access property list is set to the H5FD_MPIO
- * driver then this function returns duplicates of the MPI
- * communicator and Info object stored through the comm and
- * info pointers. It is the responsibility of the application
- * to free the returned communicator and Info object.
+ * Purpose: If the file access property list is set to the H5FD_MPIO
+ * driver then this function returns duplicates of the MPI
+ * communicator and Info object stored through the comm and
+ * info pointers. It is the responsibility of the application
+ * to free the returned communicator and Info object.
*
- * Return: Success: Non-negative with the communicator and
- * Info object returned through the comm and
- * info arguments if non-null. Since they are
- * duplicates of the stored objects, future
- * modifications to the access property list do
- * not affect them and it is the responsibility
- * of the application to free them.
+ * Return: Success: Non-negative with the communicator and
+ * Info object returned through the comm and
+ * info arguments if non-null. Since they are
+ * duplicates of the stored objects, future
+ * modifications to the access property list do
+ * not affect them and it is the responsibility
+ * of the application to free them.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Thursday, February 26, 1998
+ * Programmer: Robb Matzke
+ * Thursday, February 26, 1998
*
*-------------------------------------------------------------------------
*/
@@ -359,9 +359,9 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
const H5FD_mpio_fapl_t *fa; /* MPIO fapl info */
- MPI_Comm comm_tmp = MPI_COMM_NULL;
+ MPI_Comm comm_tmp = MPI_COMM_NULL;
hbool_t comm_copied = FALSE; /* MPI Comm has been duplicated */
- int mpi_code; /* MPI return code */
+ int mpi_code; /* MPI return code */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -377,19 +377,19 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/)
/* Store the duplicated communicator in a temporary variable for error */
/* recovery in case the INFO duplication fails. */
if(comm) {
- if(MPI_SUCCESS != (mpi_code = MPI_Comm_dup(fa->comm, &comm_tmp)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Comm_dup failed", mpi_code)
+ if(MPI_SUCCESS != (mpi_code = MPI_Comm_dup(fa->comm, &comm_tmp)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Comm_dup failed", mpi_code)
comm_copied = TRUE;
} /* end if */
if(info) {
- if(MPI_INFO_NULL != fa->info) {
- if(MPI_SUCCESS != (mpi_code = MPI_Info_dup(fa->info, info)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Info_dup failed", mpi_code)
- } /* end if */
+ if(MPI_INFO_NULL != fa->info) {
+ if(MPI_SUCCESS != (mpi_code = MPI_Info_dup(fa->info, info)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Info_dup failed", mpi_code)
+ } /* end if */
else
- /* do not dup it */
- *info = MPI_INFO_NULL;
+ /* do not dup it */
+ *info = MPI_INFO_NULL;
} /* end if */
/* Store the copied communicator, now that the Info object has been
@@ -400,33 +400,33 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/)
done:
if(ret_value < 0)
- /* need to free anything created here */
- if(comm_copied)
- MPI_Comm_free(&comm_tmp);
+ /* need to free anything created here */
+ if(comm_copied)
+ MPI_Comm_free(&comm_tmp);
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_fapl_mpio() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5Pset_dxpl_mpio
+ * Function: H5Pset_dxpl_mpio
*
- * Purpose: Set the data transfer property list DXPL_ID to use transfer
- * mode XFER_MODE. The property list can then be used to control
- * the I/O transfer mode during data I/O operations. The valid
- * transfer modes are:
+ * Purpose: Set the data transfer property list DXPL_ID to use transfer
+ * mode XFER_MODE. The property list can then be used to control
+ * the I/O transfer mode during data I/O operations. The valid
+ * transfer modes are:
*
- * H5FD_MPIO_INDEPENDENT:
- * Use independent I/O access (the default).
+ * H5FD_MPIO_INDEPENDENT:
+ * Use independent I/O access (the default).
*
- * H5FD_MPIO_COLLECTIVE:
- * Use collective I/O access.
+ * H5FD_MPIO_COLLECTIVE:
+ * Use collective I/O access.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Albert Cheng
- * April 2, 1998
+ * Programmer: Albert Cheng
+ * April 2, 1998
*
*-------------------------------------------------------------------------
*/
@@ -456,21 +456,21 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_dxpl_mpio() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5Pget_dxpl_mpio
+ * Function: H5Pget_dxpl_mpio
*
- * Purpose: Queries the transfer mode current set in the data transfer
- * property list DXPL_ID. This is not collective.
+ * Purpose: Queries the transfer mode current set in the data transfer
+ * property list DXPL_ID. This is not collective.
*
- * Return: Success: Non-negative, with the transfer mode returned
- * through the XFER_MODE argument if it is
- * non-null.
+ * Return: Success: Non-negative, with the transfer mode returned
+ * through the XFER_MODE argument if it is
+ * non-null.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Albert Cheng
- * April 2, 1998
+ * Programmer: Albert Cheng
+ * April 2, 1998
*
*-------------------------------------------------------------------------
*/
@@ -495,23 +495,23 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_dxpl_mpio() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5Pset_dxpl_mpio_collective_opt
+ * Function: H5Pset_dxpl_mpio_collective_opt
*
- * Purpose: To set a flag to choose linked chunk I/O or multi-chunk I/O
- * without involving decision-making inside HDF5
+ * Purpose: To set a flag to choose linked chunk I/O or multi-chunk I/O
+ * without involving decision-making inside HDF5
*
- * Note: The library will do linked chunk I/O or multi-chunk I/O without
- * involving communications for decision-making process.
- * The library won't behave as it asks for only when we find
- * that the low-level MPI-IO package doesn't support this.
+ * Note: The library will do linked chunk I/O or multi-chunk I/O without
+ * involving communications for decision-making process.
+ * The library won't behave as it asks for only when we find
+ * that the low-level MPI-IO package doesn't support this.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Kent Yang
- * ? ?, ?
+ * Programmer: Kent Yang
+ * ? ?, ?
*
*-------------------------------------------------------------------------
*/
@@ -541,21 +541,21 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Pset_dxpl_mpio_chunk_opt
+ * Function: H5Pset_dxpl_mpio_chunk_opt
*
- * Purpose: To set a flag to choose linked chunk I/O or multi-chunk I/O
- * without involving decision-making inside HDF5
+ * Purpose: To set a flag to choose linked chunk I/O or multi-chunk I/O
+ * without involving decision-making inside HDF5
*
- * Note: The library will do linked chunk I/O or multi-chunk I/O without
- * involving communications for decision-making process.
- * The library won't behave as it asks for only when we find
- * that the low-level MPI-IO package doesn't support this.
+ * Note: The library will do linked chunk I/O or multi-chunk I/O without
+ * involving communications for decision-making process.
+ * The library won't behave as it asks for only when we find
+ * that the low-level MPI-IO package doesn't support this.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Kent Yang
- * ? ?, ?
+ * Programmer: Kent Yang
+ * ? ?, ?
*
*-------------------------------------------------------------------------
*/
@@ -583,21 +583,21 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_dxpl_mpio_chunk_opt() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5Pset_dxpl_mpio_chunk_opt_num
+ * Function: H5Pset_dxpl_mpio_chunk_opt_num
*
- * Purpose: To set a threshold for doing linked chunk IO
+ * Purpose: To set a threshold for doing linked chunk IO
*
- * Note: If the number is greater than the threshold set by the user,
- * the library will do linked chunk I/O; otherwise, I/O will be
- * done for every chunk.
+ * Note: If the number is greater than the threshold set by the user,
+ * the library will do linked chunk I/O; otherwise, I/O will be
+ * done for every chunk.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Kent Yang
- * ? ?, ?
+ * Programmer: Kent Yang
+ * ? ?, ?
*
*-------------------------------------------------------------------------
*/
@@ -625,24 +625,24 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_dxpl_mpio_chunk_opt_num() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5Pset_dxpl_mpio_chunk_opt_ratio
+ * Function: H5Pset_dxpl_mpio_chunk_opt_ratio
*
- * Purpose: To set a threshold for doing collective I/O for each chunk
+ * Purpose: To set a threshold for doing collective I/O for each chunk
*
- * Note: The library will calculate the percentage of the number of
- * process holding selections at each chunk. If that percentage
- * of number of process in the individual chunk is greater than
- * the threshold set by the user, the library will do collective
- * chunk I/O for this chunk; otherwise, independent I/O will be
- * done for this chunk.
+ * Note: The library will calculate the percentage of the number of
+ * process holding selections at each chunk. If that percentage
+ * of number of process in the individual chunk is greater than
+ * the threshold set by the user, the library will do collective
+ * chunk I/O for this chunk; otherwise, independent I/O will be
+ * done for this chunk.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Kent Yang
- * ? ?, ?
+ * Programmer: Kent Yang
+ * ? ?, ?
*
*-------------------------------------------------------------------------
*/
@@ -670,19 +670,19 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_dxpl_mpio_chunk_opt_ratio() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_fapl_get
+ * Function: H5FD_mpio_fapl_get
*
- * Purpose: Returns a file access property list which could be used to
- * create another file the same as this one.
+ * Purpose: Returns a file access property list which could be used to
+ * create another file the same as this one.
*
- * Return: Success: Ptr to new file access property list with all
- * fields copied from the file pointer.
+ * Return: Success: Ptr to new file access property list with all
+ * fields copied from the file pointer.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, August 13, 1999
*
*-------------------------------------------------------------------------
@@ -690,8 +690,8 @@ done:
static void *
H5FD_mpio_fapl_get(H5FD_t *_file)
{
- H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
- H5FD_mpio_fapl_t *fa = NULL;
+ H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
+ H5FD_mpio_fapl_t *fa = NULL;
void *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -704,7 +704,7 @@ H5FD_mpio_fapl_get(H5FD_t *_file)
/* Duplicate communicator and Info object. */
if(FAIL == H5FD_mpi_comm_info_dup(file->comm, file->info, &fa->comm, &fa->info))
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "Communicator/Info duplicate failed")
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "Communicator/Info duplicate failed")
/* Set return value */
ret_value = fa;
@@ -713,17 +713,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_fapl_copy
+ * Function: H5FD_mpio_fapl_copy
*
- * Purpose: Copies the mpio-specific file access properties.
+ * Purpose: Copies the mpio-specific file access properties.
*
- * Return: Success: Ptr to a new property list
+ * Return: Success: Ptr to a new property list
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* Jan 8, 2003
*
*-------------------------------------------------------------------------
@@ -731,14 +731,14 @@ done:
static void *
H5FD_mpio_fapl_copy(const void *_old_fa)
{
- void *ret_value = NULL;
+ void *ret_value = NULL;
const H5FD_mpio_fapl_t *old_fa = (const H5FD_mpio_fapl_t*)_old_fa;
- H5FD_mpio_fapl_t *new_fa = NULL;
+ H5FD_mpio_fapl_t *new_fa = NULL;
FUNC_ENTER_NOAPI_NOINIT
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
-fprintf(stderr, "enter H5FD_mpio_fapl_copy\n");
+HDfprintf(stderr, "enter H5FD_mpio_fapl_copy\n");
#endif
if(NULL == (new_fa = (H5FD_mpio_fapl_t *)H5MM_malloc(sizeof(H5FD_mpio_fapl_t))))
@@ -749,34 +749,34 @@ fprintf(stderr, "enter H5FD_mpio_fapl_copy\n");
/* Duplicate communicator and Info object. */
if(FAIL == H5FD_mpi_comm_info_dup(old_fa->comm, old_fa->info, &new_fa->comm, &new_fa->info))
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "Communicator/Info duplicate failed")
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "Communicator/Info duplicate failed")
ret_value = new_fa;
done:
if (NULL == ret_value){
- /* cleanup */
- if (new_fa)
- H5MM_xfree(new_fa);
+ /* cleanup */
+ if (new_fa)
+ H5MM_xfree(new_fa);
}
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
-fprintf(stderr, "leaving H5FD_mpio_fapl_copy\n");
+HDfprintf(stderr, "leaving H5FD_mpio_fapl_copy\n");
#endif
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_mpio_fapl_copy() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_fapl_free
+ * Function: H5FD_mpio_fapl_free
*
- * Purpose: Frees the mpio-specific file access properties.
+ * Purpose: Frees the mpio-specific file access properties.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* Jan 8, 2003
*
* Modifications:
@@ -786,13 +786,13 @@ fprintf(stderr, "leaving H5FD_mpio_fapl_copy\n");
static herr_t
H5FD_mpio_fapl_free(void *_fa)
{
- herr_t ret_value = SUCCEED;
- H5FD_mpio_fapl_t *fa = (H5FD_mpio_fapl_t*)_fa;
+ herr_t ret_value = SUCCEED;
+ H5FD_mpio_fapl_t *fa = (H5FD_mpio_fapl_t*)_fa;
FUNC_ENTER_NOAPI_NOINIT_NOERR
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
-fprintf(stderr, "in H5FD_mpio_fapl_free\n");
+HDfprintf(stderr, "in H5FD_mpio_fapl_free\n");
#endif
HDassert(fa);
@@ -803,23 +803,23 @@ fprintf(stderr, "in H5FD_mpio_fapl_free\n");
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
-fprintf(stderr, "leaving H5FD_mpio_fapl_free\n");
+HDfprintf(stderr, "leaving H5FD_mpio_fapl_free\n");
#endif
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_mpio_fapl_free() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_set_mpio_atomicity
+ * Function: H5FD_set_mpio_atomicity
*
- * Purpose: Sets the atomicity mode
+ * Purpose: Sets the atomicity mode
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Mohamad Chaarawi
- * Feb 14, 2012
+ * Programmer: Mohamad Chaarawi
+ * Feb 14, 2012
*
*-------------------------------------------------------------------------
*/
@@ -835,7 +835,7 @@ H5FD_set_mpio_atomicity(H5FD_t *_file, hbool_t flag)
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
- fprintf(stdout, "Entering H5FD_set_mpio_atomicity\n");
+ HDfprintf(stdout, "Entering H5FD_set_mpio_atomicity\n");
#endif
if (FALSE == flag)
@@ -850,23 +850,23 @@ H5FD_set_mpio_atomicity(H5FD_t *_file, hbool_t flag)
done:
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
- fprintf(stdout, "Leaving H5FD_set_mpio_atomicity\n");
+ HDfprintf(stdout, "Leaving H5FD_set_mpio_atomicity\n");
#endif
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_get_mpio_atomicity
+ * Function: H5FD_get_mpio_atomicity
*
- * Purpose: Returns the atomicity mode
+ * Purpose: Returns the atomicity mode
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Mohamad Chaarawi
- * Feb 14, 2012
+ * Programmer: Mohamad Chaarawi
+ * Feb 14, 2012
*
*-------------------------------------------------------------------------
*/
@@ -882,7 +882,7 @@ H5FD_get_mpio_atomicity(H5FD_t *_file, hbool_t *flag)
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
- fprintf(stdout, "Entering H5FD_get_mpio_atomicity\n");
+ HDfprintf(stdout, "Entering H5FD_get_mpio_atomicity\n");
#endif
/* get atomicity value */
@@ -897,21 +897,21 @@ H5FD_get_mpio_atomicity(H5FD_t *_file, hbool_t *flag)
done:
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
- fprintf(stdout, "Leaving H5FD_get_mpio_atomicity\n");
+ HDfprintf(stdout, "Leaving H5FD_get_mpio_atomicity\n");
#endif
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_mpio_open
*
* Purpose: Opens a file with name NAME. The FLAGS are a bit field with
- * purpose similar to the second argument of open(2) and which
- * are defined in H5Fpublic.h. The file access property list
- * FAPL_ID contains the properties driver properties and MAXADDR
- * is the largest address which this file will be expected to
- * access. This is collective.
+ * purpose similar to the second argument of open(2) and which
+ * are defined in H5Fpublic.h. The file access property list
+ * FAPL_ID contains the properties driver properties and MAXADDR
+ * is the largest address which this file will be expected to
+ * access. This is collective.
*
* Return: Success: A new file pointer.
*
@@ -924,29 +924,29 @@ done:
*/
static H5FD_t *
H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id,
- haddr_t H5_ATTR_UNUSED maxaddr)
+ haddr_t H5_ATTR_UNUSED maxaddr)
{
- H5FD_mpio_t *file=NULL;
- MPI_File fh;
+ H5FD_mpio_t *file=NULL;
+ MPI_File fh;
unsigned file_opened=0; /* Flag to indicate that the file was successfully opened */
- int mpi_amode;
- int mpi_rank; /* MPI rank of this process */
- int mpi_size; /* Total number of MPI processes */
- int mpi_code; /* mpi return code */
- MPI_Offset size;
- const H5FD_mpio_fapl_t *fa = NULL;
- H5FD_mpio_fapl_t _fa;
+ int mpi_amode;
+ int mpi_rank; /* MPI rank of this process */
+ int mpi_size; /* Total number of MPI processes */
+ int mpi_code; /* mpi return code */
+ MPI_Offset size;
+ const H5FD_mpio_fapl_t *fa = NULL;
+ H5FD_mpio_fapl_t _fa;
H5P_genplist_t *plist; /* Property list pointer */
MPI_Comm comm_dup = MPI_COMM_NULL;
MPI_Info info_dup = MPI_INFO_NULL;
- H5FD_t *ret_value; /* Return value */
+ H5FD_t *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t']) {
- fprintf(stdout, "Entering H5FD_mpio_open(name=\"%s\", flags=0x%x, "
- "fapl_id=%d, maxaddr=%lu)\n", name, flags, (int)fapl_id, (unsigned long)maxaddr);
+ HDfprintf(stdout, "Entering H5FD_mpio_open(name=\"%s\", flags=0x%x, "
+ "fapl_id=%d, maxaddr=%lu)\n", name, flags, (int)fapl_id, (unsigned long)maxaddr);
}
#endif
@@ -954,18 +954,18 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id,
if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
if(H5P_FILE_ACCESS_DEFAULT == fapl_id || H5FD_MPIO != H5P_peek_driver(plist)) {
- _fa.comm = MPI_COMM_SELF; /*default*/
- _fa.info = MPI_INFO_NULL; /*default*/
- fa = &_fa;
+ _fa.comm = MPI_COMM_SELF; /*default*/
+ _fa.info = MPI_INFO_NULL; /*default*/
+ fa = &_fa;
} /* end if */
else {
if(NULL == (fa = (const H5FD_mpio_fapl_t *)H5P_peek_driver_info(plist)))
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info")
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info")
} /* end else */
/* Duplicate communicator and Info object for use by this file. */
if(FAIL == H5FD_mpi_comm_info_dup(fa->comm, fa->info, &comm_dup, &info_dup))
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "Communicator/Info duplicate failed")
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "Communicator/Info duplicate failed")
/* convert HDF5 flags to MPI-IO flags */
/* some combinations are illegal; let MPI-IO figure it out */
@@ -986,7 +986,7 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id,
if(flag) {
int i;
- fprintf(stdout, "H5FD_mpio debug flags = '%s'\n", debug_str);
+ HDfprintf(stdout, "H5FD_mpio debug flags = '%s'\n", debug_str);
for(i = 0; debug_str[i]/*end of string*/ && i < 128/*just in case*/; ++i)
H5FD_mpio_Debug[(int)debug_str[i]] = 1;
}
@@ -1047,57 +1047,57 @@ done:
if(ret_value==NULL) {
if(file_opened)
MPI_File_close(&fh);
- if (MPI_COMM_NULL != comm_dup)
- MPI_Comm_free(&comm_dup);
- if (MPI_INFO_NULL != info_dup)
- MPI_Info_free(&info_dup);
- if (file)
- H5MM_xfree(file);
+ if (MPI_COMM_NULL != comm_dup)
+ MPI_Comm_free(&comm_dup);
+ if (MPI_INFO_NULL != info_dup)
+ MPI_Info_free(&info_dup);
+ if (file)
+ H5MM_xfree(file);
} /* end if */
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
- fprintf(stdout, "Leaving H5FD_mpio_open\n" );
+ HDfprintf(stdout, "Leaving H5FD_mpio_open\n" );
#endif
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_mpio_open() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_mpio_close
*
* Purpose: Closes a file. This is collective.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
* Programmer: Unknown
* January 30, 1998
*
* Modifications:
- * Robb Matzke, 1998-02-18
- * Added the ACCESS_PARMS argument.
+ * Robb Matzke, 1998-02-18
+ * Added the ACCESS_PARMS argument.
*
- * Robb Matzke, 1999-08-06
- * Modified to work with the virtual file layer.
+ * Robb Matzke, 1999-08-06
+ * Modified to work with the virtual file layer.
*
- * Albert Cheng, 2003-04-17
- * Free the communicator stored.
+ * Albert Cheng, 2003-04-17
+ * Free the communicator stored.
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_mpio_close(H5FD_t *_file)
{
- H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
- int mpi_code; /* MPI return code */
+ H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
+ int mpi_code; /* MPI return code */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
- fprintf(stdout, "Entering H5FD_mpio_close\n");
+ HDfprintf(stdout, "Entering H5FD_mpio_close\n");
#endif
HDassert(file);
HDassert(H5FD_MPIO==file->pub.driver_id);
@@ -1113,33 +1113,33 @@ H5FD_mpio_close(H5FD_t *_file)
done:
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
- fprintf(stdout, "Leaving H5FD_mpio_close\n");
+ HDfprintf(stdout, "Leaving H5FD_mpio_close\n");
#endif
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_query
+ * Function: H5FD_mpio_query
*
- * Purpose: Set the flags that this VFL driver is capable of supporting.
+ * Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 25, 2000
*
* Modifications:
*
- * John Mainzer -- 9/21/05
- * Modified code to turn off the
- * H5FD_FEAT_ACCUMULATE_METADATA_WRITE flag.
+ * John Mainzer -- 9/21/05
+ * Modified code to turn off the
+ * H5FD_FEAT_ACCUMULATE_METADATA_WRITE flag.
* With the movement of
- * all cache writes to process 0, this flag has become
- * problematic in PHDF5.
+ * all cache writes to process 0, this flag has become
+ * problematic in PHDF5.
*
*-------------------------------------------------------------------------
*/
@@ -1161,19 +1161,19 @@ H5FD_mpio_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags /* out
FUNC_LEAVE_NOAPI(SUCCEED)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_get_eoa
+ * Function: H5FD_mpio_get_eoa
*
- * Purpose: Gets the end-of-address marker for the file. The EOA marker
- * is the first address past the last byte allocated in the
- * format address space.
+ * Purpose: Gets the end-of-address marker for the file. The EOA marker
+ * is the first address past the last byte allocated in the
+ * format address space.
*
- * Return: Success: The end-of-address marker.
+ * Return: Success: The end-of-address marker.
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, August 6, 1999
*
* Modifications:
@@ -1186,7 +1186,7 @@ H5FD_mpio_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags /* out
static haddr_t
H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
- const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file;
+ const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1196,19 +1196,19 @@ H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
FUNC_LEAVE_NOAPI(file->eoa)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_set_eoa
+ * Function: H5FD_mpio_set_eoa
*
- * Purpose: Set the end-of-address marker for the file. This function is
- * called shortly after an existing HDF5 file is opened in order
- * to tell the driver where the end of the HDF5 data is located.
+ * Purpose: Set the end-of-address marker for the file. This function is
+ * called shortly after an existing HDF5 file is opened in order
+ * to tell the driver where the end of the HDF5 data is located.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, August 6, 1999
*
* Modifications:
@@ -1221,7 +1221,7 @@ H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
static herr_t
H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
- H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
+ H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1233,30 +1233,30 @@ H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
FUNC_LEAVE_NOAPI(SUCCEED)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_get_eof
+ * Function: H5FD_mpio_get_eof
*
- * Purpose: Gets the end-of-file marker for the file. The EOF marker
- * is the real size of the file.
+ * Purpose: Gets the end-of-file marker for the file. The EOF marker
+ * is the real size of the file.
*
- * The MPIO driver doesn't bother keeping this field updated
- * since that's a relatively expensive operation. Fortunately
- * the library only needs the EOF just after the file is opened
- * in order to determine whether the file is empty, truncated,
- * or okay. Therefore, any MPIO I/O function will set its value
- * to HADDR_UNDEF which is the error return value of this
- * function.
+ * The MPIO driver doesn't bother keeping this field updated
+ * since that's a relatively expensive operation. Fortunately
+ * the library only needs the EOF just after the file is opened
+ * in order to determine whether the file is empty, truncated,
+ * or okay. Therefore, any MPIO I/O function will set its value
+ * to HADDR_UNDEF which is the error return value of this
+ * function.
*
* Keeping the EOF updated (during write calls) is expensive
* because any process may extend the physical end of the
* file. -QAK
*
- * Return: Success: The end-of-address marker.
+ * Return: Success: The end-of-address marker.
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, August 6, 1999
*
* Modifications:
@@ -1266,7 +1266,7 @@ H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
static haddr_t
H5FD_mpio_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
- const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file;
+ const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1276,7 +1276,7 @@ H5FD_mpio_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
FUNC_LEAVE_NOAPI(file->eof)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_mpio_get_handle
*
@@ -1308,7 +1308,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_mpio_get_info
*
@@ -1341,55 +1341,55 @@ done:
} /* H5FD_mpio_get_info() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_read
+ * Function: H5FD_mpio_read
*
- * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
- * into buffer BUF according to data transfer properties in
- * DXPL_ID using potentially complex file and buffer types to
- * effect the transfer.
+ * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
+ * into buffer BUF according to data transfer properties in
+ * DXPL_ID using potentially complex file and buffer types to
+ * effect the transfer.
*
- * Reading past the end of the MPI file returns zeros instead of
- * failing. MPI is able to coalesce requests from different
- * processes (collective or independent).
+ * Reading past the end of the MPI file returns zeros instead of
+ * failing. MPI is able to coalesce requests from different
+ * processes (collective or independent).
*
- * Return: Success: Zero. Result is stored in caller-supplied
- * buffer BUF.
+ * Return: Success: Zero. Result is stored in caller-supplied
+ * buffer BUF.
*
- * Failure: -1, Contents of buffer BUF are undefined.
+ * Failure: -1, Contents of buffer BUF are undefined.
*
- * Programmer: rky, 1998-01-30
+ * Programmer: rky, 1998-01-30
*
* Modifications:
- * Robb Matzke, 1998-02-18
- * Added the ACCESS_PARMS argument.
+ * Robb Matzke, 1998-02-18
+ * Added the ACCESS_PARMS argument.
*
- * rky, 1998-04-10
- * Call independent or collective MPI read, based on
- * ACCESS_PARMS.
+ * rky, 1998-04-10
+ * Call independent or collective MPI read, based on
+ * ACCESS_PARMS.
*
- * Albert Cheng, 1998-06-01
- * Added XFER_MODE to control independent or collective MPI
- * read.
+ * Albert Cheng, 1998-06-01
+ * Added XFER_MODE to control independent or collective MPI
+ * read.
*
- * rky, 1998-08-16
- * Use BTYPE, FTYPE, and DISP from access parms. The guts of
- * H5FD_mpio_read and H5FD_mpio_write should be replaced by a
- * single dual-purpose routine.
+ * rky, 1998-08-16
+ * Use BTYPE, FTYPE, and DISP from access parms. The guts of
+ * H5FD_mpio_read and H5FD_mpio_write should be replaced by a
+ * single dual-purpose routine.
*
- * Robb Matzke, 1999-04-21
- * Changed XFER_MODE to XFER_PARMS for all H5F_*_read()
- * callbacks.
+ * Robb Matzke, 1999-04-21
+ * Changed XFER_MODE to XFER_PARMS for all H5F_*_read()
+ * callbacks.
*
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
+ * Robb Matzke, 1999-07-28
+ * The ADDR argument is passed by value.
*
- * Robb Matzke, 1999-08-06
- * Modified to work with the virtual file layer.
+ * Robb Matzke, 1999-08-06
+ * Modified to work with the virtual file layer.
*
- * Quincey Koziol, 2002-05-14
- * Only call MPI_Get_count if we can use MPI_BYTE for the MPI type
+ * Quincey Koziol, 2002-05-14
+ * Only call MPI_Get_count if we can use MPI_BYTE for the MPI type
* for the I/O transfer. Someday we might include code to decode
* the MPI type used for more complicated transfers and call
* MPI_Get_count all the time.
@@ -1566,7 +1566,7 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type,
#endif
HMPI_GOTO_ERROR(FAIL, "MPI_Get_elements failed", mpi_code)
} /* end if */
-
+
/* If the rank0-bcast feature was used, broadcast the # of bytes read to
* other ranks, which didn't perform any I/O.
*/
@@ -1607,102 +1607,102 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_write
+ * Function: H5FD_mpio_write
*
- * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
- * from buffer BUF according to data transfer properties in
- * DXPL_ID using potentially complex file and buffer types to
- * effect the transfer.
+ * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
+ * from buffer BUF according to data transfer properties in
+ * DXPL_ID using potentially complex file and buffer types to
+ * effect the transfer.
*
- * MPI is able to coalesce requests from different processes
- * (collective and independent).
+ * MPI is able to coalesce requests from different processes
+ * (collective and independent).
*
- * Return: Success: Zero. USE_TYPES and OLD_USE_TYPES in the
- * access params are altered.
+ * Return: Success: Zero. USE_TYPES and OLD_USE_TYPES in the
+ * access params are altered.
*
- * Failure: -1, USE_TYPES and OLD_USE_TYPES in the
- * access params may be altered.
+ * Failure: -1, USE_TYPES and OLD_USE_TYPES in the
+ * access params may be altered.
*
- * Programmer: Unknown
+ * Programmer: Unknown
* January 30, 1998
*
* Modifications:
- * rky, 1998-08-28
- * If the file->allsame flag is set, we assume that all the
- * procs in the relevant MPI communicator will write identical
- * data at identical offsets in the file, so only proc 0 will
- * write, and all other procs will wait for p0 to finish. This
- * is useful for writing metadata, for example. Note that we
- * don't _check_ that the data is identical. Also, the mechanism
- * we use to eliminate the redundant writes is by requiring a
- * call to H5FD_mpio_tas_allsame before the write, which is
- * rather klugey. Would it be better to pass a parameter to
- * low-level writes like H5F_block_write and H5F_low_write,
- * instead? Or...??? Also, when I created this mechanism I
- * wanted to minimize the difference in behavior between the old
- * way of doing things (i.e., all procs write) and the new way,
- * so the writes are eliminated at the very lowest level, here
- * in H5FD_mpio_write. It may be better to rethink that, and
- * short-circuit the writes at a higher level (e.g., at the
- * points in the code where H5FD_mpio_tas_allsame is called).
- *
- *
- * Robb Matzke, 1998-02-18
- * Added the ACCESS_PARMS argument.
- *
- * rky, 1998-04-10
- * Call independent or collective MPI write, based on
- * ACCESS_PARMS.
- *
- * rky, 1998-04-24
- * Removed redundant write from H5FD_mpio_write.
- *
- * Albert Cheng, 1998-06-01
- * Added XFER_MODE to control independent or collective MPI
- * write.
- *
- * rky, 1998-08-16
- * Use BTYPE, FTYPE, and DISP from access parms. The guts of
- * H5FD_mpio_read and H5FD_mpio_write should be replaced by a
- * single dual-purpose routine.
- *
- * rky, 1998-08-28
- * Added ALLSAME parameter to make all but proc 0 skip the
- * actual write.
- *
- * Robb Matzke, 1999-04-21
- * Changed XFER_MODE to XFER_PARMS for all H5FD_*_write()
- * callbacks.
- *
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
- *
- * Robb Matzke, 1999-08-06
- * Modified to work with the virtual file layer.
- *
- * Albert Cheng, 1999-12-19
- * When only-p0-write-allsame-data, p0 Bcasts the
- * ret_value to other processes. This prevents
- * a racing condition (that other processes try to
- * read the file before p0 finishes writing) and also
- * allows all processes to report the same ret_value.
- *
- * Kim Yates, Pat Weidhaas, 2000-09-26
- * Move block of coding where only p0 writes after the
+ * rky, 1998-08-28
+ * If the file->allsame flag is set, we assume that all the
+ * procs in the relevant MPI communicator will write identical
+ * data at identical offsets in the file, so only proc 0 will
+ * write, and all other procs will wait for p0 to finish. This
+ * is useful for writing metadata, for example. Note that we
+ * don't _check_ that the data is identical. Also, the mechanism
+ * we use to eliminate the redundant writes is by requiring a
+ * call to H5FD_mpio_tas_allsame before the write, which is
+ * rather klugey. Would it be better to pass a parameter to
+ * low-level writes like H5F_block_write and H5F_low_write,
+ * instead? Or...??? Also, when I created this mechanism I
+ * wanted to minimize the difference in behavior between the old
+ * way of doing things (i.e., all procs write) and the new way,
+ * so the writes are eliminated at the very lowest level, here
+ * in H5FD_mpio_write. It may be better to rethink that, and
+ * short-circuit the writes at a higher level (e.g., at the
+ * points in the code where H5FD_mpio_tas_allsame is called).
+ *
+ *
+ * Robb Matzke, 1998-02-18
+ * Added the ACCESS_PARMS argument.
+ *
+ * rky, 1998-04-10
+ * Call independent or collective MPI write, based on
+ * ACCESS_PARMS.
+ *
+ * rky, 1998-04-24
+ * Removed redundant write from H5FD_mpio_write.
+ *
+ * Albert Cheng, 1998-06-01
+ * Added XFER_MODE to control independent or collective MPI
+ * write.
+ *
+ * rky, 1998-08-16
+ * Use BTYPE, FTYPE, and DISP from access parms. The guts of
+ * H5FD_mpio_read and H5FD_mpio_write should be replaced by a
+ * single dual-purpose routine.
+ *
+ * rky, 1998-08-28
+ * Added ALLSAME parameter to make all but proc 0 skip the
+ * actual write.
+ *
+ * Robb Matzke, 1999-04-21
+ * Changed XFER_MODE to XFER_PARMS for all H5FD_*_write()
+ * callbacks.
+ *
+ * Robb Matzke, 1999-07-28
+ * The ADDR argument is passed by value.
+ *
+ * Robb Matzke, 1999-08-06
+ * Modified to work with the virtual file layer.
+ *
+ * Albert Cheng, 1999-12-19
+ * When only-p0-write-allsame-data, p0 Bcasts the
+ * ret_value to other processes. This prevents
+ * a racing condition (that other processes try to
+ * read the file before p0 finishes writing) and also
+ * allows all processes to report the same ret_value.
+ *
+ * Kim Yates, Pat Weidhaas, 2000-09-26
+ * Move block of coding where only p0 writes after the
* MPI_File_set_view call.
*
- * Quincey Koziol, 2002-05-10
- * Instead of always writing metadata from process 0, spread the
+ * Quincey Koziol, 2002-05-10
+ * Instead of always writing metadata from process 0, spread the
* burden among all the processes by using a round-robin rotation
* scheme.
*
- * Quincey Koziol, 2002-05-10
- * Removed allsame code, keying off the type parameter instead.
+ * Quincey Koziol, 2002-05-10
+ * Removed allsame code, keying off the type parameter instead.
*
- * Quincey Koziol, 2002-05-14
- * Only call MPI_Get_count if we can use MPI_BYTE for the MPI type
+ * Quincey Koziol, 2002-05-14
+ * Only call MPI_Get_count if we can use MPI_BYTE for the MPI type
* for the I/O transfer. Someday we might include code to decode
* the MPI type used for more complicated transfers and call
* MPI_Get_count all the time.
@@ -1733,13 +1733,13 @@ static herr_t
H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
haddr_t addr, size_t size, const void *buf)
{
- H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
- MPI_Offset mpi_off;
- MPI_Status mpi_stat; /* Status from I/O operation */
- MPI_Datatype buf_type = MPI_BYTE; /* MPI description of the selection in memory */
- int mpi_code; /* MPI return code */
+ H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
+ MPI_Offset mpi_off;
+ MPI_Status mpi_stat; /* Status from I/O operation */
+ MPI_Datatype buf_type = MPI_BYTE; /* MPI description of the selection in memory */
+ int mpi_code; /* MPI return code */
#if MPI_VERSION >= 3
- MPI_Count bytes_written;
+ MPI_Count bytes_written;
MPI_Count type_size; /* MPI datatype used for I/O's size */
MPI_Count io_size; /* Actual number of bytes requested */
#else
@@ -1748,15 +1748,15 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
int io_size; /* Actual number of bytes requested */
#endif
int size_i;
- hbool_t use_view_this_time = FALSE;
+ hbool_t use_view_this_time = FALSE;
H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode */
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
- fprintf(stdout, "Entering H5FD_mpio_write\n" );
+ HDfprintf(stdout, "Entering H5FD_mpio_write\n" );
#endif
HDassert(file);
HDassert(H5FD_MPIO==file->pub.driver_id);
@@ -1777,7 +1777,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'w'])
- fprintf(stdout, "in H5FD_mpio_write mpi_off=%ld size_i=%d\n", (long)mpi_off, size_i);
+ HDfprintf(stdout, "in H5FD_mpio_write mpi_off=%ld size_i=%d\n", (long)mpi_off, size_i);
#endif
/* Get the transfer mode from the API context */
@@ -1791,7 +1791,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
* could mean "use MPI_BYTE" by convention).
*/
if(xfer_mode == H5FD_MPIO_COLLECTIVE) {
- MPI_Datatype file_type;
+ MPI_Datatype file_type;
/* Remember that views are used */
use_view_this_time = TRUE;
@@ -1818,7 +1818,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
- fprintf(stdout, "H5FD_mpio_write: using MPIO collective mode\n");
+ HDfprintf(stdout, "H5FD_mpio_write: using MPIO collective mode\n");
#endif
/* Get the collective_opt property to check whether the application wants to do IO individually. */
@@ -1828,7 +1828,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
if(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) {
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
- fprintf(stdout, "H5FD_mpio_write: doing MPI collective IO\n");
+ HDfprintf(stdout, "H5FD_mpio_write: doing MPI collective IO\n");
#endif
if(MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code)
@@ -1838,7 +1838,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "Metadata Coll opt property should be collective at this point")
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
- fprintf(stdout, "H5FD_mpio_write: doing MPI independent IO\n");
+ HDfprintf(stdout, "H5FD_mpio_write: doing MPI independent IO\n");
#endif
if(MPI_SUCCESS != (mpi_code = MPI_File_write_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mpi_code)
@@ -1889,21 +1889,21 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
done:
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
- fprintf(stdout, "proc %d: Leaving H5FD_mpio_write with ret_value=%d\n",
- file->mpi_rank, ret_value );
+ HDfprintf(stdout, "proc %d: Leaving H5FD_mpio_write with ret_value=%d\n",
+ file->mpi_rank, ret_value );
#endif
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_mpio_write() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_mpio_flush
*
* Purpose: Makes sure that all data is on disk. This is collective.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
* Programmer: Robb Matzke
* January 30, 1998
@@ -1913,15 +1913,15 @@ done:
static herr_t
H5FD_mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
{
- H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
- int mpi_code; /* mpi return code */
+ H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
+ int mpi_code; /* mpi return code */
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "Entering %s\n", FUNC);
+ HDfprintf(stdout, "Entering %s\n", FUNC);
#endif
HDassert(file);
HDassert(H5FD_MPIO == file->pub.driver_id);
@@ -1934,41 +1934,41 @@ H5FD_mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
done:
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "Leaving %s\n", FUNC);
+ HDfprintf(stdout, "Leaving %s\n", FUNC);
#endif
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_mpio_flush() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_mpio_truncate
*
* Purpose: Make certain the file's size matches it's allocated size
*
- * This is a little sticky in the mpio case, as it is not
+ * This is a little sticky in the mpio case, as it is not
* easy for us to track the current EOF by extracting it from
- * write calls.
+ * write calls.
*
* Instead, we first check to see if the eoa has changed since
- * the last call to this function. If it has, we call
- * MPI_File_get_size() to determine the current EOF, and
- * only call MPI_File_set_size() if this value disagrees
+ * the last call to this function. If it has, we call
+ * MPI_File_get_size() to determine the current EOF, and
+ * only call MPI_File_set_size() if this value disagrees
* with the current eoa.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* January 31, 2008
*
* Changes: Heavily reworked to avoid unnecessary MPI_File_set_size()
* calls. The hope is that these calls are superfluous in the
- * typical case, allowing us to avoid truncates most of the
+ * typical case, allowing us to avoid truncates most of the
* time.
*
- * The basic idea is to query the file system to get the
- * current eof, and only truncate if the file systems
+ * The basic idea is to query the file system to get the
+ * current eof, and only truncate if the file systems
* conception of the eof disagrees with our eoa.
*
* JRM -- 10/27/17
@@ -1978,14 +1978,14 @@ done:
static herr_t
H5FD_mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
{
- H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
+ H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "Entering %s\n", FUNC);
+ HDfprintf(stdout, "Entering %s\n", FUNC);
#endif
HDassert(file);
HDassert(H5FD_MPIO == file->pub.driver_id);
@@ -1995,13 +1995,13 @@ H5FD_mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
MPI_Offset size;
MPI_Offset needed_eof;
- /* In principle, it is possible for the size returned by the
- * call to MPI_File_get_size() to depend on whether writes from
+ /* In principle, it is possible for the size returned by the
+ * call to MPI_File_get_size() to depend on whether writes from
* all proceeses have completed at the time process 0 makes the
- * call.
+ * call.
*
* In practice, most (all?) truncate calls will come after a barrier
- * and with no interviening writes to the file (with the possible
+ * and with no interviening writes to the file (with the possible
* exception of sueprblock / superblock extension message updates).
*
* Check the "MPI file closing" flag in the API context to determine
@@ -2032,13 +2032,13 @@ H5FD_mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
if(MPI_SUCCESS != (mpi_code = MPI_File_set_size(file->f, needed_eof)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code)
- /* In general, we must wait until all processes have finished
- * the truncate before any process can continue, since it is
- * possible that a process would write at the end of the
+ /* In general, we must wait until all processes have finished
+ * the truncate before any process can continue, since it is
+ * possible that a process would write at the end of the
* file, and this write would be discarded by the truncate.
*
- * While this is an issue for a user initiated flush, it may
- * not be an issue at file close. If so, we may be able to
+ * While this is an issue for a user initiated flush, it may
+ * not be an issue at file close. If so, we may be able to
* optimize out the following barrier in that case.
*/
if(MPI_SUCCESS != (mpi_code = MPI_Barrier(file->comm)))
@@ -2052,22 +2052,22 @@ H5FD_mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
done:
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "Leaving %s\n", FUNC);
+ HDfprintf(stdout, "Leaving %s\n", FUNC);
#endif
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_mpio_truncate() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_mpi_rank
+ * Function: H5FD_mpio_mpi_rank
*
- * Purpose: Returns the MPI rank for a process
+ * Purpose: Returns the MPI rank for a process
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, May 16, 2002
*
* Modifications:
@@ -2077,7 +2077,7 @@ done:
static int
H5FD_mpio_mpi_rank(const H5FD_t *_file)
{
- const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file;
+ const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -2087,16 +2087,16 @@ H5FD_mpio_mpi_rank(const H5FD_t *_file)
FUNC_LEAVE_NOAPI(file->mpi_rank)
} /* end H5FD_mpio_mpi_rank() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_mpi_size
+ * Function: H5FD_mpio_mpi_size
*
- * Purpose: Returns the number of MPI processes
+ * Purpose: Returns the number of MPI processes
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, May 16, 2002
*
* Modifications:
@@ -2106,7 +2106,7 @@ H5FD_mpio_mpi_rank(const H5FD_t *_file)
static int
H5FD_mpio_mpi_size(const H5FD_t *_file)
{
- const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file;
+ const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -2116,17 +2116,17 @@ H5FD_mpio_mpi_size(const H5FD_t *_file)
FUNC_LEAVE_NOAPI(file->mpi_size)
} /* end H5FD_mpio_mpi_size() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5FD_mpio_communicator
+ * Function: H5FD_mpio_communicator
*
- * Purpose: Returns the MPI communicator for the file.
+ * Purpose: Returns the MPI communicator for the file.
*
- * Return: Success: The communicator
+ * Return: Success: The communicator
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 9, 1999
*
* Modifications:
@@ -2136,7 +2136,7 @@ H5FD_mpio_mpi_size(const H5FD_t *_file)
static MPI_Comm
H5FD_mpio_communicator(const H5FD_t *_file)
{
- const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file;
+ const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file;
FUNC_ENTER_NOAPI_NOINIT_NOERR
diff --git a/src/H5FDros3.c b/src/H5FDros3.c
new file mode 100644
index 0000000..75fcfd7
--- /dev/null
+++ b/src/H5FDros3.c
@@ -0,0 +1,1833 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Read-Only S3 Virtual File Driver (VFD)
+ *
+ * Programmer: Jacob Smith <jake.smith@hdfgroup.org>
+ * 2017-10-13
+ *
+ * Purpose:
+ *
+ * Provide read-only access to files hosted on Amazon's S3 service.
+ * Relies on "s3comms" utility layer to implement the AWS REST API.
+ */
+
+/* This source code file is part of the H5FD driver module */
+#include "H5FDdrvr_module.h"
+
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDros3.h" /* ros3 file driver */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5FDs3comms.h" /* S3 Communications */
+
+#ifdef H5_HAVE_ROS3_VFD
+
+/* toggle function call prints: 1 turns on
+ */
+#define ROS3_DEBUG 0
+
+/* toggle stats collection and reporting
+ */
+#define ROS3_STATS 0
+
+/* The driver identification number, initialized at runtime
+ */
+static hid_t H5FD_ROS3_g = 0;
+
+#if ROS3_STATS
+
+/* arbitrarily large value, such that any reasonable size read will be "less"
+ * than this value and set a true minimum
+ * not 0 because that may be a valid recorded minimum in degenerate cases
+ */
+#define ROS3_STATS_STARTING_MIN 0xfffffffful
+
+/* Configuration definitions for stats collection and breakdown
+ *
+ * 2^10 = 1024
+ * Reads up to 1024 bytes (1 kB) fall in bin 0
+ * 2^(10+(1*16)) = 2^26 = 64MB
+ * Reads of 64MB or greater fall in "overflow" bin[BIN_COUNT]
+ */
+#define ROS3_STATS_BASE 2
+#define ROS3_STATS_INTERVAL 1
+#define ROS3_STATS_START_POWER 10
+#define ROS3_STATS_BIN_COUNT 16 /* MUST BE GREATER THAN 0 */
+
+
+/*
+ * Calculate `BASE ^ (START_POWER + (INTERVAL * bin_i))`
+ * Stores result at `(unsigned long long *) out_ptr`.
+ * Used in computing boundaries between stats bins.
+ */
+#define ROS3_STATS_POW(bin_i, out_ptr) { \
+ unsigned long long donotshadowresult = 1; \
+ unsigned donotshadowindex = 0; \
+ for (donotshadowindex = 0; \
+ donotshadowindex < (((bin_i) * ROS3_STATS_INTERVAL) + \
+ ROS3_STATS_START_POWER); \
+ donotshadowindex++) \
+ { \
+ donotshadowresult *= ROS3_STATS_BASE; \
+ } \
+ *(out_ptr) = donotshadowresult; \
+}
+
+/* array to hold pre-computed boundaries for stats bins
+ */
+static unsigned long long ros3_stats_boundaries[ROS3_STATS_BIN_COUNT];
+
+/***************************************************************************
+ *
+ * Structure: ros3_statsbin
+ *
+ * Purpose:
+ *
+ * Structure for storing per-file ros3 VFD usage statistics.
+ *
+ *
+ *
+ * `count` (unsigned long long)
+ *
+ * Number of reads with size in this bin's range.
+ *
+ * `bytes` (unsigned long long)
+ *
+ * Total number of bytes read through this bin.
+ *
+ * `min` (unsigned long long)
+ *
+ * Smallest read size in this bin.
+ *
+ * `max` (unsigned long long)
+ *
+ * Largest read size in this bin.
+ *
+ *
+ *
+ * Programmer: Jacob Smith
+ *
+ ***************************************************************************/
+typedef struct {
+ unsigned long long count;
+ unsigned long long bytes;
+ unsigned long long min;
+ unsigned long long max;
+} ros3_statsbin;
+
+#endif /* ROS3_STATS */
+
+/***************************************************************************
+ *
+ * Structure: H5FD_ros3_t
+ *
+ * Purpose:
+ *
+ * H5FD_ros3_t is a structure used to store all information needed to
+ * maintain R/O access to a single HDF5 file that has been stored as a
+ * S3 object. This structure is created when such a file is "opened" and
+ * discarded when it is "closed".
+ *
+ * Presents an S3 object as a file to the HDF5 library.
+ *
+ *
+ *
+ * `pub` (H5FD_t)
+ *
+ * Instance of H5FD_t which contains all fields common to all VFDs.
+ * It must be the first item in this structure, since at higher levels,
+ * this structure will be treated as an instance of H5FD_t.
+ *
+ * `fa` (H5FD_ros3_fapl_t)
+ *
+ * Instance of `H5FD_ros3_fapl_t` containing the S3 configuration data
+ * needed to "open" the HDF5 file.
+ *
+ * `eoa` (haddr_t)
+ *
+ * End of addressed space in file. After open, it should always
+ * equal the file size.
+ *
+ * `s3r_handle` (s3r_t *)
+ *
+ * Instance of S3 Request handle associated with the target resource.
+ * Responsible for communicating with remote host and presenting file
+ * contents as indistinguishable from a file on the local filesystem.
+ *
+ * *** present only if ROS3_SATS is flagged to enable stats collection ***
+ *
+ * `meta` (ros3_statsbin[])
+ * `raw` (ros3_statsbin[])
+ *
+ * Only present if ros3 stats collection is enabled.
+ *
+ * Arrays of `ros3_statsbin` structures to record raw- and metadata reads.
+ *
+ * Records count and size of reads performed by the VFD, and is used to
+ * print formatted usage statistics to stdout upon VFD shutdown.
+ *
+ * Reads of each raw- and metadata type are recorded in an individual bin
+ * determined by the size of the read. The last bin of each type is
+ * reserved for "big" reads, with no defined upper bound.
+ *
+ * *** end ROS3_STATS ***
+ *
+ *
+ *
+ * Programmer: Jacob Smith
+ *
+ ***************************************************************************/
+typedef struct H5FD_ros3_t {
+ H5FD_t pub;
+ H5FD_ros3_fapl_t fa;
+ haddr_t eoa;
+ s3r_t *s3r_handle;
+#if ROS3_STATS
+ ros3_statsbin meta[ROS3_STATS_BIN_COUNT + 1];
+ ros3_statsbin raw[ROS3_STATS_BIN_COUNT + 1];
+#endif
+} H5FD_ros3_t;
+
+/*
+ * These macros check for overflow of various quantities. These macros
+ * assume that HDoff_t is signed and haddr_t and size_t are unsigned.
+ *
+ * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t'
+ * is too large to be represented by the second argument
+ * of the file seek function.
+ * Only included if it may be used -- ROS3 VFD is enabled.
+ *
+ */
+#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1)
+#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR))
+
+/* Prototypes */
+static herr_t H5FD_ros3_term(void);
+static void *H5FD_ros3_fapl_get(H5FD_t *_file);
+static void *H5FD_ros3_fapl_copy(const void *_old_fa);
+static herr_t H5FD_ros3_fapl_free(void *_fa);
+static H5FD_t *H5FD_ros3_open(const char *name, unsigned flags, hid_t fapl_id,
+ haddr_t maxaddr);
+static herr_t H5FD_ros3_close(H5FD_t *_file);
+static int H5FD_ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD_ros3_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD_ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD_ros3_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD_ros3_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD_ros3_get_handle(H5FD_t *_file, hid_t fapl,
+ void** file_handle);
+static herr_t H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
+ haddr_t addr, size_t size, void *buf);
+static herr_t H5FD_ros3_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
+ haddr_t addr, size_t size, const void *buf);
+static herr_t H5FD_ros3_truncate(H5FD_t *_file, hid_t dxpl_id,
+ hbool_t closing);
+static herr_t H5FD_ros3_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD_ros3_unlock(H5FD_t *_file);
+static herr_t H5FD_ros3_validate_config(const H5FD_ros3_fapl_t * fa);
+
+static const H5FD_class_t H5FD_ros3_g = {
+ "ros3", /* name */
+ MAXADDR, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD_ros3_term, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ sizeof(H5FD_ros3_fapl_t), /* fapl_size */
+ H5FD_ros3_fapl_get, /* fapl_get */
+ H5FD_ros3_fapl_copy, /* fapl_copy */
+ H5FD_ros3_fapl_free, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD_ros3_open, /* open */
+ H5FD_ros3_close, /* close */
+ H5FD_ros3_cmp, /* cmp */
+ H5FD_ros3_query, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD_ros3_get_eoa, /* get_eoa */
+ H5FD_ros3_set_eoa, /* set_eoa */
+ H5FD_ros3_get_eof, /* get_eof */
+ H5FD_ros3_get_handle, /* get_handle */
+ H5FD_ros3_read, /* read */
+ H5FD_ros3_write, /* write */
+ NULL, /* flush */
+ H5FD_ros3_truncate, /* truncate */
+ H5FD_ros3_lock, /* lock */
+ H5FD_ros3_unlock, /* unlock */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
+};
+
+/* Declare a free list to manage the H5FD_ros3_t struct */
+H5FL_DEFINE_STATIC(H5FD_ros3_t);
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD__init_package
+ *
+ * Purpose: Initializes any interface-specific data or routines.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Jacob Smith 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__init_package(void)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
+
+ if (H5FD_ros3_init() < 0) {
+ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL,
+ "unable to initialize ros3 VFD")
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* end H5FD__init_package() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_ros3_init
+ *
+ * Purpose: Initialize this driver by registering the driver with the
+ * library.
+ *
+ * Return: Success: The driver ID for the ros3 driver.
+ * Failure: Negative
+ *
+ * Programmer: Jacob Smith 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+H5FD_ros3_init(void)
+{
+ hid_t ret_value = H5I_INVALID_HID;
+ unsigned int bin_i;
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_init() called.\n");
+#endif
+
+ if (H5I_VFL != H5I_get_type(H5FD_ROS3_g))
+ H5FD_ROS3_g = H5FD_register(&H5FD_ros3_g, sizeof(H5FD_class_t), FALSE);
+
+#if ROS3_STATS
+ /* pre-compute statsbin boundaries
+ */
+ for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) {
+ unsigned long long value = 0;
+ ROS3_STATS_POW(bin_i, &value)
+ ros3_stats_boundaries[bin_i] = value;
+ }
+#endif
+
+ /* Set return value */
+ ret_value = H5FD_ROS3_g;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* end H5FD_ros3_init() */
+
+
+/*---------------------------------------------------------------------------
+ * Function: H5FD_ros3_term
+ *
+ * Purpose: Shut down the VFD
+ *
+ * Returns: SUCCEED (Can't fail)
+ *
+ * Programmer: Jacob Smith 2017
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_term(void)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_term() called.\n");
+#endif
+
+ /* Reset VFL ID */
+ H5FD_ROS3_g = 0;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+
+} /* end H5FD_ros3_term() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_fapl_ros3
+ *
+ * Purpose: Modify the file access property list to use the H5FD_ROS3
+ * driver defined in this source file. All driver specfic
+ * properties are passed in as a pointer to a suitably
+ * initialized instance of H5FD_ros3_fapl_t
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: John Mainzer
+ * 9/10/17
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_fapl_ros3(hid_t fapl_id,
+ H5FD_ros3_fapl_t *fa)
+{
+ H5P_genplist_t *plist = NULL; /* Property list pointer */
+ herr_t ret_value = FAIL;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "i*x", fapl_id, fa);
+
+ HDassert(fa != NULL);
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5Pset_fapl_ros3() called.\n");
+#endif
+
+ plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
+ if (plist == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \
+ "not a file access property list")
+ }
+
+ if (FAIL == H5FD_ros3_validate_config(fa)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid ros3 config")
+ }
+
+ ret_value = H5P_set_driver(plist, H5FD_ROS3, (void *)fa);
+
+done:
+ FUNC_LEAVE_API(ret_value)
+
+} /* end H5Pset_fapl_ros3() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_ros3_validate_config()
+ *
+ * Purpose: Test to see if the supplied instance of H5FD_ros3_fapl_t
+ * contains internally consistant data. Return SUCCEED if so,
+ * and FAIL otherwise.
+ *
+ * Note the difference between internally consistant and
+ * correct. As we will have to try to access the target
+ * object to determine whether the supplied data is correct,
+ * we will settle for internal consistancy at this point
+ *
+ * Return: SUCCEED if instance of H5FD_ros3_fapl_t contains internally
+ * consistant data, FAIL otherwise.
+ *
+ * Programmer: Jacob Smith
+ * 9/10/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_validate_config(const H5FD_ros3_fapl_t * fa)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ HDassert(fa != NULL);
+
+ if ( fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION ) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "Unknown H5FD_ros3_fapl_t version");
+ }
+
+ /* if set to authenticate, region and id cannot be empty strings
+ */
+ if (fa->authenticate == TRUE) {
+ if ((fa->aws_region[0] == '\0') ||
+ (fa->secret_id[0] == '\0'))
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "Inconsistent authentication information");
+ }
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* end H5FD_ros3_validate_config() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_fapl_ros3
+ *
+ * Purpose: Returns information about the ros3 file access property
+ * list though the function arguments.
+ *
+ * Return: Success: Non-negative
+ *
+ * Failure: Negative
+ *
+ * Programmer: John Mainzer
+ * 9/10/17
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_fapl_ros3(hid_t fapl_id,
+ H5FD_ros3_fapl_t *fa_out)
+{
+ const H5FD_ros3_fapl_t *fa = NULL;
+ H5P_genplist_t *plist = NULL;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "i*x", fapl_id, fa_out);
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5Pget_fapl_ros3() called.\n");
+#endif
+
+ if (fa_out == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL")
+ }
+
+ plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
+ if (plist == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
+ }
+
+ if (H5FD_ROS3 != H5P_peek_driver(plist)) {
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
+ }
+
+ fa = (const H5FD_ros3_fapl_t *)H5P_peek_driver_info(plist);
+ if (fa == NULL) {
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
+ }
+
+ /* Copy the ros3 fapl data out */
+ HDmemcpy(fa_out, fa, sizeof(H5FD_ros3_fapl_t));
+
+done:
+ FUNC_LEAVE_API(ret_value)
+
+} /* end H5Pget_fapl_ros3() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_ros3_fapl_get
+ *
+ * Purpose: Gets a file access property list which could be used to
+ * create an identical file.
+ *
+ * Return: Success: Ptr to new file access property list value.
+ *
+ * Failure: NULL
+ *
+ * Programmer: John Mainzer
+ * 9/8/17
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5FD_ros3_fapl_get(H5FD_t *_file)
+{
+ H5FD_ros3_t *file = (H5FD_ros3_t*)_file;
+ H5FD_ros3_fapl_t *fa = NULL;
+ void *ret_value = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ fa = (H5FD_ros3_fapl_t *)H5MM_calloc(sizeof(H5FD_ros3_fapl_t));
+ if (fa == NULL) {
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
+ "memory allocation failed")
+ }
+
+ /* Copy the fields of the structure */
+ HDmemcpy(fa, &(file->fa), sizeof(H5FD_ros3_fapl_t));
+
+ /* Set return value */
+ ret_value = fa;
+
+done:
+ if (ret_value == NULL) {
+ if (fa != NULL) {
+ H5MM_xfree(fa);
+ }
+ }
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* end H5FD_ros3_fapl_get() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_ros3_fapl_copy
+ *
+ * Purpose: Copies the ros3-specific file access properties.
+ *
+ * Return: Success: Ptr to a new property list
+ *
+ * Failure: NULL
+ *
+ * Programmer: John Mainzer
+ * 9/8/17
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5FD_ros3_fapl_copy(const void *_old_fa)
+{
+ const H5FD_ros3_fapl_t *old_fa = (const H5FD_ros3_fapl_t*)_old_fa;
+ H5FD_ros3_fapl_t *new_fa = NULL;
+ void *ret_value = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ new_fa = (H5FD_ros3_fapl_t *)H5MM_malloc(sizeof(H5FD_ros3_fapl_t));
+ if (new_fa == NULL) {
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
+ "memory allocation failed");
+ }
+
+ HDmemcpy(new_fa, old_fa, sizeof(H5FD_ros3_fapl_t));
+ ret_value = new_fa;
+
+done:
+ if (ret_value == NULL) {
+ if (new_fa != NULL) {
+ H5MM_xfree(new_fa);
+ }
+ }
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* end H5FD_ros3_fapl_copy() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_ros3_fapl_free
+ *
+ * Purpose: Frees the ros3-specific file access properties.
+ *
+ * Return: SUCCEED (cannot fail)
+ *
+ * Programmer: John Mainzer
+ * 9/8/17
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_fapl_free(void *_fa)
+{
+ H5FD_ros3_fapl_t *fa = (H5FD_ros3_fapl_t*)_fa;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ HDassert(fa != NULL); /* sanity check */
+
+ H5MM_xfree(fa);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+
+} /* end H5FD_ros3_fapl_free() */
+
+#if ROS3_STATS
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: ros3_reset_stats()
+ *
+ * Purpose:
+ *
+ * Reset the stats collection elements in this virtual file structure.
+ *
+ * Clears any set data in stats bins; initializes/zeroes values.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ * - Occurs if the file is invalid somehow
+ *
+ * Programmer: Jacob Smith
+ * 2017-12-08
+ *
+ *----------------------------------------------------------------------------
+ */
+static herr_t
+ros3_reset_stats(H5FD_ros3_t *file)
+{
+ unsigned i = 0;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if ROS3_DEBUG
+ HDprintf("ros3_reset_stats() called\n");
+#endif
+
+ if (file == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "file was null");
+ }
+
+ for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
+ file->raw[i].bytes = 0;
+ file->raw[i].count = 0;
+ file->raw[i].min = (unsigned long long)ROS3_STATS_STARTING_MIN;
+ file->raw[i].max = 0;
+
+ file->meta[i].bytes = 0;
+ file->meta[i].count = 0;
+ file->meta[i].min = (unsigned long long)ROS3_STATS_STARTING_MIN;
+ file->meta[i].max = 0;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+
+} /* end ros3_reset_stats() */
+
+#endif /* ROS3_STATS */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_ros3_open()
+ *
+ * Purpose:
+ *
+ * Create and/or opens a file as an HDF5 file.
+ *
+ * Any flag except H5F_ACC_RDONLY will cause an error.
+ *
+ * Name (as received from `H5FD_open()`) must conform to web url:
+ * NAME :: HTTP "://" DOMAIN [PORT] ["/" [URI] [QUERY] ]
+ * HTTP :: "http" [ "s" ]
+ * DOMAIN :: e.g., "mybucket.host.org"
+ * PORT :: ":" <number> (e.g., ":9000" )
+ * URI :: <string> (e.g., "path/to/resource.hd5" )
+ * QUERY :: "?" <string> (e.g., "arg1=param1&arg2=param2")
+ *
+ * Return:
+ *
+ * Success: A pointer to a new file data structure.
+ * The public fields will be initialized by the caller, which is
+ * always H5FD_open().
+ *
+ * Failure: NULL
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-02
+ *
+ *-------------------------------------------------------------------------
+ */
+static H5FD_t *
+H5FD_ros3_open(
+ const char *url,
+ unsigned flags,
+ hid_t fapl_id,
+ haddr_t maxaddr)
+{
+ H5FD_ros3_t *file = NULL;
+ struct tm *now = NULL;
+ char iso8601now[ISO8601_SIZE];
+ unsigned char signing_key[SHA256_DIGEST_LENGTH];
+ s3r_t *handle = NULL;
+ H5FD_ros3_fapl_t fa;
+ H5FD_t *ret_value = NULL;
+
+
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_open() called.\n");
+#endif
+
+ /* Sanity check on file offsets */
+ HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t));
+
+ /* Check arguments */
+ if (!url || !*url)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name")
+ if (0 == maxaddr || HADDR_UNDEF == maxaddr)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr")
+ if (ADDR_OVERFLOW(maxaddr))
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr")
+ if (flags != H5F_ACC_RDONLY)
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL,
+ "only Read-Only access allowed")
+
+ if (FAIL == H5Pget_fapl_ros3(fapl_id, &fa)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get property list")
+ }
+
+ if (CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "unable to initialize curl global (placeholder flags)")
+ }
+
+ /* open file; procedure depends on whether or not the fapl instructs to
+ * authenticate requests or not.
+ */
+ if (fa.authenticate == TRUE) {
+ /* compute signing key (part of AWS/S3 REST API)
+ * can be re-used by user/key for 7 days after creation.
+ * find way to re-use/share
+ */
+ now = gmnow();
+ HDassert( now != NULL );
+ if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "problem while writing iso8601 timestamp")
+ }
+ if (FAIL == H5FD_s3comms_signing_key(signing_key,
+ (const char *)fa.secret_key,
+ (const char *)fa.aws_region,
+ (const char *)iso8601now) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "problem while computing signing key")
+ }
+
+ handle = H5FD_s3comms_s3r_open(
+ url,
+ (const char *)fa.aws_region,
+ (const char *)fa.secret_id,
+ (const unsigned char *)signing_key);
+ } else {
+ handle = H5FD_s3comms_s3r_open(url, NULL, NULL, NULL);
+ } /* if/else should authenticate */
+
+ if (handle == NULL) {
+ /* If we want to check CURL's say on the matter in a controlled
+ * fashion, this is the place to do it, but would need to make a
+ * few minor changes to s3comms `s3r_t` and `s3r_read()`.
+ */
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "could not open");
+ }
+
+ /* create new file struct
+ */
+ file = H5FL_CALLOC(H5FD_ros3_t);
+ if (file == NULL) {
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
+ "unable to allocate file struct")
+ }
+
+ file->s3r_handle = handle;
+ HDmemcpy(&(file->fa), &fa, sizeof(H5FD_ros3_fapl_t));
+
+#if ROS3_STATS
+ if (FAIL == ros3_reset_stats(file)) {
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL,
+ "unable to reset file statistics")
+ }
+#endif /* ROS3_STATS */
+
+ ret_value = (H5FD_t*)file;
+
+done:
+ if (ret_value == NULL) {
+ if (handle != NULL) {
+ if (FAIL == H5FD_s3comms_s3r_close(handle)) {
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL,
+ "unable to close s3 file handle")
+ }
+ }
+ if (file != NULL) {
+ file = H5FL_FREE(H5FD_ros3_t, file);
+ }
+ curl_global_cleanup(); /* early cleanup because open failed */
+ } /* end if null return value (error) */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* end H5FD_ros3_open() */
+
+#if ROS3_STATS
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: ros3_fprint_stats()
+ *
+ * Purpose:
+ *
+ * Tabulate and pretty-print statistics for this virtual file.
+ *
+ * Should be called upon file close.
+ *
+ * Shows number of reads and bytes read, broken down by
+ * "raw" (H5FD_MEM_DRAW)
+ * or "meta" (any other flag)
+ *
+ * Prints filename and listing of total number of reads and bytes read,
+ * both as a grand total and separate meta- and rawdata reads.
+ *
+ * If any reads were done, prints out two tables:
+ *
+ * 1. overview of raw- and metadata reads
+ * - min (smallest size read)
+ * - average of size read
+ * - k,M,G suffixes by powers of 1024 (2^10)
+ * - max (largest size read)
+ * 2. tabulation of "bins", sepraring reads into exponentially-larger
+ * ranges of size.
+ * - columns for number of reads, total bytes, and average size, with
+ * separate sub-colums for raw- and metadata reads.
+ * - each row represents one bin, identified by the top of its range
+ *
+ * Bin ranges can be modified with pound-defines at the top of this file.
+ *
+ * Bins without any reads in their bounds are not printed.
+ *
+ * An "overflow" bin is also present, to catch "big" reads.
+ *
+ * Output for all bins (and range ceiling and average size report)
+ * is divied by powers of 1024. By corollary, four digits before the decimal
+ * is valid.
+ *
+ * - 41080 bytes is represented by 40.177k, not 41.080k
+ * - 1004.831M represents approx. 1052642000 bytes
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ * - occurs if the file passed in is invalid
+ * - TODO: if stream is invalid? how can we check this?
+ *
+ * Programmer: Jacob Smith
+ *
+ *----------------------------------------------------------------------------
+ */
+static herr_t
+ros3_fprint_stats(FILE *stream,
+ const H5FD_ros3_t *file)
+{
+ herr_t ret_value = SUCCEED;
+ parsed_url_t *purl = NULL;
+ unsigned i = 0;
+ unsigned long count_meta = 0;
+ unsigned long count_raw = 0;
+ double average_meta = 0.0;
+ double average_raw = 0.0;
+ unsigned long long min_meta = (unsigned long long)ROS3_STATS_STARTING_MIN;
+ unsigned long long min_raw = (unsigned long long)ROS3_STATS_STARTING_MIN;
+ unsigned long long max_meta = 0;
+ unsigned long long max_raw = 0;
+ unsigned long long bytes_raw = 0;
+ unsigned long long bytes_meta = 0;
+ double re_dub = 0.0; /* re-usable double variable */
+ unsigned suffix_i = 0;
+ const char suffixes[] = { ' ', 'K', 'M', 'G', 'T', 'P' };
+
+
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ if (stream == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "file stream cannot be null" );
+ }
+ if (file == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "file cannot be null");
+ }
+ if (file->s3r_handle == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "s3 request handle cannot be null");
+ }
+ if (file->s3r_handle->purl == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "parsed url structure cannot be null");
+ }
+ purl = file->s3r_handle->purl;
+
+ /******************
+ * PRINT FILENAME *
+ ******************/
+
+ HDfprintf(stream, "stats for %s://%s", purl->scheme, purl->host);
+ if (purl->port != NULL && purl->port[0] != '\0')
+ HDfprintf(stream, ":%s", purl->port);
+ if (purl->query != NULL && purl->query[0] != '\0') {
+ if (purl->path != NULL && purl->path[0] != '\0')
+ HDfprintf(stream, "/%s", purl->path);
+ else
+ HDfprintf(stream, "/");
+ HDfprintf(stream, "?%s", purl->query);
+ } else if (purl->path != NULL && purl->path[0] != '\0') {
+ HDfprintf(stream, "/%s", purl->path);
+ }
+ HDfprintf(stream, "\n");
+
+ /*******************
+ * AGGREGATE STATS *
+ *******************/
+
+ for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
+ const ros3_statsbin *r = &file->raw[i];
+ const ros3_statsbin *m = &file->meta[i];
+
+ if (m->min < min_meta) min_meta = m->min;
+ if (r->min < min_raw) min_raw = r->min;
+ if (m->max > max_meta) max_meta = m->max;
+ if (r->max > max_raw) max_raw = r->max;
+
+ count_raw += r->count;
+ count_meta += m->count;
+ bytes_raw += r->bytes;
+ bytes_meta += m->bytes;
+ }
+ if (count_raw > 0)
+ average_raw = (double)bytes_raw / (double)count_raw;
+ if (count_meta > 0)
+ average_meta = (double)bytes_meta / (double)count_meta;
+
+ /******************
+ * PRINT OVERVIEW *
+ ******************/
+
+ HDfprintf(stream, "TOTAL READS: %llu (%llu meta, %llu raw)\n",
+ count_raw + count_meta, count_meta, count_raw);
+ HDfprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n",
+ bytes_raw + bytes_meta, bytes_meta, bytes_raw);
+
+ if (count_raw + count_meta == 0)
+ goto done;
+
+ /*************************
+ * PRINT AGGREGATE STATS *
+ *************************/
+
+ HDfprintf(stream, "SIZES meta raw\n");
+ HDfprintf(stream, " min ");
+ if (count_meta == 0) {
+ HDfprintf(stream, " 0.000 ");
+ } else {
+ re_dub = (double)min_meta;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
+ }
+
+ if (count_raw == 0) {
+ HDfprintf(stream, " 0.000 \n");
+ } else {
+ re_dub = (double)min_raw;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
+ }
+
+ HDfprintf(stream, " avg ");
+ re_dub = (double)average_meta;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
+
+ re_dub = (double)average_raw;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
+
+ HDfprintf(stream, " max ");
+ re_dub = (double)max_meta;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
+
+ re_dub = (double)max_raw;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
+
+ /******************************
+ * PRINT INDIVIDUAL BIN STATS *
+ ******************************/
+
+ HDfprintf(stream,
+ "BINS # of reads total bytes average size\n");
+ HDfprintf(stream,
+ " up-to meta raw meta raw meta raw\n");
+
+ for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
+ const ros3_statsbin *m;
+ const ros3_statsbin *r;
+ unsigned long long range_end = 0;
+ char bm_suffix = ' '; /* bytes-meta */
+ double bm_val = 0.0;
+ char br_suffix = ' '; /* bytes-raw */
+ double br_val = 0.0;
+ char am_suffix = ' '; /* average-meta */
+ double am_val = 0.0;
+ char ar_suffix = ' '; /* average-raw */
+ double ar_val = 0.0;
+
+ m = &file->meta[i];
+ r = &file->raw[i];
+ if (r->count == 0 && m->count == 0)
+ continue;
+
+ range_end = ros3_stats_boundaries[i];
+
+ if (i == ROS3_STATS_BIN_COUNT) {
+ range_end = ros3_stats_boundaries[i-1];
+ HDfprintf(stream, ">");
+ } else {
+ HDfprintf(stream, " ");
+ }
+
+ bm_val = (double)m->bytes;
+ for (suffix_i = 0; bm_val >= 1024.0; suffix_i++)
+ bm_val /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ bm_suffix = suffixes[suffix_i];
+
+ br_val = (double)r->bytes;
+ for (suffix_i = 0; br_val >= 1024.0; suffix_i++)
+ br_val /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ br_suffix = suffixes[suffix_i];
+
+ if (m->count > 0)
+ am_val = (double)(m->bytes) / (double)(m->count);
+ for (suffix_i = 0; am_val >= 1024.0; suffix_i++)
+ am_val /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ am_suffix = suffixes[suffix_i];
+
+ if (r->count > 0)
+ ar_val = (double)(r->bytes) / (double)(r->count);
+ for (suffix_i = 0; ar_val >= 1024.0; suffix_i++)
+ ar_val /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ ar_suffix = suffixes[suffix_i];
+
+ re_dub = (double)range_end;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+
+ HDfprintf(stream,
+ " %8.3f%c %7d %7d %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n",
+ re_dub, suffixes[suffix_i], /* bin ceiling */
+ m->count, /* metadata reads */
+ r->count, /* rawdata reads */
+ bm_val, bm_suffix, /* metadata bytes */
+ br_val, br_suffix, /* rawdata bytes */
+ am_val, am_suffix, /* metadata average */
+ ar_val, ar_suffix); /* rawdata average */
+
+ fflush(stream);
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+
+} /* ros3_fprint_stats */
+#endif /* ROS3_STATS */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_ros3_close()
+ *
+ * Purpose:
+ *
+ * Close an HDF5 file.
+ *
+ * Return:
+ *
+ * SUCCEED/FAIL
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-02
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_close(H5FD_t H5_ATTR_UNUSED *_file)
+{
+ H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_close() called.\n");
+#endif
+
+ /* Sanity checks
+ */
+ HDassert(file != NULL);
+ HDassert(file->s3r_handle != NULL);
+
+ /* Close the underlying request handle
+ */
+ if (FAIL == H5FD_s3comms_s3r_close(file->s3r_handle)) {
+ HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
+ "unable to close S3 request handle")
+ }
+
+#if ROS3_STATS
+ /* TODO: mechanism to re-target stats printout */
+ if (ros3_fprint_stats(stdout, file) == FAIL) {
+ HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL,
+ "problem while writing file statistics")
+ }
+#endif /* ROS3_STATS */
+
+ /* Release the file info
+ */
+ file = H5FL_FREE(H5FD_ros3_t, file);
+
+done:
+ curl_global_cleanup(); /* cleanup to answer init on open */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* end H5FD_ros3_close() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_ros3_cmp()
+ *
+ * Purpose:
+ *
+ * Compares two files belonging to this driver using an arbitrary
+ * (but consistent) ordering:
+ *
+ * + url scheme
+ * + url host
+ * + url port
+ * + url path
+ * + url query
+ * + fapl aws_region
+ * + fapl secret_id
+ * + fapl secret_key
+ *
+ * tl;dr -> check URL, check crentials
+ *
+ * Return:
+ *
+ * - Equivalent: 0
+ * - Not Equivalent: -1
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-06
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5FD_ros3_cmp(
+ const H5FD_t *_f1,
+ const H5FD_t *_f2)
+{
+ const H5FD_ros3_t *f1 = (const H5FD_ros3_t *)_f1;
+ const H5FD_ros3_t *f2 = (const H5FD_ros3_t *)_f2;
+ const parsed_url_t *purl1 = NULL;
+ const parsed_url_t *purl2 = NULL;
+ int ret_value = 0;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_cmp() called.\n");
+#endif
+
+ HDassert(f1->s3r_handle != NULL);
+ HDassert(f2->s3r_handle != NULL);
+
+ purl1 = (const parsed_url_t *)f1->s3r_handle->purl;
+ purl2 = (const parsed_url_t *)f2->s3r_handle->purl;
+ HDassert(purl1 != NULL);
+ HDassert(purl2 != NULL);
+ HDassert(purl1->scheme != NULL);
+ HDassert(purl2->scheme != NULL);
+ HDassert(purl1->host != NULL);
+ HDassert(purl2->host != NULL);
+
+ /* URL: SCHEME */
+ if (HDstrcmp(purl1->scheme, purl2->scheme)) {
+ HGOTO_DONE(-1);
+ }
+
+ /* URL: HOST */
+ if (HDstrcmp(purl1->host, purl2->host)) {
+ HGOTO_DONE(-1);
+ }
+
+ /* URL: PORT */
+ if (purl1->port && purl2->port) {
+ if (HDstrcmp(purl1->port, purl2->port)) {
+ HGOTO_DONE(-1);
+ }
+ }
+ else
+ if (purl1->port) {
+ HGOTO_DONE(-1);
+ }
+ else
+ if (purl2->port) {
+ HGOTO_DONE(-1);
+ }
+
+ /* URL: PATH */
+ if (purl1->path && purl2->path) {
+ if (HDstrcmp(purl1->path, purl2->path)) {
+ HGOTO_DONE(-1);
+ }
+ }
+ else
+ if (purl1->path && !purl2->path) {
+ HGOTO_DONE(-1);
+ }
+ else
+ if (purl2->path && !purl1->path) {
+ HGOTO_DONE(-1);
+ }
+
+ /* URL: QUERY */
+ if (purl1->query && purl2->query) {
+ if (HDstrcmp(purl1->query, purl2->query)) {
+ HGOTO_DONE(-1);
+ }
+ }
+ else
+ if (purl1->query && !purl2->query) {
+ HGOTO_DONE(-1);
+ }
+ else
+ if (purl2->query && !purl1->query) {
+ HGOTO_DONE(-1);
+ }
+
+ /* FAPL: AWS_REGION */
+ if (f1->fa.aws_region[0] != '\0' && f1->fa.aws_region[0] != '\0') {
+ if (HDstrcmp(f1->fa.aws_region, f2->fa.aws_region)) {
+ HGOTO_DONE(-1);
+ }
+ }
+ else
+ if (f1->fa.aws_region[0] != '\0') {
+ HGOTO_DONE(-1);
+ }
+ else
+ if (f2->fa.aws_region[0] != '\0') {
+ HGOTO_DONE(-1);
+ }
+
+ /* FAPL: SECRET_ID */
+ if (f1->fa.secret_id[0] != '\0' && f1->fa.secret_id[0] != '\0') {
+ if (HDstrcmp(f1->fa.secret_id, f2->fa.secret_id)) {
+ HGOTO_DONE(-1);
+ }
+ }
+ else
+ if (f1->fa.secret_id[0] != '\0') {
+ HGOTO_DONE(-1);
+ }
+ else
+ if (f2->fa.secret_id[0] != '\0') {
+ HGOTO_DONE(-1);
+ }
+
+ /* FAPL: SECRET_KEY */
+ if (f1->fa.secret_key[0] != '\0' && f1->fa.secret_key[0] != '\0') {
+ if (HDstrcmp(f1->fa.secret_key, f2->fa.secret_key)) {
+ HGOTO_DONE(-1);
+ }
+ }
+ else
+ if (f1->fa.secret_key[0] != '\0') {
+ HGOTO_DONE(-1);
+ }
+ else
+ if (f2->fa.secret_key[0] != '\0') {
+ HGOTO_DONE(-1);
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5FD_ros3_cmp() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_ros3_query
+ *
+ * Purpose: Set the flags that this VFL driver is capable of supporting.
+ * (listed in H5FDpublic.h)
+ *
+ * Note that since the ROS3 VFD is read only, most flags
+ * are irrelevant.
+ *
+ * The term "set" is highly misleading...
+ * stores/copies the supported flags in the out-pointer `flags`.
+ *
+ * Return: SUCCEED (Can't fail)
+ *
+ * Programmer: John Mainzer
+ * 9/11/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file,
+ unsigned long *flags /* out */)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_query() called.\n");
+#endif
+
+ /* Set the VFL feature flags that this driver supports */
+ if (flags) {
+ *flags = 0;
+ /* OK to perform data sieving for faster raw data reads & writes */
+ *flags |= H5FD_FEAT_DATA_SIEVE;
+ } /* end if */
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+
+} /* H5FD_ros3_query() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_ros3_get_eoa()
+ *
+ * Purpose:
+ *
+ * Gets the end-of-address marker for the file. The EOA marker
+ * is the first address past the last byte allocated in the
+ * format address space.
+ *
+ * Return:
+ *
+ * The end-of-address marker.
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-02
+ *
+ *-------------------------------------------------------------------------
+ */
+static haddr_t
+H5FD_ros3_get_eoa(const H5FD_t *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type)
+{
+ const H5FD_ros3_t *file = (const H5FD_ros3_t *)_file;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_get_eoa() called.\n");
+#endif
+
+ FUNC_LEAVE_NOAPI(file->eoa)
+
+} /* end H5FD_ros3_get_eoa() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_ros3_set_eoa()
+ *
+ * Purpose:
+ *
+ * Set the end-of-address marker for the file.
+ *
+ * Return:
+ *
+ * SUCCEED (can't fail)
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-03
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_set_eoa(H5FD_t *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type,
+ haddr_t addr)
+{
+ H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_set_eoa() called.\n");
+#endif
+
+ file->eoa = addr;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+
+} /* H5FD_ros3_set_eoa() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_ros3_get_eof()
+ *
+ * Purpose:
+ *
+ * Returns the end-of-file marker.
+ *
+ * Return:
+ *
+ * EOF: the first address past the end of the "file", either the
+ * filesystem file or the HDF5 file.
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-02
+ *
+ *-------------------------------------------------------------------------
+ */
+static haddr_t
+H5FD_ros3_get_eof(const H5FD_t *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type)
+{
+ const H5FD_ros3_t *file = (const H5FD_ros3_t *)_file;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_get_eof() called.\n");
+#endif
+
+ FUNC_LEAVE_NOAPI(H5FD_s3comms_s3r_get_filesize(file->s3r_handle))
+
+} /* end H5FD_ros3_get_eof() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_ros3_get_handle()
+ *
+ * Purpose:
+ *
+ * Returns the S3 Request handle (s3r_t) of ros3 file driver.
+ *
+ * Returns:
+ *
+ * SUCCEED/FAIL
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-02
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_get_handle(H5FD_t *_file,
+ hid_t H5_ATTR_UNUSED fapl,
+ void **file_handle)
+{
+ H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_get_handle() called.\n");
+#endif
+
+ if (!file_handle) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
+ }
+
+ *file_handle = file->s3r_handle;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* end H5FD_ros3_get_handle() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_ros3_read()
+ *
+ * Purpose
+ *
+ * Reads SIZE bytes of data from FILE beginning at address ADDR
+ * into buffer BUF according to data transfer properties in DXPL_ID.
+ *
+ * Return:
+ *
+ * Success: `SUCCEED`
+ * - Result is stored in caller-supplied buffer BUF.
+ * Failure: `FAIL`
+ * - Unable to complete read.
+ * - Contents of buffer `buf` are undefined.
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-??
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_read(H5FD_t *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type,
+ hid_t H5_ATTR_UNUSED dxpl_id,
+ haddr_t addr, /* start offset */
+ size_t size, /* length of read */
+ void *buf) /* out */
+{
+ H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
+ size_t filesize = 0;
+ herr_t ret_value = SUCCEED;
+#if ROS3_STATS
+ /* working variables for storing stats */
+ ros3_statsbin *bin = NULL;
+ unsigned bin_i = 0;
+#endif /* ROS3_STATS */
+
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_read() called.\n");
+#endif
+
+ HDassert(file != NULL);
+ HDassert(file->s3r_handle != NULL);
+ HDassert(buf != NULL);
+
+ filesize = H5FD_s3comms_s3r_get_filesize(file->s3r_handle);
+
+ if ((addr > filesize) || ((addr + size) > filesize)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "range exceeds file address")
+ }
+
+ if (H5FD_s3comms_s3r_read(file->s3r_handle, addr, size, buf) == FAIL) {
+ HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to execute read")
+ }
+
+#if ROS3_STATS
+
+ /* Find which "bin" this read fits in. Can be "overflow" bin.
+ */
+ for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) {
+ if ((unsigned long long)size < ros3_stats_boundaries[bin_i]) {
+ break;
+ }
+ }
+ bin = (type == H5FD_MEM_DRAW)
+ ? &file->raw[bin_i]
+ : &file->meta[bin_i];
+
+ /* Store collected stats in appropriate bin
+ */
+ if (bin->count == 0) {
+ bin->min = size;
+ bin->max = size;
+ }
+ else {
+ if (size < bin->min) {
+ bin->min = size;
+ }
+ if (size > bin->max) {
+ bin->max = size;
+ }
+ }
+ bin->count++;
+ bin->bytes += (unsigned long long)size;
+
+#endif /* ROS3_STATS */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* end H5FD_ros3_read() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_ros3_write()
+ *
+ * Purpose:
+ *
+ * Write bytes to file.
+ * UNSUPPORTED IN READ-ONLY ROS3 VFD.
+ *
+ * Return:
+ *
+ * FAIL (Not possible with Read-Only S3 file.)
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-23
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_write(H5FD_t H5_ATTR_UNUSED *_file,
+ H5FD_mem_t H5_ATTR_UNUSED type,
+ hid_t H5_ATTR_UNUSED dxpl_id,
+ haddr_t H5_ATTR_UNUSED addr,
+ size_t H5_ATTR_UNUSED size,
+ const void H5_ATTR_UNUSED *buf)
+{
+ herr_t ret_value = FAIL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_write() called.\n");
+#endif
+
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL,
+ "cannot write to read-only file.")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5FD_ros3_write() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_ros3_truncate()
+ *
+ * Purpose:
+ *
+ * Makes sure that the true file size is the same (or larger)
+ * than the end-of-address.
+ *
+ * NOT POSSIBLE ON READ-ONLY S3 FILES.
+ *
+ * Return:
+ *
+ * FAIL (Not possible on Read-Only S3 files.)
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-23
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_truncate(H5FD_t H5_ATTR_UNUSED *_file,
+ hid_t H5_ATTR_UNUSED dxpl_id,
+ hbool_t H5_ATTR_UNUSED closing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5FD_ros3_truncate() called.\n");
+#endif
+
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL,
+ "cannot truncate read-only file.")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* end H5FD_ros3_truncate() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_ros3_lock()
+ *
+ * Purpose:
+ *
+ * Place an advisory lock on a file.
+ * No effect on Read-Only S3 file.
+ *
+ * Suggestion: remove lock/unlock from class
+ * > would result in error at H5FD_[un]lock() (H5FD.c)
+ *
+ * Return:
+ *
+ * SUCCEED (No-op always succeeds)
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-03
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_lock(H5FD_t H5_ATTR_UNUSED *_file,
+ hbool_t H5_ATTR_UNUSED rw)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_LEAVE_NOAPI(SUCCEED)
+
+} /* end H5FD_ros3_lock() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_ros3_unlock()
+ *
+ * Purpose:
+ *
+ * Remove the existing lock on the file.
+ * No effect on Read-Only S3 file.
+ *
+ * Return:
+ *
+ * SUCCEED (No-op always succeeds)
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-03
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_unlock(H5FD_t H5_ATTR_UNUSED *_file)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_LEAVE_NOAPI(SUCCEED)
+
+} /* end H5FD_ros3_unlock() */
+
+#endif /* H5_HAVE_ROS3_VFD */
+
diff --git a/src/H5FDros3.h b/src/H5FDros3.h
new file mode 100644
index 0000000..457326e
--- /dev/null
+++ b/src/H5FDros3.h
@@ -0,0 +1,105 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Read-Only S3 Virtual File Driver (VFD)
+ *
+ * Programmer: John Mainzer
+ * 2017-10-10
+ *
+ * Purpose: The public header file for the ros3 driver.
+ */
+#ifndef H5FDros3_H
+#define H5FDros3_H
+
+#ifdef H5_HAVE_ROS3_VFD
+#define H5FD_ROS3 (H5FD_ros3_init())
+#else
+#define H5FD_ROS3 (H5I_INVALID_HID)
+#endif /* H5_HAVE_ROS3_VFD */
+
+#ifdef H5_HAVE_ROS3_VFD
+
+/****************************************************************************
+ *
+ * Structure: H5FD_ros3_fapl_t
+ *
+ * Purpose:
+ *
+ * H5FD_ros3_fapl_t is a public structure that is used to pass S3
+ * authentication data to the appropriate S3 VFD via the FAPL. A pointer
+ * to an instance of this structure is a parameter to H5Pset_fapl_ros3()
+ * and H5Pget_fapl_ros3().
+ *
+ *
+ *
+ * `version` (int32_t)
+ *
+ * Version number of the H5FD_ros3_fapl_t structure. Any instance passed
+ * to the above calls must have a recognized version number, or an error
+ * will be flagged.
+ *
+ * This field should be set to H5FD_CURR_ROS3_FAPL_T_VERSION.
+ *
+ * `authenticate` (hbool_t)
+ *
+ * Flag TRUE or FALSE whether or not requests are to be authenticated
+ * with the AWS4 algorithm.
+ * If TRUE, `aws_region`, `secret_id`, and `secret_key` must be populated.
+ * If FALSE, those three components are unused.
+ *
+ * `aws_region` (char[])
+ *
+ * String: name of the AWS "region" of the host, e.g. "us-east-1".
+ *
+ * `secret_id` (char[])
+ *
+ * String: "Access ID" for the resource.
+ *
+ * `secret_key` (char[])
+ *
+ * String: "Secret Access Key" associated with the ID and resource.
+ *
+ ****************************************************************************/
+
+#define H5FD_CURR_ROS3_FAPL_T_VERSION 1
+
+#define H5FD_ROS3_MAX_REGION_LEN 32
+#define H5FD_ROS3_MAX_SECRET_ID_LEN 128
+#define H5FD_ROS3_MAX_SECRET_KEY_LEN 128
+
+typedef struct H5FD_ros3_fapl_t {
+ int32_t version;
+ hbool_t authenticate;
+ char aws_region[H5FD_ROS3_MAX_REGION_LEN + 1];
+ char secret_id[H5FD_ROS3_MAX_SECRET_ID_LEN + 1];
+ char secret_key[H5FD_ROS3_MAX_SECRET_KEY_LEN + 1];
+} H5FD_ros3_fapl_t;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+H5_DLL hid_t H5FD_ros3_init(void);
+H5_DLL herr_t H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out);
+H5_DLL herr_t H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* H5_HAVE_ROS3_VFD */
+
+#endif /* ifndef H5FDros3_H */
+
+
diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c
new file mode 100644
index 0000000..f08e9d5
--- /dev/null
+++ b/src/H5FDs3comms.c
@@ -0,0 +1,3593 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*****************************************************************************
+ * Read-Only S3 Virtual File Driver (VFD)
+ *
+ * Source for S3 Communications module
+ *
+ * ***NOT A FILE DRIVER***
+ *
+ * Provide functions and structures required for interfacing with Amazon
+ * Simple Storage Service (S3).
+ *
+ * Provide S3 object access as if it were a local file.
+ *
+ * Connect to remote host, send and receive HTTP requests and responses
+ * as part of the AWS REST API, authenticating requests as appropriate.
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-30
+ *
+ *****************************************************************************/
+
+/****************/
+/* Module Setup */
+/****************/
+
+/***********/
+/* Headers */
+/***********/
+
+#include "H5private.h" /* generic functions */
+#include "H5Eprivate.h" /* error handling */
+#include "H5MMprivate.h" /* memory management */
+#include "H5FDs3comms.h" /* S3 Communications */
+
+/****************/
+/* Local Macros */
+/****************/
+
+#ifdef H5_HAVE_ROS3_VFD
+
+/* toggle debugging (enable with 1)
+ */
+#define S3COMMS_DEBUG 0
+
+/* manipulate verbosity of CURL output
+ * operates separately from S3COMMS_DEBUG
+ *
+ * 0 -> no explicit curl output
+ * 1 -> on error, print failure info to stderr
+ * 2 -> in addition to above, print information for all performs; sets all
+ * curl handles with CURLOPT_VERBOSE
+ */
+#define S3COMMS_CURL_VERBOSITY 0
+
+/* size to allocate for "bytes=<first_byte>[-<last_byte>]" HTTP Range value
+ */
+#define S3COMMS_MAX_RANGE_STRING_SIZE 128
+
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/********************/
+/* Local Structures */
+/********************/
+
+/* struct s3r_datastruct
+ * Structure passed to curl write callback
+ * pointer to data region and record of bytes written (offset)
+ */
+struct s3r_datastruct {
+ unsigned long magic;
+ char *data;
+ size_t size;
+};
+#define S3COMMS_CALLBACK_DATASTRUCT_MAGIC 0x28c2b2ul
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+size_t curlwritecallback(char *ptr,
+ size_t size,
+ size_t nmemb,
+ void *userdata);
+
+herr_t H5FD_s3comms_s3r_getsize(s3r_t *handle);
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+/*************/
+/* Functions */
+/*************/
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: curlwritecallback()
+ *
+ * Purpose:
+ *
+ * Function called by CURL to write received data.
+ *
+ * Writes bytes to `userdata`.
+ *
+ * Internally manages number of bytes processed.
+ *
+ * Return:
+ *
+ * - Number of bytes processed.
+ * - Should equal number of bytes passed to callback.
+ * - Failure will result in curl error: CURLE_WRITE_ERROR.
+ *
+ * Programmer: Jacob Smith
+ * 2017-08-17
+ *
+ *----------------------------------------------------------------------------
+ */
+size_t
+curlwritecallback(char *ptr,
+ size_t size,
+ size_t nmemb,
+ void *userdata)
+{
+ struct s3r_datastruct *sds = (struct s3r_datastruct *)userdata;
+ size_t product = (size * nmemb);
+ size_t written = 0;
+
+ if (sds->magic != S3COMMS_CALLBACK_DATASTRUCT_MAGIC) {
+ return written;
+ }
+
+ if (size > 0) {
+ HDmemcpy(&(sds->data[sds->size]), ptr, product);
+ sds->size += product;
+ written = product;
+ }
+
+ return written;
+
+} /* end curlwritecallback() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_hrb_node_set()
+ *
+ * Purpose:
+ *
+ * Create, insert, modify, and remove elements in a field node list.
+ *
+ * `name` cannot be null; will return FAIL and list will be unaltered.
+ *
+ * Entries are accessed via the lowercase representation of their name:
+ * "Host", "host", and "hOSt" would all access the same node,
+ * but name's case is relevant in HTTP request output.
+ *
+ * List pointer `L` must always point to either of :
+ * - header node with lowest alphabetical order (by lowername)
+ * - NULL, if list is empty
+ *
+ * Types of operations:
+ *
+ * - CREATE
+ * - If `L` is NULL and `name` and `value` are not NULL,
+ * a new node is created at `L`, starting a list.
+ * - MODIFY
+ * - If a node is found with a matching lowercase name and `value`
+ * is not NULL, the existing name, value, and cat values are released
+ * and replaced with the new data.
+ * - No modifications are made to the list pointers.
+ * - REMOVE
+ * - If `value` is NULL, will attempt to remove node with matching
+ * lowercase name.
+ * - If no match found, returns FAIL and list is not modified.
+ * - When removing a node, all its resources is released.
+ * - If removing the last node in the list, list pointer is set to NULL.
+ * - INSERT
+ * - If no nodes exists with matching lowercase name and `value`
+ * is not NULL, a new node is created, inserted into list
+ * alphabetically by lowercase name.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - List was successfully modified
+ * - FAILURE: `FAIL`
+ * - Unable to perform operation
+ * - Forbidden (attempting to remove absent node, e.g.)
+ * - Internal error
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-22
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_hrb_node_set(
+ hrb_node_t **L,
+ const char *name,
+ const char *value)
+{
+ size_t i = 0;
+ char *valuecpy = NULL;
+ char *namecpy = NULL;
+ size_t namelen = 0;
+ char *lowername = NULL;
+ char *nvcat = NULL;
+ hrb_node_t *node_ptr = NULL;
+ hrb_node_t *new_node = NULL;
+ hbool_t is_looking = TRUE;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_hrb_node_set.\n");
+ HDprintf("NAME: %s\n", name);
+ HDprintf("VALUE: %s\n", value);
+ HDprintf("LIST:\n->");
+ for (node_ptr = (*L); node_ptr != NULL; node_ptr = node_ptr->next) {
+ HDfprintf(stdout, "{%s}\n->", node_ptr->cat);
+ }
+ HDprintf("(null)\n");
+ fflush(stdout);
+ node_ptr = NULL;
+#endif
+
+ if (name == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to operate on null name.\n");
+ }
+ namelen = HDstrlen(name);
+
+ /***********************
+ * PREPARE ALL STRINGS *
+ **********************/
+
+ /* copy and lowercase name
+ */
+ lowername = (char *)H5MM_malloc(sizeof(char) * (namelen + 1));
+ if (lowername == NULL) {
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
+ "cannot make space for lowercase name copy.\n");
+ }
+ for (i = 0; i < namelen; i++) {
+ lowername[i] = (char)tolower((int)name[i]);
+ }
+ lowername[namelen] = 0;
+
+ /* If value supplied, copy name, value, and concatenated "name: value".
+ * If NULL, we will be removing a node or doing nothing, so no need for
+ * copies
+ */
+ if (value != NULL) {
+ int ret = 0;
+ size_t valuelen = HDstrlen(value);
+ size_t catlen = namelen + valuelen + 2; /* +2 from ": " */
+ size_t catwrite = catlen + 3; /* 3 not 1 to quiet compiler warning */
+
+
+ namecpy = (char *)H5MM_malloc(sizeof(char) * (namelen + 1));
+ if (namecpy == NULL) {
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
+ "cannot make space for name copy.\n");
+ }
+ HDmemcpy(namecpy, name, (namelen + 1));
+
+ valuecpy = (char *)H5MM_malloc(sizeof(char) * (valuelen + 1));
+ if (valuecpy == NULL) {
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
+ "cannot make space for value copy.\n");
+ }
+ HDmemcpy(valuecpy, value, (valuelen + 1));
+
+ nvcat = (char *)H5MM_malloc(sizeof(char) * catwrite);
+ if (nvcat == NULL) {
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
+ "cannot make space for concatenated string.\n");
+ }
+ ret = HDsnprintf(nvcat, catwrite, "%s: %s", name, value);
+ if (ret < 0 || (size_t)ret > catlen) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "cannot concatenate `%s: %s", name, value);
+ }
+ HDassert( catlen == HDstrlen(nvcat) );
+
+ /* create new_node, should we need it
+ */
+ new_node = (hrb_node_t *)H5MM_malloc(sizeof(hrb_node_t));
+ if (new_node == NULL) {
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
+ "cannot make space for new set.\n");
+ }
+
+ new_node->magic = S3COMMS_HRB_NODE_MAGIC;
+ new_node->name = NULL;
+ new_node->value = NULL;
+ new_node->cat = NULL;
+ new_node->lowername = NULL;
+ new_node->next = NULL;
+ }
+
+ /***************
+ * ACT ON LIST *
+ ***************/
+
+ if (*L == NULL) {
+ if (value == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "trying to remove node from empty list");
+ }
+ else {
+#if S3COMMS_DEBUG
+HDprintf("CREATE NEW\n"); fflush(stdout);
+#endif
+ /*******************
+ * CREATE NEW LIST *
+ *******************/
+
+ new_node->cat = nvcat;
+ new_node->name = namecpy;
+ new_node->lowername = lowername;
+ new_node->value = valuecpy;
+
+ *L = new_node;
+ goto done; /* bypass further seeking */
+ }
+ }
+
+ /* sanity-check pointer passed in
+ */
+ HDassert( (*L) != NULL );
+ HDassert( (*L)->magic == S3COMMS_HRB_NODE_MAGIC );
+ node_ptr = (*L);
+
+ /* Check whether to modify/remove first node in list
+ */
+ if (strcmp(lowername, node_ptr->lowername) == 0) {
+
+ is_looking = FALSE;
+
+ if (value == NULL) {
+#if S3COMMS_DEBUG
+HDprintf("REMOVE HEAD\n"); fflush(stdout);
+#endif
+ /***************
+ * REMOVE HEAD *
+ ***************/
+
+ *L = node_ptr->next;
+
+#if S3COMMS_DEBUG
+HDprintf("FREEING CAT (node)\n"); fflush(stdout);
+#endif
+ H5MM_xfree(node_ptr->cat);
+#if S3COMMS_DEBUG
+HDprintf("FREEING LOWERNAME (node)\n"); fflush(stdout);
+#endif
+ H5MM_xfree(node_ptr->lowername);
+#if S3COMMS_DEBUG
+HDprintf("FREEING NAME (node)\n"); fflush(stdout);
+#endif
+ H5MM_xfree(node_ptr->name);
+#if S3COMMS_DEBUG
+HDprintf("FREEING VALUE (node)\n"); fflush(stdout);
+#endif
+ H5MM_xfree(node_ptr->value);
+#if S3COMMS_DEBUG
+HDprintf("MAGIC OK? %s\n",
+ (node_ptr->magic == S3COMMS_HRB_NODE_MAGIC) ? "YES" : "NO");
+fflush(stdout);
+#endif
+ HDassert( node_ptr->magic == S3COMMS_HRB_NODE_MAGIC );
+ node_ptr->magic += 1ul;
+#if S3COMMS_DEBUG
+HDprintf("FREEING POINTER\n"); fflush(stdout);
+#endif
+ H5MM_xfree(node_ptr);
+
+#if S3COMMS_DEBUG
+HDprintf("FREEING WORKING LOWERNAME\n"); fflush(stdout);
+#endif
+ H5MM_xfree(lowername); lowername = NULL;
+ }
+ else {
+#if S3COMMS_DEBUG
+HDprintf("MODIFY HEAD\n"); fflush(stdout);
+#endif
+ /***************
+ * MODIFY HEAD *
+ ***************/
+
+ H5MM_xfree(node_ptr->cat);
+ H5MM_xfree(node_ptr->name);
+ H5MM_xfree(node_ptr->value);
+
+ node_ptr->name = namecpy;
+ node_ptr->value = valuecpy;
+ node_ptr->cat = nvcat;
+
+ H5MM_xfree(lowername);
+ lowername = NULL;
+ new_node->magic += 1ul;
+ H5MM_xfree(new_node);
+ new_node = NULL;
+ }
+ }
+ else
+ if (strcmp(lowername, node_ptr->lowername) < 0) {
+
+ is_looking = FALSE;
+
+ if (value == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "trying to remove a node 'before' head");
+ }
+ else {
+#if S3COMMS_DEBUG
+HDprintf("PREPEND NEW HEAD\n"); fflush(stdout);
+#endif
+ /*******************
+ * INSERT NEW HEAD *
+ *******************/
+
+ new_node->name = namecpy;
+ new_node->value = valuecpy;
+ new_node->lowername = lowername;
+ new_node->cat = nvcat;
+ new_node->next = node_ptr;
+ *L = new_node;
+ }
+ }
+
+ /***************
+ * SEARCH LIST *
+ ***************/
+
+ while (is_looking) {
+ if (node_ptr->next == NULL) {
+
+ is_looking = FALSE;
+
+ if (value == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "trying to remove absent node");
+ }
+ else {
+#if S3COMMS_DEBUG
+HDprintf("APPEND A NODE\n"); fflush(stdout);
+#endif
+ /*******************
+ * APPEND NEW NODE *
+ *******************/
+
+ HDassert( strcmp(lowername, node_ptr->lowername) > 0 );
+ new_node->name = namecpy;
+ new_node->value = valuecpy;
+ new_node->lowername = lowername;
+ new_node->cat = nvcat;
+ node_ptr->next = new_node;
+ }
+ }
+ else
+ if (strcmp(lowername, node_ptr->next->lowername) < 0) {
+
+ is_looking = FALSE;
+
+ if (value == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "trying to remove absent node");
+ }
+ else {
+#if S3COMMS_DEBUG
+HDprintf("INSERT A NODE\n"); fflush(stdout);
+#endif
+ /*******************
+ * INSERT NEW NODE *
+ *******************/
+
+ HDassert( strcmp(lowername, node_ptr->lowername) > 0 );
+ new_node->name = namecpy;
+ new_node->value = valuecpy;
+ new_node->lowername = lowername;
+ new_node->cat = nvcat;
+ new_node->next = node_ptr->next;
+ node_ptr->next = new_node;
+ }
+ }
+ else
+ if (strcmp(lowername, node_ptr->next->lowername) == 0) {
+
+ is_looking = FALSE;
+
+ if (value == NULL) {
+ /*****************
+ * REMOVE A NODE *
+ *****************/
+
+ hrb_node_t *tmp = node_ptr->next;
+ node_ptr->next = tmp->next;
+
+#if S3COMMS_DEBUG
+HDprintf("REMOVE A NODE\n"); fflush(stdout);
+#endif
+ H5MM_xfree(tmp->cat);
+ H5MM_xfree(tmp->lowername);
+ H5MM_xfree(tmp->name);
+ H5MM_xfree(tmp->value);
+
+ HDassert( tmp->magic == S3COMMS_HRB_NODE_MAGIC );
+ tmp->magic += 1ul;
+ H5MM_xfree(tmp);
+
+ H5MM_xfree(lowername);
+ lowername = NULL;
+ }
+ else {
+#if S3COMMS_DEBUG
+HDprintf("MODIFY A NODE\n"); fflush(stdout);
+#endif
+ /*****************
+ * MODIFY A NODE *
+ *****************/
+
+ node_ptr = node_ptr->next;
+ H5MM_xfree(node_ptr->name);
+ H5MM_xfree(node_ptr->value);
+ H5MM_xfree(node_ptr->cat);
+
+ HDassert( new_node->magic == S3COMMS_HRB_NODE_MAGIC );
+ new_node->magic += 1ul;
+ H5MM_xfree(new_node);
+ H5MM_xfree(lowername);
+ new_node = NULL;
+ lowername = NULL;
+
+ node_ptr->name = namecpy;
+ node_ptr->value = valuecpy;
+ node_ptr->cat = nvcat;
+ }
+ }
+ else {
+ /****************
+ * KEEP LOOKING *
+ ****************/
+
+ node_ptr = node_ptr->next;
+ }
+ } /* end while is_looking */
+
+done:
+ if (ret_value == FAIL) {
+ /* clean up
+ */
+ if (nvcat != NULL) { H5MM_xfree(nvcat); }
+ if (namecpy != NULL) { H5MM_xfree(namecpy); }
+ if (lowername != NULL) { H5MM_xfree(lowername); }
+ if (valuecpy != NULL) { H5MM_xfree(valuecpy); }
+ if (new_node != NULL) {
+ HDassert( new_node->magic == S3COMMS_HRB_NODE_MAGIC );
+ new_node->magic += 1ul;
+ H5MM_xfree(new_node);
+ }
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5FD_s3comms_hrb_node_set() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_hrb_destroy()
+ *
+ * Purpose:
+ *
+ * Destroy and free resources _directly_ associated with an HTTP Buffer.
+ *
+ * Takes a pointer to pointer to the buffer structure.
+ * This allows for the pointer itself to be NULLed from within the call.
+ *
+ * If buffer or buffer pointer is NULL, there is no effect.
+ *
+ * Headers list at `first_header` is not touched.
+ *
+ * - Programmer should re-use or destroy `first_header` pointer
+ * (hrb_node_t *) as suits their purposes.
+ * - Recommend fetching prior to destroy()
+ * e.g., `reuse_node = hrb_to_die->first_header; destroy(hrb_to_die);`
+ * or maintaining an external reference.
+ * - Destroy node/list separately as appropriate
+ * - Failure to account for this will result in a memory leak.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - successfully released buffer resources
+ * - if `buf` is NULL or `*buf` is NULL, no effect
+ * - FAILURE: `FAIL`
+ * - `buf->magic != S3COMMS_HRB_MAGIC`
+ *
+ * Programmer: Jacob Smith
+ * 2017-07-21
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_hrb_destroy(hrb_t **_buf)
+{
+ hrb_t *buf = NULL;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_hrb_destroy.\n");
+#endif
+
+ if (_buf != NULL && *_buf != NULL) {
+ buf = *_buf;
+ if (buf->magic != S3COMMS_HRB_MAGIC) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "pointer's magic does not match.\n");
+ }
+
+ H5MM_xfree(buf->verb);
+ H5MM_xfree(buf->version);
+ H5MM_xfree(buf->resource);
+ buf->magic += 1ul;
+ H5MM_xfree(buf);
+ *_buf = NULL;
+ } /* end if `_buf` has some value */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_s3comms_hrb_destroy() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_hrb_init_request()
+ *
+ * Purpose:
+ *
+ * Create a new HTTP Request Buffer
+ *
+ * All non-null arguments should be null-terminated strings.
+ *
+ * If `verb` is NULL, defaults to "GET".
+ * If `http_version` is NULL, defaults to "HTTP/1.1".
+ *
+ * `resource` cannot be NULL; should be string beginning with slash
+ * character ('/').
+ *
+ * All strings are copied into the structure, making them safe from
+ * modification in source strings.
+ *
+ * Return:
+ *
+ * - SUCCESS: pointer to new `hrb_t`
+ * - FAILURE: `NULL`
+ *
+ * Programmer: Jacob Smith
+ * 2017-07-21
+ *
+ *----------------------------------------------------------------------------
+ */
+hrb_t *
+H5FD_s3comms_hrb_init_request(const char *_verb,
+ const char *_resource,
+ const char *_http_version)
+{
+ hrb_t *request = NULL;
+ char *res = NULL;
+ size_t reslen = 0;
+ hrb_t *ret_value = NULL;
+ char *verb = NULL;
+ size_t verblen = 0;
+ char *vrsn = NULL;
+ size_t vrsnlen = 0;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_hrb_init_request.\n");
+#endif
+
+ if (_resource == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "resource string cannot be null.\n");
+ }
+
+ /* populate valid NULLs with defaults
+ */
+ if (_verb == NULL) {
+ _verb = "GET";
+ }
+
+ if (_http_version == NULL) {
+ _http_version = "HTTP/1.1";
+ }
+
+ /* malloc space for and prepare structure
+ */
+ request = (hrb_t *)H5MM_malloc(sizeof(hrb_t));
+ if (request == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL,
+ "no space for request structure");
+ }
+ request->magic = S3COMMS_HRB_MAGIC;
+ request->body = NULL;
+ request->body_len = 0;
+ request->first_header = NULL;
+
+
+
+ /* malloc and copy strings for the structure
+ */
+ reslen = HDstrlen(_resource);
+
+ if (_resource[0] == '/') {
+ res = (char *)H5MM_malloc(sizeof(char) * (reslen+1));
+ if (res == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL,
+ "no space for resource string");
+ }
+ HDmemcpy(res, _resource, (reslen+1));
+ }
+ else {
+ res = (char *)H5MM_malloc(sizeof(char) * (reslen+2));
+ if (res == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL,
+ "no space for resource string");
+ }
+ *res = '/';
+ HDmemcpy((&res[1]), _resource, (reslen+1));
+ HDassert( (reslen+1) == HDstrlen(res) );
+ } /* end if (else resource string not starting with '/') */
+
+ verblen = HDstrlen(_verb) + 1;
+ verb = (char *)H5MM_malloc(sizeof(char) * verblen);
+ if (verb == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "no space for verb string");
+ }
+ HDstrncpy(verb, _verb, verblen);
+
+ vrsnlen = HDstrlen(_http_version) + 1;
+ vrsn = (char *)H5MM_malloc(sizeof(char) * vrsnlen);
+ if (vrsn == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "no space for http-version string");
+ }
+ HDstrncpy(vrsn, _http_version, vrsnlen);
+
+
+
+ /* place new copies into structure
+ */
+ request->resource = res;
+ request->verb = verb;
+ request->version = vrsn;
+
+ ret_value = request;
+
+done:
+ /* if there is an error, clean up after ourselves
+ */
+ if (ret_value == NULL) {
+ if (request != NULL) H5MM_xfree(request);
+ if (vrsn != NULL) H5MM_xfree(vrsn);
+ if (verb != NULL) H5MM_xfree(verb);
+ if (res != NULL) H5MM_xfree(res);
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_s3comms_hrb_init_request() */
+
+
+/****************************************************************************
+ * S3R FUNCTIONS
+ ****************************************************************************/
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_s3r_close()
+ *
+ * Purpose:
+ *
+ * Close communications through given S3 Request Handle (`s3r_t`)
+ * and clean up associated resources.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ * - fails if handle is null or has invalid magic number
+ *
+ *
+ * Programmer: Jacob Smith
+ * 2017-08-31
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_s3r_close(s3r_t *handle)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_s3r_close.\n");
+#endif
+
+ if (handle == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle cannot be null.\n");
+ }
+ if (handle->magic != S3COMMS_S3R_MAGIC) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle has invalid magic.\n");
+ }
+
+ curl_easy_cleanup(handle->curlhandle);
+
+ H5MM_xfree(handle->secret_id);
+ H5MM_xfree(handle->region);
+ H5MM_xfree(handle->signing_key);
+
+ HDassert( handle->httpverb != NULL );
+ H5MM_xfree(handle->httpverb);
+
+ if (FAIL == H5FD_s3comms_free_purl(handle->purl)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to release parsed url structure")
+ }
+
+ H5MM_xfree(handle);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD_s3comms_s3r_close */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_s3r_get_filesize()
+ *
+ * Purpose:
+ *
+ * Retrieve the filesize of an open request handle.
+ *
+ * Wrapper "getter" to hide implementation details.
+ *
+ *
+ * Return:
+ *
+ * - SUCCESS: size of file, in bytes, if handle is valid.
+ * - FAILURE: 0, if handle is NULL or undefined.
+ *
+ * Programmer: Jacob Smith 2017-01-14
+ *
+ *----------------------------------------------------------------------------
+ */
+size_t
+H5FD_s3comms_s3r_get_filesize(s3r_t *handle)
+{
+ size_t ret_value = 0;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ if (handle != NULL) {
+ ret_value = handle->filesize;
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD_s3comms_s3r_get_filesize */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_s3r_getsize()
+ *
+ * Purpose:
+ *
+ * Get the number of bytes of handle's target resource.
+ *
+ * Sets handle and curlhandle with to enact an HTTP HEAD request on file,
+ * and parses received headers to extract "Content-Length" from response
+ * headers, storing file size at `handle->filesize`.
+ *
+ * Critical step in opening (initiating) an `s3r_t` handle.
+ *
+ * Wraps `s3r_read()`.
+ * Sets curlhandle to write headers to a temporary buffer (using extant
+ * write callback) and provides no buffer for body.
+ *
+ * Upon exit, unsets HTTP HEAD settings from curl handle, returning to
+ * initial state. In event of error, curl handle state is undefined and is
+ * not to be trusted.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ *
+ * Programmer: Jacob Smith
+ * 2017-08-23
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_s3r_getsize(s3r_t *handle)
+{
+ uintmax_t content_length = 0;
+ CURL *curlh = NULL;
+ char *end = NULL;
+ char *headerresponse = NULL;
+ struct s3r_datastruct sds = {
+ S3COMMS_CALLBACK_DATASTRUCT_MAGIC,
+ NULL,
+ 0 };
+ char *start = NULL;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_s3r_getsize.\n");
+#endif
+
+ if (handle == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle cannot be null.\n");
+ }
+ if (handle->magic != S3COMMS_S3R_MAGIC) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle has invalid magic.\n");
+ }
+ if (handle->curlhandle == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle has bad (null) curlhandle.\n")
+ }
+
+ /********************
+ * PREPARE FOR HEAD *
+ ********************/
+
+ curlh = handle->curlhandle;
+
+ if ( CURLE_OK !=
+ curl_easy_setopt(curlh,
+ CURLOPT_NOBODY,
+ 1L) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "error while setting CURL option (CURLOPT_NOBODY). "
+ "(placeholder flags)");
+ }
+
+ if ( CURLE_OK !=
+ curl_easy_setopt(curlh,
+ CURLOPT_HEADERDATA,
+ &sds) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "error while setting CURL option (CURLOPT_HEADERDATA). "
+ "(placeholder flags)");
+ }
+
+ HDassert( handle->httpverb == NULL );
+ handle->httpverb = (char *)H5MM_malloc(sizeof(char) * 16);
+ if (handle->httpverb == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
+ "unable to allocate space for S3 request HTTP verb");
+ }
+ HDmemcpy(handle->httpverb, "HEAD", 5);
+
+ headerresponse = (char *)H5MM_malloc(sizeof(char) * CURL_MAX_HTTP_HEADER);
+ if (headerresponse == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
+ "unable to allocate space for curl header response");
+ }
+ sds.data = headerresponse;
+
+ /*******************
+ * PERFORM REQUEST *
+ *******************/
+
+ /* these parameters fetch the entire file,
+ * but, with a NULL destination and NOBODY and HEADERDATA supplied above,
+ * only http metadata will be sent by server and recorded by s3comms
+ */
+ if (FAIL ==
+ H5FD_s3comms_s3r_read(handle, 0, 0, NULL) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem in reading during getsize.\n");
+ }
+
+ if (sds.size > CURL_MAX_HTTP_HEADER) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "HTTP metadata buffer overrun\n");
+ } else if (sds.size == 0) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "No HTTP metadata\n");
+#if S3COMMS_DEBUG
+ } else {
+ HDfprintf(stderr, "GETSIZE: OK\n");
+#endif
+ }
+
+
+ /******************
+ * PARSE RESPONSE *
+ ******************/
+
+ start = strstr(headerresponse,
+ "\r\nContent-Length: ");
+ if (start == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "could not find \"Content-Length\" in response.\n");
+ }
+
+ /* move "start" to beginning of value in line; find end of line
+ */
+ start = start + HDstrlen("\r\nContent-Length: ");
+ end = strstr(start, "\r\n");
+ if (end == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "could not find end of content length line");
+ }
+
+ /* place null terminator at end of numbers
+ */
+ *end = '\0';
+
+ content_length = strtoumax((const char *)start,
+ NULL,
+ 0);
+
+ if (UINTMAX_MAX > SIZE_MAX && content_length > SIZE_MAX) {
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "content_length overflows size_t\n");
+ }
+
+ if (content_length == 0 ||
+ errno == ERANGE) /* errno set by strtoumax*/
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "could not convert found \"Content-Length\" response (\"%s\")",
+ start); /* range is null-terminated, remember */
+ }
+
+ handle->filesize = (size_t)content_length;
+
+ /**********************
+ * UNDO HEAD SETTINGS *
+ **********************/
+
+ if ( CURLE_OK !=
+ curl_easy_setopt(curlh,
+ CURLOPT_NOBODY,
+ NULL) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "error while setting CURL option (CURLOPT_NOBODY). "
+ "(placeholder flags)");
+ }
+
+ if ( CURLE_OK !=
+ curl_easy_setopt(curlh,
+ CURLOPT_HEADERDATA,
+ NULL) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "error while setting CURL option (CURLOPT_HEADERDATA). "
+ "(placeholder flags)");
+ }
+
+done:
+ H5MM_xfree(headerresponse);
+ sds.magic += 1; /* set to bad magic */
+
+ FUNC_LEAVE_NOAPI(ret_value);
+
+} /* H5FD_s3comms_s3r_getsize */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_s3r_open()
+ *
+ * Purpose:
+ *
+ * Logically 'open' a file hosted on S3.
+ *
+ * - create new Request Handle
+ * - copy supplied url
+ * - copy authentication info if supplied
+ * - create CURL handle
+ * - fetch size of file
+ * - connect with server and execute HEAD request
+ * - return request handle ready for reads
+ *
+ * To use 'default' port to connect, `port` should be 0.
+ *
+ * To prevent AWS4 authentication, pass null pointer to `region`, `id`,
+ * and `signing_key`.
+ *
+ * Uses `H5FD_s3comms_parse_url()` to validate and parse url input.
+ *
+ * Return:
+ *
+ * - SUCCESS: Pointer to new request handle.
+ * - FAILURE: NULL
+ * - occurs if:
+ * - authentication strings are inconsistent
+ * - must _all_ be null, or have at least `region` and `id`
+ * - url is NULL (no filename)
+ * - unable to parse url (malformed?)
+ * - error while performing `getsize()`
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-01
+ *
+ *----------------------------------------------------------------------------
+ */
+s3r_t *
+H5FD_s3comms_s3r_open(const char *url,
+ const char *region,
+ const char *id,
+ const unsigned char *signing_key)
+{
+ size_t tmplen = 0;
+ CURL *curlh = NULL;
+ s3r_t *handle = NULL;
+ parsed_url_t *purl = NULL;
+ s3r_t *ret_value = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_s3r_open.\n");
+#endif
+
+
+
+ if (url == NULL || url[0] == '\0') {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "url cannot be null.\n");
+ }
+
+ if (FAIL == H5FD_s3comms_parse_url(url, &purl)) {
+ /* probably a malformed url, but could be internal error */
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCREATE, NULL,
+ "unable to create parsed url structure");
+ }
+ HDassert( purl != NULL ); /* if above passes, this must be true */
+ HDassert( purl->magic == S3COMMS_PARSED_URL_MAGIC );
+
+ handle = (s3r_t *)H5MM_malloc(sizeof(s3r_t));
+ if (handle == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL,
+ "could not malloc space for handle.\n");
+ }
+
+ handle->magic = S3COMMS_S3R_MAGIC;
+ handle->purl = purl;
+ handle->filesize = 0;
+ handle->region = NULL;
+ handle->secret_id = NULL;
+ handle->signing_key = NULL;
+ handle->httpverb = NULL;
+
+ /*************************************
+ * RECORD AUTHENTICATION INFORMATION *
+ *************************************/
+
+ if ((region != NULL && *region != '\0') ||
+ (id != NULL && *id != '\0') ||
+ (signing_key != NULL && *signing_key != '\0'))
+ {
+ /* if one exists, all three must exist
+ */
+ if (region == NULL || region[0] == '\0') {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "region cannot be null.\n");
+ }
+ if (id == NULL || id[0] == '\0') {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "secret id cannot be null.\n");
+ }
+ if (signing_key == NULL || signing_key[0] == '\0') {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "signing key cannot be null.\n");
+ }
+
+ /* copy strings
+ */
+ tmplen = HDstrlen(region) + 1;
+ handle->region = (char *)H5MM_malloc(sizeof(char) * tmplen);
+ if (handle->region == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "could not malloc space for handle region copy.\n");
+ }
+ HDmemcpy(handle->region, region, tmplen);
+
+ tmplen = HDstrlen(id) + 1;
+ handle->secret_id = (char *)H5MM_malloc(sizeof(char) * tmplen);
+ if (handle->secret_id == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "could not malloc space for handle ID copy.\n");
+ }
+ HDmemcpy(handle->secret_id, id, tmplen);
+
+ tmplen = SHA256_DIGEST_LENGTH;
+ handle->signing_key =
+ (unsigned char *)H5MM_malloc(sizeof(unsigned char) * tmplen);
+ if (handle->signing_key == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "could not malloc space for handle key copy.\n");
+ }
+ HDmemcpy(handle->signing_key, signing_key, tmplen);
+ } /* if authentication information provided */
+
+ /************************
+ * INITIATE CURL HANDLE *
+ ************************/
+
+ curlh = curl_easy_init();
+
+ if (curlh == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "problem creating curl easy handle!\n");
+ }
+
+ if ( CURLE_OK !=
+ curl_easy_setopt(curlh,
+ CURLOPT_HTTPGET,
+ 1L) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "error while setting CURL option (CURLOPT_HTTPGET). "
+ "(placeholder flags)");
+ }
+
+ if ( CURLE_OK !=
+ curl_easy_setopt(curlh,
+ CURLOPT_HTTP_VERSION,
+ CURL_HTTP_VERSION_1_1) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "error while setting CURL option (CURLOPT_HTTP_VERSION). "
+ "(placeholder flags)");
+ }
+
+ if ( CURLE_OK !=
+ curl_easy_setopt(curlh,
+ CURLOPT_FAILONERROR,
+ 1L) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "error while setting CURL option (CURLOPT_FAILONERROR). "
+ "(placeholder flags)");
+ }
+
+ if ( CURLE_OK !=
+ curl_easy_setopt(curlh,
+ CURLOPT_WRITEFUNCTION,
+ curlwritecallback) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "error while setting CURL option (CURLOPT_WRITEFUNCTION). "
+ "(placeholder flags)");
+ }
+
+ if ( CURLE_OK !=
+ curl_easy_setopt(curlh,
+ CURLOPT_URL,
+ url) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "error while setting CURL option (CURLOPT_URL). "
+ "(placeholder flags)");
+ }
+
+#if S3COMMS_CURL_VERBOSITY > 1
+ /* CURL will print (to stdout) information for each operation
+ */
+ curl_easy_setopt(curlh, CURLOPT_VERBOSE, 1L);
+#endif
+
+ handle->curlhandle = curlh;
+
+ /*******************
+ * OPEN CONNECTION *
+ * * * * * * * * * *
+ * GET FILE SIZE *
+ *******************/
+
+ if (FAIL ==
+ H5FD_s3comms_s3r_getsize(handle) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "problem in H5FD_s3comms_s3r_getsize.\n");
+ }
+
+ /*********************
+ * FINAL PREPARATION *
+ *********************/
+
+ HDassert( handle->httpverb != NULL );
+ HDmemcpy(handle->httpverb, "GET", 4);
+
+ ret_value = handle;
+
+done:
+ if (ret_value == NULL) {
+ if (curlh != NULL) {
+ curl_easy_cleanup(curlh);
+ }
+ if (FAIL == H5FD_s3comms_free_purl(purl)) {
+ HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
+ "unable to free parsed url structure")
+ }
+ if (handle != NULL) {
+ H5MM_xfree(handle->region);
+ H5MM_xfree(handle->secret_id);
+ H5MM_xfree(handle->signing_key);
+ if (handle->httpverb != NULL) {
+ H5MM_xfree(handle->httpverb);
+ }
+ H5MM_xfree(handle);
+ }
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5FD_s3comms_s3r_open */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_s3r_read()
+ *
+ * Purpose:
+ *
+ * Read file pointed to by request handle, writing specified
+ * `offset` .. `offset + len` bytes to buffer `dest`.
+ *
+ * If `len` is 0, reads entirety of file starting at `offset`.
+ * If `offset` and `len` are both 0, reads entire file.
+ *
+ * If `offset` or `offset+len` is greater than the file size, read is
+ * aborted and returns `FAIL`.
+ *
+ * Uses configured "curl easy handle" to perform request.
+ *
+ * In event of error, buffer should remain unaltered.
+ *
+ * If handle is set to authorize a request, creates a new (temporary)
+ * HTTP Request object (hrb_t) for generating requisite headers,
+ * which is then translated to a `curl slist` and set in the curl handle
+ * for the request.
+ *
+ * `dest` _may_ be NULL, but no body data will be recorded.
+ *
+ * - In general practice, NULL should never be passed in as `dest`.
+ * - NULL `dest` passed in by internal function `s3r_getsize()`, in
+ * conjunction with CURLOPT_NOBODY to preempt transmission of file data
+ * from server.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ *
+ * Programmer: Jacob Smith
+ * 2017-08-22
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_s3r_read(s3r_t *handle,
+ haddr_t offset,
+ size_t len,
+ void *dest)
+{
+ CURL *curlh = NULL;
+ CURLcode p_status = CURLE_OK;
+ struct curl_slist *curlheaders = NULL;
+ hrb_node_t *headers = NULL;
+ hrb_node_t *node = NULL;
+ struct tm *now = NULL;
+ char *rangebytesstr = NULL;
+ hrb_t *request = NULL;
+ int ret = 0; /* working variable to check */
+ /* return value of HDsnprintf */
+ struct s3r_datastruct *sds = NULL;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_s3r_read.\n");
+#endif
+
+ /**************************************
+ * ABSOLUTELY NECESSARY SANITY-CHECKS *
+ **************************************/
+
+ if (handle == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle cannot be null.\n");
+ }
+ if (handle->magic != S3COMMS_S3R_MAGIC) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle has invalid magic.\n");
+ }
+ if (handle->curlhandle == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle has bad (null) curlhandle.\n")
+ }
+ if (handle->purl == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle has bad (null) url.\n")
+ }
+ HDassert( handle->purl->magic == S3COMMS_PARSED_URL_MAGIC );
+ if (offset > handle->filesize || (len + offset) > handle->filesize) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to read past EoF")
+ }
+
+ curlh = handle->curlhandle;
+
+ /*********************
+ * PREPARE WRITEDATA *
+ *********************/
+
+ if (dest != NULL) {
+ sds = (struct s3r_datastruct *)H5MM_malloc(
+ sizeof(struct s3r_datastruct));
+ if (sds == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
+ "could not malloc destination datastructure.\n");
+ }
+
+ sds->magic = S3COMMS_CALLBACK_DATASTRUCT_MAGIC;
+ sds->data = (char *)dest;
+ sds->size = 0;
+ if (CURLE_OK !=
+ curl_easy_setopt(curlh,
+ CURLOPT_WRITEDATA,
+ sds) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL,
+ "error while setting CURL option (CURLOPT_WRITEDATA). "
+ "(placeholder flags)");
+ }
+ }
+
+ /*********************
+ * FORMAT HTTP RANGE *
+ *********************/
+
+ if (len > 0) {
+ rangebytesstr = (char *)H5MM_malloc(sizeof(char) * \
+ (S3COMMS_MAX_RANGE_STRING_SIZE+1) );
+ if (rangebytesstr == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
+ "could not malloc range format string.\n");
+ }
+ ret = HDsnprintf(rangebytesstr,
+ (S3COMMS_MAX_RANGE_STRING_SIZE),
+ "bytes="H5_PRINTF_HADDR_FMT"-"H5_PRINTF_HADDR_FMT,
+ offset,
+ offset + len - 1);
+ if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to format HTTP Range value");
+ } else if (offset > 0) {
+ rangebytesstr = (char *)H5MM_malloc(sizeof(char) * \
+ (S3COMMS_MAX_RANGE_STRING_SIZE+1));
+ if (rangebytesstr == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
+ "could not malloc range format string.\n");
+ }
+ ret = HDsnprintf(rangebytesstr,
+ (S3COMMS_MAX_RANGE_STRING_SIZE),
+ "bytes="H5_PRINTF_HADDR_FMT"-",
+ offset);
+ if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to format HTTP Range value");
+ }
+
+ /*******************
+ * COMPILE REQUEST *
+ *******************/
+
+ if (handle->signing_key == NULL) {
+ /* Do not authenticate.
+ */
+ if (rangebytesstr != NULL) {
+ /* Pass in range directly
+ */
+ char *bytesrange_ptr = NULL; /* pointer past "bytes=" portion */
+
+ bytesrange_ptr = strchr(rangebytesstr, '=');
+ HDassert( bytesrange_ptr != NULL );
+ bytesrange_ptr++; /* move to first char past '=' */
+ HDassert( *bytesrange_ptr != '\0' );
+
+ if (CURLE_OK !=
+ curl_easy_setopt(curlh,
+ CURLOPT_RANGE,
+ bytesrange_ptr) )
+ {
+ HGOTO_ERROR(H5E_VFL, H5E_UNINITIALIZED, FAIL,
+ "error while setting CURL option (CURLOPT_RANGE). ");
+ }
+ }
+ } else {
+ /* authenticate request
+ */
+ char authorization[512+1];
+ /* 512 := approximate max length...
+ * 67 <len("AWS4-HMAC-SHA256 Credential=///s3/aws4_request,"
+ * "SignedHeaders=,Signature=")>
+ * + 8 <yyyyMMDD>
+ * + 64 <hex(sha256())>
+ * + 128 <max? len(secret_id)>
+ * + 20 <max? len(region)>
+ * + 128 <max? len(signed_headers)>
+ */
+ char buffer1[512+1]; /* -> Canonical Request -> Signature */
+ char buffer2[256+1]; /* -> String To Sign -> Credential */
+ char iso8601now[ISO8601_SIZE];
+ char signed_headers[48+1];
+ /* should be large enough for nominal listing:
+ * "host;range;x-amz-content-sha256;x-amz-date"
+ * + '\0', with "range;" possibly absent
+ */
+
+ /* zero start of strings */
+ authorization[0] = 0;
+ buffer1[0] = 0;
+ buffer2[0] = 0;
+ iso8601now[0] = 0;
+ signed_headers[0] = 0;
+
+ /**** VERIFY INFORMATION EXISTS ****/
+
+ if (handle->region == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle must have non-null region.\n");
+ }
+ if (handle->secret_id == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle must have non-null secret_id.\n");
+ }
+ if (handle->signing_key == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle must have non-null signing_key.\n");
+ }
+ if (handle->httpverb == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle must have non-null httpverb.\n");
+ }
+ if (handle->purl->host == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle must have non-null host.\n");
+ }
+ if (handle->purl->path == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "handle must have non-null resource.\n");
+ }
+
+ /**** CREATE HTTP REQUEST STRUCTURE (hrb_t) ****/
+
+ request = H5FD_s3comms_hrb_init_request(
+ (const char *)handle->httpverb,
+ (const char *)handle->purl->path,
+ "HTTP/1.1");
+ if (request == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "could not allocate hrb_t request.\n");
+ }
+ HDassert( request->magic == S3COMMS_HRB_MAGIC );
+
+ now = gmnow();
+ if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "could not format ISO8601 time.\n");
+ }
+
+ if (FAIL ==
+ H5FD_s3comms_hrb_node_set(
+ &headers,
+ "x-amz-date",
+ (const char *)iso8601now) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to set x-amz-date header")
+ }
+ if (headers == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem building headers list. "
+ "(placeholder flags)\n");
+ }
+ HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC );
+
+ if (FAIL ==
+ H5FD_s3comms_hrb_node_set(
+ &headers,
+ "x-amz-content-sha256",
+ (const char *)EMPTY_SHA256) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to set x-amz-content-sha256 header")
+ }
+ if (headers == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem building headers list. "
+ "(placeholder flags)\n");
+ }
+ HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC );
+
+ if (rangebytesstr != NULL) {
+ if (FAIL ==
+ H5FD_s3comms_hrb_node_set(
+ &headers,
+ "Range",
+ (const char *)rangebytesstr) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to set range header")
+ }
+ if (headers == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem building headers list. "
+ "(placeholder flags)\n");
+ }
+ HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC );
+ }
+
+ if (FAIL ==
+ H5FD_s3comms_hrb_node_set(
+ &headers,
+ "Host",
+ (const char *)handle->purl->host) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to set host header")
+ }
+ if (headers == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem building headers list. "
+ "(placeholder flags)\n");
+ }
+ HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC );
+
+ request->first_header = headers;
+
+ /**** COMPUTE AUTHORIZATION ****/
+
+ if (FAIL == /* buffer1 -> canonical request */
+ H5FD_s3comms_aws_canonical_request(
+ buffer1,
+ 512,
+ signed_headers,
+ 48,
+ request) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "(placeholder flags)\n");
+ }
+ if ( FAIL == /* buffer2->string-to-sign */
+ H5FD_s3comms_tostringtosign(buffer2,
+ buffer1,
+ iso8601now,
+ handle->region) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "(placeholder flags)\n");
+ }
+ if (FAIL == /* buffer1 -> signature */
+ H5FD_s3comms_HMAC_SHA256(handle->signing_key,
+ SHA256_DIGEST_LENGTH,
+ buffer2,
+ HDstrlen(buffer2),
+ buffer1) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "(placeholder flags)\n");
+ }
+
+ iso8601now[8] = 0; /* trim to yyyyMMDD */
+ ret = S3COMMS_FORMAT_CREDENTIAL(buffer2,
+ handle->secret_id,
+ iso8601now,
+ handle->region,
+ "s3");
+ if (ret == 0 || ret >= S3COMMS_MAX_CREDENTIAL_SIZE)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to format aws4 credential string");
+
+ ret = HDsnprintf(
+ authorization,
+ 512,
+ "AWS4-HMAC-SHA256 Credential=%s,SignedHeaders=%s,Signature=%s",
+ buffer2,
+ signed_headers,
+ buffer1);
+ if (ret <= 0 || ret >= 512) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to format aws4 authorization string");
+ }
+
+ /* append authorization header to http request buffer
+ */
+ if (H5FD_s3comms_hrb_node_set(
+ &headers,
+ "Authorization",
+ (const char *)authorization)
+ == FAIL)
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to set Authorization header")
+ }
+ if (headers == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem building headers list. "
+ "(placeholder flags)\n");
+ }
+
+ /* update hrb's "first header" pointer
+ */
+ request->first_header = headers;
+
+ /**** SET CURLHANDLE HTTP HEADERS FROM GENERATED DATA ****/
+
+ node = request->first_header;
+ while (node != NULL) {
+ HDassert( node->magic == S3COMMS_HRB_NODE_MAGIC );
+ curlheaders = curl_slist_append(curlheaders,
+ (const char *)node->cat);
+ if (curlheaders == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "could not append header to curl slist. "
+ "(placeholder flags)\n");
+ }
+ node = node->next;
+ }
+
+ /* sanity-check
+ */
+ if (curlheaders == NULL) {
+ /* above loop was probably never run */
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "curlheaders was never populated.\n");
+ }
+
+ /* finally, set http headers in curl handle
+ */
+ if (curl_easy_setopt(
+ curlh,
+ CURLOPT_HTTPHEADER,
+ curlheaders)
+ != CURLE_OK)
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "error while setting CURL option "
+ "(CURLOPT_HTTPHEADER). (placeholder flags)");
+ }
+
+ } /* end if should authenticate (info provided) */
+
+ /*******************
+ * PERFORM REQUEST *
+ *******************/
+
+#if S3COMMS_CURL_VERBOSITY > 0
+ /* In event of error, print detailed information to stderr
+ * This is not the default behavior.
+ */
+ {
+ long int httpcode = 0;
+ char curlerrbuf[CURL_ERROR_SIZE];
+ curlerrbuf[0] = '\0';
+
+ if (CURLE_OK !=
+ curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, curlerrbuf) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem setting error buffer")
+ }
+
+ p_status = curl_easy_perform(curlh);
+
+ if (p_status != CURLE_OK) {
+ if (CURLE_OK !=
+ curl_easy_getinfo(curlh, CURLINFO_RESPONSE_CODE, &httpcode) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem getting response code")
+ }
+ HDfprintf(stderr, "CURL ERROR CODE: %d\nHTTP CODE: %d\n",
+ p_status, httpcode);
+ HDfprintf(stderr, "%s\n", curl_easy_strerror(p_status));
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL,
+ "problem while performing request.\n");
+ }
+ if (CURLE_OK !=
+ curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, NULL) )
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem unsetting error buffer")
+ }
+ } /* verbose error reporting */
+#else
+ p_status = curl_easy_perform(curlh);
+
+ if (p_status != CURLE_OK) {
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL,
+ "curl cannot perform request\n")
+ }
+#endif
+
+#if S3COMMS_DEBUG
+ if (dest != NULL) {
+ HDfprintf(stderr, "len: %d\n", (int)len);
+ HDfprintf(stderr, "CHECKING FOR BUFFER OVERFLOW\n");
+ if (sds == NULL) {
+ HDfprintf(stderr, "sds is NULL!\n");
+ }
+ else {
+ HDfprintf(stderr, "sds: 0x%lx\n", (long long)sds);
+ HDfprintf(stderr, "sds->size: %d\n", (int)sds->size);
+ if (len > sds->size) {
+ HDfprintf(stderr, "buffer overwrite\n");
+ }
+ }
+ }
+ else {
+ HDfprintf(stderr, "performed on entire file\n");
+ }
+#endif
+
+done:
+ /* clean any malloc'd resources
+ */
+ if (curlheaders != NULL) {
+ curl_slist_free_all(curlheaders);
+ curlheaders = NULL;
+ }
+ if (rangebytesstr != NULL) {
+ H5MM_xfree(rangebytesstr);
+ rangebytesstr = NULL;
+ }
+ if (sds != NULL) {
+ H5MM_xfree(sds);
+ sds = NULL;
+ }
+ if (request != NULL) {
+ while (headers != NULL)
+ if (FAIL ==
+ H5FD_s3comms_hrb_node_set(&headers, headers->name, NULL))
+ {
+ HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "cannot release header node")
+ }
+ HDassert( NULL == headers );
+ if (FAIL == H5FD_s3comms_hrb_destroy(&request)) {
+ HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "cannot release header request structure")
+ }
+ HDassert( NULL == request );
+ }
+
+ if (curlh != NULL) {
+ /* clear any Range */
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, NULL) ) {
+ HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "cannot unset CURLOPT_RANGE")
+ }
+
+ /* clear headers */
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, NULL) ) {
+ HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "cannot unset CURLOPT_HTTPHEADER")
+ }
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* H5FD_s3comms_s3r_read */
+
+
+/****************************************************************************
+ * MISCELLANEOUS FUNCTIONS
+ ****************************************************************************/
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: gmnow()
+ *
+ * Purpose:
+ *
+ * Get the output of `time.h`'s `gmtime()` call while minimizing setup
+ * clutter where important.
+ *
+ * Return:
+ *
+ * Pointer to resulting `struct tm`,as created by gmtime(time_t * T).
+ *
+ * Programmer: Jacob Smith
+ * 2017-07-12
+ *
+ *----------------------------------------------------------------------------
+ */
+struct tm *
+gmnow(void)
+{
+ time_t now;
+ time_t *now_ptr = &now;
+ struct tm *ret_value = NULL;
+
+ /* Doctor assert, checks against error in time() */
+ if ( (time_t)(-1) != time(now_ptr) ) {
+ ret_value = gmtime(now_ptr);
+ }
+
+ HDassert( ret_value != NULL );
+
+ return ret_value;
+} /* end gmnow() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_aws_canonical_request()
+ *
+ * Purpose:
+ *
+ * Compose AWS "Canonical Request" (and signed headers string)
+ * as defined in the REST API documentation.
+ *
+ * Both destination strings are null-terminated.
+ *
+ * Destination string arguments must be provided with adequate space.
+ *
+ * Canonical Request format:
+ *
+ * <HTTP VERB>"\n"
+ * <resource path>"\n"
+ * <query string>"\n"
+ * <header1>"\n" (`lowercase(name)`":"`trim(value)`)
+ * <header2>"\n"
+ * ... (headers sorted by name)
+ * <header_n>"\n"
+ * "\n"
+ * <signed headers>"\n" (`lowercase(header 1 name)`";"`header 2 name`;...)
+ * <hex-string of sha256sum of body> ("e3b0c4429...", e.g.)
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - writes canonical request to respective `...dest` strings
+ * - FAILURE: `FAIL`
+ * - one or more input argument was NULL
+ * - internal error
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-04
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_aws_canonical_request(
+ char *canonical_request_dest,
+ int _cr_size,
+ char *signed_headers_dest,
+ int _sh_size,
+ hrb_t *http_request)
+{
+ hrb_node_t *node = NULL;
+ const char *query_params = ""; /* unused at present */
+ herr_t ret_value = SUCCEED;
+ int ret = 0;
+ size_t cr_size = (size_t)_cr_size;
+ size_t sh_size = (size_t)_sh_size;
+ size_t cr_len = 0; /* working length of canonical request str */
+ size_t sh_len = 0; /* working length of signed headers str */
+ char tmpstr[256+1];
+ tmpstr[256] = 0; /* terminating NULL */
+
+ /* "query params" refers to the optional element in the URL, e.g.
+ * http://bucket.aws.com/myfile.txt?max-keys=2&prefix=J
+ * ^-----------------^
+ *
+ * Not handled/implemented as of 2017-10-xx.
+ * Element introduced as empty placeholder and reminder.
+ * Further research to be done if this is ever relevant for the
+ * VFD use-cases.
+ */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_aws_canonical_request.\n");
+#endif
+
+ if (http_request == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "hrb object cannot be null.\n");
+ }
+ HDassert( http_request->magic == S3COMMS_HRB_MAGIC );
+
+ if (canonical_request_dest == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "canonical request destination cannot be null.\n");
+ }
+
+ if (signed_headers_dest == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "signed headers destination cannot be null.\n");
+ }
+
+ /* HTTP verb, resource path, and query string lines
+ */
+ cr_len = (HDstrlen(http_request->verb) +
+ HDstrlen(http_request->resource) +
+ HDstrlen(query_params) +
+ (size_t)3); /* three newline chars */
+ if (cr_len >= cr_size) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "not enough space in canonical request");
+ }
+ ret = HDsnprintf( /* TODO: compiler warning */
+ canonical_request_dest,
+ (cr_size-1),
+ "%s\n%s\n%s\n",
+ http_request->verb,
+ http_request->resource,
+ query_params);
+ if (ret < 0 || (size_t)ret >= cr_size) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to compose canonical request first line");
+ }
+
+ /* write in canonical headers, building signed headers concurrently
+ */
+ node = http_request->first_header; /* assumed sorted */
+ while (node != NULL) {
+
+ HDassert(node->magic == S3COMMS_HRB_NODE_MAGIC);
+
+ ret = HDsnprintf(
+ tmpstr,
+ 256,
+ "%s:%s\n",
+ node->lowername,
+ node->value);
+ if (ret < 0 || ret >= 256) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to concatenate HTTP header %s:%s",
+ node->lowername,
+ node->value);
+ }
+ cr_len += HDstrlen(tmpstr);
+ if (cr_len + 1 > cr_size) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "not enough space in canonical request");
+ }
+ strcat(canonical_request_dest, tmpstr);
+
+ ret = HDsnprintf(
+ tmpstr,
+ 256,
+ "%s;",
+ node->lowername);
+ if (ret < 0 || ret >= 256) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to append semicolon to lowername %s",
+ node->lowername);
+ }
+ sh_len += HDstrlen(tmpstr);
+ if (sh_len + 1 > sh_size) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "not enough space in signed headers");
+ }
+ strcat(signed_headers_dest, tmpstr);
+
+ node = node->next;
+ } /* end while node is not NULL */
+
+ /* remove tailing ';' from signed headers sequence
+ */
+ signed_headers_dest[HDstrlen(signed_headers_dest) - 1] = '\0';
+
+ /* append signed headers and payload hash
+ * NOTE: at present, no HTTP body is handled, per the nature of
+ * requests/range-gets
+ */
+ strcat(canonical_request_dest, "\n");
+ strcat(canonical_request_dest, signed_headers_dest);
+ strcat(canonical_request_dest, "\n");
+ strcat(canonical_request_dest, EMPTY_SHA256);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5FD_s3comms_aws_canonical_request() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_bytes_to_hex()
+ *
+ * Purpose:
+ *
+ * Produce human-readable hex string [0-9A-F] from sequence of bytes.
+ *
+ * For each byte (char), writes two-character hexadecimal representation.
+ *
+ * No null-terminator appended.
+ *
+ * Assumes `dest` is allocated to enough size (msg_len * 2).
+ *
+ * Fails if either `dest` or `msg` are null.
+ *
+ * `msg_len` message length of 0 has no effect.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - hex string written to `dest` (not null-terminated)
+ * - FAILURE: `FAIL`
+ * - `dest == NULL`
+ * - `msg == NULL`
+ *
+ * Programmer: Jacob Smith
+ * 2017-07-12
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_bytes_to_hex(
+ char *dest,
+ const unsigned char *msg,
+ size_t msg_len,
+ hbool_t lowercase)
+{
+ size_t i = 0;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_bytes_to_hex.\n");
+#endif
+
+ if (dest == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "hex destination cannot be null.\n")
+ }
+ if (msg == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "bytes sequence cannot be null.\n")
+ }
+
+ for (i = 0; i < msg_len; i++) {
+ int chars_written = HDsnprintf(&(dest[i * 2]),
+ 3, /* 'X', 'X', '\n' */
+ (lowercase == TRUE) ? "%02x" : "%02X",
+ msg[i]);
+ if (chars_written != 2) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem while writing hex chars for %c",
+ msg[i]);
+ }
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+
+} /* end H5FD_s3comms_bytes_to_hex() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_free_purl()
+ *
+ * Purpose:
+ *
+ * Release resources from a parsed_url_t pointer.
+ *
+ * If pointer is null, nothing happens.
+ *
+ * Return:
+ *
+ * `SUCCEED` (never fails)
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-01
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_free_purl(parsed_url_t *purl)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+#if S3COMMS_DEBUG
+ HDprintf("called H5FD_s3comms_free_purl.\n");
+#endif
+
+ if (purl != NULL) {
+ HDassert( purl->magic == S3COMMS_PARSED_URL_MAGIC );
+ if (purl->scheme != NULL) { H5MM_xfree(purl->scheme); }
+ if (purl->host != NULL) { H5MM_xfree(purl->host); }
+ if (purl->port != NULL) { H5MM_xfree(purl->port); }
+ if (purl->path != NULL) { H5MM_xfree(purl->path); }
+ if (purl->query != NULL) { H5MM_xfree(purl->query); }
+ purl->magic += 1ul;
+ H5MM_xfree(purl);
+ }
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FD_s3comms_free_purl() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_HMAC_SHA256()
+ *
+ * Purpose:
+ *
+ * Generate Hash-based Message Authentication Checksum using the SHA-256
+ * hashing algorithm.
+ *
+ * Given a key, message, and respective lengths (to accommodate null
+ * characters in either), generate _hex string_ of authentication checksum
+ * and write to `dest`.
+ *
+ * `dest` must be at least `SHA256_DIGEST_LENGTH * 2` characters in size.
+ * Not enforceable by this function.
+ * `dest` will _not_ be null-terminated by this function.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - hex string written to `dest` (not null-terminated)
+ * - FAILURE: `FAIL`
+ * - `dest == NULL`
+ * - error while generating hex string output
+ *
+ * Programmer: Jacob Smith
+ * 2017-07-??
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_HMAC_SHA256(
+ const unsigned char *key,
+ size_t key_len,
+ const char *msg,
+ size_t msg_len,
+ char *dest)
+{
+ unsigned char md[SHA256_DIGEST_LENGTH];
+ unsigned int md_len = SHA256_DIGEST_LENGTH;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_HMAC_SHA256.\n");
+#endif
+
+ if (dest == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "destination cannot be null.");
+ }
+
+ HMAC(EVP_sha256(),
+ key,
+ (int)key_len,
+ (const unsigned char *)msg,
+ msg_len,
+ md,
+ &md_len);
+
+ if (H5FD_s3comms_bytes_to_hex(
+ dest,
+ (const unsigned char *)md,
+ (size_t)md_len,
+ true)
+ == FAIL)
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "could not convert to hex string.");
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* H5FD_s3comms_HMAC_SHA256 */
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * Function: H5FD__s3comms_load_aws_creds_from_file()
+ *
+ * Purpose:
+ *
+ * Extract AWS configuration information from a target file.
+ *
+ * Given a file and a profile name, e.g. "ros3_vfd_test", attempt to locate
+ * that region in the file. If not found, returns in error and output
+ * pointers are not modified.
+ *
+ * If the profile label is found, attempts to locate and parse configuration
+ * data, stopping at the first line where:
+ * + reached end of file
+ * + line does not start with a recognized setting name
+ *
+ * Following AWS documentation, looks for any of:
+ * + aws_access_key_id
+ * + aws_secret_access_key
+ * + region
+ *
+ * To be valid, the setting must begin the line with one of the keywords,
+ * followed immediately by an equals sign '=', and have some data before
+ * newline at end of line.
+ * + `spam=eggs` would be INVALID because name is unrecognized
+ * + `region = us-east-2` would be INVALID because of spaces
+ * + `region=` would be INVALID because no data.
+ *
+ * Upon successful parsing of a setting line, will store the result in the
+ * corresponding output pointer. If the output pointer is NULL, will skip
+ * any matching setting line while parsing -- useful to prevent overwrite
+ * when reading from multiple files.
+ *
+ * Return:
+ *
+ * + SUCCESS: `SUCCEED`
+ * + no error. settings may or may not have been loaded.
+ * + FAILURE: `FAIL`
+ * + internal error occurred.
+ * + -1 :: unable to format profile label
+ * + -2 :: profile name/label not found in file
+ * + -3 :: some other error
+ *
+ * Programmer: Jacob Smith
+ * 2018-02-27
+ *
+ *-----------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__s3comms_load_aws_creds_from_file(
+ FILE *file,
+ const char *profile_name,
+ char *key_id,
+ char *access_key,
+ char *aws_region)
+{
+ char profile_line[32];
+ char buffer[128];
+ const char *setting_names[] = {
+ "region",
+ "aws_access_key_id",
+ "aws_secret_access_key",
+ };
+ char * const setting_pointers[] = {
+ aws_region,
+ key_id,
+ access_key,
+ };
+ unsigned setting_count = 3;
+ herr_t ret_value = SUCCEED;
+ unsigned buffer_i = 0;
+ unsigned setting_i = 0;
+ int found_setting = 0;
+ char *line_buffer = &(buffer[0]);
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called load_aws_creds_from_file.\n");
+#endif
+
+ /* format target line for start of profile */
+ if (32 < HDsnprintf(profile_line, 32, "[%s]", profile_name)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL,
+ "unable to format profile label")
+ }
+
+ /* look for start of profile */
+ do {
+ /* clear buffer */
+ for (buffer_i=0; buffer_i < 128; buffer_i++) {
+ buffer[buffer_i] = 0;
+ }
+
+ line_buffer = fgets(line_buffer, 128, file);
+ if (line_buffer == NULL) { /* reached end of file */
+ goto done;
+ }
+ } while (strncmp(line_buffer, profile_line, HDstrlen(profile_line)));
+
+ /* extract credentials from lines */
+ do {
+ /* clear buffer */
+ for (buffer_i=0; buffer_i < 128; buffer_i++) {
+ buffer[buffer_i] = 0;
+ }
+
+ /* collect a line from file */
+ line_buffer = fgets(line_buffer, 128, file);
+ if (line_buffer == NULL) {
+ goto done; /* end of file */
+ }
+
+ /* loop over names to see if line looks like assignment */
+ for (setting_i = 0; setting_i < setting_count; setting_i++) {
+ size_t setting_name_len = 0;
+ const char *setting_name = NULL;
+ char line_prefix[128];
+
+ setting_name = setting_names[setting_i];
+ setting_name_len = HDstrlen(setting_name);
+ if (HDsnprintf(line_prefix, 128, "%s=", setting_name) < 0) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL,
+ "unable to format line prefix")
+ }
+
+ /* found a matching name? */
+ if (!HDstrncmp(line_buffer, line_prefix, setting_name_len + 1)) {
+ found_setting = 1;
+
+ /* skip NULL destination buffer */
+ if (setting_pointers[setting_i] == NULL) {
+ break;
+ }
+
+ /* advance to end of name in string */
+ do {
+ line_buffer++;
+ } while (*line_buffer != 0 && *line_buffer != '=');
+
+ if (*line_buffer == 0 || *(line_buffer+1) == 0) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "incomplete assignment in file")
+ }
+ line_buffer++; /* was pointing at '='; advance */
+
+ /* copy line buffer into out pointer */
+ if (HDstrncpy(
+ setting_pointers[setting_i],
+ (const char *)line_buffer,
+ HDstrlen(line_buffer))
+ == NULL)
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL,
+ "unable to copy line into pointer")
+ }
+
+ /* "trim" tailing whitespace by replacing with null terminator*/
+ buffer_i = 0;
+ while (!isspace(setting_pointers[setting_i][buffer_i])) {
+ buffer_i++;
+ }
+ setting_pointers[setting_i][buffer_i] = '\0';
+
+ break; /* have read setting; don't compare with others */
+ } /* end if possible name match */
+ } /* end for each setting name */
+ } while (found_setting);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5FD__s3comms_load_aws_creds_from_file() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_load_aws_profile()
+ *
+ * Purpose :
+ *
+ * Read aws profile elements from standard location on system and store
+ * settings in memory.
+ *
+ * Looks for both `~/.aws/config` and `~/.aws/credentials`, the standard
+ * files for AWS tools. If a file exists (can be opened), looks for the
+ * given profile name and reads the settings into the relevant buffer.
+ *
+ * Any setting duplicated in both files will be set to that from
+ * `credentials`.
+ *
+ * Settings are stored in the supplied buffers as null-terminated strings.
+ *
+ * Return:
+ *
+ * + SUCCESS: `SUCCEED` (0)
+ * + no error occurred and all settings were populated
+ * + FAILURE: `FAIL` (-1)
+ * + internal error occurred
+ * + unable to locate profile
+ * + region, key id, and secret key were not all found and set
+ *
+ * Programmer: Jacob Smith
+ * 2018-02-27
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_load_aws_profile(const char *profile_name,
+ char *key_id_out,
+ char *secret_access_key_out,
+ char *aws_region_out)
+{
+ herr_t ret_value = SUCCEED;
+ FILE *credfile = NULL;
+ char awspath[117];
+ char filepath[128];
+ int ret = 0;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_load_aws_profile.\n");
+#endif
+
+#ifdef H5_HAVE_WIN32_API
+ ret = HDsnprintf(awspath, 117, "%s/.aws/", getenv("USERPROFILE")) ;
+#else
+ ret = HDsnprintf(awspath, 117, "%s/.aws/", getenv("HOME")) ;
+#endif
+ if (ret < 0 || (size_t)ret >= 117) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL,
+ "unable to format home-aws path")
+ }
+ ret = HDsnprintf(filepath, 128, "%s%s", awspath, "credentials");
+ if (ret < 0 || (size_t)ret >= 128) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL,
+ "unable to format credentials path")
+ }
+
+ credfile = fopen(filepath, "r");
+ if (credfile != NULL) {
+ if (H5FD__s3comms_load_aws_creds_from_file(
+ credfile,
+ profile_name,
+ key_id_out,
+ secret_access_key_out,
+ aws_region_out)
+ == FAIL)
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to load from aws credentials")
+ }
+ if (fclose(credfile) == EOF) {
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL,
+ "unable to close credentials file")
+ }
+ credfile = NULL;
+ } /* end if credential file opened */
+
+ ret = HDsnprintf(filepath, 128, "%s%s", awspath, "config");
+ if (ret < 0 || (size_t)ret >= 128) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL,
+ "unable to format config path")
+ }
+ credfile = fopen(filepath, "r");
+ if (credfile != NULL) {
+ if (H5FD__s3comms_load_aws_creds_from_file(
+ credfile,
+ profile_name,
+ (*key_id_out == 0) ? key_id_out : NULL,
+ (*secret_access_key_out == 0) ? secret_access_key_out : NULL,
+ (*aws_region_out == 0) ? aws_region_out : NULL)
+ == FAIL)
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to load from aws config")
+ }
+ if (fclose(credfile) == EOF) {
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL,
+ "unable to close config file")
+ }
+ credfile = NULL;
+ } /* end if credential file opened */
+
+ /* fail if not all three settings were loaded */
+ if (*key_id_out == 0 ||
+ *secret_access_key_out == 0 ||
+ *aws_region_out == 0)
+ {
+ ret_value = FAIL;
+ }
+
+done:
+ if (credfile != NULL) {
+ if (fclose(credfile) == EOF) {
+ HDONE_ERROR(H5E_ARGS, H5E_ARGS, FAIL,
+ "problem error-closing aws configuration file")
+ }
+ }
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5FD_s3comms_load_aws_profile() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_nlowercase()
+ *
+ * Purpose:
+ *
+ * From string starting at `s`, write `len` characters to `dest`,
+ * converting all to lowercase.
+ *
+ * Behavior is undefined if `s` is NULL or `len` overruns the allocated
+ * space of either `s` or `dest`.
+ *
+ * Provided as convenience.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - upon completion, `dest` is populated
+ * - FAILURE: `FAIL`
+ * - `dest == NULL`
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-18
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_nlowercase(
+ char *dest,
+ const char *s,
+ size_t len)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_nlowercase.\n");
+#endif
+
+ if (dest == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "destination cannot be null.\n");
+ }
+
+ if (len > 0) {
+ HDmemcpy(dest, s, len);
+ do {
+ len--;
+ dest[len] = (char)tolower( (int)dest[len] );
+ } while (len > 0);
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5FD_s3comms_nlowercase() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_parse_url()
+ *
+ * Purpose:
+ *
+ * Parse URL-like string and stuff URL components into
+ * `parsed_url` structure, if possible.
+ *
+ * Expects null-terminated string of format:
+ * SCHEME "://" HOST [":" PORT ] ["/" [ PATH ] ] ["?" QUERY]
+ * where SCHEME :: "[a-zA-Z/.-]+"
+ * PORT :: "[0-9]"
+ *
+ * Stores resulting structure in argument pointer `purl`, if successful,
+ * creating and populating new `parsed_url_t` structure pointer.
+ * Empty or absent elements are NULL in new purl structure.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - `purl` pointer is populated
+ * - FAILURE: `FAIL`
+ * - unable to parse
+ * - `purl` is unaltered (probably NULL)
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-30
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_parse_url(
+ const char *str,
+ parsed_url_t **_purl)
+{
+ parsed_url_t *purl = NULL; /* pointer to new structure */
+ const char *tmpstr = NULL; /* working pointer in string */
+ const char *curstr = str; /* "start" pointer in string */
+ long int len = 0; /* substring length */
+ long int urllen = 0; /* length of passed-in url string */
+ unsigned int i = 0;
+ herr_t ret_value = FAIL;
+
+ FUNC_ENTER_NOAPI_NOINIT;
+
+#if S3COMMS_DEBUG
+ HDprintf("called H5FD_s3comms_parse_url.\n");
+#endif
+
+ if (str == NULL || *str == '\0') {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "invalid url string");
+ }
+
+ urllen = (long int)HDstrlen(str);
+
+ purl = (parsed_url_t *)H5MM_malloc(sizeof(parsed_url_t));
+ if (purl == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
+ "can't allocate space for parsed_url_t");
+ }
+ purl->magic = S3COMMS_PARSED_URL_MAGIC;
+ purl->scheme = NULL;
+ purl->host = NULL;
+ purl->port = NULL;
+ purl->path = NULL;
+ purl->query = NULL;
+
+ /***************
+ * READ SCHEME *
+ ***************/
+
+ tmpstr = HDstrchr(curstr, ':');
+ if (tmpstr == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "invalid SCHEME construction: probably not URL");
+ }
+ len = tmpstr - curstr;
+ HDassert( (0 <= len) && (len < urllen) );
+
+ /* check for restrictions
+ */
+ for (i = 0; i < len; i++) {
+ /* scheme = [a-zA-Z+-.]+ (terminated by ":") */
+ if (!isalpha(curstr[i]) &&
+ '+' != curstr[i] &&
+ '-' != curstr[i] &&
+ '.' != curstr[i])
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "invalid SCHEME construction");
+ }
+ }
+ /* copy lowercased scheme to structure
+ */
+ purl->scheme = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
+ if (purl->scheme == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
+ "can't allocate space for SCHEME");
+ }
+ (void)HDstrncpy(purl->scheme, curstr, (size_t)len);
+ purl->scheme[len] = '\0';
+ for ( i = 0; i < len; i++ ) {
+ purl->scheme[i] = (char)tolower(purl->scheme[i]);
+ }
+
+ /* Skip "://" */
+ tmpstr += 3;
+ curstr = tmpstr;
+
+ /*************
+ * READ HOST *
+ *************/
+
+ if (*curstr == '[') {
+ /* IPv6 */
+ while (']' != *tmpstr) {
+ if (tmpstr == 0) { /* end of string reached! */
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "reached end of URL: incomplete IPv6 HOST");
+ }
+ tmpstr++;
+ }
+ tmpstr++;
+ } /* end if (IPv6) */
+ else {
+ while (0 != *tmpstr) {
+ if (':' == *tmpstr ||
+ '/' == *tmpstr ||
+ '?' == *tmpstr)
+ {
+ break;
+ }
+ tmpstr++;
+ }
+ } /* end else (IPv4) */
+ len = tmpstr - curstr;
+ if (len == 0) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "HOST substring cannot be empty");
+ }
+ else
+ if (len > urllen) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem with length of HOST substring");
+ }
+
+ /* copy host
+ */
+ purl->host = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
+ if (purl->host == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
+ "can't allocate space for HOST");
+ }
+ (void)HDstrncpy(purl->host, curstr, (size_t)len);
+ purl->host[len] = 0;
+
+ /*************
+ * READ PORT *
+ *************/
+
+ if (':' == *tmpstr) {
+ tmpstr += 1; /* advance past ':' */
+ curstr = tmpstr;
+ while ((0 != *tmpstr) && ('/' != *tmpstr) && ('?' != *tmpstr)) {
+ tmpstr++;
+ }
+ len = tmpstr - curstr;
+ if (len == 0) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "PORT element cannot be empty");
+ }
+ else
+ if (len > urllen) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem with length of PORT substring");
+ }
+ for (i = 0; i < len; i ++) {
+ if (!isdigit(curstr[i])) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "PORT is not a decimal string");
+ }
+ }
+
+ /* copy port
+ */
+ purl->port = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
+ if (purl->port == NULL) { /* cannot malloc */
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
+ "can't allocate space for PORT");
+ }
+ (void)HDstrncpy(purl->port, curstr, (size_t)len);
+ purl->port[len] = 0;
+ } /* end if PORT element */
+
+ /*************
+ * READ PATH *
+ *************/
+
+ if ('/' == *tmpstr) {
+ /* advance past '/' */
+ tmpstr += 1;
+ curstr = tmpstr;
+
+ /* seek end of PATH
+ */
+ while ((0 != *tmpstr) && ('?' != *tmpstr)) {
+ tmpstr++;
+ }
+ len = tmpstr - curstr;
+ if (len > urllen) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem with length of PATH substring");
+ }
+ if (len > 0) {
+ purl->path = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
+ if (purl->path == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
+ "can't allocate space for PATH");
+ } /* cannot malloc path pointer */
+ (void)HDstrncpy(purl->path, curstr, (size_t)len);
+ purl->path[len] = 0;
+ }
+ } /* end if PATH element */
+
+ /**************
+ * READ QUERY *
+ **************/
+
+ if ('?' == *tmpstr) {
+ tmpstr += 1;
+ curstr = tmpstr;
+ while (0 != *tmpstr) {
+ tmpstr++;
+ }
+ len = tmpstr - curstr;
+ if (len == 0) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "QUERY cannot be empty");
+ } else if (len > urllen) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem with length of QUERY substring");
+ }
+ purl->query = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
+ if (purl->query == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
+ "can't allocate space for QUERY");
+ } /* cannot malloc path pointer */
+ (void)HDstrncpy(purl->query, curstr, (size_t)len);
+ purl->query[len] = 0;
+ } /* end if QUERY exists */
+
+ *_purl = purl;
+ ret_value = SUCCEED;
+
+done:
+ if (ret_value == FAIL) {
+ H5FD_s3comms_free_purl(purl);
+ }
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5FD_s3comms_parse_url() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_percent_encode_char()
+ *
+ * Purpose:
+ *
+ * "Percent-encode" utf-8 character `c`, e.g.,
+ * '$' -> "%24"
+ * '¢' -> "%C2%A2"
+ *
+ * `c` cannot be null.
+ *
+ * Does not (currently) accept multi-byte characters...
+ * limit to (?) u+00ff, well below upper bound for two-byte utf-8 encoding
+ * (u+0080..u+07ff).
+ *
+ * Writes output to `repr`.
+ * `repr` cannot be null.
+ * Assumes adequate space i `repr`...
+ * >>> char[4] or [7] for most characters,
+ * >>> [13] as theoretical maximum.
+ *
+ * Representation `repr` is null-terminated.
+ *
+ * Stores length of representation (without null terminator) at pointer
+ * `repr_len`.
+ *
+ * Return : SUCCEED/FAIL
+ *
+ * - SUCCESS: `SUCCEED`
+ * - percent-encoded representation written to `repr`
+ * - 'repr' is null-terminated
+ * - FAILURE: `FAIL`
+ * - `c` or `repr` was NULL
+ *
+ * Programmer: Jacob Smith
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_percent_encode_char(
+ char *repr,
+ const unsigned char c,
+ size_t *repr_len)
+{
+ unsigned int i = 0;
+ int chars_written = 0;
+ herr_t ret_value = SUCCEED;
+#if S3COMMS_DEBUG
+ unsigned char s[2] = {c, 0};
+ unsigned char hex[3] = {0, 0, 0};
+#endif
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_percent_encode_char.\n");
+#endif
+
+ if (repr == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`.\n")
+ }
+
+#if S3COMMS_DEBUG
+ H5FD_s3comms_bytes_to_hex((char *)hex, s, 1, FALSE);
+ HDfprintf(stdout, " CHAR: \'%s\'\n", s);
+ HDfprintf(stdout, " CHAR-HEX: \"%s\"\n", hex);
+#endif
+
+ if (c <= (unsigned char)0x7f) {
+ /* character represented in a single "byte"
+ * and single percent-code
+ */
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, " SINGLE-BYTE\n");
+#endif
+ *repr_len = 3;
+ chars_written = HDsnprintf(repr, 4, "%%%02X", c);
+ if (chars_written < 0) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "cannot write char %c",
+ c);
+ }
+ } /* end if single-byte unicode char */
+ else {
+ /* multi-byte, multi-percent representation
+ */
+ unsigned int acc = 0; /* byte accumulator */
+ unsigned int k = 0; /* uint character representation */
+ unsigned int stack_size = 0;
+ unsigned char stack[4] = {0, 0, 0, 0};
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, " MULTI-BYTE\n");
+#endif
+ stack_size = 0;
+ k = (unsigned int)c;
+ *repr_len = 0;
+ do {
+ /* push number onto stack in six-bit slices
+ */
+ acc = k;
+ acc >>= 6; /* cull least */
+ acc <<= 6; /* six bits */
+ stack[stack_size++] = (unsigned char)(k - acc);
+ k = acc >> 6;
+ } while (k > 0);
+
+ /* `stack` now has two to four six-bit 'numbers' to be put into
+ * UTF-8 byte fields.
+ */
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, " STACK:\n {\n");
+ for (i = 0; i < stack_size; i++) {
+ H5FD_s3comms_bytes_to_hex(
+ (char *)hex,
+ (&stack[i]),
+ 1,
+ FALSE);
+ hex[2] = 0;
+ HDfprintf(stdout, " %s,\n", hex);
+ }
+ HDfprintf(stdout, " }\n");
+#endif
+
+ /****************
+ * leading byte *
+ ****************/
+
+ /* prepend 11[1[1]]0 to first byte */
+ /* 110xxxxx, 1110xxxx, or 11110xxx */
+ acc = 0xC0; /* 0x11000000 */
+ acc += (stack_size > 2) ? 0x20 : 0; /* 0x00100000 */
+ acc += (stack_size > 3) ? 0x10 : 0; /* 0x00010000 */
+ stack_size--;
+ chars_written = HDsnprintf(
+ repr,
+ 4,
+ "%%%02X",
+ (unsigned char)(acc + stack[stack_size]));
+ if (chars_written < 0) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "cannot write char %c",
+ c);
+ }
+ *repr_len += 3;
+
+ /************************
+ * continuation byte(s) *
+ ************************/
+
+ /* 10xxxxxx */
+ for (i = 0; i < stack_size; i++) {
+ chars_written = HDsnprintf(
+ &repr[i*3 + 3],
+ 4,
+ "%%%02X",
+ (unsigned char)(0x80 + stack[stack_size - 1 - i]));
+ if (chars_written < 0) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "cannot write char %c",
+ c);
+ }
+ *repr_len += 3;
+ } /* end for each continuation byte */
+ } /* end else (multi-byte) */
+
+ *(repr + *repr_len) = '\0';
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* H5FD_s3comms_percent_encode_char */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_signing_key()
+ *
+ * Purpose:
+ *
+ * Create AWS4 "Signing Key" from secret key, AWS region, and timestamp.
+ *
+ * Sequentially runs HMAC_SHA256 on strings in specified order,
+ * generating re-usable checksum (according to documentation, valid for
+ * 7 days from time given).
+ *
+ * `secret` is `access key id` for targeted service/bucket/resource.
+ *
+ * `iso8601now` must conform to format, yyyyMMDD'T'hhmmss'Z'
+ * e.g. "19690720T201740Z".
+ *
+ * `region` should be one of AWS service region names, e.g. "us-east-1".
+ *
+ * Hard-coded "service" algorithm requirement to "s3".
+ *
+ * Inputs must be null-terminated strings.
+ *
+ * Writes to `md` the raw byte data, length of `SHA256_DIGEST_LENGTH`.
+ * Programmer must ensure that `md` is appropriately allocated.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - raw byte data of signing key written to `md`
+ * - FAILURE: `FAIL`
+ * - if any input arguments was NULL
+ *
+ * Programmer: Jacob Smith
+ * 2017-07-13
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_signing_key(
+ unsigned char *md,
+ const char *secret,
+ const char *region,
+ const char *iso8601now)
+{
+ char *AWS4_secret = NULL;
+ size_t AWS4_secret_len = 0;
+ unsigned char datekey[SHA256_DIGEST_LENGTH];
+ unsigned char dateregionkey[SHA256_DIGEST_LENGTH];
+ unsigned char dateregionservicekey[SHA256_DIGEST_LENGTH];
+ int ret = 0; /* return value of HDsnprintf */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_signing_key.\n");
+#endif
+
+ if (md == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "Destination `md` cannot be NULL.\n")
+ }
+ if (secret == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "`secret` cannot be NULL.\n")
+ }
+ if (region == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "`region` cannot be NULL.\n")
+ }
+ if (iso8601now == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "`iso8601now` cannot be NULL.\n")
+ }
+
+ AWS4_secret_len = 4 + HDstrlen(secret) + 1;
+ AWS4_secret = (char*)H5MM_malloc(sizeof(char *) * AWS4_secret_len);
+ if (AWS4_secret == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "Could not allocate space.\n")
+ }
+
+ /* prepend "AWS4" to start of the secret key
+ */
+ ret = HDsnprintf(AWS4_secret, AWS4_secret_len,"%s%s", "AWS4", secret);
+ if ((size_t)ret != (AWS4_secret_len - 1)) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem writing AWS4+secret `%s`",
+ secret);
+ }
+
+ /* hash_func, key, len(key), msg, len(msg), digest_dest, digest_len_dest
+ * we know digest length, so ignore via NULL
+ */
+ HMAC(EVP_sha256(),
+ (const unsigned char *)AWS4_secret,
+ (int)HDstrlen(AWS4_secret),
+ (const unsigned char*)iso8601now,
+ 8, /* 8 --> length of 8 --> "yyyyMMDD" */
+ datekey,
+ NULL);
+ HMAC(EVP_sha256(),
+ (const unsigned char *)datekey,
+ SHA256_DIGEST_LENGTH,
+ (const unsigned char *)region,
+ HDstrlen(region),
+ dateregionkey,
+ NULL);
+ HMAC(EVP_sha256(),
+ (const unsigned char *)dateregionkey,
+ SHA256_DIGEST_LENGTH,
+ (const unsigned char *)"s3",
+ 2,
+ dateregionservicekey,
+ NULL);
+ HMAC(EVP_sha256(),
+ (const unsigned char *)dateregionservicekey,
+ SHA256_DIGEST_LENGTH,
+ (const unsigned char *)"aws4_request",
+ 12,
+ md,
+ NULL);
+
+done:
+ H5MM_xfree(AWS4_secret);
+
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5FD_s3comms_signing_key() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_tostringtosign()
+ *
+ * Purpose:
+ *
+ * Get AWS "String to Sign" from Canonical Request, timestamp,
+ * and AWS "region".
+ *
+ * Common between single request and "chunked upload",
+ * conforms to:
+ * "AWS4-HMAC-SHA256\n" +
+ * <ISO8601 date format> + "\n" + // yyyyMMDD'T'hhmmss'Z'
+ * <yyyyMMDD> + "/" + <AWS Region> + "/s3/aws4-request\n" +
+ * hex(SHA256(<CANONICAL-REQUEST>))
+ *
+ * Inputs `creq` (canonical request string), `now` (ISO8601 format),
+ * and `region` (s3 region designator string) must all be
+ * null-terminated strings.
+ *
+ * Result is written to `dest` with null-terminator.
+ * It is left to programmer to ensure `dest` has adequate space.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - "string to sign" written to `dest` and null-terminated
+ * - FAILURE: `FAIL`
+ * - if any of the inputs are NULL
+ * - if an error is encountered while computing checksum
+ *
+ * Programmer: Jacob Smith
+ * 2017-07-??
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_tostringtosign(
+ char *dest,
+ const char *req,
+ const char *now,
+ const char *region)
+{
+ unsigned char checksum[SHA256_DIGEST_LENGTH * 2 + 1];
+ size_t d = 0;
+ char day[9];
+ char hexsum[SHA256_DIGEST_LENGTH * 2 + 1];
+ size_t i = 0;
+ int ret = 0; /* HDsnprintf return value */
+ herr_t ret_value = SUCCEED;
+ char tmp[128];
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_tostringtosign.\n");
+#endif
+
+ if (dest == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "destination buffer cannot be null.\n")
+ }
+ if (req == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "canonical request cannot be null.\n")
+ }
+ if (now == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "Timestring cannot be NULL.\n")
+ }
+ if (region == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "Region cannot be NULL.\n")
+ }
+
+ for (i = 0; i < 128; i++) {
+ tmp[i] = '\0';
+ }
+ for (i = 0; i < SHA256_DIGEST_LENGTH * 2 + 1; i++) {
+ checksum[i] = '\0';
+ hexsum[i] = '\0';
+ }
+ HDstrncpy(day, now, 8);
+ day[8] = '\0';
+ ret = HDsnprintf(tmp, 127, "%s/%s/s3/aws4_request", day, region);
+ if (ret <= 0 || ret >= 127) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "problem adding day and region to string")
+ }
+
+ HDmemcpy((dest + d), "AWS4-HMAC-SHA256\n", 17);
+ d = 17;
+
+ HDmemcpy((dest+d), now, HDstrlen(now));
+ d += HDstrlen(now);
+ dest[d++] = '\n';
+
+ HDmemcpy((dest + d), tmp, HDstrlen(tmp));
+ d += HDstrlen(tmp);
+ dest[d++] = '\n';
+
+ SHA256((const unsigned char *)req,
+ HDstrlen(req),
+ checksum);
+
+ if (H5FD_s3comms_bytes_to_hex(
+ hexsum,
+ (const unsigned char *)checksum,
+ SHA256_DIGEST_LENGTH,
+ true)
+ == FAIL)
+ {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "could not create hex string");
+ }
+
+ for (i = 0; i < SHA256_DIGEST_LENGTH * 2; i++) {
+ dest[d++] = hexsum[i];
+ }
+
+ dest[d] = '\0';
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5ros3_tostringtosign() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_trim()
+ *
+ * Purpose:
+ *
+ * Remove all whitespace characters from start and end of a string `s`
+ * of length `s_len`, writing trimmed string copy to `dest`.
+ * Stores number of characters remaining at `n_written`.
+ *
+ * Destination for trimmed copy `dest` cannot be null.
+ * `dest` must have adequate space allocated for trimmed copy.
+ * If inadequate space, behavior is undefined, possibly resulting
+ * in segfault or overwrite of other data.
+ *
+ * If `s` is NULL or all whitespace, `dest` is untouched and `n_written`
+ * is set to 0.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ * - `dest == NULL`
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-18
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_trim(char *dest,
+ char *s,
+ size_t s_len,
+ size_t *n_written)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "called H5FD_s3comms_trim.\n");
+#endif
+
+ if (dest == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "destination cannot be null.")
+ }
+ if (s == NULL) {
+ s_len = 0;
+ }
+
+ if (s_len > 0) {
+ /* Find first non-whitespace character from start;
+ * reduce total length per character.
+ */
+ while ((s_len > 0) &&
+ isspace((unsigned char)s[0]) && s_len > 0)
+ {
+ s++;
+ s_len--;
+ }
+
+ /* Find first non-whitespace character from tail;
+ * reduce length per-character.
+ * If length is 0 already, there is no non-whitespace character.
+ */
+ if (s_len > 0) {
+ do {
+ s_len--;
+ } while( isspace((unsigned char)s[s_len]) );
+ s_len++;
+
+ /* write output into dest
+ */
+ HDmemcpy(dest, s, s_len);
+ }
+ }
+
+ *n_written = s_len;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_s3comms_trim() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: H5FD_s3comms_uriencode()
+ *
+ * Purpose:
+ *
+ * URIencode (percent-encode) every byte except "[a-zA-Z0-9]-._~".
+ *
+ * For each character in source string `_s` from `s[0]` to `s[s_len-1]`,
+ * writes to `dest` either the raw character or its percent-encoded
+ * equivalent.
+ *
+ * See `H5FD_s3comms_bytes_to_hex` for information on percent-encoding.
+ *
+ * Space (' ') character encoded as "%20" (not "+")
+ *
+ * Forward-slash ('/') encoded as "%2F" only when `encode_slash == true`.
+ *
+ * Records number of characters written at `n_written`.
+ *
+ * Assumes that `dest` has been allocated with enough space.
+ *
+ * Neither `dest` nor `s` can be NULL.
+ *
+ * `s_len == 0` will have no effect.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ * - source strings `s` or destination `dest` are NULL
+ * - error while attempting to percent-encode a character
+ *
+ * Programmer: Jacob Smith
+ * 2017-07-??
+ *
+ *----------------------------------------------------------------------------
+ */
+herr_t
+H5FD_s3comms_uriencode(
+ char *dest,
+ const char *s,
+ size_t s_len,
+ hbool_t encode_slash,
+ size_t *n_written)
+{
+ char c = 0;
+ size_t dest_off = 0;
+ char hex_buffer[13];
+ size_t hex_off = 0;
+ size_t hex_len = 0;
+ herr_t ret_value = SUCCEED;
+ size_t s_off = 0;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if S3COMMS_DEBUG
+ HDfprintf(stdout, "H5FD_s3comms_uriencode called.\n");
+#endif
+
+ if (s == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "source string cannot be NULL");
+ }
+ if (dest == NULL) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "destination cannot be NULL");
+ }
+
+ /* Write characters to destination, converting to percent-encoded
+ * "hex-utf-8" strings if necessary.
+ * e.g., '$' -> "%24"
+ */
+ for (s_off = 0; s_off < s_len; s_off++) {
+ c = s[s_off];
+ if (isalnum(c) ||
+ c == '.' ||
+ c == '-' ||
+ c == '_' ||
+ c == '~' ||
+ (c == '/' && encode_slash == FALSE))
+ {
+ dest[dest_off++] = c;
+ }
+ else {
+ hex_off = 0;
+ if (H5FD_s3comms_percent_encode_char(
+ hex_buffer,
+ (const unsigned char)c,
+ &hex_len)
+ == FAIL)
+ {
+ hex_buffer[0] = c;
+ hex_buffer[1] = 0;
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "unable to percent-encode character \'%s\' "
+ "at %d in \"%s\"", hex_buffer, (int)s_off, s);
+ }
+
+ for (hex_off = 0; hex_off < hex_len; hex_off++) {
+ dest[dest_off++] = hex_buffer[hex_off];
+ }
+ } /* end else (not a regular character) */
+ } /* end for each character */
+
+ if (dest_off < s_len)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "buffer overflow");
+
+ *n_written = dest_off;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD_s3comms_uriencode */
+
+#endif /* H5_HAVE_ROS3_VFD */
+
diff --git a/src/H5FDs3comms.h b/src/H5FDs3comms.h
new file mode 100644
index 0000000..90c6650
--- /dev/null
+++ b/src/H5FDs3comms.h
@@ -0,0 +1,604 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*****************************************************************************
+ * Read-Only S3 Virtual File Driver (VFD)
+ *
+ * This is the header for the S3 Communications module
+ *
+ * ***NOT A FILE DRIVER***
+ *
+ * Purpose:
+ *
+ * - Provide structures and functions related to communicating with
+ * Amazon S3 (Simple Storage Service).
+ * - Abstract away the REST API (HTTP,
+ * networked communications) behind a series of uniform function calls.
+ * - Handle AWS4 authentication, if appropriate.
+ * - Fail predictably in event of errors.
+ * - Eventually, support more S3 operations, such as creating, writing to,
+ * and removing Objects remotely.
+ *
+ * translates:
+ * `read(some_file, bytes_offset, bytes_length, &dest_buffer);`
+ * to:
+ * ```
+ * GET myfile HTTP/1.1
+ * Host: somewhere.me
+ * Range: bytes=4096-5115
+ * ```
+ * and places received bytes from HTTP response...
+ * ```
+ * HTTP/1.1 206 Partial-Content
+ * Content-Range: 4096-5115/63239
+ *
+ * <bytes>
+ * ```
+ * ...in destination buffer.
+ *
+ * TODO: put documentation in a consistent place and point to it from here.
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-30
+ *
+ *****************************************************************************/
+
+#include "H5private.h" /* Generic Functions */
+
+#ifdef H5_HAVE_ROS3_VFD
+
+/* Necessary S3 headers */
+#include <curl/curl.h>
+#include <openssl/evp.h>
+#include <openssl/hmac.h>
+#include <openssl/sha.h>
+
+/*****************
+ * PUBLIC MACROS *
+ *****************/
+
+/* hexadecimal string of pre-computed sha256 checksum of the empty string
+ * hex(sha256sum(""))
+ */
+#define EMPTY_SHA256 \
+"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
+
+/* string length (plus null terminator)
+ * example ISO8601-format string: "20170713T145903Z" (YYYYmmdd'T'HHMMSS'_')
+ */
+#define ISO8601_SIZE 17
+
+/* string length (plus null terminator)
+ * example RFC7231-format string: "Fri, 30 Jun 2017 20:41:55 GMT"
+ */
+#define RFC7231_SIZE 30
+
+/*---------------------------------------------------------------------------
+ *
+ * Macro: ISO8601NOW()
+ *
+ * Purpose:
+ *
+ * write "YYYYmmdd'T'HHMMSS'Z'" (less single-quotes) to dest
+ * e.g., "20170630T204155Z"
+ *
+ * wrapper for strftime()
+ *
+ * It is left to the programmer to check return value of
+ * ISO8601NOW (should equal ISO8601_SIZE - 1).
+ *
+ *---------------------------------------------------------------------------
+ */
+#define ISO8601NOW(dest, now_gm) \
+strftime((dest), ISO8601_SIZE, "%Y%m%dT%H%M%SZ", (now_gm))
+
+/*---------------------------------------------------------------------------
+ *
+ * Macro: RFC7231NOW()
+ *
+ * Purpose:
+ *
+ * write "Day, dd Mmm YYYY HH:MM:SS GMT" to dest
+ * e.g., "Fri, 30 Jun 2017 20:41:55 GMT"
+ *
+ * wrapper for strftime()
+ *
+ * It is left to the programmer to check return value of
+ * RFC7231NOW (should equal RFC7231_SIZE - 1).
+ *
+ *---------------------------------------------------------------------------
+ */
+#define RFC7231NOW(dest, now_gm) \
+strftime((dest), RFC7231_SIZE, "%a, %d %b %Y %H:%M:%S GMT", (now_gm))
+
+
+/* Reasonable maximum length of a credential string.
+ * Provided for error-checking S3COMMS_FORMAT_CREDENTIAL (below).
+ * 17 <- "////aws4_request\0"
+ * 2 < "s3" (service)
+ * 8 <- "YYYYmmdd" (date)
+ * 128 <- (access_id)
+ * 155 :: sum
+ */
+#define S3COMMS_MAX_CREDENTIAL_SIZE 155
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Macro: H5FD_S3COMMS_FORMAT_CREDENTIAL()
+ *
+ * Purpose:
+ *
+ * Format "S3 Credential" string from inputs, for AWS4.
+ *
+ * Wrapper for HDsnprintf().
+ *
+ * _HAS NO ERROR-CHECKING FACILITIES_
+ * It is left to programmer to ensure that return value confers success.
+ * e.g.,
+ * ```
+ * assert( S3COMMS_MAX_CREDENTIAL_SIZE >=
+ * S3COMMS_FORMAT_CREDENTIAL(...) );
+ * ```
+ *
+ * "<access-id>/<date>/<aws-region>/<aws-service>/aws4_request"
+ * assuming that `dest` has adequate space.
+ *
+ * ALL inputs must be null-terminated strings.
+ *
+ * `access` should be the user's access key ID.
+ * `date` must be of format "YYYYmmdd".
+ * `region` should be relevant AWS region, i.e. "us-east-1".
+ * `service` should be "s3".
+ *
+ *---------------------------------------------------------------------------
+ */
+#define S3COMMS_FORMAT_CREDENTIAL(dest, access, iso8601_date, region, service) \
+HDsnprintf((dest), S3COMMS_MAX_CREDENTIAL_SIZE, \
+ "%s/%s/%s/%s/aws4_request", \
+ (access), (iso8601_date), (region), (service))
+
+/*********************
+ * PUBLIC STRUCTURES *
+ *********************/
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Structure: hrb_node_t
+ *
+ * HTTP Header Field Node
+ *
+ *
+ *
+ * Maintain a ordered (linked) list of HTTP Header fields.
+ *
+ * Provides efficient access and manipulation of a logical sequence of
+ * HTTP header fields, of particular use when composing an
+ * "S3 Canonical Request" for authentication.
+ *
+ * - The creation of a Canoncial Request involves:
+ * - convert field names to lower case
+ * - sort by this lower-case name
+ * - convert ": " name-value separator in HTTP string to ":"
+ * - get sorted lowercase names without field or separator
+ *
+ * As HTTP headers allow headers in any order (excepting the case of multiple
+ * headers with the same name), the list ordering can be optimized for Canonical
+ * Request creation, suggesting alphabtical order. For more expedient insertion
+ * and removal of elements in the list, linked list seems preferable to a
+ * dynamically-expanding array. The usually-smaller number of entries (5 or
+ * fewer) makes performance overhead of traversing the list trivial.
+ *
+ * The above requirements of creating at Canonical Request suggests a reasonable
+ * trade-off of speed for space with the option to compute elements as needed
+ * or to have the various elements prepared and stored in the structure
+ * (e.g. name, value, lowername, concatenated name:value)
+ * The structure currently is implemented to pre-compute.
+ *
+ * At all times, the "first" node of the list should be the least,
+ * alphabetically. For all nodes, the `next` node should be either NULL or
+ * of greater alphabetical value.
+ *
+ * Each node contains its own header field information, plus a pointer to the
+ * next node.
+ *
+ * It is not allowed to have multiple nodes with the same _lowercase_ `name`s
+ * in the same list
+ * (i.e., name is case-insensitive for access and modification.)
+ *
+ * All data (`name`, `value`, `lowername`, and `cat`) are null-terminated
+ * strings allocated specifically for their node.
+ *
+ *
+ *
+ * `magic` (unsigned long)
+ *
+ * "unique" idenfier number for the structure type
+ *
+ * `name` (char *)
+ *
+ * Case-meaningful name of the HTTP field.
+ * Given case is how it is supplied to networking code.
+ * e.g., "Range"
+ *
+ * `lowername` (char *)
+ *
+ * Lowercase copy of name.
+ * e.g., "range"
+ *
+ * `value` (char *)
+ *
+ * Case-meaningful value of HTTP field.
+ * e.g., "bytes=0-9"
+ *
+ * `cat` (char *)
+ *
+ * Concatenated, null-terminated string of HTTP header line,
+ * as the field would appear in an HTTP request.
+ * e.g., "Range: bytes=0-9"
+ *
+ * `next` (hrb_node_t *)
+ *
+ * Pointers to next node in the list, or NULL sentinel as end of list.
+ * Next node must have a greater `lowername` as determined by strcmp().
+ *
+ *----------------------------------------------------------------------------
+ */
+typedef struct hrb_node_t {
+ unsigned long magic;
+ char *name;
+ char *value;
+ char *cat;
+ char *lowername;
+ struct hrb_node_t *next;
+} hrb_node_t;
+#define S3COMMS_HRB_NODE_MAGIC 0x7F5757UL
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Structure: hrb_t
+ *
+ * HTTP Request Buffer structure
+ *
+ *
+ *
+ * Logically represent an HTTP request
+ *
+ * GET /myplace/myfile.h5 HTTP/1.1
+ * Host: over.rainbow.oz
+ * Date: Fri, 01 Dec 2017 12:35:04 CST
+ *
+ * <body>
+ *
+ * ...with fast, efficient access to and modification of primary and field
+ * elements.
+ *
+ * Structure for building HTTP requests while hiding much of the string
+ * processing required "under the hood."
+ *
+ * Information about the request target -- the first line -- and the body text,
+ * if any, are managed directly with this structure. All header fields, e.g.,
+ * "Host" and "Date" above, are created with a linked list of `hrb_node_t` and
+ * included in the request by a pointer to the head of the list.
+ *
+ *
+ *
+ * `magic` (unsigned long)
+ *
+ * "Magic" number confirming that this is an hrb_t structure and
+ * what operations are valid for it.
+ *
+ * Must be S3COMMS_HRB_MAGIC to be valid.
+ *
+ * `body` (char *) :
+ *
+ * Pointer to start of HTTP body.
+ *
+ * Can be NULL, in which case it is treated as the empty string, "".
+ *
+ * `body_len` (size_t) :
+ *
+ * Number of bytes (characters) in `body`. 0 if empty or NULL `body`.
+ *
+ * `first_header` (hrb_node_t *) :
+ *
+ * Pointer to first SORTED header node, if any.
+ * It is left to the programmer to ensure that this node and associated
+ * list is destroyed when done.
+ *
+ * `resource` (char *) :
+ *
+ * Pointer to resource URL string, e.g., "/folder/page.xhtml".
+ *
+ * `verb` (char *) :
+ *
+ * Pointer to HTTP verb string, e.g., "GET".
+ *
+ * `version` (char *) :
+ *
+ * Pointer to HTTP version string, e.g., "HTTP/1.1".
+ *
+ *----------------------------------------------------------------------------
+ */
+typedef struct {
+ unsigned long magic;
+ char *body;
+ size_t body_len;
+ hrb_node_t *first_header;
+ char *resource;
+ char *verb;
+ char *version;
+} hrb_t;
+#define S3COMMS_HRB_MAGIC 0x6DCC84UL
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Structure: parsed_url_t
+ *
+ *
+ * Represent a URL with easily-accessed pointers to logical elements within.
+ * These elements (components) are stored as null-terminated strings (or just
+ * NULLs). These components should be allocated for the structure, making the
+ * data as safe as possible from modification. If a component is NULL, it is
+ * either implicit in or absent from the URL.
+ *
+ * "http://mybucket.s3.amazonaws.com:8080/somefile.h5?param=value&arg=value"
+ * ^--^ ^-----------------------^ ^--^ ^---------^ ^-------------------^
+ * Scheme Host Port Resource Query/-ies
+ *
+ *
+ *
+ * `magic` (unsigned long)
+ *
+ * Structure identification and validation identifier.
+ * Identifies as `parsed_url_t` type.
+ *
+ * `scheme` (char *)
+ *
+ * String representing which protocol is to be expected.
+ * _Must_ be present.
+ * "http", "https", "ftp", e.g.
+ *
+ * `host` (char *)
+ *
+ * String of host, either domain name, IPv4, or IPv6 format.
+ * _Must_ be present.
+ * "over.rainbow.oz", "192.168.0.1", "[0000:0000:0000:0001]"
+ *
+ * `port` (char *)
+ *
+ * String representation of specified port. Must resolve to a valid unsigned
+ * integer.
+ * "9000", "80"
+ *
+ * `path` (char *)
+ *
+ * Path to resource on host. If not specified, assumes root "/".
+ * "lollipop_guild.wav", "characters/witches/white.dat"
+ *
+ * `query` (char *)
+ *
+ * Single string of all query parameters in url (if any).
+ * "arg1=value1&arg2=value2"
+ *
+ *----------------------------------------------------------------------------
+ */
+typedef struct {
+ unsigned long magic;
+ char *scheme; /* required */
+ char *host; /* required */
+ char *port;
+ char *path;
+ char *query;
+} parsed_url_t;
+#define S3COMMS_PARSED_URL_MAGIC 0x21D0DFUL
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Structure: s3r_t
+ *
+ *
+ *
+ * S3 request structure "handle".
+ *
+ * Holds persistent information for Amazon S3 requests.
+ *
+ * Instantiated through `H5FD_s3comms_s3r_open()`, copies data into self.
+ *
+ * Intended to be re-used for operations on a remote object.
+ *
+ * Cleaned up through `H5FD_s3comms_s3r_close()`.
+ *
+ * _DO NOT_ share handle between threads: curl easy handle `curlhandle` has
+ * undefined behavior if called to perform in multiple threads.
+ *
+ *
+ *
+ * `magic` (unsigned long)
+ *
+ * "magic" number identifying this structure as unique type.
+ * MUST equal `S3R_MAGIC` to be valid.
+ *
+ * `curlhandle` (CURL)
+ *
+ * Pointer to the curl_easy handle generated for the request.
+ *
+ * `httpverb` (char *)
+ *
+ * Pointer to NULL-terminated string. HTTP verb,
+ * e.g. "GET", "HEAD", "PUT", etc.
+ *
+ * Default is NULL, resulting in a "GET" request.
+ *
+ * `purl` (parsed_url_t *)
+ *
+ * Pointer to structure holding the elements of URL for file open.
+ *
+ * e.g., "http://bucket.aws.com:8080/myfile.dat?q1=v1&q2=v2"
+ * parsed into...
+ * { scheme: "http"
+ * host: "bucket.aws.com"
+ * port: "8080"
+ * path: "myfile.dat"
+ * query: "q1=v1&q2=v2"
+ * }
+ *
+ * Cannot be NULL.
+ *
+ * `region` (char *)
+ *
+ * Pointer to NULL-terminated string, specifying S3 "region",
+ * e.g., "us-east-1".
+ *
+ * Required to authenticate.
+ *
+ * `secret_id` (char *)
+ *
+ * Pointer to NULL-terminated string for "secret" access id to S3 resource.
+ *
+ * Requred to authenticate.
+ *
+ * `signing_key` (unsigned char *)
+ *
+ * Pointer to `SHA256_DIGEST_LENGTH`-long string for "re-usable" signing
+ * key, generated via
+ * `HMAC-SHA256(HMAC-SHA256(HMAC-SHA256(HMAC-SHA256("AWS4<secret_key>",
+ * "<yyyyMMDD"), "<aws-region>"), "<aws-service>"), "aws4_request")`
+ * which may be re-used for several (up to seven (7)) days from creation?
+ * Computed once upon file open.
+ *
+ * Requred to authenticate.
+ *
+ *----------------------------------------------------------------------------
+ */
+typedef struct {
+ unsigned long magic;
+ CURL *curlhandle;
+ size_t filesize;
+ char *httpverb;
+ parsed_url_t *purl;
+ char *region;
+ char *secret_id;
+ unsigned char *signing_key;
+} s3r_t;
+
+#define S3COMMS_S3R_MAGIC 0x44d8d79
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*******************************************
+ * DECLARATION OF HTTP FIELD LIST ROUTINES *
+ *******************************************/
+
+H5_DLL herr_t H5FD_s3comms_hrb_node_set(hrb_node_t **L,
+ const char *name,
+ const char *value);
+
+/***********************************************
+ * DECLARATION OF HTTP REQUEST BUFFER ROUTINES *
+ ***********************************************/
+
+H5_DLL herr_t H5FD_s3comms_hrb_destroy(hrb_t **buf);
+
+H5_DLL hrb_t * H5FD_s3comms_hrb_init_request(const char *verb,
+ const char *resource,
+ const char *host);
+
+/*************************************
+ * DECLARATION OF S3REQUEST ROUTINES *
+ *************************************/
+
+H5_DLL herr_t H5FD_s3comms_s3r_close(s3r_t *handle);
+
+H5_DLL size_t H5FD_s3comms_s3r_get_filesize(s3r_t *handle);
+
+H5_DLL s3r_t * H5FD_s3comms_s3r_open(const char url[],
+ const char region[],
+ const char id[],
+ const unsigned char signing_key[]);
+
+H5_DLL herr_t H5FD_s3comms_s3r_read(s3r_t *handle,
+ haddr_t offset,
+ size_t len,
+ void *dest);
+
+/*********************************
+ * DECLARATION OF OTHER ROUTINES *
+ *********************************/
+
+H5_DLL struct tm * gmnow(void);
+
+H5_DLL herr_t H5FD_s3comms_aws_canonical_request(char *canonical_request_dest,
+ int cr_size,
+ char *signed_headers_dest,
+ int sh_size,
+ hrb_t *http_request);
+
+H5_DLL herr_t H5FD_s3comms_bytes_to_hex(char *dest,
+ const unsigned char *msg,
+ size_t msg_len,
+ hbool_t lowercase);
+
+H5_DLL herr_t H5FD_s3comms_free_purl(parsed_url_t *purl);
+
+H5_DLL herr_t H5FD_s3comms_HMAC_SHA256(const unsigned char *key,
+ size_t key_len,
+ const char *msg,
+ size_t msg_len,
+ char *dest);
+
+H5_DLL herr_t H5FD_s3comms_load_aws_profile(const char *name,
+ char *key_id_out,
+ char *secret_access_key_out,
+ char *aws_region_out);
+
+H5_DLL herr_t H5FD_s3comms_nlowercase(char *dest,
+ const char *s,
+ size_t len);
+
+H5_DLL herr_t H5FD_s3comms_parse_url(const char *str,
+ parsed_url_t **purl);
+
+H5_DLL herr_t H5FD_s3comms_percent_encode_char(char *repr,
+ const unsigned char c,
+ size_t *repr_len);
+
+H5_DLL herr_t H5FD_s3comms_signing_key(unsigned char *md,
+ const char *secret,
+ const char *region,
+ const char *iso8601now);
+
+H5_DLL herr_t H5FD_s3comms_tostringtosign(char *dest,
+ const char *req_str,
+ const char *now,
+ const char *region);
+
+H5_DLL herr_t H5FD_s3comms_trim(char *dest,
+ char *s,
+ size_t s_len,
+ size_t *n_written);
+
+H5_DLL herr_t H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len,
+ hbool_t encode_slash, size_t *n_written);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* H5_HAVE_ROS3_VFD */
+
diff --git a/src/H5FL.c b/src/H5FL.c
index 89a580a..21bbf02 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -642,7 +642,7 @@ H5FL__reg_term(void)
tmp = H5FL_reg_gc_head.first->next;
#ifdef H5FL_DEBUG
-printf("%s: head->name = %s, head->allocated = %d\n", FUNC, H5FL_reg_gc_head.first->list->name, (int)H5FL_reg_gc_head.first->list->allocated);
+HDprintf("%s: head->name = %s, head->allocated = %d\n", FUNC, H5FL_reg_gc_head.first->list->name, (int)H5FL_reg_gc_head.first->list->allocated);
#endif /* H5FL_DEBUG */
/* Check if the list has allocations outstanding */
if(H5FL_reg_gc_head.first->list->allocated > 0) {
@@ -1312,7 +1312,7 @@ H5FL__blk_term(void)
tmp = H5FL_blk_gc_head.first->next;
#ifdef H5FL_DEBUG
-printf("%s: head->name = %s, head->allocated = %d\n", FUNC, H5FL_blk_gc_head.first->pq->name, (int)H5FL_blk_gc_head.first->pq->allocated);
+HDprintf("%s: head->name = %s, head->allocated = %d\n", FUNC, H5FL_blk_gc_head.first->pq->name, (int)H5FL_blk_gc_head.first->pq->allocated);
#endif /* H5FL_DEBUG */
/* Check if the list has allocations outstanding */
@@ -1780,7 +1780,7 @@ H5FL__arr_term(void)
/* Check if the list has allocations outstanding */
#ifdef H5FL_DEBUG
-printf("%s: head->name = %s, head->allocated = %d\n", FUNC, H5FL_arr_gc_head.first->list->name, (int)H5FL_arr_gc_head.first->list->allocated);
+HDprintf("%s: head->name = %s, head->allocated = %d\n", FUNC, H5FL_arr_gc_head.first->list->name, (int)H5FL_arr_gc_head.first->list->allocated);
#endif /* H5FL_DEBUG */
if(H5FL_arr_gc_head.first->list->allocated > 0) {
/* Add free list to the list of nodes with allocations open still */
@@ -2408,7 +2408,7 @@ H5FL__fac_term_all(void)
tmp = H5FL_fac_gc_head.first->next;
#ifdef H5FL_DEBUG
-printf("%s: head->size = %d, head->allocated = %d\n", FUNC, (int)H5FL_fac_gc_head.first->list->size, (int)H5FL_fac_gc_head.first->list->allocated);
+HDprintf("%s: head->size = %d, head->allocated = %d\n", FUNC, (int)H5FL_fac_gc_head.first->list->size, (int)H5FL_fac_gc_head.first->list->allocated);
#endif /* H5FL_DEBUG */
/* The list cannot have any allocations outstanding */
diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h
index a5896ee..c2654a7 100644
--- a/src/H5FSpkg.h
+++ b/src/H5FSpkg.h
@@ -215,10 +215,8 @@ H5FL_EXTERN(H5FS_t);
/******************************/
/* Generic routines */
-H5_DLL herr_t H5FS__create_flush_depend(H5AC_info_t *parent_entry,
- H5AC_info_t *child_entry);
-H5_DLL herr_t H5FS__destroy_flush_depend(H5AC_info_t *parent_entry,
- H5AC_info_t *child_entry);
+H5_DLL herr_t H5FS__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry);
+H5_DLL herr_t H5FS__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry);
/* Free space manager header routines */
H5_DLL H5FS_t *H5FS__new(const H5F_t *f, uint16_t nclasses,
diff --git a/src/H5Ffake.c b/src/H5Ffake.c
index d199cf0..7e44cfc 100644
--- a/src/H5Ffake.c
+++ b/src/H5Ffake.c
@@ -42,10 +42,9 @@
*-------------------------------------------------------------------------
*/
H5F_t *
-H5F_fake_alloc(uint8_t sizeof_size, hid_t fapl_id)
+H5F_fake_alloc(uint8_t sizeof_size)
{
H5F_t *f = NULL; /* Pointer to fake file struct */
- H5P_genplist_t *plist; /* Property list */
H5F_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -62,17 +61,6 @@ H5F_fake_alloc(uint8_t sizeof_size, hid_t fapl_id)
else
f->shared->sizeof_size = sizeof_size;
- /* Set low/high bounds according to the setting in fapl_id */
- /* See H5F_new() in H5Fint.c */
- if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list")
-
- if(H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &(f->shared->low_bound)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'low' bound for library format versions")
- if(H5P_get(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &(f->shared->high_bound)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'high' bound for library format versions")
-
- /* Set return value */
ret_value = f;
done:
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 253ec3c..eebbcf0 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -2956,8 +2956,10 @@ H5F_set_retries(H5F_t *f)
/* Initialize the # of bins for retries */
f->shared->retries_nbins = 0;
if(f->shared->read_attempts > 1) {
- tmp = HDlog10((double)(f->shared->read_attempts - 1));
- f->shared->retries_nbins = (unsigned)tmp + 1;
+ /* Use HDceil to ensure that the log10 value is rounded up to the
+ nearest integer before casting to unsigned */
+ tmp = HDceil(HDlog10((double)f->shared->read_attempts));
+ f->shared->retries_nbins = (unsigned)tmp;
}
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 663f84e..7bd9a47 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -311,6 +311,9 @@ struct H5F_file_t {
H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */
hsize_t fs_threshold; /* Free space section threshold */
hbool_t fs_persist; /* Free-space persist or not */
+ unsigned fs_version; /* Free-space version: */
+ /* It is used to update fsinfo message in the superblock
+ extension when closing down the free-space managers */
hbool_t use_tmp_space; /* Whether temp. file space allocation is allowed */
haddr_t tmp_addr; /* Next address to use for temp. space in the file */
hbool_t point_of_no_return; /* Flag to indicate that we can't go back and delete a freespace header when it's used up */
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 0c2f5f2..5e78d9e 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -702,8 +702,9 @@ typedef enum H5F_mem_page_t {
/* Type of prefix for opening prefixed files */
typedef enum H5F_prefix_open_t {
- H5F_PREFIX_VDS, /* Virtual dataset prefix */
- H5F_PREFIX_ELINK /* External link prefix */
+ H5F_PREFIX_VDS = 0, /* Virtual dataset prefix */
+ H5F_PREFIX_ELINK = 1, /* External link prefix */
+ H5F_PREFIX_EFILE = 2 /* External file prefix */
} H5F_prefix_open_t;
@@ -827,7 +828,7 @@ H5_DLL void H5F_addr_decode_len(size_t addr_len, const uint8_t **pp, haddr_t *ad
H5_DLL void H5F_sfile_assert_num(unsigned n);
/* Routines for creating & destroying "fake" file structures */
-H5_DLL H5F_t *H5F_fake_alloc(uint8_t sizeof_size, hid_t fapl_id);
+H5_DLL H5F_t *H5F_fake_alloc(uint8_t sizeof_size);
H5_DLL herr_t H5F_fake_free(H5F_t *f);
/* Superblock related routines */
diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h
index 8a475d1..14dbe70 100644
--- a/src/H5Fpublic.h
+++ b/src/H5Fpublic.h
@@ -47,13 +47,13 @@
* We're assuming that these constants are used rather early in the hdf5
* session.
*/
-#define H5F_ACC_RDONLY (H5CHECK H5OPEN 0x0000u) /*absence of rdwr => rd-only */
-#define H5F_ACC_RDWR (H5CHECK H5OPEN 0x0001u) /*open for read and write */
-#define H5F_ACC_TRUNC (H5CHECK H5OPEN 0x0002u) /*overwrite existing files */
-#define H5F_ACC_EXCL (H5CHECK H5OPEN 0x0004u) /*fail if file already exists*/
+#define H5F_ACC_RDONLY (H5CHECK H5OPEN 0x0000u) /*absence of rdwr => rd-only */
+#define H5F_ACC_RDWR (H5CHECK H5OPEN 0x0001u) /*open for read and write */
+#define H5F_ACC_TRUNC (H5CHECK H5OPEN 0x0002u) /*overwrite existing files */
+#define H5F_ACC_EXCL (H5CHECK H5OPEN 0x0004u) /*fail if file already exists*/
/* NOTE: 0x0008u was H5F_ACC_DEBUG, now deprecated */
-#define H5F_ACC_CREAT (H5CHECK H5OPEN 0x0010u) /*create non-existing files */
-#define H5F_ACC_SWMR_WRITE (H5CHECK 0x0020u) /*indicate that this file is
+#define H5F_ACC_CREAT (H5CHECK H5OPEN 0x0010u) /*create non-existing files */
+#define H5F_ACC_SWMR_WRITE (H5CHECK 0x0020u) /*indicate that this file is
* open for writing in a
* single-writer/multi-reader (SWMR)
* scenario. Note that the
@@ -62,7 +62,7 @@
* with RDONLY access, and use
* the special "SWMR_READ" access
* flag. */
-#define H5F_ACC_SWMR_READ (H5CHECK 0x0040u) /*indicate that this file is
+#define H5F_ACC_SWMR_READ (H5CHECK 0x0040u) /*indicate that this file is
* open for reading in a
* single-writer/multi-reader (SWMR)
* scenario. Note that the
@@ -73,15 +73,15 @@
/* Value passed to H5Pset_elink_acc_flags to cause flags to be taken from the
* parent file. */
-#define H5F_ACC_DEFAULT (H5CHECK H5OPEN 0xffffu) /*ignore setting on lapl */
+#define H5F_ACC_DEFAULT (H5CHECK H5OPEN 0xffffu) /*ignore setting on lapl */
/* Flags for H5Fget_obj_count() & H5Fget_obj_ids() calls */
-#define H5F_OBJ_FILE (0x0001u) /* File objects */
-#define H5F_OBJ_DATASET (0x0002u) /* Dataset objects */
-#define H5F_OBJ_GROUP (0x0004u) /* Group objects */
+#define H5F_OBJ_FILE (0x0001u) /* File objects */
+#define H5F_OBJ_DATASET (0x0002u) /* Dataset objects */
+#define H5F_OBJ_GROUP (0x0004u) /* Group objects */
#define H5F_OBJ_DATATYPE (0x0008u) /* Named datatype objects */
#define H5F_OBJ_ATTR (0x0010u) /* Attribute objects */
-#define H5F_OBJ_ALL (H5F_OBJ_FILE|H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR)
+#define H5F_OBJ_ALL (H5F_OBJ_FILE|H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR)
#define H5F_OBJ_LOCAL (0x0020u) /* Restrict search to objects opened through current file ID */
/* (as opposed to objects opened through any file ID accessing this file) */
@@ -99,20 +99,20 @@
/* The difference between a single file and a set of mounted files */
typedef enum H5F_scope_t {
- H5F_SCOPE_LOCAL = 0, /*specified file handle only */
- H5F_SCOPE_GLOBAL = 1 /*entire virtual file */
+ H5F_SCOPE_LOCAL = 0, /*specified file handle only */
+ H5F_SCOPE_GLOBAL = 1 /*entire virtual file */
} H5F_scope_t;
/* Unlimited file size for H5Pset_external() */
-#define H5F_UNLIMITED ((hsize_t)(-1L))
+#define H5F_UNLIMITED ((hsize_t)(-1L))
/* How does file close behave?
* H5F_CLOSE_DEFAULT - Use the degree pre-defined by underlining VFL
* H5F_CLOSE_WEAK - file closes only after all opened objects are closed
* H5F_CLOSE_SEMI - if no opened objects, file is close; otherwise, file
- close fails
+ close fails
* H5F_CLOSE_STRONG - if there are opened objects, close them first, then
- close file
+ close file
*/
typedef enum H5F_close_degree_t {
H5F_CLOSE_DEFAULT = 0,
@@ -124,19 +124,19 @@ typedef enum H5F_close_degree_t {
/* Current "global" information about file */
typedef struct H5F_info2_t {
struct {
- unsigned version; /* Superblock version # */
- hsize_t super_size; /* Superblock size */
- hsize_t super_ext_size; /* Superblock extension size */
+ unsigned version; /* Superblock version # */
+ hsize_t super_size; /* Superblock size */
+ hsize_t super_ext_size; /* Superblock extension size */
} super;
struct {
- unsigned version; /* Version # of file free space management */
- hsize_t meta_size; /* Free space manager metadata size */
- hsize_t tot_space; /* Amount of free space in the file */
+ unsigned version; /* Version # of file free space management */
+ hsize_t meta_size; /* Free space manager metadata size */
+ hsize_t tot_space; /* Amount of free space in the file */
} free;
struct {
- unsigned version; /* Version # of shared object header info */
- hsize_t hdr_size; /* Shared object header message header size */
- H5_ih_info_t msgs_info; /* Shared object header message index & heap size */
+ unsigned version; /* Version # of shared object header info */
+ hsize_t hdr_size; /* Shared object header message header size */
+ H5_ih_info_t msgs_info; /* Shared object header message index & heap size */
} sohm;
} H5F_info2_t;
@@ -199,16 +199,16 @@ typedef enum H5F_fspace_strategy_t {
typedef enum H5F_file_space_type_t {
H5F_FILE_SPACE_DEFAULT = 0, /* Default (or current) free space strategy setting */
H5F_FILE_SPACE_ALL_PERSIST = 1, /* Persistent free space managers, aggregators, virtual file driver */
- H5F_FILE_SPACE_ALL = 2, /* Non-persistent free space managers, aggregators, virtual file driver */
- /* This is the library default */
+ H5F_FILE_SPACE_ALL = 2, /* Non-persistent free space managers, aggregators, virtual file driver */
+ /* This is the library default */
H5F_FILE_SPACE_AGGR_VFD = 3, /* Aggregators, Virtual file driver */
- H5F_FILE_SPACE_VFD = 4, /* Virtual file driver */
- H5F_FILE_SPACE_NTYPES /* must be last */
+ H5F_FILE_SPACE_VFD = 4, /* Virtual file driver */
+ H5F_FILE_SPACE_NTYPES /* must be last */
} H5F_file_space_type_t;
/* Data structure to report the collection of read retries for metadata items with checksum */
/* Used by public routine H5Fget_metadata_read_retry_info() */
-#define H5F_NUM_METADATA_READ_RETRY_TYPES 21
+#define H5F_NUM_METADATA_READ_RETRY_TYPES 21
typedef struct H5F_retry_info_t {
unsigned nbins;
uint32_t *retries[H5F_NUM_METADATA_READ_RETRY_TYPES];
@@ -217,7 +217,9 @@ typedef struct H5F_retry_info_t {
/* Callback for H5Pset_object_flush_cb() in a file access property list */
typedef herr_t (*H5F_flush_cb_t)(hid_t object_id, void *udata);
-
+/*********************/
+/* Public Prototypes */
+/*********************/
#ifdef __cplusplus
extern "C" {
#endif
@@ -225,9 +227,9 @@ extern "C" {
/* Functions in H5F.c */
H5_DLL htri_t H5Fis_hdf5(const char *filename);
H5_DLL hid_t H5Fcreate(const char *filename, unsigned flags,
- hid_t create_plist, hid_t access_plist);
+ hid_t create_plist, hid_t access_plist);
H5_DLL hid_t H5Fopen(const char *filename, unsigned flags,
- hid_t access_plist);
+ hid_t access_plist);
H5_DLL hid_t H5Freopen(hid_t file_id);
H5_DLL herr_t H5Fflush(hid_t object_id, H5F_scope_t scope);
H5_DLL herr_t H5Fclose(hid_t file_id);
@@ -245,9 +247,9 @@ H5_DLL herr_t H5Fget_eoa(hid_t file_id, haddr_t *eoa);
H5_DLL herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment);
H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void * buf_ptr, size_t buf_len);
H5_DLL herr_t H5Fget_mdc_config(hid_t file_id,
- H5AC_cache_config_t * config_ptr);
+ H5AC_cache_config_t * config_ptr);
H5_DLL herr_t H5Fset_mdc_config(hid_t file_id,
- H5AC_cache_config_t * config_ptr);
+ H5AC_cache_config_t * config_ptr);
H5_DLL herr_t H5Fget_mdc_hit_rate(hid_t file_id, double * hit_rate_ptr);
H5_DLL herr_t H5Fget_mdc_size(hid_t file_id,
size_t * max_size_ptr,
@@ -288,16 +290,16 @@ H5_DLL herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag);
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Macros */
-#define H5F_ACC_DEBUG (H5CHECK H5OPEN 0x0000u) /*print debug info (deprecated)*/
+#define H5F_ACC_DEBUG (H5CHECK H5OPEN 0x0000u) /*print debug info (deprecated)*/
/* Typedefs */
/* Current "global" information about file */
typedef struct H5F_info1_t {
- hsize_t super_ext_size; /* Superblock extension size */
+ hsize_t super_ext_size; /* Superblock extension size */
struct {
- hsize_t hdr_size; /* Shared object header message header size */
- H5_ih_info_t msgs_info; /* Shared object header message index & heap size */
+ hsize_t hdr_size; /* Shared object header message header size */
+ H5_ih_info_t msgs_info; /* Shared object header message index & heap size */
} sohm;
} H5F_info1_t;
diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c
index e0c830b..a066790 100644
--- a/src/H5Fsfile.c
+++ b/src/H5Fsfile.c
@@ -40,11 +40,11 @@ H5F_sfile_node_t *H5F_sfile_head_g = NULL;
/*-------------------------------------------------------------------------
- * Function: H5F_sfile_assert_num
+ * Function: H5F_sfile_assert_num
*
- * Purpose: Sanity checking that shared file list is empty
+ * Purpose: Sanity checking that shared file list is empty
*
- * Return: none (void)
+ * Return: void
*
* Programmer: Quincey Koziol
* Monday, July 25, 2005
@@ -86,21 +86,19 @@ H5F_sfile_assert_num(unsigned n)
/*-------------------------------------------------------------------------
* Function: H5F_sfile_add
*
- * Purpose: Add a "shared" file struct to the list of open files
+ * Purpose: Add a "shared" file struct to the list of open files
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Monday, July 18, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5F_sfile_add(H5F_file_t *shared)
{
- H5F_sfile_node_t *new_shared; /* New shared file node */
+ H5F_sfile_node_t *new_shared; /* New shared file node */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -110,7 +108,7 @@ H5F_sfile_add(H5F_file_t *shared)
/* Allocate new shared file node */
if (NULL == (new_shared = H5FL_CALLOC(H5F_sfile_node_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Set shared file value */
new_shared->shared = shared;
@@ -127,16 +125,14 @@ done:
/*-------------------------------------------------------------------------
* Function: H5F_sfile_search
*
- * Purpose: Search for a "shared" file with low-level file info that
+ * Purpose: Search for a "shared" file with low-level file info that
* matches
*
- * Return: Non-NULL on success / NULL on failure
+ * Return: Non-NULL on success / NULL on failure
*
* Programmer: Quincey Koziol
* Monday, July 18, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5F_file_t *
@@ -154,7 +150,7 @@ H5F_sfile_search(H5FD_t *lf)
curr = H5F_sfile_head_g;
while(curr) {
/* Check for match */
- if(0==H5FD_cmp(curr->shared->lf, lf))
+ if(0 == H5FD_cmp(curr->shared->lf, lf))
HGOTO_DONE(curr->shared)
/* Advance to next shared file node */
@@ -169,15 +165,13 @@ done:
/*-------------------------------------------------------------------------
* Function: H5F_sfile_remove
*
- * Purpose: Remove a "shared" file struct from the list of open files
+ * Purpose: Remove a "shared" file struct from the list of open files
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Monday, July 18, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -203,7 +197,7 @@ H5F_sfile_remove(H5F_file_t *shared)
/* Indicate error if the node wasn't found */
if(curr == NULL)
- HGOTO_ERROR(H5E_FILE, H5E_NOTFOUND, FAIL, "can't find shared file info")
+ HGOTO_ERROR(H5E_FILE, H5E_NOTFOUND, FAIL, "can't find shared file info")
/* Remove node found from list */
if(last != NULL)
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 9339b3d..4999565 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -79,6 +79,15 @@ static const unsigned HDF5_superblock_ver_bounds[] = {
HDF5_SUPERBLOCK_VERSION_LATEST /* H5F_LIBVER_LATEST */
};
+/* Format version bounds for fsinfo message */
+/* This message exists starting library release v1.10 */
+static const unsigned H5O_fsinfo_ver_bounds[] = {
+ H5O_INVALID_VERSION, /* H5F_LIBVER_EARLIEST */
+ H5O_INVALID_VERSION, /* H5F_LIBVER_V18 */
+ H5O_FSINFO_VERSION_1, /* H5F_LIBVER_V110 */
+ H5O_FSINFO_VERSION_LATEST /* H5F_LIBVER_LATEST */
+};
+
/*-------------------------------------------------------------------------
* Function: H5F__super_ext_create
@@ -784,6 +793,14 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get free-space manager info message")
/* Update changed values */
+
+ /* Version bounds check */
+ if(H5O_fsinfo_ver_bounds[H5F_HIGH_BOUND(f)] == H5O_INVALID_VERSION ||
+ fsinfo.version > H5O_fsinfo_ver_bounds[H5F_HIGH_BOUND(f)])
+ HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, FAIL, "File space info message's version out of bounds")
+ if(f->shared->fs_version != fsinfo.version)
+ f->shared->fs_version = fsinfo.version;
+
if(f->shared->fs_strategy != fsinfo.strategy) {
f->shared->fs_strategy = fsinfo.strategy;
@@ -1376,6 +1393,11 @@ H5F__super_init(H5F_t *f)
fsinfo.eoa_pre_fsm_fsalloc = HADDR_UNDEF;
fsinfo.mapped = FALSE;
+ /* Set the version for the fsinfo message */
+ if(H5O__fsinfo_set_version(f, &fsinfo) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set version of fsinfo")
+ f->shared->fs_version = fsinfo.version;
+
for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype))
fsinfo.fs_addr[ptype - 1] = HADDR_UNDEF;
@@ -1800,3 +1822,44 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F__super_ext_remove_msg() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5O__fsinfo_set_version
+ *
+ * Purpose: Set the version to encode the fsinfo message with.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; June 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5O__fsinfo_set_version(H5F_t *f, H5O_fsinfo_t *fsinfo)
+{
+ unsigned version; /* Message version */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(f);
+ HDassert(fsinfo);
+
+ version = H5O_FSINFO_VERSION_1;
+
+ /* Upgrade to the version indicated by the file's low bound if higher */
+ if(H5O_fsinfo_ver_bounds[H5F_LOW_BOUND(f)] != H5O_INVALID_VERSION)
+ version = MAX(version, H5O_fsinfo_ver_bounds[H5F_LOW_BOUND(f)]);
+
+ /* Version bounds check */
+ if(H5O_fsinfo_ver_bounds[H5F_HIGH_BOUND(f)] == H5O_INVALID_VERSION ||
+ version > H5O_fsinfo_ver_bounds[H5F_HIGH_BOUND(f)])
+ HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, FAIL, "File space info message's version out of bounds")
+
+ /* Set the message version */
+ fsinfo->version = version;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5O__fsinfo_set_version() */
diff --git a/src/H5Ftest.c b/src/H5Ftest.c
index bdecad2..4091579 100644
--- a/src/H5Ftest.c
+++ b/src/H5Ftest.c
@@ -26,24 +26,24 @@
/* Module Setup */
/****************/
-#include "H5Fmodule.h" /* This source code file is part of the H5F module */
-#define H5F_TESTING /*suppress warning about H5F testing funcs*/
-#define H5G_FRIEND /*suppress error about including H5Gpkg */
-#define H5G_TESTING /*suppress warning about H5G testing funcs*/
-#define H5SM_FRIEND /*suppress error about including H5SMpkg */
-#define H5SM_TESTING /*suppress warning about H5SM testing funcs*/
+#include "H5Fmodule.h" /* This source code file is part of the H5F module */
+#define H5F_TESTING /* Suppress warning about H5F testing funcs */
+#define H5G_FRIEND /* Suppress error about including H5Gpkg.h */
+#define H5G_TESTING /* Suppress warning about H5G testing funcs */
+#define H5SM_FRIEND /* Suppress error about including H5SMpkg.h */
+#define H5SM_TESTING /* Suppress warning about H5SM testing funcs */
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5CXprivate.h" /* API Contexts */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fpkg.h" /* File access */
-#include "H5Gpkg.h" /* Groups */
-#include "H5Iprivate.h" /* IDs */
-#include "H5SMpkg.h" /* Shared object header messages */
+#include "H5private.h" /* Generic Functions */
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fpkg.h" /* File access */
+#include "H5Gpkg.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
+#include "H5SMpkg.h" /* Shared object header messages */
/****************/
@@ -86,27 +86,25 @@
*
* Purpose: Retrieve the number of shared messages of a given type in a file
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * Jan 3, 2007
+ * Programmer: Quincey Koziol
+ * Jan 3, 2007
*
*-------------------------------------------------------------------------
*/
herr_t
-H5F_get_sohm_mesg_count_test(hid_t file_id, unsigned type_id,
- size_t *mesg_count)
+H5F_get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, size_t *mesg_count)
{
- H5F_t *file; /* File info */
- hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5F_t *file; /* File info */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Check arguments */
if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file")
/* Push API context */
if(H5CX_push() < 0)
@@ -133,8 +131,7 @@ done:
* group's object header, and check that the addresses are
* valid.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Neil Fortner
* Mar 31, 2009
@@ -144,15 +141,15 @@ done:
herr_t
H5F_check_cached_stab_test(hid_t file_id)
{
- H5F_t *file; /* File info */
- hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5F_t *file; /* File info */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Check arguments */
if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file")
/* Push API context */
if(H5CX_push() < 0)
@@ -176,8 +173,7 @@ done:
*
* Purpose: Retrieve the maximum address for a file
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Jun 10, 2009
@@ -187,14 +183,14 @@ done:
herr_t
H5F_get_maxaddr_test(hid_t file_id, haddr_t *maxaddr)
{
- H5F_t *file; /* File info */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5F_t *file; /* File info */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Check arguments */
if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file")
/* Retrieve maxaddr for file */
*maxaddr = file->shared->maxaddr;
@@ -208,10 +204,9 @@ done:
* Function: H5F_get_sbe_addr_test
*
* Purpose: Retrieve the address of a superblock extension's object header
- * for a file
+ * for a file
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Jul 10, 2016
@@ -221,8 +216,8 @@ done:
herr_t
H5F_get_sbe_addr_test(hid_t file_id, haddr_t *sbe_addr)
{
- H5F_t *file; /* File info */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5F_t *file; /* File info */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
diff --git a/src/H5G.c b/src/H5G.c
index cbf3a8e..b831c99 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -14,14 +14,12 @@
/*-------------------------------------------------------------------------
*
* Created: H5G.c
- * Jul 18 1997
- * Robb Matzke <matzke@llnl.gov>
*
* Purpose: Symbol table functions. The functions that begin with
- * `H5G_stab_' don't understand the naming system; they operate
+ * 'H5G_stab_' don't understand the naming system; they operate
* on a single symbol table at a time.
*
- * The functions that begin with `H5G_node_' operate on the leaf
+ * The functions that begin with 'H5G_node_' operate on the leaf
* nodes of a symbol table B-tree. They should be defined in
* the H5Gnode.c file.
*
@@ -42,11 +40,11 @@
* +--------------+----------- +--------------------------------+
* | Location ID | Name | Meaning |
* +--------------+------------+--------------------------------+
- * | File ID | "/foo/bar" | Find `foo' within `bar' within |
+ * | File ID | "/foo/bar" | Find 'foo' within 'bar' within |
* | | | the root group of the specified|
* | | | file. |
* +--------------+------------+--------------------------------+
- * | File ID | "foo/bar" | Find `foo' within `bar' within |
+ * | File ID | "foo/bar" | Find 'foo' within 'bar' within |
* | | | the root group of the specified|
* | | | file. |
* +--------------+------------+--------------------------------+
@@ -56,11 +54,11 @@
* | File ID | "." | The root group of the specified|
* | | | the specified file. |
* +--------------+------------+--------------------------------+
- * | Group ID | "/foo/bar" | Find `foo' within `bar' within |
+ * | Group ID | "/foo/bar" | Find 'foo' within 'bar' within |
* | | | the root group of the file |
* | | | containing the specified group.|
* +--------------+------------+--------------------------------+
- * | Group ID | "foo/bar" | File `foo' within `bar' within |
+ * | Group ID | "foo/bar" | File 'foo' within 'bar' within |
* | | | the specified group. |
* +--------------+------------+--------------------------------+
* | Group ID | "/" | The root group of the file |
@@ -83,13 +81,13 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5CXprivate.h" /* API Contexts */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Gpkg.h" /* Groups */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Pprivate.h" /* Property lists */
+#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Gpkg.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Pprivate.h" /* Property lists */
/****************/
@@ -131,10 +129,10 @@ hbool_t H5_PKG_INIT_VAR = FALSE;
/* Group ID class */
static const H5I_class_t H5I_GROUP_CLS[1] = {{
- H5I_GROUP, /* ID class value */
- 0, /* Class flags */
- 0, /* # of reserved IDs for class */
- (H5I_free_t)H5G__close_cb /* Callback routine for closing objects of this class */
+ H5I_GROUP, /* ID class value */
+ 0, /* Class flags */
+ 0, /* # of reserved IDs for class */
+ (H5I_free_t)H5G__close_cb /* Callback routine for closing objects of this class */
}};
/* Flag indicating "top" of interface has been initialized */
@@ -258,9 +256,9 @@ H5G_term_package(void)
/*-------------------------------------------------------------------------
- * Function: H5Gcreate2
+ * Function: H5Gcreate2
*
- * Purpose: Creates a new group relative to LOC_ID, giving it the
+ * Purpose: Creates a new group relative to LOC_ID, giving it the
* specified creation property list GCPL_ID and access
* property list GAPL_ID. The link to the new group is
* created with the LCPL_ID.
@@ -272,14 +270,11 @@ H5G_term_package(void)
* hid_t gcpl_id; IN: Property list for group creation
* hid_t gapl_id; IN: Property list for group access
*
- * Return: Success: The object ID of a new, empty group open for
- * writing. Call H5Gclose() when finished with
- * the group.
+ * Return: Success: The object ID of a new, empty group open for
+ * writing. Call H5Gclose() when finished with
+ * the group.
*
- * Failure: H5I_INVALID_HID
- *
- * Programmer: Quincey Koziol
- * April 5, 2007
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
@@ -314,6 +309,9 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id,
if(TRUE != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not group create property list")
+ /* Set the LCPL for the API context */
+ H5CX_set_lcpl(lcpl_id);
+
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info")
@@ -334,9 +332,9 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Gcreate_anon
+ * Function: H5Gcreate_anon
*
- * Purpose: Creates a new group relative to LOC_ID, giving it the
+ * Purpose: Creates a new group relative to LOC_ID, giving it the
* specified creation property list GCPL_ID and access
* property list GAPL_ID.
*
@@ -352,19 +350,16 @@ done:
* hid_t gcpl_id; IN: Property list for group creation
* hid_t gapl_id; IN: Property list for group access
*
- * Example: To create missing groups "A" and "B01" along the given path "/A/B01/grp"
+ * Example: To create missing groups "A" and "B01" along the given path "/A/B01/grp"
* hid_t create_id = H5Pcreate(H5P_GROUP_CREATE);
* int status = H5Pset_create_intermediate_group(create_id, TRUE);
* hid_t gid = H5Gcreate_anon(file_id, "/A/B01/grp", create_id, H5P_DEFAULT);
*
- * Return: Success: The object ID of a new, empty group open for
- * writing. Call H5Gclose() when finished with
- * the group.
+ * Return: Success: The object ID of a new, empty group open for
+ * writing. Call H5Gclose() when finished with
+ * the group.
*
- * Failure: H5I_INVALID_HID
- *
- * Programmer: Peter Cao
- * May 08, 2005
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
@@ -429,19 +424,17 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Gopen2
+ * Function: H5Gopen2
*
- * Purpose: Opens an existing group for modification. When finished,
- * call H5Gclose() to close it and release resources.
+ * Purpose: Opens an existing group for modification. When finished,
+ * call H5Gclose() to close it and release resources.
*
* This function allows the user the pass in a Group Access
* Property List, which H5Gopen1() does not.
*
- * Return: Success: Object ID of the group.
- * Failure: H5I_INVALID_HID
+ * Return: Success: Object ID of the group
*
- * Programmer: James Laird
- * Thursday, July 27, 2006
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
@@ -483,18 +476,15 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Gget_create_plist
+ * Function: H5Gget_create_plist
*
- * Purpose: Returns a copy of the group creation property list.
+ * Purpose: Returns a copy of the group creation property list.
*
- * Return: Success: ID for a copy of the group creation
- * property list. The property list ID should be
- * released by calling H5Pclose().
+ * Return: Success: ID for a copy of the group creation
+ * property list. The property list ID should be
+ * released by calling H5Pclose().
*
- * Failure: H5I_INVALID_HID
- *
- * Programmer: Quincey Koziol
- * Tuesday, October 25, 2005
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
@@ -521,15 +511,11 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Gget_info
- *
- * Purpose: Retrieve information about a group.
+ * Function: H5Gget_info
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Purpose: Retrieve information about a group.
*
- * Programmer: Quincey Koziol
- * November 27 2006
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -564,15 +550,12 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Gget_info_by_name
+ * Function: H5Gget_info_by_name
*
- * Purpose: Retrieve information about a group.
+ * Purpose: Retrieve information about a group, where the group is
+ * identified by name instead of ID.
*
- * Return: Success: Non-negative
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * November 27 2006
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -608,16 +591,12 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Gget_info_by_idx
+ * Function: H5Gget_info_by_idx
*
- * Purpose: Retrieve information about a group, according to the order
+ * Purpose: Retrieve information about a group, according to the order
* of an index.
*
- * Return: Success: Non-negative
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * November 27 2006
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -658,15 +637,12 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Gclose
+ * Function: H5Gclose
*
- * Purpose: Closes the specified group. The group ID will no longer be
- * valid for accessing the group.
+ * Purpose: Closes the specified group. The group ID will no longer be
+ * valid for accessing the group.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Wednesday, December 31, 1997
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -679,11 +655,10 @@ H5Gclose(hid_t group_id)
H5TRACE1("e", "i", group_id);
/* Check args */
- if(NULL == H5I_object_verify(group_id,H5I_GROUP))
+ if(NULL == H5I_object_verify(group_id, H5I_GROUP))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
- /*
- * Decrement the counter on the group atom. It will be freed if the count
+ /* Decrement the counter on the group atom. It will be freed if the count
* reaches zero.
*/
if(H5I_dec_app_ref(group_id) < 0)
diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c
index aae5496..6d66274 100644
--- a/src/H5Gcompact.c
+++ b/src/H5Gcompact.c
@@ -68,10 +68,10 @@ static herr_t H5G__compact_build_table(const H5O_loc_t *oloc,
/*-------------------------------------------------------------------------
* Function: H5G_compact_build_table_cb
*
- * Purpose: Callback routine for searching 'link' messages for a particular
+ * Purpose: Callback routine for searching 'link' messages for a particular
* name.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* koziol@ncsa.uiuc.edu
@@ -434,10 +434,10 @@ done:
/*-------------------------------------------------------------------------
* Function: H5G_compact_lookup_cb
*
- * Purpose: Callback routine for searching 'link' messages for a particular
+ * Purpose: Callback routine for searching 'link' messages for a particular
* name & gettting object location for it
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* koziol@ncsa.uiuc.edu
diff --git a/src/H5Gdense.c b/src/H5Gdense.c
index 326561a..d2bcad1 100644
--- a/src/H5Gdense.c
+++ b/src/H5Gdense.c
@@ -416,7 +416,7 @@ HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDst
/* Create serialized form of link */
if(H5O_msg_encode(f, H5O_LINK_ID, FALSE, (unsigned char *)link_ptr, lnk) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't encode link")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't encode link")
/* Open the fractal heap */
if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr)))
@@ -966,8 +966,7 @@ done:
*/
herr_t
H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op,
- void *op_data)
+ H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data)
{
H5HF_t *fheap = NULL; /* Fractal heap handle */
H5G_link_table_t ltable = {0, NULL}; /* Table of links */
diff --git a/src/H5Gint.c b/src/H5Gint.c
index 8fd7514..c46681b 100644
--- a/src/H5Gint.c
+++ b/src/H5Gint.c
@@ -32,13 +32,13 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FOprivate.h" /* File objects */
-#include "H5Gpkg.h" /* Groups */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Lprivate.h" /* Links */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FOprivate.h" /* File objects */
+#include "H5Gpkg.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Lprivate.h" /* Links */
+#include "H5MMprivate.h" /* Memory management */
/****************/
@@ -805,12 +805,11 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_iterate
+ * Function: H5G_iterate
*
* Purpose: Private function for iterating over links in a group
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Oct 3, 2005
@@ -823,10 +822,10 @@ H5G_iterate(hid_t loc_id, const char *group_name,
const H5G_link_iterate_t *lnk_op, void *op_data)
{
H5G_loc_t loc; /* Location of parent for group */
- hid_t gid = -1; /* ID of group to iterate over */
- H5G_t *grp = NULL; /* Pointer to group data structure to iterate over */
- H5G_iter_appcall_ud_t udata; /* User data for callback */
- herr_t ret_value = FAIL; /* Return value */
+ hid_t gid = H5I_INVALID_HID; /* ID of group to iterate over */
+ H5G_t *grp = NULL; /* Pointer to group data structure to iterate over */
+ H5G_iter_appcall_ud_t udata; /* User data for callback */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -835,8 +834,7 @@ H5G_iterate(hid_t loc_id, const char *group_name,
HDassert(last_lnk);
HDassert(lnk_op && lnk_op->op_func.op_new);
- /*
- * Open the group on which to operate. We also create a group ID which
+ /* Open the group on which to operate. We also create a group ID which
* we can pass to the application-defined operator.
*/
if(H5G_loc(loc_id, &loc) < 0)
@@ -860,7 +858,7 @@ done:
if(gid > 0) {
if(H5I_dec_app_ref(gid) < 0)
HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group")
- } /* end if */
+ }
else if(grp && H5G_close(grp) < 0)
HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group")
@@ -1054,9 +1052,9 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_visit
+ * Function: H5G_visit
*
- * Purpose: Recursively visit all the links in a group and all
+ * Purpose: Recursively visit all the links in a group and all
* the groups that are linked to from that group. Links within
* each group are visited according to the order within the
* specified index (unless the specified index does not exist for
@@ -1068,18 +1066,13 @@ done:
* callback with more than one link that points to a particular
* _object_.
*
- * Return: Success: The return value of the first operator that
- * returns non-zero, or zero if all members were
- * processed with no operator returning non-zero.
- *
- * Failure: Negative if something goes wrong within the
- * library, or the negative value returned by one
- * of the operators.
+ * Return: Success: The return value of the first operator that
+ * returns non-zero, or zero if all members were
+ * processed with no operator returning non-zero.
*
- *
- *
- * Programmer: Quincey Koziol
- * November 4 2007
+ * Failure: Negative if something goes wrong within the
+ * library, or the negative value returned by one
+ * of the operators.
*
*-------------------------------------------------------------------------
*/
@@ -1090,7 +1083,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type,
H5G_iter_visit_ud_t udata; /* User data for callback */
H5O_linfo_t linfo; /* Link info message */
htri_t linfo_exists; /* Whether the link info message exists */
- hid_t gid = (-1); /* Group ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
H5G_t *grp = NULL; /* Group opened */
H5G_loc_t loc; /* Location of group passed in */
H5G_loc_t start_loc; /* Location of starting group */
@@ -1193,7 +1186,7 @@ done:
if(gid > 0) {
if(H5I_dec_app_ref(gid) < 0)
HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group")
- } /* end if */
+ }
else if(grp && H5G_close(grp) < 0)
HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group")
@@ -1260,7 +1253,7 @@ H5G_get_create_plist(const H5G_t *grp)
/* Check for the group having a link info message */
if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to read object header")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to read object header")
if(linfo_exists) {
/* Set the link info for the property list */
if(H5P_set(new_plist, H5G_CRT_LINK_INFO_NAME, &linfo) < 0)
diff --git a/src/H5Glink.c b/src/H5Glink.c
index 509e511..1f4edd5 100644
--- a/src/H5Glink.c
+++ b/src/H5Glink.c
@@ -402,15 +402,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G__link_sort_table
+ * Function: H5G__link_sort_table
*
* Purpose: Sort table containing a list of links for a group
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * Nov 20, 2006
+ * Programmer: Quincey Koziol
+ * Nov 20, 2006
*
*-------------------------------------------------------------------------
*/
@@ -568,7 +567,7 @@ H5G__link_name_replace(H5F_t *file, H5RS_str_t *grp_full_path_r, const H5O_link_
obj_path_r = H5G_build_fullpath_refstr_str(grp_full_path_r, lnk->name);
if(H5G_name_replace(lnk, H5G_NAME_DELETE, file, obj_path_r, NULL, NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to replace name")
- } /* end if */
+ }
done:
if(obj_path_r)
diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h
index ab6f200..170b74d 100644
--- a/src/H5Gpublic.h
+++ b/src/H5Gpublic.h
@@ -37,10 +37,6 @@
/* Public Macros */
/*****************/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/*******************/
/* Public Typedefs */
/*******************/
@@ -62,6 +58,7 @@ typedef struct H5G_info_t {
hbool_t mounted; /* Whether group has a file mounted on it */
} H5G_info_t;
+
/********************/
/* Public Variables */
/********************/
@@ -70,6 +67,10 @@ typedef struct H5G_info_t {
/*********************/
/* Public Prototypes */
/*********************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
H5_DLL hid_t H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id,
hid_t gcpl_id, hid_t gapl_id);
H5_DLL hid_t H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id);
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index 64c4054..8e0fec3 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -225,14 +225,14 @@ H5G__stab_create(H5O_loc_t *grp_oloc, const H5O_ginfo_t *ginfo, H5O_stab_t *stab
/* Go create the B-tree & local heap */
if(H5G__stab_create_components(grp_oloc->file, stab, size_hint) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create symbol table components")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create symbol table components")
/*
* Insert the symbol table message into the object header and the symbol
* table entry.
*/
if(H5O_msg_create(grp_oloc, H5O_STAB_ID, 0, H5O_UPDATE_TIME, stab) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message")
done:
FUNC_LEAVE_NOAPI_TAG(ret_value)
@@ -534,7 +534,7 @@ H5G__stab_iterate(const H5O_loc_t *oloc, H5_iter_order_t order,
/* Get the B-tree info */
if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab))
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address")
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address")
/* Pin the heap down in memory */
if(NULL == (heap = H5HL_protect(oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG)))
@@ -626,7 +626,7 @@ H5G__stab_count(const H5O_loc_t *oloc, hsize_t *num_objs)
/* Get the B-tree info */
if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab))
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address")
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address")
/* Iterate over the group members */
if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_sumup, num_objs) < 0)
@@ -757,7 +757,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t
/* Get the B-tree & local heap info */
if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab))
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address")
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address")
/* Pin the heap down in memory */
if(NULL == (heap = H5HL_protect(oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG)))
@@ -785,11 +785,11 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t
/* Iterate over the group members */
if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed")
/* If we don't know the name now, we almost certainly went out of bounds */
if(udata.name == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "index out of bound")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "index out of bound")
/* Get the length of the name */
ret_value = (ssize_t)HDstrlen(udata.name);
@@ -979,7 +979,7 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_
/* Get the B-tree & local heap info */
if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab))
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address")
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address")
/* Pin the heap down in memory */
if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG)))
@@ -1007,11 +1007,11 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_
/* Iterate over the group members */
if(H5B_iterate(grp_oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed")
/* If we didn't find the link, we almost certainly went out of bounds */
if(!udata.found)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "index out of bound")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "index out of bound")
done:
/* Release resources */
diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c
index 70dfeed..22de0c4 100644
--- a/src/H5HFdbg.c
+++ b/src/H5HFdbg.c
@@ -395,7 +395,7 @@ H5HF_hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth)
/* Load the fractal heap header */
if(NULL == (hdr = H5HF__hdr_protect(f, addr, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header")
/* Print the information about the heap's header */
H5HF_hdr_print(hdr, FALSE, stream, indent, fwidth);
@@ -483,7 +483,7 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata)
/* Flag overlaps */
if (overlap)
- fprintf(udata->stream, "***THAT FREE BLOCK OVERLAPPED A PREVIOUS ONE!\n");
+ HDfprintf(udata->stream, "***THAT FREE BLOCK OVERLAPPED A PREVIOUS ONE!\n");
else
udata->amount_free += len;
} /* end if */
@@ -531,13 +531,13 @@ H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
/* Load the fractal heap header */
if(NULL == (hdr = H5HF__hdr_protect(f, hdr_addr, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header")
/*
* Load the heap direct block
*/
if(NULL == (dblock = H5HF__man_dblock_protect(hdr, addr, block_size, NULL, 0, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap direct block")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap direct block")
/* Print opening message */
HDfprintf(stream, "%*sFractal Heap Direct Block...\n", indent, "");
@@ -788,13 +788,13 @@ H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
/* Load the fractal heap header */
if(NULL == (hdr = H5HF__hdr_protect(f, hdr_addr, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header")
/*
* Load the heap indirect block
*/
if(NULL == (iblock = H5HF__man_iblock_protect(hdr, addr, nrows, NULL, 0, FALSE, H5AC__READ_ONLY_FLAG, &did_protect)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block")
/* Print the information about the heap's indirect block */
H5HF_iblock_print(iblock, FALSE, stream, indent, fwidth);
@@ -878,8 +878,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_sects_debug(H5F_t *f, haddr_t fh_addr, FILE *stream, int indent,
- int fwidth)
+H5HF_sects_debug(H5F_t *f, haddr_t fh_addr, FILE *stream, int indent, int fwidth)
{
H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */
herr_t ret_value = SUCCEED; /* Return value */
@@ -897,7 +896,7 @@ H5HF_sects_debug(H5F_t *f, haddr_t fh_addr, FILE *stream, int indent,
/* Load the fractal heap header */
if(NULL == (hdr = H5HF__hdr_protect(f, fh_addr, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header")
/* Initialize the free space information for the heap */
if(H5HF__space_start(hdr, FALSE) < 0)
diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c
index e5c2559..20a62b7 100644
--- a/src/H5HFiblock.c
+++ b/src/H5HFiblock.c
@@ -256,52 +256,52 @@ H5HF__iblock_decr(H5HF_indirect_t *iblock)
/* Check for last reference to block */
if(iblock->rc == 0) {
- /* If this indirect block has a parent, reset it's child iblock pointer */
- if(iblock->parent) {
- H5HF_indirect_t *par_iblock = iblock->parent; /* Parent indirect block */
- unsigned indir_idx; /* Index in parent's child iblock pointer array */
-
- /* Sanity check */
- HDassert(par_iblock->child_iblocks);
- HDassert(iblock->par_entry >= (iblock->hdr->man_dtable.max_direct_rows
- * iblock->hdr->man_dtable.cparam.width));
-
- /* Compute index in parent's child iblock pointer array */
- indir_idx = iblock->par_entry - (iblock->hdr->man_dtable.max_direct_rows
- * iblock->hdr->man_dtable.cparam.width);
-
- /* Reset pointer to pinned child indirect block in parent */
- HDassert(par_iblock->child_iblocks[indir_idx]);
- par_iblock->child_iblocks[indir_idx] = NULL;
- } /* end if */
- else {
- /* Check for root indirect block */
- if(iblock->block_off == 0) {
- /* Sanity check - shouldn't be recursively unpinning root indirect block */
- HDassert(iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED);
-
- /* Check if we should reset the root iblock pointer */
- if(H5HF_ROOT_IBLOCK_PINNED == iblock->hdr->root_iblock_flags) {
- HDassert(NULL != iblock->hdr->root_iblock);
- iblock->hdr->root_iblock = NULL;
- } /* end if */
-
- /* Indicate that the root indirect block is unpinned */
- iblock->hdr->root_iblock_flags &= (unsigned)(~(H5HF_ROOT_IBLOCK_PINNED));
- } /* end if */
- } /* end else */
-
- /* Check if the block is still in the cache */
- if(!iblock->removed_from_cache) {
- /* Unpin the indirect block, making it evictable again */
- if(H5HF__iblock_unpin(iblock) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap indirect block")
- } /* end if */
- else {
- /* Destroy the indirect block */
- if(H5HF_man_iblock_dest(iblock) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block")
- } /* end else */
+ /* If this indirect block has a parent, reset it's child iblock pointer */
+ if(iblock->parent) {
+ H5HF_indirect_t *par_iblock = iblock->parent; /* Parent indirect block */
+ unsigned indir_idx; /* Index in parent's child iblock pointer array */
+
+ /* Sanity check */
+ HDassert(par_iblock->child_iblocks);
+ HDassert(iblock->par_entry >= (iblock->hdr->man_dtable.max_direct_rows
+ * iblock->hdr->man_dtable.cparam.width));
+
+ /* Compute index in parent's child iblock pointer array */
+ indir_idx = iblock->par_entry - (iblock->hdr->man_dtable.max_direct_rows
+ * iblock->hdr->man_dtable.cparam.width);
+
+ /* Reset pointer to pinned child indirect block in parent */
+ HDassert(par_iblock->child_iblocks[indir_idx]);
+ par_iblock->child_iblocks[indir_idx] = NULL;
+ } /* end if */
+ else {
+ /* Check for root indirect block */
+ if(iblock->block_off == 0) {
+ /* Sanity check - shouldn't be recursively unpinning root indirect block */
+ HDassert(iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED);
+
+ /* Check if we should reset the root iblock pointer */
+ if(H5HF_ROOT_IBLOCK_PINNED == iblock->hdr->root_iblock_flags) {
+ HDassert(NULL != iblock->hdr->root_iblock);
+ iblock->hdr->root_iblock = NULL;
+ } /* end if */
+
+ /* Indicate that the root indirect block is unpinned */
+ iblock->hdr->root_iblock_flags &= (unsigned)(~(H5HF_ROOT_IBLOCK_PINNED));
+ } /* end if */
+ } /* end else */
+
+ /* Check if the block is still in the cache */
+ if(!iblock->removed_from_cache) {
+ /* Unpin the indirect block, making it evictable again */
+ if(H5HF__iblock_unpin(iblock) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap indirect block")
+ } /* end if */
+ else {
+ /* Destroy the indirect block */
+ if(H5HF_man_iblock_dest(iblock) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block")
+ } /* end else */
} /* end if */
done:
@@ -408,13 +408,13 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size)
dblock->parent = iblock;
dblock->par_entry = 0;
- /* Destroy flush dependency between direct block and header */
- if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0)
+ /* Destroy flush dependency between direct block and header */
+ if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency")
dblock->fd_parent = NULL;
- /* Create flush dependency between direct block and new root indirect block */
- if(H5AC_create_flush_dependency(iblock, dblock) < 0)
+ /* Create flush dependency between direct block and new root indirect block */
+ if(H5AC_create_flush_dependency(iblock, dblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency")
dblock->fd_parent = iblock;
@@ -1059,14 +1059,14 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock,
iblock->block_off += hdr->man_dtable.row_block_off[par_entry / hdr->man_dtable.cparam.width];
iblock->block_off += hdr->man_dtable.row_block_size[par_entry / hdr->man_dtable.cparam.width] * (par_entry % hdr->man_dtable.cparam.width);
- /* Set indirect block parent as flush dependency parent */
- iblock->fd_parent = par_iblock;
+ /* Set indirect block parent as flush dependency parent */
+ iblock->fd_parent = par_iblock;
} /* end if */
else {
iblock->block_off = 0; /* Must be the root indirect block... */
- /* Set heap header as flush dependency parent */
- iblock->fd_parent = hdr;
+ /* Set heap header as flush dependency parent */
+ iblock->fd_parent = hdr;
} /* end else */
/* Update indirect block's statistics */
@@ -1430,69 +1430,69 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry)
if(H5HF__man_iblock_root_revert(iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't convert root indirect block back to root direct block")
- /* If the indirect block wasn't removed already (by reverting it) */
- if(!iblock->removed_from_cache) {
- /* Check for reducing size of root indirect block */
- if(iblock->nchildren > 0 && hdr->man_dtable.cparam.start_root_rows != 0
- && entry > iblock->max_child) {
- unsigned max_child_row; /* Row for max. child entry */
-
- /* Compute information needed for determining whether to reduce size of root indirect block */
- max_child_row = iblock->max_child / hdr->man_dtable.cparam.width;
-
- /* Check if the root indirect block should be reduced */
- if(iblock->nrows > 1 && max_child_row <= (iblock->nrows / 2))
- if(H5HF__man_iblock_root_halve(iblock) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce size of root indirect block")
- } /* end if */
- } /* end if */
+ /* If the indirect block wasn't removed already (by reverting it) */
+ if(!iblock->removed_from_cache) {
+ /* Check for reducing size of root indirect block */
+ if(iblock->nchildren > 0 && hdr->man_dtable.cparam.start_root_rows != 0
+ && entry > iblock->max_child) {
+ unsigned max_child_row; /* Row for max. child entry */
+
+ /* Compute information needed for determining whether to reduce size of root indirect block */
+ max_child_row = iblock->max_child / hdr->man_dtable.cparam.width;
+
+ /* Check if the root indirect block should be reduced */
+ if(iblock->nrows > 1 && max_child_row <= (iblock->nrows / 2))
+ if(H5HF__man_iblock_root_halve(iblock) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce size of root indirect block")
+ } /* end if */
+ } /* end if */
} /* end if */
/* If the indirect block wasn't removed already (by reverting it) */
if(!iblock->removed_from_cache) {
- /* Mark indirect block as modified */
- if(H5HF_iblock_dirty(iblock) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty")
-
- /* Check for last child being removed from indirect block */
- if(iblock->nchildren == 0) {
- hbool_t did_protect = FALSE; /* Whether the indirect block was protected */
-
- /* If this indirect block's refcount is >1, then it's being deleted
- * from the fractal heap (since its nchildren == 0), but is still
- * referred to from free space sections in the heap (refcount >1).
- * Its space in the file needs to be freed now, and it also needs
- * to be removed from the metadata cache now, in case the space in
- * the file is reused by another piece of metadata that is inserted
- * into the cache before the indirect block's entry is evicted
- * (having two entries at the same address would be an error, from
- * the cache's perspective).
- */
- /* Lock indirect block for deletion */
- if(NULL == (del_iblock = H5HF__man_iblock_protect(hdr, iblock->addr, iblock->nrows, iblock->parent, iblock->par_entry, TRUE, H5AC__NO_FLAGS_SET, &did_protect)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block")
- HDassert(did_protect == TRUE);
-
- /* Check for deleting root indirect block (and no root direct block) */
- if(iblock->block_off == 0 && hdr->man_dtable.curr_root_rows > 0)
- /* Reset header information back to "empty heap" state */
- if(H5HF__hdr_empty(hdr) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't make heap empty")
-
- /* Detach from parent indirect block */
- if(iblock->parent) {
- /* Destroy flush dependency between indirect block and parent */
- if(H5AC_destroy_flush_dependency(iblock->fd_parent, iblock) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency")
- iblock->fd_parent = NULL;
-
- /* Detach from parent indirect block */
- if(H5HF__man_iblock_detach(iblock->parent, iblock->par_entry) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't detach from parent indirect block")
- iblock->parent = NULL;
- iblock->par_entry = 0;
- } /* end if */
- } /* end if */
+ /* Mark indirect block as modified */
+ if(H5HF_iblock_dirty(iblock) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty")
+
+ /* Check for last child being removed from indirect block */
+ if(iblock->nchildren == 0) {
+ hbool_t did_protect = FALSE; /* Whether the indirect block was protected */
+
+ /* If this indirect block's refcount is >1, then it's being deleted
+ * from the fractal heap (since its nchildren == 0), but is still
+ * referred to from free space sections in the heap (refcount >1).
+ * Its space in the file needs to be freed now, and it also needs
+ * to be removed from the metadata cache now, in case the space in
+ * the file is reused by another piece of metadata that is inserted
+ * into the cache before the indirect block's entry is evicted
+ * (having two entries at the same address would be an error, from
+ * the cache's perspective).
+ */
+ /* Lock indirect block for deletion */
+ if(NULL == (del_iblock = H5HF__man_iblock_protect(hdr, iblock->addr, iblock->nrows, iblock->parent, iblock->par_entry, TRUE, H5AC__NO_FLAGS_SET, &did_protect)))
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block")
+ HDassert(did_protect == TRUE);
+
+ /* Check for deleting root indirect block (and no root direct block) */
+ if(iblock->block_off == 0 && hdr->man_dtable.curr_root_rows > 0)
+ /* Reset header information back to "empty heap" state */
+ if(H5HF__hdr_empty(hdr) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't make heap empty")
+
+ /* Detach from parent indirect block */
+ if(iblock->parent) {
+ /* Destroy flush dependency between indirect block and parent */
+ if(H5AC_destroy_flush_dependency(iblock->fd_parent, iblock) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency")
+ iblock->fd_parent = NULL;
+
+ /* Detach from parent indirect block */
+ if(H5HF__man_iblock_detach(iblock->parent, iblock->par_entry) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't detach from parent indirect block")
+ iblock->parent = NULL;
+ iblock->par_entry = 0;
+ } /* end if */
+ } /* end if */
} /* end if */
/* Decrement the reference count on this indirect block if we're not deleting it */
@@ -1501,48 +1501,48 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry)
* not being deleted)
*/
if(H5HF__iblock_decr(iblock) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block")
iblock = NULL;
/* Delete indirect block from cache, if appropriate */
if(del_iblock) {
- unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotect */
- hbool_t took_ownership = FALSE; /* Flag to indicate that block ownership has transitioned */
-
- /* If the refcount is still >0, unpin the block and take ownership
- * from the cache, otherwise let the cache destroy it.
- */
- if(del_iblock->rc > 0) {
- cache_flags |= (H5AC__DELETED_FLAG | H5AC__TAKE_OWNERSHIP_FLAG);
- cache_flags |= H5AC__UNPIN_ENTRY_FLAG;
- took_ownership = TRUE;
- } /* end if */
- else {
- /* Entry should be removed from the cache */
- cache_flags |= H5AC__DELETED_FLAG;
-
- /* If the indirect block is in real file space, tell
- * the cache to free its file space as well.
- */
- if(!H5F_IS_TMP_ADDR(hdr->f, del_iblock->addr))
- cache_flags |= H5AC__FREE_FILE_SPACE_FLAG;
- } /* end else */
-
- /* Unprotect the indirect block, with appropriate flags */
- if(H5HF__man_iblock_unprotect(del_iblock, cache_flags, TRUE) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block")
-
- /* if took ownership, free file space & mark block as removed from cache */
- if(took_ownership) {
- /* Free indirect block disk space, if it's in real space */
- if(!H5F_IS_TMP_ADDR(hdr->f, del_iblock->addr))
- if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, del_iblock->addr, (hsize_t)del_iblock->size) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block file space")
- del_iblock->addr = HADDR_UNDEF;
-
- /* Mark block as removed from the cache */
- del_iblock->removed_from_cache = TRUE;
- } /* end if */
+ unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotect */
+ hbool_t took_ownership = FALSE; /* Flag to indicate that block ownership has transitioned */
+
+ /* If the refcount is still >0, unpin the block and take ownership
+ * from the cache, otherwise let the cache destroy it.
+ */
+ if(del_iblock->rc > 0) {
+ cache_flags |= (H5AC__DELETED_FLAG | H5AC__TAKE_OWNERSHIP_FLAG);
+ cache_flags |= H5AC__UNPIN_ENTRY_FLAG;
+ took_ownership = TRUE;
+ } /* end if */
+ else {
+ /* Entry should be removed from the cache */
+ cache_flags |= H5AC__DELETED_FLAG;
+
+ /* If the indirect block is in real file space, tell
+ * the cache to free its file space as well.
+ */
+ if(!H5F_IS_TMP_ADDR(hdr->f, del_iblock->addr))
+ cache_flags |= H5AC__FREE_FILE_SPACE_FLAG;
+ } /* end else */
+
+ /* Unprotect the indirect block, with appropriate flags */
+ if(H5HF__man_iblock_unprotect(del_iblock, cache_flags, TRUE) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block")
+
+ /* if took ownership, free file space & mark block as removed from cache */
+ if(took_ownership) {
+ /* Free indirect block disk space, if it's in real space */
+ if(!H5F_IS_TMP_ADDR(hdr->f, del_iblock->addr))
+ if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, del_iblock->addr, (hsize_t)del_iblock->size) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block file space")
+ del_iblock->addr = HADDR_UNDEF;
+
+ /* Mark block as removed from the cache */
+ del_iblock->removed_from_cache = TRUE;
+ } /* end if */
} /* end if */
done:
@@ -1633,24 +1633,24 @@ H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr,
if(H5F_addr_defined(iblock->ents[entry].addr)) {
/* Are we in a direct or indirect block row */
if(row < hdr->man_dtable.max_direct_rows) {
- hsize_t dblock_size; /* Size of direct block on disk */
+ hsize_t dblock_size; /* Size of direct block on disk */
- /* Check for I/O filters on this heap */
- if(hdr->filter_len > 0)
- dblock_size = iblock->filt_ents[entry].size;
- else
- dblock_size = hdr->man_dtable.row_block_size[row];
+ /* Check for I/O filters on this heap */
+ if(hdr->filter_len > 0)
+ dblock_size = iblock->filt_ents[entry].size;
+ else
+ dblock_size = hdr->man_dtable.row_block_size[row];
/* Delete child direct block */
if(H5HF__man_dblock_delete(hdr->f, iblock->ents[entry].addr, dblock_size) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap child direct block")
} /* end if */
else {
- hsize_t row_block_size; /* The size of blocks in this row */
+ hsize_t row_block_size; /* The size of blocks in this row */
unsigned child_nrows; /* Number of rows in new indirect block */
- /* Get the row's block size */
- row_block_size = (hsize_t)hdr->man_dtable.row_block_size[row];
+ /* Get the row's block size */
+ row_block_size = (hsize_t)hdr->man_dtable.row_block_size[row];
/* Compute # of rows in next child indirect block to use */
child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, row_block_size);
@@ -1733,30 +1733,30 @@ H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr,
/* Indirect entries in this indirect block */
if(iblock->nrows > hdr->man_dtable.max_direct_rows) {
- unsigned first_row_bits; /* Number of bits used bit addresses in first row */
+ unsigned first_row_bits; /* Number of bits used bit addresses in first row */
unsigned num_indirect_rows; /* Number of rows of blocks in each indirect block */
unsigned entry; /* Current entry in row */
size_t u; /* Local index variable */
entry = hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width;
- first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) +
- H5VM_log2_of2(hdr->man_dtable.cparam.width);
+ first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) +
+ H5VM_log2_of2(hdr->man_dtable.cparam.width);
num_indirect_rows =
- (H5VM_log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1;
+ (H5VM_log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1;
for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++, num_indirect_rows++) {
size_t v; /* Local index variable */
- for(v = 0; v < hdr->man_dtable.cparam.width; v++, entry++)
- if(H5F_addr_defined(iblock->ents[entry].addr))
- if(H5HF__man_iblock_size(f, hdr, iblock->ents[entry].addr, num_indirect_rows, iblock, entry, heap_size) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to get fractal heap storage info for indirect block")
+ for(v = 0; v < hdr->man_dtable.cparam.width; v++, entry++)
+ if(H5F_addr_defined(iblock->ents[entry].addr))
+ if(H5HF__man_iblock_size(f, hdr, iblock->ents[entry].addr, num_indirect_rows, iblock, entry, heap_size) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to get fractal heap storage info for indirect block")
} /* end for */
} /* end if */
done:
/* Release the indirect block */
if(iblock && H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block")
iblock = NULL;
FUNC_LEAVE_NOAPI(ret_value)
@@ -1810,17 +1810,17 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off,
*/
prev_par_block_off = par_block_off = 0;
while(row >= hdr->man_dtable.max_direct_rows) {
- /* Retain previous parent block offset */
- prev_par_block_off = par_block_off;
+ /* Retain previous parent block offset */
+ prev_par_block_off = par_block_off;
/* Compute the new parent indirect block's offset in the heap's address space */
/* (based on previous block offset) */
par_block_off += hdr->man_dtable.row_block_off[row];
par_block_off += hdr->man_dtable.row_block_size[row] * col;
- /* Preserve current row & column */
- prev_row = row;
- prev_col = col;
+ /* Preserve current row & column */
+ prev_row = row;
+ prev_col = col;
/* Look up row & column in new indirect block for object */
if(H5HF_dtable_lookup(&hdr->man_dtable, (block_off - par_block_off), &row, &col) < 0)
diff --git a/src/H5HFman.c b/src/H5HFman.c
index 394bcff..7f90f49 100644
--- a/src/H5HFman.c
+++ b/src/H5HFman.c
@@ -140,6 +140,7 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id)
/* Check for row section */
if(sec_node->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW ||
sec_node->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW) {
+
/* Allocate 'single' selection out of 'row' selection */
if(H5HF__man_iblock_alloc_row(hdr, &sec_node) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't break up row section")
diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h
index 6bd4e46..4eec1c1 100644
--- a/src/H5HFprivate.h
+++ b/src/H5HFprivate.h
@@ -107,15 +107,13 @@ H5_DLL H5HF_t *H5HF_create(H5F_t *f, const H5HF_create_t *cparam);
H5_DLL H5HF_t *H5HF_open(H5F_t *f, haddr_t fh_addr);
H5_DLL herr_t H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p/*out*/);
H5_DLL herr_t H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr/*out*/);
-H5_DLL herr_t H5HF_insert(H5HF_t *fh, size_t size, const void *obj,
- void *id/*out*/);
+H5_DLL herr_t H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id/*out*/);
H5_DLL herr_t H5HF_get_obj_len(H5HF_t *fh, const void *id, size_t *obj_len_p/*out*/);
H5_DLL herr_t H5HF_get_obj_off(H5HF_t *fh, const void *_id, hsize_t *obj_off_p/*out*/);
H5_DLL herr_t H5HF_read(H5HF_t *fh, const void *id, void *obj/*out*/);
H5_DLL herr_t H5HF_write(H5HF_t *fh, void *id, hbool_t *id_changed,
const void *obj);
-H5_DLL herr_t H5HF_op(H5HF_t *fh, const void *id, H5HF_operator_t op,
- void *op_data);
+H5_DLL herr_t H5HF_op(H5HF_t *fh, const void *id, H5HF_operator_t op, void *op_data);
H5_DLL herr_t H5HF_remove(H5HF_t *fh, const void *id);
H5_DLL herr_t H5HF_close(H5HF_t *fh);
H5_DLL herr_t H5HF_delete(H5F_t *f, haddr_t fh_addr);
@@ -125,11 +123,9 @@ H5_DLL herr_t H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats);
H5_DLL herr_t H5HF_size(const H5HF_t *fh, hsize_t *heap_size/*out*/);
/* Debugging routines */
-H5_DLL herr_t H5HF_id_print(H5HF_t *fh, const void *id, FILE *stream,
- int indent, int fwidth);
+H5_DLL herr_t H5HF_id_print(H5HF_t *fh, const void *id, FILE *stream, int indent, int fwidth);
#ifdef H5HF_DEBUGGING
-H5_DLL herr_t H5HF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent,
- int fwidth);
+H5_DLL herr_t H5HF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth);
#endif /* H5HF_DEBUGGING */
#endif /* _H5HFprivate_H */
diff --git a/src/H5HFsection.c b/src/H5HFsection.c
index 66c8414..36e966e 100644
--- a/src/H5HFsection.c
+++ b/src/H5HFsection.c
@@ -692,8 +692,7 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect,
*-------------------------------------------------------------------------
*/
herr_t
-H5HF__sect_single_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect,
- size_t amt)
+H5HF__sect_single_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, size_t amt)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2094,8 +2093,7 @@ H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF__sect_row_debug(const H5FS_section_info_t *_sect,
- FILE *stream, int indent, int fwidth)
+H5HF__sect_row_debug(const H5FS_section_info_t *_sect, FILE *stream, int indent, int fwidth)
{
const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Section to dump info */
@@ -2666,8 +2664,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock,
- unsigned start_entry, unsigned nentries)
+H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries)
{
H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */
H5HF_free_section_t *first_row_sect = NULL; /* First row section in new indirect section */
@@ -2841,8 +2838,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect,
- H5HF_indirect_t *sect_iblock)
+H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_indirect_t *sect_iblock)
{
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5HFspace.c b/src/H5HFspace.c
index 5260ae2..37a0502 100644
--- a/src/H5HFspace.c
+++ b/src/H5HFspace.c
@@ -311,7 +311,7 @@ H5HF__space_revert_root(const H5HF_hdr_t *hdr)
/* Only need to scan the sections if the free space has been initialized */
if(hdr->fspace)
- /* Iterate over all sections, resetting the parent pointers in 'single' sections */
+ /* Iterate over all sections, resetting the parent pointers in 'single' sections */
if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_revert_root_cb, NULL) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to reset parent pointers")
@@ -404,7 +404,7 @@ H5HF__space_create_root(const H5HF_hdr_t *hdr, H5HF_indirect_t *root_iblock)
/* Only need to scan the sections if the free space has been initialized */
if(hdr->fspace)
- /* Iterate over all sections, seting the parent pointers in 'single' sections to the new indirect block */
+ /* Iterate over all sections, seting the parent pointers in 'single' sections to the new indirect block */
if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_create_root_cb, root_iblock) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to set parent pointers")
@@ -602,8 +602,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect,
- uint16_t new_class)
+H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16_t new_class)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c
index e4e6fa8..edb0261 100644
--- a/src/H5HLdbg.c
+++ b/src/H5HLdbg.c
@@ -76,10 +76,10 @@ H5HL_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth))
"Data bytes allocated for heap:",
h->dblk_size);
- /*
- * Traverse the free list and check that all free blocks fall within
+ /* Traverse the free list and check that all free blocks fall within
* the heap and that no two free blocks point to the same region of
- * the heap. */
+ * the heap.
+ */
if(NULL == (marker = (uint8_t *)H5MM_calloc(h->dblk_size)))
H5E_THROW(H5E_CANTALLOC, "memory allocation failed");
@@ -88,35 +88,30 @@ H5HL_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth))
char temp_str[32];
HDsnprintf(temp_str, sizeof(temp_str), "Block #%d:", free_block);
- HDfprintf(stream, "%*s%-*s %8Zu, %8Zu\n", indent+3, "", MAX(0,fwidth-9),
- temp_str,
- freelist->offset, freelist->size);
- if((freelist->offset + freelist->size) > h->dblk_size)
- HDfprintf(stream, "***THAT FREE BLOCK IS OUT OF BOUNDS!\n");
- else {
+ HDfprintf(stream, "%*s%-*s %8Zu, %8Zu\n", indent+3, "", MAX(0,fwidth-9), temp_str, freelist->offset, freelist->size);
+ if((freelist->offset + freelist->size) > h->dblk_size)
+ HDfprintf(stream, "***THAT FREE BLOCK IS OUT OF BOUNDS!\n");
+ else {
int overlap = 0;
size_t i;
- for(i = 0; i < freelist->size; i++) {
- if(marker[freelist->offset + i])
- overlap++;
- marker[freelist->offset + i] = 1;
- } /* end for */
- if(overlap)
- HDfprintf(stream, "***THAT FREE BLOCK OVERLAPPED A PREVIOUS ONE!\n");
- else
- amount_free += freelist->size;
- } /* end for */
+ for(i = 0; i < freelist->size; i++) {
+ if(marker[freelist->offset + i])
+ overlap++;
+ marker[freelist->offset + i] = 1;
+ } /* end for */
+ if(overlap)
+ HDfprintf(stream, "***THAT FREE BLOCK OVERLAPPED A PREVIOUS ONE!\n");
+ else
+ amount_free += freelist->size;
+ } /* end else */
} /* end for */
if(h->dblk_size)
- HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth,
- "Percent of heap used:",
- ((double)100.0f * (double)(h->dblk_size - amount_free) / (double)h->dblk_size));
+ HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of heap used:",
+ ((double)100.0f * (double)(h->dblk_size - amount_free) / (double)h->dblk_size));
- /*
- * Print the data in a VMS-style octal dump.
- */
+ /* Print the data in a VMS-style octal dump */
H5_buffer_dump(stream, indent, h->dblk_image, marker, (size_t)0, h->dblk_size);
CATCH
@@ -127,3 +122,4 @@ CATCH
H5E_THROW(H5E_CANTFREE, "can't free marker buffer");
END_FUNC(PRIV) /* end H5HL_debug() */
+
diff --git a/src/H5I.c b/src/H5I.c
index 097aad3..6c24d5a 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -33,8 +33,8 @@
#include "H5ACprivate.h" /* Metadata cache */
#include "H5CXprivate.h" /* API Contexts */
#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
#include "H5Gprivate.h" /* Groups */
#include "H5Ipkg.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
@@ -46,25 +46,25 @@
/* Local Macros */
/* Combine a Type number and an atom index into an atom */
-#define H5I_MAKE(g,i) ((((hid_t)(g) & TYPE_MASK) << ID_BITS) | \
- ((hid_t)(i) & ID_MASK))
+#define H5I_MAKE(g,i) ((((hid_t)(g) & TYPE_MASK) << ID_BITS) | \
+ ((hid_t)(i) & ID_MASK))
/* Local typedefs */
/* Atom information structure used */
typedef struct H5I_id_info_t {
- hid_t id; /* ID for this info */
- unsigned count; /* ref. count for this atom */
+ hid_t id; /* ID for this info */
+ unsigned count; /* ref. count for this atom */
unsigned app_count; /* ref. count of application visible atoms */
- const void *obj_ptr; /* pointer associated with the atom */
+ const void *obj_ptr; /* pointer associated with the atom */
} H5I_id_info_t;
/* ID type structure used */
typedef struct {
const H5I_class_t *cls; /* Pointer to ID class */
- unsigned init_count; /* # of times this type has been initialized*/
- uint64_t id_count; /* Current number of IDs held */
- uint64_t nextid; /* ID to use for the next atom */
+ unsigned init_count; /* # of times this type has been initialized*/
+ uint64_t id_count; /* Current number of IDs held */
+ uint64_t nextid; /* ID to use for the next atom */
H5SL_t *ids; /* Pointer to skip list that stores IDs */
} H5I_id_type_t;
@@ -125,7 +125,7 @@ static H5I_id_info_t *H5I__find_id(hid_t id);
static int H5I__debug_cb(void *_item, void *_key, void *_udata);
static int H5I__id_dump_cb(void *_item, void *_key, void *_udata);
-
+
/*-------------------------------------------------------------------------
* Function: H5I_term_package
*
@@ -136,14 +136,14 @@ static int H5I__id_dump_cb(void *_item, void *_key, void *_udata);
* Return: Success: Positive if any action was taken that might
* affect some other interface; zero otherwise.
*
- * Failure: Negative.
+ * Failure: Negative.
*
*-------------------------------------------------------------------------
*/
int
H5I_term_package(void)
{
- int n = 0;
+ int n = 0;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -177,7 +177,7 @@ H5I_term_package(void)
FUNC_LEAVE_NOAPI(n)
} /* end H5I_term_package() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iregister_type
*
@@ -257,7 +257,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iregister_type() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_register_type
*
@@ -272,7 +272,7 @@ done:
herr_t
H5I_register_type(const H5I_class_t *cls)
{
- H5I_id_type_t *type_ptr = NULL; /* Ptr to the atomic type*/
+ H5I_id_type_t *type_ptr = NULL; /* Ptr to the atomic type*/
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -306,7 +306,7 @@ H5I_register_type(const H5I_class_t *cls)
type_ptr->init_count++;
done:
- if(ret_value < 0) { /* Clean up on error */
+ if(ret_value < 0) { /* Clean up on error */
if(type_ptr) {
if(type_ptr->ids)
H5SL_close(type_ptr->ids);
@@ -317,7 +317,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_register_type() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Itype_exists
*
@@ -346,7 +346,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Itype_exists() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Inmembers
*
@@ -357,8 +357,8 @@ done:
*
* Return: SUCCEED/FAIL
*
- * Programmer: James Laird
- * Nathaniel Furrer
+ * Programmer: James Laird
+ * Nathaniel Furrer
* Friday, April 23, 2004
*
*-------------------------------------------------------------------------
@@ -396,7 +396,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Inmembers() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_nmembers
*
@@ -407,7 +407,7 @@ done:
*
* Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, March 24, 1999
*
*-------------------------------------------------------------------------
@@ -432,7 +432,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_nmembers() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iclear_type
*
@@ -442,8 +442,8 @@ done:
*
* Return: SUCCEED/FAIL
*
- * Programmer: James Laird
- * Nathaniel Furrer
+ * Programmer: James Laird
+ * Nathaniel Furrer
* Friday, April 23, 2004
*
*-------------------------------------------------------------------------
@@ -465,7 +465,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iclear_type() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_clear_type
*
@@ -474,7 +474,7 @@ done:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, March 24, 1999
*
*-------------------------------------------------------------------------
@@ -506,7 +506,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_clear_type() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I__clear_type_cb
*
@@ -543,7 +543,7 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata)
if(udata->force) {
#ifdef H5I_DEBUG
if(H5DEBUG(I)) {
- fprintf(H5DEBUG(I), "H5I: free type=%d obj=0x%08lx "
+ HDfprintf(H5DEBUG(I), "H5I: free type=%d obj=0x%08lx "
"failure ignored\n",
(int)udata->type_ptr->cls->type_id,
(unsigned long)(id->obj_ptr));
@@ -572,7 +572,7 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I__clear_type_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Idestroy_type
*
@@ -584,8 +584,8 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata)
*
* Return: SUCCEED/FAIL
*
- * Programmer: Nathaniel Furrer
- * James Laird
+ * Programmer: Nathaniel Furrer
+ * James Laird
*
*-------------------------------------------------------------------------
*/
@@ -606,7 +606,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Idestroy_type() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I__destroy_type
*
@@ -617,15 +617,15 @@ done:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Nathaniel Furrer
- * James Laird
+ * Programmer: Nathaniel Furrer
+ * James Laird
*
*-------------------------------------------------------------------------
*/
static herr_t
H5I__destroy_type(H5I_type_t type)
{
- H5I_id_type_t *type_ptr; /* ptr to the atomic type */
+ H5I_id_type_t *type_ptr; /* ptr to the atomic type */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -657,7 +657,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I__destroy_type() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iregister
*
@@ -685,7 +685,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iregister() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_register
*
@@ -744,13 +744,13 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_register() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_register_with_id
*
* Purpose: Registers an OBJECT in a TYPE with the supplied ID for it.
* This routine will check to ensure the supplied ID is not already
- * in use, and ensure that it is a valid ID for the given type,
+ * in use, and ensure that it is a valid ID for the given type,
* but will NOT check to ensure the OBJECT is not already
* registered (thus, it is possible to register one object under
* multiple IDs).
@@ -808,7 +808,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_register_with_id() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_subst
*
@@ -818,8 +818,8 @@ done:
* with the specified ID.
* Failure: NULL
*
- * Programmer: Quincey Koziol
- * Saturday, February 27, 2010
+ * Programmer: Quincey Koziol
+ * Saturday, February 27, 2010
*
*-------------------------------------------------------------------------
*/
@@ -827,7 +827,7 @@ void *
H5I_subst(hid_t id, const void *new_object)
{
H5I_id_info_t *id_ptr; /* Pointer to the atom */
- void *ret_value = NULL; /* Return value */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -846,7 +846,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_subst() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_object
*
@@ -862,8 +862,8 @@ done:
void *
H5I_object(hid_t id)
{
- H5I_id_info_t *id_ptr; /* Pointer to the new atom */
- void *ret_value = NULL; /* Return value */
+ H5I_id_info_t *id_ptr; /* Pointer to the new atom */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOERR
@@ -876,7 +876,7 @@ H5I_object(hid_t id)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_object() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iobject_verify
*
@@ -910,7 +910,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iobject_verify() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_object_verify
*
@@ -921,8 +921,8 @@ done:
* specified ID.
* Failure: NULL
*
- * Programmer: Quincey Koziol
- * Wednesday, July 31, 2002
+ * Programmer: Quincey Koziol
+ * Wednesday, July 31, 2002
*
*-------------------------------------------------------------------------
*/
@@ -945,7 +945,7 @@ H5I_object_verify(hid_t id, H5I_type_t id_type)
FUNC_LEAVE_NOAPI(ret_value)
} /* H5I_object_verify() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_get_type
*
@@ -959,8 +959,8 @@ H5I_object_verify(hid_t id, H5I_type_t id_type)
* ID types).
* Failure: H5I_BADID
*
- * Programmer: Robb Matzke
- * Friday, February 19, 1999
+ * Programmer: Robb Matzke
+ * Friday, February 19, 1999
*
*-------------------------------------------------------------------------
*/
@@ -979,7 +979,7 @@ H5I_get_type(hid_t id)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_get_type() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iget_type
*
@@ -1006,13 +1006,13 @@ H5Iget_type(hid_t id)
ret_value = H5I_get_type(id);
if(ret_value <= H5I_BADID || ret_value >= H5I_next_type || NULL == H5I_object(id))
- HGOTO_DONE(H5I_BADID);
+ HGOTO_DONE(H5I_BADID);
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iget_type() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iremove_verify
*
@@ -1025,8 +1025,8 @@ done:
* calling H5I_object().
* Failure: NULL
*
- * Programmer: James Laird
- * Nathaniel Furrer
+ * Programmer: James Laird
+ * Nathaniel Furrer
*
*-------------------------------------------------------------------------
*/
@@ -1048,7 +1048,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iremove_verify() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I__remove_verify
*
@@ -1060,15 +1060,15 @@ done:
* calling H5I_object().
* Failure: NULL
*
- * Programmer: James Laird
- * Nat Furrer
+ * Programmer: James Laird
+ * Nat Furrer
*
*-------------------------------------------------------------------------
*/
void *
H5I__remove_verify(hid_t id, H5I_type_t id_type)
{
- void * ret_value = NULL; /*return value */
+ void * ret_value = NULL; /*return value */
FUNC_ENTER_STATIC_NOERR
@@ -1081,7 +1081,7 @@ H5I__remove_verify(hid_t id, H5I_type_t id_type)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I__remove_verify() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I__remove_common
*
@@ -1100,8 +1100,8 @@ H5I__remove_verify(hid_t id, H5I_type_t id_type)
static void *
H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id)
{
- H5I_id_info_t *curr_id; /* Pointer to the current atom */
- void *ret_value = NULL; /* Return value */
+ H5I_id_info_t *curr_id; /* Pointer to the current atom */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -1123,7 +1123,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I__remove_common() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_remove
*
@@ -1134,16 +1134,16 @@ done:
* calling H5I_object().
* Failure: NULL
*
- * Programmer: Unknown
+ * Programmer: Unknown
*
*-------------------------------------------------------------------------
*/
void *
H5I_remove(hid_t id)
{
- H5I_id_type_t *type_ptr; /* Pointer to the atomic type */
- H5I_type_t type; /* Atom's atomic type */
- void * ret_value = NULL; /* Return value */
+ H5I_id_type_t *type_ptr; /* Pointer to the atomic type */
+ H5I_type_t type; /* Atom's atomic type */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1163,7 +1163,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_remove() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Idec_ref
*
@@ -1199,7 +1199,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Idec_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_dec_ref
*
@@ -1238,14 +1238,14 @@ H5I_dec_ref(hid_t id)
* reference count without calling the free method.
*
* Beware: the free method may call other H5I functions.
- *
- * If an object is closing, we can remove the ID even though the free
+ *
+ * If an object is closing, we can remove the ID even though the free
* method might fail. This can happen when a mandatory filter fails to
- * write when a dataset is closed and the chunk cache is flushed to the
+ * write when a dataset is closed and the chunk cache is flushed to the
* file. We have to close the dataset anyway. (SLU - 2010/9/7)
*/
if(1 == id_ptr->count) {
- H5I_id_type_t *type_ptr; /*ptr to the type */
+ H5I_id_type_t *type_ptr; /*ptr to the type */
/* Get the ID's type */
type_ptr = H5I_id_type_list_g[H5I_TYPE(id)];
@@ -1269,7 +1269,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_dec_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_dec_app_ref
*
@@ -1317,7 +1317,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_dec_app_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_dec_app_ref_always_close
*
@@ -1345,9 +1345,9 @@ H5I_dec_app_ref_always_close(hid_t id)
/* Check for failure */
if (ret_value < 0) {
/*
- * If an object is closing, we can remove the ID even though the free
+ * If an object is closing, we can remove the ID even though the free
* method might fail. This can happen when a mandatory filter fails to
- * write when a dataset is closed and the chunk cache is flushed to the
+ * write when a dataset is closed and the chunk cache is flushed to the
* file. We have to close the dataset anyway. (SLU - 2010/9/7)
*/
H5I_remove(id);
@@ -1359,7 +1359,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_dec_app_ref_always_close() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iinc_ref
*
@@ -1390,7 +1390,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iinc_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_inc_ref
*
@@ -1428,7 +1428,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_inc_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iget_ref
*
@@ -1459,7 +1459,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iget_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_get_ref
*
@@ -1492,7 +1492,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_get_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iinc_type_ref
*
@@ -1526,7 +1526,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iinc_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I__inc_type_ref
*
@@ -1560,14 +1560,14 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I__inc_type_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Idec_type_ref
*
* Purpose: Decrements the reference count on an entire type of IDs.
* If the type reference count becomes zero then the type is
* destroyed along with all atoms in that type regardless of
- * their reference counts. Destroying IDs involves calling
+ * their reference counts. Destroying IDs involves calling
* the free-func for each ID's object and then adding the ID
* struct to the ID free list. Public interface to
* H5I_dec_type_ref.
@@ -1602,14 +1602,14 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Idec_type_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_dec_type_ref
*
* Purpose: Decrements the reference count on an entire type of IDs.
* If the type reference count becomes zero then the type is
* destroyed along with all atoms in that type regardless of
- * their reference counts. Destroying IDs involves calling
+ * their reference counts. Destroying IDs involves calling
* the free-func for each ID's object and then adding the ID
* struct to the ID free list.
* Returns the number of references to the type on success; a
@@ -1655,7 +1655,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_dec_type_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iget_type_ref
*
@@ -1689,7 +1689,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iget_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I__get_type_ref
*
@@ -1724,7 +1724,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I__get_type_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iis_valid
*
@@ -1754,7 +1754,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iis_valid() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I__search_cb
*
@@ -1780,7 +1780,7 @@ H5I__search_cb(void *obj, hid_t id, void *_udata)
/* Set the return value based on the callback's return value */
if(cb_ret_val > 0) {
- ret_value = H5_ITER_STOP; /* terminate iteration early */
+ ret_value = H5_ITER_STOP; /* terminate iteration early */
udata->ret_obj = obj; /* also set out parameter */
}
else if(cb_ret_val < 0)
@@ -1789,7 +1789,7 @@ H5I__search_cb(void *obj, hid_t id, void *_udata)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I__search_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Isearch
*
@@ -1828,7 +1828,7 @@ H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key)
udata.app_key = key;
udata.ret_obj = NULL;
- /* Note that H5I_iterate returns an error code. We ignore it
+ /* Note that H5I_iterate returns an error code. We ignore it
* here, as we can't do anything with it without revising the API.
*/
(void)H5I_iterate(type, H5I__search_cb, &udata, TRUE);
@@ -1840,7 +1840,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Isearch() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I__iterate_cb
*
@@ -1873,7 +1873,7 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
/* Set the return value based on the callback's return value */
if(cb_ret_val > 0)
- ret_value = H5_ITER_STOP; /* terminate iteration early */
+ ret_value = H5_ITER_STOP; /* terminate iteration early */
else if(cb_ret_val < 0)
ret_value = H5_ITER_ERROR; /* indicate failure (which terminates iteration) */
}
@@ -1881,26 +1881,26 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I__iterate_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5I_iterate
+ * Function: H5I_iterate
*
- * Purpose: Apply function FUNC to each member of type TYPE (with
- * non-zero application reference count if app_ref is TRUE).
- * Stop if FUNC returns a non zero value (i.e. anything
- * other than H5_ITER_CONT).
+ * Purpose: Apply function FUNC to each member of type TYPE (with
+ * non-zero application reference count if app_ref is TRUE).
+ * Stop if FUNC returns a non zero value (i.e. anything
+ * other than H5_ITER_CONT).
*
- * If FUNC returns a positive value (i.e. H5_ITER_STOP),
+ * If FUNC returns a positive value (i.e. H5_ITER_STOP),
* return SUCCEED.
*
- * If FUNC returns a negative value (i.e. H5_ITER_ERROR),
+ * If FUNC returns a negative value (i.e. H5_ITER_ERROR),
* return FAIL.
- *
- * The FUNC should take a pointer to the object and the
- * udata as arguments and return non-zero to terminate
+ *
+ * The FUNC should take a pointer to the object and the
+ * udata as arguments and return non-zero to terminate
* siteration, and zero to continue.
*
- * Limitation: Currently there is no way to start the iteration from
+ * Limitation: Currently there is no way to start the iteration from
* where a previous iteration left off.
*
* Return: SUCCEED/FAIL
@@ -1911,7 +1911,7 @@ herr_t
H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref)
{
H5I_id_type_t *type_ptr; /* Pointer to the type */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1939,7 +1939,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_iterate() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I__find_id
*
@@ -1955,9 +1955,9 @@ done:
static H5I_id_info_t *
H5I__find_id(hid_t id)
{
- H5I_type_t type; /*ID's type */
- H5I_id_type_t *type_ptr; /*ptr to the type */
- H5I_id_info_t *ret_value = NULL; /* Return value */
+ H5I_type_t type; /*ID's type */
+ H5I_id_type_t *type_ptr; /*ptr to the type */
+ H5I_id_info_t *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC_NOERR
@@ -1977,7 +1977,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I__find_id() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iget_name
*
@@ -2020,7 +2020,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iget_name() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Iget_file_id
*
@@ -2057,7 +2057,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iget_file_id() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_get_file_id
*
@@ -2065,7 +2065,7 @@ done:
* ID given an object ID.
*
* Return: Success: The file ID associated with the object
- * Failure: H5I_INVALID_HID
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
@@ -2101,7 +2101,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_get_file_id() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I__id_dump_cb
*
@@ -2120,9 +2120,9 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
FUNC_ENTER_STATIC_NOERR
- HDfprintf(stderr, " id = %lu\n", (unsigned long)(item->id));
- HDfprintf(stderr, " count = %u\n", item->count);
- HDfprintf(stderr, " obj = 0x%08lx\n", (unsigned long)(item->obj_ptr));
+ HDfprintf(stderr, " id = %lu\n", (unsigned long)(item->id));
+ HDfprintf(stderr, " count = %u\n", item->count);
+ HDfprintf(stderr, " obj = 0x%08lx\n", (unsigned long)(item->obj_ptr));
/* Get the group location, so we get get the name */
switch(type) {
@@ -2168,7 +2168,7 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
FUNC_LEAVE_NOAPI(H5_ITER_CONT)
} /* end H5I__id_dump_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: H5I_dump_ids_for_type
*
@@ -2191,14 +2191,14 @@ H5I_dump_ids_for_type(H5I_type_t type)
if(type_ptr) {
/* Header */
- HDfprintf(stderr, " init_count = %u\n", type_ptr->init_count);
- HDfprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved);
- HDfprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count);
- HDfprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid);
+ HDfprintf(stderr, " init_count = %u\n", type_ptr->init_count);
+ HDfprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved);
+ HDfprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count);
+ HDfprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid);
/* List */
if(type_ptr->id_count > 0) {
- HDfprintf(stderr, " List:\n");
+ HDfprintf(stderr, " List:\n");
H5SL_iterate(type_ptr->ids, H5I__id_dump_cb, &type);
}
}
diff --git a/src/H5L.c b/src/H5L.c
index 6967812..5c52932 100644
--- a/src/H5L.c
+++ b/src/H5L.c
@@ -309,6 +309,13 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list")
+ /* Check the link create property list */
+ if(H5P_DEFAULT == lcpl_id)
+ lcpl_id = H5P_LINK_CREATE_DEFAULT;
+
+ /* Set the LCPL for the API context */
+ H5CX_set_lcpl(lcpl_id);
+
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC,
((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0)
@@ -371,6 +378,13 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list")
+ /* Check the link create property list */
+ if(H5P_DEFAULT == lcpl_id)
+ lcpl_id = H5P_LINK_CREATE_DEFAULT;
+
+ /* Set the LCPL for the API context */
+ H5CX_set_lcpl(lcpl_id);
+
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC,
((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0)
@@ -431,6 +445,13 @@ H5Lcreate_soft(const char *link_target, hid_t link_loc_id,
if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list")
+ /* Check the link creation property list */
+ if(H5P_DEFAULT == lcpl_id)
+ lcpl_id = H5P_LINK_CREATE_DEFAULT;
+
+ /* Set the LCPL for the API context */
+ H5CX_set_lcpl(lcpl_id);
+
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info")
@@ -486,6 +507,13 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name,
if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list")
+ /* Check the link create property list */
+ if(H5P_DEFAULT == lcpl_id)
+ lcpl_id = H5P_LINK_CREATE_DEFAULT;
+
+ /* Set the LCPL for the API context */
+ H5CX_set_lcpl(lcpl_id);
+
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, cur_loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info")
@@ -552,6 +580,13 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type,
if(link_type < H5L_TYPE_UD_MIN || link_type > H5L_TYPE_MAX)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link class")
+ /* Check the link creation property list */
+ if(H5P_DEFAULT == lcpl_id)
+ lcpl_id = H5P_LINK_CREATE_DEFAULT;
+
+ /* Set the LCPL for the API context */
+ H5CX_set_lcpl(lcpl_id);
+
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info")
@@ -1626,8 +1661,8 @@ H5L__link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATT
/* Check for non-default link creation properties */
if(udata->lc_plist) {
/* Get character encoding property */
- if(H5P_get(udata->lc_plist, H5P_STRCRT_CHAR_ENCODING_NAME, &udata->lnk->cset) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get property value for character encoding")
+ if(H5CX_get_encoding(&udata->lnk->cset) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get 'character set' property")
} /* end if */
else
udata->lnk->cset = H5F_DEFAULT_CSET; /* Default character encoding for link */
@@ -1760,7 +1795,7 @@ H5L__create_real(const H5G_loc_t *link_loc, const char *link_name,
HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name")
/* Check for flags present in creation property list */
- if(lcpl_id != H5P_DEFAULT) {
+ if(lcpl_id != H5P_DEFAULT && lcpl_id != H5P_LINK_CREATE_DEFAULT) {
unsigned crt_intmd_group;
/* Get link creation property list */
@@ -1768,8 +1803,8 @@ H5L__create_real(const H5G_loc_t *link_loc, const char *link_name,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
/* Get intermediate group creation property */
- if(H5P_get(lc_plist, H5L_CRT_INTERMEDIATE_GROUP_NAME, &crt_intmd_group) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for creating missing groups")
+ if(H5CX_get_intermediate_group(&crt_intmd_group) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get 'create intermediate group' property")
if(crt_intmd_group > 0)
target_flags |= H5G_CRT_INTMD_GROUP;
@@ -2652,14 +2687,14 @@ H5L_move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_lo
HDassert(dst_name && *dst_name);
/* Check for flags present in creation property list */
- if(lcpl_id != H5P_DEFAULT) {
+ if(lcpl_id != H5P_DEFAULT && lcpl_id != H5P_LINK_CREATE_DEFAULT) {
unsigned crt_intmd_group;
if(NULL == (lc_plist = (H5P_genplist_t *)H5I_object(lcpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
/* Get intermediate group creation property */
- if(H5P_get(lc_plist, H5L_CRT_INTERMEDIATE_GROUP_NAME, &crt_intmd_group) < 0)
+ if(H5CX_get_intermediate_group(&crt_intmd_group) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for creating missing groups")
/* Set target flags for source and destination */
@@ -2667,7 +2702,7 @@ H5L_move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_lo
dst_target_flags |= H5G_CRT_INTMD_GROUP;
/* Get character encoding property */
- if(H5P_get(lc_plist, H5P_STRCRT_CHAR_ENCODING_NAME, &char_encoding) < 0)
+ if(H5CX_get_encoding(&char_encoding) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for character encoding")
} /* end if */
diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c
index 7c32309..4f6eeba 100644
--- a/src/H5Lexternal.c
+++ b/src/H5Lexternal.c
@@ -356,6 +356,13 @@ H5Lcreate_external(const char *file_name, const char *obj_name,
if(!link_name || !*link_name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no link name specified")
+ /* Check the link creation property list */
+ if(H5P_DEFAULT == lcpl_id)
+ lcpl_id = H5P_LINK_CREATE_DEFAULT;
+
+ /* Set the LCPL for the API context */
+ H5CX_set_lcpl(lcpl_id);
+
/* Get normalized copy of the link target */
if(NULL == (norm_obj_name = H5G_normalize(obj_name)))
HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize object name")
diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h
index e6fd37c..7bdb001 100644
--- a/src/H5Lpublic.h
+++ b/src/H5Lpublic.h
@@ -41,10 +41,10 @@
#define H5L_SAME_LOC (hid_t)0
/* Current version of the H5L_class_t struct */
-#define H5L_LINK_CLASS_T_VERS 1
+#define H5L_LINK_CLASS_T_VERS 1
/* Previous versions of the H5L_class_t struct */
-#define H5L_LINK_CLASS_T_VERS_0 0
+#define H5L_LINK_CLASS_T_VERS_0 0
#ifdef __cplusplus
extern "C" {
diff --git a/src/H5MF.c b/src/H5MF.c
index 65b27db..065a5c6 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -1835,6 +1835,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
fsinfo.page_size = f->shared->fs_page_size;
fsinfo.pgend_meta_thres = f->shared->pgend_meta_thres;
fsinfo.eoa_pre_fsm_fsalloc = f->shared->eoa_pre_fsm_fsalloc;
+ fsinfo.version = f->shared->fs_version;
/* Write the free space manager message -- message must already exist */
if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0)
@@ -1973,6 +1974,8 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
fsinfo.page_size = f->shared->fs_page_size;
fsinfo.pgend_meta_thres = f->shared->pgend_meta_thres;
fsinfo.eoa_pre_fsm_fsalloc = HADDR_UNDEF;
+ fsinfo.version = f->shared->fs_version;
+
for(ptype = H5F_MEM_PAGE_META; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype))
fsinfo.fs_addr[ptype - 1] = HADDR_UNDEF;
diff --git a/src/H5MM.c b/src/H5MM.c
index 866dfbe..0f01b3f 100644
--- a/src/H5MM.c
+++ b/src/H5MM.c
@@ -43,7 +43,7 @@
#define H5MM_SIG_SIZE 4
#define H5MM_HEAD_GUARD_SIZE 8
#define H5MM_TAIL_GUARD_SIZE 8
-#define H5MM_BLOCK_FROM_BUF(mem) ((H5MM_block_t *)((unsigned char *)mem - (offsetof(H5MM_block_t, b) + H5MM_HEAD_GUARD_SIZE)))
+#define H5MM_BLOCK_FROM_BUF(mem) ((H5MM_block_t *)((void *)((unsigned char *)mem - (offsetof(H5MM_block_t, b) + H5MM_HEAD_GUARD_SIZE))))
#endif /* H5_MEMORY_ALLOC_SANITY_CHECK */
diff --git a/src/H5MP.c b/src/H5MP.c
index 8c9b411..7947e7d 100644
--- a/src/H5MP.c
+++ b/src/H5MP.c
@@ -44,7 +44,7 @@
/* First block in page */
#define H5MP_PAGE_FIRST_BLOCK(p) \
- (H5MP_page_blk_t *)((unsigned char *)(p) + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_t)))
+ (H5MP_page_blk_t *)((void *)((unsigned char *)(p) + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_t))))
/******************/
@@ -294,7 +294,7 @@ found:
H5MP_page_blk_t *new_free; /* New free block created */
/* Carve out new free block after block to allocate */
- new_free = (H5MP_page_blk_t *)(((unsigned char *)alloc_free) + needed);
+ new_free = (H5MP_page_blk_t *)((void *)(((unsigned char *)alloc_free) + needed));
/* Link into existing lists */
new_free->next = alloc_free->next;
@@ -361,7 +361,7 @@ H5MP_free(H5MP_pool_t *mp, void *spc)
HDassert(spc);
/* Get block header for space to free */
- spc_blk = (H5MP_page_blk_t *)(((unsigned char *)spc) - H5MP_BLOCK_ALIGN(sizeof(H5MP_page_blk_t)));
+ spc_blk = (H5MP_page_blk_t *)((void *)(((unsigned char *)spc) - H5MP_BLOCK_ALIGN(sizeof(H5MP_page_blk_t))));
/* Mark block as free */
HDassert(spc_blk->is_free == FALSE);
diff --git a/src/H5MPtest.c b/src/H5MPtest.c
index b3f2e24..0cba847 100644
--- a/src/H5MPtest.c
+++ b/src/H5MPtest.c
@@ -134,7 +134,7 @@ H5MP_pool_is_free_size_correct(const H5MP_pool_t *mp)
size_t page_free; /* Size of blocks on free list */
/* Iterate through the blocks in page, accumulating free space */
- blk = (H5MP_page_blk_t *)((unsigned char *)page + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_t)));
+ blk = (H5MP_page_blk_t *)((void *)((unsigned char *)page + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_t))));
page_free = 0;
while(blk != NULL) {
if(blk->is_free)
diff --git a/src/H5O.c b/src/H5O.c
index aa175eb..0d7e1ea 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -288,6 +288,13 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id,
if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list")
+ /* Check the link creation property list */
+ if(H5P_DEFAULT == lcpl_id)
+ lcpl_id = H5P_LINK_CREATE_DEFAULT;
+
+ /* Set the LCPL for the API context */
+ H5CX_set_lcpl(lcpl_id);
+
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, obj_id, TRUE) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info")
diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c
index 205515a..ccaf46c 100644
--- a/src/H5Ochunk.c
+++ b/src/H5Ochunk.c
@@ -335,7 +335,7 @@ H5O__chunk_update_idx(H5F_t *f, H5O_t *oh, unsigned idx)
H5O_chk_cache_ud_t chk_udata; /* User data for loading chunk */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_PACKAGE
+ FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr)
/* check args */
HDassert(f);
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index b57eaf6..31f6ebc 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -309,6 +309,9 @@ H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc,
if(TRUE != H5P_isa_class(ocpypl_id, H5P_OBJECT_COPY))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not object copy property list")
+ /* Set the LCPL for the API context */
+ H5CX_set_lcpl(lcpl_id);
+
/* Do the actual copying of the object */
if(H5O__copy_obj(&src_loc, dst_loc, dst_name, ocpypl_id, lcpl_id) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object")
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 8060398..4cf5067 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -15,13 +15,13 @@
#define H5T_FRIEND /*prevent warning from including H5Tpkg */
-#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* Files */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Gprivate.h" /* Groups */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* Files */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Gprivate.h" /* Groups */
+#include "H5MMprivate.h" /* Memory management */
#include "H5Opkg.h" /* Object headers */
#include "H5Tpkg.h" /* Datatypes */
#include "H5VMprivate.h" /* Vectors and arrays */
diff --git a/src/H5Ofill.c b/src/H5Ofill.c
index 8a6004d..64d75f4 100644
--- a/src/H5Ofill.c
+++ b/src/H5Ofill.c
@@ -14,15 +14,15 @@
/* Programmer: Robb Matzke <matzke@llnl.gov>
* Wednesday, September 30, 1998
*
- * Purpose: The fill message indicates a bit pattern to use for
- * uninitialized data points of a dataset.
+ * Purpose: The fill message indicates a bit pattern to use for
+ * uninitialized data points of a dataset.
*/
#include "H5Omodule.h" /* This source code file is part of the H5O module */
#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
+#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* IDs */
@@ -49,61 +49,61 @@ static herr_t H5O__fill_debug(H5F_t *f, const void *_mesg, FILE *stream,
int indent, int fwidth);
/* Set up & include shared message "interface" info */
-#define H5O_SHARED_TYPE H5O_MSG_FILL
-#define H5O_SHARED_DECODE H5O_fill_shared_decode
-#define H5O_SHARED_DECODE_REAL H5O_fill_old_decode
-#define H5O_SHARED_ENCODE H5O_fill_shared_encode
-#define H5O_SHARED_ENCODE_REAL H5O_fill_old_encode
-#define H5O_SHARED_SIZE H5O_fill_shared_size
-#define H5O_SHARED_SIZE_REAL H5O_fill_old_size
-#define H5O_SHARED_DELETE H5O__fill_shared_delete
+#define H5O_SHARED_TYPE H5O_MSG_FILL
+#define H5O_SHARED_DECODE H5O_fill_shared_decode
+#define H5O_SHARED_DECODE_REAL H5O_fill_old_decode
+#define H5O_SHARED_ENCODE H5O_fill_shared_encode
+#define H5O_SHARED_ENCODE_REAL H5O_fill_old_encode
+#define H5O_SHARED_SIZE H5O_fill_shared_size
+#define H5O_SHARED_SIZE_REAL H5O_fill_old_size
+#define H5O_SHARED_DELETE H5O__fill_shared_delete
#undef H5O_SHARED_DELETE_REAL
-#define H5O_SHARED_LINK H5O__fill_shared_link
+#define H5O_SHARED_LINK H5O__fill_shared_link
#undef H5O_SHARED_LINK_REAL
-#define H5O_SHARED_COPY_FILE H5O__fill_shared_copy_file
+#define H5O_SHARED_COPY_FILE H5O__fill_shared_copy_file
#undef H5O_SHARED_COPY_FILE_REAL
-#define H5O_SHARED_POST_COPY_FILE H5O_fill_shared_post_copy_file
+#define H5O_SHARED_POST_COPY_FILE H5O_fill_shared_post_copy_file
#undef H5O_SHARED_POST_COPY_FILE_REAL
#undef H5O_SHARED_POST_COPY_FILE_UPD
-#define H5O_SHARED_DEBUG H5O_fill_shared_debug
-#define H5O_SHARED_DEBUG_REAL H5O__fill_debug
-#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
+#define H5O_SHARED_DEBUG H5O_fill_shared_debug
+#define H5O_SHARED_DEBUG_REAL H5O__fill_debug
+#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
/* Set up & include shared message "interface" info */
/* (Kludgy 'undef's in order to re-include the H5Oshared.h header) */
#undef H5O_SHARED_TYPE
-#define H5O_SHARED_TYPE H5O_MSG_FILL_NEW
+#define H5O_SHARED_TYPE H5O_MSG_FILL_NEW
#undef H5O_SHARED_DECODE
-#define H5O_SHARED_DECODE H5O_fill_new_shared_decode
+#define H5O_SHARED_DECODE H5O_fill_new_shared_decode
#undef H5O_SHARED_DECODE_REAL
-#define H5O_SHARED_DECODE_REAL H5O_fill_new_decode
+#define H5O_SHARED_DECODE_REAL H5O_fill_new_decode
#undef H5O_SHARED_ENCODE
-#define H5O_SHARED_ENCODE H5O_fill_new_shared_encode
+#define H5O_SHARED_ENCODE H5O_fill_new_shared_encode
#undef H5O_SHARED_ENCODE_REAL
-#define H5O_SHARED_ENCODE_REAL H5O_fill_new_encode
+#define H5O_SHARED_ENCODE_REAL H5O_fill_new_encode
#undef H5O_SHARED_SIZE
-#define H5O_SHARED_SIZE H5O_fill_new_shared_size
+#define H5O_SHARED_SIZE H5O_fill_new_shared_size
#undef H5O_SHARED_SIZE_REAL
-#define H5O_SHARED_SIZE_REAL H5O_fill_new_size
+#define H5O_SHARED_SIZE_REAL H5O_fill_new_size
#undef H5O_SHARED_DELETE
-#define H5O_SHARED_DELETE H5O__fill_new_shared_delete
+#define H5O_SHARED_DELETE H5O__fill_new_shared_delete
#undef H5O_SHARED_DELETE_REAL
#undef H5O_SHARED_LINK
-#define H5O_SHARED_LINK H5O__fill_new_shared_link
+#define H5O_SHARED_LINK H5O__fill_new_shared_link
#undef H5O_SHARED_LINK_REAL
#undef H5O_SHARED_COPY_FILE
-#define H5O_SHARED_COPY_FILE H5O__fill_new_shared_copy_file
+#define H5O_SHARED_COPY_FILE H5O__fill_new_shared_copy_file
#undef H5O_SHARED_COPY_FILE_REAL
#undef H5O_SHARED_POST_COPY_FILE
-#define H5O_SHARED_POST_COPY_FILE H5O_fill_new_shared_post_copy_file
+#define H5O_SHARED_POST_COPY_FILE H5O_fill_new_shared_post_copy_file
#undef H5O_SHARED_POST_COPY_FILE_REAL
#undef H5O_SHARED_POST_COPY_FILE_UPD
#undef H5O_SHARED_DEBUG
-#define H5O_SHARED_DEBUG H5O_fill_new_shared_debug
+#define H5O_SHARED_DEBUG H5O_fill_new_shared_debug
#undef H5O_SHARED_DEBUG_REAL
-#define H5O_SHARED_DEBUG_REAL H5O__fill_debug
+#define H5O_SHARED_DEBUG_REAL H5O__fill_debug
#undef H5Oshared_H
-#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
+#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
/* This message derives from H5O message class, for old fill value before version 1.5 */
const H5O_msg_class_t H5O_MSG_FILL[1] = {{
@@ -150,13 +150,13 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{
H5O_fill_new_shared_post_copy_file, /* post copy native value to file */
NULL, /* get creation index */
NULL, /* set creation index */
- H5O_fill_new_shared_debug /*debug the message */
+ H5O_fill_new_shared_debug /*debug the message */
}};
/* Format version bounds for fill value */
const unsigned H5O_fill_ver_bounds[] = {
H5O_FILL_VERSION_1, /* H5F_LIBVER_EARLIEST */
- H5O_FILL_VERSION_2, /* H5F_LIBVER_V18 */
+ H5O_FILL_VERSION_3, /* H5F_LIBVER_V18 */
H5O_FILL_VERSION_LATEST /* H5F_LIBVER_LATEST */
};
@@ -175,15 +175,15 @@ H5FL_DEFINE(H5O_fill_t);
/* Declare extern the free list to manage blocks of type conversion data */
H5FL_BLK_EXTERN(type_conv);
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_fill_new_decode
+ * Function: H5O_fill_new_decode
*
- * Purpose: Decode a new fill value message. The new fill value
+ * Purpose: Decode a new fill value message. The new fill value
* message is fill value plus space allocation time and
* fill value writing time and whether fill value is defined.
*
- * Return: Success: Ptr to new message in native struct.
+ * Return: Success: Ptr to new message in native struct.
* Failure: NULL
*
* Programmer: Raymond Lu
@@ -196,7 +196,7 @@ H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
size_t p_size, const uint8_t *p)
{
- H5O_fill_t *fill = NULL;
+ H5O_fill_t *fill = NULL;
void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -294,7 +294,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_fill_new_decode() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O_fill_old_decode
*
@@ -313,7 +313,7 @@ H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh,
unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
size_t p_size, const uint8_t *p)
{
- H5O_fill_t *fill = NULL; /* Decoded fill value message */
+ H5O_fill_t *fill = NULL; /* Decoded fill value message */
htri_t exists = FALSE;
H5T_t *dt = NULL;
void *ret_value = NULL; /* Return value */
@@ -375,15 +375,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_fill_old_decode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_fill_new_encode
+ * Function: H5O_fill_new_encode
*
- * Purpose: Encode a new fill value message. The new fill value
+ * Purpose: Encode a new fill value message. The new fill value
* message is fill value plus space allocation time and
* fill value writing time and whether fill value is defined.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Raymond Lu
* Feb 26, 2002
@@ -393,7 +393,7 @@ done:
static herr_t
H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
{
- const H5O_fill_t *fill = (const H5O_fill_t *)_fill;
+ const H5O_fill_t *fill = (const H5O_fill_t *)_fill;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -473,7 +473,7 @@ H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_fill_new_encode() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O_fill_old_encode
*
@@ -504,17 +504,17 @@ H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_fill_old_encode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_fill_copy
+ * Function: H5O_fill_copy
*
- * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
- * necessary. The new fill value message is fill value plus
- * space allocation time and fill value writing time and
- * whether fill value is defined.
+ * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
+ * necessary. The new fill value message is fill value plus
+ * space allocation time and fill value writing time and
+ * whether fill value is defined.
*
- * Return: Success: Ptr to _DEST
- * Failure: NULL
+ * Return: Success: Ptr to _DEST
+ * Failure: NULL
*
* Programmer: Raymond Lu
* Feb 26, 2002
@@ -621,18 +621,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_fill_copy() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_fill_new_size
+ * Function: H5O_fill_new_size
*
- * Purpose: Returns the size of the raw message in bytes not counting the
+ * Purpose: Returns the size of the raw message in bytes not counting the
* message type or size fields, but only the data fields. This
* function doesn't take into account alignment. The new fill
* value message is fill value plus space allocation time and
* fill value writing time and whether fill value is defined.
*
- * Return: Success: Message data size in bytes w/o alignment.
- * Failure: 0
+ * Return: Success: Message data size in bytes w/o alignment.
+ * Failure: 0
*
* Programmer: Raymond Lu
* Feb 26, 2002
@@ -652,26 +652,26 @@ H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill)
/* Determine size for different versions */
if(fill->version < H5O_FILL_VERSION_3) {
- ret_value = 1 + /* Version number */
- 1 + /* Space allocation time */
- 1 + /* Fill value write time */
- 1; /* Fill value defined */
+ ret_value = 1 + /* Version number */
+ 1 + /* Space allocation time */
+ 1 + /* Fill value write time */
+ 1; /* Fill value defined */
if(fill->fill_defined)
- ret_value += 4 + /* Fill value size */
- (fill->size > 0 ? (size_t)fill->size : 0); /* Size of fill value */
+ ret_value += 4 + /* Fill value size */
+ (fill->size > 0 ? (size_t)fill->size : 0); /* Size of fill value */
} /* end if */
else {
- ret_value = 1 + /* Version number */
- 1; /* Status flags */
+ ret_value = 1 + /* Version number */
+ 1; /* Status flags */
if(fill->size > 0)
- ret_value += 4 + /* Fill value size */
- (size_t)fill->size; /* Size of fill value */
+ ret_value += 4 + /* Fill value size */
+ (size_t)fill->size; /* Size of fill value */
} /* end else */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_fill_new_size() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O_fill_old_size
*
@@ -699,15 +699,15 @@ H5O_fill_old_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill)
FUNC_LEAVE_NOAPI(4 + (size_t)fill->size)
} /* end H5O_fill_old_size() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_fill_reset_dyn
+ * Function: H5O_fill_reset_dyn
*
- * Purpose: Resets dynamic fill value fields
+ * Purpose: Resets dynamic fill value fields
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, January 22, 2007
*
*-------------------------------------------------------------------------
@@ -754,8 +754,8 @@ H5O_fill_reset_dyn(H5O_fill_t *fill)
} /* end if */
fill->size = 0;
if(fill->type) {
- (void)H5T_close_real(fill->type);
- fill->type = NULL;
+ (void)H5T_close_real(fill->type);
+ fill->type = NULL;
} /* end if */
done:
@@ -765,15 +765,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_fill_reset_dyn() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O__fill_reset
+ * Function: H5O__fill_reset
*
- * Purpose: Resets a message to an initial state.
+ * Purpose: Resets a message to an initial state.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, October 1, 1998
*
*-------------------------------------------------------------------------
@@ -781,7 +781,7 @@ done:
static herr_t
H5O__fill_reset(void *_fill)
{
- H5O_fill_t *fill = (H5O_fill_t *)_fill;
+ H5O_fill_t *fill = (H5O_fill_t *)_fill;
FUNC_ENTER_STATIC_NOERR
@@ -798,15 +798,15 @@ H5O__fill_reset(void *_fill)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__fill_reset() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O__fill_free
+ * Function: H5O__fill_free
*
- * Purpose: Frees the message
+ * Purpose: Frees the message
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, December 5, 2002
*
*-------------------------------------------------------------------------
@@ -823,7 +823,7 @@ H5O__fill_free(void *fill)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__fill_free() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O__fill_pre_copy_file
*
@@ -841,7 +841,7 @@ static herr_t
H5O__fill_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata)
{
- const H5O_fill_t *fill_src = (const H5O_fill_t *)mesg_src; /* Source fill value */
+ const H5O_fill_t *fill_src = (const H5O_fill_t *)mesg_src; /* Source fill value */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -859,15 +859,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O__fill_pre_copy_file() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O__fill_debug
+ * Function: H5O__fill_debug
*
- * Purpose: Prints debugging info for the message.
+ * Purpose: Prints debugging info for the message.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, October 1, 1998
*
*-------------------------------------------------------------------------
@@ -890,40 +890,40 @@ H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream,
HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Space Allocation Time:");
switch(fill->alloc_time) {
case H5D_ALLOC_TIME_EARLY:
- fprintf(stream,"Early\n");
+ HDfprintf(stream,"Early\n");
break;
case H5D_ALLOC_TIME_LATE:
- fprintf(stream,"Late\n");
+ HDfprintf(stream,"Late\n");
break;
case H5D_ALLOC_TIME_INCR:
- fprintf(stream,"Incremental\n");
+ HDfprintf(stream,"Incremental\n");
break;
case H5D_ALLOC_TIME_DEFAULT:
case H5D_ALLOC_TIME_ERROR:
default:
- fprintf(stream,"Unknown!\n");
+ HDfprintf(stream,"Unknown!\n");
break;
} /* end switch */
HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Fill Time:");
switch(fill->fill_time) {
case H5D_FILL_TIME_ALLOC:
- fprintf(stream,"On Allocation\n");
+ HDfprintf(stream,"On Allocation\n");
break;
case H5D_FILL_TIME_NEVER:
- fprintf(stream,"Never\n");
+ HDfprintf(stream,"Never\n");
break;
case H5D_FILL_TIME_IFSET:
- fprintf(stream,"If Set\n");
+ HDfprintf(stream,"If Set\n");
break;
case H5D_FILL_TIME_ERROR:
default:
- fprintf(stream,"Unknown!\n");
+ HDfprintf(stream,"Unknown!\n");
break;
} /* end switch */
@@ -931,25 +931,25 @@ H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream,
H5P_is_fill_value_defined((const H5O_fill_t *)fill, &fill_status);
switch(fill_status) {
case H5D_FILL_VALUE_UNDEFINED:
- fprintf(stream,"Undefined\n");
+ HDfprintf(stream,"Undefined\n");
break;
case H5D_FILL_VALUE_DEFAULT:
- fprintf(stream,"Default\n");
+ HDfprintf(stream,"Default\n");
break;
case H5D_FILL_VALUE_USER_DEFINED:
- fprintf(stream,"User Defined\n");
+ HDfprintf(stream,"User Defined\n");
break;
case H5D_FILL_VALUE_ERROR:
default:
- fprintf(stream,"Unknown!\n");
+ HDfprintf(stream,"Unknown!\n");
break;
} /* end switch */
HDfprintf(stream, "%*s%-*s %Zd\n", indent, "", fwidth,
- "Size:", fill->size);
+ "Size:", fill->size);
HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Data type:");
if(fill->type) {
H5T_debug(fill->type, stream);
@@ -961,18 +961,18 @@ H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream,
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__fill_debug() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_fill_convert
+ * Function: H5O_fill_convert
*
- * Purpose: Convert a fill value from whatever data type it currently has
+ * Purpose: Convert a fill value from whatever data type it currently has
* to the specified dataset type. The `type' field of the fill
* value struct will be set to NULL to indicate that it has the
* same type as the dataset.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, October 1, 1998
*
*-------------------------------------------------------------------------
@@ -980,10 +980,10 @@ H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream,
herr_t
H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed)
{
- H5T_path_t *tpath; /* Type conversion info */
- void *buf = NULL, *bkg = NULL; /* Conversion buffers */
- hid_t src_id = -1, dst_id = -1; /* Datatype identifiers */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5T_path_t *tpath; /* Type conversion info */
+ void *buf = NULL, *bkg = NULL; /* Conversion buffers */
+ hid_t src_id = -1, dst_id = -1; /* Datatype identifiers */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1008,7 +1008,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed)
* Can we convert between source and destination data types?
*/
if(NULL == (tpath = H5T_path_find(fill->type, dset_type)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes")
/* Don't bother doing anything if there will be no actual conversion */
if(!H5T_path_noop(tpath)) {
@@ -1064,7 +1064,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_fill_convert() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O_fill_set_version
*
diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c
index bb15f62..8c42f46 100644
--- a/src/H5Ofsinfo.c
+++ b/src/H5Ofsinfo.c
@@ -15,7 +15,7 @@
*
* Created: H5Ofsinfo.c
* Feb 2009
- * Vailin Choi
+ * Vailin Choi
*
* Purpose: File space info message.
*
@@ -25,11 +25,11 @@
#include "H5Omodule.h" /* This source code file is part of the H5O module */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
-#include "H5FLprivate.h" /* Free lists */
-#include "H5Opkg.h" /* Object headers */
+#include "H5FLprivate.h" /* Free lists */
+#include "H5Opkg.h" /* Object headers */
/* PRIVATE PROTOTYPES */
static void *H5O_fsinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
@@ -43,36 +43,32 @@ static herr_t H5O__fsinfo_debug(H5F_t *f, const void *_mesg, FILE * stream,
/* This message derives from H5O message class */
const H5O_msg_class_t H5O_MSG_FSINFO[1] = {{
- H5O_FSINFO_ID, /* message id number */
- "fsinfo", /* message name for debugging */
- sizeof(H5O_fsinfo_t), /* native message size */
- 0, /* messages are sharable? */
- H5O_fsinfo_decode, /* decode message */
- H5O_fsinfo_encode, /* encode message */
- H5O_fsinfo_copy, /* copy the native value */
- H5O_fsinfo_size, /* size of free-space manager info message */
- NULL, /* default reset method */
- H5O__fsinfo_free, /* free method */
- NULL, /* file delete method */
- NULL, /* link method */
- NULL, /* set share method */
- NULL, /* can share method */
- NULL, /* pre copy native value to file */
- NULL, /* copy native value to file */
- NULL, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O__fsinfo_debug /* debug the message */
+ H5O_FSINFO_ID, /* message id number */
+ "fsinfo", /* message name for debugging */
+ sizeof(H5O_fsinfo_t), /* native message size */
+ 0, /* messages are sharable? */
+ H5O_fsinfo_decode, /* decode message */
+ H5O_fsinfo_encode, /* encode message */
+ H5O_fsinfo_copy, /* copy the native value */
+ H5O_fsinfo_size, /* size of free-space manager info message */
+ NULL, /* default reset method */
+ H5O__fsinfo_free, /* free method */
+ NULL, /* file delete method */
+ NULL, /* link method */
+ NULL, /* set share method */
+ NULL, /* can share method */
+ NULL, /* pre copy native value to file */
+ NULL, /* copy native value to file */
+ NULL, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O__fsinfo_debug /* debug the message */
}};
-/* Current version of free-space manager info information */
-#define H5O_FSINFO_VERSION_0 0
-#define H5O_FSINFO_VERSION_1 1
-
/* Declare a free list to manage the H5O_fsinfo_t struct */
H5FL_DEFINE_STATIC(H5O_fsinfo_t);
-
+
/*-------------------------------------------------------------------------
* Function: H5O_fsinfo_decode
*
@@ -103,7 +99,7 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh,
/* Allocate space for message */
if(NULL == (fsinfo = H5FL_CALLOC(H5O_fsinfo_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype))
fsinfo->fs_addr[ptype - 1] = HADDR_UNDEF;
@@ -157,11 +153,13 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file space strategy")
} /* end switch */
+ fsinfo->version = H5O_FSINFO_VERSION_1;
fsinfo->mapped = TRUE;
-
+
} else {
- HDassert(vers == H5O_FSINFO_VERSION_1);
+ HDassert(vers >= H5O_FSINFO_VERSION_1);
+ fsinfo->version = vers;
fsinfo->strategy = (H5F_fspace_strategy_t)*p++; /* File space strategy */
fsinfo->persist = *p++; /* Free-space persist or not */
H5F_DECODE_LENGTH(f, p, fsinfo->threshold); /* Free-space section threshold */
@@ -189,7 +187,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_fsinfo_decode() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O_fsinfo_encode
*
@@ -205,7 +203,7 @@ static herr_t
H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg;
- H5F_mem_page_t ptype; /* Memory type for iteration */
+ H5F_mem_page_t ptype; /* Memory type for iteration */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -214,13 +212,13 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c
HDassert(p);
HDassert(fsinfo);
- *p++ = H5O_FSINFO_VERSION_1; /* message version */
- *p++ = fsinfo->strategy; /* File space strategy */
- *p++ = (unsigned char)fsinfo->persist; /* Free-space persist or not */
+ *p++ = (uint8_t)fsinfo->version; /* message version */
+ *p++ = fsinfo->strategy; /* File space strategy */
+ *p++ = (unsigned char)fsinfo->persist; /* Free-space persist or not */
H5F_ENCODE_LENGTH(f, p, fsinfo->threshold); /* Free-space section size threshold */
- H5F_ENCODE_LENGTH(f, p, fsinfo->page_size); /* File space page size */
- UINT16ENCODE(p, fsinfo->pgend_meta_thres); /* Page end metadata threshold */
+ H5F_ENCODE_LENGTH(f, p, fsinfo->page_size); /* File space page size */
+ UINT16ENCODE(p, fsinfo->pgend_meta_thres); /* Page end metadata threshold */
H5F_addr_encode(f, &p, fsinfo->eoa_pre_fsm_fsalloc); /* EOA before free-space header and section info */
/* Store addresses of free-space managers, if persisting */
@@ -233,7 +231,7 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_fsinfo_encode() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O_fsinfo_copy
*
@@ -259,7 +257,7 @@ H5O_fsinfo_copy(const void *_mesg, void *_dest)
/* check args */
HDassert(fsinfo);
if(!dest && NULL == (dest = H5FL_CALLOC(H5O_fsinfo_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* copy */
*dest = *fsinfo;
@@ -271,7 +269,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_fsinfo_copy() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O_fsinfo_size
*
@@ -295,11 +293,11 @@ H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi
FUNC_ENTER_NOAPI_NOINIT_NOERR
ret_value = 3 /* Version, strategy & persist */
- + (size_t)H5F_SIZEOF_SIZE(f) /* Free-space section threshold */
- + (size_t)H5F_SIZEOF_SIZE(f) /* File space page size */
- + 2 /* Page end meta threshold */
- + (size_t)H5F_SIZEOF_ADDR(f);
-
+ + (size_t)H5F_SIZEOF_SIZE(f) /* Free-space section threshold */
+ + (size_t)H5F_SIZEOF_SIZE(f) /* File space page size */
+ + 2 /* Page end meta threshold */
+ + (size_t)H5F_SIZEOF_ADDR(f);
+
/* Free-space manager addresses */
if(fsinfo->persist)
ret_value += (H5F_MEM_PAGE_NTYPES - 1) * (size_t)H5F_SIZEOF_ADDR(f);
@@ -307,7 +305,7 @@ H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_fsinfo_size() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O__fsinfo_free
*
@@ -347,7 +345,7 @@ static herr_t
H5O__fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream,
int indent, int fwidth)
{
- const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *) _mesg;
+ const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *) _mesg;
H5F_mem_page_t ptype; /* Free-space types for iteration */
FUNC_ENTER_STATIC_NOERR
diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c
index b75a9c5..4b34a52 100644
--- a/src/H5Oginfo.c
+++ b/src/H5Oginfo.c
@@ -113,7 +113,7 @@ H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
/* Allocate space for message */
if(NULL == (ginfo = H5FL_CALLOC(H5O_ginfo_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Get the flags for the group */
flags = *p++;
@@ -231,7 +231,7 @@ H5O_ginfo_copy(const void *_mesg, void *_dest)
/* check args */
HDassert(ginfo);
if(!dest && NULL == (dest = H5FL_MALLOC(H5O_ginfo_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* copy */
*dest = *ginfo;
diff --git a/src/H5Oint.c b/src/H5Oint.c
index 09e6bb8..543637c 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -352,9 +352,16 @@ H5O__create_ohdr(H5F_t *f, hid_t ocpl_id)
if(NULL == oc_plist)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, NULL, "not a property list")
- /* Get any object header status flags set by properties */
- if(H5P_get(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &oh_flags) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get object header flags")
+ if(H5P_DATASET_CREATE_DEFAULT == ocpl_id) {
+ /* If the OCPL is the default DCPL, we can get the header flags from the
+ * API context. Otherwise we have to call H5P_get */
+ if(H5CX_get_ohdr_flags(&oh_flags) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get object header flags")
+ }
+ else {
+ if(H5P_get(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &oh_flags) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get object header flags")
+ }
if(H5O_set_version(f, oh, oh_flags, H5F_STORE_MSG_CRT_IDX(f)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, NULL, "can't set version of object header")
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index d0c7f3e..ba63a16 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -1045,7 +1045,8 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
layout_dst->storage.u.contig.size = H5S_extent_nelem(udata->src_space_extent) *
H5T_get_size(udata->src_dtype);
- if(H5D__contig_is_space_alloc(&layout_src->storage)) {
+ if(H5D__contig_is_space_alloc(&layout_src->storage)
+ || (cpy_info->shared_fo && H5D__contig_is_data_cached((const H5D_shared_t *)cpy_info->shared_fo))) {
/* copy contiguous raw data */
if(H5D__contig_copy(file_src, &layout_src->storage.u.contig, file_dst, &layout_dst->storage.u.contig, udata->src_dtype, cpy_info) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy contiguous storage")
@@ -1054,7 +1055,8 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
break;
case H5D_CHUNKED:
- if(H5D__chunk_is_space_alloc(&layout_src->storage)) {
+ if(H5D__chunk_is_space_alloc(&layout_src->storage)
+ || (cpy_info->shared_fo && H5D__chunk_is_data_cached((const H5D_shared_t *)cpy_info->shared_fo))) {
/* Create chunked layout */
if(H5D__chunk_copy(file_src, &layout_src->storage.u.chunk, &layout_src->u.chunk, file_dst, &layout_dst->storage.u.chunk, udata->src_space_extent, udata->src_dtype, udata->common.src_pline, cpy_info) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage")
diff --git a/src/H5Omessage.c b/src/H5Omessage.c
index b38d74e..9fba865 100644
--- a/src/H5Omessage.c
+++ b/src/H5Omessage.c
@@ -127,11 +127,11 @@ H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags,
/* Pin the object header */
if(NULL == (oh = H5O_pin(loc)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header")
/* Go append message to object header */
if(H5O_msg_append_oh(loc->file, oh, type_id, mesg_flags, update_flags, mesg) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to append to object header")
+ HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to append to object header")
done:
if(oh && H5O_unpin(oh) < 0)
@@ -276,7 +276,7 @@ H5O_msg_write(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags,
/* Pin the object header */
if(NULL == (oh = H5O_pin(loc)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header")
/* Call the "real" modify routine */
if(H5O__msg_write_real(loc->file, oh, type, mesg_flags, update_flags, mesg) < 0)
@@ -384,7 +384,7 @@ H5O__msg_write_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type,
/* Check for modifying a constant message */
if(!(update_flags & H5O_UPDATE_FORCE) && (idx_msg->flags & H5O_MSG_FLAG_CONSTANT))
- HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to modify constant message")
+ HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to modify constant message")
/* This message is shared, but it's being modified. */
else if((idx_msg->flags & H5O_MSG_FLAG_SHARED) || (idx_msg->flags & H5O_MSG_FLAG_SHAREABLE)) {
htri_t status; /* Status of "try share" call */
@@ -474,15 +474,15 @@ H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg)
/* Get the object header */
if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header")
/* Call the "real" read routine */
if(NULL == (ret_value = H5O_msg_read_oh(loc->file, oh, type_id, mesg)))
- HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header message")
+ HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header message")
done:
if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0)
- HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header")
+ HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header")
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5O_msg_read() */
@@ -616,12 +616,12 @@ H5O__msg_reset_real(const H5O_msg_class_t *type, void *native)
HDassert(type);
if(native) {
- if(type->reset) {
- if((type->reset)(native) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "reset method failed")
- } /* end if */
+ if(type->reset) {
+ if((type->reset)(native) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "reset method failed")
+ } /* end if */
else
- HDmemset(native, 0, type->native_size);
+ HDmemset(native, 0, type->native_size);
} /* end if */
done:
@@ -798,7 +798,7 @@ H5O_msg_count(const H5O_loc_t *loc, unsigned type_id)
/* Load the object header */
if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header")
/* Count the messages of the correct type */
msg_count = H5O_msg_count_real(oh, type);
@@ -806,7 +806,7 @@ H5O_msg_count(const H5O_loc_t *loc, unsigned type_id)
done:
if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0)
- HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header")
+ HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_msg_count() */
@@ -841,7 +841,7 @@ H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type)
/* Loop over all messages, counting the ones of the type looked for */
for(u = ret_value = 0; u < oh->nmesgs; u++)
- if(oh->mesg[u].type == type)
+ if(oh->mesg[u].type == type)
ret_value++;
FUNC_LEAVE_NOAPI(ret_value)
@@ -976,11 +976,11 @@ H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, hbool_t adj
/* Pin the object header */
if(NULL == (oh = H5O_pin(loc)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header")
/* Call the "real" remove routine */
if((ret_value = H5O__msg_remove_real(loc->file, oh, type, sequence, NULL, NULL, adj_link)) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove object header message")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove object header message")
done:
if(oh && H5O_unpin(oh) < 0)
@@ -1028,11 +1028,11 @@ H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence,
/* Pin the object header */
if(NULL == (oh = H5O_pin(loc)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header")
/* Call the "real" remove routine */
if((ret_value = H5O__msg_remove_real(loc->file, oh, type, sequence, op, op_data, adj_link)) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove object header message")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove object header message")
done:
if(oh && H5O_unpin(oh) < 0)
@@ -1316,7 +1316,7 @@ done:
*/
if(oh_modified & H5O_MODIFY_CONDENSE)
if(H5O_condense_header(f, oh) < 0)
- HDONE_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack object header")
+ HDONE_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack object header")
/* Mark object header as changed */
if(H5O_touch_oh(f, oh, FALSE) < 0)
@@ -1980,7 +1980,7 @@ H5O__copy_mesg(H5F_t *f, H5O_t *oh, size_t idx, const H5O_msg_class_t *type,
/* Protect chunk */
if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, idx_msg->chunkno)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk")
/* Reset existing native information for the header's message */
H5O__msg_reset_real(type, idx_msg->native);
diff --git a/src/H5Omtime.c b/src/H5Omtime.c
index db1d8d7..e86804b 100644
--- a/src/H5Omtime.c
+++ b/src/H5Omtime.c
@@ -11,20 +11,20 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
- * Friday, July 24, 1998
+/* Programmer: Robb Matzke <matzke@llnl.gov>
+ * Friday, July 24, 1998
*
- * Purpose: The object modification time message.
+ * Purpose: The object modification time message.
*/
#include "H5Omodule.h" /* This source code file is part of the H5O module */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free lists */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free lists */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
static void *H5O__mtime_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
@@ -43,62 +43,62 @@ static herr_t H5O__mtime_debug(H5F_t *f, const void *_mesg, FILE *stream,
/* This message derives from H5O message class */
const H5O_msg_class_t H5O_MSG_MTIME[1] = {{
- H5O_MTIME_ID, /*message id number */
- "mtime", /*message name for debugging */
- sizeof(time_t), /*native message size */
- 0, /* messages are sharable? */
- H5O__mtime_decode, /*decode message */
- H5O_mtime_encode, /*encode message */
- H5O_mtime_copy, /*copy the native value */
- H5O_mtime_size, /*raw message size */
- NULL, /* reset method */
- H5O__mtime_free, /* free method */
- NULL, /* file delete method */
- NULL, /* link method */
- NULL, /*set share method */
- NULL, /*can share method */
- NULL, /* pre copy native value to file */
- NULL, /* copy native value to file */
- NULL, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O__mtime_debug /*debug the message */
+ H5O_MTIME_ID, /*message id number */
+ "mtime", /*message name for debugging */
+ sizeof(time_t), /*native message size */
+ 0, /* messages are sharable? */
+ H5O__mtime_decode, /*decode message */
+ H5O_mtime_encode, /*encode message */
+ H5O_mtime_copy, /*copy the native value */
+ H5O_mtime_size, /*raw message size */
+ NULL, /* reset method */
+ H5O__mtime_free, /* free method */
+ NULL, /* file delete method */
+ NULL, /* link method */
+ NULL, /*set share method */
+ NULL, /*can share method */
+ NULL, /* pre copy native value to file */
+ NULL, /* copy native value to file */
+ NULL, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O__mtime_debug /*debug the message */
}};
/* This message derives from H5O message class */
/* (Only encode, decode & size routines are different from old mtime routines) */
const H5O_msg_class_t H5O_MSG_MTIME_NEW[1] = {{
- H5O_MTIME_NEW_ID, /*message id number */
- "mtime_new", /*message name for debugging */
- sizeof(time_t), /*native message size */
- 0, /* messages are sharable? */
- H5O__mtime_new_decode, /*decode message */
- H5O_mtime_new_encode, /*encode message */
- H5O_mtime_copy, /*copy the native value */
- H5O_mtime_new_size, /*raw message size */
- NULL, /* reset method */
- H5O__mtime_free, /* free method */
- NULL, /* file delete method */
- NULL, /* link method */
- NULL, /*set share method */
- NULL, /*can share method */
- NULL, /* pre copy native value to file */
- NULL, /* copy native value to file */
- NULL, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O__mtime_debug /*debug the message */
+ H5O_MTIME_NEW_ID, /*message id number */
+ "mtime_new", /*message name for debugging */
+ sizeof(time_t), /*native message size */
+ 0, /* messages are sharable? */
+ H5O__mtime_new_decode, /*decode message */
+ H5O_mtime_new_encode, /*encode message */
+ H5O_mtime_copy, /*copy the native value */
+ H5O_mtime_new_size, /*raw message size */
+ NULL, /* reset method */
+ H5O__mtime_free, /* free method */
+ NULL, /* file delete method */
+ NULL, /* link method */
+ NULL, /*set share method */
+ NULL, /*can share method */
+ NULL, /* pre copy native value to file */
+ NULL, /* copy native value to file */
+ NULL, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O__mtime_debug /*debug the message */
}};
/* Current version of new mtime information */
-#define H5O_MTIME_VERSION 1
+#define H5O_MTIME_VERSION 1
/* Declare a free list to manage the time_t struct */
H5FL_DEFINE(time_t);
-
+
/*-------------------------------------------------------------------------
- * Function: H5O__mtime_new_decode
+ * Function: H5O__mtime_new_decode
*
* Purpose: Decode a new modification time message and return a pointer to
* a new time_t value.
@@ -106,13 +106,13 @@ H5FL_DEFINE(time_t);
* The new modification time message format was added due to the
* performance overhead of the old format.
*
- * Return: Success: Ptr to new message in native struct.
+ * Return: Success: Ptr to new message in native struct.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jan 3 2002
+ * Programmer: Quincey Koziol
+ * koziol@ncsa.uiuc.edu
+ * Jan 3 2002
*
*-------------------------------------------------------------------------
*/
@@ -121,7 +121,7 @@ H5O__mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
- time_t *mesg;
+ time_t *mesg;
uint32_t tmp_time; /* Temporary copy of the time */
void *ret_value = NULL; /* Return value */
@@ -153,9 +153,9 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O__mtime_new_decode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O__mtime_decode
+ * Function: H5O__mtime_decode
*
* Purpose: Decode a modification time message and return a pointer to a
* new time_t value.
@@ -163,13 +163,13 @@ done:
* The new modification time message format was added due to the
* performance overhead of the old format.
*
- * Return: Success: Ptr to new message in native struct.
+ * Return: Success: Ptr to new message in native struct.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 24 1998
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jul 24 1998
*
*-------------------------------------------------------------------------
*/
@@ -178,9 +178,9 @@ H5O__mtime_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
- time_t *mesg, the_time;
- struct tm tm;
- int i; /* Local index variable */
+ time_t *mesg, the_time;
+ struct tm tm;
+ int i; /* Local index variable */
void *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -218,24 +218,24 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O__mtime_decode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_new_encode
+ * Function: H5O_mtime_new_encode
*
- * Purpose: Encodes a new modification time message.
+ * Purpose: Encodes a new modification time message.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jan 3 2002
+ * Programmer: Quincey Koziol
+ * koziol@ncsa.uiuc.edu
+ * Jan 3 2002
*
*-------------------------------------------------------------------------
*/
static herr_t
H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
- const time_t *mesg = (const time_t *) _mesg;
+ const time_t *mesg = (const time_t *) _mesg;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -258,17 +258,17 @@ H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_mtime_new_encode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_encode
+ * Function: H5O_mtime_encode
*
- * Purpose: Encodes a modification time message.
+ * Purpose: Encodes a modification time message.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 24 1998
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jul 24 1998
*
* Modifications:
*
@@ -277,8 +277,8 @@ H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha
static herr_t
H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
- const time_t *mesg = (const time_t *) _mesg;
- struct tm *tm;
+ const time_t *mesg = (const time_t *) _mesg;
+ struct tm *tm;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -289,27 +289,27 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
/* encode */
tm = HDgmtime(mesg);
- sprintf((char*)p, "%04d%02d%02d%02d%02d%02d",
+ HDsprintf((char*)p, "%04d%02d%02d%02d%02d%02d",
1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
FUNC_LEAVE_NOAPI(SUCCEED)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_copy
+ * Function: H5O_mtime_copy
*
- * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
- * necessary.
+ * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
+ * necessary.
*
- * Return: Success: Ptr to _DEST
+ * Return: Success: Ptr to _DEST
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 24 1998
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jul 24 1998
*
* Modifications:
*
@@ -318,8 +318,8 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
static void *
H5O_mtime_copy(const void *_mesg, void *_dest)
{
- const time_t *mesg = (const time_t *) _mesg;
- time_t *dest = (time_t *) _dest;
+ const time_t *mesg = (const time_t *) _mesg;
+ time_t *dest = (time_t *) _dest;
void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -339,22 +339,22 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_new_size
+ * Function: H5O_mtime_new_size
*
- * Purpose: Returns the size of the raw message in bytes not
- * counting the message type or size fields, but only the data
- * fields. This function doesn't take into account
- * alignment.
+ * Purpose: Returns the size of the raw message in bytes not
+ * counting the message type or size fields, but only the data
+ * fields. This function doesn't take into account
+ * alignment.
*
- * Return: Success: Message data size in bytes w/o alignment.
+ * Return: Success: Message data size in bytes w/o alignment.
*
- * Failure: 0
+ * Failure: 0
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jan 3 2002
+ * Programmer: Quincey Koziol
+ * koziol@ncsa.uiuc.edu
+ * Jan 3 2002
*
* Modifications:
*
@@ -372,22 +372,22 @@ H5O_mtime_new_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disabl
FUNC_LEAVE_NOAPI(8)
} /* end H5O_mtime_new_size() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_size
+ * Function: H5O_mtime_size
*
- * Purpose: Returns the size of the raw message in bytes not
- * counting the message type or size fields, but only the data
- * fields. This function doesn't take into account
- * alignment.
+ * Purpose: Returns the size of the raw message in bytes not
+ * counting the message type or size fields, but only the data
+ * fields. This function doesn't take into account
+ * alignment.
*
- * Return: Success: Message data size in bytes w/o alignment.
+ * Return: Success: Message data size in bytes w/o alignment.
*
- * Failure: 0
+ * Failure: 0
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 14 1998
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jul 14 1998
*
* Modifications:
*
@@ -405,15 +405,15 @@ H5O_mtime_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_sh
FUNC_LEAVE_NOAPI(16)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5O__mtime_free
+ * Function: H5O__mtime_free
*
- * Purpose: Frees the message
+ * Purpose: Frees the message
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, March 30, 2000
*
*-------------------------------------------------------------------------
@@ -430,19 +430,17 @@ H5O__mtime_free(void *mesg)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__mtime_free() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O__mtime_debug
+ * Function: H5O__mtime_debug
*
- * Purpose: Prints debugging info for the message.
+ * Purpose: Prints debugging info for the message.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 24 1998
- *
- * Modifications:
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jul 24 1998
*
*-------------------------------------------------------------------------
*/
@@ -450,9 +448,9 @@ static herr_t
H5O__mtime_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream,
int indent, int fwidth)
{
- const time_t *mesg = (const time_t *)_mesg;
- struct tm *tm;
- char buf[128];
+ const time_t *mesg = (const time_t *)_mesg;
+ struct tm *tm;
+ char buf[128];
FUNC_ENTER_NOAPI_NOINIT_NOERR
diff --git a/src/H5Oname.c b/src/H5Oname.c
index a710944..dbfa710 100644
--- a/src/H5Oname.c
+++ b/src/H5Oname.c
@@ -25,10 +25,10 @@
#include "H5Omodule.h" /* This source code file is part of the H5O module */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
/* PRIVATE PROTOTYPES */
@@ -43,29 +43,29 @@ static herr_t H5O__name_debug(H5F_t *f, const void *_mesg, FILE * stream,
/* This message derives from H5O message class */
const H5O_msg_class_t H5O_MSG_NAME[1] = {{
- H5O_NAME_ID, /*message id number */
- "name", /*message name for debugging */
- sizeof(H5O_name_t), /*native message size */
- 0, /* messages are sharable? */
- H5O__name_decode, /*decode message */
- H5O_name_encode, /*encode message */
- H5O_name_copy, /*copy the native value */
- H5O_name_size, /*raw message size */
- H5O__name_reset, /*free internal memory */
- NULL, /* free method */
- NULL, /* file delete method */
- NULL, /* link method */
- NULL, /*set share method */
- NULL, /*can share method */
- NULL, /* pre copy native value to file */
- NULL, /* copy native value to file */
- NULL, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O__name_debug /*debug the message */
+ H5O_NAME_ID, /*message id number */
+ "name", /*message name for debugging */
+ sizeof(H5O_name_t), /*native message size */
+ 0, /* messages are sharable? */
+ H5O__name_decode, /*decode message */
+ H5O_name_encode, /*encode message */
+ H5O_name_copy, /*copy the native value */
+ H5O_name_size, /*raw message size */
+ H5O__name_reset, /*free internal memory */
+ NULL, /* free method */
+ NULL, /* file delete method */
+ NULL, /* link method */
+ NULL, /*set share method */
+ NULL, /*can share method */
+ NULL, /* pre copy native value to file */
+ NULL, /* copy native value to file */
+ NULL, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O__name_debug /*debug the message */
}};
-
+
/*-------------------------------------------------------------------------
* Function: H5O__name_decode
*
@@ -98,9 +98,9 @@ H5O__name_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
/* decode */
if(NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
if(NULL == (mesg->s = (char *)H5MM_strdup((const char *)p)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Set return value */
ret_value = mesg;
@@ -113,7 +113,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O__name_decode() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O_name_encode
*
@@ -147,7 +147,7 @@ H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
FUNC_LEAVE_NOAPI(SUCCEED)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5O_name_copy
*
@@ -179,7 +179,7 @@ H5O_name_copy(const void *_mesg, void *_dest)
HDassert(mesg);
if(!dest && NULL == (dest = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* copy */
*dest = *mesg;
@@ -197,7 +197,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_name_copy() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O_name_size
*
@@ -235,7 +235,7 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5O__name_reset
*
@@ -266,7 +266,7 @@ H5O__name_reset(void *_mesg)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__name_reset() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O__name_debug
*
@@ -286,7 +286,7 @@ static herr_t
H5O__name_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream,
int indent, int fwidth)
{
- const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
+ const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -297,7 +297,7 @@ H5O__name_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream,
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- fprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth,
"Name:",
mesg->s);
diff --git a/src/H5Opline.c b/src/H5Opline.c
index 1fae1b8..9a0f5da 100644
--- a/src/H5Opline.c
+++ b/src/H5Opline.c
@@ -12,23 +12,23 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
- * Wednesday, April 15, 1998
+ * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Wednesday, April 15, 1998
*
- * Purpose: Data filter pipeline message.
+ * Purpose: Data filter pipeline message.
*/
#include "H5Omodule.h" /* This source code file is part of the H5O module */
-#define H5Z_FRIEND /*suppress error about including H5Zpkg */
+#define H5Z_FRIEND /*suppress error about including H5Zpkg */
-#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
-#include "H5Zpkg.h" /* Data filters */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
+#include "H5Zpkg.h" /* Data filters */
/* PRIVATE PROTOTYPES */
@@ -45,48 +45,48 @@ static herr_t H5O__pline_debug(H5F_t *f, const void *_mesg, FILE * stream,
int indent, int fwidth);
/* Set up & include shared message "interface" info */
-#define H5O_SHARED_TYPE H5O_MSG_PLINE
-#define H5O_SHARED_DECODE H5O_pline_shared_decode
-#define H5O_SHARED_DECODE_REAL H5O__pline_decode
-#define H5O_SHARED_ENCODE H5O_pline_shared_encode
-#define H5O_SHARED_ENCODE_REAL H5O_pline_encode
-#define H5O_SHARED_SIZE H5O_pline_shared_size
-#define H5O_SHARED_SIZE_REAL H5O_pline_size
-#define H5O_SHARED_DELETE H5O__pline_shared_delete
+#define H5O_SHARED_TYPE H5O_MSG_PLINE
+#define H5O_SHARED_DECODE H5O_pline_shared_decode
+#define H5O_SHARED_DECODE_REAL H5O__pline_decode
+#define H5O_SHARED_ENCODE H5O_pline_shared_encode
+#define H5O_SHARED_ENCODE_REAL H5O_pline_encode
+#define H5O_SHARED_SIZE H5O_pline_shared_size
+#define H5O_SHARED_SIZE_REAL H5O_pline_size
+#define H5O_SHARED_DELETE H5O__pline_shared_delete
#undef H5O_SHARED_DELETE_REAL
-#define H5O_SHARED_LINK H5O__pline_shared_link
+#define H5O_SHARED_LINK H5O__pline_shared_link
#undef H5O_SHARED_LINK_REAL
-#define H5O_SHARED_COPY_FILE H5O__pline_shared_copy_file
+#define H5O_SHARED_COPY_FILE H5O__pline_shared_copy_file
#undef H5O_SHARED_COPY_FILE_REAL
-#define H5O_SHARED_POST_COPY_FILE H5O_pline_shared_post_copy_file
+#define H5O_SHARED_POST_COPY_FILE H5O_pline_shared_post_copy_file
#undef H5O_SHARED_POST_COPY_FILE_REAL
#undef H5O_SHARED_POST_COPY_FILE_UPD
-#define H5O_SHARED_DEBUG H5O_pline_shared_debug
-#define H5O_SHARED_DEBUG_REAL H5O__pline_debug
-#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
+#define H5O_SHARED_DEBUG H5O_pline_shared_debug
+#define H5O_SHARED_DEBUG_REAL H5O__pline_debug
+#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
/* This message derives from H5O message class */
const H5O_msg_class_t H5O_MSG_PLINE[1] = {{
- H5O_PLINE_ID, /* message id number */
- "filter pipeline", /* message name for debugging */
- sizeof(H5O_pline_t), /* native message size */
- H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */
- H5O_pline_shared_decode, /* decode message */
- H5O_pline_shared_encode, /* encode message */
- H5O_pline_copy, /* copy the native value */
- H5O_pline_shared_size, /* size of raw message */
- H5O__pline_reset, /* reset method */
- H5O__pline_free, /* free method */
- H5O__pline_shared_delete, /* file delete method */
- H5O__pline_shared_link, /* link method */
- NULL, /* set share method */
- NULL, /*can share method */
- H5O_pline_pre_copy_file, /* pre copy native value to file */
- H5O__pline_shared_copy_file, /* copy native value to file */
- H5O_pline_shared_post_copy_file, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O_pline_shared_debug /* debug the message */
+ H5O_PLINE_ID, /* message id number */
+ "filter pipeline", /* message name for debugging */
+ sizeof(H5O_pline_t), /* native message size */
+ H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */
+ H5O_pline_shared_decode, /* decode message */
+ H5O_pline_shared_encode, /* encode message */
+ H5O_pline_copy, /* copy the native value */
+ H5O_pline_shared_size, /* size of raw message */
+ H5O__pline_reset, /* reset method */
+ H5O__pline_free, /* free method */
+ H5O__pline_shared_delete, /* file delete method */
+ H5O__pline_shared_link, /* link method */
+ NULL, /* set share method */
+ NULL, /*can share method */
+ H5O_pline_pre_copy_file, /* pre copy native value to file */
+ H5O__pline_shared_copy_file, /* copy native value to file */
+ H5O_pline_shared_post_copy_file, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O_pline_shared_debug /* debug the message */
}};
/* Format version bounds for filter pipleline */
@@ -99,16 +99,16 @@ const unsigned H5O_pline_ver_bounds[] = {
/* Declare a free list to manage the H5O_pline_t struct */
H5FL_DEFINE(H5O_pline_t);
-
+
/*-------------------------------------------------------------------------
- * Function: H5O__pline_decode
+ * Function: H5O__pline_decode
*
- * Purpose: Decodes a filter pipeline message.
+ * Purpose: Decodes a filter pipeline message.
*
- * Return: Success: Ptr to the native message.
- * Failure: NULL
+ * Return: Success: Ptr to the native message.
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -118,12 +118,12 @@ H5O__pline_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
size_t p_size, const uint8_t *p)
{
- H5O_pline_t *pline = NULL; /* Pipeline message */
+ H5O_pline_t *pline = NULL; /* Pipeline message */
H5Z_filter_info_t *filter; /* Filter to decode */
- size_t name_length; /* Length of filter name */
- size_t i; /* Local index variable */
+ size_t name_length; /* Length of filter name */
+ size_t i; /* Local index variable */
const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */
- void *ret_value = NULL; /* Return value */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -203,7 +203,7 @@ H5O__pline_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
/* Filter parameters */
if(filter->cd_nelmts) {
- size_t j; /* Local index variable */
+ size_t j; /* Local index variable */
/* Allocate space for the client data elements, or use the internal buffer */
if(filter->cd_nelmts > H5Z_COMMON_CD_VALUES) {
@@ -242,15 +242,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O__pline_decode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_pline_encode
+ * Function: H5O_pline_encode
*
- * Purpose: Encodes message MESG into buffer P.
+ * Purpose: Encodes message MESG into buffer P.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -258,9 +258,9 @@ done:
static herr_t
H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg)
{
- const H5O_pline_t *pline = (const H5O_pline_t*)mesg; /* Pipeline message to encode */
+ const H5O_pline_t *pline = (const H5O_pline_t*)mesg; /* Pipeline message to encode */
const H5Z_filter_info_t *filter; /* Filter to encode */
- size_t i, j; /* Local index variables */
+ size_t i, j; /* Local index variables */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -272,21 +272,21 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg)
*p++ = (uint8_t)pline->version;
*p++ = (uint8_t)(pline->nused);
if(pline->version == H5O_PLINE_VERSION_1) {
- *p++ = 0; /*reserved 1*/
- *p++ = 0; /*reserved 2*/
- *p++ = 0; /*reserved 3*/
- *p++ = 0; /*reserved 4*/
- *p++ = 0; /*reserved 5*/
- *p++ = 0; /*reserved 6*/
+ *p++ = 0; /*reserved 1*/
+ *p++ = 0; /*reserved 2*/
+ *p++ = 0; /*reserved 3*/
+ *p++ = 0; /*reserved 4*/
+ *p++ = 0; /*reserved 5*/
+ *p++ = 0; /*reserved 6*/
} /* end if */
/* Encode filters */
for(i = 0, filter = &pline->filter[0]; i < pline->nused; i++, filter++) {
- const char *name; /* Filter name */
- size_t name_length; /* Length of filter name */
+ const char *name; /* Filter name */
+ size_t name_length; /* Length of filter name */
/* Filter ID */
- UINT16ENCODE(p, filter->id);
+ UINT16ENCODE(p, filter->id);
/* Skip writing the name length & name if the filter is an internal filter */
if(pline->version > H5O_PLINE_VERSION_1 && filter->id < H5Z_FILTER_RESERVED) {
@@ -294,7 +294,7 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg)
name = NULL;
} /* end if */
else {
- H5Z_class2_t *cls; /* Filter class */
+ H5Z_class2_t *cls; /* Filter class */
/*
* Get the filter name. If the pipeline message has a name in it then
@@ -310,26 +310,26 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg)
} /* end else */
/* Filter flags */
- UINT16ENCODE(p, filter->flags);
+ UINT16ENCODE(p, filter->flags);
/* # of filter parameters */
- UINT16ENCODE(p, filter->cd_nelmts);
+ UINT16ENCODE(p, filter->cd_nelmts);
/* Encode name, if there is one to encode */
- if(name_length > 0) {
+ if(name_length > 0) {
/* Store name, with null terminator */
- HDmemcpy(p, name, name_length);
- p += name_length;
+ HDmemcpy(p, name, name_length);
+ p += name_length;
/* Pad out name to alignment, in older versions */
if(pline->version == H5O_PLINE_VERSION_1)
while(name_length++ % 8)
*p++ = 0;
- } /* end if */
+ } /* end if */
/* Filter parameters */
- for(j = 0; j < filter->cd_nelmts; j++)
- UINT32ENCODE(p, filter->cd_values[j]);
+ for(j = 0; j < filter->cd_nelmts; j++)
+ UINT32ENCODE(p, filter->cd_values[j]);
/* Align the parameters for older versions of the format */
if(pline->version == H5O_PLINE_VERSION_1)
@@ -340,19 +340,19 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_pline_encode() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_pline_copy
+ * Function: H5O_pline_copy
*
- * Purpose: Copies a filter pipeline message from SRC to DST allocating
- * DST if necessary. If DST is already allocated then we assume
- * that it isn't initialized.
+ * Purpose: Copies a filter pipeline message from SRC to DST allocating
+ * DST if necessary. If DST is already allocated then we assume
+ * that it isn't initialized.
*
- * Return: Success: Ptr to DST or allocated result.
+ * Return: Success: Ptr to DST or allocated result.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -360,16 +360,16 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg)
static void *
H5O_pline_copy(const void *_src, void *_dst/*out*/)
{
- const H5O_pline_t *src = (const H5O_pline_t *)_src; /* Source pipeline message */
- H5O_pline_t *dst = (H5O_pline_t *)_dst; /* Destination pipeline message */
- size_t i; /* Local index variable */
- H5O_pline_t *ret_value = NULL; /* Return value */
+ const H5O_pline_t *src = (const H5O_pline_t *)_src; /* Source pipeline message */
+ H5O_pline_t *dst = (H5O_pline_t *)_dst; /* Destination pipeline message */
+ size_t i; /* Local index variable */
+ H5O_pline_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Allocate pipeline message, if not provided */
if(!dst && NULL == (dst = H5FL_MALLOC(H5O_pline_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Shallow copy basic fields */
*dst = *src;
@@ -378,8 +378,8 @@ H5O_pline_copy(const void *_src, void *_dst/*out*/)
dst->nalloc = dst->nused;
if(dst->nalloc) {
/* Allocate array to hold filters */
- if(NULL == (dst->filter = (H5Z_filter_info_t *)H5MM_calloc(dst->nalloc * sizeof(dst->filter[0]))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ if(NULL == (dst->filter = (H5Z_filter_info_t *)H5MM_calloc(dst->nalloc * sizeof(dst->filter[0]))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Deep-copy filters */
for(i = 0; i < src->nused; i++) {
@@ -418,7 +418,7 @@ H5O_pline_copy(const void *_src, void *_dst/*out*/)
} /* end for */
} /* end if */
else
- dst->filter = NULL;
+ dst->filter = NULL;
/* Set return value */
ret_value = dst;
@@ -426,24 +426,24 @@ H5O_pline_copy(const void *_src, void *_dst/*out*/)
done:
if(!ret_value && dst) {
H5O__pline_reset(dst);
- if(!_dst)
+ if(!_dst)
H5O__pline_free(dst);
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_pline_copy() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O_pline_size
+ * Function: H5O_pline_size
*
- * Purpose: Determines the size of a raw filter pipeline message.
+ * Purpose: Determines the size of a raw filter pipeline message.
*
- * Return: Success: Size of message.
+ * Return: Success: Size of message.
*
- * Failure: zero
+ * Failure: zero
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -451,27 +451,27 @@ done:
static size_t
H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg)
{
- const H5O_pline_t *pline = (const H5O_pline_t*)mesg; /* Pipeline message */
+ const H5O_pline_t *pline = (const H5O_pline_t*)mesg; /* Pipeline message */
size_t i; /* Local index variable */
size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Message header */
- ret_value = 1 + /*version */
- 1 + /*number of filters */
- (pline->version == H5O_PLINE_VERSION_1 ? 6 : 0); /*reserved */
+ ret_value = (size_t)(1 + /*version */
+ 1 + /*number of filters */
+ (pline->version == H5O_PLINE_VERSION_1 ? 6 : 0)); /*reserved */
/* Calculate size of each filter in pipeline */
for(i = 0; i < pline->nused; i++) {
- size_t name_len; /* Length of filter name */
+ size_t name_len; /* Length of filter name */
const char *name; /* Filter name */
/* Don't write the name length & name if the filter is an internal filter */
if(pline->version > H5O_PLINE_VERSION_1 && pline->filter[i].id < H5Z_FILTER_RESERVED)
name_len = 0;
else {
- H5Z_class2_t *cls; /* Filter class */
+ H5Z_class2_t *cls; /* Filter class */
/* Get the name of the filter, same as done with H5O_pline_encode() */
if(NULL == (name = pline->filter[i].name) && (cls = H5Z_find(pline->filter[i].id)))
@@ -479,13 +479,13 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg)
name_len = name ? HDstrlen(name) + 1 : 0;
} /* end else */
- ret_value += 2 + /*filter identification number */
- (size_t)((pline->version == H5O_PLINE_VERSION_1 || pline->filter[i].id >= H5Z_FILTER_RESERVED) ? 2 : 0) + /*name length */
- 2 + /*flags */
- 2 + /*number of client data values */
- (pline->version == H5O_PLINE_VERSION_1 ? (size_t)H5O_ALIGN_OLD(name_len) : name_len); /*length of the filter name */
+ ret_value += 2 + /*filter identification number */
+ (size_t)((pline->version == H5O_PLINE_VERSION_1 || pline->filter[i].id >= H5Z_FILTER_RESERVED) ? 2 : 0) + /*name length */
+ 2 + /*flags */
+ 2 + /*number of client data values */
+ (pline->version == H5O_PLINE_VERSION_1 ? (size_t)H5O_ALIGN_OLD(name_len) : name_len); /*length of the filter name */
- ret_value += pline->filter[i].cd_nelmts * 4;
+ ret_value += pline->filter[i].cd_nelmts * 4;
if(pline->version == H5O_PLINE_VERSION_1)
if(pline->filter[i].cd_nelmts % 2)
ret_value += 4;
@@ -494,16 +494,16 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_pline_size() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O__pline_reset
+ * Function: H5O__pline_reset
*
- * Purpose: Resets a filter pipeline message by clearing all filters.
- * The MESG buffer is not freed.
+ * Purpose: Resets a filter pipeline message by clearing all filters.
+ * The MESG buffer is not freed.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -511,8 +511,8 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg)
static herr_t
H5O__pline_reset(void *mesg)
{
- H5O_pline_t *pline = (H5O_pline_t*)mesg; /* Pipeline message */
- size_t i; /* Local index variable */
+ H5O_pline_t *pline = (H5O_pline_t*)mesg; /* Pipeline message */
+ size_t i; /* Local index variable */
FUNC_ENTER_STATIC_NOERR
@@ -550,15 +550,15 @@ H5O__pline_reset(void *mesg)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__pline_reset() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O__pline_free
+ * Function: H5O__pline_free
*
- * Purpose: Frees the message
+ * Purpose: Frees the message
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, March 11, 2000
*
*-------------------------------------------------------------------------
@@ -575,7 +575,7 @@ H5O__pline_free(void *mesg)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__pline_free() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O_pline_pre_copy_file
*
@@ -623,17 +623,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_pline_pre_copy_file() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5O__pline_debug
+ * Function: H5O__pline_debug
*
- * Purpose: Prints debugging information for filter pipeline message MESG
- * on output stream STREAM. Each line is indented INDENT
- * characters and the field name takes up FWIDTH characters.
+ * Purpose: Prints debugging information for filter pipeline message MESG
+ * on output stream STREAM. Each line is indented INDENT
+ * characters and the field name takes up FWIDTH characters.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -642,8 +642,8 @@ static herr_t
H5O__pline_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream,
int indent, int fwidth)
{
- const H5O_pline_t *pline = (const H5O_pline_t *)mesg;
- size_t i, j;
+ const H5O_pline_t *pline = (const H5O_pline_t *)mesg;
+ size_t i, j;
FUNC_ENTER_STATIC_NOERR
@@ -655,48 +655,48 @@ H5O__pline_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream,
HDassert(fwidth >= 0);
HDfprintf(stream, "%*s%-*s %Zu/%Zu\n", indent, "", fwidth,
- "Number of filters:",
- pline->nused,
- pline->nalloc);
+ "Number of filters:",
+ pline->nused,
+ pline->nalloc);
/* Loop over all the filters */
for(i = 0; i < pline->nused; i++) {
- char name[32];
-
- HDsnprintf(name, sizeof(name), "Filter at position %u", (unsigned)i);
- HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, name);
- HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3),
- "Filter identification:",
- (unsigned)(pline->filter[i].id));
- if(pline->filter[i].name)
- HDfprintf(stream, "%*s%-*s \"%s\"\n", indent + 3, "", MAX(0, fwidth - 3),
- "Filter name:",
- pline->filter[i].name);
- else
- HDfprintf(stream, "%*s%-*s NONE\n", indent + 3, "", MAX(0, fwidth - 3),
- "Filter name:");
- HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3),
- "Flags:",
- pline->filter[i].flags);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3),
- "Num CD values:",
- pline->filter[i].cd_nelmts);
+ char name[32];
+
+ HDsnprintf(name, sizeof(name), "Filter at position %u", (unsigned)i);
+ HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, name);
+ HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3),
+ "Filter identification:",
+ (unsigned)(pline->filter[i].id));
+ if(pline->filter[i].name)
+ HDfprintf(stream, "%*s%-*s \"%s\"\n", indent + 3, "", MAX(0, fwidth - 3),
+ "Filter name:",
+ pline->filter[i].name);
+ else
+ HDfprintf(stream, "%*s%-*s NONE\n", indent + 3, "", MAX(0, fwidth - 3),
+ "Filter name:");
+ HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3),
+ "Flags:",
+ pline->filter[i].flags);
+ HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3),
+ "Num CD values:",
+ pline->filter[i].cd_nelmts);
/* Filter parameters */
- for(j = 0; j < pline->filter[i].cd_nelmts; j++) {
- char field_name[32];
-
- HDsnprintf(field_name, sizeof(field_name), "CD value %lu", (unsigned long)j);
- HDfprintf(stream, "%*s%-*s %u\n", indent + 6, "", MAX(0, fwidth - 6),
- field_name,
- pline->filter[i].cd_values[j]);
- } /* end for */
+ for(j = 0; j < pline->filter[i].cd_nelmts; j++) {
+ char field_name[32];
+
+ HDsnprintf(field_name, sizeof(field_name), "CD value %lu", (unsigned long)j);
+ HDfprintf(stream, "%*s%-*s %u\n", indent + 6, "", MAX(0, fwidth - 6),
+ field_name,
+ pline->filter[i].cd_values[j]);
+ } /* end for */
} /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__pline_debug() */
-
+
/*-------------------------------------------------------------------------
* Function: H5O_pline_set_version
*
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index 34683fe..955155b 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -803,6 +803,17 @@ typedef uint32_t H5O_refcount_t; /* Contains # of links to object, if >1
*/
typedef unsigned H5O_unknown_t; /* Original message type ID */
+/* To indicate an invalid version for a message that does not exist yet for the release */
+/* Message version is 1 byte so the value can be 0 to 255 */
+#define H5O_INVALID_VERSION 256
+
+/* The initial version of the fsinfo message: deprecated */
+/* This version is mapped to version 1 from release 1.10.1 onwards */
+#define H5O_FSINFO_VERSION_0 0
+
+/* The latest version for fsinfo message */
+#define H5O_FSINFO_VERSION_1 1
+#define H5O_FSINFO_VERSION_LATEST H5O_FSINFO_VERSION_1
/*
* File space info Message.
* Contains file space management info and
@@ -810,6 +821,7 @@ typedef unsigned H5O_unknown_t; /* Original message type ID */
* (Data structure in memory)
*/
typedef struct H5O_fsinfo_t {
+ unsigned version; /* Version number */
H5F_fspace_strategy_t strategy; /* File space strategy */
hbool_t persist; /* Persisting free-space or not */
hsize_t threshold; /* Free-space section threshold */
diff --git a/src/H5Opublic.h b/src/H5Opublic.h
index cbccc7a..dcbf85a 100644
--- a/src/H5Opublic.h
+++ b/src/H5Opublic.h
@@ -26,9 +26,9 @@
#define _H5Opublic_H
/* Public headers needed by this file */
-#include "H5public.h" /* Generic Functions */
-#include "H5Ipublic.h" /* IDs */
-#include "H5Lpublic.h" /* Links */
+#include "H5public.h" /* Generic Functions */
+#include "H5Ipublic.h" /* IDs */
+#include "H5Lpublic.h" /* Links */
/*****************/
/* Public Macros */
@@ -38,7 +38,7 @@
#define H5O_COPY_SHALLOW_HIERARCHY_FLAG (0x0001u) /* Copy only immediate members */
#define H5O_COPY_EXPAND_SOFT_LINK_FLAG (0x0002u) /* Expand soft links into new objects */
#define H5O_COPY_EXPAND_EXT_LINK_FLAG (0x0004u) /* Expand external links into new objects */
-#define H5O_COPY_EXPAND_REFERENCE_FLAG (0x0008u) /* Copy objects that are pointed by references */
+#define H5O_COPY_EXPAND_REFERENCE_FLAG (0x0008u) /* Copy objects that are pointed by references */
#define H5O_COPY_WITHOUT_ATTR_FLAG (0x0010u) /* Copy object without copying attributes */
#define H5O_COPY_PRESERVE_NULL_FLAG (0x0020u) /* Copy NULL messages (empty space) */
#define H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG (0x0040u) /* Merge committed datatypes in dest file */
@@ -155,13 +155,13 @@ typedef H5O_mcdt_search_ret_t (*H5O_mcdt_search_cb_t)(void *op_data);
/********************/
+/*********************/
+/* Public Prototypes */
+/*********************/
#ifdef __cplusplus
extern "C" {
#endif
-/*********************/
-/* Public Prototypes */
-/*********************/
H5_DLL hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id);
H5_DLL hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr);
H5_DLL hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name,
diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c
index dbab28c..89c00ad 100644
--- a/src/H5Ounknown.c
+++ b/src/H5Ounknown.c
@@ -63,11 +63,11 @@ H5FL_DEFINE(H5O_unknown_t);
/*-------------------------------------------------------------------------
- * Function: H5O__unknown_free
+ * Function: H5O__unknown_free
*
- * Purpose: Frees the message
+ * Purpose: Frees the message
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Tuesday, May 1, 2007
diff --git a/src/H5P.c b/src/H5P.c
index 180e005..9d3b903 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -840,10 +840,7 @@ herr_t
H5Pencode(hid_t plist_id, void *buf, size_t *nalloc)
{
H5P_genplist_t *plist; /* Property list to query */
- H5P_genplist_t *fapl_plist;
- hid_t new_fapl_id;
- H5F_libver_t low_bound = H5F_LIBVER_V110;
- H5F_libver_t high_bound = H5F_LIBVER_V110;
+ hid_t temp_fapl_id = H5P_DEFAULT;
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
@@ -853,8 +850,12 @@ H5Pencode(hid_t plist_id, void *buf, size_t *nalloc)
if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
+ /* Verify access property list and set up collective metadata if appropriate */
+ if(H5CX_set_apl(&temp_fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info")
+
/* Call the internal encode routine */
- if((ret_value = H5P__encode(plist, TRUE, buf, nalloc, H5P_FILE_ACCESS_DEFAULT)) < 0)
+ if((ret_value = H5P__encode(plist, TRUE, buf, nalloc)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to encode property list");
done:
diff --git a/src/H5PB.c b/src/H5PB.c
index a325ad1..8d29951 100644
--- a/src/H5PB.c
+++ b/src/H5PB.c
@@ -24,20 +24,20 @@
/* Module Setup */
/****************/
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
#include "H5PBmodule.h" /* This source code file is part of the H5PB module */
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fpkg.h" /* Files */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5Iprivate.h" /* IDs */
-#include "H5PBpkg.h" /* File access */
-#include "H5SLprivate.h" /* Skip List */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fpkg.h" /* Files */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5Iprivate.h" /* IDs */
+#include "H5PBpkg.h" /* File access */
+#include "H5SLprivate.h" /* Skip List */
/****************/
@@ -150,9 +150,9 @@ H5FL_DEFINE_STATIC(H5PB_t);
H5FL_DEFINE_STATIC(H5PB_entry_t);
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB_reset_stats
+ * Function: H5PB_reset_stats
*
* Purpose: This function was created without documentation.
* What follows is my best understanding of Mohamad's intent.
@@ -161,11 +161,11 @@ H5FL_DEFINE_STATIC(H5PB_entry_t);
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
-herr_t
+herr_t
H5PB_reset_stats(H5PB_t *page_buf)
{
FUNC_ENTER_NOAPI_NOERR
@@ -187,9 +187,9 @@ H5PB_reset_stats(H5PB_t *page_buf)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5PB_reset_stats() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB_get_stats
+ * Function: H5PB_get_stats
*
* Purpose: This function was created without documentation.
* What follows is my best understanding of Mohamad's intent.
@@ -201,13 +201,13 @@ H5PB_reset_stats(H5PB_t *page_buf)
* --evictions: the number of metadata and raw data evictions from the page buffer layer
* --bypasses: the number of metadata and raw data accesses that bypass the page buffer layer
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
-herr_t
+herr_t
H5PB_get_stats(const H5PB_t *page_buf, unsigned accesses[2], unsigned hits[2],
unsigned misses[2], unsigned evictions[2], unsigned bypasses[2])
{
@@ -230,18 +230,18 @@ H5PB_get_stats(const H5PB_t *page_buf, unsigned accesses[2], unsigned hits[2],
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5PB_get_stats */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB_print_stats()
+ * Function: H5PB_print_stats()
*
* Purpose: This function was created without documentation.
* What follows is my best understanding of Mohamad's intent.
*
* Print out statistics collected for the page buffer layer.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
@@ -252,7 +252,7 @@ H5PB_print_stats(const H5PB_t *page_buf)
HDassert(page_buf);
- printf("PAGE BUFFER STATISTICS:\n");
+ HDprintf("PAGE BUFFER STATISTICS:\n");
HDprintf("******* METADATA\n");
HDprintf("\t Total Accesses: %u\n", page_buf->accesses[0]);
@@ -275,15 +275,15 @@ H5PB_print_stats(const H5PB_t *page_buf)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5PB_print_stats */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB_create
+ * Function: H5PB_create
*
- * Purpose: Create and setup the PB on the file.
+ * Purpose: Create and setup the PB on the file.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
@@ -314,7 +314,7 @@ H5PB_create(H5F_t *f, size_t size, unsigned page_buf_min_meta_perc, unsigned pag
/* Allocate the new page buffering structure */
if(NULL == (page_buf = H5FL_CALLOC(H5PB_t)))
- HGOTO_ERROR(H5E_PAGEBUF, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_PAGEBUF, H5E_NOSPACE, FAIL, "memory allocation failed")
page_buf->max_size = size;
H5_CHECKED_ASSIGN(page_buf->page_size, size_t, f->shared->fs_page_size, hsize_t);
@@ -322,7 +322,7 @@ H5PB_create(H5F_t *f, size_t size, unsigned page_buf_min_meta_perc, unsigned pag
page_buf->min_raw_perc = page_buf_min_raw_perc;
/* Calculate the minimum page count for metadata and raw data
- * based on the fractions provided
+ * based on the fractions provided
*/
page_buf->min_meta_count = (unsigned)((size * page_buf_min_meta_perc) / (f->shared->fs_page_size * 100));
page_buf->min_raw_count = (unsigned)((size * page_buf_min_raw_perc) / (f->shared->fs_page_size * 100));
@@ -353,15 +353,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5PB_create */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB__flush_cb
+ * Function: H5PB__flush_cb
*
- * Purpose: Callback to flush PB skiplist entries.
+ * Purpose: Callback to flush PB skiplist entries.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
@@ -387,15 +387,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5PB__flush_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB_flush
+ * Function: H5PB_flush
*
- * Purpose: Flush/Free all the PB entries to the file.
+ * Purpose: Flush/Free all the PB entries to the file.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
@@ -422,15 +422,15 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5PB_flush */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB__dest_cb
+ * Function: H5PB__dest_cb
*
- * Purpose: Callback to free PB skiplist entries.
+ * Purpose: Callback to free PB skiplist entries.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
@@ -459,15 +459,15 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5PB__dest_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB_dest
+ * Function: H5PB_dest
*
- * Purpose: Flush and destroy the PB on the file if it exists.
+ * Purpose: Flush and destroy the PB on the file if it exists.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
@@ -513,22 +513,22 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5PB_dest */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB_add_new_page
+ * Function: H5PB_add_new_page
*
- * Purpose: Add a new page to the new page skip list. This is called
- * from the MF layer when a new page is allocated to
- * indicate to the page buffer layer that a read of the page
+ * Purpose: Add a new page to the new page skip list. This is called
+ * from the MF layer when a new page is allocated to
+ * indicate to the page buffer layer that a read of the page
* from the file is not necessary since it's an empty page.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
-herr_t
+herr_t
H5PB_add_new_page(H5F_t *f, H5FD_mem_t type, haddr_t page_addr)
{
H5PB_t *page_buf = f->shared->page_buf;
@@ -571,22 +571,22 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5PB_add_new_page */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB_update_entry
+ * Function: H5PB_update_entry
*
- * Purpose: In PHDF5, entries that are written by other processes and just
- * marked clean by this process have to have their corresponding
- * pages updated if they exist in the page buffer.
+ * Purpose: In PHDF5, entries that are written by other processes and just
+ * marked clean by this process have to have their corresponding
+ * pages updated if they exist in the page buffer.
* This routine checks and update the pages.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
-herr_t
+herr_t
H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf)
{
H5PB_entry_t *page_entry; /* Pointer to the corresponding page entry */
@@ -618,12 +618,12 @@ H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5PB_update_entry */
-
+
/*-------------------------------------------------------------------------
* Function: H5PB_remove_entry
*
* Purpose: Remove possible metadata entry with ADDR from the PB cache.
- * This is in response to the data corruption bug from fheap.c
+ * This is in response to the data corruption bug from fheap.c
* with page buffering + page strategy.
* Note: Large metadata page bypasses the PB cache.
* Note: Update of raw data page (large or small sized) is handled by the PB cache.
@@ -669,16 +669,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5PB_remove_entry */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB_read
+ * Function: H5PB_read
*
- * Purpose: Reads in the data from the page containing it if it exists
+ * Purpose: Reads in the data from the page containing it if it exists
* in the PB cache; otherwise reads in the page through the VFD.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
@@ -739,7 +739,7 @@ H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/
page_buf->bypasses[0] ++;
} /* end if */
- /* If page buffering is disabled, or if this is a large metadata access,
+ /* If page buffering is disabled, or if this is a large metadata access,
* or if this is parallel raw data access, we are done here
*/
if(NULL == page_buf || (size >= page_buf->page_size && H5FD_MEM_DRAW != type) ||
@@ -765,7 +765,7 @@ H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/
last_page_addr = ((addr + size - 1) / page_buf->page_size) * page_buf->page_size;
/* How many pages does this write span */
- num_touched_pages = (last_page_addr / page_buf->page_size + 1) -
+ num_touched_pages = (last_page_addr / page_buf->page_size + 1) -
(first_page_addr / page_buf->page_size);
if(first_page_addr == last_page_addr) {
HDassert(1 == num_touched_pages);
@@ -818,7 +818,7 @@ H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/
offset = addr - first_page_addr;
HDassert(page_buf->page_size > offset);
- HDmemcpy(buf, (uint8_t *)page_entry->page_buf_ptr + offset,
+ HDmemcpy(buf, (uint8_t *)page_entry->page_buf_ptr + offset,
page_buf->page_size - (size_t)offset);
/* move to top of LRU list */
@@ -826,7 +826,7 @@ H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/
} /* end if */
/* special handling for the last page if it is not a full page access */
else if(num_touched_pages > 1 && i == num_touched_pages-1 && search_addr < addr+size) {
- offset = (num_touched_pages-2)*page_buf->page_size +
+ offset = (num_touched_pages-2)*page_buf->page_size +
(page_buf->page_size - (addr - first_page_addr));
HDmemcpy((uint8_t *)buf + offset, page_entry->page_buf_ptr,
@@ -839,7 +839,7 @@ H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/
else {
offset = i*page_buf->page_size;
- HDmemcpy((uint8_t *)buf+(i*page_buf->page_size) , page_entry->page_buf_ptr,
+ HDmemcpy((uint8_t *)buf+(i*page_buf->page_size) , page_entry->page_buf_ptr,
page_buf->page_size);
} /* end else */
} /* end if */
@@ -883,7 +883,7 @@ H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/
else
page_buf->hits[0]++;
} /* end if */
- /* if not found */
+ /* if not found */
else {
void *new_page_buf = NULL;
size_t page_size = page_buf->page_size;
@@ -965,17 +965,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PB_read() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB_write
+ * Function: H5PB_write
*
* Purpose: Write data into the Page Buffer. If the page exists in the
* cache, update it; otherwise read it from disk, update it, and
* insert into cache.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
@@ -1035,7 +1035,7 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
page_buf->bypasses[0]++;
} /* end if */
- /* If page buffering is disabled, or if this is a large metadata access,
+ /* If page buffering is disabled, or if this is a large metadata access,
* or if this is a parallel raw data access, we are done here
*/
if(NULL == page_buf || (size >= page_buf->page_size && H5FD_MEM_DRAW != type) ||
@@ -1069,7 +1069,7 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
last_page_addr = (addr + size - 1) / page_buf->page_size * page_buf->page_size;
/* how many pages does this write span */
- num_touched_pages = (last_page_addr/page_buf->page_size + 1) -
+ num_touched_pages = (last_page_addr/page_buf->page_size + 1) -
(first_page_addr / page_buf->page_size);
if(first_page_addr == last_page_addr) {
HDassert(1 == num_touched_pages);
@@ -1110,18 +1110,18 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
} /* end if */
} /* end if */
/* Special handling for the last page if it is not a full page update */
- else if(num_touched_pages > 1 && i == (num_touched_pages - 1) &&
+ else if(num_touched_pages > 1 && i == (num_touched_pages - 1) &&
(search_addr + page_buf->page_size) != (addr + size)) {
HDassert(search_addr+page_buf->page_size > addr+size);
/* Lookup the page in the skip list */
page_entry = (H5PB_entry_t *)H5SL_search(page_buf->slist_ptr, (void *)(&search_addr));
if(page_entry) {
- offset = (num_touched_pages - 2) * page_buf->page_size +
+ offset = (num_touched_pages - 2) * page_buf->page_size +
(page_buf->page_size - (addr - first_page_addr));
/* Update page's data */
- HDmemcpy(page_entry->page_buf_ptr, (const uint8_t *)buf + offset,
+ HDmemcpy(page_entry->page_buf_ptr, (const uint8_t *)buf + offset,
(size_t)((addr + size) - last_page_addr));
/* Mark page dirty and push to top of LRU */
@@ -1185,7 +1185,7 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
else
page_buf->hits[0]++;
} /* end if */
- /* If not found */
+ /* If not found */
else {
void *new_page_buf;
size_t page_size = page_buf->page_size;
@@ -1207,7 +1207,7 @@ H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr,
/* Write to VFD and return */
if(H5FD_write(file, type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "driver write request failed")
-
+
/* Break out of loop */
break;
} /* end if */
@@ -1305,16 +1305,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PB_write() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB__insert_entry()
+ * Function: H5PB__insert_entry()
*
- * Purpose: ???
+ * Purpose: ???
*
* This function was created without documentation.
* What follows is my best understanding of Mohamad's intent.
*
- * Insert the supplied page into the page buffer, both the
+ * Insert the supplied page into the page buffer, both the
* skip list and the LRU.
*
* As best I can tell, this function imposes no limit on the
@@ -1324,13 +1324,13 @@ done:
* JRM -- 12/22/16
*
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
-static herr_t
+static herr_t
H5PB__insert_entry(H5PB_t *page_buf, H5PB_entry_t *page_entry)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -1355,29 +1355,29 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PB__insert_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB__make_space()
+ * Function: H5PB__make_space()
*
- * Purpose: ???
+ * Purpose: ???
*
* This function was created without documentation.
* What follows is my best understanding of Mohamad's intent.
*
- * If necessary and if possible, evict a page from the page
- * buffer to make space for the supplied page. Depending on
- * the page buffer configuration and contents, and the page
+ * If necessary and if possible, evict a page from the page
+ * buffer to make space for the supplied page. Depending on
+ * the page buffer configuration and contents, and the page
* supplied this may or may not be possible.
*
* JRM -- 12/22/16
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
-static htri_t
+static htri_t
H5PB__make_space(H5F_t *f, H5PB_t *page_buf, H5FD_mem_t inserted_type)
{
H5PB_entry_t *page_entry; /* Pointer to page eviction candidate */
@@ -1402,7 +1402,7 @@ H5PB__make_space(H5F_t *f, H5PB_t *page_buf, H5FD_mem_t inserted_type)
/* check the metadata threshold before evicting metadata items */
while(1) {
- if(page_entry->prev && H5F_MEM_PAGE_META == page_entry->type &&
+ if(page_entry->prev && H5F_MEM_PAGE_META == page_entry->type &&
page_buf->min_meta_count >= page_buf->meta_count)
page_entry = page_entry->prev;
else
@@ -1419,7 +1419,7 @@ H5PB__make_space(H5F_t *f, H5PB_t *page_buf, H5FD_mem_t inserted_type)
/* check the raw data threshold before evicting raw data items */
while(1) {
- if(page_entry->prev && (H5F_MEM_PAGE_DRAW == page_entry->type || H5F_MEM_PAGE_GHEAP == page_entry->type) &&
+ if(page_entry->prev && (H5F_MEM_PAGE_DRAW == page_entry->type || H5F_MEM_PAGE_GHEAP == page_entry->type) &&
page_buf->min_raw_count >= page_buf->raw_count)
page_entry = page_entry->prev;
else
@@ -1460,19 +1460,19 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PB__make_space() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5PB__write_entry()
+ * Function: H5PB__write_entry()
*
- * Purpose: ???
+ * Purpose: ???
*
* This function was created without documentation.
* What follows is my best understanding of Mohamad's intent.
*
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Mohamad Chaarawi
+ * Programmer: Mohamad Chaarawi
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Pacpl.c b/src/H5Pacpl.c
index 4368dd6..166a35f 100644
--- a/src/H5Pacpl.c
+++ b/src/H5Pacpl.c
@@ -13,11 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Pacpl.c
- * January 2 2006
- * James Laird <jlaird@ncsa.uiuc.edu>
+ * Created: H5Pacpl.c
*
- * Purpose: Attribute creation property list class routines
+ * Purpose: Attribute creation property list class routines
*
*-------------------------------------------------------------------------
*/
@@ -32,9 +30,9 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Ppkg.h" /* Property lists */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Ppkg.h" /* Property lists */
/****************/
@@ -63,21 +61,21 @@
/* Attribute creation property list class library initialization object */
const H5P_libclass_t H5P_CLS_ACRT[1] = {{
- "attribute create", /* Class name for debugging */
- H5P_TYPE_ATTRIBUTE_CREATE, /* Class type */
-
- &H5P_CLS_STRING_CREATE_g, /* Parent class */
- &H5P_CLS_ATTRIBUTE_CREATE_g, /* Pointer to class */
- &H5P_CLS_ATTRIBUTE_CREATE_ID_g, /* Pointer to class ID */
- &H5P_LST_ATTRIBUTE_CREATE_ID_g, /* Pointer to default property list ID */
- NULL, /* Default property registration routine */
-
- NULL, /* Class creation callback */
- NULL, /* Class creation callback info */
- NULL, /* Class copy callback */
- NULL, /* Class copy callback info */
- NULL, /* Class close callback */
- NULL /* Class close callback info */
+ "attribute create", /* Class name for debugging */
+ H5P_TYPE_ATTRIBUTE_CREATE, /* Class type */
+
+ &H5P_CLS_STRING_CREATE_g, /* Parent class */
+ &H5P_CLS_ATTRIBUTE_CREATE_g, /* Pointer to class */
+ &H5P_CLS_ATTRIBUTE_CREATE_ID_g, /* Pointer to class ID */
+ &H5P_LST_ATTRIBUTE_CREATE_ID_g, /* Pointer to default property list ID */
+ NULL, /* Default property registration routine */
+
+ NULL, /* Class creation callback */
+ NULL, /* Class creation callback info */
+ NULL, /* Class copy callback */
+ NULL, /* Class copy callback info */
+ NULL, /* Class close callback */
+ NULL /* Class close callback info */
}};
@@ -85,4 +83,3 @@ const H5P_libclass_t H5P_CLS_ACRT[1] = {{
/* Library Private Variables */
/*****************************/
-
diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c
index ad2ae4c..da06297 100644
--- a/src/H5Pdapl.c
+++ b/src/H5Pdapl.c
@@ -121,7 +121,7 @@ static herr_t H5P__encode_chunk_cache_nbytes(const void *value, void **_pp,
static herr_t H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value);
/* Property list callbacks */
-static herr_t H5P__dacc_vds_view_enc(const void *value, void **pp, size_t *size, void *udata);
+static herr_t H5P__dacc_vds_view_enc(const void *value, void **pp, size_t *size);
static herr_t H5P__dacc_vds_view_dec(const void **pp, void *value);
static herr_t H5P__dapl_vds_file_pref_set(hid_t prop_id, const char* name, size_t size, void* value);
static herr_t H5P__dapl_vds_file_pref_get(hid_t prop_id, const char* name, size_t size, void* value);
@@ -135,7 +135,7 @@ static herr_t H5P__dapl_vds_file_pref_close(const char* name, size_t size, void*
/* Property list callbacks */
static herr_t H5P__dapl_efile_pref_set(hid_t prop_id, const char* name, size_t size, void* value);
static herr_t H5P__dapl_efile_pref_get(hid_t prop_id, const char* name, size_t size, void* value);
-static herr_t H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__dapl_efile_pref_dec(const void **_pp, void *value);
static herr_t H5P__dapl_efile_pref_del(hid_t prop_id, const char* name, size_t size, void* value);
static herr_t H5P__dapl_efile_pref_copy(const char* name, size_t size, void* value);
@@ -562,7 +562,7 @@ H5P__dapl_efile_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size)
{
const char *efile_pref = *(const char * const *)value;
uint8_t **pp = (uint8_t **)_pp;
@@ -1157,7 +1157,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__dacc_vds_view_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__dacc_vds_view_enc(const void *value, void **_pp, size_t *size)
{
const H5D_vds_view_t *view = (const H5D_vds_view_t *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 6211b5b..b5ae02a 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -13,11 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Pdcpl.c
- * February 26 1998
- * Robb Matzke <matzke@llnl.gov>
+ * Created: H5Pdcpl.c
*
- * Purpose: Dataset creation property list class routines
+ * Purpose: Dataset creation property list class routines
*
*-------------------------------------------------------------------------
*/
@@ -33,19 +31,19 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5CXprivate.h" /* API Contexts */
-#include "H5Dpkg.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Oprivate.h" /* Object headers */
-#include "H5Ppkg.h" /* Property lists */
-#include "H5Sprivate.h" /* Dataspaces */
-#include "H5Tprivate.h" /* Datatypes */
-#include "H5VMprivate.h" /* Vectors and arrays */
-#include "H5Zprivate.h" /* Data filters */
+#include "H5private.h" /* Generic Functions */
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Dpkg.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Oprivate.h" /* Object headers */
+#include "H5Ppkg.h" /* Property lists */
+#include "H5Sprivate.h" /* Dataspaces */
+#include "H5Tprivate.h" /* Datatypes */
+#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5Zprivate.h" /* Data filters */
/****************/
@@ -152,7 +150,7 @@ static herr_t H5P__dcrt_reg_prop(H5P_genclass_t *pclass);
/* Property callbacks */
static herr_t H5P__dcrt_layout_set(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__dcrt_layout_get(hid_t prop_id, const char *name, size_t size, void *value);
-static herr_t H5P__dcrt_layout_enc(const void *value, void **pp, size_t *size, void *udata);
+static herr_t H5P__dcrt_layout_enc(const void *value, void **pp, size_t *size);
static herr_t H5P__dcrt_layout_dec(const void **pp, void *value);
static herr_t H5P__dcrt_layout_del(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__dcrt_layout_copy(const char *name, size_t size, void *value);
@@ -160,14 +158,14 @@ static int H5P__dcrt_layout_cmp(const void *value1, const void *value2, size_t s
static herr_t H5P__dcrt_layout_close(const char *name, size_t size, void *value);
static herr_t H5P__dcrt_fill_value_set(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__dcrt_fill_value_get(hid_t prop_id, const char *name, size_t size, void *value);
-static herr_t H5P__dcrt_fill_value_enc(const void *value, void **pp, size_t *size, void *udata);
+static herr_t H5P__dcrt_fill_value_enc(const void *value, void **pp, size_t *size);
static herr_t H5P__dcrt_fill_value_dec(const void **pp, void *value);
static herr_t H5P__dcrt_fill_value_del(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__dcrt_fill_value_copy(const char *name, size_t size, void *value);
static herr_t H5P__dcrt_fill_value_close(const char *name, size_t size, void *value);
static herr_t H5P__dcrt_ext_file_list_set(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__dcrt_ext_file_list_get(hid_t prop_id, const char *name, size_t size, void *value);
-static herr_t H5P__dcrt_ext_file_list_enc(const void *value, void **pp, size_t *size, void *udata);
+static herr_t H5P__dcrt_ext_file_list_enc(const void *value, void **pp, size_t *size);
static herr_t H5P__dcrt_ext_file_list_dec(const void **pp, void *value);
static herr_t H5P__dcrt_ext_file_list_del(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__dcrt_ext_file_list_copy(const char *name, size_t size, void *value);
@@ -379,41 +377,21 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size, void *_udata)
+H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size)
{
const H5O_layout_t *layout = (const H5O_layout_t *)value; /* Create local aliases for values */
- H5P_enc_cb_info_t *udata = (H5P_enc_cb_info_t *)_udata; /* User data for encode callback */
uint8_t **pp = (uint8_t **)_pp;
uint8_t *tmp_p;
size_t tmp_size;
size_t u; /* Local index variable */
- H5P_genplist_t *fapl_plist; /* The file access property list */
- hid_t new_fapl_id; /* The file access property list ID */
- H5F_libver_t low_bound = H5F_LIBVER_V110; /* Set the low bound in fapl to latest */
- H5F_libver_t high_bound = H5F_LIBVER_V110; /* Set the high bound in fapl to latest */
herr_t ret_value = SUCCEED; /* Return value */
-
FUNC_ENTER_STATIC
/* Sanity check */
HDassert(layout);
HDassert(size);
- /* Make a copy of the default file access property list */
- if(NULL == (fapl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_FILE_ACCESS_ID_g)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
-
- /* Set latest format in fapl_plist */
- /* This will eventually be used by VDS to encode datasets via H5S_encode() */
- if(H5P_set(fapl_plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &low_bound) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'low' bound for library format versions")
- if(H5P_set(fapl_plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &high_bound) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'high' bound for library format versions")
-
- if((new_fapl_id = H5P_copy_plist(fapl_plist, FALSE)) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "can't copy file access property list")
-
if(NULL != *pp) {
/* Encode layout type */
*(*pp)++ = (uint8_t)layout->type;
@@ -459,15 +437,14 @@ H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size, void *_udata)
* list before we get here. */
tmp_size = (size_t)-1;
tmp_p = *pp;
-
- if(H5S_encode(layout->storage.u.virt.list[u].source_select, pp, &tmp_size, new_fapl_id) < 0)
+ if(H5S_encode(layout->storage.u.virt.list[u].source_select, pp, &tmp_size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to serialize source selection")
*size += (size_t)(*pp - tmp_p);
/* Virtual dataset selection. Same notes as above apply. */
tmp_size = (size_t)-1;
tmp_p = *pp;
- if(H5S_encode(layout->storage.u.virt.list[u].source_dset.virtual_select, pp, &tmp_size, new_fapl_id) < 0)
+ if(H5S_encode(layout->storage.u.virt.list[u].source_dset.virtual_select, pp, &tmp_size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to serialize virtual selection")
*size += (size_t)(*pp - tmp_p);
} /* end for */
@@ -500,14 +477,14 @@ H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size, void *_udata)
/* Source selection */
tmp_size = (size_t)0;
tmp_p = NULL;
- if(H5S_encode(layout->storage.u.virt.list[u].source_select, &tmp_p, &tmp_size, new_fapl_id) < 0)
+ if(H5S_encode(layout->storage.u.virt.list[u].source_select, &tmp_p, &tmp_size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to serialize source selection")
*size += tmp_size;
/* Virtual dataset selection */
tmp_size = (size_t)0;
tmp_p = NULL;
- if(H5S_encode(layout->storage.u.virt.list[u].source_dset.virtual_select, &tmp_p, &tmp_size, new_fapl_id) < 0)
+ if(H5S_encode(layout->storage.u.virt.list[u].source_dset.virtual_select, &tmp_p, &tmp_size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to serialize virtual selection")
*size += tmp_size;
} /* end for */
@@ -1013,7 +990,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size)
{
const H5O_fill_t *fill = (const H5O_fill_t *)value; /* Create local aliases for values */
size_t dt_size = 0; /* Size of encoded datatype */
@@ -1416,7 +1393,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size)
{
const H5O_efl_t *efl = (const H5O_efl_t *)value; /* Create local aliases for values */
size_t len = 0; /* String length of slot name */
@@ -3239,10 +3216,10 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value)
H5T_path_t *tpath; /* Conversion information */
/* Retrieve pointer to datatype */
- if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
+ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
- /* Set the fill value */
+ /* Set the fill value */
if(NULL == (fill.type = H5T_copy(type, H5T_COPY_TRANSIENT)))
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy datatype")
fill.size = (ssize_t)H5T_get_size(type);
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 1c97589..e33bc05 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -172,21 +172,21 @@
static herr_t H5P__dxfr_reg_prop(H5P_genclass_t *pclass);
/* Property list callbacks */
-static herr_t H5P__dxfr_bkgr_buf_type_enc(const void *value, void **pp, size_t *size, void *udata);
+static herr_t H5P__dxfr_bkgr_buf_type_enc(const void *value, void **pp, size_t *size);
static herr_t H5P__dxfr_bkgr_buf_type_dec(const void **pp, void *value);
-static herr_t H5P__dxfr_btree_split_ratio_enc(const void *value, void **pp, size_t *size, void *udata);
+static herr_t H5P__dxfr_btree_split_ratio_enc(const void *value, void **pp, size_t *size);
static herr_t H5P__dxfr_btree_split_ratio_dec(const void **pp, void *value);
-static herr_t H5P__dxfr_io_xfer_mode_enc(const void *value, void **pp, size_t *size, void *udata);
+static herr_t H5P__dxfr_io_xfer_mode_enc(const void *value, void **pp, size_t *size);
static herr_t H5P__dxfr_io_xfer_mode_dec(const void **pp, void *value);
-static herr_t H5P__dxfr_mpio_collective_opt_enc(const void *value, void **pp, size_t *size, void *udata);
+static herr_t H5P__dxfr_mpio_collective_opt_enc(const void *value, void **pp, size_t *size);
static herr_t H5P__dxfr_mpio_collective_opt_dec(const void **pp, void *value);
-static herr_t H5P__dxfr_mpio_chunk_opt_hard_enc(const void *value, void **pp, size_t *size, void *udata);
+static herr_t H5P__dxfr_mpio_chunk_opt_hard_enc(const void *value, void **pp, size_t *size);
static herr_t H5P__dxfr_mpio_chunk_opt_hard_dec(const void **pp, void *value);
-static herr_t H5P__dxfr_edc_enc(const void *value, void **pp, size_t *size, void *udata);
+static herr_t H5P__dxfr_edc_enc(const void *value, void **pp, size_t *size);
static herr_t H5P__dxfr_edc_dec(const void **pp, void *value);
static herr_t H5P__dxfr_xform_set(hid_t prop_id, const char* name, size_t size, void* value);
static herr_t H5P__dxfr_xform_get(hid_t prop_id, const char* name, size_t size, void* value);
-static herr_t H5P__dxfr_xform_enc(const void *value, void **pp, size_t *size, void *udata);
+static herr_t H5P__dxfr_xform_enc(const void *value, void **pp, size_t *size);
static herr_t H5P__dxfr_xform_dec(const void **pp, void *value);
static herr_t H5P__dxfr_xform_del(hid_t prop_id, const char* name, size_t size, void* value);
static herr_t H5P__dxfr_xform_copy(const char* name, size_t size, void* value);
@@ -421,7 +421,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__dxfr_bkgr_buf_type_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__dxfr_bkgr_buf_type_enc(const void *value, void **_pp, size_t *size)
{
const H5T_bkg_t *bkgr_buf_type = (const H5T_bkg_t *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
@@ -494,7 +494,7 @@ H5P__dxfr_bkgr_buf_type_dec(const void **_pp, void *_value)
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__dxfr_btree_split_ratio_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__dxfr_btree_split_ratio_enc(const void *value, void **_pp, size_t *size)
{
const double *btree_split_ratio = (const double *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
@@ -655,7 +655,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size)
{
const H5Z_data_xform_t *data_xform_prop = *(const H5Z_data_xform_t * const *)value; /* Create local alias for values */
const char *pexp = NULL; /* Pointer to transform expression */
@@ -1743,7 +1743,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__dxfr_io_xfer_mode_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__dxfr_io_xfer_mode_enc(const void *value, void **_pp, size_t *size)
{
const H5FD_mpio_xfer_t *xfer_mode = (const H5FD_mpio_xfer_t *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
@@ -1816,7 +1816,7 @@ H5P__dxfr_io_xfer_mode_dec(const void **_pp, void *_value)
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__dxfr_mpio_collective_opt_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__dxfr_mpio_collective_opt_enc(const void *value, void **_pp, size_t *size)
{
const H5FD_mpio_collective_opt_t *coll_opt = (const H5FD_mpio_collective_opt_t *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
@@ -1889,7 +1889,7 @@ H5P__dxfr_mpio_collective_opt_dec(const void **_pp, void *_value)
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__dxfr_mpio_chunk_opt_hard_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__dxfr_mpio_chunk_opt_hard_enc(const void *value, void **_pp, size_t *size)
{
const H5FD_mpio_chunk_opt_t *chunk_opt = (const H5FD_mpio_chunk_opt_t *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
@@ -2073,7 +2073,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__dxfr_edc_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__dxfr_edc_enc(const void *value, void **_pp, size_t *size)
{
const H5Z_EDC_t *check = (const H5Z_EDC_t *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c
index 3332098..16dd5a8 100644
--- a/src/H5Pencdec.c
+++ b/src/H5Pencdec.c
@@ -52,7 +52,6 @@ typedef struct {
hbool_t encode; /* Whether the property list should be encoded */
size_t *enc_size_ptr; /* Pointer to size of encoded buffer */
void **pp; /* Pointer to encoding buffer pointer */
- hid_t fapl_id; /* File access property list */
} H5P_enc_iter_ud_t;
@@ -91,7 +90,7 @@ typedef struct {
*-------------------------------------------------------------------------
*/
herr_t
-H5P__encode_size_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__encode_size_t(const void *value, void **_pp, size_t *size)
{
uint64_t enc_value = (uint64_t)*(const size_t *)value; /* Property value to encode */
uint8_t **pp = (uint8_t **)_pp;
@@ -133,7 +132,7 @@ H5P__encode_size_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UNU
*-------------------------------------------------------------------------
*/
herr_t
-H5P__encode_hsize_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__encode_hsize_t(const void *value, void **_pp, size_t *size)
{
uint64_t enc_value = (uint64_t)*(const hsize_t *)value; /* Property value to encode */
unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */
@@ -174,7 +173,7 @@ H5P__encode_hsize_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UN
*-------------------------------------------------------------------------
*/
herr_t
-H5P__encode_unsigned(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__encode_unsigned(const void *value, void **_pp, size_t *size)
{
uint8_t **pp = (uint8_t **)_pp;
@@ -213,7 +212,7 @@ H5P__encode_unsigned(const void *value, void **_pp, size_t *size, void H5_ATTR_U
*-------------------------------------------------------------------------
*/
herr_t
-H5P__encode_uint8_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__encode_uint8_t(const void *value, void **_pp, size_t *size)
{
uint8_t **pp = (uint8_t **)_pp;
@@ -249,7 +248,7 @@ H5P__encode_uint8_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UN
*-------------------------------------------------------------------------
*/
herr_t
-H5P__encode_hbool_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__encode_hbool_t(const void *value, void **_pp, size_t *size)
{
uint8_t **pp = (uint8_t **)_pp;
@@ -284,7 +283,7 @@ H5P__encode_hbool_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UN
*-------------------------------------------------------------------------
*/
herr_t
-H5P__encode_double(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__encode_double(const void *value, void **_pp, size_t *size)
{
uint8_t **pp = (uint8_t **)_pp;
@@ -333,7 +332,6 @@ static int
H5P__encode_cb(H5P_genprop_t *prop, void *_udata)
{
H5P_enc_iter_ud_t *udata = (H5P_enc_iter_ud_t *)_udata; /* Pointer to user data */
- H5P_enc_cb_info_t cb_udata; /* User data for property iteration callback */
int ret_value = H5_ITER_CONT; /* Return value */
FUNC_ENTER_STATIC
@@ -357,8 +355,7 @@ H5P__encode_cb(H5P_genprop_t *prop, void *_udata)
/* Encode (or not, if *(udata->pp) is NULL) the property value */
prop_value_len = 0;
- cb_udata.fapl_id = udata->fapl_id;
- if((prop->encode)(prop->value, udata->pp, &prop_value_len, &cb_udata) < 0)
+ if((prop->encode)(prop->value, udata->pp, &prop_value_len) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, H5_ITER_ERROR, "property encoding routine failed")
*(udata->enc_size_ptr) += prop_value_len;
} /* end if */
@@ -393,7 +390,7 @@ done:
--------------------------------------------------------------------------*/
herr_t
H5P__encode(const H5P_genplist_t *plist, hbool_t enc_all_prop, void *buf,
- size_t *nalloc, hid_t fapl_id)
+ size_t *nalloc)
{
H5P_enc_iter_ud_t udata; /* User data for property iteration callback */
uint8_t *p = (uint8_t *)buf; /* Temporary pointer to encoding buffer */
@@ -428,7 +425,6 @@ H5P__encode(const H5P_genplist_t *plist, hbool_t enc_all_prop, void *buf,
udata.encode = encode;
udata.enc_size_ptr = &encode_size;
udata.pp = (void **)&p;
- udata.fapl_id = fapl_id;
/* Iterate over all properties in property list, encoding them */
idx = 0;
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index e5a0a63..b5fe527 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -298,18 +298,18 @@ static int H5P__facc_file_image_info_cmp(const void *value1, const void *value2,
static herr_t H5P__facc_file_image_info_close(const char *name, size_t size, void *value);
/* encode & decode callbacks */
-static herr_t H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__facc_cache_config_dec(const void **_pp, void *value);
static int H5P__facc_cache_config_cmp(const void *value1, const void *value2, size_t size);
-static herr_t H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__facc_fclose_degree_dec(const void **pp, void *value);
-static herr_t H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__facc_multi_type_dec(const void **_pp, void *value);
static herr_t H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__facc_libver_type_dec(const void **_pp, void *value);
/* Metadata cache log location property callbacks */
-static herr_t H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P_facc_mdc_log_location_dec(const void **_pp, void *value);
static herr_t H5P_facc_mdc_log_location_del(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P_facc_mdc_log_location_copy(const char *name, size_t size, void *value);
@@ -318,7 +318,7 @@ static herr_t H5P_facc_mdc_log_location_close(const char *name, size_t size, voi
/* Metadata cache image property callbacks */
static int H5P__facc_cache_image_config_cmp(const void *_config1, const void *_config2, size_t H5_ATTR_UNUSED size);
-static herr_t H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__facc_cache_image_config_dec(const void **_pp, void *_value);
@@ -3020,7 +3020,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size)
{
const H5AC_cache_image_config_t *config = (const H5AC_cache_image_config_t *)value; /* Create local aliases for value */
uint8_t **pp = (uint8_t **)_pp;
@@ -3446,7 +3446,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
{
const H5AC_cache_config_t *config = (const H5AC_cache_config_t *)value; /* Create local aliases for values */
uint8_t **pp = (uint8_t **)_pp;
@@ -3726,7 +3726,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size)
{
const H5F_close_degree_t *fclose_degree = (const H5F_close_degree_t *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
@@ -3799,7 +3799,7 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value)
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size)
{
const H5FD_mem_t *type = (const H5FD_mem_t *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
@@ -4299,7 +4299,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size)
{
const char *log_location = *(const char * const *)value;
uint8_t **pp = (uint8_t **)_pp;
@@ -4599,7 +4599,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size)
{
const H5P_coll_md_read_flag_t *coll_md_read_flag = (const H5P_coll_md_read_flag_t *)value;
uint8_t **pp = (uint8_t **)_pp;
diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c
index 8751b70..f90dae5 100644
--- a/src/H5Pfcpl.c
+++ b/src/H5Pfcpl.c
@@ -132,13 +132,13 @@
static herr_t H5P_fcrt_reg_prop(H5P_genclass_t *pclass);
/* property callbacks */
-static herr_t H5P__fcrt_btree_rank_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__fcrt_btree_rank_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__fcrt_btree_rank_dec(const void **_pp, void *value);
-static herr_t H5P__fcrt_shmsg_index_types_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__fcrt_shmsg_index_types_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__fcrt_shmsg_index_types_dec(const void **_pp, void *value);
-static herr_t H5P__fcrt_shmsg_index_minsize_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__fcrt_shmsg_index_minsize_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__fcrt_shmsg_index_minsize_dec(const void **_pp, void *value);
-static herr_t H5P__fcrt_fspace_strategy_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__fcrt_fspace_strategy_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__fcrt_fspace_strategy_dec(const void **_pp, void *_value);
@@ -722,7 +722,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__fcrt_btree_rank_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__fcrt_btree_rank_enc(const void *value, void **_pp, size_t *size)
{
const unsigned *btree_k = (const unsigned *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
@@ -1013,7 +1013,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__fcrt_shmsg_index_types_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__fcrt_shmsg_index_types_enc(const void *value, void **_pp, size_t *size)
{
const unsigned *type_flags = (const unsigned *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
@@ -1106,7 +1106,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__fcrt_shmsg_index_minsize_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__fcrt_shmsg_index_minsize_enc(const void *value, void **_pp, size_t *size)
{
const unsigned *minsizes = (const unsigned *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
@@ -1388,7 +1388,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__fcrt_fspace_strategy_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__fcrt_fspace_strategy_enc(const void *value, void **_pp, size_t *size)
{
const H5F_fspace_strategy_t *strategy = (const H5F_fspace_strategy_t *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c
index a719616..8ff8442 100644
--- a/src/H5Pgcpl.c
+++ b/src/H5Pgcpl.c
@@ -32,12 +32,12 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Gprivate.h" /* Groups */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Oprivate.h" /* Object headers */
-#include "H5Ppkg.h" /* Property lists */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Gprivate.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Oprivate.h" /* Object headers */
+#include "H5Ppkg.h" /* Property lists */
/****************/
@@ -69,9 +69,9 @@
static herr_t H5P__gcrt_reg_prop(H5P_genclass_t *pclass);
/* Property callbacks */
-static herr_t H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__gcrt_group_info_dec(const void **_pp, void *value);
-static herr_t H5P__gcrt_link_info_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__gcrt_link_info_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__gcrt_link_info_dec(const void **_pp, void *value);
@@ -546,7 +546,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size)
{
const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)value; /* Create local aliases for values */
uint8_t **pp = (uint8_t **)_pp;
@@ -634,7 +634,7 @@ H5P__gcrt_group_info_dec(const void **_pp, void *_value)
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__gcrt_link_info_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__gcrt_link_info_enc(const void *value, void **_pp, size_t *size)
{
const H5O_linfo_t *linfo = (const H5O_linfo_t *)value; /* Create local aliases for values */
uint8_t **pp = (uint8_t **)_pp;
diff --git a/src/H5Plapl.c b/src/H5Plapl.c
index 4a95991..99d98f8 100644
--- a/src/H5Plapl.c
+++ b/src/H5Plapl.c
@@ -114,7 +114,7 @@ static herr_t H5P__lacc_reg_prop(H5P_genclass_t *pclass);
/* Property list callbacks */
static herr_t H5P__lacc_elink_pref_set(hid_t prop_id, const char* name, size_t size, void* value);
static herr_t H5P__lacc_elink_pref_get(hid_t prop_id, const char* name, size_t size, void* value);
-static herr_t H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__lacc_elink_pref_dec(const void **_pp, void *value);
static herr_t H5P__lacc_elink_pref_del(hid_t prop_id, const char* name, size_t size, void* value);
static herr_t H5P__lacc_elink_pref_copy(const char* name, size_t size, void* value);
@@ -122,7 +122,7 @@ static int H5P__lacc_elink_pref_cmp(const void *value1, const void *value2, size
static herr_t H5P__lacc_elink_pref_close(const char* name, size_t size, void* value);
static herr_t H5P__lacc_elink_fapl_set(hid_t prop_id, const char* name, size_t size, void* value);
static herr_t H5P__lacc_elink_fapl_get(hid_t prop_id, const char* name, size_t size, void* value);
-static herr_t H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__lacc_elink_fapl_dec(const void **_pp, void *value);
static herr_t H5P__lacc_elink_fapl_del(hid_t prop_id, const char* name, size_t size, void* value);
static herr_t H5P__lacc_elink_fapl_copy(const char* name, size_t size, void* value);
@@ -338,11 +338,10 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size, void *_udata)
+H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size)
{
const hid_t *elink_fapl = (const hid_t *)value; /* Property to encode */
uint8_t **pp = (uint8_t **)_pp;
- H5P_enc_cb_info_t *udata = (H5P_enc_cb_info_t *)_udata; /* User data for encode callback */
H5P_genplist_t *fapl_plist; /* Pointer to property list */
hbool_t non_default_fapl = FALSE; /* Whether the FAPL is non-default */
size_t fapl_size = 0; /* FAPL's encoded size */
@@ -365,7 +364,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size, void *_uda
/* Encode the property list, if non-default */
/* (if *pp == NULL, will only compute the size) */
if(non_default_fapl) {
- if(H5P__encode(fapl_plist, TRUE, NULL, &fapl_size, udata->fapl_id) < 0)
+ if(H5P__encode(fapl_plist, TRUE, NULL, &fapl_size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "can't encode property list")
if(*pp) {
@@ -380,7 +379,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size, void *_uda
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
/* encode the plist */
- if(H5P__encode(fapl_plist, TRUE, *pp, &fapl_size, udata->fapl_id) < 0)
+ if(H5P__encode(fapl_plist, TRUE, *pp, &fapl_size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "can't encode property list")
*pp += fapl_size;
@@ -689,7 +688,7 @@ H5P__lacc_elink_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size)
{
const char *elink_pref = *(const char * const *)value;
uint8_t **pp = (uint8_t **)_pp;
diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c
index 6508a82..6084ffe 100644
--- a/src/H5Plcpl.c
+++ b/src/H5Plcpl.c
@@ -13,11 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Plcpl.c
- * May 8 2006
- * Peter Cao <xcao@ncsa.uiuc.edu>
+ * Created: H5Plcpl.c
*
- * Purpose: Link creation property list class routines
+ * Purpose: Link creation property list class routines
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c
index b3c472e..be41e32 100644
--- a/src/H5Pocpl.c
+++ b/src/H5Pocpl.c
@@ -90,7 +90,7 @@
static herr_t H5P__ocrt_reg_prop(H5P_genclass_t *pclass);
/* Property callbacks */
-static herr_t H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__ocrt_pipeline_dec(const void **_pp, void *value);
static herr_t H5P__ocrt_pipeline_set(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__ocrt_pipeline_get(hid_t prop_id, const char *name, size_t size, void *value);
@@ -1459,7 +1459,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size)
{
const H5O_pline_t *pline = (const H5O_pline_t *)value;
uint8_t **pp = (uint8_t **)_pp;
diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h
index c59a53a..60b2363 100644
--- a/src/H5Ppkg.h
+++ b/src/H5Ppkg.h
@@ -176,21 +176,21 @@ H5_DLL hid_t H5P__new_plist_of_type(H5P_plist_type_t type);
/* Encode/decode routines */
H5_DLL herr_t H5P__encode(const H5P_genplist_t *plist, hbool_t enc_all_prop,
- void *buf, size_t *nalloc, hid_t fapl_id);
+ void *buf, size_t *nalloc);
H5_DLL hid_t H5P__decode(const void *buf);
-H5_DLL herr_t H5P__encode_hsize_t(const void *value, void **_pp, size_t *size, void *udata);
-H5_DLL herr_t H5P__encode_size_t(const void *value, void **_pp, size_t *size, void *udata);
-H5_DLL herr_t H5P__encode_unsigned(const void *value, void **_pp, size_t *size, void *udata);
-H5_DLL herr_t H5P__encode_uint8_t(const void *value, void **_pp, size_t *size, void *udata);
-H5_DLL herr_t H5P__encode_hbool_t(const void *value, void **_pp, size_t *size, void *udata);
-H5_DLL herr_t H5P__encode_double(const void *value, void **_pp, size_t *size, void *udat);
+H5_DLL herr_t H5P__encode_hsize_t(const void *value, void **_pp, size_t *size);
+H5_DLL herr_t H5P__encode_size_t(const void *value, void **_pp, size_t *size);
+H5_DLL herr_t H5P__encode_unsigned(const void *value, void **_pp, size_t *size);
+H5_DLL herr_t H5P__encode_uint8_t(const void *value, void **_pp, size_t *size);
+H5_DLL herr_t H5P__encode_hbool_t(const void *value, void **_pp, size_t *size);
+H5_DLL herr_t H5P__encode_double(const void *value, void **_pp, size_t *size);
H5_DLL herr_t H5P__decode_hsize_t(const void **_pp, void *value);
H5_DLL herr_t H5P__decode_size_t(const void **_pp, void *value);
H5_DLL herr_t H5P__decode_unsigned(const void **_pp, void *value);
H5_DLL herr_t H5P__decode_uint8_t(const void **_pp, void *value);
H5_DLL herr_t H5P__decode_hbool_t(const void **_pp, void *value);
H5_DLL herr_t H5P__decode_double(const void **_pp, void *value);
-H5_DLL herr_t H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size, void *udata);
+H5_DLL herr_t H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size);
H5_DLL herr_t H5P__decode_coll_md_read_flag_t(const void **_pp, void *value);
/* Private OCPL routines */
diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h
index a18df06..460e16b 100644
--- a/src/H5Pprivate.h
+++ b/src/H5Pprivate.h
@@ -86,14 +86,9 @@ typedef herr_t (*H5P_reg_prop_func_t)(H5P_genclass_t *pclass);
/* Move encode/decode callback typedefs from H5Ppublic.h: not exposed to user */
/* Add a parameter to encode callback */
-typedef herr_t (*H5P_prp_encode_func_t)(const void *value, void **buf, size_t *size, void *udata);
+typedef herr_t (*H5P_prp_encode_func_t)(const void *value, void **buf, size_t *size);
typedef herr_t (*H5P_prp_decode_func_t)(const void **buf, void *value);
-/* User data passed to encode callback */
-typedef struct H5P_enc_cb_info_t {
- hid_t fapl_id; /* File access property list */
-} H5P_enc_cb_info_t;
-
/*
* Each library property list class has a variable of this type that contains
* class variables and methods used to initialize the class.
diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c
index b84d69b..fb91356 100644
--- a/src/H5Pstrcpl.c
+++ b/src/H5Pstrcpl.c
@@ -69,7 +69,7 @@
static herr_t H5P__strcrt_reg_prop(H5P_genclass_t *pclass);
/* encode & decode callbacks */
-static herr_t H5P__strcrt_char_encoding_enc(const void *value, void **_pp, size_t *size, void *udata);
+static herr_t H5P__strcrt_char_encoding_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__strcrt_char_encoding_dec(const void **_pp, void *value);
@@ -227,7 +227,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__strcrt_char_encoding_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata)
+H5P__strcrt_char_encoding_enc(const void *value, void **_pp, size_t *size)
{
const H5T_cset_t *encoding = (const H5T_cset_t *)value; /* Create local alias for values */
uint8_t **pp = (uint8_t **)_pp;
diff --git a/src/H5Rint.c b/src/H5Rint.c
index 1465ee1..159bcca 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -242,6 +242,9 @@ H5R__create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type,
obj_loc.path = &path;
H5G_loc_reset(&obj_loc);
+ /* Set the FAPL for the API context */
+ H5CX_set_libver_bounds(loc->oloc->file);
+
/* Find the object */
if(H5G_loc_find(loc, name, &obj_loc) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_NOTFOUND, FAIL, "object not found")
@@ -290,7 +293,7 @@ H5R__create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type,
HDmemset(ref, 0, H5R_DSET_REG_REF_BUF_SIZE);
/* Get the amount of space required to serialize the selection */
- if ((buf_size = H5S_SELECT_SERIAL_SIZE(space, loc->oloc->file)) < 0)
+ if ((buf_size = H5S_SELECT_SERIAL_SIZE(space)) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "Invalid amount of space for serializing selection")
/* Increase buffer size to allow for the dataset OID */
@@ -306,7 +309,7 @@ H5R__create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type,
H5F_addr_encode(loc->oloc->file, &p, obj_loc.oloc->addr);
/* Serialize the selection into heap buffer */
- if (H5S_SELECT_SERIALIZE(space, &p, loc->oloc->file) < 0)
+ if (H5S_SELECT_SERIALIZE(space, &p) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Unable to serialize selection")
/* Save the serialized buffer for later */
diff --git a/src/H5S.c b/src/H5S.c
index bd21caf..e582db7 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -23,6 +23,7 @@
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Fprivate.h" /* Files */
#include "H5FLprivate.h" /* Free lists */
#include "H5Iprivate.h" /* IDs */
@@ -1595,6 +1596,7 @@ herr_t
H5Sencode(hid_t obj_id, void *buf, size_t *nalloc)
{
H5S_t *dspace;
+ hid_t temp_fapl_id = H5P_DEFAULT;
herr_t ret_value=SUCCEED;
FUNC_ENTER_API(FAIL)
@@ -1602,10 +1604,14 @@ H5Sencode(hid_t obj_id, void *buf, size_t *nalloc)
/* Check argument and retrieve object */
if (NULL == (dspace = (H5S_t *)H5I_object_verify(obj_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+
+ /* Verify access property list and set up collective metadata if appropriate */
+ if(H5CX_set_apl(&temp_fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info")
- if(H5S_encode(dspace, (unsigned char **)&buf, nalloc, H5P_FILE_ACCESS_DEFAULT)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode dataspace")
+ if(H5S_encode(dspace, (unsigned char **)&buf, nalloc)<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode dataspace")
done:
FUNC_LEAVE_API(ret_value)
@@ -1629,7 +1635,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc, hid_t fapl_id)
+H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc)
{
H5F_t *f = NULL; /* Fake file structure*/
size_t extent_size; /* Size of serialized dataspace extent */
@@ -1640,7 +1646,7 @@ H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc, hid_t fapl_id)
FUNC_ENTER_NOAPI_NOINIT
/* Allocate "fake" file structure */
- if(NULL == (f = H5F_fake_alloc((uint8_t)0, fapl_id)))
+ if(NULL == (f = H5F_fake_alloc((uint8_t)0)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct")
/* Find out the size of buffer needed for extent */
@@ -1648,7 +1654,7 @@ H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc, hid_t fapl_id)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, FAIL, "can't find dataspace size")
/* Find out the size of buffer needed for selection */
- if((sselect_size = H5S_SELECT_SERIAL_SIZE(obj, f)) < 0)
+ if((sselect_size = H5S_SELECT_SERIAL_SIZE(obj)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, FAIL, "can't find dataspace selection size")
H5_CHECKED_ASSIGN(select_size, size_t, sselect_size, hssize_t);
@@ -1678,7 +1684,7 @@ H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc, hid_t fapl_id)
/* Encode the selection part of dataspace. */
*p = pp;
- if(H5S_SELECT_SERIALIZE(obj, p, f) < 0)
+ if(H5S_SELECT_SERIALIZE(obj, p) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode select space")
} /* end else */
@@ -1772,7 +1778,7 @@ H5S_decode(const unsigned char **p)
sizeof_size = *pp++;
/* Allocate "fake" file structure */
- if(NULL == (f = H5F_fake_alloc(sizeof_size, H5P_FILE_ACCESS_DEFAULT)))
+ if(NULL == (f = H5F_fake_alloc(sizeof_size)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate fake file struct")
/* Decode size of extent information */
diff --git a/src/H5ST.c b/src/H5ST.c
index dd5b63c..3a1020b 100644
--- a/src/H5ST.c
+++ b/src/H5ST.c
@@ -743,19 +743,19 @@ H5ST__dump_internal(H5ST_ptr_t p)
FUNC_ENTER_STATIC_NOERR
if(p) {
- printf("p=%p\n", (void *)p);
- printf("\tp->up=%p\n", (void *)p->up);
- printf("\tp->parent=%p\n", (void *)p->parent);
- printf("\tp->lokid=%p\n", (void *)p->lokid);
- printf("\tp->hikid=%p\n", (void *)p->hikid);
- printf("\tp->eqkid=%p\n", (void *)p->eqkid);
- printf("\tp->splitchar=%c\n", p->splitchar);
+ HDprintf("p=%p\n", (void *)p);
+ HDprintf("\tp->up=%p\n", (void *)p->up);
+ HDprintf("\tp->parent=%p\n", (void *)p->parent);
+ HDprintf("\tp->lokid=%p\n", (void *)p->lokid);
+ HDprintf("\tp->hikid=%p\n", (void *)p->hikid);
+ HDprintf("\tp->eqkid=%p\n", (void *)p->eqkid);
+ HDprintf("\tp->splitchar=%c\n", p->splitchar);
H5ST__dump_internal(p->lokid);
if(p->splitchar)
H5ST__dump_internal(p->eqkid);
else
- printf("%s\n", (char *)p->eqkid);
+ HDprintf("%s\n", (char *)p->eqkid);
H5ST__dump_internal(p->hikid);
} /* end if */
diff --git a/src/H5Sall.c b/src/H5Sall.c
index 1377022..1738615 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -36,10 +36,9 @@ static herr_t H5S__all_get_seq_list(const H5S_t *space, unsigned flags,
size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len);
static herr_t H5S__all_release(H5S_t *space);
static htri_t H5S__all_is_valid(const H5S_t *space);
-static hssize_t H5S__all_serial_size(const H5S_t *space, H5F_t *f);
-static herr_t H5S__all_serialize(const H5S_t *space, uint8_t **p, H5F_t *f);
-static herr_t H5S__all_deserialize(H5S_t *space, uint32_t version, uint8_t flags,
- const uint8_t **p);
+static hssize_t H5S__all_serial_size(const H5S_t *space);
+static herr_t H5S__all_serialize(const H5S_t *space, uint8_t **p);
+static herr_t H5S__all_deserialize(H5S_t **space, const uint8_t **p);
static herr_t H5S__all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
static herr_t H5S__all_offset(const H5S_t *space, hsize_t *off);
static int H5S__all_unlim_dim(const H5S_t *space);
@@ -56,7 +55,7 @@ static herr_t H5S__all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords);
static herr_t H5S__all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
static hsize_t H5S__all_iter_nelmts(const H5S_sel_iter_t *iter);
static htri_t H5S__all_iter_has_next_block(const H5S_sel_iter_t *iter);
-static herr_t H5S__all_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem);
+static herr_t H5S__all_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem);
static herr_t H5S__all_iter_next_block(H5S_sel_iter_t *sel_iter);
static herr_t H5S__all_iter_release(H5S_sel_iter_t *sel_iter);
@@ -268,7 +267,7 @@ H5S__all_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter)
USAGE
herr_t H5S__all_iter_next(iter, nelem)
H5S_sel_iter_t *iter; IN: Pointer to selection iterator
- hsize_t nelem; IN: Number of elements to advance by
+ size_t nelem; IN: Number of elements to advance by
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -279,7 +278,7 @@ H5S__all_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S__all_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
+H5S__all_iter_next(H5S_sel_iter_t *iter, size_t nelem)
{
FUNC_ENTER_STATIC_NOERR
@@ -457,9 +456,8 @@ H5S__all_is_valid(const H5S_t H5_ATTR_UNUSED *space)
Determine the number of bytes needed to store the serialized "all"
selection information.
USAGE
- hssize_t H5S_all_serial_size(space, f)
+ hssize_t H5S_all_serial_size(space)
H5S_t *space; IN: Dataspace pointer to query
- H5F_t *f; IN: File pointer
RETURNS
The number of bytes required on success, negative on an error.
DESCRIPTION
@@ -471,7 +469,7 @@ H5S__all_is_valid(const H5S_t H5_ATTR_UNUSED *space)
REVISION LOG
--------------------------------------------------------------------------*/
static hssize_t
-H5S__all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f)
+H5S__all_serial_size (const H5S_t H5_ATTR_UNUSED *space)
{
FUNC_ENTER_STATIC_NOERR
@@ -491,12 +489,11 @@ H5S__all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f
PURPOSE
Serialize the current selection into a user-provided buffer.
USAGE
- herr_t H5S__all_serialize(space, p, f)
+ herr_t H5S__all_serialize(space, p)
const H5S_t *space; IN: Dataspace with selection to serialize
uint8_t **p; OUT: Pointer to buffer to put serialized
selection. Will be advanced to end of
serialized selection.
- H5F_t *f; IN: File pointer
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -508,7 +505,7 @@ H5S__all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S__all_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f)
+H5S__all_serialize(const H5S_t *space, uint8_t **p)
{
uint8_t *pp = (*p); /* Local pointer for decoding */
@@ -539,10 +536,8 @@ H5S__all_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f)
Deserialize the current selection from a user-provided buffer.
USAGE
herr_t H5S_all_deserialize(space, p)
- H5S_t *space; IN/OUT: Dataspace pointer to place
+ H5S_t **space; IN/OUT: Dataspace pointer to place
selection into
- uint32_t version IN: Selection version
- uint8_t flags IN: Selection flags
uint8 **p; OUT: Pointer to buffer holding serialized
selection. Will be advanced to end of
serialized selection.
@@ -557,22 +552,51 @@ H5S__all_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S__all_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t H5_ATTR_UNUSED flags,
- const uint8_t H5_ATTR_UNUSED **p)
+H5S__all_deserialize(H5S_t **space, const uint8_t **p)
{
+ uint32_t version; /* Version number */
+ H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use,
+ either *space or a newly allocated one */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_STATIC
- HDassert(space);
HDassert(p);
HDassert(*p);
+ /* As part of the efforts to push all selection-type specific coding
+ to the callbacks, the coding for the allocation of a null dataspace
+ is moved from H5S_select_deserialize() in H5Sselect.c.
+ This is needed for decoding virtual layout in H5O__layout_decode() */
+
+ /* Allocate space if not provided */
+ if(!*space) {
+ if(NULL == (tmp_space = H5S_create(H5S_SIMPLE)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create dataspace")
+ } /* end if */
+ else
+ tmp_space = *space;
+
+ /* Decode version */
+ UINT32DECODE(*p, version);
+
+ /* Skip over the remainder of the header */
+ *p += 8;
+
/* Change to "all" selection */
- if(H5S_select_all(space, TRUE) < 0)
+ if(H5S_select_all(tmp_space, TRUE) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
+ /* Return space to the caller if allocated */
+ if(!*space)
+ *space = tmp_space;
+
done:
+ /* Free temporary space if not passed to caller (only happens on error) */
+ if(!*space && tmp_space)
+ if(H5S_close(tmp_space) < 0)
+ HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5S__all_deserialize() */
diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c
index ebd05ce..6ffa2a9 100644
--- a/src/H5Sdbg.c
+++ b/src/H5Sdbg.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Sdbg.c
- * Jul 24 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5Sdbg.c
+ * Jul 24 2007
+ * Quincey Koziol <koziol@hdfgroup.org>
*
- * Purpose: Dump debugging information about a dataspace
+ * Purpose: Dump debugging information about a dataspace
*
*-------------------------------------------------------------------------
*/
@@ -32,9 +32,9 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Spkg.h" /* Dataspaces */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Spkg.h" /* Dataspaces */
/****************/
@@ -72,15 +72,15 @@
/*******************/
-
+
/*-------------------------------------------------------------------------
- * Function: H5S_debug
+ * Function: H5S_debug
*
- * Purpose: Prints debugging information about a dataspace.
+ * Purpose: Prints debugging information about a dataspace.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, July 21, 1998
*
*-------------------------------------------------------------------------
@@ -88,30 +88,30 @@
herr_t
H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth)
{
- const H5S_t *mesg = (const H5S_t*)_mesg;
+ const H5S_t *mesg = (const H5S_t*)_mesg;
FUNC_ENTER_NOAPI_NOINIT_NOERR
switch(H5S_GET_EXTENT_TYPE(mesg)) {
case H5S_NULL:
- fprintf(stream, "%*s%-*s H5S_NULL\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s H5S_NULL\n", indent, "", fwidth,
"Space class:");
break;
case H5S_SCALAR:
- fprintf(stream, "%*s%-*s H5S_SCALAR\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s H5S_SCALAR\n", indent, "", fwidth,
"Space class:");
break;
case H5S_SIMPLE:
- fprintf(stream, "%*s%-*s H5S_SIMPLE\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s H5S_SIMPLE\n", indent, "", fwidth,
"Space class:");
H5O_debug_id(H5O_SDSPACE_ID, f, &(mesg->extent), stream, indent + 3, MAX(0, fwidth - 3));
break;
case H5S_NO_CLASS:
default:
- fprintf(stream, "%*s%-*s **UNKNOWN-%ld**\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s **UNKNOWN-%ld**\n", indent, "", fwidth,
"Space class:", (long)(H5S_GET_EXTENT_TYPE(mesg)));
break;
} /* end switch */
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index c19de54..4f96197 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -21,12 +21,13 @@
#include "H5Smodule.h" /* This source code file is part of the H5S module */
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* ID Functions */
-#include "H5Spkg.h" /* Dataspace functions */
-#include "H5VMprivate.h" /* Vector functions */
+#include "H5Spkg.h" /* Dataspace functions */
+#include "H5VMprivate.h" /* Vector functions */
/* Format version bounds for dataspace hyperslab selection */
const unsigned H5O_sds_hyper_ver_bounds[] = {
@@ -85,10 +86,9 @@ static herr_t H5S__hyper_get_seq_list(const H5S_t *space, unsigned flags,
size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len);
static herr_t H5S__hyper_release(H5S_t *space);
static htri_t H5S__hyper_is_valid(const H5S_t *space);
-static hssize_t H5S__hyper_serial_size(const H5S_t *space, H5F_t *f);
-static herr_t H5S__hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f);
-static herr_t H5S__hyper_deserialize(H5S_t *space, uint32_t version, uint8_t flags,
- const uint8_t **p);
+static hssize_t H5S__hyper_serial_size(const H5S_t *space);
+static herr_t H5S__hyper_serialize(const H5S_t *space, uint8_t **p);
+static herr_t H5S__hyper_deserialize(H5S_t **space, const uint8_t **p);
static herr_t H5S__hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
static herr_t H5S__hyper_offset(const H5S_t *space, hsize_t *offset);
static int H5S__hyper_unlim_dim(const H5S_t *space);
@@ -107,7 +107,7 @@ static herr_t H5S__hyper_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords
static herr_t H5S__hyper_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
static hsize_t H5S__hyper_iter_nelmts(const H5S_sel_iter_t *iter);
static htri_t H5S__hyper_iter_has_next_block(const H5S_sel_iter_t *sel_iter);
-static herr_t H5S__hyper_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem);
+static herr_t H5S__hyper_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem);
static herr_t H5S__hyper_iter_next_block(H5S_sel_iter_t *sel_iter);
static herr_t H5S__hyper_iter_release(H5S_sel_iter_t *sel_iter);
/* Static function for optimizing hyperslab */
@@ -688,7 +688,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5S__hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
+H5S__hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem)
{
unsigned ndims; /* Number of dimensions of dataset */
int fast_dim; /* Rank of the fastest changing dimension for the dataspace */
@@ -738,14 +738,14 @@ H5S__hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
temp_dim=fast_dim;
while(temp_dim>=0) {
if(temp_dim==fast_dim) {
- hsize_t actual_elem; /* Actual # of elements advanced on each iteration through loop */
+ size_t actual_elem; /* Actual # of elements advanced on each iteration through loop */
hsize_t block_elem; /* Number of elements left in a block */
/* Compute the number of elements left in block */
block_elem = tdiminfo[temp_dim].block - iter_offset[temp_dim];
/* Compute the number of actual elements to advance */
- actual_elem=MIN(nelem,block_elem);
+ actual_elem=(size_t)MIN(nelem,block_elem);
/* Move the iterator over as many elements as possible */
iter_offset[temp_dim] += actual_elem;
@@ -809,7 +809,7 @@ H5S__hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
/* Increment absolute position */
if(curr_dim==fast_dim) {
- hsize_t actual_elem; /* Actual # of elements advanced on each iteration through loop */
+ size_t actual_elem; /* Actual # of elements advanced on each iteration through loop */
hsize_t span_elem; /* Number of elements left in a span */
/* Compute the number of elements left in block */
@@ -1872,8 +1872,9 @@ H5S__hyper_span_nblocks(const H5S_hyper_span_info_t *spans)
PURPOSE
Get the number of hyperslab blocks in current hyperslab selection
USAGE
- hsize_t H5S__get_select_hyper_nblocks(space)
+ hsize_t H5S__get_select_hyper_nblocks(space, app_ref)
H5S_t *space; IN: Dataspace ptr of selection to query
+ hbool_t app_ref; IN: Whether this is an appl. ref. call
RETURNS
The number of hyperslab blocks in selection on success, negative on failure
DESCRIPTION
@@ -1884,7 +1885,7 @@ H5S__hyper_span_nblocks(const H5S_hyper_span_info_t *spans)
REVISION LOG
--------------------------------------------------------------------------*/
static hsize_t
-H5S__get_select_hyper_nblocks(const H5S_t *space)
+H5S__get_select_hyper_nblocks(const H5S_t *space, hbool_t app_ref)
{
hsize_t ret_value = 0; /* Return value */
@@ -1899,7 +1900,8 @@ H5S__get_select_hyper_nblocks(const H5S_t *space)
/* Check each dimension */
for(ret_value = 1, u = 0; u < space->extent.rank; u++)
- ret_value *= space->select.sel_info.hslab->app_diminfo[u].count;
+ ret_value *= (app_ref ? space->select.sel_info.hslab->app_diminfo[u].count :
+ space->select.sel_info.hslab->opt_diminfo[u].count);
} /* end if */
else
ret_value = H5S__hyper_span_nblocks(space->select.sel_info.hslab->span_lst);
@@ -1942,7 +1944,7 @@ H5Sget_select_hyper_nblocks(hid_t spaceid)
if(space->select.sel_info.hslab->unlim_dim >= 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "cannot get number of blocks for unlimited selection")
- ret_value = (hssize_t)H5S__get_select_hyper_nblocks(space);
+ ret_value = (hssize_t)H5S__get_select_hyper_nblocks(space, TRUE);
done:
FUNC_LEAVE_API(ret_value)
@@ -1951,88 +1953,52 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_set_offset_size
+ H5S_hyper_get_version_enc_size
PURPOSE
- Determine the offset size (4 or 8 bytes) to use for encoding hyperslab selection info
- USAGE
- hssize_t H5S_hyper_set_offset_size(space, block_count, bounds_end, version, offset_size)
- const H5S_t *space: IN: The maximum size of the hyperslab selection info
- hsize_t block_count: IN: The number of blocks in the selection
- hsize_t bounds_end: IN: The selection high bounds
- uint32_t version: IN: The version used for encoding
- uint8_t *offset_size: OUT: The offset size
-
- RETURNS
- The offset size
- DESCRIPTION
- Determine the offset size for encoding hyperslab selection info based on the
- the input parameter "version". This is for release 1.10.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static herr_t
-H5S_hyper_set_offset_size(const H5S_t *space, hsize_t block_count, hsize_t bounds_end[], uint32_t version, uint8_t *offset_size)
-{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
- switch(version) {
- case H5S_HYPER_VERSION_1:
- *offset_size = H5S_INFO_SIZE_4;
- break;
-
- case H5S_HYPER_VERSION_2:
- *offset_size = H5S_INFO_SIZE_8;
- break;
-
- default:
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper offset size")
- break;
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_set_offset_size() */
-
-
-/*--------------------------------------------------------------------------
- NAME
- H5S_hyper_set_version
- PURPOSE
- Determine the version to use for encoding hyperslab selection info
+ Determine the version and encoded size to use for encoding hyperslab selection info
See tables 2 & 3 in the RFC: H5Sencode/H5Sdecode Format Change
USAGE
- hssize_t H5S_hyper_set_version(space, block_count, bounds_end, f, version)
+ hssize_t H5S_hyper_get_version_enc_size(space, block_count, version, enc_size)
const H5S_t *space: IN: The dataspace
hsize_t block_count: IN: The number of blocks in the selection
- hsize_t bounds_end: IN: The selection high bounds
- H5F_t *f: IN: The file pointer
uint32_t *version: OUT: The version to use for encoding
+ uint8_t *enc_size: OUT: The encoded size to use
RETURNS
- The version to use
+ The version and the size to encode hyperslab selection info
DESCRIPTION
Determine the version to use for encoding hyperslab selection info based
on whether the number of blocks or the selection high bounds exceeds (2^32 - 1).
+ Then determine the encoded size based on version.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_set_version(const H5S_t *space, hsize_t block_count, hsize_t bounds_end[], H5F_t *f, uint32_t *version)
+H5S_hyper_get_version_enc_size(const H5S_t *space, hsize_t block_count, uint32_t *version, uint8_t *enc_size)
{
+ hsize_t bounds_start[H5S_MAX_RANK]; /* Starting coordinate of bounding box */
+ hsize_t bounds_end[H5S_MAX_RANK]; /* Opposite coordinate of bounding box */
hbool_t count_up_version = FALSE; /* Whether number of blocks exceed (2^32 - 1) */
hbool_t bound_up_version = FALSE; /* Whether high bounds exceed (2^32 - 1) */
+ H5F_libver_t low_bound; /* The 'low' bound of library format versions */
+ H5F_libver_t high_bound; /* The 'high' bound of library format versions */
unsigned u; /* Local index veriable */
uint32_t tmp_version; /* Temporay version */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_NOAPI_NOINIT
+ /* Get bounding box for the selection */
+ HDmemset(bounds_end, 0, sizeof(bounds_end));
+
+ if(space->select.sel_info.hslab->unlim_dim < 0) { /* ! H5S_UNLIMITED */
+ /* Get bounding box for the selection */
+ if(H5S__hyper_bounds(space, bounds_start, bounds_end) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds")
+ }
+
/* Determine whether the number of blocks or the high bounds in the selection exceed (2^32 - 1) */
if(block_count > H5S_UINT32_MAX)
count_up_version = TRUE;
@@ -2042,6 +2008,10 @@ H5S_hyper_set_version(const H5S_t *space, hsize_t block_count, hsize_t bounds_en
bound_up_version = TRUE;
}
+ /* Get the file's low_bound and high_bound */
+ if(H5CX_get_libver_bounds(&low_bound, &high_bound) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get low/high bounds from API context")
+
/* Use version 2 for unlimited selection */
if(space->select.sel_info.hslab->unlim_dim >= 0)
tmp_version = H5S_HYPER_VERSION_2;
@@ -2053,7 +2023,7 @@ H5S_hyper_set_version(const H5S_t *space, hsize_t block_count, hsize_t bounds_en
else
/* block_count < 4: version 1 */
/* block_count >= 4: determined by low bound */
- tmp_version = (block_count < 4) ? H5S_HYPER_VERSION_1 : H5O_sds_hyper_ver_bounds[H5F_LOW_BOUND(f)];
+ tmp_version = (block_count < 4) ? H5S_HYPER_VERSION_1 : H5O_sds_hyper_ver_bounds[low_bound];
} else {
/* Fail for irregular hyperslab if exceeds 32 bits */
@@ -2065,14 +2035,29 @@ H5S_hyper_set_version(const H5S_t *space, hsize_t block_count, hsize_t bounds_en
}
/* Version bounds check */
- if(tmp_version > H5O_sds_hyper_ver_bounds[H5F_HIGH_BOUND(f)])
+ if(tmp_version > H5O_sds_hyper_ver_bounds[high_bound])
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "Dataspace hyperslab selection version out of bounds")
*version = tmp_version;
+ /* Determine the encoded size based on version */
+ switch(tmp_version) {
+ case H5S_HYPER_VERSION_1:
+ *enc_size = H5S_SELECT_INFO_ENC_SIZE_4;
+ break;
+
+ case H5S_HYPER_VERSION_2:
+ *enc_size = H5S_SELECT_INFO_ENC_SIZE_8;
+ break;
+
+ default:
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper encoded size")
+ break;
+ }
+
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_set_version() */
+} /* H5S_hyper_get_version_enc_size() */
/*--------------------------------------------------------------------------
@@ -2082,9 +2067,8 @@ done:
Determine the number of bytes needed to store the serialized hyperslab
selection information.
USAGE
- hssize_t H5S_hyper_serial_size(space, H5F_t *f)
+ hssize_t H5S_hyper_serial_size(space)
H5S_t *space; IN: Dataspace pointer to query
- H5F_t *f; IN: File pointer
RETURNS
The number of bytes required on success, negative on an error.
DESCRIPTION
@@ -2096,44 +2080,23 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static hssize_t
-H5S__hyper_serial_size(const H5S_t *space, H5F_t *f)
+H5S__hyper_serial_size(const H5S_t *space)
{
hsize_t block_count = 0; /* block counter for regular hyperslabs */
- hsize_t bounds_start[H5S_MAX_RANK]; /* Selection bounds */
- hsize_t bounds_end[H5S_MAX_RANK]; /* Selection bounds */
uint32_t version; /* Version number */
- uint8_t offset_size; /* Offset size */
- unsigned u; /* Local index variable */
+ uint8_t enc_size; /* Encoded size of hyperslab selection info */
hssize_t ret_value = -1; /* return value */
FUNC_ENTER_NOAPI_NOINIT
HDassert(space);
- /* Get bounding box for the selection */
- HDmemset(bounds_end, 0, sizeof(bounds_end));
- if(space->select.sel_info.hslab->unlim_dim < 0) { /* ! H5S_UNLIMITED */
- /* Determine the number of blocks */
- if(H5S__hyper_is_regular(space)) {
- /* Check each dimension */
- for(block_count = 1, u = 0; u < space->extent.rank; u++)
- block_count *= space->select.sel_info.hslab->opt_diminfo[u].count;
- } /* end if */
- else
- /* Spin through hyperslab spans, adding 8 * rank bytes for each block */
- block_count = H5S__hyper_span_nblocks(space->select.sel_info.hslab->span_lst);
-
- /* Get bounding box for the selection */
- if(H5S__hyper_bounds(space, bounds_start, bounds_end) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds")
- }
-
- /* Determine the version */
- if(H5S_hyper_set_version(space, block_count, bounds_end, f, &version) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version")
+ /* Determine the number of blocks */
+ if(space->select.sel_info.hslab->unlim_dim < 0) /* ! H5S_UNLIMITED */
+ block_count = H5S__get_select_hyper_nblocks(space, FALSE);
- /* Determine the offset size */
- if(H5S_hyper_set_offset_size(space, block_count, bounds_end, version, &offset_size) < 0)
+ /* Determine the version and the encoded size */
+ if(H5S_hyper_get_version_enc_size(space, block_count, &version, &enc_size) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version")
if(version == H5S_HYPER_VERSION_2) {
@@ -2141,19 +2104,19 @@ H5S__hyper_serial_size(const H5S_t *space, H5F_t *f)
/* Size required is always:
* <type (4 bytes)> + <version (4 bytes)> + <flags (1 byte)> +
* <length (4 bytes)> + <rank (4 bytes)> +
- * (4 (start/stride/count/block) * <offset_size (8 bytes)> * <rank>) =
+ * (4 (start/stride/count/block) * <enc_size (8 bytes)> * <rank>) =
* 17 + (4 * 8 * rank) bytes
*/
- HDassert(offset_size == 8);
+ HDassert(enc_size == 8);
ret_value = (hssize_t)17 + ((hssize_t)4 * (hssize_t)8 * (hssize_t)space->extent.rank);
} else {
HDassert(version == H5S_HYPER_VERSION_1);
- HDassert(offset_size == 4);
+ HDassert(enc_size == 4);
/* Version 1 */
/* Basic number of bytes required to serialize hyperslab selection:
* <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> +
* <length (4 bytes)> + <rank (4 bytes)> + <# of blocks (4 bytes)> +
- * (2 (starting/ending offset) * <offset_size (4 bytes)> * <rank> * <# of blocks) =
+ * (2 (starting/ending offset) * <enc_size (4 bytes)> * <rank> * <# of blocks) =
* = 24 bytes + (2 * 4 * rank * block_count)
*/
ret_value = 24;
@@ -2258,7 +2221,6 @@ H5S__hyper_serialize_helper(const H5S_hyper_span_info_t *spans,
uint8_t **p; OUT: Pointer to buffer to put serialized
selection. Will be advanced to end of
serialized selection.
- H5F_t *f; IN: File pointer
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -2270,27 +2232,25 @@ H5S__hyper_serialize_helper(const H5S_hyper_span_info_t *spans,
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S__hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
+H5S__hyper_serialize(const H5S_t *space, uint8_t **p)
{
const H5S_hyper_dim_t *diminfo; /* Alias for dataspace's diminfo information */
- uint8_t *pp = (*p); /* Local pointer for decoding */
+ uint8_t *pp; /* Local pointer for encoding */
hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary hyperslab counts */
hsize_t offset[H5O_LAYOUT_NDIMS]; /* Offset of element in dataspace */
hsize_t start[H5O_LAYOUT_NDIMS]; /* Location of start of hyperslab */
hsize_t end[H5O_LAYOUT_NDIMS]; /* Location of end of hyperslab */
- hsize_t temp_off; /* Offset in a given dimension */
uint8_t *lenp; /* pointer to length location for later storage */
uint32_t len = 0; /* number of bytes used */
uint32_t version; /* Version number */
uint8_t flags = 0; /* Flags for message */
- hsize_t block_count; /* block counter for regular hyperslabs */
+ hsize_t block_count = 0; /* block counter for regular hyperslabs */
unsigned fast_dim; /* Rank of the fastest changing dimension for the dataspace */
unsigned ndims; /* Rank of the dataspace */
- unsigned u; /* Local counting variable */
+ unsigned i, u; /* Local counting variable */
int done; /* Whether we are done with the iteration */
- uint8_t offset_size;
- hsize_t bounds_start[H5S_MAX_RANK];
- hsize_t bounds_end[H5S_MAX_RANK];
+ hbool_t is_regular; /* Whether selection is regular */
+ uint8_t enc_size; /* Encoded size */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -2305,38 +2265,23 @@ H5S__hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
ndims = space->extent.rank;
diminfo = space->select.sel_info.hslab->opt_diminfo;
- if(space->select.sel_info.hslab->unlim_dim < 0) { /* ! H5S_UNLIMITED */
- /* Calculate the # of blocks */
- if(H5S__hyper_is_regular(space)) {
- /* Check each dimension */
- for(block_count = 1, u = 0; u < ndims; u++)
- block_count *= diminfo[u].count;
- } /* end if */
- else
- /* Spin through hyperslab spans, adding 8 * rank bytes for each block */
- block_count = H5S__hyper_span_nblocks(space->select.sel_info.hslab->span_lst);
-
- /* Get bounding box */
- if(H5S__hyper_bounds(space, bounds_start, bounds_end) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds")
- }
+ /* Calculate the # of blocks */
+ if(space->select.sel_info.hslab->unlim_dim < 0) /* ! H5S_UNLIMITED */
+ block_count = H5S__get_select_hyper_nblocks(space, FALSE);
/* Determine the version to use */
- if(H5S_hyper_set_version(space, block_count, bounds_end, f, &version) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version")
-
- /* Determine the size of offset info */
- if(H5S_hyper_set_offset_size(space, block_count, bounds_end, version, &offset_size) < 0)
+ if(H5S_hyper_get_version_enc_size(space, block_count, &version, &enc_size) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version")
- if(H5S__hyper_is_regular(space) && version == H5S_HYPER_VERSION_2)
+ is_regular = H5S__hyper_is_regular(space);
+ if(is_regular && version == H5S_HYPER_VERSION_2)
flags |= H5S_HYPER_REGULAR;
/* Store the preamble information */
UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */
UINT32ENCODE(pp, version); /* Store the version number */
- if(version == 2)
+ if(version == H5S_HYPER_VERSION_2)
*(pp)++ = flags; /* Store the flags */
else
UINT32ENCODE(pp, (uint32_t)0); /* Store the un-used padding */
@@ -2348,105 +2293,110 @@ H5S__hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
/* Encode number of dimensions */
UINT32ENCODE(pp, (uint32_t)ndims);
- /* If flags indicates a regular hyperslab or unlimited dimension, encode opt_diminfo */
- if(flags & H5S_HYPER_REGULAR) {
- unsigned i;
-
- HDassert(H5S_UNLIMITED == HSIZE_UNDEF);
- HDassert(version == H5S_HYPER_VERSION_2);
-
- /* Iterate over dimensions */
- /* Encode start/stride/block/count */
- for(i = 0; i < space->extent.rank; i++) {
- UINT64ENCODE(pp, diminfo[i].start);
- UINT64ENCODE(pp, diminfo[i].stride);
- UINT64ENCODE(pp, diminfo[i].count);
- UINT64ENCODE(pp, diminfo[i].block);
- } /* end for */
- len += (4 * space->extent.rank * 8);
- } /* end if */
/* Check for a "regular" hyperslab selection */
- else if(H5S__hyper_is_regular(space)) {
- HDassert(version == H5S_HYPER_VERSION_1);
+ if(is_regular) {
- /* Set some convienence values */
- fast_dim = ndims - 1;
- /* Encode number of hyperslabs */
- H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t);
- UINT32ENCODE(pp, (uint32_t)block_count);
- len += 4;
+ /* If flags indicates a regular hyperslab or unlimited dimension, encode opt_diminfo */
+ if(version == H5S_HYPER_VERSION_2) {
- /* Now serialize the information for the regular hyperslab */
+ HDassert(H5S_UNLIMITED == HSIZE_UNDEF);
+ HDassert(enc_size == H5S_SELECT_INFO_ENC_SIZE_8);
- /* Build the tables of count sizes as well as the initial offset */
- for(u = 0; u < ndims; u++) {
- tmp_count[u] = diminfo[u].count;
- offset[u] = diminfo[u].start;
- } /* end for */
+ /* Iterate over dimensions */
+ /* Encode start/stride/block/count */
+ for(i = 0; i < space->extent.rank; i++) {
+ UINT64ENCODE(pp, diminfo[i].start);
+ UINT64ENCODE(pp, diminfo[i].stride);
+ UINT64ENCODE(pp, diminfo[i].count);
+ UINT64ENCODE(pp, diminfo[i].block);
+ } /* end for */
+ len += (4 * space->extent.rank * 8);
+ } else {
+ HDassert(version == H5S_HYPER_VERSION_1);
+ HDassert(enc_size == H5S_SELECT_INFO_ENC_SIZE_4);
- /* We're not done with the iteration */
- done = FALSE;
+ /* Set some convienence values */
+ fast_dim = ndims - 1;
- /* Go iterate over the hyperslabs */
- while(done == FALSE) {
- /* Iterate over the blocks in the fastest dimension */
- while(tmp_count[fast_dim] > 0) {
- /* Add 8 bytes times the rank for each hyperslab selected */
- len += 8 * ndims;
+ /* Encode number of hyperslabs */
+ H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t);
+ UINT32ENCODE(pp, (uint32_t)block_count);
+ len += 4;
- /* Encode hyperslab starting location */
- for(u = 0; u < ndims; u++)
- UINT32ENCODE(pp, (uint32_t)offset[u]);
+ /* Now serialize the information for the regular hyperslab */
- /* Encode hyperslab ending location */
- for(u = 0; u < ndims; u++)
- UINT32ENCODE(pp, (uint32_t)(offset[u] + (diminfo[u].block - 1)));
+ /* Build the tables of count sizes as well as the initial offset */
+ for(u = 0; u < ndims; u++) {
+ tmp_count[u] = diminfo[u].count;
+ offset[u] = diminfo[u].start;
+ } /* end for */
- /* Move the offset to the next sequence to start */
- offset[fast_dim]+=diminfo[fast_dim].stride;
+ /* We're not done with the iteration */
+ done = FALSE;
- /* Decrement the block count */
- tmp_count[fast_dim]--;
- } /* end while */
+ /* Go iterate over the hyperslabs */
+ while(done == FALSE) {
+ /* Iterate over the blocks in the fastest dimension */
+ while(tmp_count[fast_dim] > 0) {
+ /* Add 8 bytes times the rank for each hyperslab selected */
+ len += 8 * ndims;
- /* Work on other dimensions if necessary */
- if(fast_dim > 0) {
- int temp_dim; /* Temporary rank holder */
+ /* Encode hyperslab starting location */
+ for(u = 0; u < ndims; u++)
+ UINT32ENCODE(pp, (uint32_t)offset[u]);
- /* Reset the block counts */
- tmp_count[fast_dim] = diminfo[fast_dim].count;
+ /* Encode hyperslab ending location */
+ for(u = 0; u < ndims; u++)
+ UINT32ENCODE(pp, (uint32_t)(offset[u] + (diminfo[u].block - 1)));
+
+ /* Move the offset to the next sequence to start */
+ offset[fast_dim]+=diminfo[fast_dim].stride;
- /* Bubble up the decrement to the slower changing dimensions */
- temp_dim = (int)fast_dim - 1;
- while(temp_dim >= 0 && done == FALSE) {
/* Decrement the block count */
- tmp_count[temp_dim]--;
+ tmp_count[fast_dim]--;
+ } /* end while */
- /* Check if we have more blocks left */
- if(tmp_count[temp_dim] > 0)
- break;
+ /* Work on other dimensions if necessary */
+ if(fast_dim > 0) {
+ int temp_dim; /* Temporary rank holder */
- /* Check for getting out of iterator */
- if(temp_dim == 0)
- done = TRUE;
+ /* Reset the block counts */
+ tmp_count[fast_dim] = diminfo[fast_dim].count;
- /* Reset the block count in this dimension */
- tmp_count[temp_dim] = diminfo[temp_dim].count;
+ /* Bubble up the decrement to the slower changing dimensions */
+ temp_dim = (int)fast_dim - 1;
+ while(temp_dim >= 0 && done == FALSE) {
+ /* Decrement the block count */
+ tmp_count[temp_dim]--;
- /* Wrapped a dimension, go up to next dimension */
- temp_dim--;
- } /* end while */
- } /* end if */
- else
- break; /* Break out now, for 1-D selections */
+ /* Check if we have more blocks left */
+ if(tmp_count[temp_dim] > 0)
+ break;
- /* Re-compute offset array */
- for(u = 0; u < ndims; u++)
- offset[u] = diminfo[u].start + diminfo[u].stride * (diminfo[u].count - tmp_count[u]);
- } /* end while */
- } /* end if */
- else {
+ /* Check for getting out of iterator */
+ if(temp_dim == 0)
+ done = TRUE;
+
+ /* Reset the block count in this dimension */
+ tmp_count[temp_dim] = diminfo[temp_dim].count;
+
+ /* Wrapped a dimension, go up to next dimension */
+ temp_dim--;
+ } /* end while */
+ } /* end if */
+ else
+ break; /* Break out now, for 1-D selections */
+
+ /* Re-compute offset array */
+ for(u = 0; u < ndims; u++)
+ offset[u] = diminfo[u].start + diminfo[u].stride * (diminfo[u].count - tmp_count[u]);
+ } /* end while */
+ } /* end if */
+
+ } else { /* irregular */
HDassert(version == H5S_HYPER_VERSION_1);
+ HDassert(enc_size == H5S_SELECT_INFO_ENC_SIZE_4);
+
/* Encode number of hyperslabs */
H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t);
UINT32ENCODE(pp, (uint32_t)block_count);
@@ -2479,10 +2429,8 @@ done:
Deserialize the current selection from a user-provided buffer.
USAGE
herr_t H5S__hyper_deserialize(space, p)
- H5S_t *space; IN/OUT: Dataspace pointer to place
+ H5S_t **space; IN/OUT: Dataspace pointer to place
selection into
- uint32_t version IN: Selection version
- uint8_t flags IN: Selection flags
uint8 **p; OUT: Pointer to buffer holding serialized
selection. Will be advanced to end of
serialized selection.
@@ -2497,27 +2445,68 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S__hyper_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t flags,
- const uint8_t **p)
+H5S__hyper_deserialize(H5S_t **space, const uint8_t **p)
{
- unsigned rank; /* Rank of points */
- const uint8_t *pp; /* Local pointer for decoding */
- hsize_t start[H5O_LAYOUT_NDIMS]; /* Hyperslab start information */
- hsize_t block[H5O_LAYOUT_NDIMS]; /* Hyperslab block information */
- unsigned u; /* Local counting variable */
- herr_t ret_value = FAIL; /* Return value */
+ H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use,
+ either *space or a newly allocated one */
+ hsize_t dims[H5S_MAX_RANK]; /* Dimenion sizes */
+ hsize_t start[H5S_MAX_RANK]; /* Hyperslab start information */
+ hsize_t block[H5S_MAX_RANK]; /* Hyperslab block information */
+ uint32_t version; /* Version number */ /* Encoded size */
+ uint8_t flags = 0; /* Flags */
+ unsigned rank; /* Rank of points */
+ const uint8_t *pp; /* Local pointer for decoding */
+ unsigned u; /* Local counting variable */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_STATIC
/* Check args */
- HDassert(space);
HDassert(p);
pp = (*p);
HDassert(pp);
- /* Deserialize slabs to select */
- /* (The header and rank have already beed decoded) */
- rank = space->extent.rank; /* Retrieve rank from space */
+ /* As part of the efforts to push all selection-type specific coding
+ to the callbacks, the coding for the allocation of a null dataspace
+ is moved from H5S_select_deserialize() in H5Sselect.c to here.
+ This is needed for decoding virtual layout in H5O__layout_decode() */
+ /* Allocate space if not provided */
+ if(!*space) {
+ if(NULL == (tmp_space = H5S_create(H5S_SIMPLE)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create dataspace")
+ } /* end if */
+ else
+ tmp_space = *space;
+
+ /* Decode version */
+ UINT32DECODE(pp, version);
+
+ if(version < H5S_HYPER_VERSION_1 || version > H5S_HYPER_VERSION_LATEST)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for hyperslab selection")
+
+ if(version >= (uint32_t)H5S_HYPER_VERSION_2) {
+ /* Decode flags */
+ flags = *(pp)++;
+
+ /* Skip over the remainder of the header */
+ pp += 4;
+ } else
+ /* Skip over the remainder of the header */
+ pp += 8;
+
+ /* Decode the rank of the point selection */
+ UINT32DECODE(pp,rank);
+
+ if(!*space) {
+ /* Patch the rank of the allocated dataspace */
+ (void)HDmemset(dims, 0, (size_t)rank * sizeof(dims[0]));
+ if(H5S_set_extent_simple(tmp_space, rank, dims, NULL) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't set dimensions")
+ } /* end if */
+ else
+ /* Verify the rank of the provided dataspace */
+ if(rank != tmp_space->extent.rank)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "rank of serialized selection does not match dataspace")
if(flags & H5S_HYPER_REGULAR) {
hsize_t stride[H5O_LAYOUT_NDIMS]; /* Hyperslab stride information */
@@ -2525,7 +2514,7 @@ H5S__hyper_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t fl
/* Sanity checks */
HDassert(H5S_UNLIMITED == HSIZE_UNDEF);
- HDassert(version >= 2);
+ HDassert(version >= H5S_HYPER_VERSION_2);
/* Iterate over dimensions */
for(u = 0; u < rank; u++) {
@@ -2537,7 +2526,7 @@ H5S__hyper_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t fl
} /* end for */
/* Select the hyperslab to the current selection */
- if((ret_value = H5S_select_hyperslab(space, H5S_SELECT_SET, start, stride, count, block)) < 0)
+ if((ret_value = H5S_select_hyperslab(tmp_space, H5S_SELECT_SET, start, stride, count, block)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't change selection")
} /* end if */
else {
@@ -2571,7 +2560,7 @@ H5S__hyper_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t fl
*tblock = (*tend - *tstart) + 1;
/* Select or add the hyperslab to the current selection */
- if((ret_value = H5S_select_hyperslab(space, (u == 0 ? H5S_SELECT_SET : H5S_SELECT_OR), start, stride, count, block)) < 0)
+ if((ret_value = H5S_select_hyperslab(tmp_space, (u == 0 ? H5S_SELECT_SET : H5S_SELECT_OR), start, stride, count, block)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't change selection")
} /* end for */
} /* end else */
@@ -2579,7 +2568,16 @@ H5S__hyper_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t fl
/* Update decoding pointer */
*p = pp;
+ /* Return space to the caller if allocated */
+ if(!*space)
+ *space = tmp_space;
+
done:
+ /* Free temporary space if not passed to caller (only happens on error) */
+ if(!*space && tmp_space)
+ if(H5S_close(tmp_space) < 0)
+ HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S__hyper_deserialize() */
diff --git a/src/H5Snone.c b/src/H5Snone.c
index e71b599..aa98035 100644
--- a/src/H5Snone.c
+++ b/src/H5Snone.c
@@ -37,10 +37,9 @@ static herr_t H5S_none_get_seq_list(const H5S_t *space, unsigned flags,
size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len);
static herr_t H5S_none_release(H5S_t *space);
static htri_t H5S_none_is_valid(const H5S_t *space);
-static hssize_t H5S_none_serial_size(const H5S_t *space, H5F_t *f);
-static herr_t H5S_none_serialize(const H5S_t *space, uint8_t **p, H5F_t *f);
-static herr_t H5S_none_deserialize(H5S_t *space, uint32_t version, uint8_t flags,
- const uint8_t **p);
+static hssize_t H5S_none_serial_size(const H5S_t *space);
+static herr_t H5S_none_serialize(const H5S_t *space, uint8_t **p);
+static herr_t H5S_none_deserialize(H5S_t **space, const uint8_t **p);
static herr_t H5S_none_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
static herr_t H5S_none_offset(const H5S_t *space, hsize_t *off);
static int H5S__none_unlim_dim(const H5S_t *space);
@@ -57,7 +56,7 @@ static herr_t H5S_none_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords);
static herr_t H5S_none_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
static hsize_t H5S_none_iter_nelmts(const H5S_sel_iter_t *iter);
static htri_t H5S_none_iter_has_next_block(const H5S_sel_iter_t *iter);
-static herr_t H5S_none_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem);
+static herr_t H5S_none_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem);
static herr_t H5S_none_iter_next_block(H5S_sel_iter_t *sel_iter);
static herr_t H5S_none_iter_release(H5S_sel_iter_t *sel_iter);
@@ -251,7 +250,7 @@ H5S_none_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter)
USAGE
herr_t H5S_none_iter_next(iter, nelem)
H5S_sel_iter_t *iter; IN: Pointer to selection iterator
- hsize_t nelem; IN: Number of elements to advance by
+ size_t nelem; IN: Number of elements to advance by
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -262,7 +261,7 @@ H5S_none_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_none_iter_next(H5S_sel_iter_t H5_ATTR_UNUSED *iter, hsize_t H5_ATTR_UNUSED nelem)
+H5S_none_iter_next(H5S_sel_iter_t H5_ATTR_UNUSED *iter, size_t H5_ATTR_UNUSED nelem)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -435,7 +434,6 @@ H5S_none_is_valid(const H5S_t H5_ATTR_UNUSED *space)
USAGE
hssize_t H5S_none_serial_size(space, f)
H5S_t *space; IN: Dataspace pointer to query
- H5F_t *f; IN: File pointer
RETURNS
The number of bytes required on success, negative on an error.
DESCRIPTION
@@ -447,7 +445,7 @@ H5S_none_is_valid(const H5S_t H5_ATTR_UNUSED *space)
REVISION LOG
--------------------------------------------------------------------------*/
static hssize_t
-H5S_none_serial_size(const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f)
+H5S_none_serial_size(const H5S_t H5_ATTR_UNUSED *space)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -467,12 +465,11 @@ H5S_none_serial_size(const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f)
PURPOSE
Serialize the current selection into a user-provided buffer.
USAGE
- herr_t H5S_none_serialize(space, p, f)
+ herr_t H5S_none_serialize(space, p)
const H5S_t *space; IN: Dataspace with selection to serialize
uint8_t **p; OUT: Pointer to buffer to put serialized
selection. Will be advanced to end of
serialized selection.
- H5F_t *f; IN: File pointer
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -484,7 +481,7 @@ H5S_none_serial_size(const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_none_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f)
+H5S_none_serialize(const H5S_t *space, uint8_t **p)
{
uint8_t *pp = (*p); /* Local pointer for decoding */
@@ -515,10 +512,8 @@ H5S_none_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f)
Deserialize the current selection from a user-provided buffer.
USAGE
herr_t H5S_none_deserialize(space, version, flags, p)
- H5S_t *space; IN/OUT: Dataspace pointer to place
+ H5S_t **space; IN/OUT: Dataspace pointer to place
selection into
- uint32_t version IN: Selection version
- uint8_t flags IN: Selection flags
uint8 **p; OUT: Pointer to buffer holding serialized
selection. Will be advanced to end of
serialized selection.
@@ -533,22 +528,50 @@ H5S_none_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_none_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t H5_ATTR_UNUSED flags,
- const uint8_t H5_ATTR_UNUSED **p)
+H5S_none_deserialize(H5S_t **space, const uint8_t **p)
{
- herr_t ret_value = SUCCEED; /* return value */
+ H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use,
+ either *space or a newly allocated one */
+ uint32_t version; /* Version number */
+ herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_NOAPI_NOINIT
- HDassert(space);
HDassert(p);
HDassert(*p);
+ /* As part of the efforts to push all selection-type specific coding
+ to the callbacks, the coding for the allocation of a null dataspace
+ is moved from H5S_select_deserialize() in H5Sselect.c to here.
+ This is needed for decoding virtual layout in H5O__layout_decode() */
+ /* Allocate space if not provided */
+ if(!*space) {
+ if(NULL == (tmp_space = H5S_create(H5S_SIMPLE)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create dataspace")
+ } /* end if */
+ else
+ tmp_space = *space;
+
+ /* Decode version */
+ UINT32DECODE(*p, version);
+
+ /* Skip over the remainder of the header */
+ *p += 8;
+
/* Change to "none" selection */
- if(H5S_select_none(space) < 0)
+ if(H5S_select_none(tmp_space) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
+ /* Return space to the caller if allocated */
+ if(!*space)
+ *space = tmp_space;
+
done:
+ /* Free temporary space if not passed to caller (only happens on error) */
+ if(!*space && tmp_space)
+ if(H5S_close(tmp_space) < 0)
+ HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_none_deserialize() */
diff --git a/src/H5Spkg.h b/src/H5Spkg.h
index f6bd3d1..518c495 100644
--- a/src/H5Spkg.h
+++ b/src/H5Spkg.h
@@ -37,8 +37,9 @@
#define H5S_SELECT_FLAG_BITS (H5S_HYPER_REGULAR)
/* Versions for H5S_SEL_HYPER selection info */
-#define H5S_HYPER_VERSION_1 1
-#define H5S_HYPER_VERSION_2 2
+#define H5S_HYPER_VERSION_1 1
+#define H5S_HYPER_VERSION_2 2
+#define H5S_HYPER_VERSION_LATEST H5S_HYPER_VERSION_2
/* Versions for H5S_SEL_POINTS selection info */
#define H5S_POINT_VERSION_1 1
@@ -50,9 +51,9 @@
#define H5S_ALL_VERSION_1 1
/* Size of point/offset info for H5S_SEL_POINTS/H5S_SEL_HYPER */
-#define H5S_INFO_SIZE_4 0x04 /* 4 bytes: 32 bits */
-#define H5S_INFO_SIZE_8 0x08 /* 8 bytes: 64 bits */
-#define H5S_SELECT_INFO_SIZE_BITS (H5S_INFO_SIZE_4|H5S_INFO_SIZE_8)
+#define H5S_SELECT_INFO_ENC_SIZE_4 0x04 /* 4 bytes: 32 bits */
+#define H5S_SELECT_INFO_ENC_SIZE_8 0x08 /* 8 bytes: 64 bits */
+#define H5S_SELECT_INFO_ENC_SIZE_BITS (H5S_SELECT_INFO_ENC_SIZE_4|H5S_SELECT_INFO_ENC_SIZE_8)
#define H5S_UINT32_MAX 4294967295 /* 2^32 - 1 */
@@ -159,12 +160,11 @@ typedef herr_t (*H5S_sel_release_func_t)(H5S_t *space);
/* Method to determine if current selection is valid for dataspace */
typedef htri_t (*H5S_sel_is_valid_func_t)(const H5S_t *space);
/* Method to determine number of bytes required to store current selection */
-typedef hssize_t (*H5S_sel_serial_size_func_t)(const H5S_t *space, H5F_t *f);
+typedef hssize_t (*H5S_sel_serial_size_func_t)(const H5S_t *space);
/* Method to store current selection in "serialized" form (a byte sequence suitable for storing on disk) */
-typedef herr_t (*H5S_sel_serialize_func_t)(const H5S_t *space, uint8_t **p, H5F_t *f);
+typedef herr_t (*H5S_sel_serialize_func_t)(const H5S_t *space, uint8_t **p);
/* Method to create selection from "serialized" form (a byte sequence suitable for storing on disk) */
-typedef herr_t (*H5S_sel_deserialize_func_t)(H5S_t *space, uint32_t version, uint8_t flags,
- const uint8_t **p);
+typedef herr_t (*H5S_sel_deserialize_func_t)(H5S_t **space, const uint8_t **p);
/* Method to determine smallest n-D bounding box containing the current selection */
typedef herr_t (*H5S_sel_bounds_func_t)(const H5S_t *space, hsize_t *start, hsize_t *end);
/* Method to determine linear offset of initial element in selection within dataspace */
@@ -245,7 +245,7 @@ typedef hsize_t (*H5S_sel_iter_nelmts_func_t)(const H5S_sel_iter_t *iter);
/* Method to determine if there are more blocks left in the current selection */
typedef htri_t (*H5S_sel_iter_has_next_block_func_t)(const H5S_sel_iter_t *iter);
/* Method to move selection iterator to the next element in the selection */
-typedef herr_t (*H5S_sel_iter_next_func_t)(H5S_sel_iter_t *iter, hsize_t nelem);
+typedef herr_t (*H5S_sel_iter_next_func_t)(H5S_sel_iter_t *iter, size_t nelem);
/* Method to move selection iterator to the next block in the selection */
typedef herr_t (*H5S_sel_iter_next_block_func_t)(H5S_sel_iter_t *iter);
/* Method to release iterator for current selection */
diff --git a/src/H5Spoint.c b/src/H5Spoint.c
index 2363352..04d829f 100644
--- a/src/H5Spoint.c
+++ b/src/H5Spoint.c
@@ -38,10 +38,9 @@ static herr_t H5S_point_get_seq_list(const H5S_t *space, unsigned flags,
size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len);
static herr_t H5S_point_release(H5S_t *space);
static htri_t H5S_point_is_valid(const H5S_t *space);
-static hssize_t H5S_point_serial_size(const H5S_t *space, H5F_t *f);
-static herr_t H5S_point_serialize(const H5S_t *space, uint8_t **p, H5F_t *f);
-static herr_t H5S_point_deserialize(H5S_t *space, uint32_t version, uint8_t flags,
- const uint8_t **p);
+static hssize_t H5S_point_serial_size(const H5S_t *space);
+static herr_t H5S_point_serialize(const H5S_t *space, uint8_t **p);
+static herr_t H5S_point_deserialize(H5S_t **space, const uint8_t **p);
static herr_t H5S_point_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
static herr_t H5S_point_offset(const H5S_t *space, hsize_t *off);
static int H5S__point_unlim_dim(const H5S_t *space);
@@ -52,13 +51,15 @@ static void H5S_point_adjust_u(H5S_t *space, const hsize_t *offset);
static herr_t H5S_point_project_scalar(const H5S_t *space, hsize_t *offset);
static herr_t H5S_point_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
static herr_t H5S_point_iter_init(H5S_sel_iter_t *iter, const H5S_t *space);
+static herr_t
+ H5S_point_get_version_enc_size(const H5S_t *space, uint32_t *version, uint8_t *enc_size);
/* Selection iteration callbacks */
static herr_t H5S_point_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords);
static herr_t H5S_point_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
static hsize_t H5S_point_iter_nelmts(const H5S_sel_iter_t *iter);
static htri_t H5S_point_iter_has_next_block(const H5S_sel_iter_t *iter);
-static herr_t H5S_point_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem);
+static herr_t H5S_point_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem);
static herr_t H5S_point_iter_next_block(H5S_sel_iter_t *sel_iter);
static herr_t H5S_point_iter_release(H5S_sel_iter_t *sel_iter);
@@ -278,7 +279,7 @@ done:
USAGE
herr_t H5S_point_iter_next(iter, nelem)
H5S_sel_iter_t *iter; IN: Pointer to selection iterator
- hsize_t nelem; IN: Number of elements to advance by
+ size_t nelem; IN: Number of elements to advance by
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -289,7 +290,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_point_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
+H5S_point_iter_next(H5S_sel_iter_t *iter, size_t nelem)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -754,20 +755,19 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5S_point_set_version
+ H5S_point_get_version_enc_size
PURPOSE
- Determine the version to use for encoding points selection info
+ Determine the version and the size (4 bytes) to encode point selection info
USAGE
- hssize_t H5S_point_set_version(space, bounds_end, f, version)
+ hssize_t H5S_point_get_version_enc_size(space, uint32_t *version, uint8_t *enc_size
const H5S_t *space; IN: The dataspace
- hsize_t bounds_end: IN: The selection high bounds
- H5F_t *f: IN: The file pointer
uint32_t *version: OUT: The version to use for encoding
+ uint8_t *enc_size: OUT: The size to use for encoding
RETURNS
- The version to use
+ The version and the encoded size to use
DESCRIPTION
- Determine the version to use for encoding points selection info:
- For 1.10, return 1
+ Determine the version and the encoded size to use for encoding points selection info.
+ Detect whether the number of points or the high bound exceeds 2^32 -1.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
@@ -775,15 +775,20 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_point_set_version(const H5S_t *space, hsize_t bounds_end[], H5F_t *f, uint32_t *version)
+H5S_point_get_version_enc_size(const H5S_t *space, uint32_t *version, uint8_t *enc_size)
{
hbool_t exceed = FALSE;
+ hsize_t bounds_start[H5S_MAX_RANK];
+ hsize_t bounds_end[H5S_MAX_RANK];
unsigned u;
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_NOAPI_NOINIT
- *version = H5S_POINT_VERSION_1;
+ /* Get bounding box for the selection */
+ HDmemset(bounds_end, 0, sizeof(bounds_end));
+ if(H5S_point_bounds(space, bounds_start, bounds_end) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds")
/* Determine whether the number of points or the high bounds in the selection exceed (2^32 - 1) */
for(u = 0; u < space->extent.rank; u++)
@@ -797,47 +802,12 @@ H5S_point_set_version(const H5S_t *space, hsize_t bounds_end[], H5F_t *f, uint32
else if(exceed)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "The end of bounding box in point selection exceeds 2^32")
+ *version = H5S_POINT_VERSION_1;
+ *enc_size = H5S_SELECT_INFO_ENC_SIZE_4;
+
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_point_set_version() */
-
-
-/*--------------------------------------------------------------------------
- NAME
- H5S_point_set_info_size
- PURPOSE
- Determine the size of point info to use for encoding selection info
- USAGE
- hssize_t H5S_point_set_info_size(space, bounds_end, version, point_size)
- const H5S_t *space: IN: Dataspace ID of selection to query
- hsize_t bounds_end[]: IN: The selection high bounds
- uint32_t version: IN: The version used for encoding
- uint8_t *point_size: OUT: The size of point info
- RETURNS
- The size of the points selection info
- DESCRIPTION
- Determine the size for encoding points selection info:
- For 1.10, return 4
-
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static herr_t
-H5S_point_set_info_size(const H5S_t *space, hsize_t H5_ATTR_UNUSED bounds_end[], uint32_t H5_ATTR_UNUSED version, uint8_t H5_ATTR_UNUSED *point_size)
-{
- hsize_t max_size = 0;
- unsigned u;
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- HDassert(version == H5S_POINT_VERSION_1);
-
- *point_size = H5S_INFO_SIZE_4;
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_point_set_info_size() */
+} /* H5S_point_get_version_enc_size() */
/*--------------------------------------------------------------------------
@@ -847,9 +817,8 @@ H5S_point_set_info_size(const H5S_t *space, hsize_t H5_ATTR_UNUSED bounds_end[],
Determine the number of bytes needed to store the serialized point selection
information.
USAGE
- hssize_t H5S_point_serial_size(space, f)
+ hssize_t H5S_point_serial_size(space)
H5S_t *space; IN: Dataspace pointer to query
- H5F_t *f; IN: File pointer
RETURNS
The number of bytes required on success, negative on an error.
DESCRIPTION
@@ -861,34 +830,23 @@ H5S_point_set_info_size(const H5S_t *space, hsize_t H5_ATTR_UNUSED bounds_end[],
REVISION LOG
--------------------------------------------------------------------------*/
static hssize_t
-H5S_point_serial_size (const H5S_t *space, H5F_t *f)
+H5S_point_serial_size (const H5S_t *space)
{
H5S_pnt_node_t *curr; /* Point information nodes */
- hsize_t bounds_start[H5S_MAX_RANK];
- hsize_t bounds_end[H5S_MAX_RANK];
uint32_t version; /* Version number */
- uint8_t point_size; /* Size of point info */
+ uint8_t enc_size; /* Size of point info */
hssize_t ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
HDassert(space);
- /* Get bounding box for the selection */
- HDmemset(bounds_end, 0, sizeof(bounds_end));
- if(H5S_point_bounds(space, bounds_start, bounds_end) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds")
-
/* Determine the version */
- if(H5S_point_set_version(space, bounds_end, f, &version) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version")
-
- /* Determine the size of point info */
- if(H5S_point_set_info_size(space, bounds_end, version, &point_size) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version")
+ if(H5S_point_get_version_enc_size(space, &version, &enc_size) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine version and enc_size")
HDassert(version == H5S_POINT_VERSION_1);
- HDassert(point_size == H5S_INFO_SIZE_4);
+ HDassert(enc_size == H5S_SELECT_INFO_ENC_SIZE_4);
/* Basic number of bytes required to serialize point selection: */
/*
@@ -897,14 +855,14 @@ H5S_point_serial_size (const H5S_t *space, H5F_t *f)
*/
ret_value=20;
- /* <num points (depend on point_size)> */
- ret_value += point_size;
+ /* <num points (depend on enc_size)> */
+ ret_value += enc_size;
/* Count points in selection */
curr=space->select.sel_info.pnt_lst->head;
while(curr!=NULL) {
- /* Add <point_size> bytes times the rank for each element selected */
- ret_value += point_size * space->extent.rank;
+ /* Add <enc_size> bytes times the rank for each element selected */
+ ret_value += enc_size * space->extent.rank;
curr = curr->next;
} /* end while */
@@ -919,12 +877,11 @@ done:
PURPOSE
Serialize the current selection into a user-provided buffer.
USAGE
- herr_t H5S_point_serialize(space, p, f)
+ herr_t H5S_point_serialize(space, p)
const H5S_t *space; IN: Dataspace with selection to serialize
uint8_t **p; OUT: Pointer to buffer to put serialized
selection. Will be advanced to end of
serialized selection.
- H5F_t *f; IN: File pointer
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -936,17 +893,15 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_point_serialize (const H5S_t *space, uint8_t **p, H5F_t *f)
+H5S_point_serialize (const H5S_t *space, uint8_t **p)
{
H5S_pnt_node_t *curr; /* Point information nodes */
- uint8_t *pp = (*p); /* Local pointer for decoding */
+ uint8_t *pp; /* Local pointer for encoding */
uint8_t *lenp; /* pointer to length location for later storage */
uint32_t len=0; /* number of bytes used */
unsigned u; /* local counting variable */
uint32_t version; /* Version number */
- uint8_t point_size; /* Size of point info */
- hsize_t bounds_start[H5S_MAX_RANK];
- hsize_t bounds_end[H5S_MAX_RANK];
+ uint8_t enc_size; /* Size of point info */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -954,22 +909,14 @@ H5S_point_serialize (const H5S_t *space, uint8_t **p, H5F_t *f)
/* Check args */
HDassert(space);
HDassert(p);
+ pp = (*p);
HDassert(pp);
- /* Get bounding box for the selection */
- HDmemset(bounds_end, 0, sizeof(bounds_end));
- if(H5S_point_bounds(space, bounds_start, bounds_end) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds")
-
/* Determine the version */
- if(H5S_point_set_version(space, bounds_end, f, &version) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version")
-
- /* Determine the size of point info */
- if(H5S_point_set_info_size(space, bounds_end, version, &point_size) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version")
+ if(H5S_point_get_version_enc_size(space, &version, &enc_size) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine version and enc_size")
- HDassert(point_size == H5S_INFO_SIZE_4);
+ HDassert(enc_size == H5S_SELECT_INFO_ENC_SIZE_4);
HDassert(version == H5S_POINT_VERSION_1);
/* Store the preamble information */
@@ -1019,10 +966,8 @@ done:
Deserialize the current selection from a user-provided buffer.
USAGE
herr_t H5S_point_deserialize(space, p)
- H5S_t *space; IN/OUT: Dataspace pointer to place
+ H5S_t **space; IN/OUT: Dataspace pointer to place
selection into
- uint32_t version IN: Selection version
- uint8_t flags IN: Selection flags
uint8 **p; OUT: Pointer to buffer holding serialized
selection. Will be advanced to end of
serialized selection.
@@ -1037,13 +982,15 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_point_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t H5_ATTR_UNUSED flags,
- const uint8_t **p)
+H5S_point_deserialize(H5S_t **space, const uint8_t **p)
{
- H5S_seloper_t op = H5S_SELECT_SET; /* Selection operation */
+ H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use,
+ either *space or a newly allocated one */
+ hsize_t dims[H5S_MAX_RANK]; /* Dimension sizes */
+ uint32_t version; /* Version number */
hsize_t *coord = NULL, *tcoord; /* Pointer to array of elements */
- const uint8_t *pp = (*p); /* Local pointer for decoding */
- hsize_t num_elem = 0; /* Number of elements in selection */
+ const uint8_t *pp; /* Local pointer for decoding */
+ size_t num_elem = 0; /* Number of elements in selection */
unsigned rank; /* Rank of points */
unsigned i, j; /* local counting variables */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1051,13 +998,43 @@ H5S_point_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t H5_
FUNC_ENTER_NOAPI_NOINIT
/* Check args */
- HDassert(space);
HDassert(p);
+ pp = (*p);
HDassert(pp);
+ /* As part of the efforts to push all selection-type specific coding
+ to the callbacks, the coding for the allocation of a null dataspace
+ is moved from H5S_select_deserialize() in H5Sselect.c to here.
+ This is needed for decoding virtual layout in H5O__layout_decode() */
+ /* Allocate space if not provided */
+ if(!*space) {
+ if(NULL == (tmp_space = H5S_create(H5S_SIMPLE)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create dataspace")
+ } /* end if */
+ else
+ tmp_space = *space;
+
+ /* Decode version */
+ UINT32DECODE(pp, version);
+
+ /* Skip over the remainder of the header */
+ pp += 8;
+
+ /* Decode the rank of the point selection */
+ UINT32DECODE(pp,rank);
+
+ if(!*space) {
+ /* Patch the rank of the allocated dataspace */
+ (void)HDmemset(dims, 0, (size_t)rank * sizeof(dims[0]));
+ if(H5S_set_extent_simple(tmp_space, rank, dims, NULL) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't set dimensions")
+ } /* end if */
+ else
+ /* Verify the rank of the provided dataspace */
+ if(rank != tmp_space->extent.rank)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "rank of serialized selection does not match dataspace")
+
/* Deserialize points to select */
- /* (The header and rank have already beed decoded) */
- rank = space->extent.rank; /* Retrieve rank from space */
UINT32DECODE(pp, num_elem); /* decode the number of points */
/* Allocate space for the coordinates */
@@ -1070,13 +1047,22 @@ H5S_point_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t H5_
UINT32DECODE(pp, *tcoord);
/* Select points */
- if(H5S_select_elements(space, op, num_elem, (const hsize_t *)coord) < 0)
+ if(H5S_select_elements(tmp_space, H5S_SELECT_SET, num_elem, (const hsize_t *)coord) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
/* Update decoding pointer */
*p = pp;
+ /* Return space to the caller if allocated */
+ if(!*space)
+ *space = tmp_space;
+
done:
+ /* Free temporary space if not passed to caller (only happens on error) */
+ if(!*space && tmp_space)
+ if(H5S_close(tmp_space) < 0)
+ HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace")
+
/* Free the coordinate array if necessary */
if(coord != NULL)
H5MM_xfree(coord);
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index e46c43b..cf9338e 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -149,8 +149,8 @@ typedef struct H5S_sel_iter_op_t {
#define H5S_SELECT_GET_SEQ_LIST(S,FLAGS,ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN) ((*(S)->select.type->get_seq_list)(S,FLAGS,ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN))
#define H5S_SELECT_VALID(S) ((*(S)->select.type->is_valid)(S))
#define H5S_SELECT_RELEASE(S) ((*(S)->select.type->release)(S))
-#define H5S_SELECT_SERIAL_SIZE(S,F) ((*(S)->select.type->serial_size)(S,F))
-#define H5S_SELECT_SERIALIZE(S,BUF,F) ((*(S)->select.type->serialize)(S,BUF,F))
+#define H5S_SELECT_SERIAL_SIZE(S) ((*(S)->select.type->serial_size)(S))
+#define H5S_SELECT_SERIALIZE(S,BUF) ((*(S)->select.type->serialize)(S,BUF))
#define H5S_SELECT_BOUNDS(S,START,END) ((*(S)->select.type->bounds)(S,START,END))
#define H5S_SELECT_OFFSET(S, OFFSET) ((*(S)->select.type->offset)(S, OFFSET))
#define H5S_SELECT_IS_CONTIGUOUS(S) ((*(S)->select.type->is_contiguous)(S))
@@ -175,8 +175,8 @@ typedef struct H5S_sel_iter_op_t {
#define H5S_SELECT_GET_SEQ_LIST(S,FLAGS,ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN) (H5S_select_get_seq_list(S,FLAGS,ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN))
#define H5S_SELECT_VALID(S) (H5S_select_valid(S))
#define H5S_SELECT_RELEASE(S) (H5S_select_release(S))
-#define H5S_SELECT_SERIAL_SIZE(S,F) (H5S_select_serial_size(S,F))
-#define H5S_SELECT_SERIALIZE(S,BUF,F) (H5S_select_serialize(S,BUF,F))
+#define H5S_SELECT_SERIAL_SIZE(S) (H5S_select_serial_size(S))
+#define H5S_SELECT_SERIALIZE(S,BUF) (H5S_select_serialize(S,BUF))
#define H5S_SELECT_BOUNDS(S,START,END) (H5S_get_select_bounds(S,START,END))
#define H5S_SELECT_OFFSET(S, OFFSET) (H5S_get_select_offset(S, OFFSET))
#define H5S_SELECT_IS_CONTIGUOUS(S) (H5S_select_is_contiguous(S))
@@ -220,7 +220,7 @@ H5_DLL herr_t H5S_get_validated_dataspace(hid_t space_id, const H5S_t **space/*o
H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/],
const hsize_t maxdims[/*rank*/]);
H5_DLL herr_t H5S_set_version(H5F_t *f, H5S_t *ds);
-H5_DLL herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc, hid_t fapl_id);
+H5_DLL herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc);
H5_DLL H5S_t *H5S_decode(const unsigned char **p);
H5_DLL herr_t H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent,
int fwidth);
@@ -255,8 +255,8 @@ H5_DLL herr_t H5S_select_release(H5S_t *ds);
H5_DLL herr_t H5S_select_get_seq_list(const H5S_t *space, unsigned flags,
H5S_sel_iter_t *iter, size_t maxseq, size_t maxbytes,
size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len);
-H5_DLL hssize_t H5S_select_serial_size(const H5S_t *space, H5F_t *f);
-H5_DLL herr_t H5S_select_serialize(const H5S_t *space, uint8_t **p, H5F_t *f);
+H5_DLL hssize_t H5S_select_serial_size(const H5S_t *space);
+H5_DLL herr_t H5S_select_serialize(const H5S_t *space, uint8_t **p);
H5_DLL htri_t H5S_select_is_contiguous(const H5S_t *space);
H5_DLL htri_t H5S_select_is_single(const H5S_t *space);
H5_DLL htri_t H5S_select_is_regular(const H5S_t *space);
@@ -306,7 +306,7 @@ H5_DLL hsize_t H5S_hyper_get_first_inc_block(const H5S_t *space,
H5_DLL herr_t H5S_select_iter_init(H5S_sel_iter_t *iter, const H5S_t *space, size_t elmt_size);
H5_DLL herr_t H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords);
H5_DLL hsize_t H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter);
-H5_DLL herr_t H5S_select_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem);
+H5_DLL herr_t H5S_select_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem);
H5_DLL herr_t H5S_select_iter_release(H5S_sel_iter_t *sel_iter);
#ifdef H5_HAVE_PARALLEL
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index 3a7ad7a..3ab4d28 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -223,7 +223,7 @@ done:
*-------------------------------------------------------------------------
*/
hssize_t
-H5S_select_serial_size(const H5S_t *space, H5F_t *f)
+H5S_select_serial_size(const H5S_t *space)
{
hssize_t ret_value = -1; /* Return value */
@@ -232,7 +232,7 @@ H5S_select_serial_size(const H5S_t *space, H5F_t *f)
HDassert(space);
/* Call the selection type's serial_size function */
- ret_value=(*space->select.type->serial_size)(space, f);
+ ret_value=(*space->select.type->serial_size)(space);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_select_serial_size() */
@@ -249,7 +249,6 @@ H5S_select_serial_size(const H5S_t *space, H5F_t *f)
uint8_t **p; OUT: Pointer to buffer to put serialized
selection. Will be advanced to end of
serialized selection.
- H5F_t *f; IN: File pointer
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -264,7 +263,7 @@ H5S_select_serial_size(const H5S_t *space, H5F_t *f)
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_select_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
+H5S_select_serialize(const H5S_t *space, uint8_t **p)
{
herr_t ret_value=SUCCEED; /* Return value */
@@ -274,7 +273,7 @@ H5S_select_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
HDassert(p);
/* Call the selection type's serialize function */
- ret_value=(*space->select.type->serialize)(space,p,f);
+ ret_value=(*space->select.type->serialize)(space,p);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_select_serialize() */
@@ -458,101 +457,44 @@ H5S_select_valid(const H5S_t *space)
herr_t
H5S_select_deserialize(H5S_t **space, const uint8_t **p)
{
- H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use, either
- *space or a newly allocated one */
uint32_t sel_type; /* Pointer to the selection type */
- uint32_t version; /* Version number */
- uint8_t flags = 0; /* Flags */
herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
HDassert(space);
- /* Allocate space if not provided */
- if(!*space) {
- if(NULL == (tmp_space = H5S_create(H5S_SIMPLE)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create dataspace")
- } /* end if */
- else
- tmp_space = *space;
+ /* Selection-type specific coding is moved to the callbacks. */
/* Decode selection type */
UINT32DECODE(*p, sel_type);
- /* Decode version */
- UINT32DECODE(*p, version);
-
- if(version >= (uint32_t)2) {
- /* Decode flags */
- flags = *(*p)++;
-
- /* Check for unknown flags */
- if(flags & ~H5S_SELECT_FLAG_BITS)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTLOAD, FAIL, "unknown flag for selection")
-
- /* Skip over the remainder of the header */
- *p += 4;
- } /* end if */
- else
- /* Skip over the remainder of the header */
- *p += 8;
-
- /* Decode and check or patch rank for point and hyperslab selections */
- if((sel_type == H5S_SEL_POINTS) || (sel_type == H5S_SEL_HYPERSLABS)) {
- uint32_t rank; /* Rank of dataspace */
-
- /* Decode the rank of the point selection */
- UINT32DECODE(*p,rank);
-
- if(!*space) {
- hsize_t dims[H5S_MAX_RANK];
-
- /* Patch the rank of the allocated dataspace */
- (void)HDmemset(dims, 0, (size_t)rank * sizeof(dims[0]));
- if(H5S_set_extent_simple(tmp_space, rank, dims, NULL) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't set dimensions")
- } /* end if */
- else
- /* Verify the rank of the provided dataspace */
- if(rank != tmp_space->extent.rank)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "rank of serialized selection does not match dataspace")
- } /* end if */
-
/* Make routine for selection type */
switch(sel_type) {
case H5S_SEL_POINTS: /* Sequence of points selected */
- ret_value = (*H5S_sel_point->deserialize)(tmp_space, version, flags, p);
+ ret_value = (*H5S_sel_point->deserialize)(space, p);
break;
case H5S_SEL_HYPERSLABS: /* Hyperslab selection defined */
- ret_value = (*H5S_sel_hyper->deserialize)(tmp_space, version, flags, p);
+ ret_value = (*H5S_sel_hyper->deserialize)(space, p);
break;
case H5S_SEL_ALL: /* Entire extent selected */
- ret_value = (*H5S_sel_all->deserialize)(tmp_space, version, flags, p);
+ ret_value = (*H5S_sel_all->deserialize)(space, p);
break;
case H5S_SEL_NONE: /* Nothing selected */
- ret_value = (*H5S_sel_none->deserialize)(tmp_space, version, flags, p);
+ ret_value = (*H5S_sel_all->deserialize)(space, p);
break;
default:
break;
}
+
if(ret_value < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTLOAD, FAIL, "can't deserialize selection")
- /* Return space to the caller if allocated */
- if(!*space)
- *space = tmp_space;
-
done:
- /* Free temporary space if not passed to caller (only happens on error) */
- if(!*space && tmp_space)
- if(H5S_close(tmp_space) < 0)
- HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_select_deserialize() */
@@ -1223,7 +1165,7 @@ H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter)
USAGE
herr_t H5S_select_iter_next(iter, nelem)
H5S_sel_iter_t *iter; IN/OUT: Selection iterator to change
- hsize_t nelem; IN: Number of elements to advance by
+ size_t nelem; IN: Number of elements to advance by
RETURNS
Non-negative on success, negative on failure.
DESCRIPTION
@@ -1238,7 +1180,7 @@ H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter)
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_select_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
+H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem)
{
herr_t ret_value = FAIL; /* Return value */
diff --git a/src/H5T.c b/src/H5T.c
index 023a65f..6148754 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -556,7 +556,7 @@ static const H5I_class_t H5I_DATATYPE_CLS[1] = {{
static hbool_t H5T_top_package_initialize_s = FALSE;
-
+
/*-------------------------------------------------------------------------
* Function: H5T_init
*
@@ -582,7 +582,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_init() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T__init_inf
*
@@ -695,7 +695,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__init_inf() */
-
+
/*--------------------------------------------------------------------------
NAME
H5T__init_package -- Initialize interface-specific information
@@ -1319,7 +1319,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__init_package() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T__unlock_cb
*
@@ -1352,7 +1352,7 @@ H5T__unlock_cb(void *_dt, hid_t H5_ATTR_UNUSED id, void *_udata)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5T__unlock_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_top_term_package
*
@@ -1391,7 +1391,7 @@ H5T_top_term_package(void)
if((path->conv.u.app_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) {
#ifdef H5T_DEBUG
if (H5DEBUG(T)) {
- fprintf(H5DEBUG(T), "H5T: conversion function "
+ HDfprintf(H5DEBUG(T), "H5T: conversion function "
"0x%08lx failed to free private data for "
"%s (ignored)\n",
(unsigned long)(path->conv.u.app_func), path->name);
@@ -1404,7 +1404,7 @@ H5T_top_term_package(void)
if((path->conv.u.lib_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) {
#ifdef H5T_DEBUG
if (H5DEBUG(T)) {
- fprintf(H5DEBUG(T), "H5T: conversion function "
+ HDfprintf(H5DEBUG(T), "H5T: conversion function "
"0x%08lx failed to free private data for "
"%s (ignored)\n",
(unsigned long)(path->conv.u.lib_func), path->name);
@@ -1553,7 +1553,7 @@ H5T_top_term_package(void)
FUNC_LEAVE_NOAPI(n)
} /* end H5T_top_term_package() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_term_package
*
@@ -1595,7 +1595,7 @@ H5T_term_package(void)
FUNC_LEAVE_NOAPI(n)
} /* end H5T_term_package() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tcreate
*
@@ -1640,7 +1640,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tcreate() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tcopy
*
@@ -1728,7 +1728,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tcopy() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tclose
*
@@ -1763,7 +1763,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tclose() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tequal
*
@@ -1800,7 +1800,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tequal() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tlock
*
@@ -1847,7 +1847,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tlock() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tget_class
*
@@ -1882,7 +1882,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tget_class() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_get_class
*
@@ -1924,7 +1924,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_get_class() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tdetect_class
*
@@ -1960,7 +1960,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tdetect_class() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_detect_class
*
@@ -2045,7 +2045,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_detect_class() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tis_variable_str
*
@@ -2079,7 +2079,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tis_variable_str() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_is_variable_str
*
@@ -2100,7 +2100,7 @@ H5T_is_variable_str(const H5T_t *dt)
FUNC_LEAVE_NOAPI(H5T_IS_VL_STRING(dt->shared))
} /* end H5T_is_variable_str() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tget_size
*
@@ -2137,7 +2137,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tget_size() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tset_size
*
@@ -2193,7 +2193,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tset_size() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tget_super
*
@@ -2233,7 +2233,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tget_super() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_get_super
*
@@ -2267,7 +2267,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5T__register_int
*
@@ -2307,7 +2307,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__register_int() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T__register
*
@@ -2445,7 +2445,7 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst,
if((old_path->conv.u.app_func)(tmp_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) {
#ifdef H5T_DEBUG
if(H5DEBUG(T))
- fprintf (H5DEBUG(T), "H5T: conversion function 0x%08lx "
+ HDfprintf (H5DEBUG(T), "H5T: conversion function 0x%08lx "
"failed to free private data for %s (ignored)\n",
(unsigned long)(old_path->conv.u.app_func), old_path->name);
#endif
@@ -2455,7 +2455,7 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst,
if((old_path->conv.u.lib_func)(tmp_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) {
#ifdef H5T_DEBUG
if(H5DEBUG(T))
- fprintf (H5DEBUG(T), "H5T: conversion function 0x%08lx "
+ HDfprintf (H5DEBUG(T), "H5T: conversion function 0x%08lx "
"failed to free private data for %s (ignored)\n",
(unsigned long)(old_path->conv.u.lib_func), old_path->name);
#endif
@@ -2492,7 +2492,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__register() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tregister
*
@@ -2548,7 +2548,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tregister() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T__unregister
*
@@ -2627,7 +2627,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst,
if((path->conv.u.app_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) {
#ifdef H5T_DEBUG
if(H5DEBUG(T))
- fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx failed "
+ HDfprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx failed "
"to free private data for %s (ignored)\n",
(unsigned long)(path->conv.u.app_func), path->name);
#endif
@@ -2637,7 +2637,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst,
if((path->conv.u.lib_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) {
#ifdef H5T_DEBUG
if(H5DEBUG(T))
- fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx failed "
+ HDfprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx failed "
"to free private data for %s (ignored)\n",
(unsigned long)(path->conv.u.lib_func), path->name);
#endif
@@ -2652,7 +2652,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst,
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5T__unregister() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tunregister
*
@@ -2692,7 +2692,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tunregister() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tfind
*
@@ -2742,7 +2742,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tfind() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tcompiler_conv
*
@@ -2782,7 +2782,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tcompiler_conv() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tconvert
*
@@ -2841,7 +2841,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tconvert() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tencode
*
@@ -2880,7 +2880,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Tencode() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Tdecode
*
@@ -2935,7 +2935,7 @@ done:
*-------------------------------------------------------------------------
*/
-
+
/*-------------------------------------------------------------------------
* Function: H5T_encode
*
@@ -2961,7 +2961,7 @@ H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc)
FUNC_ENTER_NOAPI_NOINIT
/* Allocate "fake" file structure */
- if(NULL == (f = H5F_fake_alloc((uint8_t)0, H5P_FILE_ACCESS_DEFAULT)))
+ if(NULL == (f = H5F_fake_alloc((uint8_t)0)))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct")
/* Find out the size of buffer needed */
@@ -2991,7 +2991,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_encode() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_decode
*
@@ -3016,7 +3016,7 @@ H5T_decode(size_t buf_size, const unsigned char *buf)
FUNC_ENTER_NOAPI_NOINIT
/* Allocate "fake" file structure */
- if(NULL == (f = H5F_fake_alloc((uint8_t)0, H5P_FILE_ACCESS_DEFAULT)))
+ if(NULL == (f = H5F_fake_alloc((uint8_t)0)))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, NULL, "can't allocate fake file struct")
/* Decode the type of the information */
@@ -3043,7 +3043,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_decode() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T__create
*
@@ -3172,7 +3172,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__create() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_copy
*
@@ -3480,7 +3480,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_copy() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_lock
*
@@ -3526,7 +3526,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5T__alloc
*
@@ -3573,7 +3573,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__alloc() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T__free
*
@@ -3655,7 +3655,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__free() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_close_real
*
@@ -3698,7 +3698,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_close_real() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T__close_cb
*
@@ -3727,7 +3727,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__close_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_close
*
@@ -3812,7 +3812,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_close() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T__set_size
*
@@ -4012,7 +4012,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__set_size() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_get_size
*
@@ -4040,7 +4040,7 @@ H5T_get_size(const H5T_t *dt)
FUNC_LEAVE_NOAPI(dt->shared->size)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5T_cmp
*
@@ -4502,7 +4502,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_cmp() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_path_find
*
@@ -4549,7 +4549,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_path_find() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T__path_find_real
*
@@ -4615,7 +4615,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name,
if(H5T__conv_noop((hid_t)FAIL, (hid_t)FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) {
#ifdef H5T_DEBUG
if(H5DEBUG(T))
- fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n");
+ HDfprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n");
#endif
H5E_clear_stack(NULL); /*ignore the error*/
} /* end if */
@@ -4793,7 +4793,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name,
if((table->conv.u.app_func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) {
#ifdef H5T_DEBUG
if(H5DEBUG(T))
- fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free failed for %s (ignored)\n",
+ HDfprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free failed for %s (ignored)\n",
(unsigned long)(path->conv.u.app_func), path->name);
#endif
H5E_clear_stack(NULL); /*ignore the failure*/
@@ -4803,7 +4803,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name,
if((table->conv.u.lib_func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) {
#ifdef H5T_DEBUG
if(H5DEBUG(T))
- fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free failed for %s (ignored)\n",
+ HDfprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free failed for %s (ignored)\n",
(unsigned long)(path->conv.u.lib_func), path->name);
#endif
H5E_clear_stack(NULL); /*ignore the failure*/
@@ -4859,7 +4859,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__path_find_real() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_path_noop
*
@@ -4884,7 +4884,7 @@ H5T_path_noop(const H5T_path_t *p)
FUNC_LEAVE_NOAPI(p->is_noop || (p->is_hard && 0==H5T_cmp(p->src, p->dst, FALSE)))
} /* end H5T_path_noop() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_path_compound_subset
*
@@ -4928,7 +4928,7 @@ H5T_path_compound_subset(const H5T_path_t *p)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_path_compound_subset */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_path_bkg
*
@@ -4950,7 +4950,7 @@ H5T_path_bkg(const H5T_path_t *p)
FUNC_LEAVE_NOAPI(p->cdata.need_bkg)
} /* end H5T_path_bkg() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T__compiler_conv
*
@@ -4984,7 +4984,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__compiler_conv() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_convert
*
@@ -5035,7 +5035,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_convert() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_oloc
*
@@ -5076,7 +5076,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_oloc() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_nameof
*
@@ -5116,7 +5116,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_nameof() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_is_immutable
*
@@ -5146,7 +5146,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
* Function: H5T_is_named
*
@@ -5219,7 +5219,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_convert_committed_datatype() */
-
+
/*--------------------------------------------------------------------------
* Function: H5T_get_ref_type
*
@@ -5248,7 +5248,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_get_ref_type() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_is_sensible
*
@@ -5310,7 +5310,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*--------------------------------------------------------------------------
NAME
H5T_set_loc
@@ -5476,7 +5476,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_set_loc() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_is_relocatable
*
@@ -5515,7 +5515,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_is_relocatable() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_detect_reg_ref
*
@@ -5523,7 +5523,7 @@ done:
* datatype.
*
* Return: TRUE (1) or FALSE (0) on success
- * (Can't fail)
+ * (Can't fail)
*
* Programmer: Quincey Koziol
* Saturday, January 5, 2019
@@ -5578,7 +5578,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__detect_reg_ref() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_is_vl_storage
*
@@ -5620,7 +5620,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_is_vl_storage() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_upgrade_version_cb
*
@@ -5678,7 +5678,7 @@ H5T_upgrade_version_cb(H5T_t *dt, void *op_value)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5T_upgrade_version_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T__upgrade_version
*
@@ -5711,12 +5711,12 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__upgrade_version() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_set_version
*
* Purpose: Set the encoding for a datatype to the version indicated by
- * the file's low bound if that is higher than the datatype's
+ * the file's low bound if that is higher than the datatype's
* version.
*
* Return: Non-negative on success/Negative on failure
@@ -5743,7 +5743,7 @@ H5T_set_version(H5F_t *f, H5T_t *dt)
if(H5T__upgrade_version(dt, vers) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade datatype encoding")
}
-
+
/* Version bounds check */
if(dt->shared->version > H5O_dtype_ver_bounds[H5F_HIGH_BOUND(f)])
HGOTO_ERROR(H5E_DATATYPE, H5E_BADRANGE, FAIL, "Datatype version out of bounds")
@@ -5752,7 +5752,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_set_version() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_patch_file
*
@@ -5788,7 +5788,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_patch_file() */
-
+
/*-------------------------------------------------------------------------
* Function: H5T_patch_vlen_file
*
diff --git a/src/H5TS.c b/src/H5TS.c
index d239e09..10e14d5 100644
--- a/src/H5TS.c
+++ b/src/H5TS.c
@@ -359,7 +359,6 @@ H5TS_win32_process_enter(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContex)
ret_value = FALSE;
#endif /* H5_HAVE_CODESTACK */
- /* Set up thread local storage */
if(TLS_OUT_OF_INDEXES == (H5TS_apictx_key_g = TlsAlloc()))
ret_value = FALSE;
@@ -428,12 +427,9 @@ H5TS_win32_process_exit(void)
/* Clean up per-process thread local storage */
TlsFree(H5TS_errstk_key_g);
-
#ifdef H5_HAVE_CODESTACK
TlsFree(H5TS_funcstk_key_g);
#endif /* H5_HAVE_CODESTACK */
-
- /* Clean up per-process thread local storage */
TlsFree(H5TS_apictx_key_g);
return;
@@ -479,7 +475,6 @@ H5TS_win32_thread_exit(void)
LocalFree((HLOCAL)lpvData);
#endif /* H5_HAVE_CODESTACK */
- /* Clean up per-thread thread local storage */
lpvData = TlsGetValue(H5TS_apictx_key_g);
if(lpvData)
LocalFree((HLOCAL)lpvData);
@@ -534,3 +529,4 @@ H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata)
} /* H5TS_create_thread */
#endif /* H5_HAVE_THREADSAFE */
+
diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h
index 8d74676..9e093a6 100644
--- a/src/H5TSprivate.h
+++ b/src/H5TSprivate.h
@@ -128,3 +128,4 @@ H5_DLL H5TS_thread_t H5TS_create_thread(void *(*func)(void *), H5TS_attr_t * att
#endif /* c_plusplus || __cplusplus */
#endif /* H5TSprivate_H_ */
+
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index 649bd2e..0a2e9af 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -128,6 +128,9 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id,
if(TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list")
+ /* Set the LCPL for the API context */
+ H5CX_set_lcpl(lcpl_id);
+
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info")
diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c
index feece57..d4f1008 100644
--- a/src/H5Tcompound.c
+++ b/src/H5Tcompound.c
@@ -202,7 +202,7 @@ done:
* modifying the returned datatype does not
* modify the member type.
*
- * Failure: Negative
+ * Failure: H5I_INVALID_HID
*
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
@@ -221,17 +221,17 @@ H5Tget_member_type(hid_t type_id, unsigned membno)
/* Check args */
if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)) || H5T_COMPOUND != dt->shared->type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a compound datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a compound datatype")
if(membno >= dt->shared->u.compnd.nmembs)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid member number")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid member number")
/* Retrieve the datatype for the member */
if(NULL == (memb_dt = H5T_get_member_type(dt, membno, H5T_COPY_REOPEN)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to retrieve member type")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to retrieve member type")
/* Get an ID for the datatype */
if((ret_value = H5I_register(H5I_DATATYPE, memb_dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable register datatype atom")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable register datatype atom")
done:
if(ret_value < 0)
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 803a6da..c76ca3c 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Module Info: Datatype conversions for the H5T interface.
+ * Module Info: Datatype conversions for the H5T interface.
*/
/****************/
@@ -25,16 +25,16 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5HGprivate.h" /* Global Heaps */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Pprivate.h" /* Property lists */
-#include "H5Tpkg.h" /* Datatypes */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5HGprivate.h" /* Global Heaps */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5Tpkg.h" /* Datatypes */
/****************/
@@ -57,57 +57,57 @@
* source value has a magnitude that cannot be represented by the destination
* type.
*
- * Suffix Description
- * ------ -----------
- * sS: Signed integers to signed integers where the destination is
- * at least as wide as the source. This case cannot generate
- * overflows.
+ * Suffix Description
+ * ------ -----------
+ * sS: Signed integers to signed integers where the destination is
+ * at least as wide as the source. This case cannot generate
+ * overflows.
*
- * sU: Signed integers to unsigned integers where the destination is
- * at least as wide as the source. This case experiences
- * overflows when the source value is negative.
+ * sU: Signed integers to unsigned integers where the destination is
+ * at least as wide as the source. This case experiences
+ * overflows when the source value is negative.
*
- * uS: Unsigned integers to signed integers where the destination is
- * at least as wide as the source. This case can experience
- * overflows when the source and destination are the same size.
+ * uS: Unsigned integers to signed integers where the destination is
+ * at least as wide as the source. This case can experience
+ * overflows when the source and destination are the same size.
*
- * uU: Unsigned integers to unsigned integers where the destination
- * is at least as wide as the source. Overflows are not
- * possible in this case.
+ * uU: Unsigned integers to unsigned integers where the destination
+ * is at least as wide as the source. Overflows are not
+ * possible in this case.
*
- * Ss: Signed integers to signed integers where the source is at
- * least as large as the destination. Overflows can occur when
- * the destination is narrower than the source.
+ * Ss: Signed integers to signed integers where the source is at
+ * least as large as the destination. Overflows can occur when
+ * the destination is narrower than the source.
*
- * Su: Signed integers to unsigned integers where the source is at
- * least as large as the destination. Overflows occur when the
- * source value is negative and can also occur if the
- * destination is narrower than the source.
+ * Su: Signed integers to unsigned integers where the source is at
+ * least as large as the destination. Overflows occur when the
+ * source value is negative and can also occur if the
+ * destination is narrower than the source.
*
- * Us: Unsigned integers to signed integers where the source is at
- * least as large as the destination. Overflows can occur for
- * all sizes.
+ * Us: Unsigned integers to signed integers where the source is at
+ * least as large as the destination. Overflows can occur for
+ * all sizes.
*
- * Uu: Unsigned integers to unsigned integers where the source is at
- * least as large as the destination. Overflows can occur if the
- * destination is narrower than the source.
+ * Uu: Unsigned integers to unsigned integers where the source is at
+ * least as large as the destination. Overflows can occur if the
+ * destination is narrower than the source.
*
- * su: Conversion from signed integers to unsigned integers where
- * the source and destination are the same size. Overflow occurs
- * when the source value is negative.
+ * su: Conversion from signed integers to unsigned integers where
+ * the source and destination are the same size. Overflow occurs
+ * when the source value is negative.
*
- * us: Conversion from unsigned integers to signed integers where
- * the source and destination are the same size. Overflow
- * occurs when the source magnitude is too large for the
- * destination.
+ * us: Conversion from unsigned integers to signed integers where
+ * the source and destination are the same size. Overflow
+ * occurs when the source magnitude is too large for the
+ * destination.
*
- * fF: Floating-point values to floating-point values where the
- * destination is at least as wide as the source. This case
+ * fF: Floating-point values to floating-point values where the
+ * destination is at least as wide as the source. This case
* cannot generate overflows.
*
- * Ff: Floating-point values to floating-point values the source is at
- * least as large as the destination. Overflows can occur when
- * the destination is narrower than the source.
+ * Ff: Floating-point values to floating-point values the source is at
+ * least as large as the destination. Overflows can occur when
+ * the destination is narrower than the source.
*
* xF: Integers to float-point(float or double) values where the destination
* is at least as wide as the source. This case cannot generate
@@ -119,29 +119,29 @@
*
* The macros take a subset of these arguments in the order listed here:
*
- * CDATA: A pointer to the H5T_cdata_t structure that was passed to the
- * conversion function.
+ * CDATA: A pointer to the H5T_cdata_t structure that was passed to the
+ * conversion function.
*
- * STYPE: The hid_t value for the source datatype.
+ * STYPE: The hid_t value for the source datatype.
*
- * DTYPE: The hid_t value for the destination datatype.
+ * DTYPE: The hid_t value for the destination datatype.
*
- * BUF: A pointer to the conversion buffer.
+ * BUF: A pointer to the conversion buffer.
*
- * NELMTS: The number of values to be converted.
+ * NELMTS: The number of values to be converted.
*
- * ST: The C name for source datatype (e.g., int)
+ * ST: The C name for source datatype (e.g., int)
*
- * DT: The C name for the destination datatype (e.g., signed char)
+ * DT: The C name for the destination datatype (e.g., signed char)
*
- * D_MIN: The minimum possible destination value. For unsigned
- * destination types this should be zero. For signed
- * destination types it's a negative value with a magnitude that
- * is usually one greater than D_MAX. Source values which are
- * smaller than D_MIN generate overflows.
+ * D_MIN: The minimum possible destination value. For unsigned
+ * destination types this should be zero. For signed
+ * destination types it's a negative value with a magnitude that
+ * is usually one greater than D_MAX. Source values which are
+ * smaller than D_MIN generate overflows.
*
- * D_MAX: The maximum possible destination value. Source values which
- * are larger than D_MAX generate overflows.
+ * D_MAX: The maximum possible destination value. Source values which
+ * are larger than D_MAX generate overflows.
*
* The macros are implemented with a generic programming technique, similar
* to templates in C++. The macro which defines the "core" part of the
@@ -156,25 +156,25 @@
*
* The generic "core" macros are: (others are specific to particular conversion)
*
- * Suffix Description
- * ------ -----------
- * xX: Generic Conversion where the destination is at least as
+ * Suffix Description
+ * ------ -----------
+ * xX: Generic Conversion where the destination is at least as
* wide as the source. This case cannot generate overflows.
*
- * Xx: Generic signed conversion where the source is at least as large
+ * Xx: Generic signed conversion where the source is at least as large
* as the destination. Overflows can occur when the destination is
* narrower than the source.
*
- * Ux: Generic conversion for the `Us', `Uu' & `us' cases
- * Overflow occurs when the source magnitude is too large for the
- * destination.
+ * Ux: Generic conversion for the `Us', `Uu' & `us' cases
+ * Overflow occurs when the source magnitude is too large for the
+ * destination.
*
*/
-#define H5T_CONV_xX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
- *(D) = (DT)(*(S)); \
+#define H5T_CONV_xX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_xX_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
- *(D) = (DT)(*(S)); \
+#define H5T_CONV_xX_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+ *(D) = (DT)(*(S)); \
}
/* Added a condition branch(else if (*(S) == (DT)(D_MAX))) which seems redundant.
@@ -184,13 +184,13 @@
* equal. In this case, do not return exception but make sure the maximum is assigned
* to the destination. SLU - 2005/06/29
*/
-#define H5T_CONV_Xx_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Xx_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
if (*(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
@@ -199,69 +199,69 @@
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MIN); \
+ *(D) = (DT)(D_MIN); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Xx_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Xx_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
if (*(S) > (ST)(D_MAX)) { \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
} else if (*(S) < (ST)(D_MIN)) { \
- *(D) = (DT)(D_MIN); \
- } else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(D_MIN); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Ux_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Ux_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
if (*(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Ux_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Ux_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
if (*(S) > (ST)(D_MAX)) { \
- *(D) = (DT)(D_MAX); \
- } else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(D_MAX); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_sS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
+#define H5T_CONV_sS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_sU_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_sU_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
if (*(S) < 0) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = 0; \
+ *(D) = 0; \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_sU_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_sU_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) < 0) \
- *(D) = 0; \
- else \
- *(D) = (DT)(*(S)); \
+ *(D) = 0; \
+ else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_sU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
+#define H5T_CONV_sU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
@@ -349,23 +349,23 @@
H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_uU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
+#define H5T_CONV_uU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_Ss(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
+#define H5T_CONV_Ss(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_Su_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Su_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) < 0) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = 0; \
+ *(D) = 0; \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
@@ -374,106 +374,106 @@
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Su_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Su_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) < 0) \
- *(D) = 0; \
+ *(D) = 0; \
else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) \
- *(D) = (DT)(D_MAX); \
- else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(D_MAX); \
+ else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
+#define H5T_CONV_Su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_Us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
+#define H5T_CONV_Us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_Uu(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
+#define H5T_CONV_Uu(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_su_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
- /* Assumes memory format of unsigned & signed integers is same */ \
+#define H5T_CONV_su_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+ /* Assumes memory format of unsigned & signed integers is same */ \
if(*(S) < 0) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = 0; \
+ *(D) = 0; \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_su_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
- /* Assumes memory format of unsigned & signed integers is same */ \
+#define H5T_CONV_su_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+ /* Assumes memory format of unsigned & signed integers is same */ \
if(*(S) < 0) \
- *(D) = 0; \
- else \
- *(D) = (DT)(*(S)); \
+ *(D) = 0; \
+ else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)==sizeof(DT)); \
+#define H5T_CONV_su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)==sizeof(DT)); \
H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_us_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
- /* Assumes memory format of unsigned & signed integers is same */ \
+#define H5T_CONV_us_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+ /* Assumes memory format of unsigned & signed integers is same */ \
if (*(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_us_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
- /* Assumes memory format of unsigned & signed integers is same */ \
+#define H5T_CONV_us_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+ /* Assumes memory format of unsigned & signed integers is same */ \
if(*(S) > (ST)(D_MAX)) \
- *(D) = (DT)(D_MAX); \
- else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(D_MAX); \
+ else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)==sizeof(DT)); \
+#define H5T_CONV_us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)==sizeof(DT)); \
H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
-#define H5T_CONV_fF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
+#define H5T_CONV_fF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
/* Same as H5T_CONV_Xx_CORE, except that instead of using D_MAX and D_MIN
* when an overflow occurs, use the 'float' infinity values.
*/
-#define H5T_CONV_Ff_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Ff_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \
+ *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
@@ -482,24 +482,24 @@
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \
+ *(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else \
- *(D) = (DT)(*(S)); \
+ } else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Ff_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Ff_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) > (ST)(D_MAX)) \
- *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \
+ *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \
else if (*(S) < (ST)(D_MIN)) \
- *(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \
- else \
- *(D) = (DT)(*(S)); \
+ *(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \
+ else \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Ff(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
+#define H5T_CONV_Ff(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
@@ -562,35 +562,35 @@
LO = count; \
}
-#define H5T_CONV_xF_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
- if (sprec > dprec) { \
+#define H5T_CONV_xF_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+ if (sprec > dprec) { \
unsigned low_bit_pos, high_bit_pos; \
\
/* Detect high & low bits set in source */ \
H5T_HI_LO_BIT_SET(ST, *(S), low_bit_pos, high_bit_pos) \
\
/* Check for more bits of precision in src than available in dst */ \
- if((high_bit_pos - low_bit_pos) >= dprec) { \
+ if((high_bit_pos - low_bit_pos) >= dprec) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PRECISION, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(*(S)); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } \
+ } \
else \
- *(D) = (DT)(*(S)); \
- } \
+ *(D) = (DT)(*(S)); \
+ } \
else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_xF_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
- *(D) = (DT)(*(S)); \
+#define H5T_CONV_xF_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_xF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_xF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \
}
@@ -602,13 +602,13 @@
* (ST)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under
* the same situation the "int" doesn't overflow. SLU - 2005/9/12
*/
-#define H5T_CONV_Fx_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Fx_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) > (ST)(D_MAX) || (sprec < dprec && *(S) == (ST)(D_MAX))) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
@@ -617,7 +617,7 @@
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(D_MIN); \
+ *(D) = (DT)(D_MIN); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
@@ -626,24 +626,24 @@
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
/* Let compiler convert if case is ignored by user handler*/ \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(*(S)); \
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } \
+ } \
else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Fx_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Fx_NOEX_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) > (ST)(D_MAX)) \
- *(D) = (DT)(D_MAX); \
+ *(D) = (DT)(D_MAX); \
else if(*(S) < (ST)(D_MIN)) \
- *(D) = (DT)(D_MIN); \
+ *(D) = (DT)(D_MIN); \
else \
- *(D) = (DT)(*(S)); \
+ *(D) = (DT)(*(S)); \
}
-#define H5T_CONV_Fx(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+#define H5T_CONV_Fx(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \
}
@@ -652,146 +652,146 @@
* to do them all.
*/
#ifndef H5_WANT_DCONV_EXCEPTION
-#define H5T_CONV_NO_EXCEPT_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
- *(D) = (DT)(*(S)); \
+#define H5T_CONV_NO_EXCEPT_CORE(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) { \
+ *(D) = (DT)(*(S)); \
}
#endif /* H5_WANT_DCONV_EXCEPTION */
/* The main part of every integer hardware conversion macro */
-#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX,PREC) \
+#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX,PREC) \
{ \
herr_t ret_value=SUCCEED; /* Return value */ \
\
FUNC_ENTER_PACKAGE \
\
{ \
- size_t elmtno; /*element number */ \
+ size_t elmtno; /*element number */ \
H5T_CONV_DECL_PREC(PREC) /*declare precision variables, or not */ \
- uint8_t *src_buf; /*'raw' source buffer */ \
- uint8_t *dst_buf; /*'raw' destination buffer */ \
- ST *src, *s; /*source buffer */ \
- DT *dst, *d; /*destination buffer */ \
- H5T_t *st, *dt; /*datatype descriptors */ \
- ST src_aligned; /*source aligned type */ \
- DT dst_aligned; /*destination aligned type */ \
- hbool_t s_mv, d_mv; /*move data to align it? */ \
- ssize_t s_stride, d_stride; /*src and dst strides */ \
+ uint8_t *src_buf; /*'raw' source buffer */ \
+ uint8_t *dst_buf; /*'raw' destination buffer */ \
+ ST *src, *s; /*source buffer */ \
+ DT *dst, *d; /*destination buffer */ \
+ H5T_t *st, *dt; /*datatype descriptors */ \
+ ST src_aligned; /*source aligned type */ \
+ DT dst_aligned; /*destination aligned type */ \
+ hbool_t s_mv, d_mv; /*move data to align it? */ \
+ ssize_t s_stride, d_stride; /*src and dst strides */ \
size_t safe; /*how many elements are safe to process in each pass */ \
H5T_conv_cb_t cb_struct; /*conversion callback structure */ \
\
- switch (cdata->command) { \
- case H5T_CONV_INIT: \
- /* Sanity check and initialize statistics */ \
- cdata->need_bkg = H5T_BKG_NO; \
+ switch (cdata->command) { \
+ case H5T_CONV_INIT: \
+ /* Sanity check and initialize statistics */ \
+ cdata->need_bkg = H5T_BKG_NO; \
if (NULL==(st=(H5T_t*)H5I_object(src_id)) || NULL==(dt=(H5T_t*)H5I_object(dst_id))) \
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \
- "unable to dereference datatype object ID") \
- if (st->shared->size!=sizeof(ST) || dt->shared->size!=sizeof(DT)) \
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \
- "disagreement about datatype size") \
- CI_ALLOC_PRIV \
- break; \
- \
- case H5T_CONV_FREE: \
- /* Print and free statistics */ \
- CI_PRINT_STATS(STYPE,DTYPE); \
- CI_FREE_PRIV \
- break; \
- \
- case H5T_CONV_CONV: \
- /* Initialize source & destination strides */ \
- if (buf_stride) { \
- HDassert(buf_stride >= sizeof(ST)); \
- HDassert(buf_stride >= sizeof(DT)); \
- s_stride = d_stride = (ssize_t)buf_stride; \
- } else { \
- s_stride = sizeof(ST); \
- d_stride = sizeof(DT); \
- } \
- \
- /* Is alignment required for source or dest? */ \
- s_mv = H5T_NATIVE_##STYPE##_ALIGN_g>1 && \
- ((size_t)buf%H5T_NATIVE_##STYPE##_ALIGN_g || \
- /* Cray */ ((size_t)((ST*)buf)!=(size_t)buf) || \
- (size_t)s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \
- d_mv = H5T_NATIVE_##DTYPE##_ALIGN_g>1 && \
- ((size_t)buf%H5T_NATIVE_##DTYPE##_ALIGN_g || \
- /* Cray */ ((size_t)((DT*)buf)!=(size_t)buf) || \
- (size_t)d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \
- CI_INC_SRC(s_mv) \
- CI_INC_DST(d_mv) \
- \
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \
+ "unable to dereference datatype object ID") \
+ if (st->shared->size!=sizeof(ST) || dt->shared->size!=sizeof(DT)) \
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \
+ "disagreement about datatype size") \
+ CI_ALLOC_PRIV \
+ break; \
+ \
+ case H5T_CONV_FREE: \
+ /* Print and free statistics */ \
+ CI_PRINT_STATS(STYPE,DTYPE); \
+ CI_FREE_PRIV \
+ break; \
+ \
+ case H5T_CONV_CONV: \
+ /* Initialize source & destination strides */ \
+ if (buf_stride) { \
+ HDassert(buf_stride >= sizeof(ST)); \
+ HDassert(buf_stride >= sizeof(DT)); \
+ s_stride = d_stride = (ssize_t)buf_stride; \
+ } else { \
+ s_stride = sizeof(ST); \
+ d_stride = sizeof(DT); \
+ } \
+ \
+ /* Is alignment required for source or dest? */ \
+ s_mv = H5T_NATIVE_##STYPE##_ALIGN_g>1 && \
+ ((size_t)buf%H5T_NATIVE_##STYPE##_ALIGN_g || \
+ /* Cray */ ((size_t)((ST*)buf)!=(size_t)buf) || \
+ (size_t)s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \
+ d_mv = H5T_NATIVE_##DTYPE##_ALIGN_g>1 && \
+ ((size_t)buf%H5T_NATIVE_##DTYPE##_ALIGN_g || \
+ /* Cray */ ((size_t)((DT*)buf)!=(size_t)buf) || \
+ (size_t)d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \
+ CI_INC_SRC(s_mv) \
+ CI_INC_DST(d_mv) \
+ \
/* Get conversion exception callback property */ \
if(H5CX_get_dt_conv_cb(&cb_struct) < 0) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") \
\
- /* Get source and destination datatypes */ \
+ /* Get source and destination datatypes */ \
if(NULL == (st = (H5T_t *)H5I_object(src_id)) || NULL == (dt = (H5T_t *)H5I_object(dst_id))) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to dereference datatype object ID") \
- \
+ \
H5T_CONV_SET_PREC(PREC) /*init precision variables, or not */ \
\
/* The outer loop of the type conversion macro, controlling which */ \
- /* direction the buffer is walked */ \
- while (nelmts>0) { \
- /* Check if we need to go backwards through the buffer */ \
- if(d_stride>s_stride) { \
+ /* direction the buffer is walked */ \
+ while (nelmts>0) { \
+ /* Check if we need to go backwards through the buffer */ \
+ if(d_stride>s_stride) { \
/* Compute the number of "safe" destination elements at */ \
/* the end of the buffer (Those which don't overlap with */ \
/* any source elements at the beginning of the buffer) */ \
safe = nelmts - (((nelmts * (size_t)s_stride) + (size_t)(d_stride - 1)) / (size_t)d_stride); \
- \
+ \
/* If we're down to the last few elements, just wrap up */ \
- /* with a "real" reverse copy */ \
- if(safe<2) { \
+ /* with a "real" reverse copy */ \
+ if(safe<2) { \
src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)s_stride); \
dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)d_stride); \
- s_stride = -s_stride; \
- d_stride = -d_stride; \
- \
- safe=nelmts; \
- } /* end if */ \
- else { \
+ s_stride = -s_stride; \
+ d_stride = -d_stride; \
+ \
+ safe=nelmts; \
+ } /* end if */ \
+ else { \
src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)s_stride); \
dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)d_stride); \
- } /* end else */ \
- } /* end if */ \
- else { \
- /* Single forward pass over all data */ \
- src = (ST *)(src_buf = (uint8_t*)buf); \
- dst = (DT *)(dst_buf = (uint8_t*)buf); \
- safe=nelmts; \
- } /* end else */ \
+ } /* end else */ \
+ } /* end if */ \
+ else { \
+ /* Single forward pass over all data */ \
+ src = (ST *)(src_buf = (uint8_t*)buf); \
+ dst = (DT *)(dst_buf = (uint8_t*)buf); \
+ safe=nelmts; \
+ } /* end else */ \
\
- /* Perform loop over elements to convert */ \
- if (s_mv && d_mv) { \
- /* Alignment is required for both source and dest */ \
- s = &src_aligned; \
+ /* Perform loop over elements to convert */ \
+ if (s_mv && d_mv) { \
+ /* Alignment is required for both source and dest */ \
+ s = &src_aligned; \
H5T_CONV_LOOP_OUTER(PRE_SALIGN,PRE_DALIGN,POST_SALIGN,POST_DALIGN,GUTS,STYPE,DTYPE,s,d,ST,DT,D_MIN,D_MAX) \
- } else if(s_mv) { \
- /* Alignment is required only for source */ \
- s = &src_aligned; \
+ } else if(s_mv) { \
+ /* Alignment is required only for source */ \
+ s = &src_aligned; \
H5T_CONV_LOOP_OUTER(PRE_SALIGN,PRE_DNOALIGN,POST_SALIGN,POST_DNOALIGN,GUTS,STYPE,DTYPE,s,dst,ST,DT,D_MIN,D_MAX) \
- } else if(d_mv) { \
- /* Alignment is required only for destination */ \
+ } else if(d_mv) { \
+ /* Alignment is required only for destination */ \
H5T_CONV_LOOP_OUTER(PRE_SNOALIGN,PRE_DALIGN,POST_SNOALIGN,POST_DALIGN,GUTS,STYPE,DTYPE,src,d,ST,DT,D_MIN,D_MAX) \
- } else { \
+ } else { \
/* Alignment is not required for both source and destination */ \
H5T_CONV_LOOP_OUTER(PRE_SNOALIGN,PRE_DNOALIGN,POST_SNOALIGN,POST_DNOALIGN,GUTS,STYPE,DTYPE,src,dst,ST,DT,D_MIN,D_MAX) \
- } \
- \
- /* Decrement number of elements left to convert */ \
- nelmts-=safe; \
- } /* end while */ \
- break; \
- \
- default: \
- HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, \
- "unknown conversion command"); \
- } \
+ } \
+ \
+ /* Decrement number of elements left to convert */ \
+ nelmts-=safe; \
+ } /* end while */ \
+ break; \
+ \
+ default: \
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, \
+ "unknown conversion command"); \
+ } \
} \
- \
+ \
done: \
FUNC_LEAVE_NOAPI(ret_value) \
}
@@ -800,9 +800,9 @@ done: \
#define H5T_CONV_DECL_PREC(PREC) H5_GLUE(H5T_CONV_DECL_PREC_, PREC)
#define H5T_CONV_DECL_PREC_Y \
- size_t sprec; /*source precision */ \
- size_t dprec; /*destination precision */ \
- H5T_class_t tclass; /*datatype's class */
+ size_t sprec; /*source precision */ \
+ size_t dprec; /*destination precision */ \
+ H5T_class_t tclass; /*datatype's class */
#define H5T_CONV_DECL_PREC_N /*no precision variables */
@@ -810,60 +810,60 @@ done: \
#define H5T_CONV_SET_PREC(PREC) H5_GLUE(H5T_CONV_SET_PREC_, PREC)
#define H5T_CONV_SET_PREC_Y \
- /* Get source & destination precisions into a variable */ \
- tclass = st->shared->type; \
- HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \
- if(tclass == H5T_INTEGER) \
- sprec = st->shared->u.atomic.prec; \
- else \
- sprec = 1 + st->shared->u.atomic.u.f.msize; \
- tclass = dt->shared->type; \
- HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \
- if(tclass == H5T_INTEGER) \
- dprec = dt->shared->u.atomic.prec; \
- else \
+ /* Get source & destination precisions into a variable */ \
+ tclass = st->shared->type; \
+ HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \
+ if(tclass == H5T_INTEGER) \
+ sprec = st->shared->u.atomic.prec; \
+ else \
+ sprec = 1 + st->shared->u.atomic.u.f.msize; \
+ tclass = dt->shared->type; \
+ HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \
+ if(tclass == H5T_INTEGER) \
+ dprec = dt->shared->u.atomic.prec; \
+ else \
dprec = 1 + dt->shared->u.atomic.u.f.msize;
#define H5T_CONV_SET_PREC_N /*don't init precision variables */
/* Macro defining action on source data which needs to be aligned (before main action) */
-#define H5T_CONV_LOOP_PRE_SALIGN(ST) { \
- HDmemcpy(&src_aligned, src, sizeof(ST)); \
+#define H5T_CONV_LOOP_PRE_SALIGN(ST) { \
+ HDmemcpy(&src_aligned, src, sizeof(ST)); \
}
/* Macro defining action on source data which doesn't need to be aligned (before main action) */
-#define H5T_CONV_LOOP_PRE_SNOALIGN(ST) { \
+#define H5T_CONV_LOOP_PRE_SNOALIGN(ST) { \
}
/* Macro defining action on destination data which needs to be aligned (before main action) */
-#define H5T_CONV_LOOP_PRE_DALIGN(DT) { \
- d = &dst_aligned; \
+#define H5T_CONV_LOOP_PRE_DALIGN(DT) { \
+ d = &dst_aligned; \
}
/* Macro defining action on destination data which doesn't need to be aligned (before main action) */
-#define H5T_CONV_LOOP_PRE_DNOALIGN(DT) { \
+#define H5T_CONV_LOOP_PRE_DNOALIGN(DT) { \
}
/* Macro defining action on source data which needs to be aligned (after main action) */
-#define H5T_CONV_LOOP_POST_SALIGN(ST) { \
+#define H5T_CONV_LOOP_POST_SALIGN(ST) { \
}
/* Macro defining action on source data which doesn't need to be aligned (after main action) */
-#define H5T_CONV_LOOP_POST_SNOALIGN(ST) { \
+#define H5T_CONV_LOOP_POST_SNOALIGN(ST) { \
}
/* Macro defining action on destination data which needs to be aligned (after main action) */
-#define H5T_CONV_LOOP_POST_DALIGN(DT) { \
- HDmemcpy(dst, &dst_aligned, sizeof(DT)); \
+#define H5T_CONV_LOOP_POST_DALIGN(DT) { \
+ HDmemcpy(dst, &dst_aligned, sizeof(DT)); \
}
/* Macro defining action on destination data which doesn't need to be aligned (after main action) */
-#define H5T_CONV_LOOP_POST_DNOALIGN(DT) { \
+#define H5T_CONV_LOOP_POST_DNOALIGN(DT) { \
}
/* The outer wrapper for the type conversion loop, to check for an exception handling routine */
#define H5T_CONV_LOOP_OUTER(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,GUTS,STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \
- if(cb_struct.func) { \
+ if(cb_struct.func) { \
H5T_CONV_LOOP(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,GUTS,STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \
} \
else { \
@@ -872,36 +872,36 @@ done: \
/* The inner loop of the type conversion macro, actually converting the elements */
#define H5T_CONV_LOOP(PRE_SALIGN_GUTS,PRE_DALIGN_GUTS,POST_SALIGN_GUTS,POST_DALIGN_GUTS,GUTS,STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \
- for (elmtno=0; elmtno<safe; elmtno++) { \
- /* Handle source pre-alignment */ \
- H5_GLUE(H5T_CONV_LOOP_,PRE_SALIGN_GUTS)(ST) \
+ for (elmtno=0; elmtno<safe; elmtno++) { \
+ /* Handle source pre-alignment */ \
+ H5_GLUE(H5T_CONV_LOOP_,PRE_SALIGN_GUTS)(ST) \
\
- /* Handle destination pre-alignment */ \
- H5_GLUE(H5T_CONV_LOOP_,PRE_DALIGN_GUTS)(DT) \
+ /* Handle destination pre-alignment */ \
+ H5_GLUE(H5T_CONV_LOOP_,PRE_DALIGN_GUTS)(DT) \
\
- /* ... user-defined stuff here -- the conversion ... */ \
- H5T_CONV_LOOP_GUTS(GUTS,STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \
+ /* ... user-defined stuff here -- the conversion ... */ \
+ H5T_CONV_LOOP_GUTS(GUTS,STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \
\
- /* Handle source post-alignment */ \
- H5_GLUE(H5T_CONV_LOOP_,POST_SALIGN_GUTS)(ST) \
+ /* Handle source post-alignment */ \
+ H5_GLUE(H5T_CONV_LOOP_,POST_SALIGN_GUTS)(ST) \
\
- /* Handle destination post-alignment */ \
- H5_GLUE(H5T_CONV_LOOP_,POST_DALIGN_GUTS)(DT) \
+ /* Handle destination post-alignment */ \
+ H5_GLUE(H5T_CONV_LOOP_,POST_DALIGN_GUTS)(DT) \
\
- /* Advance pointers */ \
- src_buf += s_stride; \
- src = (ST *)src_buf; \
- dst_buf += d_stride; \
- dst = (DT *)dst_buf; \
+ /* Advance pointers */ \
+ src_buf += s_stride; \
+ src = (ST *)src_buf; \
+ dst_buf += d_stride; \
+ dst = (DT *)dst_buf; \
}
/* Macro to call the actual "guts" of the type conversion, or call the "no exception" guts */
#ifdef H5_WANT_DCONV_EXCEPTION
-#define H5T_CONV_LOOP_GUTS(GUTS,STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \
- /* ... user-defined stuff here -- the conversion ... */ \
+#define H5T_CONV_LOOP_GUTS(GUTS,STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \
+ /* ... user-defined stuff here -- the conversion ... */ \
H5_GLUE(GUTS,_CORE)(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX)
#else /* H5_WANT_DCONV_EXCEPTION */
-#define H5T_CONV_LOOP_GUTS(GUTS,STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \
+#define H5T_CONV_LOOP_GUTS(GUTS,STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX) \
H5_GLUE(H5T_CONV_NO_EXCEPT,_CORE)(STYPE,DTYPE,S,D,ST,DT,D_MIN,D_MAX)
#endif /* H5_WANT_DCONV_EXCEPTION */
@@ -909,27 +909,27 @@ done: \
#ifdef H5T_DEBUG
/* Print alignment statistics */
-# define CI_PRINT_STATS(STYPE,DTYPE) { \
- if (H5DEBUG(T) && ((H5T_conv_hw_t *)cdata->priv)->s_aligned) { \
- HDfprintf(H5DEBUG(T), \
- " %Hu src elements aligned on %lu-byte boundaries\n", \
- ((H5T_conv_hw_t *)cdata->priv)->s_aligned, \
- (unsigned long)H5T_NATIVE_##STYPE##_ALIGN_g); \
- } \
- if (H5DEBUG(T) && ((H5T_conv_hw_t *)cdata->priv)->d_aligned) { \
- HDfprintf(H5DEBUG(T), \
- " %Hu dst elements aligned on %lu-byte boundaries\n", \
- ((H5T_conv_hw_t *)cdata->priv)->d_aligned, \
- (unsigned long)H5T_NATIVE_##DTYPE##_ALIGN_g); \
- } \
+# define CI_PRINT_STATS(STYPE,DTYPE) { \
+ if (H5DEBUG(T) && ((H5T_conv_hw_t *)cdata->priv)->s_aligned) { \
+ HDfprintf(H5DEBUG(T), \
+ " %Hu src elements aligned on %lu-byte boundaries\n", \
+ ((H5T_conv_hw_t *)cdata->priv)->s_aligned, \
+ (unsigned long)H5T_NATIVE_##STYPE##_ALIGN_g); \
+ } \
+ if (H5DEBUG(T) && ((H5T_conv_hw_t *)cdata->priv)->d_aligned) { \
+ HDfprintf(H5DEBUG(T), \
+ " %Hu dst elements aligned on %lu-byte boundaries\n", \
+ ((H5T_conv_hw_t *)cdata->priv)->d_aligned, \
+ (unsigned long)H5T_NATIVE_##DTYPE##_ALIGN_g); \
+ } \
}
/* Allocate private alignment structure for atomic types */
# define CI_ALLOC_PRIV \
- if (NULL==(cdata->priv=H5MM_calloc(sizeof(H5T_conv_hw_t)))) { \
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \
- "memory allocation failed"); \
- }
+ if (NULL==(cdata->priv=H5MM_calloc(sizeof(H5T_conv_hw_t)))) { \
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \
+ "memory allocation failed"); \
+ }
/* Free private alignment structure for atomic types */
# define CI_FREE_PRIV \
@@ -961,25 +961,25 @@ done: \
/* Conversion data for H5T__conv_struct() */
typedef struct H5T_conv_struct_t {
- int *src2dst; /*mapping from src to dst member num */
- hid_t *src_memb_id; /*source member type ID's */
- hid_t *dst_memb_id; /*destination member type ID's */
- H5T_path_t **memb_path; /*conversion path for each member */
+ int *src2dst; /*mapping from src to dst member num */
+ hid_t *src_memb_id; /*source member type ID's */
+ hid_t *dst_memb_id; /*destination member type ID's */
+ H5T_path_t **memb_path; /*conversion path for each member */
H5T_subset_info_t subset_info; /*info related to compound subsets */
unsigned src_nmembs; /*needed by free function */
} H5T_conv_struct_t;
/* Conversion data for H5T__conv_enum() */
typedef struct H5T_enum_struct_t {
- int base; /*lowest `in' value */
- unsigned length; /*num elements in arrays */
- int *src2dst; /*map from src to dst index */
+ int base; /*lowest `in' value */
+ unsigned length; /*num elements in arrays */
+ int *src2dst; /*map from src to dst index */
} H5T_enum_struct_t;
/* Conversion data for the hardware conversion functions */
typedef struct H5T_conv_hw_t {
- size_t s_aligned; /*number source elements aligned */
- size_t d_aligned; /*number destination elements aligned*/
+ size_t s_aligned; /*number source elements aligned */
+ size_t d_aligned; /*number destination elements aligned*/
} H5T_conv_hw_t;
/********************/
@@ -993,7 +993,7 @@ typedef struct H5T_conv_hw_t {
static herr_t H5T_reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order);
-
+
/*********************/
/* Public Variables */
/*********************/
@@ -1019,17 +1019,17 @@ H5FL_BLK_DEFINE_STATIC(vlen_seq);
/* Declare a free list to manage pieces of array data */
H5FL_BLK_DEFINE_STATIC(array_seq);
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_noop
+ * Function: H5T__conv_noop
*
- * Purpose: The no-op conversion. The library knows about this
- * conversion without it being registered.
+ * Purpose: The no-op conversion. The library knows about this
+ * conversion without it being registered.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Wednesday, January 14, 1998
+ * Programmer: Robb Matzke
+ * Wednesday, January 14, 1998
*
*-------------------------------------------------------------------------
*/
@@ -1063,20 +1063,20 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_noop() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_order_opt
+ * Function: H5T__conv_order_opt
*
- * Purpose: Convert one type to another when byte order is the only
- * difference. This is the optimized version of H5T__conv_order()
+ * Purpose: Convert one type to another when byte order is the only
+ * difference. This is the optimized version of H5T__conv_order()
* for a handful of different sizes.
*
- * Note: This is a soft conversion function.
+ * Note: This is a soft conversion function.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Friday, January 25, 2002
+ * Programmer: Robb Matzke
+ * Friday, January 25, 2002
*
*-------------------------------------------------------------------------
*/
@@ -1086,9 +1086,9 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
void H5_ATTR_UNUSED *background)
{
- uint8_t *buf = (uint8_t*)_buf;
- H5T_t *src = NULL;
- H5T_t *dst = NULL;
+ uint8_t *buf = (uint8_t*)_buf;
+ H5T_t *src = NULL;
+ H5T_t *dst = NULL;
size_t i;
herr_t ret_value = SUCCEED; /* Return value */
@@ -1478,30 +1478,30 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5T__conv_order
+ * Function: H5T__conv_order
*
- * Purpose: Convert one type to another when byte order is the only
- * difference.
+ * Purpose: Convert one type to another when byte order is the only
+ * difference.
*
- * Note: This is a soft conversion function.
+ * Note: This is a soft conversion function.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, January 13, 1998
+ * Programmer: Robb Matzke
+ * Tuesday, January 13, 1998
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
- size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
+ size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
void H5_ATTR_UNUSED *background)
{
- uint8_t *buf = (uint8_t*)_buf;
- H5T_t *src = NULL;
- H5T_t *dst = NULL;
- size_t i;
- size_t j, md;
+ uint8_t *buf = (uint8_t*)_buf;
+ H5T_t *src = NULL;
+ H5T_t *dst = NULL;
+ size_t i;
+ size_t j, md;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -1578,34 +1578,34 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_order() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_b_b
+ * Function: H5T__conv_b_b
*
- * Purpose: Convert from one bitfield to any other bitfield.
+ * Purpose: Convert from one bitfield to any other bitfield.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Thursday, May 20, 1999
+ * Programmer: Robb Matzke
+ * Thursday, May 20, 1999
*
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
- size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
+ size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
void H5_ATTR_UNUSED *background)
{
- uint8_t *buf = (uint8_t*)_buf;
- H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */
- ssize_t direction; /*direction of traversal */
- size_t elmtno; /*element number */
- size_t olap; /*num overlapping elements */
- size_t half_size; /*1/2 of total size for swapping*/
- uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
- uint8_t dbuf[256]; /*temp destination buffer */
- size_t msb_pad_offset; /*offset for dest MSB padding */
- size_t i;
+ uint8_t *buf = (uint8_t*)_buf;
+ H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */
+ ssize_t direction; /*direction of traversal */
+ size_t elmtno; /*element number */
+ size_t olap; /*num overlapping elements */
+ size_t half_size; /*1/2 of total size for swapping*/
+ uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
+ uint8_t dbuf[256]; /*temp destination buffer */
+ size_t msb_pad_offset; /*offset for dest MSB padding */
+ size_t i;
uint8_t *src_rev=NULL; /*order-reversed source buffer */
H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */
H5T_conv_ret_t except_ret; /*return of callback function */
@@ -1820,17 +1820,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_b_b() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T_conv_struct_free
+ * Function: H5T_conv_struct_free
*
- * Purpose: Free the private data structure used by the compound
+ * Purpose: Free the private data structure used by the compound
* conversion functions.
*
- * Return: The result of H5MM_xfree(priv) (NULL)
+ * Return: The result of H5MM_xfree(priv) (NULL)
*
- * Programmer: Neil Fortner
- * Wednesday, October 1, 2008
+ * Programmer: Neil Fortner
+ * Wednesday, October 1, 2008
*
*-------------------------------------------------------------------------
*/
@@ -1862,24 +1862,24 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv)
FUNC_LEAVE_NOAPI((H5T_conv_struct_t *)H5MM_xfree(priv))
} /* end H5T_conv_struct_free() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T_conv_struct_init
+ * Function: H5T_conv_struct_init
*
- * Purpose: Initialize the `priv' field of `cdata' with conversion
- * information that is relatively constant. If `priv' is
- * already initialized then the member conversion functions
- * are recalculated.
+ * Purpose: Initialize the `priv' field of `cdata' with conversion
+ * information that is relatively constant. If `priv' is
+ * already initialized then the member conversion functions
+ * are recalculated.
*
- * Priv fields are indexed by source member number or
- * destination member number depending on whether the field
- * contains information about the source datatype or the
- * destination datatype (fields that contains the same
- * information for both source and destination are indexed by
- * source member number). The src2dst[] priv array maps source
- * member numbers to destination member numbers, but if the
- * source member doesn't have a corresponding destination member
- * then the src2dst[i]=-1.
+ * Priv fields are indexed by source member number or
+ * destination member number depending on whether the field
+ * contains information about the source datatype or the
+ * destination datatype (fields that contains the same
+ * information for both source and destination are indexed by
+ * source member number). The src2dst[] priv array maps source
+ * member numbers to destination member numbers, but if the
+ * source member doesn't have a corresponding destination member
+ * then the src2dst[i]=-1.
*
* Special optimization case when the source and destination
* members are a subset of each other, and the order is the same,
@@ -1902,20 +1902,20 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv)
* The optimization is simply moving data to the appropriate
* places in the buffer.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Monday, January 26, 1998
+ * Programmer: Robb Matzke
+ * Monday, January 26, 1998
*
*-------------------------------------------------------------------------
*/
static herr_t
H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
{
- H5T_conv_struct_t *priv = (H5T_conv_struct_t*)(cdata->priv);
- int *src2dst = NULL;
+ H5T_conv_struct_t *priv = (H5T_conv_struct_t*)(cdata->priv);
+ int *src2dst = NULL;
unsigned src_nmembs, dst_nmembs;
- unsigned i, j;
+ unsigned i, j;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1962,8 +1962,8 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
} /* end if */
} /* end for */
if(src2dst[i] >= 0) {
- hid_t tid;
- H5T_t *type;
+ hid_t tid;
+ H5T_t *type;
type = H5T_copy(src->shared->u.compnd.memb[i].type, H5T_COPY_ALL);
tid = H5I_register(H5I_DATATYPE, type, FALSE);
@@ -2053,9 +2053,9 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_conv_struct_init() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_struct_subset
+ * Function: H5T__conv_struct_subset
*
* Purpose: A quick way to return a field in a struct private in this
* file. The flag SMEMBS_SUBSET indicates whether the source
@@ -2073,15 +2073,15 @@ done:
* Return: A pointer to the subset info struct in p. Points directly
* into the structure.
*
- * Programmer: Raymond Lu
- * 8 June 2007
+ * Programmer: Raymond Lu
+ * 8 June 2007
*
*-------------------------------------------------------------------------
*/
H5T_subset_info_t *
H5T__conv_struct_subset(const H5T_cdata_t *cdata)
{
- H5T_conv_struct_t *priv = NULL;
+ H5T_conv_struct_t *priv = NULL;
FUNC_ENTER_PACKAGE_NOERR
@@ -2093,30 +2093,30 @@ H5T__conv_struct_subset(const H5T_cdata_t *cdata)
FUNC_LEAVE_NOAPI((H5T_subset_info_t *) &priv->subset_info)
} /* end H5T__conv_struct_subset() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_struct
+ * Function: H5T__conv_struct
*
- * Purpose: Converts between compound datatypes. This is a soft
- * conversion function. The algorithm is basically:
+ * Purpose: Converts between compound datatypes. This is a soft
+ * conversion function. The algorithm is basically:
*
- * For each element do
- * For I=1..NELMTS do
- * If sizeof destination type <= sizeof source type then
- * Convert member to destination type;
- * Move member as far left as possible;
+ * For each element do
+ * For I=1..NELMTS do
+ * If sizeof destination type <= sizeof source type then
+ * Convert member to destination type;
+ * Move member as far left as possible;
*
- * For I=NELMTS..1 do
- * If not destination type then
- * Convert member to destination type;
- * Move member to correct position in BKG
+ * For I=NELMTS..1 do
+ * If not destination type then
+ * Convert member to destination type;
+ * Move member to correct position in BKG
*
- * Copy BKG to BUF
+ * Copy BKG to BUF
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Thursday, January 22, 1998
+ * Programmer: Robb Matzke
+ * Thursday, January 22, 1998
*
*-------------------------------------------------------------------------
*/
@@ -2124,20 +2124,20 @@ herr_t
H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg)
{
- uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */
- uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */
+ uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */
+ uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */
uint8_t *xbuf = buf, *xbkg = bkg; /*temp pointers into buf and bkg*/
- H5T_t *src = NULL; /*source datatype */
- H5T_t *dst = NULL; /*destination datatype */
- int *src2dst = NULL; /*maps src member to dst member */
- H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/
- H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */
- size_t offset; /*byte offset wrt struct */
- ssize_t src_delta; /*source stride */
- ssize_t bkg_delta; /*background stride */
- size_t elmtno;
- unsigned u; /*counters */
- int i; /*counters */
+ H5T_t *src = NULL; /*source datatype */
+ H5T_t *dst = NULL; /*destination datatype */
+ int *src2dst = NULL; /*maps src member to dst member */
+ H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/
+ H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */
+ size_t offset; /*byte offset wrt struct */
+ ssize_t src_delta; /*source stride */
+ ssize_t bkg_delta; /*background stride */
+ size_t elmtno;
+ unsigned u; /*counters */
+ int i; /*counters */
H5T_conv_struct_t *priv = (H5T_conv_struct_t *)(cdata->priv);
herr_t ret_value = SUCCEED; /* Return value */
@@ -2155,7 +2155,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype")
if(H5T_COMPOUND != src->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype")
- if(H5T_COMPOUND != dst->shared->type)
+ if(H5T_COMPOUND != dst->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype")
if(H5T_conv_struct_init(src, dst, cdata) < 0)
@@ -2303,29 +2303,29 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_struct() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_struct_opt
+ * Function: H5T__conv_struct_opt
*
- * Purpose: Converts between compound datatypes in a manner more
- * efficient than the general-purpose H5T__conv_struct()
- * function. This function isn't applicable if the destination
- * is larger than the source type. This is a soft conversion
- * function. The algorithm is basically:
+ * Purpose: Converts between compound datatypes in a manner more
+ * efficient than the general-purpose H5T__conv_struct()
+ * function. This function isn't applicable if the destination
+ * is larger than the source type. This is a soft conversion
+ * function. The algorithm is basically:
*
- * For each member of the struct
- * If sizeof destination type <= sizeof source type then
- * Convert member to destination type for all elements
- * Move memb to BKG buffer for all elements
- * Else
- * Move member as far left as possible for all elements
+ * For each member of the struct
+ * If sizeof destination type <= sizeof source type then
+ * Convert member to destination type for all elements
+ * Move memb to BKG buffer for all elements
+ * Else
+ * Move member as far left as possible for all elements
*
- * For each member of the struct (in reverse order)
- * If not destination type then
- * Convert member to destination type for all elements
- * Move member to correct position in BKG for all elements
+ * For each member of the struct (in reverse order)
+ * If not destination type then
+ * Convert member to destination type for all elements
+ * Move member to correct position in BKG for all elements
*
- * Copy BKG to BUF for all elements
+ * Copy BKG to BUF for all elements
*
* Special case when the source and destination members
* are a subset of each other, and the order is the same, and no
@@ -2340,10 +2340,10 @@ done:
* The optimization is simply moving data to the appropriate
* places in the buffer.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Thursday, January 22, 1998
+ * Programmer: Robb Matzke
+ * Thursday, January 22, 1998
*
*-------------------------------------------------------------------------
*/
@@ -2351,22 +2351,22 @@ herr_t
H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg)
{
- uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */
- uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */
- uint8_t *xbuf = NULL; /*temporary pointer into `buf' */
- uint8_t *xbkg = NULL; /*temporary pointer into `bkg' */
- H5T_t *src = NULL; /*source datatype */
- H5T_t *dst = NULL; /*destination datatype */
- int *src2dst = NULL; /*maps src member to dst member */
- H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/
- H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */
- size_t offset; /*byte offset wrt struct */
- size_t elmtno; /*element counter */
+ uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */
+ uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */
+ uint8_t *xbuf = NULL; /*temporary pointer into `buf' */
+ uint8_t *xbkg = NULL; /*temporary pointer into `bkg' */
+ H5T_t *src = NULL; /*source datatype */
+ H5T_t *dst = NULL; /*destination datatype */
+ int *src2dst = NULL; /*maps src member to dst member */
+ H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/
+ H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */
+ size_t offset; /*byte offset wrt struct */
+ size_t elmtno; /*element counter */
size_t copy_size; /*size of element for copying */
- H5T_conv_struct_t *priv = NULL; /*private data */
+ H5T_conv_struct_t *priv = NULL; /*private data */
hbool_t no_stride = FALSE; /*flag to indicate no stride */
- unsigned u; /*counters */
- int i; /*counters */
+ unsigned u; /*counters */
+ int i; /*counters */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -2383,7 +2383,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if(H5T_COMPOUND != src->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype")
- if(H5T_COMPOUND != dst->shared->type)
+ if(H5T_COMPOUND != dst->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype")
/* Initialize data which is relatively constant */
@@ -2575,17 +2575,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_struct_opt() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T_conv_enum_init
+ * Function: H5T_conv_enum_init
*
- * Purpose: Initialize information for H5T__conv_enum().
+ * Purpose: Initialize information for H5T__conv_enum().
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, January 4, 1999
*
*-------------------------------------------------------------------------
@@ -2593,21 +2593,21 @@ done:
static herr_t
H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
{
- H5T_enum_struct_t *priv = NULL; /*private conversion data */
- int n; /*src value cast as native int */
- int domain[2] = {0, 0}; /*min and max source values */
- int *map = NULL; /*map from src value to dst idx */
- unsigned length; /*nelmts in map array */
- unsigned i, j; /*counters */
+ H5T_enum_struct_t *priv = NULL; /*private conversion data */
+ int n; /*src value cast as native int */
+ int domain[2] = {0, 0}; /*min and max source values */
+ int *map = NULL; /*map from src value to dst idx */
+ unsigned length; /*nelmts in map array */
+ unsigned i, j; /*counters */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
cdata->need_bkg = H5T_BKG_NO;
if(NULL == (priv = (H5T_enum_struct_t *)(cdata->priv = H5MM_calloc(sizeof(*priv)))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
if(0 == src->shared->u.enumer.nmembs)
- HGOTO_DONE(SUCCEED);
+ HGOTO_DONE(SUCCEED);
/*
* Check that the source symbol names are a subset of the destination
@@ -2617,16 +2617,16 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
H5T__sort_name(src, NULL);
H5T__sort_name(dst, NULL);
if(NULL == (priv->src2dst = (int *)H5MM_malloc(src->shared->u.enumer.nmembs * sizeof(int))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
for(i = 0, j = 0;
i < src->shared->u.enumer.nmembs && j < dst->shared->u.enumer.nmembs;
i++, j++) {
- while(j < dst->shared->u.enumer.nmembs &&
- HDstrcmp(src->shared->u.enumer.name[i], dst->shared->u.enumer.name[j]))
+ while(j < dst->shared->u.enumer.nmembs &&
+ HDstrcmp(src->shared->u.enumer.name[i], dst->shared->u.enumer.name[j]))
j++;
- if(j >= dst->shared->u.enumer.nmembs)
- HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source type is not a subset of destination type")
- priv->src2dst[i] = (int)j;
+ if(j >= dst->shared->u.enumer.nmembs)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source type is not a subset of destination type")
+ priv->src2dst[i] = (int)j;
} /* end for */
/*
@@ -2634,75 +2634,75 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
* value converted. However, if all of the following constraints are met
* then we can build a perfect hash table and use an O(1) lookup method.
*
- * A: The source datatype size matches one of our native datatype
- * sizes.
+ * A: The source datatype size matches one of our native datatype
+ * sizes.
*
- * B: After casting the source value bit pattern to a native type
- * the size of the range of values is less than 20% larger than
- * the number of values.
+ * B: After casting the source value bit pattern to a native type
+ * the size of the range of values is less than 20% larger than
+ * the number of values.
*
* If this special case is met then we use the source bit pattern cast as
* a native integer type as an index into the `val2dst'. The values of
* that array are the index numbers in the destination type or negative
* if the entry is unused.
*
- * (This optimized algorithm doesn't work when the byte orders are different.
+ * (This optimized algorithm doesn't work when the byte orders are different.
* The code such as "n = *((int*)(src->shared->u.enumer.value+i*src->shared->size));"
* can change the value significantly. i.g. if the source value is big-endian 0x0000000f,
* executing the casting on little-endian machine will get a big number 0x0f000000.
- * Then it can't meet the condition
+ * Then it can't meet the condition
* "if(src->shared->u.enumer.nmembs<2 || (double)length/src->shared->u.enumer.nmembs<1.2)"
- * Because this is the optimized code, we won't fix it. It should still work in some
- * situations. SLU - 2011/5/24)
+ * Because this is the optimized code, we won't fix it. It should still work in some
+ * situations. SLU - 2011/5/24)
*/
if(1 == src->shared->size || sizeof(short) == src->shared->size || sizeof(int) == src->shared->size) {
- for(i = 0; i < src->shared->u.enumer.nmembs; i++) {
- if(1 == src->shared->size)
- n = *((signed char *)(src->shared->u.enumer.value + i));
- else if (sizeof(short) == src->shared->size)
- n = *((short *)(src->shared->u.enumer.value + i * src->shared->size));
- else
- n = *((int *)(src->shared->u.enumer.value + i * src->shared->size));
- if(0 == i) {
- domain[0] = domain[1] = n;
- } else {
- domain[0] = MIN(domain[0], n);
- domain[1] = MAX(domain[1], n);
- }
- } /* end for */
+ for(i = 0; i < src->shared->u.enumer.nmembs; i++) {
+ if(1 == src->shared->size)
+ n = *((signed char *)(src->shared->u.enumer.value + i));
+ else if (sizeof(short) == src->shared->size)
+ n = *((short *)(src->shared->u.enumer.value + i * src->shared->size));
+ else
+ n = *((int *)(src->shared->u.enumer.value + i * src->shared->size));
+ if(0 == i) {
+ domain[0] = domain[1] = n;
+ } else {
+ domain[0] = MIN(domain[0], n);
+ domain[1] = MAX(domain[1], n);
+ }
+ } /* end for */
HDassert(domain[1] >= domain[0]);
- length = (unsigned)(domain[1] - domain[0]) + 1;
- if(src->shared->u.enumer.nmembs < 2 ||
+ length = (unsigned)(domain[1] - domain[0]) + 1;
+ if(src->shared->u.enumer.nmembs < 2 ||
(double)length / src->shared->u.enumer.nmembs < (double)(1.2f)) {
- priv->base = domain[0];
- priv->length = length;
- if(NULL == (map = (int *)H5MM_malloc(length * sizeof(int))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- for(i = 0; i < length; i++)
+ priv->base = domain[0];
+ priv->length = length;
+ if(NULL == (map = (int *)H5MM_malloc(length * sizeof(int))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ for(i = 0; i < length; i++)
map[i] = -1; /*entry unused*/
- for(i = 0; i < src->shared->u.enumer.nmembs; i++) {
- if(1 == src->shared->size)
- n = *((signed char *)(src->shared->u.enumer.value + i));
- else if(sizeof(short) == src->shared->size)
- n = *((short *)(src->shared->u.enumer.value + i * src->shared->size));
- else
- n = *((int *)(src->shared->u.enumer.value + i * src->shared->size));
- n -= priv->base;
- HDassert(n >= 0 && (unsigned)n < priv->length);
- HDassert(map[n] < 0);
- map[n] = priv->src2dst[i];
- } /* end for */
-
- /*
- * Replace original src2dst array with our new one. The original
- * was indexed by source member number while the new one is
- * indexed by source values.
- */
- H5MM_xfree(priv->src2dst);
- priv->src2dst = map;
- HGOTO_DONE(SUCCEED);
- }
+ for(i = 0; i < src->shared->u.enumer.nmembs; i++) {
+ if(1 == src->shared->size)
+ n = *((signed char *)(src->shared->u.enumer.value + i));
+ else if(sizeof(short) == src->shared->size)
+ n = *((short *)(src->shared->u.enumer.value + i * src->shared->size));
+ else
+ n = *((int *)(src->shared->u.enumer.value + i * src->shared->size));
+ n -= priv->base;
+ HDassert(n >= 0 && (unsigned)n < priv->length);
+ HDassert(map[n] < 0);
+ map[n] = priv->src2dst[i];
+ } /* end for */
+
+ /*
+ * Replace original src2dst array with our new one. The original
+ * was indexed by source member number while the new one is
+ * indexed by source values.
+ */
+ H5MM_xfree(priv->src2dst);
+ priv->src2dst = map;
+ HGOTO_DONE(SUCCEED);
+ }
}
/* Sort source type by value and adjust src2dst[] appropriately */
@@ -2710,24 +2710,24 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
done:
if (ret_value<0 && priv) {
- H5MM_xfree(priv->src2dst);
- H5MM_xfree(priv);
- cdata->priv = NULL;
+ H5MM_xfree(priv->src2dst);
+ H5MM_xfree(priv);
+ cdata->priv = NULL;
}
FUNC_LEAVE_NOAPI(ret_value)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_enum
+ * Function: H5T__conv_enum
*
- * Purpose: Converts one type of enumerated data to another.
+ * Purpose: Converts one type of enumerated data to another.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, January 4, 1999
*-------------------------------------------------------------------------
*/
@@ -2736,15 +2736,15 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
void H5_ATTR_UNUSED *bkg)
{
- uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */
- H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */
- uint8_t *s = NULL, *d = NULL; /*src and dst BUF pointers */
- ssize_t src_delta, dst_delta; /*conversion strides */
- int n; /*src value cast as native int */
+ uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */
+ H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */
+ uint8_t *s = NULL, *d = NULL; /*src and dst BUF pointers */
+ ssize_t src_delta, dst_delta; /*conversion strides */
+ int n; /*src value cast as native int */
H5T_enum_struct_t *priv = (H5T_enum_struct_t*)(cdata->priv);
H5T_conv_cb_t cb_struct; /*conversion callback structure */
H5T_conv_ret_t except_ret; /*return of callback function */
- size_t i; /*counters */
+ size_t i; /*counters */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -2761,7 +2761,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype")
if(H5T_ENUM != src->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype")
- if(H5T_ENUM != dst->shared->type)
+ if(H5T_ENUM != dst->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype")
if(H5T_conv_enum_init(src, dst, cdata) < 0)
@@ -2771,7 +2771,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
case H5T_CONV_FREE:
#ifdef H5T_DEBUG
if (H5DEBUG(T)) {
- fprintf(H5DEBUG(T), " Using %s mapping function%s\n",
+ HDfprintf(H5DEBUG(T), " Using %s mapping function%s\n",
priv->length?"O(1)":"O(log N)",
priv->length?"":", where N is the number of enum members");
}
@@ -2788,7 +2788,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if(H5T_ENUM != src->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype")
- if(H5T_ENUM != dst->shared->type)
+ if(H5T_ENUM != dst->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype")
/* priv->src2dst map was computed for certain sort keys. Make sure those same
@@ -2828,10 +2828,10 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/* Use O(1) lookup */
/* (The casting won't work when the byte orders are different. i.g. if the source value
* is big-endian 0x0000000f, the direct casting "n = *((int*)s);" will make it a big
- * number 0x0f000000 on little-endian machine. But we won't fix it because it's an
+ * number 0x0f000000 on little-endian machine. But we won't fix it because it's an
* optimization code. Please also see the comment in the H5T_conv_enum_init() function.
* SLU - 2011/5/24)
- */
+ */
if(1 == src->shared->size)
n = *((signed char*)s);
else if(sizeof(short) == src->shared->size)
@@ -2906,30 +2906,30 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_enum() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_enum_numeric
+ * Function: H5T__conv_enum_numeric
*
- * Purpose: Converts enumerated data to a numeric type (integer or
- * floating-point number). This function is registered into
- * the conversion table twice in H5T_init_interface in H5T.c.
+ * Purpose: Converts enumerated data to a numeric type (integer or
+ * floating-point number). This function is registered into
+ * the conversion table twice in H5T_init_interface in H5T.c.
* Once for enum-integer conversion. Once for enum-float conversion.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 12 October 2012
*-------------------------------------------------------------------------
*/
herr_t
H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
- size_t H5_ATTR_UNUSED buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
+ size_t H5_ATTR_UNUSED buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf,
void H5_ATTR_UNUSED *bkg)
{
- H5T_t *src, *dst; /*src and dst datatypes */
- H5T_t *src_parent; /*parent type for src */
+ H5T_t *src, *dst; /*src and dst datatypes */
+ H5T_t *src_parent; /*parent type for src */
hid_t src_parent_id = -1; /*ID for parent of the source */
H5T_path_t *tpath; /* Conversion information */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2962,9 +2962,9 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
src_parent = src->shared->parent;
if(NULL == (tpath = H5T_path_find(src_parent, dst))) {
- HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype")
+ HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype")
} else if(!H5T_path_noop(tpath)) {
- if((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), FALSE)) < 0)
+ if((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), FALSE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion")
/* Convert the data */
@@ -2986,28 +2986,28 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_enum_numeric() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_vlen
+ * Function: H5T__conv_vlen
*
- * Purpose: Converts between VL datatypes in memory and on disk.
- * This is a soft conversion function. The algorithm is
- * basically:
+ * Purpose: Converts between VL datatypes in memory and on disk.
+ * This is a soft conversion function. The algorithm is
+ * basically:
*
- * For every VL struct in the main buffer:
- * 1. Allocate space for temporary dst VL data (reuse buffer
- * if possible)
+ * For every VL struct in the main buffer:
+ * 1. Allocate space for temporary dst VL data (reuse buffer
+ * if possible)
* 2. Copy VL data from src buffer into dst buffer
* 3. Convert VL data into dst representation
* 4. Allocate buffer in dst heap
- * 5. Free heap objects storing old data
+ * 5. Free heap objects storing old data
* 6. Write dst VL data into dst heap
* 7. Store (heap ID or pointer) and length in main dst buffer
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Wednesday, May 26, 1999
+ * Programmer: Quincey Koziol
+ * Wednesday, May 26, 1999
*
*-------------------------------------------------------------------------
*/
@@ -3016,28 +3016,28 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t bkg_stride, void *buf, void *bkg)
{
H5T_vlen_alloc_info_t vl_alloc_info;/* VL allocation info */
- H5T_path_t *tpath = NULL; /* Type conversion path */
+ H5T_path_t *tpath = NULL; /* Type conversion path */
hbool_t noop_conv = FALSE; /* Flag to indicate a noop conversion */
hbool_t write_to_file = FALSE; /* Flag to indicate writing to file */
htri_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */
- hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */
- H5T_t *src = NULL; /*source datatype */
- H5T_t *dst = NULL; /*destination datatype */
- H5HG_t bg_hobjid, parent_hobjid;
- uint8_t *s = NULL; /*source buffer */
- uint8_t *d = NULL; /*destination buffer */
- uint8_t *b = NULL; /*background buffer */
- ssize_t s_stride, d_stride; /*src and dst strides */
- ssize_t b_stride; /*bkg stride */
+ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */
+ H5T_t *src = NULL; /*source datatype */
+ H5T_t *dst = NULL; /*destination datatype */
+ H5HG_t bg_hobjid, parent_hobjid;
+ uint8_t *s = NULL; /*source buffer */
+ uint8_t *d = NULL; /*destination buffer */
+ uint8_t *b = NULL; /*background buffer */
+ ssize_t s_stride, d_stride; /*src and dst strides */
+ ssize_t b_stride; /*bkg stride */
size_t safe; /*how many elements are safe to process in each pass */
- size_t bg_seq_len = 0;
- size_t src_base_size, dst_base_size;/*source & destination base size*/
- void *conv_buf = NULL; /*temporary conversion buffer */
- size_t conv_buf_size = 0; /*size of conversion buffer in bytes */
- void *tmp_buf = NULL; /*temporary background buffer */
- size_t tmp_buf_size = 0; /*size of temporary bkg buffer */
+ size_t bg_seq_len = 0;
+ size_t src_base_size, dst_base_size;/*source & destination base size*/
+ void *conv_buf = NULL; /*temporary conversion buffer */
+ size_t conv_buf_size = 0; /*size of conversion buffer in bytes */
+ void *tmp_buf = NULL; /*temporary background buffer */
+ size_t tmp_buf_size = 0; /*size of temporary bkg buffer */
hbool_t nested = FALSE; /*flag of nested VL case */
- size_t elmtno; /*element number counter */
+ size_t elmtno; /*element number counter */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -3055,10 +3055,10 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype")
if(H5T_VLEN != src->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_VLEN datatype")
- if(H5T_VLEN != dst->shared->type)
+ if(H5T_VLEN != dst->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_VLEN datatype")
if(H5T_VLEN_STRING == src->shared->u.vlen.type && H5T_VLEN_STRING == dst->shared->u.vlen.type) {
- if((H5T_CSET_ASCII == src->shared->u.vlen.cset && H5T_CSET_UTF8 == dst->shared->u.vlen.cset)
+ if((H5T_CSET_ASCII == src->shared->u.vlen.cset && H5T_CSET_UTF8 == dst->shared->u.vlen.cset)
|| (H5T_CSET_ASCII == dst->shared->u.vlen.cset && H5T_CSET_UTF8 == src->shared->u.vlen.cset))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF")
}
@@ -3187,7 +3187,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
} /* end if */
else {
ssize_t sseq_len; /* (signed) The number of elements in the current sequence*/
- size_t seq_len; /* The number of elements in the current sequence*/
+ size_t seq_len; /* The number of elements in the current sequence*/
/* Get length of element sequences */
if((sseq_len = (*(src->shared->u.vlen.getlen))(s)) < 0)
@@ -3201,7 +3201,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid source pointer")
} /* end if */
else {
- size_t src_size, dst_size; /*source & destination total size in bytes*/
+ size_t src_size, dst_size; /*source & destination total size in bytes*/
src_size = seq_len * src_base_size;
dst_size = seq_len * dst_base_size;
@@ -3209,11 +3209,11 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/* Check if conversion buffer is large enough, resize if
* necessary. If the SEQ_LEN is 0, allocate a minimal size buffer.
*/
- if(!seq_len && !conv_buf) {
+ if(!seq_len && !conv_buf) {
conv_buf_size = ((1 / H5T_VLEN_MIN_CONF_BUF_SIZE) + 1) * H5T_VLEN_MIN_CONF_BUF_SIZE;
if(NULL == (conv_buf = H5FL_BLK_CALLOC(vlen_seq, conv_buf_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion")
- }
+ }
else if(conv_buf_size < MAX(src_size, dst_size)) {
/* Only allocate conversion buffer in H5T_VLEN_MIN_CONF_BUF_SIZE increments */
conv_buf_size = ((MAX(src_size, dst_size) / H5T_VLEN_MIN_CONF_BUF_SIZE) + 1) * H5T_VLEN_MIN_CONF_BUF_SIZE;
@@ -3328,17 +3328,17 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_vlen() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_array
+ * Function: H5T__conv_array
*
- * Purpose: Converts between array datatypes in memory and on disk.
- * This is a soft conversion function.
+ * Purpose: Converts between array datatypes in memory and on disk.
+ * This is a soft conversion function.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Monday, November 6, 2000
+ * Programmer: Quincey Koziol
+ * Monday, November 6, 2000
*
*-------------------------------------------------------------------------
*/
@@ -3346,16 +3346,16 @@ herr_t
H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t bkg_stride, void *_buf, void H5_ATTR_UNUSED *_bkg)
{
- H5T_path_t *tpath; /* Type conversion path */
- hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */
- H5T_t *src = NULL; /*source datatype */
- H5T_t *dst = NULL; /*destination datatype */
- uint8_t *sp, *dp; /*source and dest traversal ptrs */
- ssize_t src_delta, dst_delta; /*source & destination stride */
- int direction; /*direction of traversal */
- size_t elmtno; /*element number counter */
+ H5T_path_t *tpath; /* Type conversion path */
+ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */
+ H5T_t *src = NULL; /*source datatype */
+ H5T_t *dst = NULL; /*destination datatype */
+ uint8_t *sp, *dp; /*source and dest traversal ptrs */
+ ssize_t src_delta, dst_delta; /*source & destination stride */
+ int direction; /*direction of traversal */
+ size_t elmtno; /*element number counter */
unsigned u; /* local index variable */
- void *bkg_buf = NULL; /*temporary background buffer */
+ void *bkg_buf = NULL; /*temporary background buffer */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -3433,7 +3433,7 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/* Check if we need a background buffer for this conversion */
if(tpath->cdata.need_bkg) {
- size_t bkg_buf_size; /*size of background buffer in bytes */
+ size_t bkg_buf_size; /*size of background buffer in bytes */
/* Allocate background buffer */
bkg_buf_size = src->shared->u.array.nelem * MAX(src->shared->size, dst->shared->size);
@@ -3474,18 +3474,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_array() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_i_i
+ * Function: H5T__conv_i_i
*
- * Purpose: Convert one integer type to another. This is the catch-all
- * function for integer conversions and is probably not
- * particularly fast.
+ * Purpose: Convert one integer type to another. This is the catch-all
+ * function for integer conversions and is probably not
+ * particularly fast.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Wednesday, June 10, 1998
+ * Programmer: Robb Matzke
+ * Wednesday, June 10, 1998
*
*-------------------------------------------------------------------------
*/
@@ -3493,19 +3493,19 @@ herr_t
H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5T_t *src = NULL; /*source datatype */
- H5T_t *dst = NULL; /*destination datatype */
- ssize_t src_delta, dst_delta; /*source & destination stride */
- int direction; /*direction of traversal */
- size_t elmtno; /*element number */
- size_t half_size; /*half the type size */
- size_t olap; /*num overlapping elements */
- uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
+ H5T_t *src = NULL; /*source datatype */
+ H5T_t *dst = NULL; /*destination datatype */
+ ssize_t src_delta, dst_delta; /*source & destination stride */
+ int direction; /*direction of traversal */
+ size_t elmtno; /*element number */
+ size_t half_size; /*half the type size */
+ size_t olap; /*num overlapping elements */
+ uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
uint8_t *src_rev=NULL; /*order-reversed source buffer */
- uint8_t dbuf[64]; /*temp destination buffer */
- size_t first;
- ssize_t sfirst; /*a signed version of `first' */
- size_t i; /*Local index variables */
+ uint8_t dbuf[64]; /*temp destination buffer */
+ size_t first;
+ ssize_t sfirst; /*a signed version of `first' */
+ size_t i; /*Local index variables */
H5T_conv_cb_t cb_struct={NULL, NULL}; /*conversion callback structure */
H5T_conv_ret_t except_ret; /*return of callback function */
hbool_t reverse; /*if reverse the order of destination */
@@ -3865,18 +3865,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_i_i() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_f_f
+ * Function: H5T__conv_f_f
*
- * Purpose: Convert one floating point type to another. This is a catch
- * all for floating point conversions and is probably not
- * particularly fast!
+ * Purpose: Convert one floating point type to another. This is a catch
+ * all for floating point conversions and is probably not
+ * particularly fast!
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, June 23, 1998
+ * Programmer: Robb Matzke
+ * Tuesday, June 23, 1998
*
*-------------------------------------------------------------------------
*/
@@ -3885,32 +3885,32 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
/* Traversal-related variables */
- H5T_t *src_p; /*source datatype */
- H5T_t *dst_p; /*destination datatype */
- H5T_atomic_t src; /*atomic source info */
- H5T_atomic_t dst; /*atomic destination info */
- ssize_t src_delta, dst_delta; /*source & destination stride */
- int direction; /*forward or backward traversal */
- size_t elmtno; /*element number */
- size_t half_size; /*half the type size */
+ H5T_t *src_p; /*source datatype */
+ H5T_t *dst_p; /*destination datatype */
+ H5T_atomic_t src; /*atomic source info */
+ H5T_atomic_t dst; /*atomic destination info */
+ ssize_t src_delta, dst_delta; /*source & destination stride */
+ int direction; /*forward or backward traversal */
+ size_t elmtno; /*element number */
+ size_t half_size; /*half the type size */
size_t tsize; /*type size for swapping bytes */
- size_t olap; /*num overlapping elements */
- ssize_t bitno = 0; /*bit number */
- uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
+ size_t olap; /*num overlapping elements */
+ ssize_t bitno = 0; /*bit number */
+ uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
uint8_t *src_rev = NULL; /*order-reversed source buffer */
- uint8_t dbuf[64]; /*temp destination buffer */
+ uint8_t dbuf[64]; /*temp destination buffer */
uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/
/* Conversion-related variables */
- int64_t expo; /*exponent */
- hssize_t expo_max; /*maximum possible dst exponent */
- size_t msize = 0; /*useful size of mantissa in src*/
- size_t mpos; /*offset to useful mant is src */
+ int64_t expo; /*exponent */
+ hssize_t expo_max; /*maximum possible dst exponent */
+ size_t msize = 0; /*useful size of mantissa in src*/
+ size_t mpos; /*offset to useful mant is src */
uint64_t sign; /*source sign bit value */
- size_t mrsh; /*amount to right shift mantissa*/
- hbool_t carry = FALSE; /*carry after rounding mantissa */
- size_t i; /*miscellaneous counters */
- size_t implied; /*destination implied bits */
+ size_t mrsh; /*amount to right shift mantissa*/
+ hbool_t carry = FALSE; /*carry after rounding mantissa */
+ size_t i; /*miscellaneous counters */
+ size_t implied; /*destination implied bits */
hbool_t denormalized = FALSE; /*is either source or destination denormalized?*/
H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */
H5T_conv_ret_t except_ret; /*return of callback function */
@@ -4174,7 +4174,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/*
* Get the exponent as an unsigned quantity from the section of
- * the source bit field where it's located. Don't worry about
+ * the source bit field where it's located. Don't worry about
* the exponent bias yet.
*/
expo = (int64_t)H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize);
@@ -4260,7 +4260,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
else if (expo>=expo_max) {
/*
* The exponent is too large to fit in the available region
- * or it results in the maximum possible value. Use positive
+ * or it results in the maximum possible value. Use positive
* or negative infinity instead unless the application
* specifies something else. Before calling the overflow
* handler make sure the source buffer we hand it is in the
@@ -4452,16 +4452,16 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_f_f() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_s_s
+ * Function: H5T__conv_s_s
*
- * Purpose: Convert one fixed-length string type to another.
+ * Purpose: Convert one fixed-length string type to another.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Friday, August 7, 1998
+ * Programmer: Robb Matzke
+ * Friday, August 7, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4470,15 +4470,15 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf,
void H5_ATTR_UNUSED *bkg)
{
- H5T_t *src=NULL; /*source datatype */
- H5T_t *dst=NULL; /*destination datatype */
- ssize_t src_delta, dst_delta; /*source & destination stride */
- int direction; /*direction of traversal */
- size_t elmtno; /*element number */
- size_t olap; /*num overlapping elements */
- size_t nchars=0; /*number of characters copied */
- uint8_t *s, *sp, *d, *dp; /*src and dst traversal pointers*/
- uint8_t *dbuf=NULL; /*temp buf for overlap convers. */
+ H5T_t *src=NULL; /*source datatype */
+ H5T_t *dst=NULL; /*destination datatype */
+ ssize_t src_delta, dst_delta; /*source & destination stride */
+ int direction; /*direction of traversal */
+ size_t elmtno; /*element number */
+ size_t olap; /*num overlapping elements */
+ size_t nchars=0; /*number of characters copied */
+ uint8_t *s, *sp, *d, *dp; /*src and dst traversal pointers*/
+ uint8_t *dbuf=NULL; /*temp buf for overlap convers. */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -4495,7 +4495,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad source character set")
if(H5T_CSET_ASCII != dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 != dst->shared->u.atomic.u.s.cset)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad destination character set")
- if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset)
+ if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset)
|| (H5T_CSET_ASCII == dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == src->shared->u.atomic.u.s.cset))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF")
if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NSTR ||
@@ -4684,18 +4684,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_s_s() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_uchar
+ * Function: H5T__conv_schar_uchar
*
- * Purpose: Converts `signed char' to `unsigned char'
+ * Purpose: Converts `signed char' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4707,18 +4707,18 @@ H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_su(SCHAR, UCHAR, signed char, unsigned char, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_schar
+ * Function: H5T__conv_uchar_schar
*
- * Purpose: Converts `unsigned char' to `signed char'
+ * Purpose: Converts `unsigned char' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4730,18 +4730,18 @@ H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_us(UCHAR, SCHAR, unsigned char, signed char, -, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_short
+ * Function: H5T__conv_schar_short
*
- * Purpose: Converts `signed char' to `short'
+ * Purpose: Converts `signed char' to `short'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4753,18 +4753,18 @@ H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sS(SCHAR, SHORT, signed char, short, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_ushort
+ * Function: H5T__conv_schar_ushort
*
- * Purpose: Converts `signed char' to `unsigned short'
+ * Purpose: Converts `signed char' to `unsigned short'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4776,18 +4776,18 @@ H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sU(SCHAR, USHORT, signed char, unsigned short, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_short
+ * Function: H5T__conv_uchar_short
*
- * Purpose: Converts `unsigned char' to `short'
+ * Purpose: Converts `unsigned char' to `short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4799,18 +4799,18 @@ H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uS(UCHAR, SHORT, unsigned char, short, -, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_ushort
+ * Function: H5T__conv_uchar_ushort
*
- * Purpose: Converts `unsigned char' to `unsigned short'
+ * Purpose: Converts `unsigned char' to `unsigned short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4822,18 +4822,18 @@ H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uU(UCHAR, USHORT, unsigned char, unsigned short, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_int
+ * Function: H5T__conv_schar_int
*
- * Purpose: Converts `signed char' to `int'
+ * Purpose: Converts `signed char' to `int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4845,18 +4845,18 @@ H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sS(SCHAR, INT, signed char, int, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_uint
+ * Function: H5T__conv_schar_uint
*
- * Purpose: Converts `signed char' to `unsigned int'
+ * Purpose: Converts `signed char' to `unsigned int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4868,18 +4868,18 @@ H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sU(SCHAR, UINT, signed char, unsigned, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_int
+ * Function: H5T__conv_uchar_int
*
- * Purpose: Converts `unsigned char' to `int'
+ * Purpose: Converts `unsigned char' to `int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4891,18 +4891,18 @@ H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uS(UCHAR, INT, unsigned char, int, -, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_uint
+ * Function: H5T__conv_uchar_uint
*
- * Purpose: Converts `unsigned char' to `unsigned int'
+ * Purpose: Converts `unsigned char' to `unsigned int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4914,18 +4914,18 @@ H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uU(UCHAR, UINT, unsigned char, unsigned, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_long
+ * Function: H5T__conv_schar_long
*
- * Purpose: Converts `signed char' to `long'
+ * Purpose: Converts `signed char' to `long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4937,18 +4937,18 @@ H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sS(SCHAR, LONG, signed char, long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_ulong
+ * Function: H5T__conv_schar_ulong
*
- * Purpose: Converts `signed char' to `unsigned long'
+ * Purpose: Converts `signed char' to `unsigned long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4960,18 +4960,18 @@ H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sU(SCHAR, ULONG, signed char, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_long
+ * Function: H5T__conv_uchar_long
*
- * Purpose: Converts `unsigned char' to `long'
+ * Purpose: Converts `unsigned char' to `long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4983,18 +4983,18 @@ H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uS(UCHAR, LONG, unsigned char, long, -, LONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_ulong
+ * Function: H5T__conv_uchar_ulong
*
- * Purpose: Converts `unsigned char' to `unsigned long'
+ * Purpose: Converts `unsigned char' to `unsigned long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5006,18 +5006,18 @@ H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uU(UCHAR, ULONG, unsigned char, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_llong
+ * Function: H5T__conv_schar_llong
*
- * Purpose: Converts `signed char' to `long long'
+ * Purpose: Converts `signed char' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5029,18 +5029,18 @@ H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sS(SCHAR, LLONG, signed char, long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_ullong
+ * Function: H5T__conv_schar_ullong
*
- * Purpose: Converts `signed char' to `unsigned long long'
+ * Purpose: Converts `signed char' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5052,18 +5052,18 @@ H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sU(SCHAR, ULLONG, signed char, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_llong
+ * Function: H5T__conv_uchar_llong
*
- * Purpose: Converts `unsigned char' to `long long'
+ * Purpose: Converts `unsigned char' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5075,18 +5075,18 @@ H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uS(UCHAR, LLONG, unsigned char, long long, -, LLONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_ullong
+ * Function: H5T__conv_uchar_ullong
*
- * Purpose: Converts `unsigned char' to `unsigned long long'
+ * Purpose: Converts `unsigned char' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5098,18 +5098,18 @@ H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uU(UCHAR, ULLONG, unsigned char, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_schar
+ * Function: H5T__conv_short_schar
*
- * Purpose: Converts `short' to `signed char'
+ * Purpose: Converts `short' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5121,18 +5121,18 @@ H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Ss(SHORT, SCHAR, short, signed char, SCHAR_MIN, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_uchar
+ * Function: H5T__conv_short_uchar
*
- * Purpose: Converts `short' to `unsigned char'
+ * Purpose: Converts `short' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5144,18 +5144,18 @@ H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Su(SHORT, UCHAR, short, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_schar
+ * Function: H5T__conv_ushort_schar
*
- * Purpose: Converts `unsigned short' to `signed char'
+ * Purpose: Converts `unsigned short' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5167,18 +5167,18 @@ H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Us(USHORT, SCHAR, unsigned short, signed char, -, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_uchar
+ * Function: H5T__conv_ushort_uchar
*
- * Purpose: Converts `unsigned short' to `unsigned char'
+ * Purpose: Converts `unsigned short' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5190,18 +5190,18 @@ H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Uu(USHORT, UCHAR, unsigned short, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_ushort
+ * Function: H5T__conv_short_ushort
*
- * Purpose: Converts `short' to `unsigned short'
+ * Purpose: Converts `short' to `unsigned short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5213,18 +5213,18 @@ H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_su(SHORT, USHORT, short, unsigned short, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_short
+ * Function: H5T__conv_ushort_short
*
- * Purpose: Converts `unsigned short' to `short'
+ * Purpose: Converts `unsigned short' to `short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5236,18 +5236,18 @@ H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_us(USHORT, SHORT, unsigned short, short, -, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_int
+ * Function: H5T__conv_short_int
*
- * Purpose: Converts `short' to `int'
+ * Purpose: Converts `short' to `int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5259,18 +5259,18 @@ H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sS(SHORT, INT, short, int, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_uint
+ * Function: H5T__conv_short_uint
*
- * Purpose: Converts `short' to `unsigned int'
+ * Purpose: Converts `short' to `unsigned int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5282,18 +5282,18 @@ H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sU(SHORT, UINT, short, unsigned, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_int
+ * Function: H5T__conv_ushort_int
*
- * Purpose: Converts `unsigned short' to `int'
+ * Purpose: Converts `unsigned short' to `int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5305,18 +5305,18 @@ H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uS(USHORT, INT, unsigned short, int, -, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_uint
+ * Function: H5T__conv_ushort_uint
*
- * Purpose: Converts `unsigned short' to `unsigned int'
+ * Purpose: Converts `unsigned short' to `unsigned int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5328,18 +5328,18 @@ H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uU(USHORT, UINT, unsigned short, unsigned, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_long
+ * Function: H5T__conv_short_long
*
- * Purpose: Converts `short' to `long'
+ * Purpose: Converts `short' to `long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5351,18 +5351,18 @@ H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sS(SHORT, LONG, short, long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_ulong
+ * Function: H5T__conv_short_ulong
*
- * Purpose: Converts `short' to `unsigned long'
+ * Purpose: Converts `short' to `unsigned long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5374,18 +5374,18 @@ H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sU(SHORT, ULONG, short, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_long
+ * Function: H5T__conv_ushort_long
*
- * Purpose: Converts `unsigned short' to `long'
+ * Purpose: Converts `unsigned short' to `long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5397,18 +5397,18 @@ H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uS(USHORT, LONG, unsigned short, long, -, LONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_ulong
+ * Function: H5T__conv_ushort_ulong
*
- * Purpose: Converts `unsigned short' to `unsigned long'
+ * Purpose: Converts `unsigned short' to `unsigned long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5420,18 +5420,18 @@ H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uU(USHORT, ULONG, unsigned short, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_llong
+ * Function: H5T__conv_short_llong
*
- * Purpose: Converts `short' to `long long'
+ * Purpose: Converts `short' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5443,18 +5443,18 @@ H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sS(SHORT, LLONG, short, long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_ullong
+ * Function: H5T__conv_short_ullong
*
- * Purpose: Converts `short' to `unsigned long long'
+ * Purpose: Converts `short' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5466,18 +5466,18 @@ H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sU(SHORT, ULLONG, short, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_llong
+ * Function: H5T__conv_ushort_llong
*
- * Purpose: Converts `unsigned short' to `long long'
+ * Purpose: Converts `unsigned short' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5489,18 +5489,18 @@ H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uS(USHORT, LLONG, unsigned short, long long, -, LLONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_ullong
+ * Function: H5T__conv_ushort_ullong
*
- * Purpose: Converts `unsigned short' to `unsigned long long'
+ * Purpose: Converts `unsigned short' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5512,18 +5512,18 @@ H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uU(USHORT, ULLONG, unsigned short, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_schar
+ * Function: H5T__conv_int_schar
*
- * Purpose: Converts `int' to `signed char'
+ * Purpose: Converts `int' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5535,18 +5535,18 @@ H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Ss(INT, SCHAR, int, signed char, SCHAR_MIN, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_uchar
+ * Function: H5T__conv_int_uchar
*
- * Purpose: Converts `int' to `unsigned char'
+ * Purpose: Converts `int' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5558,18 +5558,18 @@ H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Su(INT, UCHAR, int, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_schar
+ * Function: H5T__conv_uint_schar
*
- * Purpose: Converts `unsigned int' to `signed char'
+ * Purpose: Converts `unsigned int' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5581,18 +5581,18 @@ H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Us(UINT, SCHAR, unsigned, signed char, -, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_uchar
+ * Function: H5T__conv_uint_uchar
*
- * Purpose: Converts `unsigned int' to `unsigned char'
+ * Purpose: Converts `unsigned int' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5604,18 +5604,18 @@ H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Uu(UINT, UCHAR, unsigned, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_short
+ * Function: H5T__conv_int_short
*
- * Purpose: Converts `int' to `short'
+ * Purpose: Converts `int' to `short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5627,18 +5627,18 @@ H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Ss(INT, SHORT, int, short, SHRT_MIN, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_ushort
+ * Function: H5T__conv_int_ushort
*
- * Purpose: Converts `int' to `unsigned short'
+ * Purpose: Converts `int' to `unsigned short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5650,18 +5650,18 @@ H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Su(INT, USHORT, int, unsigned short, -, USHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_short
+ * Function: H5T__conv_uint_short
*
- * Purpose: Converts `unsigned int' to `short'
+ * Purpose: Converts `unsigned int' to `short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5673,18 +5673,18 @@ H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Us(UINT, SHORT, unsigned, short, -, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_ushort
+ * Function: H5T__conv_uint_ushort
*
- * Purpose: Converts `unsigned int' to `unsigned short'
+ * Purpose: Converts `unsigned int' to `unsigned short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5696,18 +5696,18 @@ H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Uu(UINT, USHORT, unsigned, unsigned short, -, USHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_uint
+ * Function: H5T__conv_int_uint
*
- * Purpose: Converts `int' to `unsigned int'
+ * Purpose: Converts `int' to `unsigned int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5719,18 +5719,18 @@ H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_su(INT, UINT, int, unsigned, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_int
+ * Function: H5T__conv_uint_int
*
- * Purpose: Converts `unsigned int' to `int'
+ * Purpose: Converts `unsigned int' to `int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5742,18 +5742,18 @@ H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_us(UINT, INT, unsigned, int, -, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_long
+ * Function: H5T__conv_int_long
*
- * Purpose: Converts `int' to `long'
+ * Purpose: Converts `int' to `long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5765,18 +5765,18 @@ H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sS(INT, LONG, int, long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_ulong
+ * Function: H5T__conv_int_ulong
*
- * Purpose: Converts `int' to `unsigned long'
+ * Purpose: Converts `int' to `unsigned long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5788,18 +5788,18 @@ H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sU(INT, LONG, int, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_long
+ * Function: H5T__conv_uint_long
*
- * Purpose: Converts `unsigned int' to `long'
+ * Purpose: Converts `unsigned int' to `long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5811,18 +5811,18 @@ H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uS(UINT, LONG, unsigned, long, -, LONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_ulong
+ * Function: H5T__conv_uint_ulong
*
- * Purpose: Converts `unsigned int' to `unsigned long'
+ * Purpose: Converts `unsigned int' to `unsigned long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5834,18 +5834,18 @@ H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uU(UINT, ULONG, unsigned, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_llong
+ * Function: H5T__conv_int_llong
*
- * Purpose: Converts `int' to `long long'
+ * Purpose: Converts `int' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5857,18 +5857,18 @@ H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sS(INT, LLONG, int, long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_ullong
+ * Function: H5T__conv_int_ullong
*
- * Purpose: Converts `int' to `unsigned long long'
+ * Purpose: Converts `int' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5880,18 +5880,18 @@ H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sU(INT, ULLONG, int, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_llong
+ * Function: H5T__conv_uint_llong
*
- * Purpose: Converts `unsigned int' to `long long'
+ * Purpose: Converts `unsigned int' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5903,18 +5903,18 @@ H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uS(UINT, LLONG, unsigned, long long, -, LLONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_ullong
+ * Function: H5T__conv_uint_ullong
*
- * Purpose: Converts `unsigned int' to `unsigned long long'
+ * Purpose: Converts `unsigned int' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5926,18 +5926,18 @@ H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uU(UINT, ULLONG, unsigned, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_schar
+ * Function: H5T__conv_long_schar
*
- * Purpose: Converts `long' to `signed char'
+ * Purpose: Converts `long' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5949,18 +5949,18 @@ H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Ss(LONG, SCHAR, long, signed char, SCHAR_MIN, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_uchar
+ * Function: H5T__conv_long_uchar
*
- * Purpose: Converts `long' to `unsigned char'
+ * Purpose: Converts `long' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5972,18 +5972,18 @@ H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Su(LONG, UCHAR, long, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_schar
+ * Function: H5T__conv_ulong_schar
*
- * Purpose: Converts `unsigned long' to `signed char'
+ * Purpose: Converts `unsigned long' to `signed char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -5995,18 +5995,18 @@ H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Us(ULONG, SCHAR, unsigned long, signed char, -, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_uchar
+ * Function: H5T__conv_ulong_uchar
*
- * Purpose: Converts `unsigned long' to `unsigned char'
+ * Purpose: Converts `unsigned long' to `unsigned char'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6018,18 +6018,18 @@ H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Uu(ULONG, UCHAR, unsigned long, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_short
+ * Function: H5T__conv_long_short
*
- * Purpose: Converts `long' to `short'
+ * Purpose: Converts `long' to `short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6041,18 +6041,18 @@ H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Ss(LONG, SHORT, long, short, SHRT_MIN, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_ushort
+ * Function: H5T__conv_long_ushort
*
- * Purpose: Converts `long' to `unsigned short'
+ * Purpose: Converts `long' to `unsigned short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6064,18 +6064,18 @@ H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Su(LONG, USHORT, long, unsigned short, -, USHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_short
+ * Function: H5T__conv_ulong_short
*
- * Purpose: Converts `unsigned long' to `short'
+ * Purpose: Converts `unsigned long' to `short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6087,18 +6087,18 @@ H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Us(ULONG, SHORT, unsigned long, short, -, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_ushort
+ * Function: H5T__conv_ulong_ushort
*
- * Purpose: Converts `unsigned long' to `unsigned short'
+ * Purpose: Converts `unsigned long' to `unsigned short'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6110,18 +6110,18 @@ H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Uu(ULONG, USHORT, unsigned long, unsigned short, -, USHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_int
+ * Function: H5T__conv_long_int
*
- * Purpose: Converts `long' to `int'
+ * Purpose: Converts `long' to `int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6133,18 +6133,18 @@ H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Ss(LONG, INT, long, int, INT_MIN, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_uint
+ * Function: H5T__conv_long_uint
*
- * Purpose: Converts `long' to `unsigned int'
+ * Purpose: Converts `long' to `unsigned int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6156,18 +6156,18 @@ H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Su(LONG, UINT, long, unsigned, -, UINT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_int
+ * Function: H5T__conv_ulong_int
*
- * Purpose: Converts `unsigned long' to `int'
+ * Purpose: Converts `unsigned long' to `int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6179,18 +6179,18 @@ H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Us(ULONG, INT, unsigned long, int, -, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_uint
+ * Function: H5T__conv_ulong_uint
*
- * Purpose: Converts `unsigned long' to `unsigned int'
+ * Purpose: Converts `unsigned long' to `unsigned int'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6202,18 +6202,18 @@ H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Uu(ULONG, UINT, unsigned long, unsigned, -, UINT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_ulong
+ * Function: H5T__conv_long_ulong
*
- * Purpose: Converts `long' to `unsigned long'
+ * Purpose: Converts `long' to `unsigned long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6225,18 +6225,18 @@ H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_su(LONG, ULONG, long, unsigned long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_long
+ * Function: H5T__conv_ulong_long
*
- * Purpose: Converts `unsigned long' to `long'
+ * Purpose: Converts `unsigned long' to `long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6248,18 +6248,18 @@ H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_us(ULONG, LONG, unsigned long, long, -, LONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_llong
+ * Function: H5T__conv_long_llong
*
- * Purpose: Converts `long' to `long long'
+ * Purpose: Converts `long' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6271,18 +6271,18 @@ H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sS(LONG, LLONG, long, long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_ullong
+ * Function: H5T__conv_long_ullong
*
- * Purpose: Converts `long' to `unsigned long long'
+ * Purpose: Converts `long' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6294,18 +6294,18 @@ H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_sU(LONG, ULLONG, long, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_llong
+ * Function: H5T__conv_ulong_llong
*
- * Purpose: Converts `unsigned long' to `long long'
+ * Purpose: Converts `unsigned long' to `long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6317,18 +6317,18 @@ H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uS(ULONG, LLONG, unsigned long, long long, -, LLONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_ullong
+ * Function: H5T__conv_ulong_ullong
*
- * Purpose: Converts `unsigned long' to `unsigned long long'
+ * Purpose: Converts `unsigned long' to `unsigned long long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6340,18 +6340,18 @@ H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_uU(ULONG, ULLONG, unsigned long, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_schar
+ * Function: H5T__conv_llong_schar
*
- * Purpose: Converts `long long' to `signed char'
+ * Purpose: Converts `long long' to `signed char'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6363,18 +6363,18 @@ H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Ss(LLONG, SCHAR, long long, signed char, SCHAR_MIN, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_uchar
+ * Function: H5T__conv_llong_uchar
*
- * Purpose: Converts `long long' to `unsigned char'
+ * Purpose: Converts `long long' to `unsigned char'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6386,18 +6386,18 @@ H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Su(LLONG, UCHAR, long long, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_schar
+ * Function: H5T__conv_ullong_schar
*
- * Purpose: Converts `unsigned long long' to `signed char'
+ * Purpose: Converts `unsigned long long' to `signed char'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6409,18 +6409,18 @@ H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Us(ULLONG, SCHAR, unsigned long long, signed char, -, SCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_uchar
+ * Function: H5T__conv_ullong_uchar
*
- * Purpose: Converts `unsigned long long' to `unsigned char'
+ * Purpose: Converts `unsigned long long' to `unsigned char'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6432,18 +6432,18 @@ H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Uu(ULLONG, UCHAR, unsigned long long, unsigned char, -, UCHAR_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_short
+ * Function: H5T__conv_llong_short
*
- * Purpose: Converts `long long' to `short'
+ * Purpose: Converts `long long' to `short'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6455,18 +6455,18 @@ H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Ss(LLONG, SHORT, long long, short, SHRT_MIN, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_ushort
+ * Function: H5T__conv_llong_ushort
*
- * Purpose: Converts `long long' to `unsigned short'
+ * Purpose: Converts `long long' to `unsigned short'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6478,18 +6478,18 @@ H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Su(LLONG, USHORT, long long, unsigned short, -, USHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_short
+ * Function: H5T__conv_ullong_short
*
- * Purpose: Converts `unsigned long long' to `short'
+ * Purpose: Converts `unsigned long long' to `short'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6501,18 +6501,18 @@ H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Us(ULLONG, SHORT, unsigned long long, short, -, SHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_ushort
+ * Function: H5T__conv_ullong_ushort
*
- * Purpose: Converts `unsigned long long' to `unsigned short'
+ * Purpose: Converts `unsigned long long' to `unsigned short'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6524,18 +6524,18 @@ H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Uu(ULLONG, USHORT, unsigned long long, unsigned short, -, USHRT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_int
+ * Function: H5T__conv_llong_int
*
- * Purpose: Converts `long long' to `int'
+ * Purpose: Converts `long long' to `int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6547,18 +6547,18 @@ H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Ss(LLONG, INT, long long, int, INT_MIN, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_uint
+ * Function: H5T__conv_llong_uint
*
- * Purpose: Converts `long long' to `unsigned int'
+ * Purpose: Converts `long long' to `unsigned int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6570,18 +6570,18 @@ H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Su(LLONG, UINT, long long, unsigned, -, UINT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_int
+ * Function: H5T__conv_ullong_int
*
- * Purpose: Converts `unsigned long long' to `int'
+ * Purpose: Converts `unsigned long long' to `int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6593,18 +6593,18 @@ H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Us(ULLONG, INT, unsigned long long, int, -, INT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_uint
+ * Function: H5T__conv_ullong_uint
*
- * Purpose: Converts `unsigned long long' to `unsigned int'
+ * Purpose: Converts `unsigned long long' to `unsigned int'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6616,18 +6616,18 @@ H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Uu(ULLONG, UINT, unsigned long long, unsigned, -, UINT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_long
+ * Function: H5T__conv_llong_long
*
- * Purpose: Converts `long long' to `long'
+ * Purpose: Converts `long long' to `long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6639,18 +6639,18 @@ H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Ss(LLONG, LONG, long long, long, LONG_MIN, LONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_ulong
+ * Function: H5T__conv_llong_ulong
*
- * Purpose: Converts `long long' to `unsigned long'
+ * Purpose: Converts `long long' to `unsigned long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6662,18 +6662,18 @@ H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Su(LLONG, ULONG, long long, unsigned long, -, ULONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_long
+ * Function: H5T__conv_ullong_long
*
- * Purpose: Converts `unsigned long long' to `long'
+ * Purpose: Converts `unsigned long long' to `long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6685,18 +6685,18 @@ H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Us(ULLONG, LONG, unsigned long long, long, -, LONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_ulong
+ * Function: H5T__conv_ullong_ulong
*
- * Purpose: Converts `unsigned long long' to `unsigned long'
+ * Purpose: Converts `unsigned long long' to `unsigned long'
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Friday, November 13, 1998
+ * Programmer: Robb Matzke
+ * Friday, November 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6708,18 +6708,18 @@ H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Uu(ULLONG, ULONG, unsigned long long, unsigned long, -, ULONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_ullong
+ * Function: H5T__conv_llong_ullong
*
- * Purpose: Converts `long long' to `unsigned long long'
+ * Purpose: Converts `long long' to `unsigned long long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6731,18 +6731,18 @@ H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_su(LLONG, ULLONG, long long, unsigned long long, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_llong
+ * Function: H5T__conv_ullong_llong
*
- * Purpose: Converts `unsigned long long' to `long long'
+ * Purpose: Converts `unsigned long long' to `long long'
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Robb Matzke
- * Monday, November 16, 1998
+ * Programmer: Robb Matzke
+ * Monday, November 16, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6754,17 +6754,17 @@ H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_us(ULLONG, LLONG, unsigned long long, long long, -, LLONG_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_double
+ * Function: H5T__conv_float_double
*
- * Purpose: Convert native `float' to native `double' using hardware.
- * This is a fast special case.
+ * Purpose: Convert native `float' to native `double' using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, June 23, 1998
+ * Programmer: Robb Matzke
+ * Tuesday, June 23, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6776,17 +6776,17 @@ H5T__conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_fF(FLOAT, DOUBLE, float, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_ldouble
+ * Function: H5T__conv_float_ldouble
*
- * Purpose: Convert native `float' to native `long double' using hardware.
- * This is a fast special case.
+ * Purpose: Convert native `float' to native `long double' using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, Feb 25, 2005
+ * Programmer: Raymond Lu
+ * Friday, Feb 25, 2005
*
*-------------------------------------------------------------------------
*/
@@ -6800,17 +6800,17 @@ H5T__conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
#endif /* H5_SIZEOF_LONG_DOUBLE != 0 */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_float
+ * Function: H5T__conv_double_float
*
- * Purpose: Convert native `double' to native `float' using hardware.
- * This is a fast special case.
+ * Purpose: Convert native `double' to native `float' using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, June 23, 1998
+ * Programmer: Robb Matzke
+ * Tuesday, June 23, 1998
*
*-------------------------------------------------------------------------
*/
@@ -6822,17 +6822,17 @@ H5T__conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_Ff(DOUBLE, FLOAT, double, float, -FLT_MAX, FLT_MAX);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_ldouble
+ * Function: H5T__conv_double_ldouble
*
- * Purpose: Convert native `double' to native `long double' using hardware.
- * This is a fast special case.
+ * Purpose: Convert native `double' to native `long double' using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, Feb 25, 2005
+ * Programmer: Raymond Lu
+ * Friday, Feb 25, 2005
*
*-------------------------------------------------------------------------
*/
@@ -6846,17 +6846,17 @@ H5T__conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
#endif /* H5_SIZEOF_LONG_DOUBLE != 0 */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_float
+ * Function: H5T__conv_ldouble_float
*
- * Purpose: Convert native `long double' to native `float' using hardware.
- * This is a fast special case.
+ * Purpose: Convert native `long double' to native `float' using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, Feb 25, 2005
+ * Programmer: Raymond Lu
+ * Friday, Feb 25, 2005
*
*-------------------------------------------------------------------------
*/
@@ -6870,17 +6870,17 @@ H5T__conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
#endif /* H5_SIZEOF_LONG_DOUBLE != 0 */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_double
+ * Function: H5T__conv_ldouble_double
*
- * Purpose: Convert native `long double' to native `double' using hardware.
- * This is a fast special case.
+ * Purpose: Convert native `long double' to native `double' using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, Feb 25, 2005
+ * Programmer: Raymond Lu
+ * Friday, Feb 25, 2005
*
*-------------------------------------------------------------------------
*/
@@ -6894,17 +6894,17 @@ H5T__conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
#endif /* H5_SIZEOF_LONG_DOUBLE != 0 */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_float
+ * Function: H5T__conv_schar_float
*
- * Purpose: Convert native signed char to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native signed char to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -6916,17 +6916,17 @@ H5T__conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(SCHAR, FLOAT, signed char, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_double
+ * Function: H5T__conv_schar_double
*
- * Purpose: Convert native signed char to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native signed char to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -6938,17 +6938,17 @@ H5T__conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(SCHAR, DOUBLE, signed char, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_schar_ldouble
+ * Function: H5T__conv_schar_ldouble
*
- * Purpose: Convert native signed char to native long double using
+ * Purpose: Convert native signed char to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -6960,17 +6960,17 @@ H5T__conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(SCHAR, LDOUBLE, signed char, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_float
+ * Function: H5T__conv_uchar_float
*
- * Purpose: Convert native unsigned char to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native unsigned char to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -6982,17 +6982,17 @@ H5T__conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(UCHAR, FLOAT, unsigned char, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_double
+ * Function: H5T__conv_uchar_double
*
- * Purpose: Convert native unsigned char to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native unsigned char to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7004,17 +7004,17 @@ H5T__conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(UCHAR, DOUBLE, unsigned char, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uchar_ldouble
+ * Function: H5T__conv_uchar_ldouble
*
- * Purpose: Convert native unsigned char to native long double using
+ * Purpose: Convert native unsigned char to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7026,17 +7026,17 @@ H5T__conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(UCHAR, LDOUBLE, unsigned char, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_float
+ * Function: H5T__conv_short_float
*
- * Purpose: Convert native short to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native short to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7048,17 +7048,17 @@ H5T__conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(SHORT, FLOAT, short, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_double
+ * Function: H5T__conv_short_double
*
- * Purpose: Convert native short to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native short to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7070,17 +7070,17 @@ H5T__conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(SHORT, DOUBLE, short, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_short_ldouble
+ * Function: H5T__conv_short_ldouble
*
- * Purpose: Convert native short to native long double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native short to native long double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7092,17 +7092,17 @@ H5T__conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(SHORT, LDOUBLE, short, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_float
+ * Function: H5T__conv_ushort_float
*
- * Purpose: Convert native unsigned short to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native unsigned short to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7114,17 +7114,17 @@ H5T__conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(USHORT, FLOAT, unsigned short, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_double
+ * Function: H5T__conv_ushort_double
*
- * Purpose: Convert native unsigned short to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native unsigned short to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7136,17 +7136,17 @@ H5T__conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(USHORT, DOUBLE, unsigned short, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ushort_ldouble
+ * Function: H5T__conv_ushort_ldouble
*
- * Purpose: Convert native unsigned short to native long double using
+ * Purpose: Convert native unsigned short to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7158,17 +7158,17 @@ H5T__conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(USHORT, LDOUBLE, unsigned short, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_float
+ * Function: H5T__conv_int_float
*
- * Purpose: Convert native integer to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native integer to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7180,17 +7180,17 @@ H5T__conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(INT, FLOAT, int, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_double
+ * Function: H5T__conv_int_double
*
- * Purpose: Convert native integer to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native integer to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7202,17 +7202,17 @@ H5T__conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(INT, DOUBLE, int, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_int_ldouble
+ * Function: H5T__conv_int_ldouble
*
- * Purpose: Convert native integer to native long double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native integer to native long double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7224,17 +7224,17 @@ H5T__conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(INT, LDOUBLE, int, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_float
+ * Function: H5T__conv_uint_float
*
- * Purpose: Convert native unsigned integer to native float using
+ * Purpose: Convert native unsigned integer to native float using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7246,17 +7246,17 @@ H5T__conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(UINT, FLOAT, unsigned int, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_double
+ * Function: H5T__conv_uint_double
*
- * Purpose: Convert native unsigned integer to native double using
+ * Purpose: Convert native unsigned integer to native double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7268,17 +7268,17 @@ H5T__conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(UINT, DOUBLE, unsigned int, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_uint_ldouble
+ * Function: H5T__conv_uint_ldouble
*
- * Purpose: Convert native unsigned integer to native long double using
+ * Purpose: Convert native unsigned integer to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7290,17 +7290,17 @@ H5T__conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(UINT, LDOUBLE, unsigned int, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_float
+ * Function: H5T__conv_long_float
*
- * Purpose: Convert native long to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native long to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7312,17 +7312,17 @@ H5T__conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(LONG, FLOAT, long, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_double
+ * Function: H5T__conv_long_double
*
- * Purpose: Convert native long to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native long to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7334,17 +7334,17 @@ H5T__conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(LONG, DOUBLE, long, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_long_ldouble
+ * Function: H5T__conv_long_ldouble
*
- * Purpose: Convert native long to native long double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native long to native long double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7356,17 +7356,17 @@ H5T__conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(LONG, LDOUBLE, long, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_float
+ * Function: H5T__conv_ulong_float
*
- * Purpose: Convert native unsigned long to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native unsigned long to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7378,17 +7378,17 @@ H5T__conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(ULONG, FLOAT, unsigned long, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_double
+ * Function: H5T__conv_ulong_double
*
- * Purpose: Convert native unsigned long to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native unsigned long to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7400,17 +7400,17 @@ H5T__conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(ULONG, DOUBLE, unsigned long, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ulong_ldouble
+ * Function: H5T__conv_ulong_ldouble
*
- * Purpose: Convert native unsigned long to native long double using
+ * Purpose: Convert native unsigned long to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7422,17 +7422,17 @@ H5T__conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(ULONG, LDOUBLE, unsigned long, long double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_float
+ * Function: H5T__conv_llong_float
*
- * Purpose: Convert native long long to native float using hardware.
- * This is a fast special case.
+ * Purpose: Convert native long long to native float using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7444,17 +7444,17 @@ H5T__conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(LLONG, FLOAT, long long, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_double
+ * Function: H5T__conv_llong_double
*
- * Purpose: Convert native long long to native double using hardware.
- * This is a fast special case.
+ * Purpose: Convert native long long to native double using hardware.
+ * This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7466,17 +7466,17 @@ H5T__conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(LLONG, DOUBLE, long long, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_llong_ldouble
+ * Function: H5T__conv_llong_ldouble
*
- * Purpose: Convert native long long to native long double using
+ * Purpose: Convert native long long to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7490,17 +7490,17 @@ H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
#endif /* H5T_CONV_INTERNAL_LLONG_LDOUBLE */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_float
+ * Function: H5T__conv_ullong_float
*
- * Purpose: Convert native unsigned long long to native float using
+ * Purpose: Convert native unsigned long long to native float using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7512,17 +7512,17 @@ H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(ULLONG, FLOAT, unsigned long long, float, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_double
+ * Function: H5T__conv_ullong_double
*
- * Purpose: Convert native unsigned long long to native double using
+ * Purpose: Convert native unsigned long long to native double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7534,17 +7534,17 @@ H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_CONV_xF(ULLONG, DOUBLE, unsigned long long, double, -, -);
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ullong_ldouble
+ * Function: H5T__conv_ullong_ldouble
*
- * Purpose: Convert native unsigned long long to native long double using
+ * Purpose: Convert native unsigned long long to native long double using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7558,17 +7558,17 @@ H5T__conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
#endif /*H5T_CONV_INTERNAL_ULLONG_LDOUBLE*/
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_schar
+ * Function: H5T__conv_float_schar
*
- * Purpose: Convert native float to native signed char using
+ * Purpose: Convert native float to native signed char using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7582,17 +7582,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_uchar
+ * Function: H5T__conv_float_uchar
*
- * Purpose: Convert native float to native unsigned char using
+ * Purpose: Convert native float to native unsigned char using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7606,17 +7606,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_schar
+ * Function: H5T__conv_double_schar
*
- * Purpose: Convert native double to native signed char using
+ * Purpose: Convert native double to native signed char using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7630,17 +7630,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_uchar
+ * Function: H5T__conv_double_uchar
*
- * Purpose: Convert native double to native unsigned char using
+ * Purpose: Convert native double to native unsigned char using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7654,17 +7654,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_schar
+ * Function: H5T__conv_ldouble_schar
*
- * Purpose: Convert native long double to native signed char using
+ * Purpose: Convert native long double to native signed char using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7678,17 +7678,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_uchar
+ * Function: H5T__conv_ldouble_uchar
*
- * Purpose: Convert native long double to native unsigned char using
+ * Purpose: Convert native long double to native unsigned char using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7702,17 +7702,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_short
+ * Function: H5T__conv_float_short
*
- * Purpose: Convert native float to native short using
+ * Purpose: Convert native float to native short using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7726,17 +7726,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_ushort
+ * Function: H5T__conv_float_ushort
*
- * Purpose: Convert native float to native unsigned short using
+ * Purpose: Convert native float to native unsigned short using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7750,17 +7750,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_short
+ * Function: H5T__conv_double_short
*
- * Purpose: Convert native double to native short using
+ * Purpose: Convert native double to native short using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7774,17 +7774,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_ushort
+ * Function: H5T__conv_double_ushort
*
- * Purpose: Convert native double to native unsigned short using
+ * Purpose: Convert native double to native unsigned short using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7798,17 +7798,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_short
+ * Function: H5T__conv_ldouble_short
*
- * Purpose: Convert native long double to native short using
+ * Purpose: Convert native long double to native short using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7822,17 +7822,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_ushort
+ * Function: H5T__conv_ldouble_ushort
*
- * Purpose: Convert native long double to native unsigned short using
+ * Purpose: Convert native long double to native unsigned short using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7846,17 +7846,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_int
+ * Function: H5T__conv_float_int
*
- * Purpose: Convert native float to native int using
+ * Purpose: Convert native float to native int using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7870,17 +7870,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_uint
+ * Function: H5T__conv_float_uint
*
- * Purpose: Convert native float to native unsigned int using
+ * Purpose: Convert native float to native unsigned int using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7894,17 +7894,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_int
+ * Function: H5T__conv_double_int
*
- * Purpose: Convert native double to native int using
+ * Purpose: Convert native double to native int using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7918,17 +7918,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_uint
+ * Function: H5T__conv_double_uint
*
- * Purpose: Convert native double to native unsigned int using
+ * Purpose: Convert native double to native unsigned int using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -7942,17 +7942,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_int
+ * Function: H5T__conv_ldouble_int
*
- * Purpose: Convert native long double to native int using
+ * Purpose: Convert native long double to native int using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7966,17 +7966,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_uint
+ * Function: H5T__conv_ldouble_uint
*
- * Purpose: Convert native long double to native unsigned int using
+ * Purpose: Convert native long double to native unsigned int using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -7990,17 +7990,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_long
+ * Function: H5T__conv_float_long
*
- * Purpose: Convert native float to native long using
+ * Purpose: Convert native float to native long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -8014,17 +8014,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_ulong
+ * Function: H5T__conv_float_ulong
*
- * Purpose: Convert native float to native unsigned long using
+ * Purpose: Convert native float to native unsigned long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -8038,17 +8038,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_long
+ * Function: H5T__conv_double_long
*
- * Purpose: Convert native double to native long using
+ * Purpose: Convert native double to native long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -8062,17 +8062,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_ulong
+ * Function: H5T__conv_double_ulong
*
- * Purpose: Convert native double to native unsigned long using
+ * Purpose: Convert native double to native unsigned long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -8086,17 +8086,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_long
+ * Function: H5T__conv_ldouble_long
*
- * Purpose: Convert native long double to native long using
+ * Purpose: Convert native long double to native long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -8110,17 +8110,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_ulong
+ * Function: H5T__conv_ldouble_ulong
*
- * Purpose: Convert native long double to native unsigned long using
+ * Purpose: Convert native long double to native unsigned long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -8134,17 +8134,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_llong
+ * Function: H5T__conv_float_llong
*
- * Purpose: Convert native float to native long long using
+ * Purpose: Convert native float to native long long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -8158,17 +8158,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_float_ullong
+ * Function: H5T__conv_float_ullong
*
- * Purpose: Convert native float to native unsigned long long using
+ * Purpose: Convert native float to native unsigned long long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -8182,17 +8182,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_llong
+ * Function: H5T__conv_double_llong
*
- * Purpose: Convert native double to native long long using
+ * Purpose: Convert native double to native long long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -8206,17 +8206,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_double_ullong
+ * Function: H5T__conv_double_ullong
*
- * Purpose: Convert native double to native unsigned long long using
+ * Purpose: Convert native double to native unsigned long long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, November 7, 2003
+ * Programmer: Raymond Lu
+ * Friday, November 7, 2003
*
*-------------------------------------------------------------------------
*/
@@ -8230,17 +8230,17 @@ H5_GCC_DIAG_OFF(float-equal)
H5_GCC_DIAG_ON(float-equal)
}
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_llong
+ * Function: H5T__conv_ldouble_llong
*
- * Purpose: Convert native long double to native long long using
+ * Purpose: Convert native long double to native long long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -8256,17 +8256,17 @@ H5_GCC_DIAG_ON(float-equal)
}
#endif /*H5T_CONV_INTERNAL_LDOUBLE_LLONG*/
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_ldouble_ullong
+ * Function: H5T__conv_ldouble_ullong
*
- * Purpose: Convert native long double to native unsigned long long using
+ * Purpose: Convert native long double to native unsigned long long using
* hardware. This is a fast special case.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Tuesday, Febuary 1, 2005
+ * Programmer: Raymond Lu
+ * Tuesday, Febuary 1, 2005
*
*-------------------------------------------------------------------------
*/
@@ -8282,18 +8282,18 @@ H5_GCC_DIAG_ON(float-equal)
}
#endif /*H5T_CONV_INTERNAL_LDOUBLE_ULLONG*/
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_f_i
+ * Function: H5T__conv_f_i
*
- * Purpose: Convert one floating-point type to an integer. This is
+ * Purpose: Convert one floating-point type to an integer. This is
* the catch-all function for float-integer conversions and
* is probably not particularly fast.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Wednesday, Jan 21, 2004
+ * Programmer: Raymond Lu
+ * Wednesday, Jan 21, 2004
*
* Raymond Lu
* Wednesday, April 21, 2004
@@ -8310,28 +8310,28 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
/* Traversal-related variables */
- H5T_t *src_p; /*source datatype */
- H5T_t *dst_p; /*destination datatype */
- H5T_atomic_t src; /*atomic source info */
- H5T_atomic_t dst; /*atomic destination info */
- int direction; /*forward or backward traversal */
- size_t elmtno; /*element number */
- size_t half_size; /*half the type size */
+ H5T_t *src_p; /*source datatype */
+ H5T_t *dst_p; /*destination datatype */
+ H5T_atomic_t src; /*atomic source info */
+ H5T_atomic_t dst; /*atomic destination info */
+ int direction; /*forward or backward traversal */
+ size_t elmtno; /*element number */
+ size_t half_size; /*half the type size */
size_t tsize; /*type size for swapping bytes */
- size_t olap; /*num overlapping elements */
- uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
+ size_t olap; /*num overlapping elements */
+ uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
uint8_t *src_rev=NULL; /*order-reversed source buffer */
- uint8_t dbuf[64]; /*temp destination buffer */
+ uint8_t dbuf[64]; /*temp destination buffer */
uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/
/* Conversion-related variables */
- hssize_t expo; /*source exponent */
+ hssize_t expo; /*source exponent */
hssize_t sign; /*source sign bit value */
uint8_t *int_buf=NULL; /*buffer for temporary value */
size_t buf_size; /*buffer size for temporary value */
- size_t i; /*miscellaneous counters */
- size_t first; /*first bit(MSB) in an integer */
- ssize_t sfirst; /*a signed version of `first' */
+ size_t i; /*miscellaneous counters */
+ size_t first; /*first bit(MSB) in an integer */
+ ssize_t sfirst; /*a signed version of `first' */
H5T_conv_cb_t cb_struct={NULL, NULL}; /*conversion callback structure */
hbool_t truncated; /*if fraction value is dropped */
hbool_t reverse; /*if reverse order of destination at the end */
@@ -8860,18 +8860,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_f_i() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T__conv_i_f
+ * Function: H5T__conv_i_f
*
- * Purpose: Convert one integer type to a floating-point type. This is
+ * Purpose: Convert one integer type to a floating-point type. This is
* the catch-all function for integer-float conversions and
* is probably not particularly fast.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
- * Friday, Feb 6, 2004
+ * Programmer: Raymond Lu
+ * Friday, Feb 6, 2004
*
*-------------------------------------------------------------------------
*/
@@ -8880,31 +8880,31 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
/* Traversal-related variables */
- H5T_t *src_p; /*source datatype */
- H5T_t *dst_p; /*destination datatype */
- H5T_atomic_t src; /*atomic source info */
- H5T_atomic_t dst; /*atomic destination info */
- int direction; /*forward or backward traversal */
- size_t elmtno; /*element number */
- size_t half_size; /*half the type size */
+ H5T_t *src_p; /*source datatype */
+ H5T_t *dst_p; /*destination datatype */
+ H5T_atomic_t src; /*atomic source info */
+ H5T_atomic_t dst; /*atomic destination info */
+ int direction; /*forward or backward traversal */
+ size_t elmtno; /*element number */
+ size_t half_size; /*half the type size */
size_t tsize; /*type size for swapping bytes */
- size_t olap; /*num overlapping elements */
- uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
+ size_t olap; /*num overlapping elements */
+ uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/
uint8_t *src_rev = NULL; /*order-reversed source buffer */
- uint8_t dbuf[64]; /*temp destination buffer */
+ uint8_t dbuf[64]; /*temp destination buffer */
uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/
/* Conversion-related variables */
- hsize_t expo; /*destination exponent */
- hsize_t expo_max; /*maximal possible exponent value */
+ hsize_t expo; /*destination exponent */
+ hsize_t expo_max; /*maximal possible exponent value */
size_t sign; /*source sign bit value */
hbool_t is_max_neg; /*source is maximal negative value*/
hbool_t do_round; /*whether there is roundup */
uint8_t *int_buf = NULL; /*buffer for temporary value */
size_t buf_size; /*buffer size for temporary value */
- size_t i; /*miscellaneous counters */
- size_t first; /*first bit(MSB) in an integer */
- ssize_t sfirst; /*a signed version of `first' */
+ size_t i; /*miscellaneous counters */
+ size_t first; /*first bit(MSB) in an integer */
+ ssize_t sfirst; /*a signed version of `first' */
H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */
H5T_conv_ret_t except_ret; /*return of callback function */
hbool_t reverse; /*if reverse the order of destination */
@@ -9036,12 +9036,12 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/*
* What is the bit position(starting from 0 as first one) for the most significant
- * bit(MSB) of S which is set?
+ * bit(MSB) of S which is set?
*/
if(H5T_SGN_2 == src.u.i.sign) {
sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, TRUE);
if(sign && sfirst < 0)
- /* The case 0x80...00, which is negative with maximal value */
+ /* The case 0x80...00, which is negative with maximal value */
is_max_neg = 1;
} else if(H5T_SGN_NONE == src.u.i.sign)
sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec, H5T_BIT_MSB, TRUE);
@@ -9060,10 +9060,10 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
H5T__bit_neg(int_buf, (size_t)0, buf_size * 8);
sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, TRUE);
} else {
- /* If it's maximal negative number 0x80...000, treat it as if it overflowed
- * (create a carry) to help conversion. i.e. a character type number 0x80
- * is treated as 0x100.
- */
+ /* If it's maximal negative number 0x80...000, treat it as if it overflowed
+ * (create a carry) to help conversion. i.e. a character type number 0x80
+ * is treated as 0x100.
+ */
sfirst = (ssize_t)(src.prec - 1);
is_max_neg = 0;
}
@@ -9072,7 +9072,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/* Sign bit has been negated if bit vector isn't 0x80...00. Set all bits in front of
* sign bit to 0 in the temporary buffer because they're all negated from the previous
- * step. */
+ * step. */
H5T__bit_set(int_buf, src.prec, (buf_size * 8) - src.prec, 0);
/* Set sign bit in destination */
@@ -9096,13 +9096,13 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
if (H5T_NORM_IMPLIED==dst.u.f.norm) {
/* Imply first bit */
H5T__bit_set(int_buf, first, (size_t)1, 0);
- } else if (H5T_NORM_NONE==dst.u.f.norm) {
- first++;
- }
+ } else if (H5T_NORM_NONE==dst.u.f.norm) {
+ first++;
+ }
/* Roundup for mantissa */
if(first > dst.u.f.msize) {
- /* If the bit sequence is bigger than the mantissa part, there'll be some
+ /* If the bit sequence is bigger than the mantissa part, there'll be some
* precision loss. Let user's handler deal with the case if it's present
*/
if(cb_struct.func) {
@@ -9117,15 +9117,15 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
} else if(except_ret == H5T_CONV_ABORT)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception")
- /* If user's exception handler does deal with it, we do it by dropping off the
- * extra bits at the end and do rounding. If we have .50...0(decimal) after radix
- * point, we do roundup when the least significant digit before radix is odd, we do
- * rounddown if it's even.
- */
+ /* If user's exception handler does deal with it, we do it by dropping off the
+ * extra bits at the end and do rounding. If we have .50...0(decimal) after radix
+ * point, we do roundup when the least significant digit before radix is odd, we do
+ * rounddown if it's even.
+ */
/* Check 1st dropoff bit, see if it's set. */
if(H5T__bit_get_d(int_buf, ((first - dst.u.f.msize) - 1), (size_t)1)) {
- /* Check all bits after 1st dropoff bit, see if any of them is set. */
+ /* Check all bits after 1st dropoff bit, see if any of them is set. */
if(((first - dst.u.f.msize) - 1) > 0 && H5T__bit_get_d(int_buf, (size_t)0, ((first - dst.u.f.msize) - 1)))
do_round = 1;
else { /* The .50...0 case */
@@ -9133,7 +9133,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
if(H5T__bit_get_d(int_buf, (first - dst.u.f.msize), (size_t)1))
do_round = 1;
}
- }
+ }
/* Right shift to drop off extra bits */
H5T__bit_shift(int_buf, (ssize_t)(dst.u.f.msize - first), (size_t)0, buf_size * 8);
@@ -9142,28 +9142,28 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
H5T__bit_inc(int_buf, (size_t)0, buf_size * 8);
do_round = 0;
- /* If integer is like 0x0ff...fff and we need to round up the
- * last f, we get 0x100...000. Treat this special case here.
- */
- if(H5T__bit_get_d(int_buf, dst.u.f.msize, (size_t)1)) {
- if (H5T_NORM_IMPLIED==dst.u.f.norm) {
- /* The bit at this 1's position was impled already, so this
- * number should be 0x200...000. We need to increment the
- * exponent in this case.
- */
- expo++;
- } else if (H5T_NORM_NONE==dst.u.f.norm) {
- /* Right shift 1 bit to let the carried 1 fit in the mantissa,
- * and increment exponent by 1.
- */
+ /* If integer is like 0x0ff...fff and we need to round up the
+ * last f, we get 0x100...000. Treat this special case here.
+ */
+ if(H5T__bit_get_d(int_buf, dst.u.f.msize, (size_t)1)) {
+ if (H5T_NORM_IMPLIED==dst.u.f.norm) {
+ /* The bit at this 1's position was impled already, so this
+ * number should be 0x200...000. We need to increment the
+ * exponent in this case.
+ */
+ expo++;
+ } else if (H5T_NORM_NONE==dst.u.f.norm) {
+ /* Right shift 1 bit to let the carried 1 fit in the mantissa,
+ * and increment exponent by 1.
+ */
H5T__bit_shift(int_buf, (ssize_t)-1, (size_t)0, buf_size * 8);
- expo++;
- }
- }
+ expo++;
+ }
+ }
}
} else {
/* The bit sequence can fit mantissa part. Left shift to fit in from high-order of
- * bit position. */
+ * bit position. */
H5T__bit_shift(int_buf, (ssize_t)(dst.u.f.msize - first), (size_t)0, dst.u.f.msize);
}
@@ -9273,11 +9273,11 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_i_f() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5T_reverse_order
+ * Function: H5T_reverse_order
*
- * Purpose: Internal assisting function to reverse the order of
+ * Purpose: Internal assisting function to reverse the order of
* a sequence of byte when it's big endian or VAX order.
* The byte sequence simulates the endian order.
*
@@ -9285,8 +9285,8 @@ done:
*
* Failure: Null
*
- * Programmer: Raymond Lu
- * April 26, 2004
+ * Programmer: Raymond Lu
+ * April 26, 2004
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Torder.c b/src/H5Torder.c
index 462b732..ca00555 100644
--- a/src/H5Torder.c
+++ b/src/H5Torder.c
@@ -199,7 +199,7 @@ done:
herr_t
H5Tset_order(hid_t type_id, H5T_order_t order)
{
- H5T_t *dt; /* Datatype to modify */
+ H5T_t *dt = NULL; /* Datatype to modify */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -207,15 +207,15 @@ H5Tset_order(hid_t type_id, H5T_order_t order)
/* Check args */
if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype")
if(order < H5T_ORDER_LE || order > H5T_ORDER_NONE || order == H5T_ORDER_MIXED)
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "illegal byte order")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "illegal byte order")
if(H5T_STATE_TRANSIENT != dt->shared->state)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype is read-only")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype is read-only")
/* Call internal routine to set the order */
if(H5T_set_order(dt, order) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "can't set order")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "can't set order")
done:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index e1b996c..05879ff 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -167,7 +167,7 @@ struct H5T_path_t {
char name[H5T_NAMELEN]; /*name for debugging only */
H5T_t *src; /*source datatype */
H5T_t *dst; /*destination datatype */
- H5T_conv_func_t conv; /* Conversion funcion */
+ H5T_conv_func_t conv; /* Conversion function */
hbool_t is_hard; /*is it a hard function? */
hbool_t is_noop; /*is it the noop conversion? */
hbool_t are_compounds; /*are source and dest both compounds?*/
diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h
index 0df05f0..a2a44fa 100644
--- a/src/H5Zpublic.h
+++ b/src/H5Zpublic.h
@@ -25,7 +25,7 @@
* Filter identifiers. Values 0 through 255 are for filters defined by the
* HDF5 library. Values 256 through 511 are available for testing new
* filters. Subsequent values should be obtained from the HDF5 development
- * team at hdf5dev@ncsa.uiuc.edu. These values will never change because they
+ * team at help@hdfgroup.org. These values will never change because they
* appear in the HDF5 files.
*/
typedef int H5Z_filter_t;
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index cdf31a4..0026749 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -1174,6 +1174,8 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
/* special case: minbits equal to full precision */
if(minbits == p.size * 8) {
HDmemcpy(outbuf, (unsigned char*)(*buf)+buf_offset, size_out);
+ /* free the original buffer */
+ H5MM_xfree(*buf);
/* convert to dataset datatype endianness order if needed */
if(need_convert)
@@ -1272,6 +1274,9 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
/* special case: minbits equal to full precision */
if(minbits == p.size * 8) {
HDmemcpy(outbuf + buf_offset, *buf, nbytes);
+ /* free the original buffer */
+ H5MM_xfree(*buf);
+
*buf = outbuf;
outbuf = NULL;
*buf_size = size_out;
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index 67646a0..f8fc325 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -850,7 +850,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers)
if (!factor)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node")
- sscanf(current->tok_begin, "%ld", &factor->value.int_val);
+ HDsscanf(current->tok_begin, "%ld", &factor->value.int_val);
break;
case H5Z_XFORM_FLOAT:
@@ -858,7 +858,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers)
if (!factor)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node")
- sscanf(current->tok_begin, "%lf", &factor->value.float_val);
+ HDsscanf(current->tok_begin, "%lf", &factor->value.float_val);
break;
case H5Z_XFORM_SYMBOL:
diff --git a/src/H5config.h.in b/src/H5config.h.in
index 738e94e..6e296a1 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -91,6 +91,9 @@
/* Define if the function stack tracing code is to be compiled in */
#undef HAVE_CODESTACK
+/* Define to 1 if you have the <curl/curl.h> header file. */
+#undef HAVE_CURL_CURL_H
+
/* Define if Darwin or Mac OS X */
#undef HAVE_DARWIN
@@ -163,6 +166,9 @@
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
+/* Define to 1 if you have the <hdfs.h> header file. */
+#undef HAVE_HDFS_H
+
/* Define if the compiler understands inline */
#undef HAVE_INLINE
@@ -179,12 +185,24 @@
/* Define to 1 if you have the <io.h> header file. */
#undef HAVE_IO_H
+/* Define to 1 if you have the `crypto' library (-lcrypto). */
+#undef HAVE_LIBCRYPTO
+
+/* Define to 1 if you have the `curl' library (-lcurl). */
+#undef HAVE_LIBCURL
+
/* Define to 1 if you have the `dl' library (-ldl). */
#undef HAVE_LIBDL
/* Define to 1 if you have the `dmalloc' library (-ldmalloc). */
#undef HAVE_LIBDMALLOC
+/* Proceed to build with libhdfs */
+#undef HAVE_LIBHDFS
+
+/* Define to 1 if you have the `jvm' library (-ljvm). */
+#undef HAVE_LIBJVM
+
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
@@ -239,6 +257,15 @@
/* Define if MPI_Info_c2f and MPI_Info_f2c exist */
#undef HAVE_MPI_MULTI_LANG_Info
+/* Define to 1 if you have the <openssl/evp.h> header file. */
+#undef HAVE_OPENSSL_EVP_H
+
+/* Define to 1 if you have the <openssl/hmac.h> header file. */
+#undef HAVE_OPENSSL_HMAC_H
+
+/* Define to 1 if you have the <openssl/sha.h> header file. */
+#undef HAVE_OPENSSL_SHA_H
+
/* Define if we have parallel support */
#undef HAVE_PARALLEL
@@ -257,6 +284,10 @@
/* Define to 1 if you have the `rand_r' function. */
#undef HAVE_RAND_R
+/* Define whether the Read-Only S3 virtual file driver (VFD) should be
+ compiled */
+#undef HAVE_ROS3_VFD
+
/* Define to 1 if you have the `round' function. */
#undef HAVE_ROUND
diff --git a/src/H5dbg.c b/src/H5dbg.c
index dd50034..214d865 100644
--- a/src/H5dbg.c
+++ b/src/H5dbg.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5dbg.c
- * Mar 4 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Created: H5dbg.c
+ * Mar 4 2006
+ * Quincey Koziol <koziol@ncsa.uiuc.edu>
*
- * Purpose: Generic debugging routines
+ * Purpose: Generic debugging routines
*
*-------------------------------------------------------------------------
*/
@@ -29,7 +29,7 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
/****************/
/* Local Macros */
@@ -61,17 +61,17 @@
/*******************/
-
+
/*-------------------------------------------------------------------------
- * Function: H5_buffer_dump
+ * Function: H5_buffer_dump
*
- * Purpose: Dumps a buffer of memory in an octal dump form
+ * Purpose: Dumps a buffer of memory in an octal dump form
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Mar 4 2006
+ * Programmer: Quincey Koziol
+ * koziol@ncsa.uiuc.edu
+ * Mar 4 2006
*
*-------------------------------------------------------------------------
*/
@@ -79,7 +79,7 @@ herr_t
H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf,
const uint8_t *marker, size_t buf_offset, size_t buf_size)
{
- size_t u, v; /* Local index variable */
+ size_t u, v; /* Local index variable */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -96,47 +96,47 @@ H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf,
* Print the buffer in a VMS-style octal dump.
*/
HDfprintf(stream, "%*sData follows (`__' indicates free region)...\n",
- indent, "");
+ indent, "");
for(u = 0; u < buf_size; u += 16) {
- uint8_t c;
+ uint8_t c;
- HDfprintf(stream, "%*s %8d: ", indent, "", u + buf_offset);
+ HDfprintf(stream, "%*s %8d: ", indent, "", u + buf_offset);
/* Print the hex values */
- for(v = 0; v < 16; v++) {
- if(u + v < buf_size) {
- if(marker[u + v])
- HDfprintf(stream, "__ ");
- else {
- c = buf[buf_offset + u + v];
- HDfprintf(stream, "%02x ", c);
- } /* end else */
- } /* end if */
+ for(v = 0; v < 16; v++) {
+ if(u + v < buf_size) {
+ if(marker[u + v])
+ HDfprintf(stream, "__ ");
+ else {
+ c = buf[buf_offset + u + v];
+ HDfprintf(stream, "%02x ", c);
+ } /* end else */
+ } /* end if */
else
- fprintf(stream, " ");
- if(7 == v)
- HDfputc(' ', stream);
- } /* end for */
+ HDfprintf(stream, " ");
+ if(7 == v)
+ HDfputc(' ', stream);
+ } /* end for */
HDfputc(' ', stream);
/* Print the character values */
- for(v = 0; v < 16; v++) {
- if(u + v < buf_size) {
- if(marker[u + v])
- HDfputc(' ', stream);
- else {
- c = buf[buf_offset + u + v];
- if(HDisprint(c))
- HDfputc(c, stream);
- else
- HDfputc('.', stream);
- } /* end else */
- } /* end if */
- if(7 == v)
- HDfputc(' ', stream);
- } /* end for */
-
- HDfputc('\n', stream);
+ for(v = 0; v < 16; v++) {
+ if(u + v < buf_size) {
+ if(marker[u + v])
+ HDfputc(' ', stream);
+ else {
+ c = buf[buf_offset + u + v];
+ if(HDisprint(c))
+ HDfputc(c, stream);
+ else
+ HDfputc('.', stream);
+ } /* end else */
+ } /* end if */
+ if(7 == v)
+ HDfputc(' ', stream);
+ } /* end for */
+
+ HDfputc('\n', stream);
} /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/src/H5detect.c b/src/H5detect.c
index 4424009..c744c39 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -43,6 +43,9 @@ static const char *FileHeader = "\n\
*/
#undef NDEBUG
#include "H5private.h"
+/* Do NOT use HDfprintf in this file as it is not linked with the library,
+ * which contains the H5system.c file in which the function is defined.
+ */
#include "H5Tpublic.h"
#include "H5Rpublic.h"
@@ -150,7 +153,7 @@ static H5JMP_BUF jbuf_g;
#endif
-
+
/*-------------------------------------------------------------------------
* Function: precision
*
@@ -203,7 +206,7 @@ precision (detected_t *d)
}
}
-
+
/*-------------------------------------------------------------------------
* Function: DETECT_I/DETECT_BYTE
*
@@ -277,7 +280,7 @@ precision (detected_t *d)
DETECT_I_BYTE_CORE(TYPE,VAR,INFO,TYPE) \
}
-
+
/*-------------------------------------------------------------------------
* Function: DETECT_F
*
@@ -374,7 +377,7 @@ precision (detected_t *d)
} \
}
-
+
/*-------------------------------------------------------------------------
* Function: DETECT_M
*
@@ -450,7 +453,7 @@ precision (detected_t *d)
#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
-
+
/*-------------------------------------------------------------------------
* Function: sigsegv_handler
*
@@ -483,7 +486,7 @@ sigsegv_handler(int H5_ATTR_UNUSED signo)
#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
-
+
/*-------------------------------------------------------------------------
* Function: sigbus_handler
*
@@ -516,7 +519,7 @@ sigbus_handler(int H5_ATTR_UNUSED signo)
#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
-
+
/*-------------------------------------------------------------------------
* Function: sigill_handler
*
@@ -547,7 +550,7 @@ sigill_handler(int H5_ATTR_UNUSED signo)
}
#endif
-
+
/*-------------------------------------------------------------------------
* Function: print_results
*
@@ -826,7 +829,7 @@ done:\n\
fprintf(rawoutstream, "/* sigill_handler called: %d times */\n", sigill_handler_called_g);
} /* end print_results() */
-
+
/*-------------------------------------------------------------------------
* Function: iprint
*
@@ -916,7 +919,7 @@ iprint(detected_t *d)
}
-
+
/*-------------------------------------------------------------------------
* Function: byte_cmp
*
@@ -943,7 +946,7 @@ byte_cmp(int n, const void *_a, const void *_b, const unsigned char *pad_mask)
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: bit_cmp
*
@@ -984,7 +987,7 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b,
return 0;
}
-
+
/*-------------------------------------------------------------------------
* Function: fix_order
*
@@ -1052,7 +1055,7 @@ fix_order(int n, int last, int *perm, const char **mesg)
}
}
-
+
/*-------------------------------------------------------------------------
* Function: imp_bit
*
@@ -1106,7 +1109,7 @@ imp_bit(unsigned int n, int *perm, void *_a, void *_b, const unsigned char *pad_
return (a[perm[major]] >> minor) & 0x01 ? 0 : 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: find_bias
*
@@ -1137,7 +1140,7 @@ find_bias(unsigned int epos, unsigned int esize, int *perm, void *_a)
return bias;
}
-
+
/*-------------------------------------------------------------------------
* Function: print_header
*
@@ -1278,7 +1281,7 @@ bit.\n";
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C89_integers
*
@@ -1300,7 +1303,7 @@ detect_C89_integers(void)
DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++;
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C89_floats
*
@@ -1316,7 +1319,7 @@ detect_C89_floats(void)
DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++;
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers8
*
@@ -1372,7 +1375,7 @@ detect_C99_integers8(void)
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers16
*
@@ -1404,7 +1407,7 @@ detect_C99_integers16(void)
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers32
*
@@ -1436,7 +1439,7 @@ detect_C99_integers32(void)
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers64
*
@@ -1482,7 +1485,7 @@ detect_C99_integers64(void)
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers
*
@@ -1502,7 +1505,7 @@ detect_C99_integers(void)
detect_C99_integers64();
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_floats
*
@@ -1527,7 +1530,7 @@ detect_C99_floats(void)
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_alignments
*
@@ -1604,7 +1607,7 @@ static int verify_signal_handlers(int signum, void (*handler)(int))
}
#endif
-
+
/*-------------------------------------------------------------------------
* Function: main
*
diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c
index da7c8d9..fd67184 100644
--- a/src/H5make_libsettings.c
+++ b/src/H5make_libsettings.c
@@ -35,12 +35,15 @@ static const char *FileHeader = "\n\
#include <stdio.h>
#include <time.h>
#include "H5private.h"
+/* Do NOT use HDfprintf in this file as it is not linked with the library,
+ * which contains the H5system.c file in which the function is defined.
+ */
#define LIBSETTINGSFNAME "libhdf5.settings"
FILE *rawoutstream = NULL;
-
+
/*-------------------------------------------------------------------------
* Function: insert_libhdf5_settings
*
@@ -105,7 +108,7 @@ insert_libhdf5_settings(FILE *flibinfo)
#endif
} /* insert_libhdf5_settings() */
-
+
/*-------------------------------------------------------------------------
* Function: make_libinfo
*
@@ -123,7 +126,7 @@ make_libinfo(void)
insert_libhdf5_settings(rawoutstream);
}
-
+
/*-------------------------------------------------------------------------
* Function: print_header
*
@@ -229,7 +232,7 @@ information about the library build configuration\n";
fprintf(rawoutstream, "\n */\n\n");
}
-
+
/*-------------------------------------------------------------------------
* Function: print_footer
*
@@ -244,7 +247,7 @@ print_footer(void)
/* nothing */
}
-
+
/*-------------------------------------------------------------------------
* Function: main
*
diff --git a/src/H5private.h b/src/H5private.h
index 4f5323a..0eb0b0c 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -313,6 +313,11 @@
# define H5_ATTR_NORETURN __attribute__((noreturn))
# define H5_ATTR_CONST __attribute__((const))
# define H5_ATTR_PURE __attribute__((pure))
+#if defined(__GNUC__) && __GNUC__ >= 7 && !defined(__INTEL_COMPILER)
+# define H5_ATTR_FALLTHROUGH __attribute__((fallthrough));
+#else
+# define H5_ATTR_FALLTHROUGH /*void*/
+#endif
#else
# define H5_ATTR_FORMAT(X,Y,Z) /*void*/
# define H5_ATTR_UNUSED /*void*/
@@ -1332,8 +1337,9 @@ typedef off_t h5_stat_size_t;
#define HDsrandom(S) srand(S)
#endif /* HDsrandom */
#endif /* H5_HAVE_RAND_R */
-/* sscanf() variable arguments */
-
+#ifndef HDsscanf
+ #define HDsscanf(S,FMT,...) sscanf(S,FMT,__VA_ARGS__)
+#endif /* HDsscanf */
#ifndef HDstrcat
#define HDstrcat(X,Y) strcat(X,Y)
#endif /* HDstrcat */
@@ -1391,6 +1397,9 @@ typedef off_t h5_stat_size_t;
#ifndef HDstrtok
#define HDstrtok(X,Y) strtok(X,Y)
#endif /* HDstrtok */
+#ifndef HDstrtok_r
+ #define HDstrtok_r(X,Y,Z) strtok_r(X,Y,Z)
+#endif /* HDstrtok */
#ifndef HDstrtol
#define HDstrtol(S,R,N) strtol(S,R,N)
#endif /* HDstrtol */
@@ -1493,6 +1502,9 @@ typedef off_t h5_stat_size_t;
#ifndef HDva_arg
#define HDva_arg(A,T) va_arg(A,T)
#endif /* HDva_arg */
+#ifndef HDva_copy
+#define HDva_copy(D,S) va_copy(D,S)
+#endif /* HDva_copy */
#ifndef HDva_end
#define HDva_end(A) va_end(A)
#endif /* HDva_end */
@@ -1998,7 +2010,6 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
H5_DLL herr_t H5CX_push(void);
H5_DLL herr_t H5CX_pop(void);
-
#ifndef NDEBUG
#define FUNC_ENTER_CHECK_NAME(asrt) \
{ \
@@ -2037,7 +2048,7 @@ H5_DLL herr_t H5CX_pop(void);
/* Local variables for API routines */
#define FUNC_ENTER_API_VARS \
MPE_LOG_VARS \
- H5TRACE_DECL \
+ H5TRACE_DECL
#define FUNC_ENTER_API_COMMON \
FUNC_ENTER_API_VARS \
diff --git a/src/H5public.h b/src/H5public.h
index a25bed9..90c74ba 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -57,6 +57,9 @@
# include <stddef.h>
#endif
#ifdef H5_HAVE_PARALLEL
+/* Don't link against MPI C++ bindings */
+# define MPICH_SKIP_MPICXX 1
+# define OMPI_SKIP_MPICXX 1
# include <mpi.h>
#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */
# include <mpio.h>
@@ -93,10 +96,10 @@ extern "C" {
/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 10 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 5 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_RELEASE 6 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */
/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.10.5" /* Full version string */
+#define H5_VERS_INFO "HDF5 library version: 1.10.6" /* Full version string */
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
H5_VERS_RELEASE)
diff --git a/src/H5system.c b/src/H5system.c
index 186d8fa..384360d 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -95,12 +95,16 @@ static hbool_t H5_ntzset = FALSE;
* Programmer: Robb Matzke
* Thursday, April 9, 1998
*
- * Modifications:
- * Robb Matzke, 1999-07-27
- * The `%a' format refers to an argument of `haddr_t' type
- * instead of `haddr_t*' and the return value is correct.
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the fprintf() calls with
+ * format_templ in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
int
HDfprintf(FILE *stream, const char *fmt, ...)
{
@@ -121,7 +125,7 @@ HDfprintf(FILE *stream, const char *fmt, ...)
HDassert(stream);
HDassert(fmt);
- va_start (ap, fmt);
+ HDva_start (ap, fmt);
while (*fmt) {
fwidth = prec = 0;
zerofill = 0;
@@ -170,7 +174,7 @@ HDfprintf(FILE *stream, const char *fmt, ...)
s = rest;
} /* end if */
else if ('*'==*s) {
- fwidth = va_arg(ap, int);
+ fwidth = HDva_arg(ap, int);
if(fwidth < 0) {
leftjust = 1;
fwidth = -fwidth;
@@ -185,7 +189,7 @@ HDfprintf(FILE *stream, const char *fmt, ...)
prec = (int)HDstrtol(s, &rest, 10);
s = rest;
} else if('*'==*s) {
- prec = va_arg(ap, int);
+ prec = HDva_arg(ap, int);
s++;
}
if(prec < 1)
@@ -272,16 +276,16 @@ HDfprintf(FILE *stream, const char *fmt, ...)
case 'd':
case 'i':
if(!HDstrcmp(modifier, "h")) {
- short x = (short)va_arg(ap, int);
+ short x = (short)HDva_arg(ap, int);
n = fprintf(stream, format_templ, x);
} else if(!*modifier) {
- int x = va_arg(ap, int);
+ int x = HDva_arg(ap, int);
n = fprintf(stream, format_templ, x);
} else if(!HDstrcmp(modifier, "l")) {
- long x = va_arg(ap, long);
+ long x = HDva_arg(ap, long);
n = fprintf(stream, format_templ, x);
} else {
- int64_t x = va_arg(ap, int64_t);
+ int64_t x = HDva_arg(ap, int64_t);
n = fprintf(stream, format_templ, x);
}
break;
@@ -291,16 +295,16 @@ HDfprintf(FILE *stream, const char *fmt, ...)
case 'x':
case 'X':
if(!HDstrcmp(modifier, "h")) {
- unsigned short x = (unsigned short)va_arg(ap, unsigned int);
+ unsigned short x = (unsigned short)HDva_arg(ap, unsigned int);
n = fprintf(stream, format_templ, x);
} else if(!*modifier) {
- unsigned int x = va_arg(ap, unsigned int); /*lint !e732 Loss of sign not really occurring */
+ unsigned int x = HDva_arg(ap, unsigned int);
n = fprintf(stream, format_templ, x);
} else if(!HDstrcmp(modifier, "l")) {
- unsigned long x = va_arg(ap, unsigned long); /*lint !e732 Loss of sign not really occurring */
+ unsigned long x = HDva_arg(ap, unsigned long);
n = fprintf(stream, format_templ, x);
} else {
- uint64_t x = va_arg(ap, uint64_t); /*lint !e732 Loss of sign not really occurring */
+ uint64_t x = HDva_arg(ap, uint64_t);
n = fprintf(stream, format_templ, x);
}
break;
@@ -311,10 +315,10 @@ HDfprintf(FILE *stream, const char *fmt, ...)
case 'g':
case 'G':
if(!HDstrcmp(modifier, "h")) {
- float x = (float)va_arg(ap, double);
+ float x = (float)HDva_arg(ap, double);
n = fprintf(stream, format_templ, (double)x);
} else if(!*modifier || !HDstrcmp(modifier, "l")) {
- double x = va_arg(ap, double);
+ double x = HDva_arg(ap, double);
n = fprintf(stream, format_templ, x);
} else {
/*
@@ -322,10 +326,10 @@ HDfprintf(FILE *stream, const char *fmt, ...)
* `double' are the same thing.
*/
#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
- long double x = va_arg(ap, long double);
+ long double x = HDva_arg(ap, long double);
n = fprintf(stream, format_templ, x);
#else
- double x = va_arg(ap, double);
+ double x = HDva_arg(ap, double);
n = fprintf(stream, format_templ, x);
#endif
}
@@ -333,7 +337,7 @@ HDfprintf(FILE *stream, const char *fmt, ...)
case 'a':
{
- haddr_t x = va_arg(ap, haddr_t); /*lint !e732 Loss of sign not really occurring */
+ haddr_t x = HDva_arg(ap, haddr_t);
if(H5F_addr_defined(x)) {
len = 0;
@@ -379,7 +383,7 @@ HDfprintf(FILE *stream, const char *fmt, ...)
case 'c':
{
- char x = (char)va_arg(ap, int);
+ char x = (char)HDva_arg(ap, int);
n = fprintf(stream, format_templ, x);
}
break;
@@ -387,7 +391,7 @@ HDfprintf(FILE *stream, const char *fmt, ...)
case 's':
case 'p':
{
- char *x = va_arg(ap, char*); /*lint !e64 Type mismatch not really occurring */
+ char *x = HDva_arg(ap, char*);
n = fprintf(stream, format_templ, x);
}
break;
@@ -399,7 +403,7 @@ HDfprintf(FILE *stream, const char *fmt, ...)
case 't':
{
- htri_t tri_var = va_arg(ap, htri_t);
+ htri_t tri_var = HDva_arg(ap, htri_t);
if(tri_var > 0)
fprintf(stream, "TRUE");
@@ -423,9 +427,10 @@ HDfprintf(FILE *stream, const char *fmt, ...)
nout++;
}
}
- va_end(ap);
+ HDva_end(ap);
return nout;
} /* end HDfprintf() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
@@ -492,7 +497,8 @@ HDstrtoll(const char *s, const char **rest, int base)
/* Optional minus or plus sign */
if ('+'==*s) {
s++;
- } else if ('-'==*s) {
+ }
+ else if ('-'==*s) {
sign = -1;
s++;
}
@@ -501,10 +507,12 @@ HDstrtoll(const char *s, const char **rest, int base)
if (0==base && '0'==*s && ('x'==s[1] || 'X'==s[1])) {
base = 16;
s += 2;
- } else if (0==base && '0'==*s) {
+ }
+ else if (0==base && '0'==*s) {
base = 8;
s++;
- } else if (0==base) {
+ }
+ else if (0==base) {
base = 10;
}
@@ -525,7 +533,8 @@ HDstrtoll(const char *s, const char **rest, int base)
if (acc*base+digit < acc) {
overflow = TRUE;
- } else {
+ }
+ else {
acc = acc*base + digit;
}
}
@@ -536,7 +545,8 @@ HDstrtoll(const char *s, const char **rest, int base)
if (overflow) {
if (sign>0) {
acc = ((uint64_t)1<<(8*sizeof(int64_t)-1))-1;
- } else {
+ }
+ else {
acc = (int64_t)((uint64_t)1<<(8*sizeof(int64_t)-1));
}
errno = ERANGE;
@@ -621,7 +631,7 @@ Pflock(int fd, int operation) {
flk.l_pid = 0; /* not used with set */
/* Lock or unlock */
- if(HDfcntl(fd, F_SETLK, flk) < 0)
+ if(HDfcntl(fd, F_SETLK, &flk) < 0)
return -1;
return 0;
@@ -843,9 +853,9 @@ int c99_snprintf(char* str, size_t size, const char* format, ...)
int count;
va_list ap;
- va_start(ap, format);
+ HDva_start(ap, format);
count = c99_vsnprintf(str, size, format, ap);
- va_end(ap);
+ HDva_end(ap);
return count;
}
@@ -980,6 +990,132 @@ Wroundf(float arg)
return (float)(arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F));
}
+/*-------------------------------------------------------------------------
+* Function: H5_get_utf16_str
+*
+* Purpose: Gets a UTF-16 string from an UTF-8 (or ASCII) string.
+*
+* Return: Success: A pointer to a UTF-16 string
+* This must be freed by the caller using H5MM_xfree()
+* Failure: NULL
+*
+* Programmer: Dana Robinson
+* Spring 2019
+*
+*-------------------------------------------------------------------------
+*/
+const wchar_t *
+H5_get_utf16_str(const char *s)
+{
+ int nwchars = -1; /* Length of the UTF-16 buffer */
+ wchar_t *ret_s = NULL; /* UTF-16 version of the string */
+
+ /* Get the number of UTF-16 characters needed */
+ if(0 == (nwchars = MultiByteToWideChar(CP_UTF8, 0, s, -1, NULL, 0)))
+ goto error;
+
+ /* Allocate a buffer for the UTF-16 string */
+ if(NULL == (ret_s = (wchar_t *)H5MM_calloc(sizeof(wchar_t) * (size_t)nwchars)))
+ goto error;
+
+ /* Convert the input UTF-8 string to UTF-16 */
+ if(0 == MultiByteToWideChar(CP_UTF8, 0, s, -1, ret_s, nwchars))
+ goto error;
+
+ return ret_s;
+
+error:
+ if(ret_s)
+ H5MM_xfree((void *)ret_s);
+ return NULL;
+} /* end H5_get_utf16_str() */
+
+/*-------------------------------------------------------------------------
+ * Function: Wopen_utf8
+ *
+ * Purpose: UTF-8 equivalent of open(2) for use on Windows.
+ * Converts a UTF-8 input path to UTF-16 and then opens the
+ * file via _wopen() under the hood
+ *
+ * Return: Success: A POSIX file descriptor
+ * Failure: -1
+ *
+ * Programmer: Dana Robinson
+ * Spring 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+Wopen_utf8(const char *path, int oflag, ...)
+{
+ int fd = -1; /* POSIX file descriptor to be returned */
+ wchar_t *wpath = NULL; /* UTF-16 version of the path */
+ int pmode = 0; /* mode (optionally set via variable args) */
+
+ /* Convert the input UTF-8 path to UTF-16 */
+ if(NULL == (wpath = H5_get_utf16_str(path)))
+ goto done;
+
+ /* _O_BINARY must be set in Windows to avoid CR-LF <-> LF EOL
+ * transformations when performing I/O. Note that this will
+ * produce Unix-style text files, though.
+ */
+ oflag |= _O_BINARY;
+
+ /* Get the mode, if O_CREAT was specified */
+ if(oflag & O_CREAT) {
+ va_list vl;
+
+ HDva_start(vl, oflag);
+ pmode = HDva_arg(vl, int);
+ HDva_end(vl);
+ }
+
+ /* Open the file */
+ fd = _wopen(wpath, oflag, pmode);
+
+done:
+ if(wpath)
+ H5MM_xfree((void *)wpath);
+
+ return fd;
+} /* end Wopen_utf8() */
+
+/*-------------------------------------------------------------------------
+ * Function: Wremove_utf8
+ *
+ * Purpose: UTF-8 equivalent of remove(3) for use on Windows.
+ * Converts a UTF-8 input path to UTF-16 and then opens the
+ * file via _wremove() under the hood
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Dana Robinson
+ * Spring 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+Wremove_utf8(const char *path)
+{
+ wchar_t *wpath = NULL; /* UTF-16 version of the path */
+ int ret;
+
+ /* Convert the input UTF-8 path to UTF-16 */
+ if(NULL == (wpath = H5_get_utf16_str(path)))
+ goto done;
+
+ /* Open the file */
+ ret = _wremove(wpath);
+
+done:
+ if(wpath)
+ H5MM_xfree((void *)wpath);
+
+ return ret;
+} /* end Wremove_utf8() */
+
#endif /* H5_HAVE_WIN32_API */
@@ -1125,13 +1261,13 @@ H5_combine_path(const char* path1, const char* path2, char **full_name /*out*/)
FUNC_ENTER_NOAPI_NOINIT
- HDassert(path1);
HDassert(path2);
- path1_len = HDstrlen(path1);
+ if(path1)
+ path1_len = HDstrlen(path1);
path2_len = HDstrlen(path2);
- if(*path1 == '\0' || H5_CHECK_ABSOLUTE(path2)) {
+ if(path1 == NULL || *path1 == '\0' || H5_CHECK_ABSOLUTE(path2)) {
/* If path1 is empty or path2 is absolute, simply use path2 */
if(NULL == (*full_name = (char *)H5MM_strdup(path2)))
@@ -1165,11 +1301,11 @@ H5_combine_path(const char* path1, const char* path2, char **full_name /*out*/)
* Allocate a buffer to hold path1 + path2 + possibly the delimiter
* + terminating null byte
*/
- if(NULL == (*full_name = (char *)H5MM_malloc(path1_len + path2_len + 2)))
+ if(NULL == (*full_name = (char *)H5MM_malloc(path1_len + path2_len + 2 + 2))) /* Extra "+2" to quiet GCC warning - 2019/07/05, QAK */
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer")
/* Compose the full file name */
- HDsnprintf(*full_name, (path1_len + path2_len + 2), "%s%s%s", path1,
+ HDsnprintf(*full_name, (path1_len + path2_len + 2 + 2), "%s%s%s", path1, /* Extra "+2" to quiet GCC warning - 2019/07/05, QAK */
(H5_CHECK_DELIMITER(path1[path1_len - 1]) ? "" : H5_DIR_SEPS), path2);
} /* end else */
diff --git a/src/H5timer.c b/src/H5timer.c
index 0ba8bd1..a9ad519 100644
--- a/src/H5timer.c
+++ b/src/H5timer.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5timer.c
- * Aug 21 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5timer.c
+ * Aug 21 2006
+ * Quincey Koziol <koziol@hdfgroup.org>
*
- * Purpose: Internal 'timer' routines & support routines.
+ * Purpose: Internal 'timer' routines & support routines.
*
*-------------------------------------------------------------------------
*/
@@ -30,7 +30,7 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
/* We need this for the struct rusage declaration */
#if defined(H5_HAVE_GETRUSAGE) && defined(H5_HAVE_SYS_RESOURCE_H)
@@ -76,16 +76,16 @@
/* Local Variables */
/*******************/
-
+
/*-------------------------------------------------------------------------
- * Function: H5_timer_reset
+ * Function: H5_timer_reset
*
- * Purpose: Resets the timer struct to zero. Use this to reset a timer
- * that's being used as an accumulator for summing times.
+ * Purpose: Resets the timer struct to zero. Use this to reset a timer
+ * that's being used as an accumulator for summing times.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, April 16, 1998
*
*-------------------------------------------------------------------------
@@ -97,15 +97,15 @@ H5_timer_reset (H5_timer_t *timer)
HDmemset(timer, 0, sizeof *timer);
} /* end H5_timer_reset() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5_timer_begin
+ * Function: H5_timer_begin
*
- * Purpose: Initialize a timer to time something.
+ * Purpose: Initialize a timer to time something.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, April 16, 1998
*
*-------------------------------------------------------------------------
@@ -114,10 +114,10 @@ void
H5_timer_begin (H5_timer_t *timer)
{
#ifdef H5_HAVE_GETRUSAGE
- struct rusage rusage;
+ struct rusage rusage;
#endif
#ifdef H5_HAVE_GETTIMEOFDAY
- struct timeval etime;
+ struct timeval etime;
#endif
HDassert(timer);
@@ -140,18 +140,18 @@ H5_timer_begin (H5_timer_t *timer)
#endif
} /* end H5_timer_begin() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5_timer_end
+ * Function: H5_timer_end
*
- * Purpose: This function should be called at the end of a timed region.
- * The SUM is an optional pointer which will accumulate times.
- * TMS is the same struct that was passed to H5_timer_start().
- * On return, TMS will contain total times for the timed region.
+ * Purpose: This function should be called at the end of a timed region.
+ * The SUM is an optional pointer which will accumulate times.
+ * TMS is the same struct that was passed to H5_timer_start().
+ * On return, TMS will contain total times for the timed region.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, April 16, 1998
*
*-------------------------------------------------------------------------
@@ -159,7 +159,7 @@ H5_timer_begin (H5_timer_t *timer)
void
H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/)
{
- H5_timer_t now;
+ H5_timer_t now;
HDassert(timer);
H5_timer_begin(&now);
@@ -175,28 +175,28 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/)
}
} /* end H5_timer_end() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5_bandwidth
+ * Function: H5_bandwidth
*
- * Purpose: Prints the bandwidth (bytes per second) in a field 10
- * characters wide widh four digits of precision like this:
+ * Purpose: Prints the bandwidth (bytes per second) in a field 10
+ * characters wide widh four digits of precision like this:
*
- * NaN If <=0 seconds
- * 1234. TB/s
- * 123.4 TB/s
- * 12.34 GB/s
- * 1.234 MB/s
- * 4.000 kB/s
- * 1.000 B/s
- * 0.000 B/s If NBYTES==0
- * 1.2345e-10 For bandwidth less than 1
- * 6.7893e+94 For exceptionally large values
- * 6.678e+106 For really big values
+ * NaN If <=0 seconds
+ * 1234. TB/s
+ * 123.4 TB/s
+ * 12.34 GB/s
+ * 1.234 MB/s
+ * 4.000 kB/s
+ * 1.000 B/s
+ * 0.000 B/s If NBYTES==0
+ * 1.2345e-10 For bandwidth less than 1
+ * 6.7893e+94 For exceptionally large values
+ * 6.678e+106 For really big values
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 5, 1998
*
*-------------------------------------------------------------------------
@@ -204,7 +204,7 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/)
void
H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds)
{
- double bw;
+ double bw;
if(nseconds <= (double)0.0F)
HDstrcpy(buf, " NaN");
@@ -213,39 +213,39 @@ H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds)
if(H5_DBL_ABS_EQUAL(bw, (double)0.0F))
HDstrcpy(buf, "0.000 B/s");
else if(bw < (double)1.0F)
- sprintf(buf, "%10.4e", bw);
+ HDsprintf(buf, "%10.4e", bw);
else if(bw < (double)H5_KB) {
- sprintf(buf, "%05.4f", bw);
+ HDsprintf(buf, "%05.4f", bw);
HDstrcpy(buf+5, " B/s");
} else if(bw < (double)H5_MB) {
- sprintf(buf, "%05.4f", bw / (double)H5_KB);
+ HDsprintf(buf, "%05.4f", bw / (double)H5_KB);
HDstrcpy(buf+5, " kB/s");
} else if(bw < (double)H5_GB) {
- sprintf(buf, "%05.4f", bw / (double)H5_MB);
+ HDsprintf(buf, "%05.4f", bw / (double)H5_MB);
HDstrcpy(buf+5, " MB/s");
} else if(bw < (double)H5_TB) {
- sprintf(buf, "%05.4f", bw / (double)H5_GB);
+ HDsprintf(buf, "%05.4f", bw / (double)H5_GB);
HDstrcpy(buf+5, " GB/s");
} else if(bw < (double)H5_PB) {
- sprintf(buf, "%05.4f", bw / (double)H5_TB);
+ HDsprintf(buf, "%05.4f", bw / (double)H5_TB);
HDstrcpy(buf+5, " TB/s");
} else {
- sprintf(buf, "%10.4e", bw);
+ HDsprintf(buf, "%10.4e", bw);
if(HDstrlen(buf) > 10)
- sprintf(buf, "%10.3e", bw);
+ HDsprintf(buf, "%10.3e", bw);
}
}
} /* end H5_bandwidth() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5_now
+ * Function: H5_now
*
- * Purpose: Retrieves the current time, as seconds after the UNIX epoch.
+ * Purpose: Retrieves the current time, as seconds after the UNIX epoch.
*
- * Return: # of seconds from the epoch (can't fail)
+ * Return: # of seconds from the epoch (can't fail)
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 28, 2006
*
*-------------------------------------------------------------------------
@@ -253,7 +253,7 @@ H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds)
time_t
H5_now(void)
{
- time_t now; /* Current time */
+ time_t now; /* Current time */
#ifdef H5_HAVE_GETTIMEOFDAY
{
diff --git a/src/H5win32defs.h b/src/H5win32defs.h
index 4522228..29533dd 100644
--- a/src/H5win32defs.h
+++ b/src/H5win32defs.h
@@ -34,6 +34,7 @@ typedef __int64 h5_stat_size_t;
#define HDaccess(F,M) _access(F,M)
#define HDchdir(S) _chdir(S)
#define HDclose(F) _close(F)
+#define HDcreat(S,M) Wopen_utf8(S,O_CREAT|O_TRUNC|O_RDWR,M)
#define HDdup(F) _dup(F)
#define HDfdopen(N,S) _fdopen(N,S)
#define HDfileno(F) _fileno(F)
@@ -47,21 +48,24 @@ typedef __int64 h5_stat_size_t;
#define HDmkdir(S,M) _mkdir(S)
#define HDnanosleep(N, O) Wnanosleep(N, O)
#define HDoff_t __int64
-/* _O_BINARY must be set in Windows to avoid CR-LF <-> LF EOL
- * transformations when performing I/O. Note that this will
- * produce Unix-style text files, though.
- *
- * Also note that the variadic macro is using a VC++ extension
+
+/* Note that the variadic HDopen macro is using a VC++ extension
* where the comma is dropped if nothing is passed to the ellipsis.
*/
-#define HDopen(S,F,...) _open(S, F | _O_BINARY, __VA_ARGS__)
+#ifndef H5_HAVE_MINGW
+#define HDopen(S,F,...) Wopen_utf8(S,F,__VA_ARGS__)
+#else
+#define HDopen(S,F,...) Wopen_utf8(S,F,##__VA_ARGS__)
+#endif
#define HDread(F,M,Z) _read(F,M,Z)
+#define HDremove(S) Wremove_utf8(S)
#define HDrmdir(S) _rmdir(S)
#define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2))
#define HDsleep(S) Sleep(S*1000)
#define HDstat(S,B) _stati64(S,B)
#define HDstrcasecmp(A,B) _stricmp(A,B)
#define HDstrdup(S) _strdup(S)
+#define HDstrtok_r(X,Y,Z) strtok_s(X,Y,Z)
#define HDtzset() _tzset()
#define HDunlink(S) _unlink(S)
#define HDwrite(F,M,Z) _write(F,M,Z)
@@ -75,6 +79,11 @@ typedef __int64 h5_stat_size_t;
#ifndef H5_HAVE_STRTOULL
#define HDstrtoull(S,R,N) _strtoui64(S,R,N)
#endif /* H5_HAVE_STRTOULL */
+ /* va_copy() does not exist on pre-2013 Visual Studio. Since va_lists are
+ * just pointers into the stack in those CRTs, the usual work-around
+ * is to just define the operation as a pointer copy.
+ */
+ #define HDva_copy(D,S) ((D) = (S))
#endif /* MSC_VER < 1800 */
/*
@@ -120,6 +129,9 @@ extern "C" {
H5_DLL int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap);
H5_DLL int Wnanosleep(const struct timespec *req, struct timespec *rem);
H5_DLL herr_t H5_expand_windows_env_vars(char **env_var);
+ H5_DLL const wchar_t *H5_get_utf16_str(const char *s);
+ H5_DLL int Wopen_utf8(const char *path, int oflag, ...);
+ H5_DLL int Wremove_utf8(const char *path);
/* Round functions only needed for VS2012 and earlier.
* They are always built to ensure they don't go stale and
diff --git a/src/Makefile.am b/src/Makefile.am
index 10ef8c6..7126e44 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -35,7 +35,7 @@ libhdf5_la_LDFLAGS= -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_
# H5Tinit.c and H5lib_settings.c are generated files and should be cleaned.
MOSTLYCLEANFILES=H5Tinit.c H5lib_settings.c
# H5pubconf.h is generated by configure, and should be cleaned.
-DISTCLEANFILES=H5pubconf.h
+DISTCLEANFILES=H5pubconf.h $(H5CC_NAME)
# library sources
libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
@@ -62,8 +62,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5Fsfile.c H5Fspace.c H5Fsuper.c H5Fsuper_cache.c H5Ftest.c \
H5FA.c H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \
H5FAint.c H5FAstat.c H5FAtest.c \
- H5FD.c H5FDcore.c \
- H5FDfamily.c H5FDint.c H5FDlog.c \
+ H5FD.c H5FDcore.c H5FDfamily.c H5FDhdfs.c H5FDint.c H5FDlog.c \
H5FDmulti.c H5FDsec2.c H5FDspace.c H5FDstdio.c H5FDtest.c \
H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c H5FSint.c H5FSsection.c \
H5FSstat.c H5FStest.c \
@@ -127,14 +126,19 @@ if DIRECT_VFD_CONDITIONAL
libhdf5_la_SOURCES += H5FDdirect.c
endif
+# Only compile the read-only S3 VFD if necessary
+if ROS3_VFD_CONDITIONAL
+ libhdf5_la_SOURCES += H5FDros3.c H5FDs3comms.c
+endif
+
# Public headers
include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5version.h \
H5Apublic.h H5ACpublic.h \
H5Cpublic.h H5Dpublic.h \
H5Epubgen.h H5Epublic.h H5Fpublic.h \
H5FDpublic.h H5FDcore.h H5FDdirect.h \
- H5FDfamily.h H5FDlog.h H5FDmpi.h H5FDmpio.h \
- H5FDmulti.h H5FDsec2.h H5FDstdio.h H5FDwindows.h \
+ H5FDfamily.h H5FDhdfs.h H5FDlog.h H5FDmpi.h H5FDmpio.h \
+ H5FDmulti.h H5FDros3.h H5FDsec2.h H5FDstdio.h H5FDwindows.h \
H5Gpublic.h H5Ipublic.h H5Lpublic.h \
H5MMpublic.h H5Opublic.h H5Ppublic.h \
H5PLextern.h H5PLpublic.h \
@@ -145,6 +149,8 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers
settingsdir=$(libdir)
settings_DATA=libhdf5.settings
+bin_SCRIPTS=$(H5CC_NAME)
+
# Number format detection
# The LD_LIBRARY_PATH setting is a kludge.
# Things should have been all set during H5detect making.
@@ -203,4 +209,10 @@ trace: $(libhdf5_la_SOURCES)
fi; \
done
+#install-exec-local:
+# @$(INSTALL) h5cc $(DESTDIR)$(bindir)/$(H5CC_NAME)
+#uninstall-local:
+# @$(RM) $(DESTDIR)$(bindir)/$(H5CC_NAME)
+
include $(top_srcdir)/config/conclude.am
+
diff --git a/src/Makefile.in b/src/Makefile.in
index d640fc5..5c5c198 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -32,6 +32,7 @@
+
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
@@ -113,6 +114,9 @@ noinst_PROGRAMS = H5detect$(EXEEXT) H5make_libsettings$(EXEEXT)
# Only compile the direct VFD if necessary
@DIRECT_VFD_CONDITIONAL_TRUE@am__append_2 = H5FDdirect.c
+
+# Only compile the read-only S3 VFD if necessary
+@ROS3_VFD_CONDITIONAL_TRUE@am__append_3 = H5FDros3.c H5FDs3comms.c
TESTS =
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -169,8 +173,8 @@ am__uninstall_files_from_dir = { \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(settingsdir)" \
- "$(DESTDIR)$(includedir)"
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
+ "$(DESTDIR)$(settingsdir)" "$(DESTDIR)$(includedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libhdf5_la_LIBADD =
am__libhdf5_la_SOURCES_DIST = H5.c H5checksum.c H5dbg.c H5system.c \
@@ -192,23 +196,23 @@ am__libhdf5_la_SOURCES_DIST = H5.c H5checksum.c H5dbg.c H5system.c \
H5Fspace.c H5Fsuper.c H5Fsuper_cache.c H5Ftest.c H5FA.c \
H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \
H5FAint.c H5FAstat.c H5FAtest.c H5FD.c H5FDcore.c H5FDfamily.c \
- H5FDint.c H5FDlog.c H5FDmulti.c H5FDsec2.c H5FDspace.c \
- H5FDstdio.c H5FDtest.c H5FL.c H5FO.c H5FS.c H5FScache.c \
- H5FSdbg.c H5FSint.c H5FSsection.c H5FSstat.c H5FStest.c H5G.c \
- H5Gbtree2.c H5Gcache.c H5Gcompact.c H5Gdense.c H5Gdeprec.c \
- H5Gent.c H5Gint.c H5Glink.c H5Gloc.c H5Gname.c H5Gnode.c \
- H5Gobj.c H5Goh.c H5Groot.c H5Gstab.c H5Gtest.c H5Gtraverse.c \
- H5HF.c H5HFbtree2.c H5HFcache.c H5HFdbg.c H5HFdblock.c \
- H5HFdtable.c H5HFhdr.c H5HFhuge.c H5HFiblock.c H5HFiter.c \
- H5HFman.c H5HFsection.c H5HFspace.c H5HFstat.c H5HFtest.c \
- H5HFtiny.c H5HG.c H5HGcache.c H5HGdbg.c H5HGquery.c H5HL.c \
- H5HLcache.c H5HLdbg.c H5HLint.c H5HLprfx.c H5HLdblk.c H5HP.c \
- H5I.c H5Itest.c H5L.c H5Lexternal.c H5lib_settings.c H5MF.c \
- H5MFaggr.c H5MFdbg.c H5MFsection.c H5MM.c H5MP.c H5MPtest.c \
- H5O.c H5Odeprec.c H5Oainfo.c H5Oalloc.c H5Oattr.c \
- H5Oattribute.c H5Obogus.c H5Obtreek.c H5Ocache.c \
- H5Ocache_image.c H5Ochunk.c H5Ocont.c H5Ocopy.c H5Odbg.c \
- H5Odrvinfo.c H5Odtype.c H5Oefl.c H5Ofill.c H5Oflush.c \
+ H5FDhdfs.c H5FDint.c H5FDlog.c H5FDmulti.c H5FDsec2.c \
+ H5FDspace.c H5FDstdio.c H5FDtest.c H5FL.c H5FO.c H5FS.c \
+ H5FScache.c H5FSdbg.c H5FSint.c H5FSsection.c H5FSstat.c \
+ H5FStest.c H5G.c H5Gbtree2.c H5Gcache.c H5Gcompact.c \
+ H5Gdense.c H5Gdeprec.c H5Gent.c H5Gint.c H5Glink.c H5Gloc.c \
+ H5Gname.c H5Gnode.c H5Gobj.c H5Goh.c H5Groot.c H5Gstab.c \
+ H5Gtest.c H5Gtraverse.c H5HF.c H5HFbtree2.c H5HFcache.c \
+ H5HFdbg.c H5HFdblock.c H5HFdtable.c H5HFhdr.c H5HFhuge.c \
+ H5HFiblock.c H5HFiter.c H5HFman.c H5HFsection.c H5HFspace.c \
+ H5HFstat.c H5HFtest.c H5HFtiny.c H5HG.c H5HGcache.c H5HGdbg.c \
+ H5HGquery.c H5HL.c H5HLcache.c H5HLdbg.c H5HLint.c H5HLprfx.c \
+ H5HLdblk.c H5HP.c H5I.c H5Itest.c H5L.c H5Lexternal.c \
+ H5lib_settings.c H5MF.c H5MFaggr.c H5MFdbg.c H5MFsection.c \
+ H5MM.c H5MP.c H5MPtest.c H5O.c H5Odeprec.c H5Oainfo.c \
+ H5Oalloc.c H5Oattr.c H5Oattribute.c H5Obogus.c H5Obtreek.c \
+ H5Ocache.c H5Ocache_image.c H5Ochunk.c H5Ocont.c H5Ocopy.c \
+ H5Odbg.c H5Odrvinfo.c H5Odtype.c H5Oefl.c H5Ofill.c H5Oflush.c \
H5Ofsinfo.c H5Oginfo.c H5Oint.c H5Olayout.c H5Olinfo.c \
H5Olink.c H5Omessage.c H5Omtime.c H5Oname.c H5Onull.c \
H5Opline.c H5Orefcount.c H5Osdspace.c H5Oshared.c H5Oshmesg.c \
@@ -227,12 +231,14 @@ am__libhdf5_la_SOURCES_DIST = H5.c H5checksum.c H5dbg.c H5system.c \
H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5VM.c H5WB.c H5Z.c \
H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c \
H5Zscaleoffset.c H5Zszip.c H5Ztrans.c H5ACmpio.c H5Cmpio.c \
- H5Dmpio.c H5Fmpi.c H5FDmpi.c H5FDmpio.c H5Smpio.c H5FDdirect.c
+ H5Dmpio.c H5Fmpi.c H5FDmpi.c H5FDmpio.c H5Smpio.c H5FDdirect.c \
+ H5FDros3.c H5FDs3comms.c
@BUILD_PARALLEL_CONDITIONAL_TRUE@am__objects_1 = H5ACmpio.lo \
@BUILD_PARALLEL_CONDITIONAL_TRUE@ H5Cmpio.lo H5Dmpio.lo \
@BUILD_PARALLEL_CONDITIONAL_TRUE@ H5Fmpi.lo H5FDmpi.lo \
@BUILD_PARALLEL_CONDITIONAL_TRUE@ H5FDmpio.lo H5Smpio.lo
@DIRECT_VFD_CONDITIONAL_TRUE@am__objects_2 = H5FDdirect.lo
+@ROS3_VFD_CONDITIONAL_TRUE@am__objects_3 = H5FDros3.lo H5FDs3comms.lo
am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \
H5timer.lo H5trace.lo H5A.lo H5Abtree2.lo H5Adense.lo \
H5Adeprec.lo H5Aint.lo H5Atest.lo H5AC.lo H5ACdbg.lo \
@@ -254,45 +260,45 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \
H5Fsfile.lo H5Fspace.lo H5Fsuper.lo H5Fsuper_cache.lo \
H5Ftest.lo H5FA.lo H5FAcache.lo H5FAdbg.lo H5FAdblock.lo \
H5FAdblkpage.lo H5FAhdr.lo H5FAint.lo H5FAstat.lo H5FAtest.lo \
- H5FD.lo H5FDcore.lo H5FDfamily.lo H5FDint.lo H5FDlog.lo \
- H5FDmulti.lo H5FDsec2.lo H5FDspace.lo H5FDstdio.lo H5FDtest.lo \
- H5FL.lo H5FO.lo H5FS.lo H5FScache.lo H5FSdbg.lo H5FSint.lo \
- H5FSsection.lo H5FSstat.lo H5FStest.lo H5G.lo H5Gbtree2.lo \
- H5Gcache.lo H5Gcompact.lo H5Gdense.lo H5Gdeprec.lo H5Gent.lo \
- H5Gint.lo H5Glink.lo H5Gloc.lo H5Gname.lo H5Gnode.lo H5Gobj.lo \
- H5Goh.lo H5Groot.lo H5Gstab.lo H5Gtest.lo H5Gtraverse.lo \
- H5HF.lo H5HFbtree2.lo H5HFcache.lo H5HFdbg.lo H5HFdblock.lo \
- H5HFdtable.lo H5HFhdr.lo H5HFhuge.lo H5HFiblock.lo H5HFiter.lo \
- H5HFman.lo H5HFsection.lo H5HFspace.lo H5HFstat.lo H5HFtest.lo \
- H5HFtiny.lo H5HG.lo H5HGcache.lo H5HGdbg.lo H5HGquery.lo \
- H5HL.lo H5HLcache.lo H5HLdbg.lo H5HLint.lo H5HLprfx.lo \
- H5HLdblk.lo H5HP.lo H5I.lo H5Itest.lo H5L.lo H5Lexternal.lo \
- H5lib_settings.lo H5MF.lo H5MFaggr.lo H5MFdbg.lo \
- H5MFsection.lo H5MM.lo H5MP.lo H5MPtest.lo H5O.lo H5Odeprec.lo \
- H5Oainfo.lo H5Oalloc.lo H5Oattr.lo H5Oattribute.lo H5Obogus.lo \
- H5Obtreek.lo H5Ocache.lo H5Ocache_image.lo H5Ochunk.lo \
- H5Ocont.lo H5Ocopy.lo H5Odbg.lo H5Odrvinfo.lo H5Odtype.lo \
- H5Oefl.lo H5Ofill.lo H5Oflush.lo H5Ofsinfo.lo H5Oginfo.lo \
- H5Oint.lo H5Olayout.lo H5Olinfo.lo H5Olink.lo H5Omessage.lo \
- H5Omtime.lo H5Oname.lo H5Onull.lo H5Opline.lo H5Orefcount.lo \
- H5Osdspace.lo H5Oshared.lo H5Oshmesg.lo H5Ostab.lo H5Otest.lo \
- H5Ounknown.lo H5P.lo H5Pacpl.lo H5Pdapl.lo H5Pdcpl.lo \
- H5Pdeprec.lo H5Pdxpl.lo H5Pencdec.lo H5Pfapl.lo H5Pfcpl.lo \
- H5Pfmpl.lo H5Pgcpl.lo H5Pint.lo H5Plapl.lo H5Plcpl.lo \
- H5Pocpl.lo H5Pocpypl.lo H5Pstrcpl.lo H5Ptest.lo H5PB.lo \
- H5PL.lo H5PLint.lo H5PLpath.lo H5PLplugin_cache.lo H5R.lo \
- H5Rint.lo H5Rdeprec.lo H5UC.lo H5RS.lo H5S.lo H5Sall.lo \
- H5Sdbg.lo H5Shyper.lo H5Snone.lo H5Spoint.lo H5Sselect.lo \
- H5Stest.lo H5SL.lo H5SM.lo H5SMbtree2.lo H5SMcache.lo \
- H5SMmessage.lo H5SMtest.lo H5ST.lo H5T.lo H5Tarray.lo \
- H5Tbit.lo H5Tcommit.lo H5Tcompound.lo H5Tconv.lo H5Tcset.lo \
- H5Tdbg.lo H5Tdeprec.lo H5Tenum.lo H5Tfields.lo H5Tfixed.lo \
- H5Tfloat.lo H5Tinit.lo H5Tnative.lo H5Toffset.lo H5Toh.lo \
- H5Topaque.lo H5Torder.lo H5Tpad.lo H5Tprecis.lo H5Tstrpad.lo \
- H5Tvisit.lo H5Tvlen.lo H5TS.lo H5VM.lo H5WB.lo H5Z.lo \
- H5Zdeflate.lo H5Zfletcher32.lo H5Znbit.lo H5Zshuffle.lo \
- H5Zscaleoffset.lo H5Zszip.lo H5Ztrans.lo $(am__objects_1) \
- $(am__objects_2)
+ H5FD.lo H5FDcore.lo H5FDfamily.lo H5FDhdfs.lo H5FDint.lo \
+ H5FDlog.lo H5FDmulti.lo H5FDsec2.lo H5FDspace.lo H5FDstdio.lo \
+ H5FDtest.lo H5FL.lo H5FO.lo H5FS.lo H5FScache.lo H5FSdbg.lo \
+ H5FSint.lo H5FSsection.lo H5FSstat.lo H5FStest.lo H5G.lo \
+ H5Gbtree2.lo H5Gcache.lo H5Gcompact.lo H5Gdense.lo \
+ H5Gdeprec.lo H5Gent.lo H5Gint.lo H5Glink.lo H5Gloc.lo \
+ H5Gname.lo H5Gnode.lo H5Gobj.lo H5Goh.lo H5Groot.lo H5Gstab.lo \
+ H5Gtest.lo H5Gtraverse.lo H5HF.lo H5HFbtree2.lo H5HFcache.lo \
+ H5HFdbg.lo H5HFdblock.lo H5HFdtable.lo H5HFhdr.lo H5HFhuge.lo \
+ H5HFiblock.lo H5HFiter.lo H5HFman.lo H5HFsection.lo \
+ H5HFspace.lo H5HFstat.lo H5HFtest.lo H5HFtiny.lo H5HG.lo \
+ H5HGcache.lo H5HGdbg.lo H5HGquery.lo H5HL.lo H5HLcache.lo \
+ H5HLdbg.lo H5HLint.lo H5HLprfx.lo H5HLdblk.lo H5HP.lo H5I.lo \
+ H5Itest.lo H5L.lo H5Lexternal.lo H5lib_settings.lo H5MF.lo \
+ H5MFaggr.lo H5MFdbg.lo H5MFsection.lo H5MM.lo H5MP.lo \
+ H5MPtest.lo H5O.lo H5Odeprec.lo H5Oainfo.lo H5Oalloc.lo \
+ H5Oattr.lo H5Oattribute.lo H5Obogus.lo H5Obtreek.lo \
+ H5Ocache.lo H5Ocache_image.lo H5Ochunk.lo H5Ocont.lo \
+ H5Ocopy.lo H5Odbg.lo H5Odrvinfo.lo H5Odtype.lo H5Oefl.lo \
+ H5Ofill.lo H5Oflush.lo H5Ofsinfo.lo H5Oginfo.lo H5Oint.lo \
+ H5Olayout.lo H5Olinfo.lo H5Olink.lo H5Omessage.lo H5Omtime.lo \
+ H5Oname.lo H5Onull.lo H5Opline.lo H5Orefcount.lo H5Osdspace.lo \
+ H5Oshared.lo H5Oshmesg.lo H5Ostab.lo H5Otest.lo H5Ounknown.lo \
+ H5P.lo H5Pacpl.lo H5Pdapl.lo H5Pdcpl.lo H5Pdeprec.lo \
+ H5Pdxpl.lo H5Pencdec.lo H5Pfapl.lo H5Pfcpl.lo H5Pfmpl.lo \
+ H5Pgcpl.lo H5Pint.lo H5Plapl.lo H5Plcpl.lo H5Pocpl.lo \
+ H5Pocpypl.lo H5Pstrcpl.lo H5Ptest.lo H5PB.lo H5PL.lo \
+ H5PLint.lo H5PLpath.lo H5PLplugin_cache.lo H5R.lo H5Rint.lo \
+ H5Rdeprec.lo H5UC.lo H5RS.lo H5S.lo H5Sall.lo H5Sdbg.lo \
+ H5Shyper.lo H5Snone.lo H5Spoint.lo H5Sselect.lo H5Stest.lo \
+ H5SL.lo H5SM.lo H5SMbtree2.lo H5SMcache.lo H5SMmessage.lo \
+ H5SMtest.lo H5ST.lo H5T.lo H5Tarray.lo H5Tbit.lo H5Tcommit.lo \
+ H5Tcompound.lo H5Tconv.lo H5Tcset.lo H5Tdbg.lo H5Tdeprec.lo \
+ H5Tenum.lo H5Tfields.lo H5Tfixed.lo H5Tfloat.lo H5Tinit.lo \
+ H5Tnative.lo H5Toffset.lo H5Toh.lo H5Topaque.lo H5Torder.lo \
+ H5Tpad.lo H5Tprecis.lo H5Tstrpad.lo H5Tvisit.lo H5Tvlen.lo \
+ H5TS.lo H5VM.lo H5WB.lo H5Z.lo H5Zdeflate.lo H5Zfletcher32.lo \
+ H5Znbit.lo H5Zshuffle.lo H5Zscaleoffset.lo H5Zszip.lo \
+ H5Ztrans.lo $(am__objects_1) $(am__objects_2) $(am__objects_3)
libhdf5_la_OBJECTS = $(am_libhdf5_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -308,6 +314,7 @@ H5detect_LDADD = $(LDADD)
H5make_libsettings_SOURCES = H5make_libsettings.c
H5make_libsettings_OBJECTS = H5make_libsettings.$(OBJEXT)
H5make_libsettings_LDADD = $(LDADD)
+SCRIPTS = $(bin_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -622,7 +629,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -645,9 +651,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -674,6 +683,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -728,6 +738,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -752,7 +763,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -869,29 +879,29 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-LT_VERS_INTERFACE = 104
+LT_VERS_INTERFACE = 105
LT_VERS_REVISION = 0
-LT_VERS_AGE = 1
-LT_CXX_VERS_INTERFACE = 104
+LT_VERS_AGE = 2
+LT_CXX_VERS_INTERFACE = 105
LT_CXX_VERS_REVISION = 0
-LT_CXX_VERS_AGE = 1
+LT_CXX_VERS_AGE = 2
LT_F_VERS_INTERFACE = 102
-LT_F_VERS_REVISION = 0
+LT_F_VERS_REVISION = 1
LT_F_VERS_AGE = 0
LT_HL_VERS_INTERFACE = 101
-LT_HL_VERS_REVISION = 2
+LT_HL_VERS_REVISION = 3
LT_HL_VERS_AGE = 1
LT_HL_CXX_VERS_INTERFACE = 101
-LT_HL_CXX_VERS_REVISION = 3
+LT_HL_CXX_VERS_REVISION = 4
LT_HL_CXX_VERS_AGE = 1
LT_HL_F_VERS_INTERFACE = 100
-LT_HL_F_VERS_REVISION = 4
+LT_HL_F_VERS_REVISION = 5
LT_HL_F_VERS_AGE = 0
LT_JAVA_VERS_INTERFACE = 104
-LT_JAVA_VERS_REVISION = 0
+LT_JAVA_VERS_REVISION = 1
LT_JAVA_VERS_AGE = 4
LT_TOOLS_VERS_INTERFACE = 101
-LT_TOOLS_VERS_REVISION = 2
+LT_TOOLS_VERS_REVISION = 3
LT_TOOLS_VERS_AGE = 1
# Our main target, the HDF5 library
@@ -903,7 +913,7 @@ libhdf5_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT
# H5Tinit.c and H5lib_settings.c are generated files and should be cleaned.
MOSTLYCLEANFILES = H5Tinit.c H5lib_settings.c
# H5pubconf.h is generated by configure, and should be cleaned.
-DISTCLEANFILES = H5pubconf.h
+DISTCLEANFILES = H5pubconf.h $(H5CC_NAME)
# library sources
libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c \
@@ -924,19 +934,19 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c \
H5Fio.c H5Fmount.c H5Fquery.c H5Fsfile.c H5Fspace.c H5Fsuper.c \
H5Fsuper_cache.c H5Ftest.c H5FA.c H5FAcache.c H5FAdbg.c \
H5FAdblock.c H5FAdblkpage.c H5FAhdr.c H5FAint.c H5FAstat.c \
- H5FAtest.c H5FD.c H5FDcore.c H5FDfamily.c H5FDint.c H5FDlog.c \
- H5FDmulti.c H5FDsec2.c H5FDspace.c H5FDstdio.c H5FDtest.c \
- H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c H5FSint.c \
- H5FSsection.c H5FSstat.c H5FStest.c H5G.c H5Gbtree2.c \
- H5Gcache.c H5Gcompact.c H5Gdense.c H5Gdeprec.c H5Gent.c \
- H5Gint.c H5Glink.c H5Gloc.c H5Gname.c H5Gnode.c H5Gobj.c \
- H5Goh.c H5Groot.c H5Gstab.c H5Gtest.c H5Gtraverse.c H5HF.c \
- H5HFbtree2.c H5HFcache.c H5HFdbg.c H5HFdblock.c H5HFdtable.c \
- H5HFhdr.c H5HFhuge.c H5HFiblock.c H5HFiter.c H5HFman.c \
- H5HFsection.c H5HFspace.c H5HFstat.c H5HFtest.c H5HFtiny.c \
- H5HG.c H5HGcache.c H5HGdbg.c H5HGquery.c H5HL.c H5HLcache.c \
- H5HLdbg.c H5HLint.c H5HLprfx.c H5HLdblk.c H5HP.c H5I.c \
- H5Itest.c H5L.c H5Lexternal.c H5lib_settings.c H5MF.c \
+ H5FAtest.c H5FD.c H5FDcore.c H5FDfamily.c H5FDhdfs.c H5FDint.c \
+ H5FDlog.c H5FDmulti.c H5FDsec2.c H5FDspace.c H5FDstdio.c \
+ H5FDtest.c H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c \
+ H5FSint.c H5FSsection.c H5FSstat.c H5FStest.c H5G.c \
+ H5Gbtree2.c H5Gcache.c H5Gcompact.c H5Gdense.c H5Gdeprec.c \
+ H5Gent.c H5Gint.c H5Glink.c H5Gloc.c H5Gname.c H5Gnode.c \
+ H5Gobj.c H5Goh.c H5Groot.c H5Gstab.c H5Gtest.c H5Gtraverse.c \
+ H5HF.c H5HFbtree2.c H5HFcache.c H5HFdbg.c H5HFdblock.c \
+ H5HFdtable.c H5HFhdr.c H5HFhuge.c H5HFiblock.c H5HFiter.c \
+ H5HFman.c H5HFsection.c H5HFspace.c H5HFstat.c H5HFtest.c \
+ H5HFtiny.c H5HG.c H5HGcache.c H5HGdbg.c H5HGquery.c H5HL.c \
+ H5HLcache.c H5HLdbg.c H5HLint.c H5HLprfx.c H5HLdblk.c H5HP.c \
+ H5I.c H5Itest.c H5L.c H5Lexternal.c H5lib_settings.c H5MF.c \
H5MFaggr.c H5MFdbg.c H5MFsection.c H5MM.c H5MP.c H5MPtest.c \
H5O.c H5Odeprec.c H5Oainfo.c H5Oalloc.c H5Oattr.c \
H5Oattribute.c H5Obogus.c H5Obtreek.c H5Ocache.c \
@@ -960,7 +970,7 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c \
H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5VM.c H5WB.c H5Z.c \
H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c \
H5Zscaleoffset.c H5Zszip.c H5Ztrans.c $(am__append_1) \
- $(am__append_2)
+ $(am__append_2) $(am__append_3)
# Public headers
include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5version.h \
@@ -968,8 +978,8 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers
H5Cpublic.h H5Dpublic.h \
H5Epubgen.h H5Epublic.h H5Fpublic.h \
H5FDpublic.h H5FDcore.h H5FDdirect.h \
- H5FDfamily.h H5FDlog.h H5FDmpi.h H5FDmpio.h \
- H5FDmulti.h H5FDsec2.h H5FDstdio.h H5FDwindows.h \
+ H5FDfamily.h H5FDhdfs.h H5FDlog.h H5FDmpi.h H5FDmpio.h \
+ H5FDmulti.h H5FDros3.h H5FDsec2.h H5FDstdio.h H5FDwindows.h \
H5Gpublic.h H5Ipublic.h H5Lpublic.h \
H5MMpublic.h H5Opublic.h H5Ppublic.h \
H5PLextern.h H5PLpublic.h \
@@ -980,6 +990,7 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers
# install libhdf5.settings in lib directory
settingsdir = $(libdir)
settings_DATA = libhdf5.settings
+bin_SCRIPTS = $(H5CC_NAME)
# Automake needs to be taught how to build lib, progs and tests targets.
# These will be filled in automatically for the most part (e.g.,
@@ -1108,6 +1119,41 @@ H5detect$(EXEEXT): $(H5detect_OBJECTS) $(H5detect_DEPENDENCIES) $(EXTRA_H5detect
H5make_libsettings$(EXEEXT): $(H5make_libsettings_OBJECTS) $(H5make_libsettings_DEPENDENCIES) $(EXTRA_H5make_libsettings_DEPENDENCIES)
@rm -f H5make_libsettings$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(H5make_libsettings_OBJECTS) $(H5make_libsettings_LDADD) $(LIBS)
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -1203,11 +1249,14 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDcore.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDdirect.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDfamily.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDhdfs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDint.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDlog.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDmpi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDmpio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDmulti.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDros3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDs3comms.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDsec2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDspace.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDstdio.Plo@am__quote@
@@ -1720,10 +1769,10 @@ distdir: $(DISTFILES)
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) \
- H5config.h all-local
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \
+ $(HEADERS) H5config.h all-local
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(settingsdir)" "$(DESTDIR)$(includedir)"; do \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(settingsdir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -1790,7 +1839,7 @@ install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am: install-libLTLIBRARIES
+install-exec-am: install-binSCRIPTS install-libLTLIBRARIES
install-html: install-html-am
@@ -1830,8 +1879,8 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
- uninstall-settingsDATA
+uninstall-am: uninstall-binSCRIPTS uninstall-includeHEADERS \
+ uninstall-libLTLIBRARIES uninstall-settingsDATA
.MAKE: all check-am install-am install-strip
@@ -1841,15 +1890,16 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
ctags-am distclean distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-includeHEADERS install-info install-info-am \
- install-libLTLIBRARIES install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-settingsDATA install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
- pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \
+ install-binSCRIPTS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-includeHEADERS install-info \
+ install-info-am install-libLTLIBRARIES install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-settingsDATA \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-local pdf pdf-am ps ps-am recheck tags tags-am \
+ uninstall uninstall-am uninstall-binSCRIPTS \
uninstall-includeHEADERS uninstall-libLTLIBRARIES \
uninstall-settingsDATA
@@ -1960,7 +2010,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
@@ -2154,6 +2204,11 @@ check-vfd: $(LIB) $(PROGS) $(chk_TESTS)
fi; \
done
+#install-exec-local:
+# @$(INSTALL) h5cc $(DESTDIR)$(bindir)/$(H5CC_NAME)
+#uninstall-local:
+# @$(RM) $(DESTDIR)$(bindir)/$(H5CC_NAME)
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/src/hdf5.h b/src/hdf5.h
index 1709375..f5ded15 100644
--- a/src/hdf5.h
+++ b/src/hdf5.h
@@ -39,16 +39,18 @@
#include "H5Zpublic.h" /* Data filters */
/* Predefined file drivers */
-#include "H5FDcore.h" /* Files stored entirely in memory */
-#include "H5FDdirect.h" /* Linux direct I/O */
-#include "H5FDfamily.h" /* File families */
+#include "H5FDcore.h" /* Files stored entirely in memory */
+#include "H5FDdirect.h" /* Linux direct I/O */
+#include "H5FDfamily.h" /* File families */
+#include "H5FDhdfs.h" /* Hadoop HDFS */
#include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */
-#include "H5FDmpi.h" /* MPI-based file drivers */
-#include "H5FDmulti.h" /* Usage-partitioned file family */
-#include "H5FDsec2.h" /* POSIX unbuffered file I/O */
-#include "H5FDstdio.h" /* Standard C buffered I/O */
+#include "H5FDmpi.h" /* MPI-based file drivers */
+#include "H5FDmulti.h" /* Usage-partitioned file family */
+#include "H5FDros3.h" /* R/O S3 "file" I/O */
+#include "H5FDsec2.h" /* POSIX unbuffered file I/O */
+#include "H5FDstdio.h" /* Standard C buffered I/O */
#ifdef H5_HAVE_WINDOWS
-#include "H5FDwindows.h" /* Win32 I/O */
+#include "H5FDwindows.h" /* Win32 I/O */
#endif
#endif
diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in
index 9d0e29f..baa99ea 100644
--- a/src/libhdf5.settings.in
+++ b/src/libhdf5.settings.in
@@ -71,12 +71,16 @@ Features:
Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@
Large Parallel I/O: @LARGE_PARALLEL_IO@
High-level library: @HDF5_HL@
+ Build HDF5 Tests: @HDF5_TESTS@
+ Build HDF5 Tools: @HDF5_TOOLS@
Threadsafety: @THREADSAFE@
Default API mapping: @DEFAULT_API_VERSION@
With deprecated public symbols: @DEPRECATED_SYMBOLS@
I/O filters (external): @EXTERNAL_FILTERS@
MPE: @MPE@
Direct VFD: @DIRECT_VFD@
+ (Read-Only) S3 VFD: @ROS3_VFD@
+ (Read-Only) HDFS VFD: @HAVE_LIBHDFS@
dmalloc: @HAVE_DMALLOC@
Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@
API tracing: @TRACE_API@
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index fa303ed..d879726 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -14,43 +14,49 @@ set (TEST_LIB_SOURCES
${HDF5_TEST_SOURCE_DIR}/h5test.c
${HDF5_TEST_SOURCE_DIR}/testframe.c
${HDF5_TEST_SOURCE_DIR}/cache_common.c
+ ${HDF5_TEST_SOURCE_DIR}/external_common.c
${HDF5_TEST_SOURCE_DIR}/swmr_common.c
)
set (TEST_LIB_HEADERS
${HDF5_TEST_SOURCE_DIR}/h5test.h
${HDF5_TEST_SOURCE_DIR}/cache_common.h
+ ${HDF5_TEST_SOURCE_DIR}/external_common.h
+ ${HDF5_TEST_SOURCE_DIR}/external_fname.h
${HDF5_TEST_SOURCE_DIR}/swmr_common.h
)
-add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
-target_include_directories(${HDF5_TEST_LIB_TARGET}
- PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC)
-target_link_libraries (${HDF5_TEST_LIB_TARGET}
- PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET}
- PRIVATE $<$<PLATFORM_ID:Windows>:ws2_32.lib>
-)
-if (MINGW)
- target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib")
+if (NOT ONLY_SHARED_LIBS)
+ add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
+ target_include_directories (${HDF5_TEST_LIB_TARGET}
+ PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC)
+ target_link_libraries (${HDF5_TEST_LIB_TARGET}
+ PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET}
+ PRIVATE $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
+ )
+ if (MINGW)
+ target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib")
+ endif ()
+ H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC 0)
+ set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test)
endif ()
-H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC 0)
if (BUILD_SHARED_LIBS)
add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
- target_include_directories(${HDF5_TEST_LIBSH_TARGET}
+ target_include_directories (${HDF5_TEST_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
target_compile_definitions(${HDF5_TEST_LIBSH_TARGET}
- PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:H5_HAVE_THREADSAFE>
+ PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
)
TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_TEST_LIBSH_TARGET}
PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET}
- PRIVATE $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ PRIVATE $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
)
if (MINGW)
target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib")
@@ -85,9 +91,9 @@ if (BUILD_SHARED_LIBS)
set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME})
add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c)
- target_include_directories(${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED)
- target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET})
+ target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB")
set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
@@ -110,9 +116,9 @@ if (BUILD_SHARED_LIBS)
set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME})
add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c)
- target_include_directories(${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED)
- target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET})
+ target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB")
set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
@@ -205,6 +211,7 @@ set (H5_TESTS
extend
direct_chunk # compression lib link
external
+ external_env
efc
objcopy
links
@@ -224,6 +231,9 @@ set (H5_TESTS
enc_dec_plist_cross_platform
getname
vfd
+ ros3
+ s3comms
+ hdfs
ntypes
dangle
dtransform
@@ -232,6 +242,7 @@ set (H5_TESTS
freespace
mf
vds
+ vds_env
file_image
unregister
cache_logging
@@ -241,17 +252,15 @@ set (H5_TESTS
macro (ADD_H5_EXE file)
add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c)
- target_include_directories(${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${file} STATIC)
- target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET})
- set_target_properties (${file} PROPERTIES FOLDER test)
- if (BUILD_SHARED_LIBS)
- add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c)
- target_include_directories(${file}-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${file}-shared SHARED)
- target_link_libraries (${file}-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET})
- set_target_properties (${file}-shared PROPERTIES FOLDER test)
+ target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (${file} STATIC)
+ target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (${file} SHARED)
+ target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
+ set_target_properties (${file} PROPERTIES FOLDER test)
endmacro ()
set (H5_TESTS_MULTIPLE
@@ -261,9 +270,9 @@ set (H5_TESTS_MULTIPLE
ttsafe
)
# Only build single source tests here
-foreach (test ${H5_TESTS})
- if (NOT ${test} IN_LIST H5_TESTS_MULTIPLE)
- ADD_H5_EXE(${test})
+foreach (h5_test ${H5_TESTS})
+ if (NOT h5_test IN_LIST H5_TESTS_MULTIPLE)
+ ADD_H5_EXE(${h5_test})
endif ()
endforeach ()
@@ -273,61 +282,58 @@ endforeach ()
######### Also special handling of link libs #############
#-- Adding test for direct_chunk
add_executable (direct_chunk ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c)
-target_include_directories(direct_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (direct_chunk STATIC)
-target_link_libraries (direct_chunk PRIVATE ${HDF5_TEST_LIB_TARGET} ${LINK_COMP_LIBS})
-set_target_properties (direct_chunk PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (direct_chunk-shared ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c)
- target_include_directories(direct_chunk-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (direct_chunk-shared SHARED)
- target_link_libraries (direct_chunk-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${LINK_COMP_LIBS})
- set_target_properties (direct_chunk-shared PROPERTIES FOLDER test)
+target_include_directories (direct_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (direct_chunk STATIC)
+ target_link_libraries (direct_chunk PRIVATE ${HDF5_TEST_LIB_TARGET} ${LINK_COMP_LIBS})
+else ()
+ TARGET_C_PROPERTIES (direct_chunk SHARED)
+ target_link_libraries (direct_chunk PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${LINK_COMP_LIBS})
endif ()
+set_target_properties (direct_chunk PROPERTIES FOLDER test)
######### Special handling for multiple sources #############
#-- Adding test for testhdf5
add_executable (testhdf5 ${testhdf5_SOURCES})
-target_include_directories(testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (testhdf5 STATIC)
-target_link_libraries (testhdf5 PRIVATE ${HDF5_TEST_LIB_TARGET})
-set_target_properties (testhdf5 PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (testhdf5-shared ${testhdf5_SOURCES})
- target_include_directories(testhdf5-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (testhdf5-shared SHARED)
- target_link_libraries (testhdf5-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET})
- set_target_properties (testhdf5-shared PROPERTIES FOLDER test)
+target_include_directories (testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (testhdf5 STATIC)
+ target_link_libraries (testhdf5 PRIVATE ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (testhdf5 SHARED)
+ target_link_libraries (testhdf5 PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
+set_target_properties (testhdf5 PROPERTIES FOLDER test)
#-- Adding test for cache_image
add_executable (cache_image ${cache_image_SOURCES})
-target_include_directories(cache_image PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (cache_image STATIC)
-target_link_libraries (cache_image PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
-set_target_properties (cache_image PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (cache_image-shared ${cache_image_SOURCES})
- target_include_directories(cache_image-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (cache_image-shared SHARED)
- target_link_libraries (cache_image-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (cache_image-shared PROPERTIES FOLDER test)
+target_include_directories (cache_image PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (cache_image STATIC)
+ target_link_libraries (cache_image PRIVATE ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (cache_image SHARED)
+ target_link_libraries (cache_image PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
+set_target_properties (cache_image PROPERTIES FOLDER test)
#-- Adding test for ttsafe
add_executable (ttsafe ${ttsafe_SOURCES})
-target_include_directories(ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (ttsafe STATIC)
-target_link_libraries (ttsafe PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
-set_target_properties (ttsafe PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (ttsafe-shared ${ttsafe_SOURCES})
- target_include_directories(ttsafe-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (ttsafe-shared SHARED)
- target_link_libraries (ttsafe-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (ttsafe-shared PROPERTIES FOLDER test)
+target_include_directories (ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (ttsafe STATIC)
+ target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIB_TARGET})
+ if (NOT WIN32)
+ target_link_libraries (ttsafe
+ PRIVATE $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>
+ )
+ endif ()
+else ()
+ TARGET_C_PROPERTIES (ttsafe SHARED)
+ target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIBSH_TARGET} $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>)
endif ()
+set_target_properties (ttsafe PROPERTIES FOLDER test)
##############################################################################
### A D D I T I O N A L T E S T S ###
@@ -346,15 +352,15 @@ set (H5_CHECK_TESTS
flushrefresh
)
-foreach (test ${H5_CHECK_TESTS})
- ADD_H5_EXE(${test})
+foreach (h5_test ${H5_CHECK_TESTS})
+ ADD_H5_EXE(${h5_test})
endforeach ()
#-- Adding test for libinfo
set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake)
file (WRITE ${GREP_RUNNER}
"file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\")
-if (\${TEST_RESULT} STREQUAL \"0\")
+if (NOT TEST_RESULT)
message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\")
else ()
message (STATUS \"COMMAND Result: \${TEST_RESULT}\")
@@ -379,8 +385,8 @@ set (H5_SWMR_TESTS
swmr_writer
)
-foreach (test ${H5_SWMR_TESTS})
- ADD_H5_EXE(${test})
+foreach (h5_test ${H5_SWMR_TESTS})
+ ADD_H5_EXE(${h5_test})
endforeach ()
set (H5_VDS_SWMR_TESTS
@@ -389,39 +395,35 @@ set (H5_VDS_SWMR_TESTS
vds_swmr_writer
)
-foreach (test ${H5_VDS_SWMR_TESTS})
- ADD_H5_EXE(${test})
+foreach (h5_test ${H5_VDS_SWMR_TESTS})
+ ADD_H5_EXE(${h5_test})
endforeach ()
#-- Adding test for accum_swmr_reader
# This has to be copied to the test directory for execve() to find it
# and it can't be renamed (i.e., no <foo>-shared).
add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c)
-target_include_directories(accum_swmr_reader PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (accum_swmr_reader STATIC)
-target_link_libraries (accum_swmr_reader PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+target_include_directories (accum_swmr_reader PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (accum_swmr_reader STATIC)
+ target_link_libraries (accum_swmr_reader PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (accum_swmr_reader SHARED)
+ target_link_libraries (accum_swmr_reader PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (accum_swmr_reader PROPERTIES FOLDER test)
#-- Set accum dependencies
set_target_properties (accum PROPERTIES DEPENDS accum_swmr_reader)
-if (BUILD_SHARED_LIBS)
- set_target_properties (accum-shared PROPERTIES DEPENDS accum_swmr_reader)
-endif ()
##############################################################################
### P L U G I N T E S T S
##############################################################################
if (BUILD_SHARED_LIBS)
add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c)
- target_include_directories(filter_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (filter_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (filter_plugin SHARED)
- target_link_libraries (filter_plugin PRIVATE ${HDF5_TEST_LIB_TARGET})
- set_target_properties (filter_plugin PROPERTIES FOLDER test)
-else ()
- add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c)
- target_include_directories(filter_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (filter_plugin STATIC)
- target_link_libraries (filter_plugin PRIVATE ${HDF5_TEST_LIB_TARGET})
+ target_link_libraries (filter_plugin PRIVATE ${HDF5_TEST_LIBSH_TARGET})
set_target_properties (filter_plugin PROPERTIES FOLDER test)
endif ()
@@ -430,44 +432,38 @@ endif ()
##############################################################################
set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c)
add_executable (use_append_chunk ${use_append_chunk_SOURCES})
-target_include_directories(use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (use_append_chunk STATIC)
-target_link_libraries (use_append_chunk PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
-set_target_properties (use_append_chunk PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (use_append_chunk-shared ${use_append_chunk_SOURCES})
- target_include_directories(use_append_chunk-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (use_append_chunk-shared SHARED)
- target_link_libraries (use_append_chunk-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (use_append_chunk-shared PROPERTIES FOLDER test)
+target_include_directories (use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (use_append_chunk STATIC)
+ target_link_libraries (use_append_chunk PRIVATE ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (use_append_chunk SHARED)
+ target_link_libraries (use_append_chunk PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
+set_target_properties (use_append_chunk PROPERTIES FOLDER test)
set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c)
add_executable (use_append_mchunks ${use_append_mchunks_SOURCES})
-target_include_directories(use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (use_append_mchunks STATIC)
-target_link_libraries (use_append_mchunks PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
-set_target_properties (use_append_mchunks PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (use_append_mchunks-shared ${use_append_mchunks_SOURCES})
- target_include_directories(use_append_mchunks-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (use_append_mchunks-shared SHARED)
- target_link_libraries (use_append_mchunks-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (use_append_mchunks-shared PROPERTIES FOLDER test)
+target_include_directories (use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (use_append_mchunks STATIC)
+ target_link_libraries (use_append_mchunks PRIVATE ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (use_append_mchunks SHARED)
+ target_link_libraries (use_append_mchunks PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
+set_target_properties (use_append_mchunks PROPERTIES FOLDER test)
set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c)
add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES})
-target_include_directories(use_disable_mdc_flushes PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC)
-target_link_libraries (use_disable_mdc_flushes PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
-set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (use_disable_mdc_flushes-shared ${use_disable_mdc_flushes_SOURCES})
- target_include_directories(use_disable_mdc_flushes-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (use_disable_mdc_flushes-shared SHARED)
- target_link_libraries (use_disable_mdc_flushes-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (use_disable_mdc_flushes-shared PROPERTIES FOLDER test)
+target_include_directories (use_disable_mdc_flushes PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC)
+ target_link_libraries (use_disable_mdc_flushes PRIVATE ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (use_disable_mdc_flushes SHARED)
+ target_link_libraries (use_disable_mdc_flushes PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
+set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test)
include (CMakeTests.cmake)
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index a8dd647..800bfb6 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -20,11 +20,6 @@
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST")
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/testfiles")
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/testfiles/plist_files")
-if (BUILD_SHARED_LIBS)
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared")
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles")
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files")
-endif ()
# --------------------------------------------------------------------
# Copy all the HDF5 files from the source directory into the test directory
@@ -39,20 +34,9 @@ add_custom_command (
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different "$<TARGET_FILE:accum_swmr_reader>" "${PROJECT_BINARY_DIR}/H5TEST/accum_swmr_reader"
)
-if (BUILD_SHARED_LIBS)
- add_custom_command (
- TARGET accum_swmr_reader
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:accum_swmr_reader>" "${PROJECT_BINARY_DIR}/H5TEST-shared/accum_swmr_reader"
- )
-endif ()
foreach (h5_tfile ${HDF5_TEST_FILES})
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST/${h5_tfile}" "HDF5_TEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files")
- endif ()
endforeach ()
# --------------------------------------------------------------------
@@ -68,9 +52,6 @@ set (HDF5_REFERENCE_FILES
foreach (ref_file ${HDF5_REFERENCE_FILES})
HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST/${ref_file}" "HDF5_TEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${ref_file}" "HDF5_TEST_LIBSH_files")
- endif ()
endforeach ()
# --------------------------------------------------------------------
@@ -130,10 +111,6 @@ set (HDF5_REFERENCE_PLIST_FILES
foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES})
HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST/testfiles/plist_files/${plistfile}" "HDF5_TEST_LIB_files")
HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST/testfiles/plist_files/def_${plistfile}" "HDF5_TEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files/${plistfile}" "HDF5_TEST_LIBSH_files")
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files/def_${plistfile}" "HDF5_TEST_LIBSH_files")
- endif ()
endforeach ()
# --------------------------------------------------------------------
@@ -158,6 +135,7 @@ set (HDF5_REFERENCE_TEST_FILES
filespace_1_6.h5
filespace_1_8.h5
fill_old.h5
+ fill18.h5
filter_error.h5
fsm_aggr_nopersist.h5
fsm_aggr_persist.h5
@@ -194,120 +172,63 @@ set (HDF5_REFERENCE_TEST_FILES
foreach (h5_file ${HDF5_REFERENCE_TEST_FILES})
HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST/${h5_file}" "HDF5_TEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST-shared/${h5_file}" "HDF5_TEST_LIBSH_files")
- endif ()
endforeach ()
add_custom_target(HDF5_TEST_LIB_files ALL COMMENT "Copying files needed by HDF5_TEST_LIB tests" DEPENDS ${HDF5_TEST_LIB_files_list})
-if (BUILD_SHARED_LIBS)
- add_custom_target(HDF5_TEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_TEST_LIBSH tests" DEPENDS ${HDF5_TEST_LIBSH_files_list})
-endif ()
+
+set (testhdf5_CLEANFILES
+ coord.h5
+ dtypes10.h5
+ sys_file1
+ tattr.h5
+ tfile1.h5
+ tfile2.h5
+ tfile3.h5
+ tfile4.h5
+ tfile5.h5
+ tfile6.h5
+ tfile7.h5
+ tfilespace.h5
+ th5o_file
+ th5s1.h5
+ tselect.h5
+ tsohm.h5
+ tsohm_dst.h5
+ tsohm_src.h5
+)
# Remove any output file left over from previous test run
-add_test (NAME H5TEST-clear-testhdf5-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- coord.h5
- dtypes10.h5
- sys_file1
- tattr.h5
- tfile1.h5
- tfile2.h5
- tfile3.h5
- tfile4.h5
- tfile5.h5
- tfile6.h5
- tfile7.h5
- tfilespace.h5
- th5o_file
- th5s1.h5
- tselect.h5
- tsohm.h5
- tsohm_dst.h5
- tsohm_src.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST
+add_test (
+ NAME H5TEST-testhdf5-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${testhdf5_CLEANFILES}
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-set_tests_properties (H5TEST-clear-testhdf5-objects PROPERTIES FIXTURES_SETUP clear_testhdf5)
+set_tests_properties (H5TEST-testhdf5-clear-objects PROPERTIES FIXTURES_SETUP clear_testhdf5)
-add_test (NAME H5TEST-testhdf5-base COMMAND $<TARGET_FILE:testhdf5> -x heap -x file -x select)
+add_test (NAME H5TEST-testhdf5-base COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testhdf5> -x heap -x file -x select)
set_tests_properties (H5TEST-testhdf5-base PROPERTIES
FIXTURES_REQUIRED clear_testhdf5
ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-add_test (NAME H5TEST-testhdf5-heap COMMAND $<TARGET_FILE:testhdf5> -o heap)
+add_test (NAME H5TEST-testhdf5-heap COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testhdf5> -o heap)
set_tests_properties (H5TEST-testhdf5-heap PROPERTIES
FIXTURES_REQUIRED clear_testhdf5
ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-add_test (NAME H5TEST-testhdf5-file COMMAND $<TARGET_FILE:testhdf5> -o file)
+add_test (NAME H5TEST-testhdf5-file COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testhdf5> -o file)
set_tests_properties (H5TEST-testhdf5-file PROPERTIES
FIXTURES_REQUIRED clear_testhdf5
ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-add_test (NAME H5TEST-testhdf5-select COMMAND $<TARGET_FILE:testhdf5> -o select)
+add_test (NAME H5TEST-testhdf5-select COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testhdf5> -o select)
set_tests_properties (H5TEST-testhdf5-select PROPERTIES
FIXTURES_REQUIRED clear_testhdf5
ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- if (BUILD_SHARED_LIBS)
- add_test (NAME H5TEST-shared-clear-testhdf5-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- coord.h5
- dtypes10.h5
- sys_file1
- tattr.h5
- tfile1.h5
- tfile2.h5
- tfile3.h5
- tfile4.h5
- tfile5.h5
- tfile6.h5
- tfile7.h5
- tfilespace.h5
- th5o_file
- th5s1.h5
- tselect.h5
- tsohm.h5
- tsohm_dst.h5
- tsohm_src.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- set_tests_properties (H5TEST-shared-clear-testhdf5-objects PROPERTIES FIXTURES_SETUP shared_clear_testhdf5)
- add_test (NAME H5TEST-shared-testhdf5-base COMMAND $<TARGET_FILE:testhdf5-shared> -x heap -x file -x select)
- set_tests_properties (H5TEST-shared-testhdf5-base PROPERTIES
- FIXTURES_REQUIRED shared_clear_testhdf5
- ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- add_test (NAME H5TEST-shared-testhdf5-heap COMMAND $<TARGET_FILE:testhdf5-shared> -o heap)
- set_tests_properties (H5TEST-shared-testhdf5-heap PROPERTIES
- FIXTURES_REQUIRED shared_clear_testhdf5
- ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- add_test (NAME H5TEST-shared-testhdf5-file COMMAND $<TARGET_FILE:testhdf5-shared> -o file)
- set_tests_properties (H5TEST-shared-testhdf5-file PROPERTIES
- FIXTURES_REQUIRED shared_clear_testhdf5
- ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- add_test (NAME H5TEST-shared-testhdf5-select COMMAND $<TARGET_FILE:testhdf5-shared> -o select)
- set_tests_properties (H5TEST-shared-testhdf5-select PROPERTIES
- FIXTURES_REQUIRED shared_clear_testhdf5
- ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- endif ()
-endif ()
##############################################################################
##############################################################################
@@ -523,55 +444,57 @@ set (test_CLEANFILES
cache_logging.out
vds_swmr.h5
vds_swmr_src_*.h5
- tmp/vds_src_2.h5
+ tmp_vds_env/vds_src_2.h5
direct_chunk.h5
)
# Remove any output file left over from previous test run
-add_test (NAME H5TEST-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${test_CLEANFILES}
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST
+add_test (
+ NAME H5TEST-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${test_CLEANFILES}
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-set_tests_properties (H5TEST-clear-objects PROPERTIES FIXTURES_SETUP clear_objects)
+set_tests_properties (H5TEST-clear-objects PROPERTIES FIXTURES_SETUP clear_H5TEST)
set (H5TEST_SEPARATE_TESTS
testhdf5
cache
cache_image
+ external_env
flush1
flush2
+ vds_env
)
-foreach (test ${H5_TESTS})
- if (NOT ${test} IN_LIST H5TEST_SEPARATE_TESTS)
+foreach (h5_test ${H5_TESTS})
+ if (NOT h5_test IN_LIST H5TEST_SEPARATE_TESTS)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5TEST-${test} COMMAND $<TARGET_FILE:${test}>)
- set_tests_properties (H5TEST-${test} PROPERTIES
+ add_test (NAME H5TEST-${h5_test} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:${h5_test}>)
+ set_tests_properties (H5TEST-${h5_test} PROPERTIES
FIXTURES_REQUIRED clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
else ()
- if ("${test}" STREQUAL "big" AND CYGWIN)
- add_test (NAME H5TEST-${test}
+ if ("${h5_test}" STREQUAL "big" AND CYGWIN)
+ add_test (NAME H5TEST-${h5_test}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}"
)
else ()
- add_test (NAME H5TEST-${test} COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${test}>"
+ add_test (NAME H5TEST-${h5_test} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:${h5_test}>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
-D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=${test}.txt"
+ -D "TEST_OUTPUT=${h5_test}.txt"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
#-D "TEST_REFERENCE=${test}.out"
-D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- set_tests_properties (H5TEST-${test} PROPERTIES
- FIXTURES_REQUIRED clear_objects
+ set_tests_properties (H5TEST-${h5_test} PROPERTIES
+ FIXTURES_REQUIRED clear_H5TEST
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -584,63 +507,19 @@ set_tests_properties (H5TEST-big PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
set_tests_properties (H5TEST-btree2 PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
set_tests_properties (H5TEST-objcopy PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
-if (BUILD_SHARED_LIBS)
- # Remove any output file left over from previous test run
- add_test (NAME H5TEST-shared-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${test_CLEANFILES}
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- set_tests_properties (H5TEST-shared-clear-objects PROPERTIES FIXTURES_SETUP shared_clear_objects)
-
- foreach (test ${H5_TESTS})
- if (NOT ${test} IN_LIST H5TEST_SEPARATE_TESTS)
- if ("${test}" STREQUAL "big" AND CYGWIN)
- add_test (NAME H5TEST-shared-${test}
- COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared"
- )
- else ()
- add_test (NAME H5TEST-shared-${test} COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${test}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=${test}.txt"
- #-D "TEST_REFERENCE=${test}.out"
- -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
- set_tests_properties (H5TEST-shared-${test} PROPERTIES
- FIXTURES_REQUIRED shared_clear_objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- endif ()
- endforeach ()
-
- set_tests_properties (H5TEST-shared-fheap PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
- set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
- set_tests_properties (H5TEST-shared-btree2 PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
- set_tests_properties (H5TEST-shared-objcopy PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
-endif ()
-
#-- Adding test for cache
if (NOT CYGWIN)
- add_test (NAME H5TEST-clear-cache-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- cache_test.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST
+ add_test (
+ NAME H5TEST-cache-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove cache_test.h5
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
- set_tests_properties (H5TEST-clear-cache-objects PROPERTIES FIXTURES_SETUP cache_clear_objects)
+ set_tests_properties (H5TEST-cache-clear-objects PROPERTIES FIXTURES_SETUP clear_cache)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5TEST-cache COMMAND $<TARGET_FILE:cache>)
+ add_test (NAME H5TEST-cache COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cache>)
else ()
add_test (NAME H5TEST-cache COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:cache>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -652,7 +531,7 @@ if (NOT CYGWIN)
)
endif ()
set_tests_properties (H5TEST-cache PROPERTIES
- FIXTURES_REQUIRED cache_clear_objects
+ FIXTURES_REQUIRED clear_cache
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -660,62 +539,97 @@ if (NOT CYGWIN)
endif ()
if (TEST_CACHE_IMAGE)
-#-- Adding test for cache_image
+ #-- Adding test for cache_image
+ add_test (
+ NAME H5TEST-cache_image-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove cache_image_test.h5
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+ set_tests_properties (H5TEST-cache_image-clear-objects PROPERTIES FIXTURES_SETUP clear_cache_image)
+ add_test (NAME H5TEST_cache_image COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cache_image>)
+ set_tests_properties (H5TEST-cache_image PROPERTIES
+ FIXTURES_REQUIRED clear_cache_image
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+endif ()
+
+#-- Adding test for external_env
add_test (
- NAME H5TEST-clear-cache_image-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- cache_image_test.h5
+ NAME H5TEST-external_env-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
+ extern_1r.raw
+ extern_2r.raw
+ extern_3r.raw
+ extern_4r.raw
+ extern_1w.raw
+ extern_2w.raw
+ extern_3w.raw
+ extern_4w.raw
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
-set_tests_properties (H5TEST-clear-cache_image-objects PROPERTIES FIXTURES_SETUP cache_image_clear_objects)
-add_test (NAME H5TEST-cache_image COMMAND $<TARGET_FILE:cache_image>)
-set_tests_properties (H5TEST-cache_image PROPERTIES
- FIXTURES_REQUIRED cache_image_clear_objects
+set_tests_properties (H5TEST-external_env-clear-objects PROPERTIES FIXTURES_SETUP clear_external_env)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5TEST-external_env COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:external_env>)
+else ()
+ add_test (NAME H5TEST-external_env COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:external_env>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_ENV_VAR:STRING=HDF5_EXTFILE_PREFIX"
+ -D "TEST_ENV_VALUE:STRING=\${ORIGIN}"
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=external_env.txt"
+ #-D "TEST_REFERENCE=external_env.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+endif ()
+set_tests_properties (H5TEST-external_env PROPERTIES
+ FIXTURES_REQUIRED clear_external_env
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-endif ()
-if (BUILD_SHARED_LIBS)
- #-- Adding test for cache
- if (NOT CYGWIN AND NOT WIN32)
- add_test (NAME H5TEST-shared-clear-cache-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- cache_test.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- set_tests_properties (H5TEST-clear-objects PROPERTIES FIXTURES_SETUP shared_cache_clear_objects)
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5TEST-shared-cache COMMAND $<TARGET_FILE:cache-shared>)
- else ()
- add_test (NAME H5TEST-shared-cache COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:cache-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=cache-shared.txt"
- #-D "TEST_REFERENCE=cache-shared.out"
- -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
- set_tests_properties (H5TEST-shared-cache PROPERTIES
- FIXTURES_REQUIRED shared_cache_clear_objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
- endif ()
+#-- Adding test for vds_env
+add_test (
+ NAME H5TEST-vds_env-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
+ vds_virt_0.h5
+ vds_virt_3.h5
+ vds_src_2.h5
+ WORKING_DIRECTORY
+ ${HDF5_TEST_BINARY_DIR}/H5TEST
+)
+set_tests_properties (H5TEST-vds_env-clear-objects PROPERTIES FIXTURES_SETUP clear_vds_env)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5TEST-vds_env COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:vds_env>)
+else ()
+ add_test (NAME H5TEST-vds_env COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:vds_env>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_ENV_VAR:STRING=HDF5_VDS_PREFIX"
+ -D "TEST_ENV_VALUE:STRING=\${ORIGIN}/tmp_vds_env"
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=vds_env.txt"
+ #-D "TEST_REFERENCE=vds_env.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
endif ()
+set_tests_properties (H5TEST-vds_env PROPERTIES
+ FIXTURES_REQUIRED clear_vds_env
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+)
#-- Adding test for flush1/2
-add_test (NAME H5TEST-clear-flush-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+add_test (NAME H5TEST-flush-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
flush.h5
flush-swmr.h5
noflush.h5
@@ -727,10 +641,12 @@ add_test (NAME H5TEST-clear-flush-objects
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
+set_tests_properties (H5TEST-flush-clear-objects PROPERTIES FIXTURES_SETUP clear_flush)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5TEST-flush1 COMMAND $<TARGET_FILE:flush1>)
+ add_test (NAME H5TEST-flush1 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:flush1>)
else ()
add_test (NAME H5TEST-flush1 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:flush1>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -741,14 +657,15 @@ else ()
)
endif ()
set_tests_properties (H5TEST-flush1 PROPERTIES
- DEPENDS H5TEST-clear-flush-objects
+ FIXTURES_REQUIRED clear_flush
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5TEST-flush2 COMMAND $<TARGET_FILE:flush2>)
+ add_test (NAME H5TEST-flush2 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:flush2>)
else ()
add_test (NAME H5TEST-flush2 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:flush2>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -758,26 +675,28 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1)
+set_tests_properties (H5TEST-flush2 PROPERTIES
+ FIXTURES_REQUIRED clear_flush
+ DEPENDS H5TEST-flush1
+)
#-- Adding test for tcheck_version
-add_test (NAME H5TEST-tcheck_version-major COMMAND $<TARGET_FILE:tcheck_version> "-tM")
+add_test (NAME H5TEST-tcheck_version-major COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:tcheck_version> "-tM")
set_tests_properties (H5TEST-tcheck_version-major PROPERTIES
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
WILL_FAIL "true"
)
-add_test (NAME H5TEST-tcheck_version-minor COMMAND $<TARGET_FILE:tcheck_version> "-tm")
+add_test (NAME H5TEST-tcheck_version-minor COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:tcheck_version> "-tm")
set_tests_properties (H5TEST-tcheck_version-minor PROPERTIES
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
WILL_FAIL "true"
)
-add_test (NAME H5TEST-tcheck_version-release COMMAND $<TARGET_FILE:tcheck_version> "-tr")
+add_test (NAME H5TEST-tcheck_version-release COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:tcheck_version> "-tr")
set_tests_properties (H5TEST-tcheck_version-release PROPERTIES
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
WILL_FAIL "true"
)
-
##############################################################################
##############################################################################
### A D D I T I O N A L T E S T S ###
@@ -812,50 +731,36 @@ set_tests_properties (H5TEST-tcheck_version-release PROPERTIES
#-- Adding test for filenotclosed
add_test (
- NAME H5TEST-clear-filenotclosed-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- filenotclosed.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST
+ NAME H5TEST-filenotclosed-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove filenotclosed.h5
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-set_tests_properties (H5TEST-clear-filenotclosed-objects PROPERTIES FIXTURES_SETUP filenotclosed_clear_objects)
-add_test (NAME H5TEST-filenotclosed COMMAND $<TARGET_FILE:filenotclosed>)
+set_tests_properties (H5TEST-filenotclosed-clear-objects PROPERTIES FIXTURES_SETUP clear_filenotclosed)
+add_test (NAME H5TEST-filenotclosed COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:filenotclosed>)
set_tests_properties (H5TEST-filenotclosed PROPERTIES
- FIXTURES_REQUIRED filenotclosed_clear_objects
+ FIXTURES_REQUIRED clear_filenotclosed
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
#-- Adding test for del_many_dense_attrs
add_test (
- NAME H5TEST-clear-del_many_dense_attrs-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- del_many_dense_attrs.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST
+ NAME H5TEST-del_many_dense_attrs-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove del_many_dense_attrs.h5
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-set_tests_properties (H5TEST-clear-del_many_dense_attrs-objects PROPERTIES FIXTURES_SETUP del_many_dense_attrs_clear_objects)
-add_test (NAME H5TEST-del_many_dense_attrs COMMAND $<TARGET_FILE:del_many_dense_attrs>)
+set_tests_properties (H5TEST-del_many_dense_attrs-clear-objects PROPERTIES FIXTURES_SETUP clear_del_many_dense_attrs)
+add_test (NAME H5TEST-del_many_dense_attrs COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:del_many_dense_attrs>)
set_tests_properties (H5TEST-del_many_dense_attrs PROPERTIES
- FIXTURES_REQUIRED del_many_dense_attrs_clear_objects
+ FIXTURES_REQUIRED clear_del_many_dense_attrs
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
#-- Adding test for err_compat
-if (HDF5_ENABLE_DEPRECATED_SYMBOLS)
- add_test (NAME H5TEST-clear-err_compat-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- err_compat.txt
- err_compat.txt.err
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST
- )
- set_tests_properties (H5TEST-clear-err_compat-objects PROPERTIES FIXTURES_SETUP err_compat_clear_objects)
+if (HDF5_ENABLE_DEPRECATED_SYMBOLS AND NOT MINGW)
add_test (NAME H5TEST-err_compat COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:err_compat>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -867,30 +772,49 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS)
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5TEST-err_compat PROPERTIES
- FIXTURES_REQUIRED err_compat_clear_objects
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+else ()
+ add_test (NAME H5TEST-err_compat COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:err_compat>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_MASK_ERROR=true"
+ -D "ERROR_APPEND=1"
+ -D "TEST_OUTPUT=err_compat.txt"
+ -D "TEST_REFERENCE=err_compat_2"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5TEST-err_compat PROPERTIES
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
endif ()
#-- Adding test for error_test
-add_test (NAME H5TEST-clear-error_test-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- error_test.txt
- error_test.txt.err
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST
-)
-set_tests_properties (H5TEST-clear-error_test-objects PROPERTIES FIXTURES_SETUP error_test_clear_objects)
-if (HDF5_USE_16_API_DEFAULT)
- add_test (
- NAME H5TEST-error_test
- COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test>"
+if (DEFAULT_API_VERSION MATCHES "v16" OR MINGW)
+ add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_MASK_ERROR=true"
+ -D "ERROR_APPEND=1"
+ -D "TEST_OUTPUT=error_test.txt"
+ -D "TEST_REFERENCE=error_test_2"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5TEST-error_test PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
- set_property(TEST H5TEST-error_test PROPERTY DISABLED)
else ()
add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -902,149 +826,54 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5TEST-error_test PROPERTIES
- FIXTURES_REQUIRED error_test_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
endif ()
#-- Adding test for links_env
-add_test (NAME H5TEST-clear-links_env-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- links_env.txt
- links_env.txt.err
+add_test (NAME H5TEST-links_env-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
extlinks_env0.h5
extlinks_env1.h5
- tmp/extlinks_env1.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST
-)
-set_tests_properties (H5TEST-clear-links_env-objects PROPERTIES FIXTURES_SETUP links_env_clear_objects)
-add_test (NAME H5TEST-links_env COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:links_env>"
- -D "TEST_ARGS:STRING="
- -D "TEST_ENV_VAR:STRING=HDF5_EXT_PREFIX"
- -D "TEST_ENV_VALUE:STRING=.:tmp"
- -D "TEST_EXPECT=0"
- -D "TEST_OUTPUT=links_env.txt"
- -D "TEST_REFERENCE=links_env.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
-)
-set_tests_properties (H5TEST-links_env PROPERTIES
- FIXTURES_REQUIRED links_env_clear_objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
-)
-
-#-- Adding test for libinfo
-add_test (NAME H5TEST-testlibinfo
- COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIB_TARGET}>" -P "${GREP_RUNNER}"
+ tmp_links_env/extlinks_env1.h5
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
-
-if (BUILD_SHARED_LIBS)
- #-- Adding test for err_compat
- if (HDF5_ENABLE_DEPRECATED_SYMBOLS)
- add_test (NAME H5TEST-shared-clear-err_compat-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- err_compat.txt
- err_compat.txt.err
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- set_tests_properties (H5TEST-shared-clear-err_compat-objects PROPERTIES FIXTURES_SETUP shared_err_compat_clear_objects)
- add_test (NAME H5TEST-shared-err_compat COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:err_compat-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_MASK_ERROR=true"
- -D "ERROR_APPEND=1"
- -D "TEST_OUTPUT=err_compat.txt"
- -D "TEST_REFERENCE=err_compat_1"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- set_tests_properties (H5TEST-shared-err_compat PROPERTIES
- FIXTURES_REQUIRED shared_err_compat_clear_objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- endif ()
-
- #-- Adding test for error_test
- add_test (NAME H5TEST-shared-clear-error_test-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- error_test.txt
- error_test.txt.err
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- set_tests_properties (H5TEST-shared-clear-error_test-objects PROPERTIES FIXTURES_SETUP shared_error_test_clear_objects)
- if (HDF5_USE_16_API_DEFAULT)
- add_test (
- NAME H5TEST-shared-error_test
- COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test-shared>"
- )
- set_property(TEST H5TEST-shared-error_test PROPERTY DISABLED)
- else ()
- add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:error_test-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_MASK_ERROR=true"
- -D "ERROR_APPEND=1"
- -D "TEST_OUTPUT=error_test.txt"
- -D "TEST_REFERENCE=error_test_1"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- set_tests_properties (H5TEST-shared-error_test PROPERTIES
- FIXTURES_REQUIRED shared_error_test_clear_objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- endif ()
-
- #-- Adding test for links_env
- add_test (NAME H5TEST-shared-clear-links_env-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- links_env.txt
- links_env.txt.err
- extlinks_env0.h5
- extlinks_env1.h5
- tmp/extlinks_env1.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- set_tests_properties (H5TEST-shared-clear-links_env-objects PROPERTIES FIXTURES_SETUP shared_links_env_clear_objects)
- add_test (NAME H5TEST-shared-links_env COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:links_env-shared>"
+set_tests_properties (H5TEST-links_env-clear-objects PROPERTIES FIXTURES_SETUP clear_links_env)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5TEST-links_env COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:links_env>)
+else ()
+ add_test (NAME H5TEST-links_env COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:links_env>"
-D "TEST_ARGS:STRING="
- -D "TEST_ENV_VAR:STRING=HDF5_EXT_PREFIX"
- -D "TEST_ENV_VALUE:STRING=.:tmp"
+ #-D "TEST_ENV_VAR:STRING=HDF5_EXT_PREFIX"
+ #-D "TEST_ENV_VALUE:STRING=.:tmp_links_env"
-D "TEST_EXPECT=0"
-D "TEST_OUTPUT=links_env.txt"
-D "TEST_REFERENCE=links_env.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5TEST-shared-links_env PROPERTIES
- FIXTURES_REQUIRED shared_links_env_clear_objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
+endif ()
+set_tests_properties (H5TEST-links_env PROPERTIES
+ FIXTURES_REQUIRED clear_links_env
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_EXT_PREFIX=.:tmp_links_env"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+)
+if (NOT BUILD_SHARED_LIBS)
#-- Adding test for libinfo
- add_test (NAME H5TEST-shared-testlibinfo
+ add_test (NAME H5TEST-testlibinfo
+ COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIB_TARGET}>" -P "${GREP_RUNNER}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+else ()
+ #-- Adding test for libinfo
+ add_test (NAME H5TEST-testlibinfo
COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIBSH_TARGET}>" -P "${GREP_RUNNER}"
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
endif ()
@@ -1052,7 +881,7 @@ endif ()
### F I L T E R P L U G I N T E S T S
##############################################################################
if (BUILD_SHARED_LIBS)
- if (WIN32)
+ if (WIN32 OR MINGW)
set (CMAKE_SEP "\;")
set (BIN_REL_PATH "../../")
else ()
@@ -1060,7 +889,7 @@ if (BUILD_SHARED_LIBS)
set (BIN_REL_PATH "../")
endif ()
- add_test (NAME H5PLUGIN-filter_plugin COMMAND $<TARGET_FILE:filter_plugin>)
+ add_test (NAME H5PLUGIN-filter_plugin COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:filter_plugin>)
set_tests_properties (H5PLUGIN-filter_plugin PROPERTIES
ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/filter_plugin_dir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/filter_plugin_dir2;srcdir=${HDF5_TEST_BINARY_DIR}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}
@@ -1069,7 +898,7 @@ if (BUILD_SHARED_LIBS)
##############################################################################
# HDFFV-9655 relative plugin test disabled
#
-# add_test (NAME H5PLUGIN-pluginRelative COMMAND $<TARGET_FILE:plugin>)
+# add_test (NAME H5PLUGIN-pluginRelative COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:plugin>)
# set_tests_properties (H5PLUGIN-pluginRelative PROPERTIES
# ENVIRONMENT "HDF5_PLUGIN_PATH=@/${BIN_REL_PATH}testdir1${CMAKE_SEP}@/${BIN_REL_PATH}testdir2;srcdir=${HDF5_TEST_BINARY_DIR}"
# WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}
@@ -1077,10 +906,12 @@ if (BUILD_SHARED_LIBS)
##############################################################################
endif ()
+option (TEST_SHELL_SCRIPTS "Enable shell script tests" OFF)
if (TEST_SHELL_SCRIPTS)
include (ShellTests.cmake)
endif()
+option (ENABLE_EXTENDED_TESTS "Enable extended tests" OFF)
if (ENABLE_EXTENDED_TESTS)
##############################################################################
### S W M R T E S T S
@@ -1090,26 +921,20 @@ if (ENABLE_EXTENDED_TESTS)
# testswmr.sh: swmr*
# testvdsswmr.sh: vds_swmr*
-# add_test (NAME H5Test-swmr_check_compat_vfd COMMAND $<TARGET_FILE:swmr_check_compat_vfd>)
+# add_test (NAME H5Test-swmr_check_compat_vfd COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:swmr_check_compat_vfd>)
#-- Adding test for flushrefresh
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test")
- if (BUILD_SHARED_LIBS)
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/flushrefresh_test")
- endif ()
find_package (Perl)
if (PERL_FOUND)
- add_test (NAME H5TEST-clear-testflushrefresh-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- flushrefresh.txt
- flushrefresh.txt.err
- flushrefresh.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test
+ add_test (
+ NAME H5TEST-testflushrefresh-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove flushrefresh.h5
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test
)
- set_tests_properties (H5TEST-clear-testflushrefresh-objects PROPERTIES FIXTURES_SETUP testflushrefresh_clear_objects)
+ set_tests_properties (H5TEST-testflushrefresh-clear-objects PROPERTIES FIXTURES_SETUP clear_testflushrefresh)
add_test (NAME H5TEST-testflushrefresh COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:flushrefresh>"
-D "TEST_ARGS1:STRING=flushrefresh_VERIFICATION_START"
-D "TEST_ARGS2:STRING=flushrefresh_VERIFICATION_DONE"
@@ -1123,14 +948,14 @@ if (ENABLE_EXTENDED_TESTS)
-P "${HDF5_TEST_SOURCE_DIR}/flushrefreshTest.cmake"
)
set_tests_properties (H5TEST-testflushrefresh PROPERTIES
- FIXTURES_REQUIRED testflushrefresh_clear_objects
+ FIXTURES_REQUIRED clear_testflushrefresh
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test
)
- else ()
- message (STATUS "Cannot execute TEST flushrefresh - perl not found")
endif ()
-endif()
+else ()
+ message (STATUS "Cannot execute TEST flushrefresh - perl not found")
+endif ()
##############################################################################
##############################################################################
@@ -1148,10 +973,10 @@ endif ()
##############################################################################
##############################################################################
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
macro (ADD_H5_GENERATOR genfile)
add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c)
- target_include_directories(${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${genfile} STATIC)
target_link_libraries (${genfile} PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (${genfile} PROPERTIES FOLDER generator/test)
@@ -1182,8 +1007,8 @@ if (HDF5_BUILD_GENERATORS)
gen_plist
)
- foreach (gen ${H5_GENERATORS})
- ADD_H5_GENERATOR (${gen})
+ foreach (h5_gen ${H5_GENERATORS})
+ ADD_H5_GENERATOR (${h5_gen})
endforeach ()
endif ()
diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake
index 569f215..cf938f5 100644
--- a/test/CMakeVFDTests.cmake
+++ b/test/CMakeVFDTests.cmake
@@ -34,37 +34,23 @@ foreach (vfdtest ${VFD_LIST})
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}")
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles")
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files")
- if (BUILD_SHARED_LIBS)
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared")
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles")
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles/plist_files")
- endif ()
endforeach ()
foreach (vfdtest ${VFD_LIST})
foreach (h5_tfile ${HDF5_TEST_FILES})
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}" "HDF5_VFDTEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${h5_tfile}" "HDF5_VFDTEST_LIBSH_files")
- endif ()
endforeach ()
endforeach ()
foreach (vfdtest ${VFD_LIST})
foreach (ref_file ${HDF5_REFERENCE_FILES})
HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}/${ref_file}" "HDF5_VFDTEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${ref_file}" "HDF5_VFDTEST_LIBSH_files")
- endif ()
endforeach ()
endforeach ()
foreach (vfdtest ${VFD_LIST})
foreach (h5_file ${HDF5_REFERENCE_TEST_FILES})
HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}/${h5_file}" "HDF5_VFDTEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}-shared/${h5_file}" "HDF5_VFDTEST_LIBSH_files")
- endif ()
endforeach ()
endforeach ()
@@ -72,17 +58,10 @@ foreach (vfdtest ${VFD_LIST})
foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES})
HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files/${plistfile}" "HDF5_VFDTEST_LIB_files")
HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files/def_${plistfile}" "HDF5_VFDTEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles/plist_files/${plistfile}" "HDF5_VFDTEST_LIBSH_files")
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/testfiles/plist_files/def_${plistfile}" "HDF5_VFDTEST_LIBSH_files")
- endif ()
endforeach ()
endforeach ()
add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIB tests" DEPENDS ${HDF5_VFDTEST_LIB_files_list})
-if (BUILD_SHARED_LIBS)
- add_custom_target(HDF5_VFDTEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIBSH tests" DEPENDS ${HDF5_VFDTEST_LIBSH_files_list})
-endif ()
##############################################################################
##############################################################################
@@ -102,6 +81,8 @@ endif ()
tcheck_version
testmeta
links_env
+ external_env
+ vds_env
)
if (NOT CYGWIN)
list (REMOVE_ITEM H5_VFD_SKIP_TESTS big cache)
@@ -111,16 +92,10 @@ endif ()
macro (CHECK_VFD_TEST vfdtest vfdname resultcode)
if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2")
if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split")
- if (NOT BUILD_SHARED_LIBS AND NOT ${HDF_CFG_NAME} MATCHES "Debug")
- add_test (
- NAME VFD-${vfdname}-${vfdtest}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${vfdname}/${vfdname}-${vfdtest}.out
- ${vfdname}/${vfdname}-${vfdtest}.out.err
- )
+ if (NOT BUILD_SHARED_LIBS AND NOT HDF_CFG_NAME MATCHES "Debug")
add_test (NAME VFD-${vfdname}-${vfdtest}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
-D "TEST_ARGS:STRING="
-D "TEST_VFD:STRING=${vfdname}"
@@ -130,54 +105,18 @@ endif ()
-P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
)
set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
- DEPENDS VFD-${vfdname}-${vfdtest}-clear-objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
)
- if (BUILD_SHARED_LIBS)
- add_test (
- NAME VFD-${vfdname}-${vfdtest}-shared-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${vfdname}-shared/${vfdname}-${vfdtest}-shared.out
- ${vfdname}-shared/${vfdname}-${vfdtest}-shared.out.err
- )
- add_test (NAME VFD-${vfdname}-${test}-shared
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES
- DEPENDS VFD-${vfdname}-${vfdtest}-shared-clear-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared
- )
- endif ()
else ()
add_test (NAME VFD-${vfdname}-${vfdtest}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}"
)
- if (BUILD_SHARED_LIBS)
- add_test (NAME VFD-${vfdname}-${test}-shared
- COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared"
- )
- endif ()
endif ()
else ()
- add_test (
- NAME VFD-${vfdname}-${vfdtest}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${vfdname}/${vfdname}-${vfdtest}.out
- ${vfdname}/${vfdname}-${vfdtest}.out.err
- )
add_test (NAME VFD-${vfdname}-${vfdtest}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
-D "TEST_ARGS:STRING="
-D "TEST_VFD:STRING=${vfdname}"
@@ -187,45 +126,14 @@ endif ()
-P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
)
set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
- DEPENDS VFD-${vfdname}-${vfdtest}-clear-objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
)
- if (BUILD_SHARED_LIBS)
- add_test (
- NAME VFD-${vfdname}-${vfdtest}-shared-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${vfdname}-shared/${vfdname}-${vfdtest}-shared.out
- ${vfdname}-shared/${vfdname}-${vfdtest}-shared.out.err
- )
- add_test (NAME VFD-${vfdname}-${test}-shared
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES
- DEPENDS VFD-${vfdname}-${vfdtest}-shared-clear-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared
- )
- endif ()
endif ()
else ()
- add_test (
- NAME VFD-${vfdname}-${vfdtest}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${vfdname}/${vfdname}-${vfdtest}.out
- ${vfdname}/${vfdname}-${vfdtest}.out.err
- )
add_test (NAME VFD-${vfdname}-${vfdtest}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
-D "TEST_ARGS:STRING="
-D "TEST_VFD:STRING=${vfdname}"
@@ -235,93 +143,37 @@ endif ()
-P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
)
set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
- DEPENDS VFD-${vfdname}-${vfdtest}-clear-objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
)
- if (BUILD_SHARED_LIBS AND NOT "${vfdtest}" STREQUAL "cache")
- add_test (
- NAME VFD-${vfdname}-${vfdtest}-shared-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${vfdname}-shared/${vfdname}-${vfdtest}-shared.out
- ${vfdname}-shared/${vfdname}-${vfdtest}-shared.out.err
- )
- add_test (NAME VFD-${vfdname}-${vfdtest}-shared
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES
- DEPENDS VFD-${vfdname}-${vfdtest}-shared-clear-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared
- )
- endif ()
endif ()
endmacro ()
macro (DO_VFD_TEST vfdtest vfdname resultcode)
- add_test (
- NAME VFD-${vfdname}-${vfdtest}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${vfdname}/${vfdname}-${vfdtest}.out
- ${vfdname}/${vfdname}-${vfdtest}.out.err
- )
- add_test (NAME VFD-${vfdname}-${vfdtest}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${vfdtest}.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
- DEPENDS VFD-${vfdname}-${vfdtest}-clear-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
- )
- if (BUILD_SHARED_LIBS)
- add_test (
- NAME VFD-${vfdname}-${vfdtest}-shared-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${vfdname}-shared/${vfdname}-${vfdtest}-shared.out
- ${vfdname}-shared/${vfdname}-${vfdtest}-shared.out.err
- )
- add_test (NAME VFD-${vfdname}-${vfdtest}-shared
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES
- DEPENDS VFD-${vfdname}-${vfdtest}-shared-clear-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared
- )
- endif ()
+ add_test (NAME VFD-${vfdname}-${vfdtest}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_VFD:STRING=${vfdname}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${vfdname}-${vfdtest}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
+ -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
+ )
endmacro ()
macro (ADD_VFD_TEST vfdname resultcode)
- foreach (test ${H5_TESTS})
- if (NOT ${test} IN_LIST H5_VFD_SKIP_TESTS)
+ foreach (h5_test ${H5_TESTS})
+ if (NOT h5_test IN_LIST H5_VFD_SKIP_TESTS)
if (WIN32)
- CHECK_VFD_TEST (${test} ${vfdname} ${resultcode})
+ CHECK_VFD_TEST (${h5_test} ${vfdname} ${resultcode})
else ()
- DO_VFD_TEST (${test} ${vfdname} ${resultcode})
+ DO_VFD_TEST (${h5_test} ${vfdname} ${resultcode})
endif ()
endif ()
endforeach ()
@@ -332,25 +184,10 @@ endif ()
if (NOT CYGWIN)
set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
endif ()
- if (BUILD_SHARED_LIBS)
- set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared)
- set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10)
- set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10)
- set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
- if (NOT CYGWIN AND NOT WIN32)
- set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
- endif ()
- endif ()
if (HDF5_TEST_FHEAP_VFD)
- add_test (
- NAME VFD-${vfdname}-fheap-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${vfdname}/${vfdname}-fheap.out
- ${vfdname}/${vfdname}-fheap.out.err
- )
add_test (NAME VFD-${vfdname}-fheap
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:fheap>"
-D "TEST_ARGS:STRING="
-D "TEST_VFD:STRING=${vfdname}"
@@ -360,40 +197,14 @@ endif ()
-P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
)
set_tests_properties (VFD-${vfdname}-fheap PROPERTIES
- DEPENDS VFD-${vfdname}-fheap-clear-objects
TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
)
- if (BUILD_SHARED_LIBS)
- add_test (
- NAME VFD-${vfdname}-fheap-shared-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${vfdname}-shared/${vfdname}-fheap-shared.out
- ${vfdname}-shared/${vfdname}-fheap-shared.out.err
- )
- add_test (NAME VFD-${vfdname}-fheap-shared
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:fheap-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-fheap-shared.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES
- DEPENDS VFD-${vfdname}-fheap-shared-clear-objects
- TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared
- )
- endif ()
endif ()
endmacro ()
# Run test with different Virtual File Driver
- foreach (vfd ${VFD_LIST})
- ADD_VFD_TEST (${vfd} 0)
+ foreach (h5_vfd ${VFD_LIST})
+ ADD_VFD_TEST (${h5_vfd} 0)
endforeach ()
diff --git a/test/Makefile.am b/test/Makefile.am
index c4fb876..276b262 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -26,21 +26,23 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_builddir)/src
# testlibinfo.sh:
# testcheck_version.sh: tcheck_version
# testlinks_env.sh: links_env
+# testexternal_env.sh: external_env
# testflushrefresh.sh: flushrefresh
+# testvds_env.sh: vds_env
# testswmr.sh: swmr*
# testvdsswmr.sh: vds_swmr*
# testabort_fail.sh: filenotclosed.c and del_many_dense_attrs.c
# test_filter_plugin.sh: filter_plugin.c
# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes
-TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh \
- testswmr.sh testvdsswmr.sh testflushrefresh.sh test_usecases.sh testabort_fail.sh
+TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh testexternal_env.sh \
+ testswmr.sh testvds_env.sh testvdsswmr.sh testflushrefresh.sh test_usecases.sh testabort_fail.sh
SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) \
- filenotclosed$(EXEEXT) del_many_dense_attrs$(EXEEXT) \
+ external_env$(EXEEXT) filenotclosed$(EXEEXT) del_many_dense_attrs$(EXEEXT) \
flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \
swmr_generator$(EXEEXT) swmr_reader$(EXEEXT) swmr_writer$(EXEEXT) \
swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) swmr_addrem_writer$(EXEEXT) \
swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) swmr_start_write$(EXEEXT) \
- vds_swmr_gen$(EXEEXT) vds_swmr_reader$(EXEEXT) vds_swmr_writer$(EXEEXT)
+ vds_env$(EXEEXT) vds_swmr_gen$(EXEEXT) vds_swmr_reader$(EXEEXT) vds_swmr_writer$(EXEEXT)
if HAVE_SHARED_CONDITIONAL
TEST_SCRIPT += test_filter_plugin.sh
SCRIPT_DEPEND += filter_plugin$(EXEEXT)
@@ -53,15 +55,15 @@ check_SCRIPTS = $(TEST_SCRIPT)
# As an exception, long-running tests should occur earlier in the list.
# This gives them more time to run when tests are executing in parallel.
TEST_PROG= testhdf5 \
- cache cache_api cache_image cache_tagging lheap ohdr stab gheap \
- evict_on_close farray earray btree2 fheap \
+ cache cache_api cache_image cache_tagging lheap ohdr \
+ stab gheap evict_on_close farray earray btree2 fheap \
pool accum hyperslab istore bittests dt_arith page_buffer \
dtypes dsets chunk_info cmpd_dset filter_fail extend direct_chunk \
external efc objcopy links unlink twriteorder big mtime fillval mount \
flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \
- enc_dec_plist_cross_platform getname vfd ntypes dangle dtransform \
- reserved cross_read freespace mf vds file_image unregister \
- cache_logging cork swmr
+ enc_dec_plist_cross_platform getname vfd ros3 s3comms hdfs ntypes \
+ dangle dtransform reserved cross_read freespace mf vds file_image \
+ unregister cache_logging cork swmr
# List programs to be built when testing here.
# error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh.
@@ -69,21 +71,23 @@ TEST_PROG= testhdf5 \
# accum_swmr_reader is used by accum.c.
# atomic_writer and atomic_reader are standalone programs.
# links_env is used by testlinks_env.sh
+# external_env is used by testexternal_env.sh
# filenotclosed and del_many_dense_attrs are used by testabort_fail.sh
# flushrefresh is used by testflushrefresh.sh.
# use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh
# swmr_* files (besides swmr.c) are used by testswmr.sh.
# vds_swmr_* files are used by testvdsswmr.sh
+# vds_env is used by testvds_env.sh
# 'make check' doesn't run them directly, so they are not included in TEST_PROG.
# Also build testmeta, which is used for timings test. It builds quickly,
# and this lets automake keep all its test programs in one place.
check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \
- testmeta accum_swmr_reader atomic_writer atomic_reader \
+ testmeta accum_swmr_reader atomic_writer atomic_reader external_env \
links_env filenotclosed del_many_dense_attrs flushrefresh \
use_append_chunk use_append_mchunks use_disable_mdc_flushes \
swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove_reader \
swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \
- swmr_check_compat_vfd vds_swmr_gen vds_swmr_reader vds_swmr_writer
+ swmr_check_compat_vfd vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer
if HAVE_SHARED_CONDITIONAL
check_PROGRAMS+= filter_plugin
endif
@@ -124,7 +128,7 @@ else
noinst_LTLIBRARIES=libh5test.la
endif
-libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c
+libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c external_common.c
# Use libhd5test.la to compile all of the tests
LDADD=libh5test.la $(LIBHDF5)
@@ -167,8 +171,9 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse
extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \
sys_file1 tfile[1-7].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \
stab.h5 extern_[1-5].h5 extern_[1-4][rw].raw gheap[0-4].h5 \
- ohdr_min_a.h5 ohdr_min_b.h5 min_dset_ohdr_testfile.h5 \
- dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 tmp \
+ ohdr_min_a.h5 ohdr_min_b.h5 min_dset_ohdr_testfile.h5\
+ dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 \
+ tmp tmp_links tmp2_links tmp_links_env tmp_vds_env \
big.data big[0-9][0-9][0-9][0-9][0-9].h5 \
stdio.h5 sec2.h5 dtypes[0-9].h5 dtypes1[0].h5 dt_arith[1-2].h5 tattr.h5 \
tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \
@@ -185,8 +190,8 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse
dtransform.h5 test_filters.h5 get_file_name.h5 tstint[1-2].h5 \
unlink_chunked.h5 btree2.h5 btree2_tmp.h5 objcopy_src.h5 objcopy_dst.h5 \
objcopy_ext.dat trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 farray_tmp.h5 \
- earray.h5 earray_tmp.h5 efc[0-5].h5 log_vfd_out.log \
- new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \
+ earray.h5 earray_tmp.h5 efc[0-5].h5 log_vfd_out.log log_ros3_out.log \
+ log_s3comms_out.log new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \
split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \
file_image_core_test.h5.copy unregister_filter_1.h5 unregister_filter_2.h5 \
vds_virt.h5 vds_dapl.h5 vds_src_[0-1].h5 \
@@ -211,6 +216,6 @@ use_disable_mdc_flushes_SOURCES=use_disable_mdc_flushes.c
# Temporary files.
DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_filter_plugin.sh \
- testswmr.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh testabort_fail.sh
+ testexternal_env.sh testswmr.sh testvds_env.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh testabort_fail.sh
include $(top_srcdir)/config/conclude.am
diff --git a/test/Makefile.in b/test/Makefile.in
index 198d4ab..8eb3f9d 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -109,15 +109,16 @@ host_triplet = @host@
check_PROGRAMS = $(am__EXEEXT_1) error_test$(EXEEXT) \
err_compat$(EXEEXT) tcheck_version$(EXEEXT) testmeta$(EXEEXT) \
accum_swmr_reader$(EXEEXT) atomic_writer$(EXEEXT) \
- atomic_reader$(EXEEXT) links_env$(EXEEXT) \
- filenotclosed$(EXEEXT) del_many_dense_attrs$(EXEEXT) \
- flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) \
- use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \
- swmr_generator$(EXEEXT) swmr_start_write$(EXEEXT) \
- swmr_reader$(EXEEXT) swmr_writer$(EXEEXT) \
- swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) \
- swmr_addrem_writer$(EXEEXT) swmr_sparse_reader$(EXEEXT) \
- swmr_sparse_writer$(EXEEXT) swmr_check_compat_vfd$(EXEEXT) \
+ atomic_reader$(EXEEXT) external_env$(EXEEXT) \
+ links_env$(EXEEXT) filenotclosed$(EXEEXT) \
+ del_many_dense_attrs$(EXEEXT) flushrefresh$(EXEEXT) \
+ use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) \
+ use_disable_mdc_flushes$(EXEEXT) swmr_generator$(EXEEXT) \
+ swmr_start_write$(EXEEXT) swmr_reader$(EXEEXT) \
+ swmr_writer$(EXEEXT) swmr_remove_reader$(EXEEXT) \
+ swmr_remove_writer$(EXEEXT) swmr_addrem_writer$(EXEEXT) \
+ swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) \
+ swmr_check_compat_vfd$(EXEEXT) vds_env$(EXEEXT) \
vds_swmr_gen$(EXEEXT) vds_swmr_reader$(EXEEXT) \
vds_swmr_writer$(EXEEXT) $(am__EXEEXT_2)
@HAVE_SHARED_CONDITIONAL_TRUE@am__append_3 = filter_plugin
@@ -151,8 +152,9 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/H5config.h \
$(top_builddir)/fortran/src/H5config_f.inc
CONFIG_CLEAN_FILES = H5srcdir_str.h testabort_fail.sh \
- testcheck_version.sh testerror.sh testflushrefresh.sh \
- testlibinfo.sh testlinks_env.sh testswmr.sh testvdsswmr.sh \
+ testcheck_version.sh testerror.sh testexternal_env.sh \
+ testflushrefresh.sh testlibinfo.sh testlinks_env.sh \
+ testswmr.sh testvds_env.sh testvdsswmr.sh \
test_filter_plugin.sh test_usecases.sh
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
@@ -209,7 +211,7 @@ libfilter_plugin4_groups_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
@HAVE_SHARED_CONDITIONAL_TRUE@am_libfilter_plugin4_groups_la_rpath =
libh5test_la_LIBADD =
am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo \
- swmr_common.lo
+ swmr_common.lo external_common.lo
libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS)
@HAVE_SHARED_CONDITIONAL_FALSE@am_libh5test_la_rpath =
@HAVE_SHARED_CONDITIONAL_TRUE@am_libh5test_la_rpath =
@@ -228,11 +230,12 @@ am__EXEEXT_1 = testhdf5$(EXEEXT) cache$(EXEEXT) cache_api$(EXEEXT) \
flush2$(EXEEXT) app_ref$(EXEEXT) enum$(EXEEXT) \
set_extent$(EXEEXT) ttsafe$(EXEEXT) enc_dec_plist$(EXEEXT) \
enc_dec_plist_cross_platform$(EXEEXT) getname$(EXEEXT) \
- vfd$(EXEEXT) ntypes$(EXEEXT) dangle$(EXEEXT) \
- dtransform$(EXEEXT) reserved$(EXEEXT) cross_read$(EXEEXT) \
- freespace$(EXEEXT) mf$(EXEEXT) vds$(EXEEXT) \
- file_image$(EXEEXT) unregister$(EXEEXT) cache_logging$(EXEEXT) \
- cork$(EXEEXT) swmr$(EXEEXT)
+ vfd$(EXEEXT) ros3$(EXEEXT) s3comms$(EXEEXT) hdfs$(EXEEXT) \
+ ntypes$(EXEEXT) dangle$(EXEEXT) dtransform$(EXEEXT) \
+ reserved$(EXEEXT) cross_read$(EXEEXT) freespace$(EXEEXT) \
+ mf$(EXEEXT) vds$(EXEEXT) file_image$(EXEEXT) \
+ unregister$(EXEEXT) cache_logging$(EXEEXT) cork$(EXEEXT) \
+ swmr$(EXEEXT)
@HAVE_SHARED_CONDITIONAL_TRUE@am__EXEEXT_2 = filter_plugin$(EXEEXT)
am__EXEEXT_3 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \
gen_cross$(EXEEXT) gen_deflate$(EXEEXT) gen_filters$(EXEEXT) \
@@ -382,6 +385,10 @@ external_SOURCES = external.c
external_OBJECTS = external.$(OBJEXT)
external_LDADD = $(LDADD)
external_DEPENDENCIES = libh5test.la $(LIBHDF5)
+external_env_SOURCES = external_env.c
+external_env_OBJECTS = external_env.$(OBJEXT)
+external_env_LDADD = $(LDADD)
+external_env_DEPENDENCIES = libh5test.la $(LIBHDF5)
farray_SOURCES = farray.c
farray_OBJECTS = farray.$(OBJEXT)
farray_LDADD = $(LDADD)
@@ -514,6 +521,10 @@ gheap_SOURCES = gheap.c
gheap_OBJECTS = gheap.$(OBJEXT)
gheap_LDADD = $(LDADD)
gheap_DEPENDENCIES = libh5test.la $(LIBHDF5)
+hdfs_SOURCES = hdfs.c
+hdfs_OBJECTS = hdfs.$(OBJEXT)
+hdfs_LDADD = $(LDADD)
+hdfs_DEPENDENCIES = libh5test.la $(LIBHDF5)
hyperslab_SOURCES = hyperslab.c
hyperslab_OBJECTS = hyperslab.$(OBJEXT)
hyperslab_LDADD = $(LDADD)
@@ -570,6 +581,14 @@ reserved_SOURCES = reserved.c
reserved_OBJECTS = reserved.$(OBJEXT)
reserved_LDADD = $(LDADD)
reserved_DEPENDENCIES = libh5test.la $(LIBHDF5)
+ros3_SOURCES = ros3.c
+ros3_OBJECTS = ros3.$(OBJEXT)
+ros3_LDADD = $(LDADD)
+ros3_DEPENDENCIES = libh5test.la $(LIBHDF5)
+s3comms_SOURCES = s3comms.c
+s3comms_OBJECTS = s3comms.$(OBJEXT)
+s3comms_LDADD = $(LDADD)
+s3comms_DEPENDENCIES = libh5test.la $(LIBHDF5)
set_extent_SOURCES = set_extent.c
set_extent_OBJECTS = set_extent.$(OBJEXT)
set_extent_LDADD = $(LDADD)
@@ -684,6 +703,10 @@ vds_SOURCES = vds.c
vds_OBJECTS = vds.$(OBJEXT)
vds_LDADD = $(LDADD)
vds_DEPENDENCIES = libh5test.la $(LIBHDF5)
+vds_env_SOURCES = vds_env.c
+vds_env_OBJECTS = vds_env.$(OBJEXT)
+vds_env_LDADD = $(LDADD)
+vds_env_DEPENDENCIES = libh5test.la $(LIBHDF5)
vds_swmr_gen_SOURCES = vds_swmr_gen.c
vds_swmr_gen_OBJECTS = vds_swmr_gen.$(OBJEXT)
vds_swmr_gen_LDADD = $(LDADD)
@@ -745,26 +768,27 @@ SOURCES = $(libfilter_plugin1_dsets_la_SOURCES) \
del_many_dense_attrs.c direct_chunk.c dsets.c dt_arith.c \
dtransform.c dtypes.c earray.c efc.c enc_dec_plist.c \
enc_dec_plist_cross_platform.c enum.c err_compat.c \
- error_test.c evict_on_close.c extend.c external.c farray.c \
- fheap.c file_image.c filenotclosed.c fillval.c filter_fail.c \
- filter_plugin.c flush1.c flush2.c flushrefresh.c freespace.c \
- gen_bad_offset.c gen_bad_ohdr.c gen_bogus.c gen_bounds.c \
- gen_cross.c gen_deflate.c gen_file_image.c gen_filespace.c \
- gen_filters.c gen_new_array.c gen_new_fill.c gen_new_group.c \
- gen_new_mtime.c gen_new_super.c gen_noencoder.c \
- gen_nullspace.c gen_plist.c gen_sizes_lheap.c \
- gen_specmetaread.c gen_udlinks.c getname.c gheap.c hyperslab.c \
- istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \
- ntypes.c objcopy.c ohdr.c page_buffer.c pool.c reserved.c \
- set_extent.c space_overflow.c stab.c swmr.c \
- swmr_addrem_writer.c swmr_check_compat_vfd.c swmr_generator.c \
- swmr_reader.c swmr_remove_reader.c swmr_remove_writer.c \
- swmr_sparse_reader.c swmr_sparse_writer.c swmr_start_write.c \
- swmr_writer.c tcheck_version.c $(testhdf5_SOURCES) testmeta.c \
- $(ttsafe_SOURCES) twriteorder.c unlink.c unregister.c \
- $(use_append_chunk_SOURCES) $(use_append_mchunks_SOURCES) \
- $(use_disable_mdc_flushes_SOURCES) vds.c vds_swmr_gen.c \
- vds_swmr_reader.c vds_swmr_writer.c vfd.c
+ error_test.c evict_on_close.c extend.c external.c \
+ external_env.c farray.c fheap.c file_image.c filenotclosed.c \
+ fillval.c filter_fail.c filter_plugin.c flush1.c flush2.c \
+ flushrefresh.c freespace.c gen_bad_offset.c gen_bad_ohdr.c \
+ gen_bogus.c gen_bounds.c gen_cross.c gen_deflate.c \
+ gen_file_image.c gen_filespace.c gen_filters.c gen_new_array.c \
+ gen_new_fill.c gen_new_group.c gen_new_mtime.c gen_new_super.c \
+ gen_noencoder.c gen_nullspace.c gen_plist.c gen_sizes_lheap.c \
+ gen_specmetaread.c gen_udlinks.c getname.c gheap.c hdfs.c \
+ hyperslab.c istore.c lheap.c links.c links_env.c mf.c mount.c \
+ mtime.c ntypes.c objcopy.c ohdr.c page_buffer.c pool.c \
+ reserved.c ros3.c s3comms.c set_extent.c space_overflow.c \
+ stab.c swmr.c swmr_addrem_writer.c swmr_check_compat_vfd.c \
+ swmr_generator.c swmr_reader.c swmr_remove_reader.c \
+ swmr_remove_writer.c swmr_sparse_reader.c swmr_sparse_writer.c \
+ swmr_start_write.c swmr_writer.c tcheck_version.c \
+ $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) twriteorder.c \
+ unlink.c unregister.c $(use_append_chunk_SOURCES) \
+ $(use_append_mchunks_SOURCES) \
+ $(use_disable_mdc_flushes_SOURCES) vds.c vds_env.c \
+ vds_swmr_gen.c vds_swmr_reader.c vds_swmr_writer.c vfd.c
DIST_SOURCES = $(am__libfilter_plugin1_dsets_la_SOURCES_DIST) \
$(am__libfilter_plugin2_dsets_la_SOURCES_DIST) \
$(am__libfilter_plugin3_dsets_la_SOURCES_DIST) \
@@ -777,25 +801,26 @@ DIST_SOURCES = $(am__libfilter_plugin1_dsets_la_SOURCES_DIST) \
dt_arith.c dtransform.c dtypes.c earray.c efc.c \
enc_dec_plist.c enc_dec_plist_cross_platform.c enum.c \
err_compat.c error_test.c evict_on_close.c extend.c external.c \
- farray.c fheap.c file_image.c filenotclosed.c fillval.c \
- filter_fail.c filter_plugin.c flush1.c flush2.c flushrefresh.c \
- freespace.c gen_bad_offset.c gen_bad_ohdr.c gen_bogus.c \
- gen_bounds.c gen_cross.c gen_deflate.c gen_file_image.c \
- gen_filespace.c gen_filters.c gen_new_array.c gen_new_fill.c \
- gen_new_group.c gen_new_mtime.c gen_new_super.c \
+ external_env.c farray.c fheap.c file_image.c filenotclosed.c \
+ fillval.c filter_fail.c filter_plugin.c flush1.c flush2.c \
+ flushrefresh.c freespace.c gen_bad_offset.c gen_bad_ohdr.c \
+ gen_bogus.c gen_bounds.c gen_cross.c gen_deflate.c \
+ gen_file_image.c gen_filespace.c gen_filters.c gen_new_array.c \
+ gen_new_fill.c gen_new_group.c gen_new_mtime.c gen_new_super.c \
gen_noencoder.c gen_nullspace.c gen_plist.c gen_sizes_lheap.c \
- gen_specmetaread.c gen_udlinks.c getname.c gheap.c hyperslab.c \
- istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \
- ntypes.c objcopy.c ohdr.c page_buffer.c pool.c reserved.c \
- set_extent.c space_overflow.c stab.c swmr.c \
- swmr_addrem_writer.c swmr_check_compat_vfd.c swmr_generator.c \
- swmr_reader.c swmr_remove_reader.c swmr_remove_writer.c \
- swmr_sparse_reader.c swmr_sparse_writer.c swmr_start_write.c \
- swmr_writer.c tcheck_version.c $(testhdf5_SOURCES) testmeta.c \
- $(ttsafe_SOURCES) twriteorder.c unlink.c unregister.c \
- $(use_append_chunk_SOURCES) $(use_append_mchunks_SOURCES) \
- $(use_disable_mdc_flushes_SOURCES) vds.c vds_swmr_gen.c \
- vds_swmr_reader.c vds_swmr_writer.c vfd.c
+ gen_specmetaread.c gen_udlinks.c getname.c gheap.c hdfs.c \
+ hyperslab.c istore.c lheap.c links.c links_env.c mf.c mount.c \
+ mtime.c ntypes.c objcopy.c ohdr.c page_buffer.c pool.c \
+ reserved.c ros3.c s3comms.c set_extent.c space_overflow.c \
+ stab.c swmr.c swmr_addrem_writer.c swmr_check_compat_vfd.c \
+ swmr_generator.c swmr_reader.c swmr_remove_reader.c \
+ swmr_remove_writer.c swmr_sparse_reader.c swmr_sparse_writer.c \
+ swmr_start_write.c swmr_writer.c tcheck_version.c \
+ $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) twriteorder.c \
+ unlink.c unregister.c $(use_append_chunk_SOURCES) \
+ $(use_append_mchunks_SOURCES) \
+ $(use_disable_mdc_flushes_SOURCES) vds.c vds_env.c \
+ vds_swmr_gen.c vds_swmr_reader.c vds_swmr_writer.c vfd.c
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -1026,10 +1051,12 @@ am__DIST_COMMON = $(srcdir)/H5srcdir_str.h.in $(srcdir)/Makefile.in \
$(srcdir)/test_filter_plugin.sh.in \
$(srcdir)/test_usecases.sh.in $(srcdir)/testabort_fail.sh.in \
$(srcdir)/testcheck_version.sh.in $(srcdir)/testerror.sh.in \
+ $(srcdir)/testexternal_env.sh.in \
$(srcdir)/testflushrefresh.sh.in $(srcdir)/testlibinfo.sh.in \
$(srcdir)/testlinks_env.sh.in $(srcdir)/testswmr.sh.in \
- $(srcdir)/testvdsswmr.sh.in $(top_srcdir)/bin/depcomp \
- $(top_srcdir)/bin/test-driver $(top_srcdir)/config/commence.am \
+ $(srcdir)/testvds_env.sh.in $(srcdir)/testvdsswmr.sh.in \
+ $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/test-driver \
+ $(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am COPYING
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
@@ -1104,7 +1131,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -1127,9 +1153,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -1156,6 +1185,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -1210,6 +1240,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -1234,7 +1265,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1369,7 +1399,8 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 accum.h5 \
fheap.h5 ohdr.h5 stab.h5 extern_[1-5].h5 extern_[1-4][rw].raw \
gheap[0-4].h5 ohdr_min_a.h5 ohdr_min_b.h5 \
min_dset_ohdr_testfile.h5 dt_arith[1-2] links.h5 \
- links[0-6]*.h5 extlinks[0-15].h5 tmp big.data \
+ links[0-6]*.h5 extlinks[0-15].h5 tmp tmp_links tmp2_links \
+ tmp_links_env tmp_vds_env big.data \
big[0-9][0-9][0-9][0-9][0-9].h5 stdio.h5 sec2.h5 \
dtypes[0-9].h5 dtypes1[0].h5 dt_arith[1-2].h5 tattr.h5 \
tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \
@@ -1388,13 +1419,14 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 accum.h5 \
btree2_tmp.h5 objcopy_src.h5 objcopy_dst.h5 objcopy_ext.dat \
trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 farray_tmp.h5 \
earray.h5 earray_tmp.h5 efc[0-5].h5 log_vfd_out.log \
- new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \
- split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \
- file_image_core_test.h5.copy unregister_filter_1.h5 \
- unregister_filter_2.h5 vds_virt.h5 vds_dapl.h5 \
- vds_src_[0-1].h5 swmr_data.h5 use_use_append_chunk.h5 \
- use_append_mchunks.h5 use_disable_mdc_flushes.h5 \
- flushrefresh.h5 flushrefresh_VERIFICATION_START \
+ log_ros3_out.log log_s3comms_out.log new_multi_file_v16-r.h5 \
+ new_multi_file_v16-s.h5 split_get_file_image_test-m.h5 \
+ split_get_file_image_test-r.h5 file_image_core_test.h5.copy \
+ unregister_filter_1.h5 unregister_filter_2.h5 vds_virt.h5 \
+ vds_dapl.h5 vds_src_[0-1].h5 swmr_data.h5 \
+ use_use_append_chunk.h5 use_append_mchunks.h5 \
+ use_disable_mdc_flushes.h5 flushrefresh.h5 \
+ flushrefresh_VERIFICATION_START \
flushrefresh_VERIFICATION_CHECKPOINT1 \
flushrefresh_VERIFICATION_CHECKPOINT2 \
flushrefresh_VERIFICATION_DONE atomic_data accum_swmr_big.h5 \
@@ -1408,25 +1440,28 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 accum.h5 \
# testlibinfo.sh:
# testcheck_version.sh: tcheck_version
# testlinks_env.sh: links_env
+# testexternal_env.sh: external_env
# testflushrefresh.sh: flushrefresh
+# testvds_env.sh: vds_env
# testswmr.sh: swmr*
# testvdsswmr.sh: vds_swmr*
# testabort_fail.sh: filenotclosed.c and del_many_dense_attrs.c
# test_filter_plugin.sh: filter_plugin.c
# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes
TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh \
- testlinks_env.sh testswmr.sh testvdsswmr.sh \
- testflushrefresh.sh test_usecases.sh testabort_fail.sh \
- $(am__append_1)
+ testlinks_env.sh testexternal_env.sh testswmr.sh \
+ testvds_env.sh testvdsswmr.sh testflushrefresh.sh \
+ test_usecases.sh testabort_fail.sh $(am__append_1)
SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) \
- links_env$(EXEEXT) filenotclosed$(EXEEXT) \
- del_many_dense_attrs$(EXEEXT) flushrefresh$(EXEEXT) \
- use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) \
- use_disable_mdc_flushes$(EXEEXT) swmr_generator$(EXEEXT) \
- swmr_reader$(EXEEXT) swmr_writer$(EXEEXT) \
- swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) \
- swmr_addrem_writer$(EXEEXT) swmr_sparse_reader$(EXEEXT) \
- swmr_sparse_writer$(EXEEXT) swmr_start_write$(EXEEXT) \
+ links_env$(EXEEXT) external_env$(EXEEXT) \
+ filenotclosed$(EXEEXT) del_many_dense_attrs$(EXEEXT) \
+ flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) \
+ use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \
+ swmr_generator$(EXEEXT) swmr_reader$(EXEEXT) \
+ swmr_writer$(EXEEXT) swmr_remove_reader$(EXEEXT) \
+ swmr_remove_writer$(EXEEXT) swmr_addrem_writer$(EXEEXT) \
+ swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) \
+ swmr_start_write$(EXEEXT) vds_env$(EXEEXT) \
vds_swmr_gen$(EXEEXT) vds_swmr_reader$(EXEEXT) \
vds_swmr_writer$(EXEEXT) $(am__append_2)
check_SCRIPTS = $(TEST_SCRIPT)
@@ -1436,15 +1471,15 @@ check_SCRIPTS = $(TEST_SCRIPT)
# As an exception, long-running tests should occur earlier in the list.
# This gives them more time to run when tests are executing in parallel.
TEST_PROG = testhdf5 \
- cache cache_api cache_image cache_tagging lheap ohdr stab gheap \
- evict_on_close farray earray btree2 fheap \
+ cache cache_api cache_image cache_tagging lheap ohdr \
+ stab gheap evict_on_close farray earray btree2 fheap \
pool accum hyperslab istore bittests dt_arith page_buffer \
dtypes dsets chunk_info cmpd_dset filter_fail extend direct_chunk \
external efc objcopy links unlink twriteorder big mtime fillval mount \
flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \
- enc_dec_plist_cross_platform getname vfd ntypes dangle dtransform \
- reserved cross_read freespace mf vds file_image unregister \
- cache_logging cork swmr
+ enc_dec_plist_cross_platform getname vfd ros3 s3comms hdfs ntypes \
+ dangle dtransform reserved cross_read freespace mf vds file_image \
+ unregister cache_logging cork swmr
# These programs generate test files for the tests. They don't need to be
@@ -1471,7 +1506,7 @@ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_n
@HAVE_SHARED_CONDITIONAL_TRUE@libfilter_plugin4_groups_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
@HAVE_SHARED_CONDITIONAL_TRUE@libfilter_plugin3_dsets_la_LIBADD = $(LIBHDF5)
@HAVE_SHARED_CONDITIONAL_TRUE@libfilter_plugin4_groups_la_LIBADD = $(LIBHDF5)
-libh5test_la_SOURCES = h5test.c testframe.c cache_common.c swmr_common.c
+libh5test_la_SOURCES = h5test.c testframe.c cache_common.c swmr_common.c external_common.c
# Use libhd5test.la to compile all of the tests
LDADD = libh5test.la $(LIBHDF5)
@@ -1498,7 +1533,7 @@ use_disable_mdc_flushes_SOURCES = use_disable_mdc_flushes.c
# Temporary files.
DISTCLEANFILES = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_filter_plugin.sh \
- testswmr.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh testabort_fail.sh
+ testexternal_env.sh testswmr.sh testvds_env.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh testabort_fail.sh
# Automake needs to be taught how to build lib, progs and tests targets.
@@ -1563,6 +1598,8 @@ testcheck_version.sh: $(top_builddir)/config.status $(srcdir)/testcheck_version.
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
testerror.sh: $(top_builddir)/config.status $(srcdir)/testerror.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+testexternal_env.sh: $(top_builddir)/config.status $(srcdir)/testexternal_env.sh.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
testflushrefresh.sh: $(top_builddir)/config.status $(srcdir)/testflushrefresh.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
testlibinfo.sh: $(top_builddir)/config.status $(srcdir)/testlibinfo.sh.in
@@ -1571,6 +1608,8 @@ testlinks_env.sh: $(top_builddir)/config.status $(srcdir)/testlinks_env.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
testswmr.sh: $(top_builddir)/config.status $(srcdir)/testswmr.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+testvds_env.sh: $(top_builddir)/config.status $(srcdir)/testvds_env.sh.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
testvdsswmr.sh: $(top_builddir)/config.status $(srcdir)/testvdsswmr.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
test_filter_plugin.sh: $(top_builddir)/config.status $(srcdir)/test_filter_plugin.sh.in
@@ -1758,6 +1797,10 @@ external$(EXEEXT): $(external_OBJECTS) $(external_DEPENDENCIES) $(EXTRA_external
@rm -f external$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(external_OBJECTS) $(external_LDADD) $(LIBS)
+external_env$(EXEEXT): $(external_env_OBJECTS) $(external_env_DEPENDENCIES) $(EXTRA_external_env_DEPENDENCIES)
+ @rm -f external_env$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(external_env_OBJECTS) $(external_env_LDADD) $(LIBS)
+
farray$(EXEEXT): $(farray_OBJECTS) $(farray_DEPENDENCIES) $(EXTRA_farray_DEPENDENCIES)
@rm -f farray$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(farray_OBJECTS) $(farray_LDADD) $(LIBS)
@@ -1890,6 +1933,10 @@ gheap$(EXEEXT): $(gheap_OBJECTS) $(gheap_DEPENDENCIES) $(EXTRA_gheap_DEPENDENCIE
@rm -f gheap$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(gheap_OBJECTS) $(gheap_LDADD) $(LIBS)
+hdfs$(EXEEXT): $(hdfs_OBJECTS) $(hdfs_DEPENDENCIES) $(EXTRA_hdfs_DEPENDENCIES)
+ @rm -f hdfs$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(hdfs_OBJECTS) $(hdfs_LDADD) $(LIBS)
+
hyperslab$(EXEEXT): $(hyperslab_OBJECTS) $(hyperslab_DEPENDENCIES) $(EXTRA_hyperslab_DEPENDENCIES)
@rm -f hyperslab$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(hyperslab_OBJECTS) $(hyperslab_LDADD) $(LIBS)
@@ -1946,6 +1993,14 @@ reserved$(EXEEXT): $(reserved_OBJECTS) $(reserved_DEPENDENCIES) $(EXTRA_reserved
@rm -f reserved$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(reserved_OBJECTS) $(reserved_LDADD) $(LIBS)
+ros3$(EXEEXT): $(ros3_OBJECTS) $(ros3_DEPENDENCIES) $(EXTRA_ros3_DEPENDENCIES)
+ @rm -f ros3$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ros3_OBJECTS) $(ros3_LDADD) $(LIBS)
+
+s3comms$(EXEEXT): $(s3comms_OBJECTS) $(s3comms_DEPENDENCIES) $(EXTRA_s3comms_DEPENDENCIES)
+ @rm -f s3comms$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(s3comms_OBJECTS) $(s3comms_LDADD) $(LIBS)
+
set_extent$(EXEEXT): $(set_extent_OBJECTS) $(set_extent_DEPENDENCIES) $(EXTRA_set_extent_DEPENDENCIES)
@rm -f set_extent$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(set_extent_OBJECTS) $(set_extent_LDADD) $(LIBS)
@@ -2046,6 +2101,10 @@ vds$(EXEEXT): $(vds_OBJECTS) $(vds_DEPENDENCIES) $(EXTRA_vds_DEPENDENCIES)
@rm -f vds$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(vds_OBJECTS) $(vds_LDADD) $(LIBS)
+vds_env$(EXEEXT): $(vds_env_OBJECTS) $(vds_env_DEPENDENCIES) $(EXTRA_vds_env_DEPENDENCIES)
+ @rm -f vds_env$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(vds_env_OBJECTS) $(vds_env_LDADD) $(LIBS)
+
vds_swmr_gen$(EXEEXT): $(vds_swmr_gen_OBJECTS) $(vds_swmr_gen_DEPENDENCIES) $(EXTRA_vds_swmr_gen_DEPENDENCIES)
@rm -f vds_swmr_gen$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(vds_swmr_gen_OBJECTS) $(vds_swmr_gen_LDADD) $(LIBS)
@@ -2103,6 +2162,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evict_on_close.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extend.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/external.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/external_common.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/external_env.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/farray.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fheap.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_image.Po@am__quote@
@@ -2142,6 +2203,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getname.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gheap.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5test.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hdfs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hyperslab.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/istore.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lheap.Po@am__quote@
@@ -2156,6 +2218,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/page_buffer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reserved.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ros3.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3comms.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_extent.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/space_overflow.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stab.Po@am__quote@
@@ -2212,6 +2276,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/use_common.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/use_disable_mdc_flushes.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vds.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vds_env.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vds_swmr_gen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vds_swmr_reader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vds_swmr_writer.Po@am__quote@
@@ -2765,6 +2830,27 @@ vfd.log: vfd$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+ros3.log: ros3$(EXEEXT)
+ @p='ros3$(EXEEXT)'; \
+ b='ros3'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+s3comms.log: s3comms$(EXEEXT)
+ @p='s3comms$(EXEEXT)'; \
+ b='s3comms'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+hdfs.log: hdfs$(EXEEXT)
+ @p='hdfs$(EXEEXT)'; \
+ b='hdfs'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
ntypes.log: ntypes$(EXEEXT)
@p='ntypes$(EXEEXT)'; \
b='ntypes'; \
@@ -3095,7 +3181,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/test/accum.c b/test/accum.c
index 19006b6..3c308b7 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -94,7 +94,7 @@ main(void)
/* Test Setup */
- puts("Testing the metadata accumulator");
+ HDputs("Testing the metadata accumulator");
/* Create a test file */
if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -141,14 +141,14 @@ main(void)
if(nerrors)
goto error;
- puts("All metadata accumulator tests passed.");
+ HDputs("All metadata accumulator tests passed.");
return 0;
error:
if(api_ctx_pushed) H5CX_pop();
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
return 1;
} /* end main() */
@@ -1846,11 +1846,11 @@ test_swmr_write_big(hbool_t newest_format)
* by the environment variable.
*/
driver = HDgetenv("HDF5_DRIVER");
- if (!H5FD_supports_swmr_test(driver)) {
+ if(!H5FD_supports_swmr_test(driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
return 0;
- } /* end if */
+ }
/* File access property list */
if((fapl = h5_fileaccess()) < 0)
@@ -1951,10 +1951,11 @@ test_swmr_write_big(hbool_t newest_format)
if((pid = HDfork()) < 0) {
HDperror("fork");
FAIL_STACK_ERROR;
- } else if(0 == pid) { /* Child process */
+ }
+ else if(0 == pid) { /* Child process */
/* Run the reader */
status = HDexecv(SWMR_READER, new_argv);
- printf("errno from execv = %s\n", strerror(errno));
+ HDprintf("errno from execv = %s\n", strerror(errno));
FAIL_STACK_ERROR;
} /* end if */
@@ -1967,14 +1968,15 @@ test_swmr_write_big(hbool_t newest_format)
/* Flush the accumulator */
if(accum_reset(rf) < 0)
FAIL_STACK_ERROR;
- /* Close the property list */
- if(H5Pclose(fapl) < 0)
- FAIL_STACK_ERROR;
/* Close and remove the file */
if(H5Fclose(fid) < 0)
FAIL_STACK_ERROR;
+ /* Close the property list */
+ if(H5Pclose(fapl) < 0)
+ FAIL_STACK_ERROR;
+
/* Pop API context */
if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
api_ctx_pushed = FALSE;
@@ -1992,11 +1994,11 @@ test_swmr_write_big(hbool_t newest_format)
error:
/* Closing and remove the file */
- H5Pclose(fapl);
H5Fclose(fid);
if(api_ctx_pushed) H5CX_pop();
+ H5Pclose(fapl);
HDremove(SWMR_FILENAME);
/* Release memory */
@@ -2030,18 +2032,19 @@ accum_printf(const H5F_t *f)
{
H5F_meta_accum_t * accum = &f->shared->accum;
- printf("\n");
- printf("Current contents of accumulator:\n");
- if (accum->alloc_size == 0) {
- printf("=====================================================\n");
- printf(" No accumulator allocated.\n");
- printf("=====================================================\n");
- } else {
- printf("=====================================================\n");
- printf(" accumulator allocated size == %zu\n", accum->alloc_size);
- printf(" accumulated data size == %zu\n", accum->size);
+ HDprintf("\n");
+ HDprintf("Current contents of accumulator:\n");
+ if(accum->alloc_size == 0) {
+ HDprintf("=====================================================\n");
+ HDprintf(" No accumulator allocated.\n");
+ HDprintf("=====================================================\n");
+ }
+ else {
+ HDprintf("=====================================================\n");
+ HDprintf(" accumulator allocated size == %zu\n", accum->alloc_size);
+ HDprintf(" accumulated data size == %zu\n", accum->size);
HDfprintf(stdout, " accumulator dirty? == %t\n", accum->dirty);
- printf("=====================================================\n");
+ HDprintf("=====================================================\n");
HDfprintf(stdout, " start of accumulated data, loc = %a\n", accum->loc);
if(accum->dirty) {
HDfprintf(stdout, " start of dirty region, loc = %a\n", (haddr_t)(accum->loc + accum->dirty_off));
@@ -2049,8 +2052,8 @@ accum_printf(const H5F_t *f)
} /* end if */
HDfprintf(stdout, " end of accumulated data, loc = %a\n", (haddr_t)(accum->loc + accum->size));
HDfprintf(stdout, " end of accumulator allocation, loc = %a\n", (haddr_t)(accum->loc + accum->alloc_size));
- printf("=====================================================\n");
+ HDprintf("=====================================================\n");
}
- printf("\n\n");
+ HDprintf("\n\n");
} /* accum_printf() */
diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c
index 5bda46a..157712f 100644
--- a/test/accum_swmr_reader.c
+++ b/test/accum_swmr_reader.c
@@ -56,9 +56,8 @@ main(void)
* by the environment variable.
*/
driver = HDgetenv("HDF5_DRIVER");
- if(!H5FD_supports_swmr_test(driver)) {
+ if(!H5FD_supports_swmr_test(driver))
return EXIT_SUCCESS;
- }
/* Initialize buffers */
for(u = 0; u < 1024; u++) {
@@ -71,7 +70,7 @@ main(void)
/* Open the file with SWMR_READ */
if((fid = H5Fopen(SWMR_FILENAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Push API context */
if(H5CX_push() < 0) FAIL_STACK_ERROR
@@ -79,21 +78,21 @@ main(void)
/* Get H5F_t * to internal file structure */
if(NULL == (f = (H5F_t *)H5I_object(fid)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Should read in [1024, 2024] with buf data */
if(H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Verify the data read is correct */
if(HDmemcmp(buf, rbuf, (size_t)1024) != 0)
- TEST_ERROR;
+ TEST_ERROR;
/* CLose the file */
if(H5Pclose(fapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Fclose(fid) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
/* Pop API context */
if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
@@ -101,8 +100,11 @@ main(void)
return EXIT_SUCCESS;
-error:
- H5Fclose(fid);
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ } H5E_END_TRY;
if(api_ctx_pushed) H5CX_pop();
diff --git a/test/app_ref.c b/test/app_ref.c
index 3ef3fef..a4853fa 100644
--- a/test/app_ref.c
+++ b/test/app_ref.c
@@ -83,8 +83,8 @@ Abrt_Handler (int H5_ATTR_UNUSED sig)
int i, n;
for (i=0; i<T_NUMCLASSES; i++) {
- fprintf(stderr, "%s ID reference count: %n", IDNAME[i], &n);
- fprintf(stderr, "%*d\n", (n < ERR_WIDTH) ? (ERR_WIDTH - n) : 0, rc[i]);
+ HDfprintf(stderr, "%s ID reference count: %n", IDNAME[i], &n);
+ HDfprintf(stderr, "%*d\n", (n < ERR_WIDTH) ? (ERR_WIDTH - n) : 0, rc[i]);
}
}
@@ -195,7 +195,7 @@ main (void)
error:
- puts("***** APPLICATION REFERENCE COUNT TESTS FAILED *****");
+ HDputs("***** APPLICATION REFERENCE COUNT TESTS FAILED *****");
return 1;
}
diff --git a/test/atomic_reader.c b/test/atomic_reader.c
index 3e3a20a..5c1241f 100644
--- a/test/atomic_reader.c
+++ b/test/atomic_reader.c
@@ -55,7 +55,7 @@ int verify(int fd, unsigned int k);
void print_info(int *info, unsigned int lastr, unsigned iteration);
-
+
/*-------------------------------------------------------------------------
* Function: usage
*
@@ -63,7 +63,7 @@ void print_info(int *info, unsigned int lastr, unsigned iteration);
*
* Parameters: None
*
- * Return: void
+ * Return: void
*
*-------------------------------------------------------------------------
*/
@@ -78,13 +78,13 @@ usage(void)
printf("\n");
} /* usage() */
-
+
/*-------------------------------------------------------------------------
* Function: verify
*
* Purpose: To verify that the data read is the pattern expected.
* Each integer read should be the same as the index.
- * When a difference is encountered, the remaining integers
+ * When a difference is encountered, the remaining integers
* read should be the same as the previous index.
* For example, the pattern expected should be either:
* a) 01234567....n-1
@@ -93,11 +93,11 @@ usage(void)
* the remaining integers should be all "3"s as:
* 012333333333333
*
- * Parameters:
+ * Parameters:
* fd -- the file descriptor
* k -- the number of integers to read
*
- * Return:
+ * Return:
* positive on success
* negative on failure
*
@@ -106,9 +106,9 @@ usage(void)
int
verify(int fd, unsigned int k)
{
- unsigned int i; /* local index variable */
- ssize_t bytes_read; /* the number of bytes read */
- unsigned int *buf = NULL; /* buffer to hold data read */
+ unsigned int i; /* local index variable */
+ ssize_t bytes_read; /* the number of bytes read */
+ unsigned int *buf = NULL; /* buffer to hold data read */
/* Allocate buffer for data read */
if((buf = (unsigned int *)malloc(k * sizeof(unsigned int))) == NULL) {
@@ -165,13 +165,13 @@ error:
} /* end verify() */
-
+
/*-------------------------------------------------------------------------
* Function: print_info
*
* Purpose: To print the statistics gathered for re-reads
*
- * Parameters:
+ * Parameters:
* info -- the array storing the statistics for re-reads
* lastr -- the last read completed
* iteration -- the current iteration
@@ -183,7 +183,7 @@ error:
void
print_info(int *info, unsigned int lastr, unsigned iteration)
{
- unsigned j; /* local index variable */
+ unsigned j; /* local index variable */
printf("--------statistics for %u reads (iteration %u)--------\n", lastr, iteration);
@@ -193,13 +193,13 @@ print_info(int *info, unsigned int lastr, unsigned iteration)
printf("--------end statistics for %u reads (iteration %u)--------\n", lastr, iteration);
} /* print_info() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: To verify that the data read is the pattern expected.
- * (1) Make sure the file opens successfully and the # of bytes read is as expected
- * (2) Iterate the reader with i iterations
+ * (1) Make sure the file opens successfully and the # of bytes read is as expected
+ * (2) Iterate the reader with i iterations
* (3) Read and verify n integers for each iteration
* (4) On verification error, re-read the data at most READ_TRIES
* times to see if correct data can be obtained
diff --git a/test/atomic_writer.c b/test/atomic_writer.c
index 218d4da..b9ea03a 100644
--- a/test/atomic_writer.c
+++ b/test/atomic_writer.c
@@ -14,7 +14,7 @@
*
* Created: atomic_writer.c
*
- * Purpose: This is the "writer" part of the standalone test to check
+ * Purpose: This is the "writer" part of the standalone test to check
* atomic read-write operation on a system.
* a) atomic_writer.c--the writer (this file)
* b) atomic_reader.c--the reader
@@ -53,7 +53,7 @@
static void usage(void);
-
+
/*-------------------------------------------------------------------------
* Function: usage
*
@@ -77,12 +77,12 @@ usage(void)
} /* usage() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: To write a series of integers to a file for the reader to verify the data.
- * A write is atomic if the whole amount written in one operation is not interleaved
+ * A write is atomic if the whole amount written in one operation is not interleaved
* with data from any other process.
* (1) Iterate with i iterations
* (2) Write a series of integers (0 to n-1) to the file with this pattern:
@@ -196,7 +196,7 @@ main(int argc, char *argv[])
printf("WRITER: error from lseek\n");
goto error;
} /* end if */
-
+
/* Write the data */
if((bytes_wrote = write(fd, buf, ((num-n) * sizeof(unsigned int)))) < 0) {
printf("WRITER: error from write\n");
diff --git a/test/big.c b/test/big.c
index fe52aef..46acc5e 100644
--- a/test/big.c
+++ b/test/big.c
@@ -275,6 +275,14 @@ error:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static int
enough_room(hid_t fapl)
{
@@ -315,6 +323,7 @@ done:
return ret_value;
}
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
@@ -524,7 +533,7 @@ reader(char *filename, hid_t fapl)
}
if(zero) {
H5_FAILED();
- printf(" %d zero%s\n", zero, 1 == zero ? "" : "s");
+ HDprintf(" %d zero%s\n", zero, 1 == zero ? "" : "s");
} else if(wrong) {
SKIPPED();
HDputs(" Possible overlap with another region.");
@@ -765,7 +774,7 @@ main (int ac, char **av)
family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0);
}
else{
- printf("***Missing fsize value***\n");
+ HDprintf("***Missing fsize value***\n");
usage();
return 1;
}
diff --git a/test/bittests.c b/test/bittests.c
index ccd725c..046528a 100644
--- a/test/bittests.c
+++ b/test/bittests.c
@@ -57,13 +57,13 @@ test_find (void)
n = H5T__bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_LSB, TRUE);
if(-1 != n) {
H5_FAILED();
- puts (" Zero length test failed (lsb)!");
+ HDputs (" Zero length test failed (lsb)!");
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_MSB, TRUE);
if(-1 != n) {
H5_FAILED();
- puts (" Zero length test failed (msb)!");
+ HDputs (" Zero length test failed (msb)!");
goto failed;
}
@@ -73,13 +73,13 @@ test_find (void)
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE);
if(-1 != n) {
H5_FAILED();
- puts (" Zero buffer test failed (lsb)!");
+ HDputs (" Zero buffer test failed (lsb)!");
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE);
if(-1 != n) {
H5_FAILED();
- puts (" Zero buffer test failed (msb)!");
+ HDputs (" Zero buffer test failed (msb)!");
goto failed;
}
@@ -90,13 +90,13 @@ test_find (void)
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE);
if((ssize_t)i != n) {
H5_FAILED();
- printf (" Test for set bit %d failed (lsb)!\n", i);
+ HDprintf (" Test for set bit %d failed (lsb)!\n", i);
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE);
if((ssize_t)i != n) {
H5_FAILED();
- printf (" Test for set bit %d failed (msb)!\n", i);
+ HDprintf (" Test for set bit %d failed (msb)!\n", i);
goto failed;
}
}
@@ -106,13 +106,13 @@ test_find (void)
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, FALSE);
if(-1 != n) {
H5_FAILED();
- puts (" One buffer test failed (lsb)!");
+ HDputs (" One buffer test failed (lsb)!");
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, FALSE);
if(-1 != n) {
H5_FAILED();
- puts (" One buffer test failed (msb)!");
+ HDputs (" One buffer test failed (msb)!");
goto failed;
}
@@ -123,13 +123,13 @@ test_find (void)
n = H5T__bit_find (v1, (size_t)0, 8*sizeof(v1), H5T_BIT_LSB, FALSE);
if ((ssize_t)i!=n) {
H5_FAILED();
- printf (" Test for clear bit %d failed (lsb)!\n", i);
+ HDprintf (" Test for clear bit %d failed (lsb)!\n", i);
goto failed;
}
n = H5T__bit_find (v1, (size_t)0, 8*sizeof(v1), H5T_BIT_MSB, FALSE);
if ((ssize_t)i!=n) {
H5_FAILED();
- printf (" Test for clear bit %d failed (lsb)!\n", i);
+ HDprintf (" Test for clear bit %d failed (lsb)!\n", i);
goto failed;
}
}
@@ -139,9 +139,9 @@ test_find (void)
return 0;
failed:
- printf (" v = 0x");
- for (i=0; i<(int)sizeof(v1); i++) printf ("%02x", v1[i]);
- printf ("\n");
+ HDprintf (" v = 0x");
+ for (i=0; i<(int)sizeof(v1); i++) HDprintf ("%02x", v1[i]);
+ HDprintf ("\n");
return -1;
}
@@ -185,12 +185,12 @@ test_copy (void)
for (j=0; j<(int)sizeof(v2); j++) if (v2[j]) break;
if (size>0 && j>=(int)sizeof(v2)) {
H5_FAILED();
- puts (" Unabled to find copied region in destination");
+ HDputs (" Unabled to find copied region in destination");
goto failed;
}
if (0==size && j<(int)sizeof(v2)) {
H5_FAILED();
- puts (" Found copied bits when we shouldn't have");
+ HDputs (" Found copied bits when we shouldn't have");
goto failed;
}
@@ -199,25 +199,25 @@ test_copy (void)
n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 1);
if (size>0 && n!=(ssize_t)d_offset) {
H5_FAILED();
- printf (" Unable to find first copied bit in destination "
+ HDprintf (" Unable to find first copied bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found copied bits and shouldn't have!");
+ HDputs (" Found copied bits and shouldn't have!");
goto failed;
}
n = H5T__bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 0);
if (d_offset+size<8*sizeof(v2) && n!=(ssize_t)size) {
H5_FAILED();
- printf (" Unable to find last copied bit in destination "
+ HDprintf (" Unable to find last copied bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (d_offset+size==8*sizeof(v2) && n>=0) {
H5_FAILED();
- puts (" High-order zeros are present and shouldn't be!");
+ HDputs (" High-order zeros are present and shouldn't be!");
goto failed;
}
@@ -228,25 +228,25 @@ test_copy (void)
n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 1);
if (size>0 && (size_t)(n+1)!=d_offset+size) {
H5_FAILED();
- printf (" Unable to find last copied bit in destination "
+ HDprintf (" Unable to find last copied bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found copied bits but shouldn't have (reverse)!");
+ HDputs (" Found copied bits but shouldn't have (reverse)!");
goto failed;
}
n = H5T__bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 0);
if (d_offset>0 && n+1!=(ssize_t)d_offset) {
H5_FAILED();
- printf (" Unable to find beginning of copied data "
+ HDprintf (" Unable to find beginning of copied data "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==d_offset && n>=0) {
H5_FAILED();
- puts (" Found leading original data but shouldn't have!");
+ HDputs (" Found leading original data but shouldn't have!");
goto failed;
}
@@ -256,14 +256,14 @@ test_copy (void)
return 0;
failed:
- printf (" i=%d, s_offset=%lu, d_offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, s_offset=%lu, d_offset=%lu, size=%lu\n",
i, (unsigned long)s_offset, (unsigned long)d_offset,
(unsigned long)size);
- printf (" s = 0x");
- for (j=sizeof(v1)-1; j>=0; --j) printf ("%02x", v1[j]);
- printf ("\n d = 0x");
- for (j=sizeof(v2)-1; j>=0; --j) printf ("%02x", v2[j]);
- printf ("\n");
+ HDprintf (" s = 0x");
+ for (j=sizeof(v1)-1; j>=0; --j) HDprintf ("%02x", v1[j]);
+ HDprintf ("\n d = 0x");
+ for (j=sizeof(v2)-1; j>=0; --j) HDprintf ("%02x", v2[j]);
+ HDprintf ("\n");
return -1;
}
@@ -311,7 +311,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if(n != (ssize_t)offset + shift_dist) {
H5_FAILED();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -323,7 +323,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (n!=(ssize_t)(offset+size-1)) {
H5_FAILED();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -338,7 +338,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if ((size_t)n!=offset) {
H5_FAILED();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -350,7 +350,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if(n != (ssize_t)(offset + size) - shift_dist - 1) {
H5_FAILED();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -373,7 +373,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if (n >= 0) {
H5_FAILED();
- printf (" Unable to verify all bits are zero in destination(LSB) "
+ HDprintf (" Unable to verify all bits are zero in destination(LSB) "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -382,7 +382,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (n >= 0) {
H5_FAILED();
- printf (" Unable to verify all bits are zero in destination(MSB) "
+ HDprintf (" Unable to verify all bits are zero in destination(MSB) "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -392,11 +392,11 @@ test_shift (void)
return 0;
failed:
- printf (" i=%d, offset=%lu, size=%lu, shift_dist=%lu\n",
+ HDprintf (" i=%d, offset=%lu, size=%lu, shift_dist=%lu\n",
i, (unsigned long)offset, (unsigned long)size,
(unsigned long)shift_dist);
- for (j=sizeof(vector)-1; j>=0; --j) printf ("%02x", vector[j]);
- printf ("\n");
+ for (j=sizeof(vector)-1; j>=0; --j) HDprintf ("%02x", vector[j]);
+ HDprintf ("\n");
return -1;
}
@@ -446,13 +446,13 @@ test_increment (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if (size!=1 && (size_t)n!=offset+size-1) {
H5_FAILED();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if(size==1 && n>=0) {
H5_FAILED();
- printf (" Unable to verify all-zero bit in destination "
+ HDprintf (" Unable to verify all-zero bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -464,13 +464,13 @@ test_increment (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (size!=1 && n!=(ssize_t)(offset+size-1)) {
H5_FAILED();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if(size==1 && n>=0) {
H5_FAILED();
- printf (" Unable to verify all-zero bit in destination "
+ HDprintf (" Unable to verify all-zero bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -480,10 +480,10 @@ test_increment (void)
return 0;
failed:
- printf (" i=%d, offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, offset=%lu, size=%lu\n",
i, (unsigned long)offset, (unsigned long)size);
- for (j=sizeof(vector)-1; j>=0; --j) printf ("%02x", vector[j]);
- printf ("\n");
+ for (j=sizeof(vector)-1; j>=0; --j) HDprintf ("%02x", vector[j]);
+ HDprintf ("\n");
return -1;
}
@@ -530,7 +530,7 @@ test_decrement (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if ((size_t)n!=offset) {
H5_FAILED();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -542,7 +542,7 @@ test_decrement (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (n!=(ssize_t)(offset+size-1)) {
H5_FAILED();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -552,10 +552,10 @@ test_decrement (void)
return 0;
failed:
- printf (" i=%d, offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, offset=%lu, size=%lu\n",
i, (unsigned long)offset, (unsigned long)size);
- for (j=sizeof(vector)-1; j>=0; --j) printf ("%02x", vector[j]);
- printf ("\n");
+ for (j=sizeof(vector)-1; j>=0; --j) HDprintf ("%02x", vector[j]);
+ HDprintf ("\n");
return -1;
}
@@ -602,7 +602,7 @@ test_negate (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if ((size_t)n!=offset) {
H5_FAILED();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -614,7 +614,7 @@ test_negate (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (n!=(ssize_t)(offset+size-1)) {
H5_FAILED();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -630,7 +630,7 @@ test_negate (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if (n>=0) {
H5_FAILED();
- printf (" Unable to verify all-zero bits in destination "
+ HDprintf (" Unable to verify all-zero bits in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -642,7 +642,7 @@ test_negate (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (n>=0) {
H5_FAILED();
- printf (" Unable to verify all-zero bits in destination "
+ HDprintf (" Unable to verify all-zero bits in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -652,10 +652,10 @@ test_negate (void)
return 0;
failed:
- printf (" i=%d, offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, offset=%lu, size=%lu\n",
i, (unsigned long)offset, (unsigned long)size);
- for (j=sizeof(vector)-1; j>=0; --j) printf ("%02x", vector[j]);
- printf ("\n");
+ for (j=sizeof(vector)-1; j>=0; --j) HDprintf ("%02x", vector[j]);
+ HDprintf ("\n");
return -1;
}
@@ -697,12 +697,12 @@ test_set (void)
for (j=0; j<(int)sizeof(v2); j++) if (v2[j]) break;
if (size>0 && j>=(int)sizeof(v2)) {
H5_FAILED();
- puts (" Unabled to find set region in buffer");
+ HDputs (" Unabled to find set region in buffer");
goto failed;
}
if (0==size && j<(int)sizeof(v2)) {
H5_FAILED();
- puts (" Found set bits when we shouldn't have");
+ HDputs (" Found set bits when we shouldn't have");
goto failed;
}
@@ -711,25 +711,25 @@ test_set (void)
n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 1);
if (size>0 && n!=(ssize_t)d_offset) {
H5_FAILED();
- printf (" Unable to find first set bit in destination "
+ HDprintf (" Unable to find first set bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found set bits and shouldn't have!");
+ HDputs (" Found set bits and shouldn't have!");
goto failed;
}
n = H5T__bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 0);
if (d_offset+size<8*sizeof(v2) && n!=(ssize_t)size) {
H5_FAILED();
- printf (" Unable to find last set bit in destination "
+ HDprintf (" Unable to find last set bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (d_offset+size==8*sizeof(v2) && n>=0) {
H5_FAILED();
- puts (" High-order zeros are present and shouldn't be!");
+ HDputs (" High-order zeros are present and shouldn't be!");
goto failed;
}
@@ -740,25 +740,25 @@ test_set (void)
n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 1);
if (size>0 && (size_t)(n+1)!=d_offset+size) {
H5_FAILED();
- printf (" Unable to find last set bit in destination "
+ HDprintf (" Unable to find last set bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found set bits but shouldn't have (reverse)!");
+ HDputs (" Found set bits but shouldn't have (reverse)!");
goto failed;
}
n = H5T__bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 0);
if (d_offset>0 && n+1!=(ssize_t)d_offset) {
H5_FAILED();
- printf (" Unable to find beginning of set bit region "
+ HDprintf (" Unable to find beginning of set bit region "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==d_offset && n>=0) {
H5_FAILED();
- puts (" Found leading zeros but shouldn't have!");
+ HDputs (" Found leading zeros but shouldn't have!");
goto failed;
}
@@ -768,11 +768,11 @@ test_set (void)
return 0;
failed:
- printf (" i=%d, d_offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, d_offset=%lu, size=%lu\n",
i, (unsigned long)d_offset, (unsigned long)size);
- printf (" d = 0x");
- for (j=sizeof(v2)-1; j>=0; --j) printf ("%02x", v2[j]);
- printf ("\n");
+ HDprintf (" d = 0x");
+ for (j=sizeof(v2)-1; j>=0; --j) HDprintf ("%02x", v2[j]);
+ HDprintf ("\n");
return -1;
}
@@ -814,12 +814,12 @@ test_clear (void)
for (j=0; j<(int)sizeof(v2); j++) if (0xff!=v2[j]) break;
if (size>0 && j>=(int)sizeof(v2)) {
H5_FAILED();
- puts (" Unabled to find cleared region in buffer");
+ HDputs (" Unabled to find cleared region in buffer");
goto failed;
}
if (0==size && j<(int)sizeof(v2)) {
H5_FAILED();
- puts (" Found cleared bits when we shouldn't have");
+ HDputs (" Found cleared bits when we shouldn't have");
goto failed;
}
@@ -828,25 +828,25 @@ test_clear (void)
n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 0);
if (size>0 && n!=(ssize_t)d_offset) {
H5_FAILED();
- printf (" Unable to find first cleared bit in destination "
+ HDprintf (" Unable to find first cleared bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found cleared bits and shouldn't have!");
+ HDputs (" Found cleared bits and shouldn't have!");
goto failed;
}
n = H5T__bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 1);
if (d_offset+size<8*sizeof(v2) && n!=(ssize_t)size) {
H5_FAILED();
- printf (" Unable to find last cleared bit in destination "
+ HDprintf (" Unable to find last cleared bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (d_offset+size==8*sizeof(v2) && n>=0) {
H5_FAILED();
- puts (" High-order ones are present and shouldn't be!");
+ HDputs (" High-order ones are present and shouldn't be!");
goto failed;
}
@@ -857,25 +857,25 @@ test_clear (void)
n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 0);
if (size>0 && (size_t)(n+1)!=d_offset+size) {
H5_FAILED();
- printf (" Unable to find last cleared bit in destination "
+ HDprintf (" Unable to find last cleared bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found cleared bits but shouldn't have (reverse)!");
+ HDputs (" Found cleared bits but shouldn't have (reverse)!");
goto failed;
}
n = H5T__bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 1);
if (d_offset>0 && n+1!=(ssize_t)d_offset) {
H5_FAILED();
- printf (" Unable to find beginning of cleared bit region "
+ HDprintf (" Unable to find beginning of cleared bit region "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==d_offset && n>=0) {
H5_FAILED();
- puts (" Found leading ones but shouldn't have!");
+ HDputs (" Found leading ones but shouldn't have!");
goto failed;
}
@@ -885,23 +885,21 @@ test_clear (void)
return 0;
failed:
- printf (" i=%d, d_offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, d_offset=%lu, size=%lu\n",
i, (unsigned long)d_offset, (unsigned long)size);
- printf (" d = 0x");
- for (j=sizeof(v2)-1; j>=0; --j) printf ("%02x", v2[j]);
- printf ("\n");
+ HDprintf (" d = 0x");
+ for (j=sizeof(v2)-1; j>=0; --j) HDprintf ("%02x", v2[j]);
+ HDprintf ("\n");
return -1;
}
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
* Purpose:
*
- * Return: Success:
- *
- * Failure:
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Robb Matzke
* Tuesday, June 16, 1998
@@ -911,7 +909,7 @@ test_clear (void)
int
main(void)
{
- int nerrors = 0;
+ int nerrors = 0;
/*
* Open the library explicitly.
@@ -928,14 +926,14 @@ main(void)
nerrors += test_negate() < 0 ? 1 : 0;
if(nerrors) {
- printf("***** %u FAILURE%s! *****\n",
+ HDprintf("***** %u FAILURE%s! *****\n",
nerrors, 1 == nerrors ? "" : "S");
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
- printf("All bit tests passed.\n");
+ HDprintf("All bit tests passed.\n");
H5close();
- return 0;
-}
+ HDexit(EXIT_SUCCESS);
+} /* end main() */
diff --git a/test/btree2.c b/test/btree2.c
index d26fed5..fb18048 100644
--- a/test/btree2.c
+++ b/test/btree2.c
@@ -20,13 +20,13 @@
* This file needs to access private datatypes from the H5B2 package.
* This file also needs to access the v2 B-tree testing code.
*/
-#define H5B2_FRIEND /*suppress error about including H5B2pkg */
+#define H5B2_FRIEND /*suppress error about including H5B2pkg */
#define H5B2_TESTING
#include "H5B2pkg.h"
/* Other private headers that this test requires */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Iprivate.h"
+#include "H5Iprivate.h" /* Virtual Object Layer */
const char *FILENAME[] = {
"btree2",
@@ -50,16 +50,16 @@ typedef struct bt2_test_param_t {
hbool_t reopen_btree; /* Whether to re-open the B-tree during the test */
} bt2_test_param_t;
-
+
/*-------------------------------------------------------------------------
- * Function: init_cparam
+ * Function: init_cparam
*
- * Purpose: Initialize v2 B-tree creation parameter structure
+ * Purpose: Initialize v2 B-tree creation parameter structure
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, October 29, 2009
*
*-------------------------------------------------------------------------
@@ -90,16 +90,16 @@ init_cparam(H5B2_create_t *cparam, H5B2_create_t *cparam2)
return(0);
} /* init_cparam() */
-
+
/*-------------------------------------------------------------------------
- * Function: create_file
+ * Function: create_file
*
- * Purpose: Perform common "creation" operations on file
+ * Purpose: Perform common "creation" operations on file
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 5, 2009
*
*-------------------------------------------------------------------------
@@ -107,7 +107,7 @@ init_cparam(H5B2_create_t *cparam, H5B2_create_t *cparam2)
static int
create_file(hid_t *file, H5F_t **f, hid_t fapl)
{
- char filename[1024]; /* Filename to use */
+ char filename[1024]; /* Filename to use */
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -131,16 +131,16 @@ error:
return(-1);
} /* end create_file() */
-
+
/*-------------------------------------------------------------------------
- * Function: create_btree
+ * Function: create_btree
*
- * Purpose: Perform common "create" operations on B-tree for testing
+ * Purpose: Perform common "create" operations on B-tree for testing
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 5, 2009
*
*-------------------------------------------------------------------------
@@ -164,16 +164,16 @@ error:
return(-1);
} /* end create_btree() */
-
+
/*-------------------------------------------------------------------------
- * Function: reopen_file
+ * Function: reopen_file
*
- * Purpose: Re-open the file
+ * Purpose: Re-open the file
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, December 28, 2015
*
*-------------------------------------------------------------------------
@@ -181,7 +181,7 @@ error:
static int
reopen_file(hid_t *file, H5F_t **f, hid_t fapl)
{
- char filename[1024]; /* Filename to use */
+ char filename[1024]; /* Filename to use */
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -205,16 +205,16 @@ error:
return(-1);
} /* end create_file() */
-
+
/*-------------------------------------------------------------------------
- * Function: reopen_btree
+ * Function: reopen_btree
*
- * Purpose: Perform common "re-open" operations on B-tree for testing
+ * Purpose: Perform common "re-open" operations on B-tree for testing
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 5, 2009
*
*-------------------------------------------------------------------------
@@ -241,16 +241,16 @@ error:
return(-1);
} /* end reopen_btree() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_stats
+ * Function: check_stats
*
- * Purpose: Check statistics about v1 B-tree
+ * Purpose: Check statistics about v1 B-tree
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 5, 2009
*
*-------------------------------------------------------------------------
@@ -275,16 +275,16 @@ error:
return(-1);
} /* end check_stats() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_node_depth
+ * Function: check_node_depth
*
- * Purpose: Check the depth of the node containing a record
+ * Purpose: Check the depth of the node containing a record
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 5, 2009
*
*-------------------------------------------------------------------------
@@ -306,16 +306,16 @@ error:
return(-1);
} /* end check_node_depth() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_node_info
+ * Function: check_node_info
*
- * Purpose: Check the info of the node containing a record
+ * Purpose: Check the info of the node containing a record
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, November 6, 2009
*
*-------------------------------------------------------------------------
@@ -340,16 +340,16 @@ error:
return(-1);
} /* end check_node_info() */
-
+
/*-------------------------------------------------------------------------
- * Function: iter_cb
+ * Function: iter_cb
*
- * Purpose: v2 B-tree iterator callback
+ * Purpose: v2 B-tree iterator callback
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, February 16, 2005
*
*-------------------------------------------------------------------------
@@ -367,16 +367,16 @@ iter_cb(const void *_record, void *_op_data)
return(H5_ITER_CONT);
} /* end iter_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: iter_rec_cb
+ * Function: iter_rec_cb
*
- * Purpose: v2 B-tree iterator callback for H5B2_test_rec_t records
+ * Purpose: v2 B-tree iterator callback for H5B2_test_rec_t records
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, December 25, 2015
*
*-------------------------------------------------------------------------
@@ -397,16 +397,16 @@ iter_rec_cb(const void *_record, void *_op_data)
return(H5_ITER_CONT);
} /* end iter_rec_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: find_cb
+ * Function: find_cb
*
- * Purpose: v2 B-tree find callback
+ * Purpose: v2 B-tree find callback
*
- * Return: Success: TRUE/FALSE
- * Failure: FAIL
+ * Return: Success: TRUE/FALSE
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 24, 2005
*
*-------------------------------------------------------------------------
@@ -423,16 +423,16 @@ find_cb(const void *_record, void *_op_data)
return(TRUE);
} /* end find_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: find_rec_cb
+ * Function: find_rec_cb
*
- * Purpose: v2 B-tree find callback for H5B2_test_rec_t records
+ * Purpose: v2 B-tree find callback for H5B2_test_rec_t records
*
- * Return: Success: TRUE/FALSE
- * Failure: FAIL
+ * Return: Success: TRUE/FALSE
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, December 25, 2015
*
*-------------------------------------------------------------------------
@@ -450,18 +450,18 @@ find_rec_cb(const void *_record, void *_op_data)
return(TRUE);
} /* end find_rec_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: find_dec_cb
+ * Function: find_dec_cb
*
- * Purpose: v2 B-tree find callback for indexing in decreasing order
+ * Purpose: v2 B-tree find callback for indexing in decreasing order
*
- * Note: Currently hard-wired to "insert_lots" test
+ * Note: Currently hard-wired to "insert_lots" test
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 7, 2006
*
*-------------------------------------------------------------------------
@@ -478,16 +478,16 @@ find_dec_cb(const void *_record, void *_op_data)
return(0);
} /* end find_dec_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: index_rec_cb
+ * Function: index_rec_cb
*
- * Purpose: v2 B-tree index callback for H5B2_test_rec_t records
+ * Purpose: v2 B-tree index callback for H5B2_test_rec_t records
*
- * Return: Success: TRUE/FALSE
- * Failure: FAIL
+ * Return: Success: TRUE/FALSE
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, December 25, 2015
*
*-------------------------------------------------------------------------
@@ -506,17 +506,17 @@ index_rec_cb(const void *_record, void *_op_data)
return(TRUE);
} /* end index_rec_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: neighbor_cb
+ * Function: neighbor_cb
*
- * Purpose: v2 B-tree neighbor callback
+ * Purpose: v2 B-tree neighbor callback
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -532,17 +532,17 @@ neighbor_cb(const void *_record, void *_op_data)
return(0);
} /* end neighbor_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: modify_cb
+ * Function: modify_cb
*
- * Purpose: v2 B-tree modify callback
+ * Purpose: v2 B-tree modify callback
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 10, 2005
*
*-------------------------------------------------------------------------
@@ -559,16 +559,16 @@ modify_cb(void *_record, void *_op_data, hbool_t *changed)
return(0);
} /* end modify_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: modify_rec_cb
+ * Function: modify_rec_cb
*
- * Purpose: v2 B-tree modify callback for H5B2_test_rec_t records
+ * Purpose: v2 B-tree modify callback for H5B2_test_rec_t records
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, December 25, 2015
*
*-------------------------------------------------------------------------
@@ -586,17 +586,17 @@ modify_rec_cb(void *_record, void *_op_data, hbool_t *changed)
return(0);
} /* end modify_rec_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: no_modify_cb
+ * Function: no_modify_cb
*
- * Purpose: v2 B-tree modify callback for updates which shouldn't change
- * the record (ie. inserting not modifying)
+ * Purpose: v2 B-tree modify callback for updates which shouldn't change
+ * the record (ie. inserting not modifying)
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, December 23, 2015
*
*-------------------------------------------------------------------------
@@ -610,17 +610,17 @@ no_modify_cb(void H5_ATTR_UNUSED *_record, void H5_ATTR_UNUSED *_op_data,
return(1);
} /* end no_modify_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: remove_cb
+ * Function: remove_cb
*
- * Purpose: v2 B-tree remove callback
+ * Purpose: v2 B-tree remove callback
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, August 8, 2006
*
*-------------------------------------------------------------------------
@@ -636,16 +636,16 @@ remove_cb(const void *_record, void *_op_data)
return(0);
} /* end remove_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_basic
+ * Function: test_insert_basic
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 3, 2005
*
*-------------------------------------------------------------------------
@@ -654,8 +654,8 @@ static unsigned
test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -702,7 +702,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index record in B-tree with no records */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -746,7 +746,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in B-tree with 1 record */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -803,7 +803,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in B-tree with several records */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -841,24 +841,24 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_insert_basic() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_split_root
+ * Function: test_insert_split_root
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It also continues to add a few more records to each of the
* left and right leaf nodes after the split
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 3, 2005
*
*-------------------------------------------------------------------------
@@ -867,8 +867,8 @@ static unsigned
test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -979,7 +979,7 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in level-1 B-tree */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -1016,25 +1016,25 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_split_root() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level1_2leaf_redistrib
+ * Function: test_insert_level1_2leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* redistribution
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, February 8, 2005
*
*-------------------------------------------------------------------------
@@ -1043,8 +1043,8 @@ static unsigned
test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -1170,25 +1170,25 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level1_2leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level1_side_split
+ * Function: test_insert_level1_side_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* split, adding another node to the B-tree
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, February 9, 2005
*
*-------------------------------------------------------------------------
@@ -1197,8 +1197,8 @@ static unsigned
test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -1329,27 +1329,27 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level1_side_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level1_3leaf_redistrib
+ * Function: test_insert_level1_3leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* split, adding another node to the B-tree, then continues to
* add records until a 3 node redistribution occurs
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 10, 2005
*
*-------------------------------------------------------------------------
@@ -1358,8 +1358,8 @@ static unsigned
test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -1472,26 +1472,26 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level1_3leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level1_middle_split
+ * Function: test_insert_level1_middle_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* split, adding another node to the B-tree, then continues to
* add records until a 3 node split occurs
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 10, 2005
*
*-------------------------------------------------------------------------
@@ -1500,8 +1500,8 @@ static unsigned
test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -1594,22 +1594,22 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level1_middle_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_make_level2
+ * Function: test_insert_make_level2
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 11, 2005
*
*-------------------------------------------------------------------------
@@ -1618,8 +1618,8 @@ static unsigned
test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -1735,7 +1735,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in level-2 B-tree */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -1773,24 +1773,24 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_make_level2() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level2_leaf_redistrib
+ * Function: test_insert_level2_leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree and then adds enough more
* records to force the leaves to redistribute
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 17, 2005
*
*-------------------------------------------------------------------------
@@ -1799,8 +1799,8 @@ static unsigned
test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -2001,24 +2001,24 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level2_leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level2_leaf_split
+ * Function: test_insert_level2_leaf_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree and then adds enough more
* records to force leaves to split.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 17, 2005
*
*-------------------------------------------------------------------------
@@ -2027,8 +2027,8 @@ static unsigned
test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -2233,25 +2233,25 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level2_leaf_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level2_2internal_redistrib
+ * Function: test_insert_level2_2internal_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree and then adds enough more
* records to force the left-most and right-most internal nodes to
* redistribute.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 18, 2005
*
*-------------------------------------------------------------------------
@@ -2260,8 +2260,8 @@ static unsigned
test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -2404,25 +2404,25 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level2_2internal_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level2_2internal_split
+ * Function: test_insert_level2_2internal_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree and then adds enough more
* records to force the left-most and right-most internal nodes to
* split.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 18, 2005
*
*-------------------------------------------------------------------------
@@ -2431,8 +2431,8 @@ static unsigned
test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -2581,26 +2581,26 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level2_2internal_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level2_3internal_redistrib
+ * Function: test_insert_level2_3internal_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree and then adds enough more
* records to force the left-most and right-most internal nodes to
* split and more records to force a 3 node redistribution of the
* internal nodes.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, February 19, 2005
*
*-------------------------------------------------------------------------
@@ -2609,8 +2609,8 @@ static unsigned
test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -2758,26 +2758,26 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level2_3internal_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level2_3internal_split
+ * Function: test_insert_level2_3internal_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree and then adds enough more
* records to force the left-most and right-most internal nodes to
* split and more records to force a 3->4 node split of the
* internal nodes.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, February 19, 2005
*
*-------------------------------------------------------------------------
@@ -2786,8 +2786,8 @@ static unsigned
test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -2939,23 +2939,23 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level2_3internal_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_lots
+ * Function: test_insert_lots
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts many
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts many
* records in random order, enough to make at a level 4 B-tree.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, February 19, 2005
*
*-------------------------------------------------------------------------
@@ -2964,9 +2964,9 @@ static unsigned
test_insert_lots(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- char filename[1024]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[1024]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -3099,13 +3099,13 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY*3), find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY*3), find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
TEST_ERROR
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY*3), find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY*3), find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3170,22 +3170,22 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
HDfree(records);
return 1;
} /* test_insert_lots() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_basic
+ * Function: test_update_basic
*
- * Purpose: Basic tests for the v2 B-tree update operation
+ * Purpose: Basic tests for the v2 B-tree update operation
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, December 23, 2015
*
*-------------------------------------------------------------------------
@@ -3194,8 +3194,8 @@ static unsigned
test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -3257,7 +3257,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in B-tree with 1 record */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3321,7 +3321,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in B-tree with 1 record */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3391,7 +3391,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in B-tree with several records */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3478,7 +3478,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in B-tree with several records */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3537,24 +3537,24 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_update_basic() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_split_root
+ * Function: test_update_split_root
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It also continues to add a few more records to each of the
* left and right leaf nodes after the split
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, December 23, 2015
*
*-------------------------------------------------------------------------
@@ -3563,8 +3563,8 @@ static unsigned
test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -3736,7 +3736,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in level-1 B-tree */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC + 2), index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC + 2), index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3788,25 +3788,25 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_update_split_root() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_level1_2leaf_redistrib
+ * Function: test_update_level1_2leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* redistribution
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, December 26, 2015
*
*-------------------------------------------------------------------------
@@ -3815,8 +3815,8 @@ static unsigned
test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -3946,25 +3946,25 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_update_level1_2leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_level1_side_split
+ * Function: test_update_level1_side_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* split, adding another node to the B-tree
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, December 26, 2015
*
*-------------------------------------------------------------------------
@@ -3973,8 +3973,8 @@ static unsigned
test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -4109,27 +4109,27 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_update_level1_side_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_level1_3leaf_redistrib
+ * Function: test_update_level1_3leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* split, adding another node to the B-tree, then continues to
* add records until a 3 node redistribution occurs
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, December 26, 2015
*
*-------------------------------------------------------------------------
@@ -4138,8 +4138,8 @@ static unsigned
test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -4256,26 +4256,26 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_update_level1_3leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_level1_middle_split
+ * Function: test_update_level1_middle_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* split, adding another node to the B-tree, then continues to
* add records until a 3 node split occurs
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, December 26, 2015
*
*-------------------------------------------------------------------------
@@ -4284,8 +4284,8 @@ static unsigned
test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -4381,22 +4381,22 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_update_level1_middle_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_make_level2
+ * Function: test_update_make_level2
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, December 26, 2015
*
*-------------------------------------------------------------------------
@@ -4405,8 +4405,8 @@ static unsigned
test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -4541,7 +4541,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in level-2 B-tree */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -4706,7 +4706,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in level-2 B-tree */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -4881,7 +4881,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in level-2 B-tree */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -4934,22 +4934,22 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_update_make_level2() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_lots
+ * Function: test_update_lots
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts many
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts many
* records in random order, enough to make at a level 4 B-tree.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Sunday, December 27, 2015
*
*-------------------------------------------------------------------------
@@ -4958,8 +4958,8 @@ static unsigned
test_update_lots(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
time_t curr_time; /* Current time, for seeding random number generator */
@@ -5086,13 +5086,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
TEST_ERROR
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5174,23 +5174,23 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
HDfree(records);
return 1;
} /* test_update_lots() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_basic
+ * Function: test_remove_basic
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 25, 2005
*
*-------------------------------------------------------------------------
@@ -5199,8 +5199,8 @@ static unsigned
test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -5231,7 +5231,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to remove a record from a B-tree with no records */
record = 0;
H5E_BEGIN_TRY {
- ret = H5B2_remove(bt2, &record, NULL, NULL);
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5351,7 +5351,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
record = 0;
H5E_BEGIN_TRY {
- ret = H5B2_remove(bt2, &record, NULL, NULL);
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5483,21 +5483,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_basic() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_noredistrib
+ * Function: test_remove_level1_noredistrib
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 25, 2005
*
*-------------------------------------------------------------------------
@@ -5506,8 +5506,8 @@ static unsigned
test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -5554,7 +5554,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to remove a non-existant record from a B-tree with 1 record */
record = (INSERT_SPLIT_ROOT_NREC * 2) + 1;
H5E_BEGIN_TRY {
- ret = H5B2_remove(bt2, &record, NULL, NULL);
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5705,21 +5705,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_noredistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_redistrib
+ * Function: test_remove_level1_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -5728,8 +5728,8 @@ static unsigned
test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -5901,21 +5901,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_2leaf_merge
+ * Function: test_remove_level1_2leaf_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -5924,8 +5924,8 @@ static unsigned
test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -6079,21 +6079,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_2leaf_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_3leaf_merge
+ * Function: test_remove_level1_3leaf_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -6102,8 +6102,8 @@ static unsigned
test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -6204,21 +6204,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_3leaf_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_promote
+ * Function: test_remove_level1_promote
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -6227,8 +6227,8 @@ static unsigned
test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -6430,21 +6430,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_promote() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_promote_2leaf_redistrib
+ * Function: test_remove_level1_promote_2leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -6453,8 +6453,8 @@ static unsigned
test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -6577,21 +6577,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_promote_2leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_promote_3leaf_redistrib
+ * Function: test_remove_level1_promote_3leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -6600,8 +6600,8 @@ static unsigned
test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -6724,21 +6724,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_promote_3leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_promote_2leaf_merge
+ * Function: test_remove_level1_promote_2leaf_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -6747,8 +6747,8 @@ static unsigned
test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -6868,21 +6868,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_promote_2leaf_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_promote_3leaf_merge
+ * Function: test_remove_level1_promote_3leaf_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -6891,8 +6891,8 @@ static unsigned
test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -7012,21 +7012,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_promote_3leaf_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_collapse
+ * Function: test_remove_level1_collapse
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -7035,8 +7035,8 @@ static unsigned
test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -7150,21 +7150,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_collapse() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_promote
+ * Function: test_remove_level2_promote
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -7173,8 +7173,8 @@ static unsigned
test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -7435,21 +7435,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_promote() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_promote_2internal_redistrib
+ * Function: test_remove_level2_promote_2internal_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 7, 2005
*
*-------------------------------------------------------------------------
@@ -7458,8 +7458,8 @@ static unsigned
test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -7584,21 +7584,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_promote_2internal_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_3promote_internal_redistrib
+ * Function: test_remove_level2_3promote_internal_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 7, 2005
*
*-------------------------------------------------------------------------
@@ -7607,8 +7607,8 @@ static unsigned
test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -7733,21 +7733,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_promote_3internal_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_promote_2internal_merge
+ * Function: test_remove_level2_promote_2internal_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 7, 2005
*
*-------------------------------------------------------------------------
@@ -7756,8 +7756,8 @@ static unsigned
test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -7883,21 +7883,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_promote_2internal_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_3promote_internal_merge
+ * Function: test_remove_level2_3promote_internal_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 7, 2005
*
*-------------------------------------------------------------------------
@@ -7906,8 +7906,8 @@ static unsigned
test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -8033,21 +8033,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_promote_3internal_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_2internal_merge_left
+ * Function: test_remove_level2_2internal_merge_left
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -8056,8 +8056,8 @@ static unsigned
test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -8158,21 +8158,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_2internal_merge_left() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_2internal_merge_right
+ * Function: test_remove_level2_2internal_merge_right
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -8181,8 +8181,8 @@ static unsigned
test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -8283,21 +8283,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_2internal_merge_right() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_3internal_merge
+ * Function: test_remove_level2_3internal_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -8306,8 +8306,8 @@ static unsigned
test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -8408,21 +8408,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_3internal_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_collapse_right
+ * Function: test_remove_level2_collapse_right
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -8431,8 +8431,8 @@ static unsigned
test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -8533,21 +8533,21 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_collapse_right() */
-
+
/*-------------------------------------------------------------------------
- * Function: gen_l4_btree2
+ * Function: gen_l4_btree2
*
- * Purpose: Generate a level-4 v2 B-tree for testing.
+ * Purpose: Generate a level-4 v2 B-tree for testing.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, October 14, 2008
*
*-------------------------------------------------------------------------
@@ -8556,8 +8556,8 @@ static unsigned
gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam,
haddr_t *bt2_addr, const hsize_t *records)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
hsize_t record; /* Record to insert into tree */
unsigned u; /* Local index variable */
@@ -8607,24 +8607,24 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* gen_l4_btree2() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_lots
+ * Function: test_remove_lots
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts many
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts many
* records in random order, enough to make at a level 4 B-tree
* and then removes them all, by record and by index.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -8632,11 +8632,11 @@ error:
static unsigned
test_remove_lots(const char *env_h5_drvr, hid_t fapl, const H5B2_create_t *cparam)
{
- hid_t file = -1; /* File ID */
- char filename[1024]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[1024]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
int fd = -1; /* File descriptor */
- h5_stat_t sb; /* Stat buffer for file */
+ h5_stat_t sb; /* Stat buffer for file */
void *file_data = NULL; /* Copy of file data */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
@@ -9051,7 +9051,7 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(fd > 0)
@@ -9064,17 +9064,17 @@ error:
return 1;
} /* test_remove_lots() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_find_neighbor
+ * Function: test_find_neighbor
*
- * Purpose: Basic tests for the B-tree v2 code. This test exercises
+ * Purpose: Basic tests for the B-tree v2 code. This test exercises
* code to find nearest neighbors to a given value in a B-tree.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -9083,8 +9083,8 @@ static unsigned
test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -9125,7 +9125,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find record B-tree less than a value */
search = 0;
H5E_BEGIN_TRY {
- ret = H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record);
+ ret = H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -9203,7 +9203,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find record B-tree less than a value */
search = (FIND_NEIGHBOR * 2) + 1;
H5E_BEGIN_TRY {
- ret = H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record);
+ ret = H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -9279,23 +9279,23 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
HDfree(records);
return 1;
} /* test_find_neighbor() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_delete
+ * Function: test_delete
*
- * Purpose: Basic tests for the B-tree v2 code. This test exercises
+ * Purpose: Basic tests for the B-tree v2 code. This test exercises
* code to delete a B-tree from a file
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, March 9, 2005
*
*-------------------------------------------------------------------------
@@ -9303,9 +9303,9 @@ error:
static unsigned
test_delete(hid_t fapl, const H5B2_create_t *cparam)
{
- hid_t file = -1; /* File ID */
- char filename[1024]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[1024]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t empty_size; /* Size of an empty file */
h5_stat_size_t file_size; /* Size of each file created */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
@@ -9551,22 +9551,22 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_delete() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_modify
+ * Function: test_modify
*
- * Purpose: Basic tests for the B-tree v2 code. This test exercises
+ * Purpose: Basic tests for the B-tree v2 code. This test exercises
* code to modify an existing record in the B-tree
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 10, 2005
*
*-------------------------------------------------------------------------
@@ -9575,8 +9575,8 @@ static unsigned
test_modify(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -9617,7 +9617,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
record = 3;
modify = 4;
H5E_BEGIN_TRY {
- ret = H5B2_modify(bt2, &record, modify_cb, &modify);
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -9663,7 +9663,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
record = 4330;
found = HSIZET_MAX;
H5E_BEGIN_TRY {
- ret = H5B2_modify(bt2, &record, modify_cb, &modify);
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -9709,7 +9709,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
record = 5350;
found = 5350;
H5E_BEGIN_TRY {
- ret = H5B2_modify(bt2, &record, modify_cb, &modify);
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -9755,7 +9755,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
record = 9445;
found = 9445;
H5E_BEGIN_TRY {
- ret = H5B2_modify(bt2, &record, modify_cb, &modify);
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -9778,23 +9778,23 @@ error:
H5E_BEGIN_TRY {
if(bt2)
H5B2_close(bt2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_modify() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_open_twice_diff
+ * Function: test_open_twice_diff
*
- * Purpose: Open a v2 B-tree twice, through different "top" file
+ * Purpose: Open a v2 B-tree twice, through different "top" file
* handles, with an intermediate file open that takes the "shared"
* file handle from the first B-tree's file pointer.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, December 18, 2015
*
*-------------------------------------------------------------------------
@@ -9802,14 +9802,14 @@ error:
static unsigned
test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
{
- char filename[1024]; /* Filename to use */
+ char filename[1024]; /* Filename to use */
char filename_tmp[1024]; /* Temporary file name */
- hid_t file = -1; /* File ID */
- hid_t file2 = -1; /* File ID */
- hid_t file0 = -1; /* File ID */
- hid_t file00 = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- H5F_t *f2 = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ hid_t file2 = -1; /* File ID */
+ hid_t file0 = -1; /* File ID */
+ hid_t file00 = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ H5F_t *f2 = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
H5B2_t *bt2_2 = NULL; /* Second v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
@@ -9914,25 +9914,25 @@ error:
H5B2_close(bt2);
if(bt2)
H5B2_close(bt2_2);
- H5Fclose(file);
- H5Fclose(file2);
- H5Fclose(file0);
- H5Fclose(file00);
+ H5Fclose(file);
+ H5Fclose(file2);
+ H5Fclose(file0);
+ H5Fclose(file00);
} H5E_END_TRY;
return(1);
} /* test_open_twice_diff() */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test the B-tree v2 code
+ * Purpose: Test the B-tree v2 code
*
- * Return: Success:
+ * Return: Success:
*
- * Failure:
+ * Failure:
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, February 1, 2005
*
*-------------------------------------------------------------------------
@@ -9942,10 +9942,10 @@ main(void)
{
H5B2_create_t cparam, cparam2; /* Creation parameters for v2 B-tree */
bt2_test_param_t tparam; /* Test parameters for v2 B-tree */
- hid_t fapl = -1; /* File access property list for data files */
- unsigned nerrors = 0; /* Cumulative error count */
+ hid_t fapl = -1; /* File access property list for data files */
+ unsigned nerrors = 0; /* Cumulative error count */
unsigned reopen; /* Whether to reopen B-tree during tests */
- int ExpressMode;
+ int ExpressMode;
const char *envval = NULL;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
@@ -9958,7 +9958,7 @@ main(void)
fapl = h5_fileaccess();
ExpressMode = GetTestExpress();
if(ExpressMode > 1)
- printf("***Express test mode on. Some tests may be skipped\n");
+ HDprintf("***Express test mode on. Some tests may be skipped\n");
/* Initialize v2 B-tree creation parameters */
init_cparam(&cparam, &cparam2);
@@ -9970,11 +9970,11 @@ main(void)
/* Loop over re-opening B-tree during tests */
for(reopen = FALSE; reopen <= TRUE; reopen++) {
if(reopen) {
- fprintf(stdout, "Testing with reopening B-tree:\n");
+ HDfprintf(stdout, "Testing with reopening B-tree:\n");
tparam.reopen_btree = TRUE;
} /* end if */
else {
- fprintf(stdout, "Testing without reopening B-tree:\n");
+ HDfprintf(stdout, "Testing without reopening B-tree:\n");
tparam.reopen_btree = FALSE;
} /* end else */
@@ -9994,7 +9994,7 @@ main(void)
nerrors += test_insert_level2_3internal_redistrib(fapl, &cparam, &tparam);
nerrors += test_insert_level2_3internal_split(fapl, &cparam, &tparam);
if(ExpressMode > 1)
- printf("***Express test mode on. test_insert_lots skipped\n");
+ HDprintf("***Express test mode on. test_insert_lots skipped\n");
else
nerrors += test_insert_lots(fapl, &cparam, &tparam);
@@ -10008,7 +10008,7 @@ main(void)
nerrors += test_update_level1_middle_split(fapl, &cparam2, &tparam);
nerrors += test_update_make_level2(fapl, &cparam2, &tparam);
if(ExpressMode > 1)
- printf("***Express test mode on. test_update_lots skipped\n");
+ HDprintf("***Express test mode on. test_update_lots skipped\n");
else
nerrors += test_update_lots(fapl, &cparam2, &tparam);
@@ -10035,7 +10035,7 @@ main(void)
nerrors += test_remove_level2_3internal_merge(fapl, &cparam, &tparam);
nerrors += test_remove_level2_collapse_right(fapl, &cparam, &tparam);
if(ExpressMode > 1)
- printf("***Express test mode on. test_remove_lots skipped\n");
+ HDprintf("***Express test mode on. test_remove_lots skipped\n");
else
nerrors += test_remove_lots(envval, fapl, &cparam);
diff --git a/test/cache.c b/test/cache.c
index d5e3c6c..1573e97 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -14,85 +14,126 @@
/* Programmer: John Mainzer
* 6/9/04
*
- * This file contains tests for the cache implemented in
- * H5C.c
+ * This file contains tests for the cache implemented in
+ * H5C.c
*/
#include "cache_common.h"
+#include "H5MFprivate.h"
+
+
+H5C_t * saved_cache = NULL; /* store the pointer to the instance of
+ * of H5C_t created by H5Fcreate()
+ * here between test cache setup and
+ * shutdown.
+ */
+
+haddr_t saved_actual_base_addr = HADDR_UNDEF; /* Store the address of the
+ * space allocated for cache items in the file between
+ * cache setup & takedown
+ */
+
+hid_t saved_fapl_id = H5P_DEFAULT; /* store the fapl id here between
+ * cache setup and takedown. Note
+ * that if saved_fapl_id == H5P_DEFAULT,
+ * we assume that there is no fapl to
+ * close.
+ */
+
+hid_t saved_fcpl_id = H5P_DEFAULT; /* store the fcpl id here between
+ * cache setup and takedown. Note
+ * that if saved_fcpl_id == H5P_DEFAULT,
+ * we assume that there is no fcpl to
+ * close.
+ */
+
+hid_t saved_fid = -1; /* store the file id here between cache setup
+ * and takedown.
+ */
+hbool_t write_permitted = TRUE;
+hbool_t try_core_file_driver = FALSE;
+hbool_t core_file_driver_failed = FALSE;
+
+
+/* global variable declarations: */
+
+const char *FILENAME[] = {
+ "cache_test",
+ NULL
+};
-
/* private typedef declarations: */
struct flush_cache_test_spec
{
- int entry_num;
- int entry_type;
- int entry_index;
- hbool_t insert_flag;
- unsigned int flags;
- hbool_t expected_deserialized;
- hbool_t expected_serialized;
- hbool_t expected_destroyed;
+ int entry_num;
+ int entry_type;
+ int entry_index;
+ hbool_t insert_flag;
+ unsigned int flags;
+ hbool_t expected_deserialized;
+ hbool_t expected_serialized;
+ hbool_t expected_destroyed;
};
struct pe_flush_cache_test_spec
{
- int entry_num;
- int entry_type;
- int entry_index;
- hbool_t insert_flag;
- unsigned int flags;
- int num_pins;
- int pin_type[MAX_PINS];
- int pin_idx[MAX_PINS];
- hbool_t expected_deserialized;
- hbool_t expected_serialized;
- hbool_t expected_destroyed;
+ int entry_num;
+ int entry_type;
+ int entry_index;
+ hbool_t insert_flag;
+ unsigned int flags;
+ int num_pins;
+ int pin_type[MAX_PINS];
+ int pin_idx[MAX_PINS];
+ hbool_t expected_deserialized;
+ hbool_t expected_serialized;
+ hbool_t expected_destroyed;
};
struct fo_flush_entry_check
{
- int entry_num;
- int entry_type;
- int entry_index;
- size_t expected_size;
- hbool_t in_cache;
- hbool_t at_main_addr;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- hbool_t expected_deserialized;
- hbool_t expected_serialized;
- hbool_t expected_destroyed;
+ int entry_num;
+ int entry_type;
+ int entry_index;
+ size_t expected_size;
+ hbool_t in_cache;
+ hbool_t at_main_addr;
+ hbool_t is_dirty;
+ hbool_t is_protected;
+ hbool_t is_pinned;
+ hbool_t expected_deserialized;
+ hbool_t expected_serialized;
+ hbool_t expected_destroyed;
};
struct fo_flush_cache_test_spec
{
- int entry_num;
- int entry_type;
- int entry_index;
- hbool_t insert_flag;
- unsigned int flags;
- hbool_t resize_flag;
- size_t new_size;
- int num_pins;
- int pin_type[MAX_PINS];
- int pin_idx[MAX_PINS];
- int num_flush_ops;
- struct flush_op flush_ops[MAX_FLUSH_OPS];
- hbool_t expected_deserialized;
- hbool_t expected_serialized;
- hbool_t expected_destroyed;
+ int entry_num;
+ int entry_type;
+ int entry_index;
+ hbool_t insert_flag;
+ unsigned int flags;
+ hbool_t resize_flag;
+ size_t new_size;
+ int num_pins;
+ int pin_type[MAX_PINS];
+ int pin_idx[MAX_PINS];
+ int num_flush_ops;
+ struct flush_op flush_ops[MAX_FLUSH_OPS];
+ hbool_t expected_deserialized;
+ hbool_t expected_serialized;
+ hbool_t expected_destroyed;
};
struct move_entry_test_spec
{
- int entry_type;
- int entry_index;
- hbool_t is_pinned;
+ int entry_type;
+ int entry_index;
+ hbool_t is_pinned;
hbool_t is_protected;
};
-
+
/* private function declarations: */
static unsigned smoke_check_1(int express_test, unsigned paged);
@@ -136,7 +177,7 @@ static void check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr,
int entry_type,
int entry_idx,
hbool_t unprot_dirty_flag,
- hbool_t mark_dirty,
+ hbool_t mark_dirty,
hbool_t pop_mark_dirty_prot,
hbool_t pop_mark_dirty_pinned,
hbool_t unprotect_unpin,
@@ -150,11 +191,11 @@ static void check_flush_cache__flush_op_test(H5F_t * file_ptr,
unsigned int flush_flags,
int spec_size,
const struct fo_flush_cache_test_spec spec[],
- unsigned init_expected_index_len,
- size_t init_expected_index_size,
- unsigned expected_index_len,
- size_t expected_index_size,
- int check_size,
+ unsigned init_expected_index_len,
+ size_t init_expected_index_size,
+ unsigned expected_index_len,
+ size_t expected_index_size,
+ int check_size,
struct fo_flush_entry_check check[]);
static void check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr);
static unsigned check_get_entry_status(unsigned paged);
@@ -204,7 +245,13 @@ static unsigned check_stats(unsigned paged);
static void check_stats__smoke_check_1(H5F_t * file_ptr);
#endif /* H5C_COLLECT_CACHE_STATS */
-
+
+static H5F_t *setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged);
+
+static void takedown_cache(H5F_t * file_ptr,
+ hbool_t dump_stats,
+ hbool_t dump_detailed_stats);
+
/**************************************************************************/
/**************************************************************************/
/********************************* tests: *********************************/
@@ -212,15 +259,15 @@ static void check_stats__smoke_check_1(H5F_t * file_ptr);
/**************************************************************************/
/*-------------------------------------------------------------------------
- * Function: smoke_check_1()
+ * Function: smoke_check_1()
*
- * Purpose: A basic functional test, inserts, destroys, and moves in
+ * Purpose: A basic functional test, inserts, destroys, and moves in
* the mix, along with repeated protects and unprotects.
- * All entries are marked as clean.
+ * All entries are marked as clean.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/16/04
*
*-------------------------------------------------------------------------
@@ -251,23 +298,23 @@ smoke_check_1(int express_test, unsigned paged)
switch (express_test)
{
- case 0:
- max_index = (10 * 1024) - 1;
- break;
+ case 0:
+ max_index = (10 * 1024) - 1;
+ break;
- case 1:
- max_index = (1 * 1024) - 1;
- break;
+ case 1:
+ max_index = (1 * 1024) - 1;
+ break;
- case 2:
- max_index = (512) - 1;
- break;
+ case 2:
+ max_index = (512) - 1;
+ break;
- default:
+ default:
SKIPPED();
- HDfprintf(stdout, " Long tests disabled.\n");
- return 0; /* <========== note return */
- break;
+ HDfprintf(stdout, " Long tests disabled.\n");
+ return 0; /* <========== note return */
+ break;
}
pass = TRUE;
@@ -289,7 +336,7 @@ smoke_check_1(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -299,7 +346,7 @@ smoke_check_1(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -318,7 +365,7 @@ smoke_check_1(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ TRUE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -327,7 +374,7 @@ smoke_check_1(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -337,7 +384,7 @@ smoke_check_1(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -357,7 +404,7 @@ smoke_check_1(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -382,7 +429,7 @@ smoke_check_1(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -416,18 +463,18 @@ smoke_check_1(int express_test, unsigned paged)
} /* smoke_check_1() */
-
+
/*-------------------------------------------------------------------------
- * Function: smoke_check_2()
+ * Function: smoke_check_2()
*
- * Purpose: A basic functional test, with inserts, destroys, and
- * moves in the mix, along with some repeated protects
- * and unprotects. About half the entries are marked as
- * dirty.
+ * Purpose: A basic functional test, with inserts, destroys, and
+ * moves in the mix, along with some repeated protects
+ * and unprotects. About half the entries are marked as
+ * dirty.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/24/04
*
*-------------------------------------------------------------------------
@@ -458,23 +505,23 @@ smoke_check_2(int express_test, unsigned paged)
switch (express_test)
{
- case 0:
- max_index = (10 * 1024) - 1;
- break;
+ case 0:
+ max_index = (10 * 1024) - 1;
+ break;
- case 1:
- max_index = (1 * 1024) - 1;
- break;
+ case 1:
+ max_index = (1 * 1024) - 1;
+ break;
- case 2:
- max_index = (512) - 1;
- break;
+ case 2:
+ max_index = (512) - 1;
+ break;
- default:
+ default:
SKIPPED();
- HDfprintf(stdout, " Long tests disabled.\n");
- return 0; /* <========== note return */
- break;
+ HDfprintf(stdout, " Long tests disabled.\n");
+ return 0; /* <========== note return */
+ break;
}
pass = TRUE;
@@ -496,7 +543,7 @@ smoke_check_2(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -506,7 +553,7 @@ smoke_check_2(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -525,7 +572,7 @@ smoke_check_2(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ TRUE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -534,7 +581,7 @@ smoke_check_2(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -544,7 +591,7 @@ smoke_check_2(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -564,7 +611,7 @@ smoke_check_2(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -589,7 +636,7 @@ smoke_check_2(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -623,17 +670,17 @@ smoke_check_2(int express_test, unsigned paged)
} /* smoke_check_2() */
-
+
/*-------------------------------------------------------------------------
- * Function: smoke_check_3()
+ * Function: smoke_check_3()
*
- * Purpose: A basic functional test on a tiny cache, with inserts,
- * destroys, and moves in the mix, along with repeated
- * protects and unprotects. All entries are marked as clean.
+ * Purpose: A basic functional test on a tiny cache, with inserts,
+ * destroys, and moves in the mix, along with repeated
+ * protects and unprotects. All entries are marked as clean.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/16/04
*
*-------------------------------------------------------------------------
@@ -664,23 +711,23 @@ smoke_check_3(int express_test, unsigned paged)
switch (express_test)
{
- case 0:
- max_index = (10 * 1024) - 1;
- break;
+ case 0:
+ max_index = (10 * 1024) - 1;
+ break;
- case 1:
- max_index = (1 * 1024) - 1;
- break;
+ case 1:
+ max_index = (1 * 1024) - 1;
+ break;
- case 2:
- max_index = (512) - 1;
- break;
+ case 2:
+ max_index = (512) - 1;
+ break;
- default:
+ default:
SKIPPED();
- HDfprintf(stdout, " Long tests disabled.\n");
- return 0; /* <========== note return */
- break;
+ HDfprintf(stdout, " Long tests disabled.\n");
+ return 0; /* <========== note return */
+ break;
}
pass = TRUE;
@@ -702,7 +749,7 @@ smoke_check_3(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -712,7 +759,7 @@ smoke_check_3(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -731,7 +778,7 @@ smoke_check_3(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ TRUE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -740,7 +787,7 @@ smoke_check_3(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -750,7 +797,7 @@ smoke_check_3(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -770,7 +817,7 @@ smoke_check_3(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -795,7 +842,7 @@ smoke_check_3(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -829,18 +876,18 @@ smoke_check_3(int express_test, unsigned paged)
} /* smoke_check_3() */
-
+
/*-------------------------------------------------------------------------
- * Function: smoke_check_4()
+ * Function: smoke_check_4()
*
- * Purpose: A basic functional test on a tiny cache, with inserts,
- * destroys, and moves in the mix, along with repeated
- * protects and unprotects. About half the entries are
- * marked as dirty.
+ * Purpose: A basic functional test on a tiny cache, with inserts,
+ * destroys, and moves in the mix, along with repeated
+ * protects and unprotects. About half the entries are
+ * marked as dirty.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/24/04
*
*-------------------------------------------------------------------------
@@ -871,23 +918,23 @@ smoke_check_4(int express_test, unsigned paged)
switch (express_test)
{
- case 0:
- max_index = (10 * 1024) - 1;
- break;
+ case 0:
+ max_index = (10 * 1024) - 1;
+ break;
- case 1:
- max_index = (1 * 1024) - 1;
- break;
+ case 1:
+ max_index = (1 * 1024) - 1;
+ break;
- case 2:
- max_index = (512) - 1;
- break;
+ case 2:
+ max_index = (512) - 1;
+ break;
- default:
+ default:
SKIPPED();
- HDfprintf(stdout, " Long tests disabled.\n");
- return 0; /* <========== note return */
- break;
+ HDfprintf(stdout, " Long tests disabled.\n");
+ return 0; /* <========== note return */
+ break;
}
pass = TRUE;
@@ -909,7 +956,7 @@ smoke_check_4(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -919,7 +966,7 @@ smoke_check_4(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -938,7 +985,7 @@ smoke_check_4(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ TRUE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -947,7 +994,7 @@ smoke_check_4(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -957,7 +1004,7 @@ smoke_check_4(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -977,7 +1024,7 @@ smoke_check_4(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -1002,7 +1049,7 @@ smoke_check_4(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -1036,18 +1083,18 @@ smoke_check_4(int express_test, unsigned paged)
} /* smoke_check_4() */
-
+
/*-------------------------------------------------------------------------
- * Function: smoke_check_5()
+ * Function: smoke_check_5()
*
- * Purpose: A basic functional test on a cache with automatic cache
- * resizing enabled, with inserts in the mix, along with
- * repeated protects and unprotects. All entries are marked
- * as clean.
+ * Purpose: A basic functional test on a cache with automatic cache
+ * resizing enabled, with inserts in the mix, along with
+ * repeated protects and unprotects. All entries are marked
+ * as clean.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 10/14/04
*
*-------------------------------------------------------------------------
@@ -1093,9 +1140,9 @@ smoke_check_5(int express_test, unsigned paged)
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0f,
+ /* double flash_threshold = */ 0.5f,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
@@ -1126,23 +1173,23 @@ smoke_check_5(int express_test, unsigned paged)
switch (express_test)
{
- case 0:
- max_index = (10 * 1024) - 1;
- break;
+ case 0:
+ max_index = (10 * 1024) - 1;
+ break;
- case 1:
- max_index = (1 * 1024) - 1;
- break;
+ case 1:
+ max_index = (1 * 1024) - 1;
+ break;
- case 2:
- max_index = (512) - 1;
- break;
+ case 2:
+ max_index = (512) - 1;
+ break;
- default:
+ default:
SKIPPED();
- HDfprintf(stdout, " Long tests disabled.\n");
- return 0; /* <========== note return */
- break;
+ HDfprintf(stdout, " Long tests disabled.\n");
+ return 0; /* <========== note return */
+ break;
}
pass = TRUE;
@@ -1280,18 +1327,18 @@ smoke_check_5(int express_test, unsigned paged)
} /* smoke_check_5() */
-
+
/*-------------------------------------------------------------------------
- * Function: smoke_check_6()
+ * Function: smoke_check_6()
*
- * Purpose: A basic functional test on a cache with automatic cache
- * resizing enabled, with inserts in the mix, along with
+ * Purpose: A basic functional test on a cache with automatic cache
+ * resizing enabled, with inserts in the mix, along with
* repeated protects and unprotects. About one half of all
- * entries are marked as dirty.
+ * entries are marked as dirty.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 10/25/04
*
*-------------------------------------------------------------------------
@@ -1337,9 +1384,9 @@ smoke_check_6(int express_test, unsigned paged)
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0f,
+ /* double flash_threshold = */ 0.5f,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
@@ -1372,23 +1419,23 @@ smoke_check_6(int express_test, unsigned paged)
switch (express_test)
{
- case 0:
- max_index = (10 * 1024) - 1;
- break;
+ case 0:
+ max_index = (10 * 1024) - 1;
+ break;
- case 1:
- max_index = (1 * 1024) - 1;
- break;
+ case 1:
+ max_index = (1 * 1024) - 1;
+ break;
- case 2:
- max_index = (512) - 1;
- break;
+ case 2:
+ max_index = (512) - 1;
+ break;
- default:
+ default:
SKIPPED();
- HDfprintf(stdout, " Long tests disabled.\n");
- return 0; /* <========== note return */
- break;
+ HDfprintf(stdout, " Long tests disabled.\n");
+ return 0; /* <========== note return */
+ break;
}
if(show_progress) /* 1 */
@@ -1524,18 +1571,18 @@ smoke_check_6(int express_test, unsigned paged)
} /* smoke_check_6() */
-
+
/*-------------------------------------------------------------------------
- * Function: smoke_check_7()
+ * Function: smoke_check_7()
*
- * Purpose: A basic functional test on a cache with automatic cache
- * resizing enabled, with inserts in the mix, along with
- * repeated protects and unprotects. All entries are marked
- * as clean.
+ * Purpose: A basic functional test on a cache with automatic cache
+ * resizing enabled, with inserts in the mix, along with
+ * repeated protects and unprotects. All entries are marked
+ * as clean.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 12/2/04
*
*-------------------------------------------------------------------------
@@ -1581,9 +1628,9 @@ smoke_check_7(int express_test, unsigned paged)
/* size_t max_increment = */ (8 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0f,
+ /* double flash_threshold = */ 0.5f,
/* enum H5C_cache_decr_mode decr_mode = */
@@ -1615,23 +1662,23 @@ smoke_check_7(int express_test, unsigned paged)
switch (express_test)
{
- case 0:
- max_index = (10 * 1024) - 1;
- break;
+ case 0:
+ max_index = (10 * 1024) - 1;
+ break;
- case 1:
- max_index = (1 * 1024) - 1;
- break;
+ case 1:
+ max_index = (1 * 1024) - 1;
+ break;
- case 2:
- max_index = (512) - 1;
- break;
+ case 2:
+ max_index = (512) - 1;
+ break;
- default:
+ default:
SKIPPED();
- HDfprintf(stdout, " Long tests disabled.\n");
- return 0; /* <========== note return */
- break;
+ HDfprintf(stdout, " Long tests disabled.\n");
+ return 0; /* <========== note return */
+ break;
}
pass = TRUE;
@@ -1769,18 +1816,18 @@ smoke_check_7(int express_test, unsigned paged)
} /* smoke_check_7() */
-
+
/*-------------------------------------------------------------------------
- * Function: smoke_check_8()
+ * Function: smoke_check_8()
*
- * Purpose: A basic functional test on a cache with automatic cache
- * resizing enabled, with inserts in the mix, along with
+ * Purpose: A basic functional test on a cache with automatic cache
+ * resizing enabled, with inserts in the mix, along with
* repeated protects and unprotects. About one half of all
- * entries are marked as dirty.
+ * entries are marked as dirty.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 10/25/04
*
*-------------------------------------------------------------------------
@@ -1826,9 +1873,9 @@ smoke_check_8(int express_test, unsigned paged)
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0f,
+ /* double flash_threshold = */ 0.5f,
/* enum H5C_cache_decr_mode decr_mode = */
@@ -1860,23 +1907,23 @@ smoke_check_8(int express_test, unsigned paged)
switch (express_test)
{
- case 0:
- max_index = (10 * 1024) - 1;
- break;
+ case 0:
+ max_index = (10 * 1024) - 1;
+ break;
- case 1:
- max_index = (1 * 1024) - 1;
- break;
+ case 1:
+ max_index = (1 * 1024) - 1;
+ break;
- case 2:
- max_index = (512) - 1;
- break;
+ case 2:
+ max_index = (512) - 1;
+ break;
- default:
+ default:
SKIPPED();
- HDfprintf(stdout, " Long tests disabled.\n");
- return 0; /* <========== note return */
- break;
+ HDfprintf(stdout, " Long tests disabled.\n");
+ return 0; /* <========== note return */
+ break;
}
pass = TRUE;
@@ -2014,26 +2061,26 @@ smoke_check_8(int express_test, unsigned paged)
} /* smoke_check_8() */
-
+
/*-------------------------------------------------------------------------
- * Function: smoke_check_9()
+ * Function: smoke_check_9()
*
- * Purpose: A repeat of smoke check 1, only with the cache corked
- * part of the time.
+ * Purpose: A repeat of smoke check 1, only with the cache corked
+ * part of the time.
*
- * Recall that smoke check 1 is a basic functional test,
- * with inserts, destroys, and moves in the mix, along
- * with repeated protects and unprotects. All entries are
- * marked as clean.
+ * Recall that smoke check 1 is a basic functional test,
+ * with inserts, destroys, and moves in the mix, along
+ * with repeated protects and unprotects. All entries are
+ * marked as clean.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 8/1/07
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -2066,23 +2113,23 @@ smoke_check_9(int express_test, unsigned paged)
switch (express_test)
{
- case 0:
- max_index = (10 * 1024) - 1;
- break;
+ case 0:
+ max_index = (10 * 1024) - 1;
+ break;
- case 1:
- max_index = (1 * 1024) - 1;
- break;
+ case 1:
+ max_index = (1 * 1024) - 1;
+ break;
- case 2:
- max_index = (512) - 1;
- break;
+ case 2:
+ max_index = (512) - 1;
+ break;
- default:
+ default:
SKIPPED();
- HDfprintf(stdout, " Long tests disabled.\n");
- return 0; /* <========== note return */
- break;
+ HDfprintf(stdout, " Long tests disabled.\n");
+ return 0; /* <========== note return */
+ break;
}
pass = TRUE;
@@ -2113,8 +2160,8 @@ smoke_check_9(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't disable evictions 1.\n";
- }
+ failure_mssg = "can't disable evictions 1.\n";
+ }
}
if(show_progress) /* 4 */
@@ -2122,7 +2169,7 @@ smoke_check_9(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -2132,7 +2179,7 @@ smoke_check_9(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -2149,8 +2196,8 @@ smoke_check_9(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't enable evictions 1.\n";
- }
+ failure_mssg = "can't enable evictions 1.\n";
+ }
}
if(show_progress) /* 6 */
@@ -2168,7 +2215,7 @@ smoke_check_9(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ TRUE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -2183,8 +2230,8 @@ smoke_check_9(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't disable evictions 2.\n";
- }
+ failure_mssg = "can't disable evictions 2.\n";
+ }
}
if(show_progress) /* 8 */
@@ -2192,7 +2239,7 @@ smoke_check_9(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -2202,7 +2249,7 @@ smoke_check_9(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -2217,8 +2264,8 @@ smoke_check_9(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't enable evictions 2.\n";
- }
+ failure_mssg = "can't enable evictions 2.\n";
+ }
}
if(show_progress) /* 10 */
@@ -2243,8 +2290,8 @@ smoke_check_9(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't disable evictions 3.\n";
- }
+ failure_mssg = "can't disable evictions 3.\n";
+ }
}
if(show_progress) /* 12 */
@@ -2252,7 +2299,7 @@ smoke_check_9(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -2283,8 +2330,8 @@ smoke_check_9(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't enable evictions 3.\n";
- }
+ failure_mssg = "can't enable evictions 3.\n";
+ }
}
if(show_progress) /* 15 */
@@ -2292,7 +2339,7 @@ smoke_check_9(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -2312,8 +2359,8 @@ smoke_check_9(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't disable evictions 4.\n";
- }
+ failure_mssg = "can't disable evictions 4.\n";
+ }
}
@@ -2342,26 +2389,26 @@ smoke_check_9(int express_test, unsigned paged)
} /* smoke_check_9() */
-
+
/*-------------------------------------------------------------------------
- * Function: smoke_check_10()
+ * Function: smoke_check_10()
*
- * Purpose: A repeat of smoke check 2, only with the cache corked
- * part of the time.
+ * Purpose: A repeat of smoke check 2, only with the cache corked
+ * part of the time.
*
- * Recall that smoke check 2 is a basic functional test,
- * with inserts, destroys, and moves in the mix, along
- * with some repeated protects and unprotects. About half
- * the entries are marked as dirty.
+ * Recall that smoke check 2 is a basic functional test,
+ * with inserts, destroys, and moves in the mix, along
+ * with some repeated protects and unprotects. About half
+ * the entries are marked as dirty.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 8/1/07
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -2394,23 +2441,23 @@ smoke_check_10(int express_test, unsigned paged)
switch (express_test)
{
- case 0:
- max_index = (10 * 1024) - 1;
- break;
+ case 0:
+ max_index = (10 * 1024) - 1;
+ break;
- case 1:
- max_index = (1 * 1024) - 1;
- break;
+ case 1:
+ max_index = (1 * 1024) - 1;
+ break;
- case 2:
- max_index = (512) - 1;
- break;
+ case 2:
+ max_index = (512) - 1;
+ break;
- default:
+ default:
SKIPPED();
- HDfprintf(stdout, " Long tests disabled.\n");
- return 0; /* <========== note return */
- break;
+ HDfprintf(stdout, " Long tests disabled.\n");
+ return 0; /* <========== note return */
+ break;
}
pass = TRUE;
@@ -2433,7 +2480,7 @@ smoke_check_10(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -2443,7 +2490,7 @@ smoke_check_10(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -2458,8 +2505,8 @@ smoke_check_10(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't disable evictions 1.\n";
- }
+ failure_mssg = "can't disable evictions 1.\n";
+ }
}
if(show_progress) /* 5 */
@@ -2477,7 +2524,7 @@ smoke_check_10(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ TRUE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -2492,8 +2539,8 @@ smoke_check_10(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't enable evictions 1.\n";
- }
+ failure_mssg = "can't enable evictions 1.\n";
+ }
}
if(show_progress) /* 7 */
@@ -2501,7 +2548,7 @@ smoke_check_10(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -2511,7 +2558,7 @@ smoke_check_10(int express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ dirty_destroys,
/* dirty_unprotects */ dirty_unprotects);
@@ -2526,8 +2573,8 @@ smoke_check_10(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't disable evictions 2.\n";
- }
+ failure_mssg = "can't disable evictions 2.\n";
+ }
}
if(show_progress) /* 9 */
@@ -2552,8 +2599,8 @@ smoke_check_10(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't enable evictions 2.\n";
- }
+ failure_mssg = "can't enable evictions 2.\n";
+ }
}
if(show_progress) /* 11 */
@@ -2561,7 +2608,7 @@ smoke_check_10(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -2581,8 +2628,8 @@ smoke_check_10(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't disable evictions 3.\n";
- }
+ failure_mssg = "can't disable evictions 3.\n";
+ }
}
if(show_progress) /* 13 */
@@ -2607,8 +2654,8 @@ smoke_check_10(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't enable evictions 3.\n";
- }
+ failure_mssg = "can't enable evictions 3.\n";
+ }
}
if(show_progress) /* 15 */
@@ -2616,7 +2663,7 @@ smoke_check_10(int express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -2636,8 +2683,8 @@ smoke_check_10(int express_test, unsigned paged)
if(result < 0) {
pass = FALSE;
- failure_mssg = "can't disable evictions 4.\n";
- }
+ failure_mssg = "can't disable evictions 4.\n";
+ }
}
if(show_progress) /* 17 */
@@ -2665,19 +2712,19 @@ smoke_check_10(int express_test, unsigned paged)
} /* smoke_check_10() */
-
+
/*-------------------------------------------------------------------------
- * Function: write_permitted_check()
+ * Function: write_permitted_check()
*
- * Purpose: A basic test of the write permitted function. In essence,
- * we load the cache up with dirty entryies, set
- * write_permitted to FALSE, and then protect a bunch of
- * entries. If there are any writes while write_permitted is
- * FALSE, the test will fail.
+ * Purpose: A basic test of the write permitted function. In essence,
+ * we load the cache up with dirty entryies, set
+ * write_permitted to FALSE, and then protect a bunch of
+ * entries. If there are any writes while write_permitted is
+ * FALSE, the test will fail.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/24/04
*
* Modifications:
@@ -2712,23 +2759,23 @@ express_test, unsigned paged)
switch (express_test)
{
- case 0:
- max_index = (10 * 1024) - 1;
- break;
+ case 0:
+ max_index = (10 * 1024) - 1;
+ break;
- case 1:
- max_index = (1 * 1024) - 1;
- break;
+ case 1:
+ max_index = (1 * 1024) - 1;
+ break;
- case 2:
- max_index = (512) - 1;
- break;
+ case 2:
+ max_index = (512) - 1;
+ break;
- default:
+ default:
SKIPPED();
- HDfprintf(stdout, " Long tests disabled.\n");
- return 0; /* <========== note return */
- break;
+ HDfprintf(stdout, " Long tests disabled.\n");
+ return 0; /* <========== note return */
+ break;
}
pass = TRUE;
@@ -2750,7 +2797,7 @@ express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -2760,7 +2807,7 @@ express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ TRUE,
/* dirty_unprotects */ TRUE);
@@ -2781,7 +2828,7 @@ express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ TRUE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ FALSE,
/* dirty_unprotects */ NO_CHANGE);
@@ -2792,7 +2839,7 @@ express_test, unsigned paged)
write_permitted = TRUE;
row_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -2802,7 +2849,7 @@ express_test, unsigned paged)
/* do_moves */ TRUE,
/* move_to_main_addr */ FALSE,
/* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
+ /* do_mult_ro_protects */ TRUE,
/* dirty_destroys */ TRUE,
/* dirty_unprotects */ TRUE);
@@ -2822,7 +2869,7 @@ express_test, unsigned paged)
FUNC, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -2838,7 +2885,7 @@ express_test, unsigned paged)
write_permitted = FALSE;
col_major_scan_backward(/* file_ptr */ file_ptr,
- /* max_index */ max_index,
+ /* max_index */ max_index,
/* lag */ lag,
/* verbose */ FALSE,
/* reset_stats */ TRUE,
@@ -2874,7 +2921,7 @@ express_test, unsigned paged)
SKIPPED();
- HDfprintf(stdout, " Clean and dirty LRU lists disabled.\n");
+ HDfprintf(stdout, " Clean and dirty LRU lists disabled.\n");
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
@@ -2882,21 +2929,21 @@ express_test, unsigned paged)
} /* write_permitted_check() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_insert_entry()
+ * Function: check_insert_entry()
*
- * Purpose: Verify that H5C_insert_entry behaves as expected.
- * Test the behaviour with different flags.
+ * Purpose: Verify that H5C_insert_entry behaves as expected.
+ * Test the behaviour with different flags.
*
- * This test was added primarily to test basic insert
- * pinned entry functionallity, but I through in explicit
- * tests for other functionallity that is tested implicitly
- * elsewhere.
+ * This test was added primarily to test basic insert
+ * pinned entry functionallity, but I through in explicit
+ * tests for other functionallity that is tested implicitly
+ * elsewhere.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 8/10/06
*
* Modifications:
@@ -2960,13 +3007,13 @@ check_insert_entry(unsigned paged)
base_addr = entries[0];
while(pass && (i < 4))
{
- entry_ptr = &(base_addr[i]);
+ entry_ptr = &(base_addr[i]);
- /* Start by checking everything we can via H5C_get_entry_status() */
+ /* Start by checking everything we can via H5C_get_entry_status() */
- result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected,
- &is_pinned, NULL, NULL, NULL, NULL);
+ result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
+ &in_cache, &is_dirty, &is_protected,
+ &is_pinned, NULL, NULL, NULL, NULL);
if(result < 0) {
@@ -2974,129 +3021,129 @@ check_insert_entry(unsigned paged)
failure_mssg = "H5C_get_entry_status() reports failure.";
}
- if(pass) {
+ if(pass) {
- /* check the universals */
- if((!in_cache) || (!is_dirty) || (is_protected) ||
+ /* check the universals */
+ if((!in_cache) || (!is_dirty) || (is_protected) ||
(entry_size != entry_sizes[entry_type])) {
pass = FALSE;
failure_mssg = "Unexpected insert results 1.";
}
- }
+ }
- if(pass) {
+ if(pass) {
/* verify that the pinned flag got set correctly */
- if((i == 2) || (i == 3)) {
+ if((i == 2) || (i == 3)) {
- if(!is_pinned) {
+ if(!is_pinned) {
pass = FALSE;
failure_mssg = "Unexpected insert results 2.";
- }
- } else if(is_pinned) {
+ }
+ } else if(is_pinned) {
pass = FALSE;
failure_mssg = "Unexpected insert results 3.";
- } else if(is_pinned != ((entry_ptr->header).is_pinned)) {
+ } else if(is_pinned != ((entry_ptr->header).is_pinned)) {
pass = FALSE;
failure_mssg = "Unexpected insert results 4.";
}
- }
+ }
- /* Thats all we can get from H5C_get_entry_status().
- * Now start looking at the cache data structures directly.
- */
+ /* Thats all we can get from H5C_get_entry_status().
+ * Now start looking at the cache data structures directly.
+ */
- if(pass) {
+ if(pass) {
/* Verify that the flush marker got set correctly */
- if((i == 1) || (i == 3)) {
+ if((i == 1) || (i == 3)) {
- if(!((entry_ptr->header).flush_marker)) {
+ if(!((entry_ptr->header).flush_marker)) {
pass = FALSE;
failure_mssg = "Unexpected insert results 5.";
- }
- } else if((entry_ptr->header).flush_marker) {
+ }
+ } else if((entry_ptr->header).flush_marker) {
pass = FALSE;
failure_mssg = "Unexpected insert results 6.";
- }
- }
+ }
+ }
- if(pass) {
+ if(pass) {
- /* Verify that pinned entries are in the pinned entry list */
- if((entry_ptr->header).is_pinned) {
+ /* Verify that pinned entries are in the pinned entry list */
+ if((entry_ptr->header).is_pinned) {
- search_ptr = cache_ptr->pel_head_ptr;
+ search_ptr = cache_ptr->pel_head_ptr;
- while((search_ptr != NULL) &&
- (search_ptr !=
- (struct H5C_cache_entry_t *)entry_ptr))
- {
- search_ptr = search_ptr->next;
- }
+ while((search_ptr != NULL) &&
+ (search_ptr !=
+ (struct H5C_cache_entry_t *)entry_ptr))
+ {
+ search_ptr = search_ptr->next;
+ }
- if(search_ptr == NULL) {
+ if(search_ptr == NULL) {
pass = FALSE;
failure_mssg = "Unexpected insert results 7.";
- }
- }
- }
+ }
+ }
+ }
- if(pass) {
+ if(pass) {
- /* Verify that unpinned entries are in the LRU list */
- if(!((entry_ptr->header).is_pinned)) {
+ /* Verify that unpinned entries are in the LRU list */
+ if(!((entry_ptr->header).is_pinned)) {
- search_ptr = cache_ptr->LRU_head_ptr;
+ search_ptr = cache_ptr->LRU_head_ptr;
- while((search_ptr != NULL) &&
- (search_ptr !=
- (struct H5C_cache_entry_t *)entry_ptr))
- {
- search_ptr = search_ptr->next;
- }
+ while((search_ptr != NULL) &&
+ (search_ptr !=
+ (struct H5C_cache_entry_t *)entry_ptr))
+ {
+ search_ptr = search_ptr->next;
+ }
- if(search_ptr == NULL) {
+ if(search_ptr == NULL) {
pass = FALSE;
failure_mssg = "Unexpected insert results 8.";
- }
- }
- }
+ }
+ }
+ }
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
- if(pass) {
+ if(pass) {
- /* Verify that unpinned entries are in the dirty LRU list */
- if(!((entry_ptr->header).is_pinned)) {
+ /* Verify that unpinned entries are in the dirty LRU list */
+ if(!((entry_ptr->header).is_pinned)) {
- search_ptr = cache_ptr->dLRU_head_ptr;
+ search_ptr = cache_ptr->dLRU_head_ptr;
- while((search_ptr != NULL) &&
- (search_ptr !=
- (struct H5C_cache_entry_t *)entry_ptr))
- {
- search_ptr = search_ptr->aux_next;
- }
+ while((search_ptr != NULL) &&
+ (search_ptr !=
+ (struct H5C_cache_entry_t *)entry_ptr))
+ {
+ search_ptr = search_ptr->aux_next;
+ }
- if(search_ptr == NULL) {
+ if(search_ptr == NULL) {
pass = FALSE;
failure_mssg = "Unexpected insert results 9.";
- }
- }
- }
+ }
+ }
+ }
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
- i++;
+ i++;
} /* while */
@@ -3107,27 +3154,27 @@ check_insert_entry(unsigned paged)
if(pass) {
- if((cache_ptr->index_len != 4) ||
- (cache_ptr->index_size != 4 * entry_sizes[entry_type]) ||
- (cache_ptr->slist_len != 4) ||
- (cache_ptr->slist_size != 4 * entry_sizes[entry_type]) ||
- (cache_ptr->pl_len != 0) ||
- (cache_ptr->pl_size != (size_t)0) ||
- (cache_ptr->pel_len != 2) ||
- (cache_ptr->pel_size != 2 * entry_sizes[entry_type]) ||
- (cache_ptr->LRU_list_len != 2) ||
- (cache_ptr->LRU_list_size != 2 * entry_sizes[entry_type])
+ if((cache_ptr->index_len != 4) ||
+ (cache_ptr->index_size != 4 * entry_sizes[entry_type]) ||
+ (cache_ptr->slist_len != 4) ||
+ (cache_ptr->slist_size != 4 * entry_sizes[entry_type]) ||
+ (cache_ptr->pl_len != 0) ||
+ (cache_ptr->pl_size != (size_t)0) ||
+ (cache_ptr->pel_len != 2) ||
+ (cache_ptr->pel_size != 2 * entry_sizes[entry_type]) ||
+ (cache_ptr->LRU_list_len != 2) ||
+ (cache_ptr->LRU_list_size != 2 * entry_sizes[entry_type])
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
- || (cache_ptr->dLRU_list_len != 2) ||
- (cache_ptr->dLRU_list_size != 2 * entry_sizes[entry_type]) ||
- (cache_ptr->cLRU_list_len != 0) ||
- (cache_ptr->cLRU_list_size != (size_t)0)
+ || (cache_ptr->dLRU_list_len != 2) ||
+ (cache_ptr->dLRU_list_size != 2 * entry_sizes[entry_type]) ||
+ (cache_ptr->cLRU_list_len != 0) ||
+ (cache_ptr->cLRU_list_size != (size_t)0)
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
) {
pass = FALSE;
failure_mssg = "Unexpected insert results 10.";
- }
+ }
}
/* Finally, if stats collection is enabled, verify that the expected
@@ -3136,23 +3183,23 @@ check_insert_entry(unsigned paged)
#if H5C_COLLECT_CACHE_STATS
if(pass) {
- if((cache_ptr->insertions[entry_type] != 4) ||
- (cache_ptr->pinned_insertions[entry_type] != 2) ||
- (cache_ptr->pins[entry_type] != 2) ||
- (cache_ptr->unpins[entry_type] != 0) ||
+ if((cache_ptr->insertions[entry_type] != 4) ||
+ (cache_ptr->pinned_insertions[entry_type] != 2) ||
+ (cache_ptr->pins[entry_type] != 2) ||
+ (cache_ptr->unpins[entry_type] != 0) ||
(cache_ptr->dirty_pins[entry_type] != 0) ||
- (cache_ptr->max_index_len != 4) ||
- (cache_ptr->max_index_size != 4 * entry_sizes[entry_type]) ||
- (cache_ptr->max_slist_len != 4) ||
- (cache_ptr->max_slist_size != 4 * entry_sizes[entry_type]) ||
- (cache_ptr->max_pl_len != 0) ||
- (cache_ptr->max_pl_size != (size_t)0) ||
- (cache_ptr->max_pel_len != 2) ||
- (cache_ptr->max_pel_size != 2 * entry_sizes[entry_type])) {
+ (cache_ptr->max_index_len != 4) ||
+ (cache_ptr->max_index_size != 4 * entry_sizes[entry_type]) ||
+ (cache_ptr->max_slist_len != 4) ||
+ (cache_ptr->max_slist_size != 4 * entry_sizes[entry_type]) ||
+ (cache_ptr->max_pl_len != 0) ||
+ (cache_ptr->max_pl_size != (size_t)0) ||
+ (cache_ptr->max_pel_len != 2) ||
+ (cache_ptr->max_pel_size != 2 * entry_sizes[entry_type])) {
pass = FALSE;
failure_mssg = "Unexpected insert results 11.";
- }
+ }
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -3161,7 +3208,7 @@ check_insert_entry(unsigned paged)
if(pass) {
unpin_entry(entry_type, 2);
- unpin_entry(entry_type, 3);
+ unpin_entry(entry_type, 3);
}
if(pass) {
@@ -3181,16 +3228,16 @@ check_insert_entry(unsigned paged)
} /* check_insert_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_cache()
+ * Function: check_flush_cache()
*
- * Purpose: Verify that flush_cache behaves as expected. In particular,
- * test the behaviour with different flags.
+ * Purpose: Verify that flush_cache behaves as expected. In particular,
+ * test the behaviour with different flags.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 1/10/05
*
* Modifications:
@@ -3247,7 +3294,7 @@ check_flush_cache(unsigned paged)
if(pass) {
- check_flush_cache__flush_ops(file_ptr);
+ check_flush_cache__flush_ops(file_ptr);
}
if(pass) {
@@ -3267,16 +3314,16 @@ check_flush_cache(unsigned paged)
} /* check_flush_cache() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_cache__empty_cache()
+ * Function: check_flush_cache__empty_cache()
*
- * Purpose: Verify that flush_cache behaves as expected with an empty
+ * Purpose: Verify that flush_cache behaves as expected with an empty
* cache.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 1/12/05
*
* Modifications:
@@ -3288,7 +3335,7 @@ static void
check_flush_cache__empty_cache(H5F_t * file_ptr)
{
H5C_t * cache_ptr = file_ptr->shared->cache;
- herr_t result;
+ herr_t result;
if(cache_ptr == NULL) {
@@ -3354,22 +3401,22 @@ check_flush_cache__empty_cache(H5F_t * file_ptr)
} /* check_flush_cache__empty_cache() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_cache__multi_entry()
+ * Function: check_flush_cache__multi_entry()
*
- * Purpose: Verify that flush_cache behaves as expected when the cache
- * contains multiple elements.
+ * Purpose: Verify that flush_cache behaves as expected when the cache
+ * contains multiple elements.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 1/14/05
*
* Modifications:
*
- * JRM -- 4/5/06
- * Added pinned entry tests.
+ * JRM -- 4/5/06
+ * Added pinned entry tests.
*
*-------------------------------------------------------------------------
*/
@@ -4264,9 +4311,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 100,
/* insert_flag = */ FALSE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 0,
- /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ FALSE
@@ -4277,10 +4324,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 75,
/* insert_flag = */ FALSE,
/* flags = */ H5C__DIRTIED_FLAG,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ FALSE
@@ -4291,11 +4338,11 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 25,
/* insert_flag = */ TRUE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 2,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 2,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ FALSE
@@ -4306,12 +4353,12 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 50,
/* insert_flag = */ TRUE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 3,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- PICO_ENTRY_TYPE,
- PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1},
+ /* num_pins = */ 3,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ FALSE
@@ -4322,13 +4369,13 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 10,
/* insert_flag = */ FALSE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 4,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ /* num_pins = */ 4,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
PICO_ENTRY_TYPE,
PICO_ENTRY_TYPE,
- PICO_ENTRY_TYPE,
- -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1},
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ FALSE
@@ -4339,14 +4386,14 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 20,
/* insert_flag = */ FALSE,
/* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 5,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ /* num_pins = */ 5,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
PICO_ENTRY_TYPE,
PICO_ENTRY_TYPE,
- PICO_ENTRY_TYPE,
- MONSTER_ENTRY_TYPE,
- -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, -1, -1, -1},
+ PICO_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ FALSE
@@ -4357,15 +4404,15 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 30,
/* insert_flag = */ TRUE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 6,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ /* num_pins = */ 6,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
PICO_ENTRY_TYPE,
PICO_ENTRY_TYPE,
- PICO_ENTRY_TYPE,
- MONSTER_ENTRY_TYPE,
- MONSTER_ENTRY_TYPE,
- -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, -1, -1},
+ PICO_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ FALSE
@@ -4376,16 +4423,16 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 40,
/* insert_flag = */ TRUE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 7,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ /* num_pins = */ 7,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
PICO_ENTRY_TYPE,
PICO_ENTRY_TYPE,
- PICO_ENTRY_TYPE,
- MONSTER_ENTRY_TYPE,
- MONSTER_ENTRY_TYPE,
- MONSTER_ENTRY_TYPE,
- -1},
- /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, 30, -1},
+ PICO_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, 30, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ FALSE
@@ -4410,9 +4457,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 100,
/* insert_flag = */ FALSE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 0,
- /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4423,10 +4470,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 75,
/* insert_flag = */ FALSE,
/* flags = */ H5C__DIRTIED_FLAG,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ TRUE
@@ -4437,11 +4484,11 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 25,
/* insert_flag = */ TRUE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 2,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 2,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ TRUE
@@ -4452,12 +4499,12 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 50,
/* insert_flag = */ TRUE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 3,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- PICO_ENTRY_TYPE,
- PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1},
+ /* num_pins = */ 3,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ TRUE
@@ -4468,9 +4515,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 10,
/* insert_flag = */ FALSE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 0,
- /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4481,10 +4528,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 20,
/* insert_flag = */ FALSE,
/* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE,
- -1, -1, -1, -1 -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {10, -1, -1, -1 -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE,
+ -1, -1, -1, -1 -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {10, -1, -1, -1 -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ TRUE
@@ -4495,11 +4542,11 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 30,
/* insert_flag = */ TRUE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 2,
- /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE,
- MONSTER_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {10, 20, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 2,
+ /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {10, 20, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ TRUE
@@ -4510,12 +4557,12 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 40,
/* insert_flag = */ TRUE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 3,
- /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE,
- MONSTER_ENTRY_TYPE,
- MONSTER_ENTRY_TYPE,
- -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {10, 20, 30, -1, -1, -1, -1, -1},
+ /* num_pins = */ 3,
+ /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {10, 20, 30, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ TRUE
@@ -4540,9 +4587,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 100,
/* insert_flag = */ FALSE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 0,
- /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4553,10 +4600,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 75,
/* insert_flag = */ FALSE,
/* flags = */ H5C__DIRTIED_FLAG,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4567,10 +4614,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 25,
/* insert_flag = */ TRUE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4581,10 +4628,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 50,
/* insert_flag = */ TRUE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4595,9 +4642,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 10,
/* insert_flag = */ FALSE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 0,
- /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4608,9 +4655,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 20,
/* insert_flag = */ FALSE,
/* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 0,
- /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4621,9 +4668,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 30,
/* insert_flag = */ TRUE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 0,
- /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4634,9 +4681,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 40,
/* insert_flag = */ TRUE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 0,
- /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4662,9 +4709,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 100,
/* insert_flag = */ FALSE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 0,
- /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4675,10 +4722,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 75,
/* insert_flag = */ FALSE,
/* flags = */ H5C__DIRTIED_FLAG,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ TRUE
@@ -4689,10 +4736,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 25,
/* insert_flag = */ TRUE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ TRUE
@@ -4703,10 +4750,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 50,
/* insert_flag = */ TRUE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ TRUE
@@ -4717,9 +4764,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 10,
/* insert_flag = */ FALSE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 0,
- /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4730,13 +4777,13 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 20,
/* insert_flag = */ FALSE,
/* flags = */ H5C__DIRTIED_FLAG,
- /* num_pins = */ 4,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ /* num_pins = */ 4,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
PICO_ENTRY_TYPE,
PICO_ENTRY_TYPE,
- PICO_ENTRY_TYPE,
- -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1},
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ TRUE
@@ -4747,13 +4794,13 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 30,
/* insert_flag = */ TRUE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 4,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ /* num_pins = */ 4,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
PICO_ENTRY_TYPE,
PICO_ENTRY_TYPE,
- PICO_ENTRY_TYPE,
- -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1},
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ TRUE
@@ -4764,9 +4811,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 40,
/* insert_flag = */ TRUE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 0,
- /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ TRUE,
/* expected_destroyed = */ TRUE
@@ -4793,9 +4840,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 100,
/* insert_flag = */ FALSE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 0,
- /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4806,10 +4853,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 75,
/* insert_flag = */ FALSE,
/* flags = */ H5C__DIRTIED_FLAG,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4820,10 +4867,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 25,
/* insert_flag = */ TRUE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4834,10 +4881,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 50,
/* insert_flag = */ TRUE,
/* flags = */ H5C__NO_FLAGS_SET,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4848,10 +4895,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 10,
/* insert_flag = */ FALSE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4862,10 +4909,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 20,
/* insert_flag = */ FALSE,
/* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ TRUE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4876,10 +4923,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 30,
/* insert_flag = */ TRUE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4890,10 +4937,10 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
/* entry_index = */ 40,
/* insert_flag = */ TRUE,
/* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
- /* num_pins = */ 1,
- /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
- -1, -1, -1, -1, -1, -1, -1},
- /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
/* expected_deserialized = */ FALSE,
/* expected_serialized = */ FALSE,
/* expected_destroyed = */ TRUE
@@ -4908,15 +4955,15 @@ check_flush_cache__multi_entry(H5F_t * file_ptr)
} /* check_flush_cache__multi_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_cache__multi_entry_test()
+ * Function: check_flush_cache__multi_entry_test()
*
- * Purpose: Run a multi entry flush cache test.
+ * Purpose: Run a multi entry flush cache test.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 1/13/05
*
* Modifications:
@@ -4933,9 +4980,9 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr,
{
H5C_t * cache_ptr = file_ptr->shared->cache;
static char msg[128];
- herr_t result;
+ herr_t result;
unsigned u;
- size_t total_entry_size = 0;
+ size_t total_entry_size = 0;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -4943,7 +4990,7 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr,
/* This gets used a lot, so lets leave it in. */
HDfprintf(stdout, "check_flush_cache__multi_entry_test: test %d\n",
- test_num);
+ test_num);
#endif /* JRM */
if(cache_ptr == NULL) {
@@ -5127,15 +5174,15 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr,
} /* check_flush_cache__multi_entry_test() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_cache__pe_multi_entry_test()
+ * Function: check_flush_cache__pe_multi_entry_test()
*
- * Purpose: Run a multi entry flush cache test.
+ * Purpose: Run a multi entry flush cache test.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/5/06
*
* Modifications:
@@ -5152,10 +5199,10 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr,
{
H5C_t *cache_ptr = file_ptr->shared->cache;
static char msg[128];
- herr_t result;
+ herr_t result;
unsigned u;
int j;
- size_t total_entry_size = 0;
+ size_t total_entry_size = 0;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -5163,7 +5210,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr,
/* This is useful debugging code. Leave it in for now. */
HDfprintf(stdout, "check_flush_cache__pe_multi_entry_test: test %d\n",
- test_num);
+ test_num);
#endif /* JRM */
if(cache_ptr == NULL) {
@@ -5201,8 +5248,8 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr,
(spec[u].entry_type >= NUMBER_OF_ENTRY_TYPES) ||
(spec[u].entry_index < 0) ||
(spec[u].entry_index > max_indices[spec[u].entry_type]) ||
- (spec[u].num_pins < 0) ||
- (spec[u].num_pins > MAX_PINS)) {
+ (spec[u].num_pins < 0) ||
+ (spec[u].num_pins > MAX_PINS)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
@@ -5231,14 +5278,14 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr,
total_entry_size += entry_sizes[spec[u].entry_type];
- for (j = 0; j < spec[u].num_pins; j++)
- {
+ for (j = 0; j < spec[u].num_pins; j++)
+ {
create_pinned_entry_dependency(file_ptr,
- spec[u].entry_type,
- spec[u].entry_index,
- spec[u].pin_type[j],
- spec[u].pin_idx[j]);
- }
+ spec[u].entry_type,
+ spec[u].entry_index,
+ spec[u].pin_type[j],
+ spec[u].pin_idx[j]);
+ }
u++;
}
@@ -5358,21 +5405,21 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr,
} /* check_flush_cache__pe_multi_entry_test() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_cache__flush_ops()
+ * Function: check_flush_cache__flush_ops()
*
- * Purpose: Run the flush ops cache tests.
+ * Purpose: Run the flush ops cache tests.
*
- * These are tests that test the cache's ability to handle
- * the case in which the flush callback dirties, resizes,
- * and/or moves entries.
+ * These are tests that test the cache's ability to handle
+ * the case in which the flush callback dirties, resizes,
+ * and/or moves entries.
*
- * Do nothing if pass is FALSE on entry.
+ * Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 9/3/06
*
* Modifications:
@@ -5399,468 +5446,468 @@ check_flush_cache__flush_ops(H5F_t * file_ptr)
if(pass) /* test #1 */
{
- /* start with a very simple test, in which there are two entries
- * resident in cache, and the second entry dirties the first in
- * the flush callback. No size changes, and no flush flags.
- */
- int test_num = 1;
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 2;
- unsigned init_expected_index_len = 2;
- size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE;
- unsigned expected_index_len = 2;
- size_t expected_index_size = 2 * PICO_ENTRY_SIZE;
- struct fo_flush_cache_test_spec spec[2] =
- {
+ /* start with a very simple test, in which there are two entries
+ * resident in cache, and the second entry dirties the first in
+ * the flush callback. No size changes, and no flush flags.
+ */
+ int test_num = 1;
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 2;
+ unsigned init_expected_index_len = 2;
+ size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE;
+ unsigned expected_index_len = 2;
+ size_t expected_index_size = 2 * PICO_ENTRY_SIZE;
+ struct fo_flush_cache_test_spec spec[2] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ 0,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
+ /* entry_index = */ 0,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
{
/* entry_num = */ 1,
/* entry_type = */ 0,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 1,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 0;
+ struct fo_flush_entry_check checks[1] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ 0,
+ /* entry_index = */ 0,
+ /* expected_size = */ (size_t)0,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
}
if(pass) /* test #2 */
{
- /* Same as test 1, only this time set the flush invalidate flag.
- * Note that we must repeat all tests with the flush invalidate flag
- * as this triggers a different set of code to execute the flush.
- *
- * Create two entries resident in cache, and have the second entry
- * dirty the first in the flush callback.
- */
- int test_num = 2;
- unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
- int spec_size = 2;
- unsigned init_expected_index_len = 2;
- size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE;
- unsigned expected_index_len = 0;
- size_t expected_index_size = 0;
- struct fo_flush_cache_test_spec spec[2] =
- {
+ /* Same as test 1, only this time set the flush invalidate flag.
+ * Note that we must repeat all tests with the flush invalidate flag
+ * as this triggers a different set of code to execute the flush.
+ *
+ * Create two entries resident in cache, and have the second entry
+ * dirty the first in the flush callback.
+ */
+ int test_num = 2;
+ unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
+ int spec_size = 2;
+ unsigned init_expected_index_len = 2;
+ size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE;
+ unsigned expected_index_len = 0;
+ size_t expected_index_size = 0;
+ struct fo_flush_cache_test_spec spec[2] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
+ /* entry_index = */ 0,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
{
/* entry_num = */ 1,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr*/
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 1,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr*/
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
}
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 0;
+ struct fo_flush_entry_check checks[1] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ 0,
+ /* entry_index = */ 0,
+ /* expected_size = */ (size_t)0,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
}
if(pass) /* test #3 */
{
- /* Single entry test verifying that the cache can handle the case in
- * which the call back function resizes the entry for which it has
- * been called.
- */
- int test_num = 3;
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 1;
- unsigned init_expected_index_len = 1;
- size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4;
- unsigned expected_index_len = 1;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2;
- struct fo_flush_cache_test_spec spec[1] =
- {
+ /* Single entry test verifying that the cache can handle the case in
+ * which the call back function resizes the entry for which it has
+ * been called.
+ */
+ int test_num = 3;
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 1;
+ unsigned init_expected_index_len = 1;
+ size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4;
+ unsigned expected_index_len = 1;
+ size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2;
+ struct fo_flush_cache_test_spec spec[1] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ TRUE,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr:*/
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 0,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ TRUE,
+ /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 1,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr:*/
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 0;
+ struct fo_flush_entry_check checks[1] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ 0,
+ /* entry_index = */ 0,
+ /* expected_size = */ (size_t)0,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
}
if(pass) /* test #4 */
{
- /* Repeat test #4 with the flush invalidate flag.
- *
- * Single entry test verifying that the cache can handle the case in
- * which the call back function resizes the entry for which it has
- * been called.
- */
- int test_num = 4;
- unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
- int spec_size = 1;
- unsigned init_expected_index_len = 1;
- size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4;
- unsigned expected_index_len = 0;
- size_t expected_index_size = 0;
- struct fo_flush_cache_test_spec spec[1] =
- {
+ /* Repeat test #4 with the flush invalidate flag.
+ *
+ * Single entry test verifying that the cache can handle the case in
+ * which the call back function resizes the entry for which it has
+ * been called.
+ */
+ int test_num = 4;
+ unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
+ int spec_size = 1;
+ unsigned init_expected_index_len = 1;
+ size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4;
+ unsigned expected_index_len = 0;
+ size_t expected_index_size = 0;
+ struct fo_flush_cache_test_spec spec[1] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ TRUE,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 0,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ TRUE,
+ /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 1,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
}
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 0;
+ struct fo_flush_entry_check checks[1] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ 0,
+ /* entry_index = */ 0,
+ /* expected_size = */ (size_t)0,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
}
if(pass) /* test #5 & #6 */
{
- /* Single entry test verifying that the cache can handle the case in
- * which the call back function first resizes and then moves the
- * entry for which it has been called.
- *
- * Run this entry twice, as the first run moves the entry to its
- * alternate address, and the second moves it back.
+ /* Single entry test verifying that the cache can handle the case in
+ * which the call back function first resizes and then moves the
+ * entry for which it has been called.
+ *
+ * Run this entry twice, as the first run moves the entry to its
+ * alternate address, and the second moves it back.
*
* 10/8/07 -- JRM
* Added a resize operation to this test to satisfy the new
* requiremnt that any resize of an entry on flush will always
* be accompanied by a resize. Note that as a result, this
* test becomes redundant with later tests.
- */
- int test_num = 5; /* and 6 */
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 1;
- unsigned init_expected_index_len = 1;
- size_t init_expected_index_size = VARIABLE_ENTRY_SIZE;
- unsigned expected_index_len = 1;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2;
- struct fo_flush_cache_test_spec spec[1] =
- {
+ */
+ int test_num = 5; /* and 6 */
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 1;
+ unsigned init_expected_index_len = 1;
+ size_t init_expected_index_size = VARIABLE_ENTRY_SIZE;
+ unsigned expected_index_len = 1;
+ size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2;
+ struct fo_flush_cache_test_spec spec[1] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 2,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 0,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 2,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 0;
+ struct fo_flush_entry_check checks[1] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ 0,
+ /* entry_index = */ 0,
+ /* expected_size = */ (size_t)0,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- /* this change forces the move to move the target entry back to its
- * main address. The first test moved it to its alternate address.
- *
- * Note that these two tests are not the same, as in the first test,
- * the moved entry is moved forward in the slist. In the second
- * it is moved backwards.
- *
- * Since there is only one entry in the cache, this doesn't really
- * matter in this case. But we will do similar tests later with
- * other entries in the cache.
- */
- if(pass) {
-
- spec[0].flush_ops[1].flag = TRUE;
- test_num = 6;
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
+
+ /* this change forces the move to move the target entry back to its
+ * main address. The first test moved it to its alternate address.
+ *
+ * Note that these two tests are not the same, as in the first test,
+ * the moved entry is moved forward in the slist. In the second
+ * it is moved backwards.
+ *
+ * Since there is only one entry in the cache, this doesn't really
+ * matter in this case. But we will do similar tests later with
+ * other entries in the cache.
+ */
+ if(pass) {
+
+ spec[0].flush_ops[1].flag = TRUE;
+ test_num = 6;
check_flush_cache__flush_op_test(file_ptr,
test_num,
@@ -5871,118 +5918,118 @@ check_flush_cache__flush_ops(H5F_t * file_ptr)
init_expected_index_size,
expected_index_len,
expected_index_size,
- check_size,
- checks);
- }
+ check_size,
+ checks);
+ }
}
if(pass) /* test #7 & #8 */
{
- /* Run tests 5 & 6 again, using the flush invalidate flag on the
- * second test.
- *
- * Single entry test verifying that the cache can handle the case in
- * which the call back function moves the entry for which it has
- * been called.
- *
- * Run this entry twice, as the first run moves the entry to its
- * alternate address, and the second moves it back.
+ /* Run tests 5 & 6 again, using the flush invalidate flag on the
+ * second test.
+ *
+ * Single entry test verifying that the cache can handle the case in
+ * which the call back function moves the entry for which it has
+ * been called.
+ *
+ * Run this entry twice, as the first run moves the entry to its
+ * alternate address, and the second moves it back.
*
* 10/8/07 -- JRM
* Added a resize operation to this test to satisfy the new
* requiremnt that any resize of an entry on flush will always
* be accompanied by a resize. Note that as a result, this
* test becomes redundant with later tests.
- */
- int test_num = 7; /* and 8 */
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 1;
- unsigned init_expected_index_len = 1;
- size_t init_expected_index_size = VARIABLE_ENTRY_SIZE;
- unsigned expected_index_len = 1;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2;
- struct fo_flush_cache_test_spec spec[1] =
- {
+ */
+ int test_num = 7; /* and 8 */
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 1;
+ unsigned init_expected_index_len = 1;
+ size_t init_expected_index_size = VARIABLE_ENTRY_SIZE;
+ unsigned expected_index_len = 1;
+ size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2;
+ struct fo_flush_cache_test_spec spec[1] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 2,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 0,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 2,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 0;
+ struct fo_flush_entry_check checks[1] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ 0,
+ /* entry_index = */ 0,
+ /* expected_size = */ (size_t)0,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- /* this change forces the move to move the target entry back to its
- * main address. The first test moved it to its alternate address.
- *
- * Note that these two tests are not the same, as in the first test,
- * the moved entry is moved forward in the slist. In the second
- * it is moved backwards.
- *
- * Since there is only one entry in the cache, this doesn't really
- * matter in this case. But we will do similar tests later with
- * other entries in the cache.
- */
-
- if(pass) {
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
+
+ /* this change forces the move to move the target entry back to its
+ * main address. The first test moved it to its alternate address.
+ *
+ * Note that these two tests are not the same, as in the first test,
+ * the moved entry is moved forward in the slist. In the second
+ * it is moved backwards.
+ *
+ * Since there is only one entry in the cache, this doesn't really
+ * matter in this case. But we will do similar tests later with
+ * other entries in the cache.
+ */
+
+ if(pass) {
test_num = 8;
- flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
- expected_index_len = 0;
- expected_index_size = 0;
- spec[0].flush_ops[1].flag = TRUE;
- spec[0].expected_destroyed = TRUE;
+ flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
+ expected_index_len = 0;
+ expected_index_size = 0;
+ spec[0].flush_ops[1].flag = TRUE;
+ spec[0].expected_destroyed = TRUE;
check_flush_cache__flush_op_test(file_ptr,
test_num,
@@ -5993,104 +6040,104 @@ check_flush_cache__flush_ops(H5F_t * file_ptr)
init_expected_index_size,
expected_index_len,
expected_index_size,
- check_size,
- checks);
- }
+ check_size,
+ checks);
+ }
}
if(pass) /* test #9 & #10 */
{
- /* Single entry test verifying that the cache can handle the case in
- * which the call back function both resizes and moves the entry
- * for which it has been called.
- *
- * Again, we run this entry twice, as the first run moves the entry
+ /* Single entry test verifying that the cache can handle the case in
+ * which the call back function both resizes and moves the entry
+ * for which it has been called.
+ *
+ * Again, we run this entry twice, as the first run moves the entry
* to its alternate address, and the second moves it back.
- */
- int test_num = 9; /* and 10 */
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 1;
- unsigned init_expected_index_len = 1;
- size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2;
- unsigned expected_index_len = 1;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4;
- struct fo_flush_cache_test_spec spec[1] =
- {
+ */
+ int test_num = 9; /* and 10 */
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 1;
+ unsigned init_expected_index_len = 1;
+ size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2;
+ unsigned expected_index_len = 1;
+ size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4;
+ struct fo_flush_cache_test_spec spec[1] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ TRUE,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 2,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 0,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ TRUE,
+ /* new_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 2,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 0;
+ struct fo_flush_entry_check checks[1] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ 0,
+ /* entry_index = */ 0,
+ /* expected_size = */ (size_t)0,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- /* this change forces the move to move the target entry back to its
- * main address. The first test moved it to its alternate address.
- *
- * Note that these two tests are not the same, as in the first test,
- * the moved entry is moved forward in the slist. In the second
- * it is moved backwards.
- *
- * Since there is only one entry in the cache, this doesn't really
- * matter in this case. But we will do similar tests later with
- * other entries in the cache.
- */
- if(pass) {
-
- spec[0].flush_ops[1].flag = TRUE;
- test_num = 10;
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
+
+ /* this change forces the move to move the target entry back to its
+ * main address. The first test moved it to its alternate address.
+ *
+ * Note that these two tests are not the same, as in the first test,
+ * the moved entry is moved forward in the slist. In the second
+ * it is moved backwards.
+ *
+ * Since there is only one entry in the cache, this doesn't really
+ * matter in this case. But we will do similar tests later with
+ * other entries in the cache.
+ */
+ if(pass) {
+
+ spec[0].flush_ops[1].flag = TRUE;
+ test_num = 10;
check_flush_cache__flush_op_test(file_ptr,
test_num,
@@ -6101,111 +6148,111 @@ check_flush_cache__flush_ops(H5F_t * file_ptr)
init_expected_index_size,
expected_index_len,
expected_index_size,
- check_size,
- checks);
- }
+ check_size,
+ checks);
+ }
}
if(pass) /* test #11 & #12 */
{
- /* Repeat the previous test with the flush invalidate flag on the
- * second test.
- *
- * Single entry test verifying that the cache can handle the case in
- * which the call back function both resizes and moves the entry
- * for which it has been called.
- *
- * Again, we run this entry twice, as the first run moves the entry to its
- * alternate address, and the second moves it back.
- */
- int test_num = 11; /* and 12 */
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 1;
- unsigned init_expected_index_len = 1;
- size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2;
- unsigned expected_index_len = 1;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4;
- struct fo_flush_cache_test_spec spec[1] =
- {
+ /* Repeat the previous test with the flush invalidate flag on the
+ * second test.
+ *
+ * Single entry test verifying that the cache can handle the case in
+ * which the call back function both resizes and moves the entry
+ * for which it has been called.
+ *
+ * Again, we run this entry twice, as the first run moves the entry to its
+ * alternate address, and the second moves it back.
+ */
+ int test_num = 11; /* and 12 */
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 1;
+ unsigned init_expected_index_len = 1;
+ size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2;
+ unsigned expected_index_len = 1;
+ size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4;
+ struct fo_flush_cache_test_spec spec[1] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ TRUE,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 2,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 0,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ TRUE,
+ /* new_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 2,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 0;
+ struct fo_flush_entry_check checks[1] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ 0,
+ /* entry_index = */ 0,
+ /* expected_size = */ (size_t)0,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- /* this change forces the move to move the target entry back to its
- * main address. The first test moved it to its alternate address.
- *
- * Note that these two tests are not the same, as in the first test,
- * the moved entry is moved forward in the slist. In the second
- * it is moved backwards.
- *
- * Since there is only one entry in the cache, this doesn't really
- * matter in this case. But we will do similar tests later with
- * other entries in the cache.
- */
- if(pass) {
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
+
+ /* this change forces the move to move the target entry back to its
+ * main address. The first test moved it to its alternate address.
+ *
+ * Note that these two tests are not the same, as in the first test,
+ * the moved entry is moved forward in the slist. In the second
+ * it is moved backwards.
+ *
+ * Since there is only one entry in the cache, this doesn't really
+ * matter in this case. But we will do similar tests later with
+ * other entries in the cache.
+ */
+ if(pass) {
test_num = 12;
- flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
- expected_index_len = 0;
- expected_index_size = 0;
- spec[0].flush_ops[1].flag = TRUE;
- spec[0].expected_destroyed = TRUE;
+ flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
+ expected_index_len = 0;
+ expected_index_size = 0;
+ spec[0].flush_ops[1].flag = TRUE;
+ spec[0].expected_destroyed = TRUE;
check_flush_cache__flush_op_test(file_ptr,
@@ -6217,500 +6264,500 @@ check_flush_cache__flush_ops(H5F_t * file_ptr)
init_expected_index_size,
expected_index_len,
expected_index_size,
- check_size,
- checks);
- }
+ check_size,
+ checks);
+ }
}
if(pass) /* test #13 */
{
- /* Test the ability of the cache to handle the case in which
- * the flush function of an entry that is resident in cache
- * dirties two entries that are not in cache. No size
- * changes.
- *
- * At present, I am assured that this case will never occur, but
- * lets make sure we can handle it regardless.
- */
- int test_num = 13;
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 1;
- unsigned init_expected_index_len = 1;
- size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE;
- unsigned expected_index_len = 3;
- size_t expected_index_size = 3 * PICO_ENTRY_SIZE;
- struct fo_flush_cache_test_spec spec[1] =
- {
+ /* Test the ability of the cache to handle the case in which
+ * the flush function of an entry that is resident in cache
+ * dirties two entries that are not in cache. No size
+ * changes.
+ *
+ * At present, I am assured that this case will never occur, but
+ * lets make sure we can handle it regardless.
+ */
+ int test_num = 13;
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 1;
+ unsigned init_expected_index_len = 1;
+ size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE;
+ unsigned expected_index_len = 3;
+ size_t expected_index_size = 3 * PICO_ENTRY_SIZE;
+ struct fo_flush_cache_test_spec spec[1] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ 0,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 2,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, 0, 2, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 2,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, 0, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 2;
- struct fo_flush_entry_check checks[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ PICO_ENTRY_SIZE,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ PICO_ENTRY_SIZE,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 2;
+ struct fo_flush_entry_check checks[2] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 0,
+ /* expected_size = */ PICO_ENTRY_SIZE,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 2,
+ /* expected_size = */ PICO_ENTRY_SIZE,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
}
if(pass) /* test #14 */
{
- /* Repeat previous test with the flush invalidate flag.
- *
- * Test the ability of the cache to handle the case in which
- * the flush function of an entry that is resident in cache
- * dirties two entries that are not in cache. No size
- * changes.
- *
- * At present, I am assured that this case will never occur, but
- * lets make sure we can handle it regardless.
- */
- int test_num = 14;
- unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
- int spec_size = 1;
- unsigned init_expected_index_len = 1;
- size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE;
- unsigned expected_index_len = 0;
- size_t expected_index_size = (size_t)0;
- struct fo_flush_cache_test_spec spec[1] =
- {
+ /* Repeat previous test with the flush invalidate flag.
+ *
+ * Test the ability of the cache to handle the case in which
+ * the flush function of an entry that is resident in cache
+ * dirties two entries that are not in cache. No size
+ * changes.
+ *
+ * At present, I am assured that this case will never occur, but
+ * lets make sure we can handle it regardless.
+ */
+ int test_num = 14;
+ unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
+ int spec_size = 1;
+ unsigned init_expected_index_len = 1;
+ size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE;
+ unsigned expected_index_len = 0;
+ size_t expected_index_size = (size_t)0;
+ struct fo_flush_cache_test_spec spec[1] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ 0,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 2,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, 0, 2, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 2,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, 0, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
}
- };
- int check_size = 2;
- struct fo_flush_entry_check checks[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ PICO_ENTRY_SIZE,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ PICO_ENTRY_SIZE,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
+ };
+ int check_size = 2;
+ struct fo_flush_entry_check checks[2] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 0,
+ /* expected_size = */ PICO_ENTRY_SIZE,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 2,
+ /* expected_size = */ PICO_ENTRY_SIZE,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
}
if(pass) /* test #15 */
{
- /* Test the ability of the cache to handle the case in which
- * the flush function of an entry that is resident in cache
- * resizes and dirties two entries that are not in cache.
- *
- * At present, I am assured that this case will never occur, but
- * lets make sure we can handle it regardless.
- */
- int test_num = 15;
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 1;
- unsigned init_expected_index_len = 1;
- size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE;
- unsigned expected_index_len = 3;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE +
- (VARIABLE_ENTRY_SIZE / 4) +
- (VARIABLE_ENTRY_SIZE / 2);
- struct fo_flush_cache_test_spec spec[1] =
- {
+ /* Test the ability of the cache to handle the case in which
+ * the flush function of an entry that is resident in cache
+ * resizes and dirties two entries that are not in cache.
+ *
+ * At present, I am assured that this case will never occur, but
+ * lets make sure we can handle it regardless.
+ */
+ int test_num = 15;
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 1;
+ unsigned init_expected_index_len = 1;
+ size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE;
+ unsigned expected_index_len = 3;
+ size_t expected_index_size = VARIABLE_ENTRY_SIZE +
+ (VARIABLE_ENTRY_SIZE / 4) +
+ (VARIABLE_ENTRY_SIZE / 2);
+ struct fo_flush_cache_test_spec spec[1] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 4,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 4,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 2;
- struct fo_flush_entry_check checks[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 2;
+ struct fo_flush_entry_check checks[2] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 0,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 2,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
}
if(pass) /* test #16 */
{
- /* Repeat previous test with the flush invalidate flag.
- *
- * Test the ability of the cache to handle the case in which
- * the flush function of an entry that is resident in cache
- * resizes and dirties two entries that are not in cache.
- *
- * At present, I am assured that this case will never occur, but
- * lets make sure we can handle it regardless.
- */
- int test_num = 16;
- unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
- int spec_size = 1;
- unsigned init_expected_index_len = 1;
- size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE;
- unsigned expected_index_len = 0;
- size_t expected_index_size = (size_t)0;
- struct fo_flush_cache_test_spec spec[1] =
- {
+ /* Repeat previous test with the flush invalidate flag.
+ *
+ * Test the ability of the cache to handle the case in which
+ * the flush function of an entry that is resident in cache
+ * resizes and dirties two entries that are not in cache.
+ *
+ * At present, I am assured that this case will never occur, but
+ * lets make sure we can handle it regardless.
+ */
+ int test_num = 16;
+ unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
+ int spec_size = 1;
+ unsigned init_expected_index_len = 1;
+ size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE;
+ unsigned expected_index_len = 0;
+ size_t expected_index_size = (size_t)0;
+ struct fo_flush_cache_test_spec spec[1] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 4,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 4,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
}
- };
- int check_size = 2;
- struct fo_flush_entry_check checks[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
+ };
+ int check_size = 2;
+ struct fo_flush_entry_check checks[2] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 0,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 2,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
}
if(pass) /* test #17 & #18 */
{
- /* Test the ability of the cache to handle the case in which
- * the flush function of an entry that is resident in cache
- * resizes, dirties, and moves two entries that are not in cache.
- *
- * At present, I am assured that this case will never occur, but
- * lets make sure we can handle it regardless.
- */
- int test_num = 17; /* and 18 */
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 1;
- unsigned init_expected_index_len = 1;
- size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE;
- unsigned expected_index_len = 3;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE +
- (VARIABLE_ENTRY_SIZE / 4) +
- (VARIABLE_ENTRY_SIZE / 2);
- struct fo_flush_cache_test_spec spec[1] =
- {
+ /* Test the ability of the cache to handle the case in which
+ * the flush function of an entry that is resident in cache
+ * resizes, dirties, and moves two entries that are not in cache.
+ *
+ * At present, I am assured that this case will never occur, but
+ * lets make sure we can handle it regardless.
+ */
+ int test_num = 17; /* and 18 */
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 1;
+ unsigned init_expected_index_len = 1;
+ size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE;
+ unsigned expected_index_len = 3;
+ size_t expected_index_size = VARIABLE_ENTRY_SIZE +
+ (VARIABLE_ENTRY_SIZE / 4) +
+ (VARIABLE_ENTRY_SIZE / 2);
+ struct fo_flush_cache_test_spec spec[1] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 6,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 2;
- struct fo_flush_entry_check checks[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 2;
+ struct fo_flush_entry_check checks[2] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 0,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 2,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- /* this change forces the moves to move the target entries back to
- * their main address. The first test moved them to their alternate
- * address.
- *
- * Note that these two tests are not the same, as in the first test,
- * the moved entries are moved forward in the slist. In the second
- * they are moved backwards.
- */
- if(pass) {
-
- test_num = 18;
- spec[0].flush_ops[2].flag = TRUE;
- spec[0].flush_ops[5].flag = TRUE;
- checks[0].at_main_addr = TRUE;
- checks[1].at_main_addr = TRUE;
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
+
+ /* this change forces the moves to move the target entries back to
+ * their main address. The first test moved them to their alternate
+ * address.
+ *
+ * Note that these two tests are not the same, as in the first test,
+ * the moved entries are moved forward in the slist. In the second
+ * they are moved backwards.
+ */
+ if(pass) {
+
+ test_num = 18;
+ spec[0].flush_ops[2].flag = TRUE;
+ spec[0].flush_ops[5].flag = TRUE;
+ checks[0].at_main_addr = TRUE;
+ checks[1].at_main_addr = TRUE;
check_flush_cache__flush_op_test(file_ptr,
test_num,
@@ -6721,131 +6768,131 @@ check_flush_cache__flush_ops(H5F_t * file_ptr)
init_expected_index_size,
expected_index_len,
expected_index_size,
- check_size,
- checks);
- }
+ check_size,
+ checks);
+ }
}
if(pass) /* test #19 & #20 */
{
- /* Repeat the above test with the flush invalidate flag on the
- * second test.
- *
- * Test the ability of the cache to handle the case in which
- * the flush function of an entry that is resident in cache
- * resizes, dirties, and moves two entries that are not in cache.
- *
- * At present, I am assured that this case will never occur, but
- * lets make sure we can handle it regardless.
- */
- int test_num = 19; /* and 20 */
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 1;
- unsigned init_expected_index_len = 1;
- size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE;
- unsigned expected_index_len = 3;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE +
- (VARIABLE_ENTRY_SIZE / 4) +
- (VARIABLE_ENTRY_SIZE / 2);
- struct fo_flush_cache_test_spec spec[1] =
- {
+ /* Repeat the above test with the flush invalidate flag on the
+ * second test.
+ *
+ * Test the ability of the cache to handle the case in which
+ * the flush function of an entry that is resident in cache
+ * resizes, dirties, and moves two entries that are not in cache.
+ *
+ * At present, I am assured that this case will never occur, but
+ * lets make sure we can handle it regardless.
+ */
+ int test_num = 19; /* and 20 */
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 1;
+ unsigned init_expected_index_len = 1;
+ size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE;
+ unsigned expected_index_len = 3;
+ size_t expected_index_size = VARIABLE_ENTRY_SIZE +
+ (VARIABLE_ENTRY_SIZE / 4) +
+ (VARIABLE_ENTRY_SIZE / 2);
+ struct fo_flush_cache_test_spec spec[1] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 6,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 2;
- struct fo_flush_entry_check checks[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 2;
+ struct fo_flush_entry_check checks[2] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 0,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 2,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- /* this change forces the moves to move the target entries back to
- * their main address. The first test moved them to their alternate
- * address.
- *
- * Note that these two tests are not the same, as in the first test,
- * the moved entries are moved forward in the slist. In the second
- * they are moved backwards.
- */
- if(pass) {
-
- test_num = 20;
- flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
- expected_index_len = 0;
- expected_index_size = (size_t)0;
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
+
+ /* this change forces the moves to move the target entries back to
+ * their main address. The first test moved them to their alternate
+ * address.
+ *
+ * Note that these two tests are not the same, as in the first test,
+ * the moved entries are moved forward in the slist. In the second
+ * they are moved backwards.
+ */
+ if(pass) {
+
+ test_num = 20;
+ flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
+ expected_index_len = 0;
+ expected_index_size = (size_t)0;
spec[0].expected_destroyed = TRUE;
- spec[0].flush_ops[2].flag = TRUE;
- spec[0].flush_ops[5].flag = TRUE;
- checks[0].at_main_addr = TRUE;
- checks[0].in_cache = FALSE;
- checks[0].expected_destroyed = TRUE;
- checks[1].at_main_addr = TRUE;
- checks[1].in_cache = FALSE;
- checks[1].expected_destroyed = TRUE;
+ spec[0].flush_ops[2].flag = TRUE;
+ spec[0].flush_ops[5].flag = TRUE;
+ checks[0].at_main_addr = TRUE;
+ checks[0].in_cache = FALSE;
+ checks[0].expected_destroyed = TRUE;
+ checks[1].at_main_addr = TRUE;
+ checks[1].in_cache = FALSE;
+ checks[1].expected_destroyed = TRUE;
check_flush_cache__flush_op_test(file_ptr,
test_num,
@@ -6856,757 +6903,757 @@ check_flush_cache__flush_ops(H5F_t * file_ptr)
init_expected_index_size,
expected_index_len,
expected_index_size,
- check_size,
- checks);
- }
+ check_size,
+ checks);
+ }
}
if(pass) /* test #21 */
{
- /* Now mix things up a bit.
- *
- * Load several entries, two of which have flush functions that
- * resize, dirty, and move two entries that are not in the
- * cache. Mark only one of these entries, and then flush the
- * cache with the flush marked entries flag.
- *
- * This is the only test in which we test the
- * H5C__FLUSH_MARKED_ENTRIES_FLAG. The hope is that since
- * we test the two features extensively by themselves, so
- * it should be sufficient to verify that they play together
- * as expected.
- */
- int test_num = 21;
- unsigned int flush_flags = H5C__FLUSH_MARKED_ENTRIES_FLAG;
- int spec_size = 4;
- unsigned init_expected_index_len = 4;
- size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (2 * PICO_ENTRY_SIZE);
- unsigned expected_index_len = 6;
- size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) +
- (VARIABLE_ENTRY_SIZE / 4) +
- (VARIABLE_ENTRY_SIZE / 2) +
- (2 * PICO_ENTRY_SIZE);
- struct fo_flush_cache_test_spec spec[4] =
- {
+ /* Now mix things up a bit.
+ *
+ * Load several entries, two of which have flush functions that
+ * resize, dirty, and move two entries that are not in the
+ * cache. Mark only one of these entries, and then flush the
+ * cache with the flush marked entries flag.
+ *
+ * This is the only test in which we test the
+ * H5C__FLUSH_MARKED_ENTRIES_FLAG. The hope is that since
+ * we test the two features extensively by themselves, so
+ * it should be sufficient to verify that they play together
+ * as expected.
+ */
+ int test_num = 21;
+ unsigned int flush_flags = H5C__FLUSH_MARKED_ENTRIES_FLAG;
+ int spec_size = 4;
+ unsigned init_expected_index_len = 4;
+ size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (2 * PICO_ENTRY_SIZE);
+ unsigned expected_index_len = 6;
+ size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) +
+ (VARIABLE_ENTRY_SIZE / 4) +
+ (VARIABLE_ENTRY_SIZE / 2) +
+ (2 * PICO_ENTRY_SIZE);
+ struct fo_flush_cache_test_spec spec[4] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 6,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
{
/* entry_num = */ 1,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 11,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 11,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 6,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
},
{
/* entry_num = */ 2,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 0,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
{
/* entry_num = */ 3,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 4;
- struct fo_flush_entry_check checks[4] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ TRUE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ TRUE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* expected_size = */ VARIABLE_ENTRY_SIZE,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 12,
- /* expected_size = */ VARIABLE_ENTRY_SIZE,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 4;
+ struct fo_flush_entry_check checks[4] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 0,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ TRUE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 2,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ TRUE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 2,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 10,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 3,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 12,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- reset_entries();
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
+ reset_entries();
}
if(pass) /* test #22 */
{
- /* Mix things up some more.
- *
- * Load lots of entries, some of which have flush functions that
- * resize, dirty, and move two entries that are not in the
- * cache.
- *
- * Also load entries that have flush ops on entries that are in
- * cache.
- */
- int test_num = 22;
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 6;
- unsigned init_expected_index_len = 6;
- size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE);
- unsigned expected_index_len = 10;
- size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) +
- (2 * (VARIABLE_ENTRY_SIZE / 4)) +
- (2 * (VARIABLE_ENTRY_SIZE / 2)) +
- (4 * PICO_ENTRY_SIZE);
- struct fo_flush_cache_test_spec spec[6] =
- {
+ /* Mix things up some more.
+ *
+ * Load lots of entries, some of which have flush functions that
+ * resize, dirty, and move two entries that are not in the
+ * cache.
+ *
+ * Also load entries that have flush ops on entries that are in
+ * cache.
+ */
+ int test_num = 22;
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 6;
+ unsigned init_expected_index_len = 6;
+ size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE);
+ unsigned expected_index_len = 10;
+ size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) +
+ (2 * (VARIABLE_ENTRY_SIZE / 4)) +
+ (2 * (VARIABLE_ENTRY_SIZE / 2)) +
+ (4 * PICO_ENTRY_SIZE);
+ struct fo_flush_cache_test_spec spec[6] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 6,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
{
/* entry_num = */ 1,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 11,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 11,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 6,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
{
/* entry_num = */ 2,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 0,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
{
/* entry_num = */ 3,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
},
{
/* entry_num = */ 4,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 10,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 1,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
{
/* entry_num = */ 5,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 20,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 20,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 1,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 4;
- struct fo_flush_entry_check checks[4] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 12,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 4;
+ struct fo_flush_entry_check checks[4] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 0,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 2,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 2,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 10,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 3,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 12,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- reset_entries();
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
+ reset_entries();
}
if(pass) /* test #23 */
{
- /* Repeat test #23 with the flush invalidate flag set.
- *
- * Mix things up some more.
- *
- * Load lots of entries, some of which have flush functions that
- * resize, dirty, and move two entries that are not in the
- * cache.
- *
- * Also load entries that have flush ops on entries that are in
- * cache.
- */
- int test_num = 23;
- unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
- int spec_size = 6;
- unsigned init_expected_index_len = 6;
- size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE);
- unsigned expected_index_len = 0;
- size_t expected_index_size = 0;
- struct fo_flush_cache_test_spec spec[6] =
- {
+ /* Repeat test #23 with the flush invalidate flag set.
+ *
+ * Mix things up some more.
+ *
+ * Load lots of entries, some of which have flush functions that
+ * resize, dirty, and move two entries that are not in the
+ * cache.
+ *
+ * Also load entries that have flush ops on entries that are in
+ * cache.
+ */
+ int test_num = 23;
+ unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
+ int spec_size = 6;
+ unsigned init_expected_index_len = 6;
+ size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE);
+ unsigned expected_index_len = 0;
+ size_t expected_index_size = 0;
+ struct fo_flush_cache_test_spec spec[6] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 6,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
{
/* entry_num = */ 1,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 11,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 11,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 6,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
{
/* entry_num = */ 2,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 0,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
{
/* entry_num = */ 3,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 1,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ TRUE
},
{
/* entry_num = */ 4,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 10,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 1,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
{
/* entry_num = */ 5,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 20,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 20,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 1,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0,FALSE,0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
}
- };
- int check_size = 4;
- struct fo_flush_entry_check checks[4] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 12,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
+ };
+ int check_size = 4;
+ struct fo_flush_entry_check checks[4] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 0,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 2,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 2,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 10,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 3,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 12,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- reset_entries();
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
+ reset_entries();
}
/* So much for tests involving only flush operations.
@@ -7615,1512 +7662,1512 @@ check_flush_cache__flush_ops(H5F_t * file_ptr)
*/
if(pass) /* test #24 */
{
- /* Pico entries 50 and 150 pin pico entry 100, and also dirty
- * pico entry 100 on flush.
- */
- int test_num = 24;
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 3;
- unsigned init_expected_index_len = 3;
- size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE;
- unsigned expected_index_len = 3;
- size_t expected_index_size = 3 * PICO_ENTRY_SIZE;
- struct fo_flush_cache_test_spec spec[3] =
- {
+ /* Pico entries 50 and 150 pin pico entry 100, and also dirty
+ * pico entry 100 on flush.
+ */
+ int test_num = 24;
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 3;
+ unsigned init_expected_index_len = 3;
+ size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE;
+ unsigned expected_index_len = 3;
+ size_t expected_index_size = 3 * PICO_ENTRY_SIZE;
+ struct fo_flush_cache_test_spec spec[3] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 100,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 1,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 50,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 1,
- /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 50,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 1,
+ /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 1,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 2,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 150,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 1,
- /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL },
- { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 150,
+ /* insert_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 1,
+ /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 1,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL },
+ { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 0;
+ struct fo_flush_entry_check checks[1] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ 0,
+ /* entry_index = */ 0,
+ /* expected_size = */ (size_t)0,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
}
if(pass) /* test #25 */
{
- /* Repeat the previous test with the flush invalidate flag.
- *
- * Pico entries 50 and 150 pin pico entry 100, and also dirty
- * pico entry 100 on flush.
- */
- int test_num = 25;
- unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
- int spec_size = 3;
- unsigned init_expected_index_len = 3;
- size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE;
- unsigned expected_index_len = 0;
- size_t expected_index_size = (size_t)0;
- struct fo_flush_cache_test_spec spec[3] =
- {
+ /* Repeat the previous test with the flush invalidate flag.
+ *
+ * Pico entries 50 and 150 pin pico entry 100, and also dirty
+ * pico entry 100 on flush.
+ */
+ int test_num = 25;
+ unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
+ int spec_size = 3;
+ unsigned init_expected_index_len = 3;
+ size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE;
+ unsigned expected_index_len = 0;
+ size_t expected_index_size = (size_t)0;
+ struct fo_flush_cache_test_spec spec[3] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 100,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 1,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 50,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 1,
- /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 50,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 1,
+ /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 1,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 2,
/* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 150,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 1,
- /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL },
- { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 150,
+ /* insert_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 1,
+ /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 1,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,100,FALSE,0, NULL },
+ { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
}
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 0;
+ struct fo_flush_entry_check checks[1] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ 0,
+ /* entry_index = */ 0,
+ /* expected_size = */ (size_t)0,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
}
if(pass) /* test #26 */
{
- /* This one is complex.
- *
- * In the following overvies table, VET stands for
- * VARIABLE_ENTRY_TYPE.
- *
- * In trying to follow what happens when we flush the
- * set of entries constructed below, recall that each
- * flush operation is executed the first time the
- * entry is flushed, and then not executed again.
- * This may be a weakness in the tests, but that
- * is the way it is for now.
- *
- * After thinking about it for a while, I'm not sure that
- * the interaction between pins and flush operations needs
- * all that much testing, as the two are essentially
- * orthoginal. Thus this is a bit of a smoke check to
- * verify that we get the expected results.
- *
- * (VET, 100) initially not resident in cache
- *
- * (VET, 200) initially clean and resident in cache
- *
- * (VET, 300) initially not resident in cache
- *
- * (VET, 2100) initially clean and resident in cache
- *
- * (VET, 2200) initially not resident in cache
- *
- * (VET, 2300) initially clean and resident in cache
- *
- * (VET, 1000) initially clean, and in cache
- * dirties (VET, 100)
- * resizes (VET, 200)
- * dirty (VET, 300) -- dirty first to bring into cache.
- * moves (VET, 300)
- *
- * (VET, 2000) initially clean, and in cache
- * dirties (VET, 2100)
- * resizes (VET, 2200)
- * moves (VET, 2300)
- *
- * (VET, 350) initially clean, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * resizes (VET, 350)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 450) initially dirty, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * moves (VET, 450)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 650) initially clean, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * resizes (VET, 650)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 750) initially dirty, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * resizes (VET, 750)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 500) initially dirty, and in cache
- * dirties (VET, 350)
- * dirties (VET, 450)
- * dirties (VET, 650)
- * dirties (VET, 750)
- */
- int test_num = 26;
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 10;
- unsigned init_expected_index_len = 10;
- size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE;
- unsigned expected_index_len = 13;
- size_t expected_index_size = 9 * VARIABLE_ENTRY_SIZE;
- struct fo_flush_cache_test_spec spec[10] =
- {
+ /* This one is complex.
+ *
+ * In the following overvies table, VET stands for
+ * VARIABLE_ENTRY_TYPE.
+ *
+ * In trying to follow what happens when we flush the
+ * set of entries constructed below, recall that each
+ * flush operation is executed the first time the
+ * entry is flushed, and then not executed again.
+ * This may be a weakness in the tests, but that
+ * is the way it is for now.
+ *
+ * After thinking about it for a while, I'm not sure that
+ * the interaction between pins and flush operations needs
+ * all that much testing, as the two are essentially
+ * orthoginal. Thus this is a bit of a smoke check to
+ * verify that we get the expected results.
+ *
+ * (VET, 100) initially not resident in cache
+ *
+ * (VET, 200) initially clean and resident in cache
+ *
+ * (VET, 300) initially not resident in cache
+ *
+ * (VET, 2100) initially clean and resident in cache
+ *
+ * (VET, 2200) initially not resident in cache
+ *
+ * (VET, 2300) initially clean and resident in cache
+ *
+ * (VET, 1000) initially clean, and in cache
+ * dirties (VET, 100)
+ * resizes (VET, 200)
+ * dirty (VET, 300) -- dirty first to bring into cache.
+ * moves (VET, 300)
+ *
+ * (VET, 2000) initially clean, and in cache
+ * dirties (VET, 2100)
+ * resizes (VET, 2200)
+ * moves (VET, 2300)
+ *
+ * (VET, 350) initially clean, and in cache
+ * pins (VET, 1000)
+ * dirties (VET, 1000)
+ * resizes (VET, 350)
+ * pins (VET, 2000)
+ * dirties (VET, 2000)
+ *
+ * (VET, 450) initially dirty, and in cache
+ * pins (VET, 1000)
+ * dirties (VET, 1000)
+ * moves (VET, 450)
+ * pins (VET, 2000)
+ * dirties (VET, 2000)
+ *
+ * (VET, 650) initially clean, and in cache
+ * pins (VET, 1000)
+ * dirties (VET, 1000)
+ * resizes (VET, 650)
+ * pins (VET, 2000)
+ * dirties (VET, 2000)
+ *
+ * (VET, 750) initially dirty, and in cache
+ * pins (VET, 1000)
+ * dirties (VET, 1000)
+ * resizes (VET, 750)
+ * pins (VET, 2000)
+ * dirties (VET, 2000)
+ *
+ * (VET, 500) initially dirty, and in cache
+ * dirties (VET, 350)
+ * dirties (VET, 450)
+ * dirties (VET, 650)
+ * dirties (VET, 750)
+ */
+ int test_num = 26;
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 10;
+ unsigned init_expected_index_len = 10;
+ size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE;
+ unsigned expected_index_len = 13;
+ size_t expected_index_size = 9 * VARIABLE_ENTRY_SIZE;
+ struct fo_flush_cache_test_spec spec[10] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 200,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 200,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 1,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2100,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 2100,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 2,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2300,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 2300,
+ /* insert_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 3,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1000,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 4,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 1000,
+ /* insert_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 4,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 4,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2000,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 2000,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 5,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 350,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 350,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 2,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 6,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 450,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 450,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 2,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 7,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 650,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 650,
+ /* insert_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 2,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 8,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 750,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 750,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 2,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 9,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 500,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 4,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 500,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 4,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 3;
- struct fo_flush_entry_check checks[3] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* expected_size = */ VARIABLE_ENTRY_SIZE,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 300,
- /* expected_size = */ VARIABLE_ENTRY_SIZE,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2200,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
-
- };
+ };
+ int check_size = 3;
+ struct fo_flush_entry_check checks[3] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 100,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 300,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 2,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 2200,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* in_cache = */ TRUE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ }
+
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
- reset_entries();
+ reset_entries();
}
if(pass) /* test #27 */
{
- /* Repeat test #26 with the flush invalidate flag.
- *
- * In the following overview table, VET stands for
- * VARIABLE_ENTRY_TYPE.
- *
- * In trying to follow what happens when we flush the
- * set of entries constructed below, recall that each
- * flush operation is executed the first time the
- * entry is flushed, and then not executed again.
- * This may be a weakness in the tests, but that
- * is the way it is for now.
- *
- * After thinking about it for a while, I'm not sure that
- * the interaction between pins and flush operations needs
- * all that much testing, as the two are essentially
- * orthoginal. The big thing is to verify that flushes of
- * pinned entries with flush ops result in the expected
- * updates of the cache.
- *
- * Thus this is a bit of a smoke check to * verify that we
- * get the expected results.
- *
- * (VET, 100) initially not resident in cache
- *
- * (VET, 200) initially clean and resident in cache
- *
- * (VET, 300) initially not resident in cache
- *
- * (VET, 2100) initially clean and resident in cache
- *
- * (VET, 2200) initially not resident in cache
- *
- * (VET, 2300) initially clean and resident in cache
- *
- * (VET, 1000) initially clean, and in cache
- * dirties (VET, 100)
- * resizes (VET, 200)
- * dirty (VET, 300) -- dirty first to bring into cache.
- * moves (VET, 300)
- *
- * (VET, 2000) initially clean, and in cache
- * dirties (VET, 2100)
- * resizes (VET, 2200)
- * moves (VET, 2300)
- *
- * (VET, 350) initially clean, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * resizes (VET, 350)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 450) initially dirty, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * moves (VET, 450)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 650) initially clean, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * resizes (VET, 650)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 750) initially dirty, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * resizes (VET, 750)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 500) initially dirty, and in cache
- * dirties (VET, 350)
- * dirties (VET, 450)
- * dirties (VET, 650)
- * dirties (VET, 750)
- */
- int test_num = 27;
- unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
- int spec_size = 10;
- unsigned init_expected_index_len = 10;
- size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE;
- unsigned expected_index_len = 0;
- size_t expected_index_size = (size_t)0;
- struct fo_flush_cache_test_spec spec[10] =
- {
+ /* Repeat test #26 with the flush invalidate flag.
+ *
+ * In the following overview table, VET stands for
+ * VARIABLE_ENTRY_TYPE.
+ *
+ * In trying to follow what happens when we flush the
+ * set of entries constructed below, recall that each
+ * flush operation is executed the first time the
+ * entry is flushed, and then not executed again.
+ * This may be a weakness in the tests, but that
+ * is the way it is for now.
+ *
+ * After thinking about it for a while, I'm not sure that
+ * the interaction between pins and flush operations needs
+ * all that much testing, as the two are essentially
+ * orthoginal. The big thing is to verify that flushes of
+ * pinned entries with flush ops result in the expected
+ * updates of the cache.
+ *
+ * Thus this is a bit of a smoke check to * verify that we
+ * get the expected results.
+ *
+ * (VET, 100) initially not resident in cache
+ *
+ * (VET, 200) initially clean and resident in cache
+ *
+ * (VET, 300) initially not resident in cache
+ *
+ * (VET, 2100) initially clean and resident in cache
+ *
+ * (VET, 2200) initially not resident in cache
+ *
+ * (VET, 2300) initially clean and resident in cache
+ *
+ * (VET, 1000) initially clean, and in cache
+ * dirties (VET, 100)
+ * resizes (VET, 200)
+ * dirty (VET, 300) -- dirty first to bring into cache.
+ * moves (VET, 300)
+ *
+ * (VET, 2000) initially clean, and in cache
+ * dirties (VET, 2100)
+ * resizes (VET, 2200)
+ * moves (VET, 2300)
+ *
+ * (VET, 350) initially clean, and in cache
+ * pins (VET, 1000)
+ * dirties (VET, 1000)
+ * resizes (VET, 350)
+ * pins (VET, 2000)
+ * dirties (VET, 2000)
+ *
+ * (VET, 450) initially dirty, and in cache
+ * pins (VET, 1000)
+ * dirties (VET, 1000)
+ * moves (VET, 450)
+ * pins (VET, 2000)
+ * dirties (VET, 2000)
+ *
+ * (VET, 650) initially clean, and in cache
+ * pins (VET, 1000)
+ * dirties (VET, 1000)
+ * resizes (VET, 650)
+ * pins (VET, 2000)
+ * dirties (VET, 2000)
+ *
+ * (VET, 750) initially dirty, and in cache
+ * pins (VET, 1000)
+ * dirties (VET, 1000)
+ * resizes (VET, 750)
+ * pins (VET, 2000)
+ * dirties (VET, 2000)
+ *
+ * (VET, 500) initially dirty, and in cache
+ * dirties (VET, 350)
+ * dirties (VET, 450)
+ * dirties (VET, 650)
+ * dirties (VET, 750)
+ */
+ int test_num = 27;
+ unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
+ int spec_size = 10;
+ unsigned init_expected_index_len = 10;
+ size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE;
+ unsigned expected_index_len = 0;
+ size_t expected_index_size = (size_t)0;
+ struct fo_flush_cache_test_spec spec[10] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 200,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 200,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 1,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2100,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 2100,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 2,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2300,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 2300,
+ /* insert_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 3,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1000,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 4,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 1000,
+ /* insert_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 4,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 4,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2000,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 2000,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 5,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 350,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 350,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 2,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 6,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 450,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 450,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 2,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 7,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 650,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 650,
+ /* insert_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 2,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 8,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 750,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 750,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 2,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 9,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 500,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 4,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 500,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 4,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
}
- };
- int check_size = 3;
- struct fo_flush_entry_check checks[3] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* expected_size = */ VARIABLE_ENTRY_SIZE,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 300,
- /* expected_size = */ VARIABLE_ENTRY_SIZE,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2200,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
-
- };
+ };
+ int check_size = 3;
+ struct fo_flush_entry_check checks[3] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 100,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 300,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 2,
+ /* entry_type = */ VARIABLE_ENTRY_TYPE,
+ /* entry_index = */ 2200,
+ /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ TRUE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ }
+
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
- reset_entries();
+ reset_entries();
}
if(pass) /* test #28 */
{
- /* Test the expected fheap case, in which an entry dirties
- * and resizes itself, and dirties an entry which it has
- * pinned.
- */
- int test_num = 28;
- unsigned int flush_flags = H5C__NO_FLAGS_SET;
- int spec_size = 5;
- unsigned init_expected_index_len = 5;
- size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE;
- unsigned expected_index_len = 5;
- size_t expected_index_size = 4 * VARIABLE_ENTRY_SIZE;
- struct fo_flush_cache_test_spec spec[5] =
- {
+ /* Test the expected fheap case, in which an entry dirties
+ * and resizes itself, and dirties an entry which it has
+ * pinned.
+ */
+ int test_num = 28;
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 5;
+ unsigned init_expected_index_len = 5;
+ size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE;
+ unsigned expected_index_len = 5;
+ size_t expected_index_size = 4 * VARIABLE_ENTRY_SIZE;
+ struct fo_flush_cache_test_spec spec[5] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 100,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 1,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 200,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ TRUE,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* num_pins = */ 1,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 200,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ TRUE,
+ /* new_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* num_pins = */ 1,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 2,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 300,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ TRUE,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* num_pins = */ 1,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 300,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ TRUE,
+ /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* num_pins = */ 1,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 3,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 400,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 400,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
},
- {
+ {
/* entry_num = */ 4,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 500,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ TRUE,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* num_pins = */ 1,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ FALSE
+ /* entry_index = */ 500,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ TRUE,
+ /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* num_pins = */ 1,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ FALSE
}
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ 0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 0;
+ struct fo_flush_entry_check checks[1] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ 0,
+ /* entry_index = */ 0,
+ /* expected_size = */ 0,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
- reset_entries();
+ reset_entries();
}
if(pass) /* test #29 */
{
- /* Repeat test #28 with the flush invalidate flag.
- *
- * Test the expected fheap case, in which an entry dirties
- * and resizes itself, and dirties an entry which it has
- * pinned.
- */
- int test_num = 29;
- unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
- int spec_size = 5;
- unsigned init_expected_index_len = 5;
- size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE;
- unsigned expected_index_len = 0;
- size_t expected_index_size = 0;
- struct fo_flush_cache_test_spec spec[5] =
- {
+ /* Repeat test #28 with the flush invalidate flag.
+ *
+ * Test the expected fheap case, in which an entry dirties
+ * and resizes itself, and dirties an entry which it has
+ * pinned.
+ */
+ int test_num = 29;
+ unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
+ int spec_size = 5;
+ unsigned init_expected_index_len = 5;
+ size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE;
+ unsigned expected_index_len = 0;
+ size_t expected_index_size = 0;
+ struct fo_flush_cache_test_spec spec[5] =
+ {
{
/* entry_num = */ 0,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 100,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 1,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 200,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ TRUE,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* num_pins = */ 1,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 200,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ TRUE,
+ /* new_size = */ VARIABLE_ENTRY_SIZE / 2,
+ /* num_pins = */ 1,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 2,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 300,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ TRUE,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* num_pins = */ 1,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 300,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ TRUE,
+ /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* num_pins = */ 1,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 3,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 400,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__NO_FLAGS_SET,
- /* resize_flag = */ FALSE,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 400,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* resize_flag = */ FALSE,
+ /* new_size = */ 0,
+ /* num_pins = */ 0,
+ /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 0,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
},
- {
+ {
/* entry_num = */ 4,
/* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 500,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C__DIRTIED_FLAG,
- /* resize_flag = */ TRUE,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* num_pins = */ 1,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: order_ptr: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
- { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
- /* expected_deserialized = */ TRUE,
- /* expected_serialized = */ TRUE,
- /* expected_destroyed = */ TRUE
+ /* entry_index = */ 500,
+ /* insert_flag = */ FALSE,
+ /* flags = */ H5C__DIRTIED_FLAG,
+ /* resize_flag = */ TRUE,
+ /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
+ /* num_pins = */ 1,
+ /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
+ /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
+ /* num_flush_ops = */ 3,
+ /* flush_ops = */
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
+ /* expected_deserialized = */ TRUE,
+ /* expected_serialized = */ TRUE,
+ /* expected_destroyed = */ TRUE
}
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ 0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_deserialized = */ FALSE,
- /* expected_serialized = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
+ };
+ int check_size = 0;
+ struct fo_flush_entry_check checks[1] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ 0,
+ /* entry_index = */ 0,
+ /* expected_size = */ 0,
+ /* in_cache = */ FALSE,
+ /* at_main_addr = */ FALSE,
+ /* is_dirty = */ FALSE,
+ /* is_protected = */ FALSE,
+ /* is_pinned = */ FALSE,
+ /* expected_deserialized = */ FALSE,
+ /* expected_serialized = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
check_flush_cache__flush_op_test(file_ptr,
test_num,
flush_flags,
spec_size,
spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
+ init_expected_index_len,
+ init_expected_index_size,
+ expected_index_len,
+ expected_index_size,
+ check_size,
+ checks);
- reset_entries();
+ reset_entries();
}
/* finally finish up with the flush ops eviction test */
@@ -9130,16 +9177,16 @@ check_flush_cache__flush_ops(H5F_t * file_ptr)
} /* check_flush_cache__flush_ops() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_cache__flush_op_test()
+ * Function: check_flush_cache__flush_op_test()
*
- * Purpose: Run a flush op flush cache test. Of the nature of
- * flush operations, this is a multi-entry test.
+ * Purpose: Run a flush op flush cache test. Of the nature of
+ * flush operations, this is a multi-entry test.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 9/3/06
*
* Modifications:
@@ -9153,16 +9200,16 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
unsigned int flush_flags,
int spec_size,
const struct fo_flush_cache_test_spec spec[],
- unsigned init_expected_index_len,
- size_t init_expected_index_size,
- unsigned expected_index_len,
- size_t expected_index_size,
- int check_size,
- struct fo_flush_entry_check check[])
+ unsigned init_expected_index_len,
+ size_t init_expected_index_size,
+ unsigned expected_index_len,
+ size_t expected_index_size,
+ int check_size,
+ struct fo_flush_entry_check check[])
{
H5C_t * cache_ptr = file_ptr->shared->cache;
static char msg[128];
- herr_t result;
+ herr_t result;
int i;
int j;
test_entry_t * base_addr;
@@ -9170,7 +9217,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
#if 0 /* This is useful debugging code -- lets keep it around. */
HDfprintf(stdout, "check_flush_cache__flush_op_test: test %d\n",
- test_num);
+ test_num);
#endif
if(cache_ptr == NULL) {
@@ -9208,10 +9255,10 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
(spec[i].entry_type >= NUMBER_OF_ENTRY_TYPES) ||
(spec[i].entry_index < 0) ||
(spec[i].entry_index > max_indices[spec[i].entry_type]) ||
- (spec[i].num_pins < 0) ||
- (spec[i].num_pins > MAX_PINS) ||
- (spec[i].num_flush_ops < 0) ||
- (spec[i].num_flush_ops > MAX_FLUSH_OPS)) {
+ (spec[i].num_pins < 0) ||
+ (spec[i].num_pins > MAX_PINS) ||
+ (spec[i].num_flush_ops < 0) ||
+ (spec[i].num_flush_ops > MAX_FLUSH_OPS)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
@@ -9234,22 +9281,22 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
/* Check for nonsense values if hbool_t is an integral
* type instead of a real Boolean.
*/
- ((check[i].in_cache != TRUE) &&
- (check[i].in_cache != FALSE)) ||
- ((check[i].at_main_addr != TRUE) &&
- (check[i].at_main_addr != FALSE)) ||
- ((check[i].is_dirty != TRUE) &&
- (check[i].is_dirty != FALSE)) ||
- ((check[i].is_protected != TRUE) &&
- (check[i].is_protected != FALSE)) ||
- ((check[i].is_pinned != TRUE) &&
- (check[i].is_pinned != FALSE)) ||
- ((check[i].expected_deserialized != TRUE) &&
- (check[i].expected_deserialized != FALSE)) ||
- ((check[i].expected_serialized != TRUE) &&
- (check[i].expected_serialized != FALSE)) ||
- ((check[i].expected_destroyed != TRUE) &&
- (check[i].expected_destroyed != FALSE)) ||
+ ((check[i].in_cache != TRUE) &&
+ (check[i].in_cache != FALSE)) ||
+ ((check[i].at_main_addr != TRUE) &&
+ (check[i].at_main_addr != FALSE)) ||
+ ((check[i].is_dirty != TRUE) &&
+ (check[i].is_dirty != FALSE)) ||
+ ((check[i].is_protected != TRUE) &&
+ (check[i].is_protected != FALSE)) ||
+ ((check[i].is_pinned != TRUE) &&
+ (check[i].is_pinned != FALSE)) ||
+ ((check[i].expected_deserialized != TRUE) &&
+ (check[i].expected_deserialized != FALSE)) ||
+ ((check[i].expected_serialized != TRUE) &&
+ (check[i].expected_serialized != FALSE)) ||
+ ((check[i].expected_destroyed != TRUE) &&
+ (check[i].expected_destroyed != FALSE)) ||
#endif /* H5_HAVE_STDBOOL_H */
(check[i].expected_size <= (size_t)0)
) {
@@ -9277,32 +9324,32 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
if(spec[i].resize_flag)
resize_entry(file_ptr, spec[i].entry_type, spec[i].entry_index,
- spec[i].new_size, TRUE);
+ spec[i].new_size, TRUE);
unprotect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index,
- spec[i].flags);
+ spec[i].flags);
}
- for (j = 0; j < spec[i].num_pins; j++)
- {
+ for (j = 0; j < spec[i].num_pins; j++)
+ {
create_pinned_entry_dependency(file_ptr,
- spec[i].entry_type,
- spec[i].entry_index,
- spec[i].pin_type[j],
- spec[i].pin_idx[j]);
- }
-
- for (j = 0; j < spec[i].num_flush_ops; j++)
- {
- add_flush_op(spec[i].entry_type,
- spec[i].entry_index,
- spec[i].flush_ops[j].op_code,
- spec[i].flush_ops[j].type,
- spec[i].flush_ops[j].idx,
- spec[i].flush_ops[j].flag,
- spec[i].flush_ops[j].size,
+ spec[i].entry_type,
+ spec[i].entry_index,
+ spec[i].pin_type[j],
+ spec[i].pin_idx[j]);
+ }
+
+ for (j = 0; j < spec[i].num_flush_ops; j++)
+ {
+ add_flush_op(spec[i].entry_type,
+ spec[i].entry_index,
+ spec[i].flush_ops[j].op_code,
+ spec[i].flush_ops[j].type,
+ spec[i].flush_ops[j].idx,
+ spec[i].flush_ops[j].flag,
+ spec[i].flush_ops[j].size,
spec[i].flush_ops[j].order_ptr);
- }
+ }
i++;
}
@@ -9356,8 +9403,8 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
(int)(entry_ptr->destroyed),
(int)(spec[i].expected_destroyed));
- HDfprintf(stdout, "entry_ptr->header.is_dirty = %d\n",
- (int)(entry_ptr->header.is_dirty));
+ HDfprintf(stdout, "entry_ptr->header.is_dirty = %d\n",
+ (int)(entry_ptr->header.is_dirty));
#endif
pass = FALSE;
@@ -9374,113 +9421,113 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
i = 0;
while(pass && (i < check_size))
{
- if(check[i].in_cache != entry_in_cache(cache_ptr,
- check[i].entry_type,
- check[i].entry_index)) {
+ if(check[i].in_cache != entry_in_cache(cache_ptr,
+ check[i].entry_type,
+ check[i].entry_index)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"Check1 failed on entry %d after flush op test #%d.",
i, test_num);
failure_mssg = msg;
- }
+ }
base_addr = entries[check[i].entry_type];
entry_ptr = &(base_addr[check[i].entry_index]);
- if((entry_ptr->size != check[i].expected_size) ||
- ((!entry_ptr->header.destroy_in_progress) &&
- (check[i].in_cache) &&
- (entry_ptr->header.size != check[i].expected_size)) ||
- (entry_ptr->at_main_addr != check[i].at_main_addr) ||
- (entry_ptr->is_dirty != check[i].is_dirty) ||
- (entry_ptr->header.is_dirty != check[i].is_dirty) ||
- (entry_ptr->is_protected != check[i].is_protected) ||
- (entry_ptr->header.is_protected != check[i].is_protected) ||
+ if((entry_ptr->size != check[i].expected_size) ||
+ ((!entry_ptr->header.destroy_in_progress) &&
+ (check[i].in_cache) &&
+ (entry_ptr->header.size != check[i].expected_size)) ||
+ (entry_ptr->at_main_addr != check[i].at_main_addr) ||
+ (entry_ptr->is_dirty != check[i].is_dirty) ||
+ (entry_ptr->header.is_dirty != check[i].is_dirty) ||
+ (entry_ptr->is_protected != check[i].is_protected) ||
+ (entry_ptr->header.is_protected != check[i].is_protected) ||
(entry_ptr->is_pinned != check[i].is_pinned) ||
(entry_ptr->header.is_pinned != check[i].is_pinned) ||
- (entry_ptr->deserialized != check[i].expected_deserialized) ||
- (entry_ptr->serialized != check[i].expected_serialized) ||
- (entry_ptr->destroyed != check[i].expected_destroyed)) {
+ (entry_ptr->deserialized != check[i].expected_deserialized) ||
+ (entry_ptr->serialized != check[i].expected_serialized) ||
+ (entry_ptr->destroyed != check[i].expected_destroyed)) {
#if 0 /* This is useful debugging code. Lets keep it around for a while. */
- if(entry_ptr->size != check[i].expected_size) {
- HDfprintf(stdout, "entry_ptr->size (expected) = %d (%d).\n",
- (int)(entry_ptr->size),
- (int)(check[i].expected_size));
- }
- if((!entry_ptr->header.destroy_in_progress) &&
- (check[i].in_cache) &&
+ if(entry_ptr->size != check[i].expected_size) {
+ HDfprintf(stdout, "entry_ptr->size (expected) = %d (%d).\n",
+ (int)(entry_ptr->size),
+ (int)(check[i].expected_size));
+ }
+ if((!entry_ptr->header.destroy_in_progress) &&
+ (check[i].in_cache) &&
(entry_ptr->header.size != check[i].expected_size)) {
HDfprintf(stdout,
"(!destroy in progress and in cache and size (expected) = %d (%d).\n",
(int)(entry_ptr->header.size),
- (int)(check[i].expected_size));
- }
- if(entry_ptr->at_main_addr != check[i].at_main_addr) {
- HDfprintf(stdout, "(%d,%d) at main addr (expected) = %d (%d).\n",
- (int)(check[i].entry_type),
- (int)(check[i].entry_index),
+ (int)(check[i].expected_size));
+ }
+ if(entry_ptr->at_main_addr != check[i].at_main_addr) {
+ HDfprintf(stdout, "(%d,%d) at main addr (expected) = %d (%d).\n",
+ (int)(check[i].entry_type),
+ (int)(check[i].entry_index),
(int)(entry_ptr->at_main_addr),
- (int)(check[i].at_main_addr));
+ (int)(check[i].at_main_addr));
}
- if(entry_ptr->is_dirty != check[i].is_dirty) {
- HDfprintf(stdout, "entry_ptr->is_dirty (expected) = %d (%d).\n",
- (int)(entry_ptr->is_dirty),
- (int)(check[i].is_dirty));
- }
- if(entry_ptr->header.is_dirty != check[i].is_dirty) {
- HDfprintf(stdout, "entry_ptr->header.is_dirty (expected) = %d (%d).\n",
- (int)(entry_ptr->header.is_dirty),
- (int)(check[i].is_dirty));
- }
- if(entry_ptr->is_protected != check[i].is_protected) {
+ if(entry_ptr->is_dirty != check[i].is_dirty) {
+ HDfprintf(stdout, "entry_ptr->is_dirty (expected) = %d (%d).\n",
+ (int)(entry_ptr->is_dirty),
+ (int)(check[i].is_dirty));
+ }
+ if(entry_ptr->header.is_dirty != check[i].is_dirty) {
+ HDfprintf(stdout, "entry_ptr->header.is_dirty (expected) = %d (%d).\n",
+ (int)(entry_ptr->header.is_dirty),
+ (int)(check[i].is_dirty));
+ }
+ if(entry_ptr->is_protected != check[i].is_protected) {
HDfprintf(stdout, "entry_ptr->is_protected (expected) = %d (%d).\n",
- (int)(entry_ptr->is_protected),
- (int)(check[i].is_protected));
- }
- if(entry_ptr->header.is_protected != check[i].is_protected) {
+ (int)(entry_ptr->is_protected),
+ (int)(check[i].is_protected));
+ }
+ if(entry_ptr->header.is_protected != check[i].is_protected) {
HDfprintf(stdout, "entry_ptr->header.is_protected (expected) = %d (%d).\n",
- (int)(entry_ptr->is_protected),
- (int)(check[i].is_protected));
- }
- if(entry_ptr->is_pinned != check[i].is_pinned) {
- HDfprintf(stdout, "entry_ptr->is_pinned (expected) = %d (%d).\n",
- (int)(entry_ptr->is_pinned),
- (int)(check[i].is_pinned));
- }
- if(entry_ptr->header.is_pinned != check[i].is_pinned) {
- HDfprintf(stdout, "entry_ptr->header.is_pinned (expected) = %d (%d).\n",
- (int)(entry_ptr->header.is_pinned),
- (int)(check[i].is_pinned));
- }
- if(entry_ptr->deserialized !=
- check[i].expected_deserialized) {
- HDfprintf(stdout,
- "entry_ptr->deserialized (expected) = %d (%d).\n",
- (int)(entry_ptr->deserialized),
- (int)(check[i].expected_deserialized));
- }
- if(entry_ptr->serialized != check[i].expected_serialized) {
- HDfprintf(stdout,
- "entry_ptr->serialized (expected) = %d (%d).\n",
- (int)(entry_ptr->serialized),
- (int)(check[i].expected_serialized));
- }
- if(entry_ptr->destroyed != check[i].expected_destroyed) {
- HDfprintf(stdout, "entry_ptr->destroyed (expected) = %d (%d).\n",
- (int)(entry_ptr->destroyed),
- (int)(check[i].expected_destroyed));
- }
+ (int)(entry_ptr->is_protected),
+ (int)(check[i].is_protected));
+ }
+ if(entry_ptr->is_pinned != check[i].is_pinned) {
+ HDfprintf(stdout, "entry_ptr->is_pinned (expected) = %d (%d).\n",
+ (int)(entry_ptr->is_pinned),
+ (int)(check[i].is_pinned));
+ }
+ if(entry_ptr->header.is_pinned != check[i].is_pinned) {
+ HDfprintf(stdout, "entry_ptr->header.is_pinned (expected) = %d (%d).\n",
+ (int)(entry_ptr->header.is_pinned),
+ (int)(check[i].is_pinned));
+ }
+ if(entry_ptr->deserialized !=
+ check[i].expected_deserialized) {
+ HDfprintf(stdout,
+ "entry_ptr->deserialized (expected) = %d (%d).\n",
+ (int)(entry_ptr->deserialized),
+ (int)(check[i].expected_deserialized));
+ }
+ if(entry_ptr->serialized != check[i].expected_serialized) {
+ HDfprintf(stdout,
+ "entry_ptr->serialized (expected) = %d (%d).\n",
+ (int)(entry_ptr->serialized),
+ (int)(check[i].expected_serialized));
+ }
+ if(entry_ptr->destroyed != check[i].expected_destroyed) {
+ HDfprintf(stdout, "entry_ptr->destroyed (expected) = %d (%d).\n",
+ (int)(entry_ptr->destroyed),
+ (int)(check[i].expected_destroyed));
+ }
#endif
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"Check2 failed on entry %d after flush op test #%d.",
i, test_num);
failure_mssg = msg;
- }
- i++;
+ }
+ i++;
}
}
@@ -9526,8 +9573,8 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
}
else if((cache_ptr->index_len != 0) ||
(cache_ptr->index_size != 0) ||
- (cache_ptr->clean_index_size != 0) ||
- (cache_ptr->dirty_index_size != 0)) {
+ (cache_ptr->clean_index_size != 0) ||
+ (cache_ptr->dirty_index_size != 0)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
@@ -9544,7 +9591,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
base_addr = entries[spec[i].entry_type];
entry_ptr = &(base_addr[spec[i].entry_index]);
- entry_ptr->size = entry_sizes[spec[i].entry_type];
+ entry_ptr->size = entry_sizes[spec[i].entry_type];
entry_ptr->deserialized = FALSE;
entry_ptr->serialized = FALSE;
@@ -9559,7 +9606,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
base_addr = entries[check[i].entry_type];
entry_ptr = &(base_addr[check[i].entry_index]);
- entry_ptr->size = entry_sizes[check[i].entry_type];
+ entry_ptr->size = entry_sizes[check[i].entry_type];
entry_ptr->deserialized = FALSE;
entry_ptr->serialized = FALSE;
@@ -9572,26 +9619,26 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
} /* check_flush_cache__flush_op_test() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_cache__flush_op_eviction_test()
+ * Function: check_flush_cache__flush_op_eviction_test()
*
- * Purpose: Verify that flush operations work as expected when an
+ * Purpose: Verify that flush operations work as expected when an
* entry is evicted.
*
* Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 10/3/06
*
* Modifications:
*
- * Updated test for minor changes in the behaviour
- * of H5C__flush_single_entry().
+ * Updated test for minor changes in the behaviour
+ * of H5C__flush_single_entry().
*
- * JRM -- 2/16/15
+ * JRM -- 2/16/15
*
*-------------------------------------------------------------------------
*/
@@ -9600,11 +9647,11 @@ static void
check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
{
H5C_t * cache_ptr = file_ptr->shared->cache;
- int i;
- int num_variable_entries = 10;
- int num_monster_entries = 31;
- int num_large_entries = 0;
- herr_t result;
+ int i;
+ int num_variable_entries = 10;
+ int num_monster_entries = 31;
+ int num_large_entries = 0;
+ herr_t result;
test_entry_t * entry_ptr;
test_entry_t * base_addr;
struct expected_entry_status expected[10 + 31 + 14] =
@@ -9614,63 +9661,63 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
* array only processes as much of it as it is told to, we don't have to
* worry about maintaining the status of entries that we haven't used yet.
*/
- /* entry entry in at main flush dep flush dep child flush flush flush */
- /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
- { VARIABLE_ENTRY_TYPE, 0, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { VARIABLE_ENTRY_TYPE, 2, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { VARIABLE_ENTRY_TYPE, 4, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { VARIABLE_ENTRY_TYPE, 8, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { VARIABLE_ENTRY_TYPE, 9, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 0, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 1, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 2, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 3, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 4, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 5, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 6, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 7, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 8, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 9, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 10, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 11, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 12, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { LARGE_ENTRY_TYPE, 13, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
+ { VARIABLE_ENTRY_TYPE, 0, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { VARIABLE_ENTRY_TYPE, 2, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { VARIABLE_ENTRY_TYPE, 4, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { VARIABLE_ENTRY_TYPE, 8, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { VARIABLE_ENTRY_TYPE, 9, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 0, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 1, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 2, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 3, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 4, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 5, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 6, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 7, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 8, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 9, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 10, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 11, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 12, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { LARGE_ENTRY_TYPE, 13, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}
};
if(pass) {
@@ -9689,15 +9736,15 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) ||
(cache_ptr->min_clean_size != (1 * 1024 * 1024))) {
- pass = FALSE;
- failure_mssg =
- "unexpected cache config at start of flush op eviction test.";
+ pass = FALSE;
+ failure_mssg =
+ "unexpected cache config at start of flush op eviction test.";
} else {
/* set min clean size to zero for this test as it simplifies
- * computing the expected cache size after each operation.
- */
+ * computing the expected cache size after each operation.
+ */
cache_ptr->min_clean_size = 0;
}
@@ -9710,112 +9757,112 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
* other entries into the cache until the cache is full. At
* that point, load yet more entries into the cache, and see
* if the flush operations are performed as expected.
- *
- * To make things a bit more interesting, we also include a
- * couple of pins.
+ *
+ * To make things a bit more interesting, we also include a
+ * couple of pins.
*/
- /* reset the stats before we start. If stats are enabled, we will
- * check to see if they are as expected at the end.
- */
- H5C_stats__reset(cache_ptr);
+ /* reset the stats before we start. If stats are enabled, we will
+ * check to see if they are as expected at the end.
+ */
+ H5C_stats__reset(cache_ptr);
- /* load a few entries with pin relationships and flush ops.
- * Start by just loading the entries.
- */
+ /* load a few entries with pin relationships and flush ops.
+ * Start by just loading the entries.
+ */
- protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0,
+ protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0,
(VARIABLE_ENTRY_SIZE / 4), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG);
- protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1,
+ protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1,
(VARIABLE_ENTRY_SIZE / 4), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG);
- protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET);
+ protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET);
- protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3,
+ protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3,
(VARIABLE_ENTRY_SIZE / 4), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3, H5C__DIRTIED_FLAG);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3, H5C__DIRTIED_FLAG);
- protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4, H5C__NO_FLAGS_SET);
+ protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4, H5C__NO_FLAGS_SET);
- protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5,
+ protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5,
(VARIABLE_ENTRY_SIZE / 4), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, H5C__DIRTIED_FLAG);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, H5C__DIRTIED_FLAG);
- protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6,
+ protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6,
(VARIABLE_ENTRY_SIZE / 2), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, H5C__DIRTIED_FLAG);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, H5C__DIRTIED_FLAG);
- protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7,
+ protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7,
(VARIABLE_ENTRY_SIZE / 2), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, H5C__DIRTIED_FLAG);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, H5C__DIRTIED_FLAG);
- protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8, H5C__NO_FLAGS_SET);
+ protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8, H5C__NO_FLAGS_SET);
- protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9, H5C__NO_FLAGS_SET);
+ protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9, H5C__NO_FLAGS_SET);
- if((cache_ptr->index_len != 10) ||
+ if((cache_ptr->index_len != 10) ||
(cache_ptr->index_size != (4 * (VARIABLE_ENTRY_SIZE / 4)) +
- (2 * (VARIABLE_ENTRY_SIZE / 2)) +
- (4 * VARIABLE_ENTRY_SIZE))) {
-
- pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 1.";
- }
- }
-
- if(pass) {
-
- /* Now set up the pinning relationships:
- *
- * Briefly, (VET, 0) is pinned by (VET, 1), (VET, 3), and (VET, 5)
- * (VET, 9) is pinned by (VET, 5), and (VET, 7)
- */
- create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 1,
- VARIABLE_ENTRY_TYPE, 0);
- create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 3,
- VARIABLE_ENTRY_TYPE, 0);
- create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5,
- VARIABLE_ENTRY_TYPE, 0);
- create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5,
- VARIABLE_ENTRY_TYPE, 9);
- create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 7,
- VARIABLE_ENTRY_TYPE, 9);
-
- /* Next, set up the flush operations:
- *
- * Briefly, (VET, 1) dirties (VET, 0)
- * resizes (VET, 0) to 3/4 VARIABLE_ENTRY_SIZE
- *
- * (VET, 3) dirties (VET, 0)
- * resizes (VET, 0) to VARIABLE_ENTRY_SIZE
- * moves (VET, 0) to its alternate address
- *
- * (VET, 5) dirties (VET, 0)
- * resizes itself to VARIABLE_ENTRY_SIZE / 2
+ (2 * (VARIABLE_ENTRY_SIZE / 2)) +
+ (4 * VARIABLE_ENTRY_SIZE))) {
+
+ pass = FALSE;
+ failure_mssg = "unexpected size/len in flush op eviction test 1.";
+ }
+ }
+
+ if(pass) {
+
+ /* Now set up the pinning relationships:
+ *
+ * Briefly, (VET, 0) is pinned by (VET, 1), (VET, 3), and (VET, 5)
+ * (VET, 9) is pinned by (VET, 5), and (VET, 7)
+ */
+ create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 1,
+ VARIABLE_ENTRY_TYPE, 0);
+ create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 3,
+ VARIABLE_ENTRY_TYPE, 0);
+ create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5,
+ VARIABLE_ENTRY_TYPE, 0);
+ create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5,
+ VARIABLE_ENTRY_TYPE, 9);
+ create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 7,
+ VARIABLE_ENTRY_TYPE, 9);
+
+ /* Next, set up the flush operations:
+ *
+ * Briefly, (VET, 1) dirties (VET, 0)
+ * resizes (VET, 0) to 3/4 VARIABLE_ENTRY_SIZE
+ *
+ * (VET, 3) dirties (VET, 0)
+ * resizes (VET, 0) to VARIABLE_ENTRY_SIZE
+ * moves (VET, 0) to its alternate address
+ *
+ * (VET, 5) dirties (VET, 0)
+ * resizes itself to VARIABLE_ENTRY_SIZE / 2
*
* (VET, 7) dirties (VET, 9)
- *
- * (VET, 9) dirties (VET, 8)
- */
+ *
+ * (VET, 9) dirties (VET, 8)
+ */
add_flush_op(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__DIRTY,
VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL);
add_flush_op(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__RESIZE,
VARIABLE_ENTRY_TYPE, 0, TRUE,
- 3 * VARIABLE_ENTRY_SIZE / 4, NULL);
+ 3 * VARIABLE_ENTRY_SIZE / 4, NULL);
add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__DIRTY,
VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL);
@@ -9838,648 +9885,648 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
if(pass) {
- /* to summarize, at present the following variable size entries
- * are in cache with the following characteristics:
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 2.5 KB Y Y - -
- *
- * (VET, 1) Y 2.5 KB Y N 0 dirty (VET, 0),
- * resize (VET, 0) to 7.5 KB
- *
- * (VET, 2) Y 10 KB N N - -
- *
- *
- * (VET, 3) Y 2.5 KB N N 0 dirty (VET, 0)
- * resize (VET, 0) to 10 KB
- * move (VET, 0) to its alternate address
- *
- * (VET, 4) Y 10 KB N N - -
- *
- *
- * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0)
- * resize (VET, 5) to 5 KB
- *
- * (VET, 6) Y 5 KB Y N - -
- *
- * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9)
- *
- * (VET, 8) Y 10 KB N N - -
- *
- * (VET, 9) Y 10 KB N N - dirty (VET, 8)
- *
- * Recall that in this test bed, flush operations are excuted the
- * first time the associated entry is flushed, and are then
- * deleted.
- */
+ /* to summarize, at present the following variable size entries
+ * are in cache with the following characteristics:
+ *
+ * in
+ * entry: cache? size: dirty? pinned? pins: flush operations:
+ *
+ * (VET, 0) Y 2.5 KB Y Y - -
+ *
+ * (VET, 1) Y 2.5 KB Y N 0 dirty (VET, 0),
+ * resize (VET, 0) to 7.5 KB
+ *
+ * (VET, 2) Y 10 KB N N - -
+ *
+ *
+ * (VET, 3) Y 2.5 KB N N 0 dirty (VET, 0)
+ * resize (VET, 0) to 10 KB
+ * move (VET, 0) to its alternate address
+ *
+ * (VET, 4) Y 10 KB N N - -
+ *
+ *
+ * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0)
+ * resize (VET, 5) to 5 KB
+ *
+ * (VET, 6) Y 5 KB Y N - -
+ *
+ * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9)
+ *
+ * (VET, 8) Y 10 KB N N - -
+ *
+ * (VET, 9) Y 10 KB N N - dirty (VET, 8)
+ *
+ * Recall that in this test bed, flush operations are excuted the
+ * first time the associated entry is flushed, and are then
+ * deleted.
+ */
/* Now fill up the cache with other, unrelated entries */
- for (i = 0; i < 31; i++)
- {
- protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
+ for (i = 0; i < 31; i++)
+ {
+ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
- for (i = 0; i < 1; i++)
- {
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
+ for (i = 0; i < 1; i++)
+ {
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
- /* The cache should now be exactly full */
- if((cache_ptr->index_len != 42) ||
+ /* The cache should now be exactly full */
+ if((cache_ptr->index_len != 42) ||
(cache_ptr->index_size != 2 * 1024 * 1024) ||
- (cache_ptr->index_size != ((4 * VARIABLE_ENTRY_SIZE / 4) +
- (2 * VARIABLE_ENTRY_SIZE / 2) +
- (4 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (1 * LARGE_ENTRY_SIZE)))) {
+ (cache_ptr->index_size != ((4 * VARIABLE_ENTRY_SIZE / 4) +
+ (2 * VARIABLE_ENTRY_SIZE / 2) +
+ (4 * VARIABLE_ENTRY_SIZE) +
+ (31 * MONSTER_ENTRY_SIZE) +
+ (1 * LARGE_ENTRY_SIZE)))) {
pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 2.";
+ failure_mssg = "unexpected size/len in flush op eviction test 2.";
- } else {
+ } else {
- /* verify the expected status of all entries we have loaded to date: */
+ /* verify the expected status of all entries we have loaded to date: */
num_large_entries = 1;
- verify_entry_status(cache_ptr,
- 0,
- (num_variable_entries + num_monster_entries + num_large_entries),
- expected);
- }
- }
-
- if(pass) {
-
- /* Now load a large entry. This should result in the eviction
- * of (VET,2), and the increase in the size of (VET, 0) from .25
- * VARIABLE_ENTRY_SIZE to .75 VARIABLE_ENTRY_SIZE.
- *
- * The following table illustrates the intended state of affairs
- * after the eviction:
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 7.5 KB Y Y - -
- *
- * (VET, 1) Y 2.5 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) Y 2.5 KB Y N 0 dirty (VET, 0)
- * resize (VET, 0) to 10 KB
- * move (VET, 0) to its alternate address
- *
- * (VET, 4) Y 10 KB N N - -
- *
- * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0)
- * resize (VET, 5) to 5 KB
- *
- * (VET, 6) Y 5 KB Y N - -
- *
- * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9)
- *
- * (VET, 8) Y 10 KB N N - -
- *
- * (VET, 9) Y 10 KB N Y - dirty (VET, 8)
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
- expected[0].size = 3 * VARIABLE_ENTRY_SIZE / 4;
- expected[1].is_dirty = FALSE;
- expected[1].serialized = TRUE;
- expected[2].in_cache = FALSE;
- expected[2].destroyed = TRUE;
+ verify_entry_status(cache_ptr,
+ 0,
+ (num_variable_entries + num_monster_entries + num_large_entries),
+ expected);
+ }
+ }
+
+ if(pass) {
+
+ /* Now load a large entry. This should result in the eviction
+ * of (VET,2), and the increase in the size of (VET, 0) from .25
+ * VARIABLE_ENTRY_SIZE to .75 VARIABLE_ENTRY_SIZE.
+ *
+ * The following table illustrates the intended state of affairs
+ * after the eviction:
+ *
+ * in
+ * entry: cache? size: dirty? pinned? pins: flush operations:
+ *
+ * (VET, 0) Y 7.5 KB Y Y - -
+ *
+ * (VET, 1) Y 2.5 KB N N - -
+ *
+ * (VET, 2) N 10 KB N N - -
+ *
+ * (VET, 3) Y 2.5 KB Y N 0 dirty (VET, 0)
+ * resize (VET, 0) to 10 KB
+ * move (VET, 0) to its alternate address
+ *
+ * (VET, 4) Y 10 KB N N - -
+ *
+ * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0)
+ * resize (VET, 5) to 5 KB
+ *
+ * (VET, 6) Y 5 KB Y N - -
+ *
+ * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9)
+ *
+ * (VET, 8) Y 10 KB N N - -
+ *
+ * (VET, 9) Y 10 KB N Y - dirty (VET, 8)
+ *
+ * Start by updating the expected table for the expected changes in entry status:
+ */
+ expected[0].size = 3 * VARIABLE_ENTRY_SIZE / 4;
+ expected[1].is_dirty = FALSE;
+ expected[1].serialized = TRUE;
+ expected[2].in_cache = FALSE;
+ expected[2].destroyed = TRUE;
num_large_entries = 2;
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1);
- unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG);
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1);
+ unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG);
- if((cache_ptr->index_len != 42) ||
+ if((cache_ptr->index_len != 42) ||
(cache_ptr->index_size != (2 * 1024 * 1024) -
- (VARIABLE_ENTRY_SIZE) +
- (VARIABLE_ENTRY_SIZE / 2) +
- (LARGE_ENTRY_SIZE)) ||
- (cache_ptr->index_size != ((1 * (3 * VARIABLE_ENTRY_SIZE / 4)) +
- (3 * VARIABLE_ENTRY_SIZE / 4) +
- (2 * VARIABLE_ENTRY_SIZE / 2) +
- (3 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (2 * LARGE_ENTRY_SIZE)))) {
- pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 3.";
- }
-
- /* verify entry status */
- verify_entry_status(cache_ptr,
- 1,
+ (VARIABLE_ENTRY_SIZE) +
+ (VARIABLE_ENTRY_SIZE / 2) +
+ (LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->index_size != ((1 * (3 * VARIABLE_ENTRY_SIZE / 4)) +
+ (3 * VARIABLE_ENTRY_SIZE / 4) +
+ (2 * VARIABLE_ENTRY_SIZE / 2) +
+ (3 * VARIABLE_ENTRY_SIZE) +
+ (31 * MONSTER_ENTRY_SIZE) +
+ (2 * LARGE_ENTRY_SIZE)))) {
+ pass = FALSE;
+ failure_mssg = "unexpected size/len in flush op eviction test 3.";
+ }
+
+ /* verify entry status */
+ verify_entry_status(cache_ptr,
+ 1,
(num_variable_entries + num_monster_entries + num_large_entries),
- expected);
- }
-
- if(pass) {
-
- /* Now load another large entry. This should result in the eviction
- * of (VET, 4), the increase in the size of (VET, 0) from .75
- * VARIABLE_ENTRY_SIZE to 1.0 VARIABLE_ENTRY_SIZE, and the renaming
- * of (VET, 0) to its alternate address.
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 10 KB Y Y - -
- *
- * (VET, 1) Y 2.5 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) Y 2.5 KB N N - -
- *
- * (VET, 4) N 10 KB N N - -
- *
- * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0)
- * resize (VET, 5) to 5 KB
- *
- * (VET, 6) Y 5 KB Y N - -
- *
- * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9)
- *
- * (VET, 8) Y 10 KB N N - -
- *
- * (VET, 9) Y 10 KB N Y - dirty (VET, 8)
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
- expected[0].size = VARIABLE_ENTRY_SIZE;
- expected[0].at_main_addr = FALSE;
- expected[3].is_dirty = FALSE;
- expected[3].serialized = TRUE;
- expected[4].in_cache = FALSE;
- expected[4].destroyed = TRUE;
+ expected);
+ }
+
+ if(pass) {
+
+ /* Now load another large entry. This should result in the eviction
+ * of (VET, 4), the increase in the size of (VET, 0) from .75
+ * VARIABLE_ENTRY_SIZE to 1.0 VARIABLE_ENTRY_SIZE, and the renaming
+ * of (VET, 0) to its alternate address.
+ *
+ * The following table shows the expected states of the variable
+ * size entries after the test.
+ *
+ * in
+ * entry: cache? size: dirty? pinned? pins: flush operations:
+ *
+ * (VET, 0) Y 10 KB Y Y - -
+ *
+ * (VET, 1) Y 2.5 KB N N - -
+ *
+ * (VET, 2) N 10 KB N N - -
+ *
+ * (VET, 3) Y 2.5 KB N N - -
+ *
+ * (VET, 4) N 10 KB N N - -
+ *
+ * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0)
+ * resize (VET, 5) to 5 KB
+ *
+ * (VET, 6) Y 5 KB Y N - -
+ *
+ * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9)
+ *
+ * (VET, 8) Y 10 KB N N - -
+ *
+ * (VET, 9) Y 10 KB N Y - dirty (VET, 8)
+ *
+ * Start by updating the expected table for the expected changes in entry status:
+ */
+ expected[0].size = VARIABLE_ENTRY_SIZE;
+ expected[0].at_main_addr = FALSE;
+ expected[3].is_dirty = FALSE;
+ expected[3].serialized = TRUE;
+ expected[4].in_cache = FALSE;
+ expected[4].destroyed = TRUE;
num_large_entries = 3;
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2);
- unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__DIRTIED_FLAG);
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2);
+ unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__DIRTIED_FLAG);
- if((cache_ptr->index_len != 42) ||
+ if((cache_ptr->index_len != 42) ||
(cache_ptr->index_size != (2 * 1024 * 1024) -
- (2 * VARIABLE_ENTRY_SIZE) +
- (3 * VARIABLE_ENTRY_SIZE / 4) +
- (2 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->index_size != ((3 * VARIABLE_ENTRY_SIZE / 4) +
- (2 * VARIABLE_ENTRY_SIZE / 2) +
- (3 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (3 * LARGE_ENTRY_SIZE)))) {
-
- pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 4.";
- }
-
- /* verify entry status */
- verify_entry_status(cache_ptr,
- 2,
+ (2 * VARIABLE_ENTRY_SIZE) +
+ (3 * VARIABLE_ENTRY_SIZE / 4) +
+ (2 * LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->index_size != ((3 * VARIABLE_ENTRY_SIZE / 4) +
+ (2 * VARIABLE_ENTRY_SIZE / 2) +
+ (3 * VARIABLE_ENTRY_SIZE) +
+ (31 * MONSTER_ENTRY_SIZE) +
+ (3 * LARGE_ENTRY_SIZE)))) {
+
+ pass = FALSE;
+ failure_mssg = "unexpected size/len in flush op eviction test 4.";
+ }
+
+ /* verify entry status */
+ verify_entry_status(cache_ptr,
+ 2,
(num_variable_entries + num_monster_entries + num_large_entries),
- expected);
+ expected);
}
if(pass) {
- /* load two more large entries. This should result in (VET, 5) being
- * flushed, and increasing its size from 1/4 VARIABLE_ENTRY_SIZE to
- * VARIABLE_ENTRY_SIZE.
- *
- * As a result of this size increase, the cache will have to look
- * for another entry to evict. After flushing (VET, 6) and (VET, 7),
- * it should evict (VET, 8), yielding the needed memory and dirtying
+ /* load two more large entries. This should result in (VET, 5) being
+ * flushed, and increasing its size from 1/4 VARIABLE_ENTRY_SIZE to
+ * VARIABLE_ENTRY_SIZE.
+ *
+ * As a result of this size increase, the cache will have to look
+ * for another entry to evict. After flushing (VET, 6) and (VET, 7),
+ * it should evict (VET, 8), yielding the needed memory and dirtying
* (VET, 9).
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 10 KB Y Y - -
- *
- * (VET, 1) Y 2.5 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) Y 2.5 KB N N - -
- *
- * (VET, 4) N 10 KB N N - -
- *
- * (VET, 5) Y 5 KB N N 0, 9 -
- *
- * (VET, 6) Y 5 KB N N - -
- *
- * (VET, 7) Y 5 KB N N 9 -
- *
- * (VET, 8) N 10 KB N N - -
- *
- * (VET, 9) Y 10 KB N Y - dirty (VET, 8)
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
-
- expected[5].size = VARIABLE_ENTRY_SIZE / 2;
- expected[5].is_dirty = FALSE;
- expected[5].serialized = TRUE;
- expected[6].is_dirty = FALSE;
- expected[6].serialized = TRUE;
- expected[7].is_dirty = FALSE;
- expected[7].serialized = TRUE;
- expected[8].in_cache = FALSE;
- expected[8].destroyed = TRUE;
- expected[9].is_dirty = TRUE;
+ *
+ * The following table shows the expected states of the variable
+ * size entries after the test.
+ *
+ * in
+ * entry: cache? size: dirty? pinned? pins: flush operations:
+ *
+ * (VET, 0) Y 10 KB Y Y - -
+ *
+ * (VET, 1) Y 2.5 KB N N - -
+ *
+ * (VET, 2) N 10 KB N N - -
+ *
+ * (VET, 3) Y 2.5 KB N N - -
+ *
+ * (VET, 4) N 10 KB N N - -
+ *
+ * (VET, 5) Y 5 KB N N 0, 9 -
+ *
+ * (VET, 6) Y 5 KB N N - -
+ *
+ * (VET, 7) Y 5 KB N N 9 -
+ *
+ * (VET, 8) N 10 KB N N - -
+ *
+ * (VET, 9) Y 10 KB N Y - dirty (VET, 8)
+ *
+ * Start by updating the expected table for the expected changes in entry status:
+ */
+
+ expected[5].size = VARIABLE_ENTRY_SIZE / 2;
+ expected[5].is_dirty = FALSE;
+ expected[5].serialized = TRUE;
+ expected[6].is_dirty = FALSE;
+ expected[6].serialized = TRUE;
+ expected[7].is_dirty = FALSE;
+ expected[7].serialized = TRUE;
+ expected[8].in_cache = FALSE;
+ expected[8].destroyed = TRUE;
+ expected[9].is_dirty = TRUE;
num_large_entries = 5;
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3);
- unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__DIRTIED_FLAG);
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3);
+ unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__DIRTIED_FLAG);
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, 4);
- unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 4, H5C__DIRTIED_FLAG);
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, 4);
+ unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 4, H5C__DIRTIED_FLAG);
/* verify cache size */
- if((cache_ptr->index_len != 43) ||
+ if((cache_ptr->index_len != 43) ||
(cache_ptr->index_size != (2 * 1024 * 1024) -
- (3 * VARIABLE_ENTRY_SIZE) +
- (1 * VARIABLE_ENTRY_SIZE / 4) +
- (3 * VARIABLE_ENTRY_SIZE / 4) +
- (4 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 4) +
- (3 * VARIABLE_ENTRY_SIZE / 2) +
- (2 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (5 * LARGE_ENTRY_SIZE)))) {
-
- pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 5.";
- }
-
- /* verify entry status */
- verify_entry_status(cache_ptr,
- 3,
+ (3 * VARIABLE_ENTRY_SIZE) +
+ (1 * VARIABLE_ENTRY_SIZE / 4) +
+ (3 * VARIABLE_ENTRY_SIZE / 4) +
+ (4 * LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 4) +
+ (3 * VARIABLE_ENTRY_SIZE / 2) +
+ (2 * VARIABLE_ENTRY_SIZE) +
+ (31 * MONSTER_ENTRY_SIZE) +
+ (5 * LARGE_ENTRY_SIZE)))) {
+
+ pass = FALSE;
+ failure_mssg = "unexpected size/len in flush op eviction test 5.";
+ }
+
+ /* verify entry status */
+ verify_entry_status(cache_ptr,
+ 3,
(num_variable_entries + num_monster_entries + num_large_entries),
- expected);
+ expected);
}
if(pass) {
/* now touch all the non VARIABLE_ENTRY_TYPE entries in the
- * cache to bring all the VARIABLE_ENTRY_TYPE entries to the
- * end of the LRU list.
- *
- * Note that we don't have to worry about (VET, 0) and (VET, 9)
- * as they are pinned and thus not in the LRU list to begin with.
- */
- for (i = 0; i < 31; i++)
- {
- protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
+ * cache to bring all the VARIABLE_ENTRY_TYPE entries to the
+ * end of the LRU list.
+ *
+ * Note that we don't have to worry about (VET, 0) and (VET, 9)
+ * as they are pinned and thus not in the LRU list to begin with.
+ */
+ for (i = 0; i < 31; i++)
+ {
+ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
- for (i = 0; i < 5; i++)
- {
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
+ for (i = 0; i < 5; i++)
+ {
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
/* verify cache size */
- if((cache_ptr->index_len != 43) ||
+ if((cache_ptr->index_len != 43) ||
(cache_ptr->index_size != (2 * 1024 * 1024) -
- (3 * VARIABLE_ENTRY_SIZE) +
- (1 * VARIABLE_ENTRY_SIZE / 4) +
- (3 * VARIABLE_ENTRY_SIZE / 4) +
- (4 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 4) +
- (3 * VARIABLE_ENTRY_SIZE / 2) +
- (2 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (5 * LARGE_ENTRY_SIZE)))) {
-
- pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 6.";
- }
-
- /* verify entry status */
- verify_entry_status(cache_ptr,
- 4,
+ (3 * VARIABLE_ENTRY_SIZE) +
+ (1 * VARIABLE_ENTRY_SIZE / 4) +
+ (3 * VARIABLE_ENTRY_SIZE / 4) +
+ (4 * LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 4) +
+ (3 * VARIABLE_ENTRY_SIZE / 2) +
+ (2 * VARIABLE_ENTRY_SIZE) +
+ (31 * MONSTER_ENTRY_SIZE) +
+ (5 * LARGE_ENTRY_SIZE)))) {
+
+ pass = FALSE;
+ failure_mssg = "unexpected size/len in flush op eviction test 6.";
+ }
+
+ /* verify entry status */
+ verify_entry_status(cache_ptr,
+ 4,
(num_variable_entries + num_monster_entries + num_large_entries),
- expected);
+ expected);
}
if(pass) {
- /* Now load three more large entries. This should result
- * in the evictions of (VET, 1), (VET, 3), and (VET, 5), and the
+ /* Now load three more large entries. This should result
+ * in the evictions of (VET, 1), (VET, 3), and (VET, 5), and the
* unpinning of (VET, 0)
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 10 KB Y N - -
- *
- * (VET, 1) N 2.5 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) N 2.5 KB N N - -
- *
- * (VET, 4) N 10 KB N N - -
- *
- * (VET, 5) N 5 KB N N - -
- *
- * (VET, 6) Y 5 KB N N - -
- *
- * (VET, 7) Y 5 KB N N 9 -
- *
- * (VET, 8) N 10 KB N N - -
- *
- * (VET, 9) Y 10 KB N Y - dirty (VET, 8)
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
-
- expected[0].is_pinned = FALSE;
- expected[1].in_cache = FALSE;
- expected[1].destroyed = TRUE;
- expected[3].in_cache = FALSE;
- expected[3].destroyed = TRUE;
- expected[5].in_cache = FALSE;
- expected[5].destroyed = TRUE;
+ *
+ * The following table shows the expected states of the variable
+ * size entries after the test.
+ *
+ * in
+ * entry: cache? size: dirty? pinned? pins: flush operations:
+ *
+ * (VET, 0) Y 10 KB Y N - -
+ *
+ * (VET, 1) N 2.5 KB N N - -
+ *
+ * (VET, 2) N 10 KB N N - -
+ *
+ * (VET, 3) N 2.5 KB N N - -
+ *
+ * (VET, 4) N 10 KB N N - -
+ *
+ * (VET, 5) N 5 KB N N - -
+ *
+ * (VET, 6) Y 5 KB N N - -
+ *
+ * (VET, 7) Y 5 KB N N 9 -
+ *
+ * (VET, 8) N 10 KB N N - -
+ *
+ * (VET, 9) Y 10 KB N Y - dirty (VET, 8)
+ *
+ * Start by updating the expected table for the expected changes in entry status:
+ */
+
+ expected[0].is_pinned = FALSE;
+ expected[1].in_cache = FALSE;
+ expected[1].destroyed = TRUE;
+ expected[3].in_cache = FALSE;
+ expected[3].destroyed = TRUE;
+ expected[5].in_cache = FALSE;
+ expected[5].destroyed = TRUE;
num_large_entries = 8;
- for (i = 5; i < 8; i++)
- {
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
+ for (i = 5; i < 8; i++)
+ {
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
/* verify cache size */
- if((cache_ptr->index_len != 43) ||
+ if((cache_ptr->index_len != 43) ||
(cache_ptr->index_size != (2 * 1024 * 1024) -
- (4 * VARIABLE_ENTRY_SIZE) +
- (1 * VARIABLE_ENTRY_SIZE / 4) +
- (3 * VARIABLE_ENTRY_SIZE / 4) +
- (7 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 2) +
- (2 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (8 * LARGE_ENTRY_SIZE)))) {
-
- pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 7.";
- }
-
- /* verify entry status */
- verify_entry_status(cache_ptr,
- 5,
+ (4 * VARIABLE_ENTRY_SIZE) +
+ (1 * VARIABLE_ENTRY_SIZE / 4) +
+ (3 * VARIABLE_ENTRY_SIZE / 4) +
+ (7 * LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 2) +
+ (2 * VARIABLE_ENTRY_SIZE) +
+ (31 * MONSTER_ENTRY_SIZE) +
+ (8 * LARGE_ENTRY_SIZE)))) {
+
+ pass = FALSE;
+ failure_mssg = "unexpected size/len in flush op eviction test 7.";
+ }
+
+ /* verify entry status */
+ verify_entry_status(cache_ptr,
+ 5,
(num_variable_entries + num_monster_entries + num_large_entries),
- expected);
- }
-
- if(pass) {
-
- /* load another large entry. (VET, 6) should be evicted.
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 10 KB Y N - -
- *
- * (VET, 1) N 2.5 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) N 2.5 KB N N - -
- *
- * (VET, 4) N 10 KB N N - -
- *
- * (VET, 5) N 5 KB N N - -
- *
- * (VET, 6) N 5 KB N N - -
- *
- * (VET, 7) Y 5 KB N N 9 -
- *
- * (VET, 8) N 10 KB N N - -
- *
- * (VET, 9) Y 10 KB N Y - dirty (VET, 8)
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
-
- expected[6].in_cache = FALSE;
- expected[6].destroyed = TRUE;
+ expected);
+ }
+
+ if(pass) {
+
+ /* load another large entry. (VET, 6) should be evicted.
+ *
+ * The following table shows the expected states of the variable
+ * size entries after the test.
+ *
+ * in
+ * entry: cache? size: dirty? pinned? pins: flush operations:
+ *
+ * (VET, 0) Y 10 KB Y N - -
+ *
+ * (VET, 1) N 2.5 KB N N - -
+ *
+ * (VET, 2) N 10 KB N N - -
+ *
+ * (VET, 3) N 2.5 KB N N - -
+ *
+ * (VET, 4) N 10 KB N N - -
+ *
+ * (VET, 5) N 5 KB N N - -
+ *
+ * (VET, 6) N 5 KB N N - -
+ *
+ * (VET, 7) Y 5 KB N N 9 -
+ *
+ * (VET, 8) N 10 KB N N - -
+ *
+ * (VET, 9) Y 10 KB N Y - dirty (VET, 8)
+ *
+ * Start by updating the expected table for the expected changes in entry status:
+ */
+
+ expected[6].in_cache = FALSE;
+ expected[6].destroyed = TRUE;
num_large_entries = 9;
- for (i = 8; i < 9; i++)
- {
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
+ for (i = 8; i < 9; i++)
+ {
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
/* verify cache size */
- if((cache_ptr->index_len != 43) ||
+ if((cache_ptr->index_len != 43) ||
(cache_ptr->index_size != (2 * 1024 * 1024) -
- (3 * VARIABLE_ENTRY_SIZE) -
- (VARIABLE_ENTRY_SIZE / 2) +
- (8 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE / 2) +
- (2 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (9 * LARGE_ENTRY_SIZE)))) {
+ (3 * VARIABLE_ENTRY_SIZE) -
+ (VARIABLE_ENTRY_SIZE / 2) +
+ (8 * LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE / 2) +
+ (2 * VARIABLE_ENTRY_SIZE) +
+ (31 * MONSTER_ENTRY_SIZE) +
+ (9 * LARGE_ENTRY_SIZE)))) {
pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 8.";
- }
+ failure_mssg = "unexpected size/len in flush op eviction test 8.";
+ }
- /* verify entry status */
- verify_entry_status(cache_ptr,
- 6,
+ /* verify entry status */
+ verify_entry_status(cache_ptr,
+ 6,
(num_variable_entries + num_monster_entries + num_large_entries),
- expected);
- }
-
- if(pass) {
-
- /* Load another large entry.
- *
- * (VET, 7) should be evicted, and (VET, 9) should be unpinned.
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 10 KB Y N - -
- *
- * (VET, 1) N 2.5 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) N 2.5 KB N N - -
- *
- * (VET, 4) N 10 KB N N - -
- *
- * (VET, 5) N 5 KB N N - -
- *
- * (VET, 6) N 5 KB N N - -
- *
- * (VET, 7) N 5 KB N N - -
- *
- * (VET, 8) N 10 KB N N - -
- *
- * (VET, 9) Y 10 KB Y N - dirty (VET, 8)
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
-
- expected[7].in_cache = FALSE;
- expected[7].destroyed = TRUE;
- expected[9].is_pinned = FALSE;
+ expected);
+ }
+
+ if(pass) {
+
+ /* Load another large entry.
+ *
+ * (VET, 7) should be evicted, and (VET, 9) should be unpinned.
+ *
+ * The following table shows the expected states of the variable
+ * size entries after the test.
+ *
+ * in
+ * entry: cache? size: dirty? pinned? pins: flush operations:
+ *
+ * (VET, 0) Y 10 KB Y N - -
+ *
+ * (VET, 1) N 2.5 KB N N - -
+ *
+ * (VET, 2) N 10 KB N N - -
+ *
+ * (VET, 3) N 2.5 KB N N - -
+ *
+ * (VET, 4) N 10 KB N N - -
+ *
+ * (VET, 5) N 5 KB N N - -
+ *
+ * (VET, 6) N 5 KB N N - -
+ *
+ * (VET, 7) N 5 KB N N - -
+ *
+ * (VET, 8) N 10 KB N N - -
+ *
+ * (VET, 9) Y 10 KB Y N - dirty (VET, 8)
+ *
+ * Start by updating the expected table for the expected changes in entry status:
+ */
+
+ expected[7].in_cache = FALSE;
+ expected[7].destroyed = TRUE;
+ expected[9].is_pinned = FALSE;
num_large_entries = 10;
- for (i = 9; i < 10; i++)
- {
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
+ for (i = 9; i < 10; i++)
+ {
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
/* verify cache size */
- if((cache_ptr->index_len != 43) ||
+ if((cache_ptr->index_len != 43) ||
(cache_ptr->index_size != (2 * 1024 * 1024) -
- (4 * VARIABLE_ENTRY_SIZE) +
- (9 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (10 * LARGE_ENTRY_SIZE)))) {
+ (4 * VARIABLE_ENTRY_SIZE) +
+ (9 * LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE) +
+ (31 * MONSTER_ENTRY_SIZE) +
+ (10 * LARGE_ENTRY_SIZE)))) {
pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 9.";
- }
+ failure_mssg = "unexpected size/len in flush op eviction test 9.";
+ }
- /* verify entry status */
- verify_entry_status(cache_ptr,
- 7,
+ /* verify entry status */
+ verify_entry_status(cache_ptr,
+ 7,
(num_variable_entries + num_monster_entries + num_large_entries),
- expected);
+ expected);
}
if(pass) {
/* Again, touch all the non VARIABLE_ENTRY_TYPE entries in the
- * cache to bring all the VARIABLE_ENTRY_TYPE entries to the
- * end of the LRU list.
- *
- * Both (VET, 0) and (VET, 7) have been unpinned, so they are
- * now in the LRU list.
- */
- for (i = 0; i < 31; i++)
- {
- protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
+ * cache to bring all the VARIABLE_ENTRY_TYPE entries to the
+ * end of the LRU list.
+ *
+ * Both (VET, 0) and (VET, 7) have been unpinned, so they are
+ * now in the LRU list.
+ */
+ for (i = 0; i < 31; i++)
+ {
+ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
- for (i = 0; i < 10; i++)
- {
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
+ for (i = 0; i < 10; i++)
+ {
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
/* verify cache size */
- if((cache_ptr->index_len != 43) ||
+ if((cache_ptr->index_len != 43) ||
(cache_ptr->index_size != (2 * 1024 * 1024) -
- (4 * VARIABLE_ENTRY_SIZE) +
- (9 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (10 * LARGE_ENTRY_SIZE)))) {
+ (4 * VARIABLE_ENTRY_SIZE) +
+ (9 * LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE) +
+ (31 * MONSTER_ENTRY_SIZE) +
+ (10 * LARGE_ENTRY_SIZE)))) {
pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 10.";
- }
+ failure_mssg = "unexpected size/len in flush op eviction test 10.";
+ }
- /* verify entry status */
- verify_entry_status(cache_ptr,
- 8,
+ /* verify entry status */
+ verify_entry_status(cache_ptr,
+ 8,
(num_variable_entries + num_monster_entries + num_large_entries),
- expected);
+ expected);
}
if(pass) {
- /* load two more large entries. Things get a bit complicated here,
- * so I'll go through the operation step by step.
+ /* load two more large entries. Things get a bit complicated here,
+ * so I'll go through the operation step by step.
*
* Initially, the cache has 4 KB of empty space, so the first entry
- * (LET, 10) is loaded via calls to H5C_protect() H5C_unprotect()
- * without causing any evictions.
+ * (LET, 10) is loaded via calls to H5C_protect() H5C_unprotect()
+ * without causing any evictions.
*
* However, this is not the case for the call of H5C_protect() on
- * (LET, 11).
+ * (LET, 11).
*
* Before inserting (LET, 11), H5C_protect(LET, 11) must try to
- * free up at least 4 KB of space. To do this, it starts scanning
- * up the LRU list to find entries to evict.
+ * free up at least 4 KB of space. To do this, it starts scanning
+ * up the LRU list to find entries to evict.
*
* (VET, 0) is at the bottom of the LRU list, and thus is the first
- * entry considered. However, it is dirty, so it flushed to disk,
+ * entry considered. However, it is dirty, so it flushed to disk,
* moved to the top of the LRU list, and marked clean.
*
* (VET, 9) is the next entry on the bottom of the LRU list. It is
- * dirty too, calls its serialize callback function to construct an
- * on disk image of the entry, and moves it to the top of the LRU
+ * dirty too, calls its serialize callback function to construct an
+ * on disk image of the entry, and moves it to the top of the LRU
* list after the serialize callback returns.
*
- * However, (VET 9)'s serialize function needs to modify (VET, 8),
+ * However, (VET 9)'s serialize function needs to modify (VET, 8),
* which is currently not in cache. Thus it calls H5C_protect(VET, 8)
- * to gain access to it. H5C_protect(VET, 8) loads (VET, 8), and
- * then attempts to evict entries to make space for it.
+ * to gain access to it. H5C_protect(VET, 8) loads (VET, 8), and
+ * then attempts to evict entries to make space for it.
*
* However, H5C_make_space_in_cache() now exits without taking
* any action on re-entrant calls. Thus H5C_protect(VET, 8) simply
* loads the entry into the cache -- resulting in a cache that is
- * 10 KB oversize. The subsequent unprotect puts (VET, 8) at the
+ * 10 KB oversize. The subsequent unprotect puts (VET, 8) at the
* head of the LRU and marks it dirty.
*
- * After (VET, 9) is serialized, it is flushed, and moved to the
+ * After (VET, 9) is serialized, it is flushed, and moved to the
* head of the LRU.
*
- * At this point, the H5C_make_space_in_cache() call made by
+ * At this point, the H5C_make_space_in_cache() call made by
* H5C_protect(LET, 11) now has 14 KB of space to make.
*
* The next entries on the LRU are (MET, 0) thru (MET, 30),
- * (LET, 0) thru (LET, 10), and (VET, 8) -- all of which are dirty,
+ * (LET, 0) thru (LET, 10), and (VET, 8) -- all of which are dirty,
* and are therefore flushed and moved to the head of the LRU list.
*
* The next entry on the bottom of the LRU list is (VET, 0), which
- * is clean, and is therefore evicted, leaving H5C_make_space_in_cache()
+ * is clean, and is therefore evicted, leaving H5C_make_space_in_cache()
* with 4 KB of space to create.
*
- * This space is sufficient, so H5C_protect(VET, 8) inserts
- * (VET, 8) into the cache's index, marks it as protected, and
- * returns to the serialize function for (VET, 9).
+ * This space is sufficient, so H5C_protect(VET, 8) inserts
+ * (VET, 8) into the cache's index, marks it as protected, and
+ * returns to the serialize function for (VET, 9).
*
* When the serialize function for (VET, 9) is done with (VET, 8), it
* calls H5C_unprotect(VET, 8), which markes (VET, 8) as dirty and
@@ -10489,101 +10536,101 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
* evicted -- leaving 6 KB of free space after (LET, 11) is inserted
* into the cache.
*
- * H5C_unprotect(LET, 11) marks (LET, 11) as unprotected, and then
- * returns as well.
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) N 10 KB N N - -
- *
- * (VET, 1) N 2.5 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) N 2.5 KB N N - -
- *
- * (VET, 4) N 10 KB N N - -
- *
- * (VET, 5) N 5 KB N N - -
- *
- * (VET, 6) N 5 KB N N - -
- *
- * (VET, 7) N 5 KB N N - -
- *
- * (VET, 8) Y 10 KB N N - -
- *
- * (VET, 9) N 10 KB N N - -
- *
- * Start by updating the expected table for the expected changes in
- * entry status:
- *
- * Note that we reset the loaded, flushed, and destroyed
- * fields of (VET,8) so we can track what is happening.
- */
- base_addr = entries[VARIABLE_ENTRY_TYPE];
- entry_ptr = &(base_addr[8]);
- entry_ptr->deserialized = FALSE;
- entry_ptr->deserialized = FALSE;
- entry_ptr->destroyed = FALSE;
-
- expected[0].in_cache = FALSE;
- expected[0].is_dirty = FALSE;
- expected[0].serialized = TRUE;
- expected[0].destroyed = TRUE;
- expected[8].in_cache = TRUE;
- expected[8].is_dirty = FALSE;
- expected[8].deserialized = TRUE;
- expected[8].serialized = TRUE;
- expected[8].destroyed = FALSE;
- expected[9].in_cache = FALSE;
- expected[9].is_dirty = FALSE;
- expected[9].serialized = TRUE;
- expected[9].destroyed = TRUE;
-
- expected[10].in_cache = TRUE;
- expected[10].is_dirty = FALSE;
- expected[10].serialized = TRUE;
- expected[10].destroyed = FALSE;
+ * H5C_unprotect(LET, 11) marks (LET, 11) as unprotected, and then
+ * returns as well.
+ *
+ * The following table shows the expected states of the variable
+ * size entries after the test.
+ *
+ * in
+ * entry: cache? size: dirty? pinned? pins: flush operations:
+ *
+ * (VET, 0) N 10 KB N N - -
+ *
+ * (VET, 1) N 2.5 KB N N - -
+ *
+ * (VET, 2) N 10 KB N N - -
+ *
+ * (VET, 3) N 2.5 KB N N - -
+ *
+ * (VET, 4) N 10 KB N N - -
+ *
+ * (VET, 5) N 5 KB N N - -
+ *
+ * (VET, 6) N 5 KB N N - -
+ *
+ * (VET, 7) N 5 KB N N - -
+ *
+ * (VET, 8) Y 10 KB N N - -
+ *
+ * (VET, 9) N 10 KB N N - -
+ *
+ * Start by updating the expected table for the expected changes in
+ * entry status:
+ *
+ * Note that we reset the loaded, flushed, and destroyed
+ * fields of (VET,8) so we can track what is happening.
+ */
+ base_addr = entries[VARIABLE_ENTRY_TYPE];
+ entry_ptr = &(base_addr[8]);
+ entry_ptr->deserialized = FALSE;
+ entry_ptr->deserialized = FALSE;
+ entry_ptr->destroyed = FALSE;
+
+ expected[0].in_cache = FALSE;
+ expected[0].is_dirty = FALSE;
+ expected[0].serialized = TRUE;
+ expected[0].destroyed = TRUE;
+ expected[8].in_cache = TRUE;
+ expected[8].is_dirty = FALSE;
+ expected[8].deserialized = TRUE;
+ expected[8].serialized = TRUE;
+ expected[8].destroyed = FALSE;
+ expected[9].in_cache = FALSE;
+ expected[9].is_dirty = FALSE;
+ expected[9].serialized = TRUE;
+ expected[9].destroyed = TRUE;
+
+ expected[10].in_cache = TRUE;
+ expected[10].is_dirty = FALSE;
+ expected[10].serialized = TRUE;
+ expected[10].destroyed = FALSE;
num_large_entries = 12;
- for (i = num_variable_entries;
- i < num_variable_entries + num_monster_entries + num_large_entries - 1;
- i++)
- {
+ for (i = num_variable_entries;
+ i < num_variable_entries + num_monster_entries + num_large_entries - 1;
+ i++)
+ {
expected[i].is_dirty = FALSE;
- expected[i].serialized = TRUE;
- }
+ expected[i].serialized = TRUE;
+ }
- for (i = 10; i < 12; i++)
- {
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
+ for (i = 10; i < 12; i++)
+ {
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
/* verify cache size */
- if((cache_ptr->index_len != 44) ||
+ if((cache_ptr->index_len != 44) ||
(cache_ptr->index_size != (2 * 1024 * 1024) -
(2 * 1024) -
(1 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (12 * LARGE_ENTRY_SIZE)))) {
+ (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE) +
+ (31 * MONSTER_ENTRY_SIZE) +
+ (12 * LARGE_ENTRY_SIZE)))) {
pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 11.";
- }
+ failure_mssg = "unexpected size/len in flush op eviction test 11.";
+ }
- /* verify entry status */
- verify_entry_status(cache_ptr,
- 9,
- (num_variable_entries + num_monster_entries +
+ /* verify entry status */
+ verify_entry_status(cache_ptr,
+ 9,
+ (num_variable_entries + num_monster_entries +
num_large_entries),
- expected);
+ expected);
}
if(pass) {
@@ -10592,8 +10639,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9);
unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9, H5C__NO_FLAGS_SET);
- /* protect and unprotect VET 8 to dirty it and move it to the
- * top of the LRU. Since we are dirtying it again, reset its
+ /* protect and unprotect VET 8 to dirty it and move it to the
+ * top of the LRU. Since we are dirtying it again, reset its
* serialized flag.
*/
base_addr = entries[VARIABLE_ENTRY_TYPE];
@@ -10605,14 +10652,14 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
/* Again, touch all the non VARIABLE_ENTRY_TYPE entries in the
- * cache to evict VET 9 and move VET 8 to the bottom of the LRU.
+ * cache to evict VET 9 and move VET 8 to the bottom of the LRU.
*
* Must do this twice to get the desired result.
- */
+ */
- /* skip MET 0 in first pass so that we evict VET 9 when we
- * reload MET 0
+ /* skip MET 0 in first pass so that we evict VET 9 when we
+ * reload MET 0
*
* Since we are reloading MET 0, reset its destroyed flag.
*/
@@ -10620,40 +10667,40 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
entry_ptr = &(base_addr[0]);
entry_ptr->destroyed = FALSE;
- for (i = 1; i < num_monster_entries; i++)
- {
- protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
+ for (i = 1; i < num_monster_entries; i++)
+ {
+ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
- for (i = 0; i < num_large_entries; i++)
- {
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
+ for (i = 0; i < num_large_entries; i++)
+ {
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
- for (i = 0; i < num_monster_entries; i++)
- {
- protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
+ for (i = 0; i < num_monster_entries; i++)
+ {
+ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
- for (i = 0; i < num_large_entries; i++)
- {
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
+ for (i = 0; i < num_large_entries; i++)
+ {
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
- /* update the expected array to mark all these entries dirty again. */
- for (i = num_variable_entries;
- i < num_variable_entries + num_monster_entries + num_large_entries - 1;
- i++)
- {
+ /* update the expected array to mark all these entries dirty again. */
+ for (i = num_variable_entries;
+ i < num_variable_entries + num_monster_entries + num_large_entries - 1;
+ i++)
+ {
expected[i].is_dirty = TRUE;
- }
+ }
- /* update MET 0 to set its in cache flag, and reset
- * its destroyed flag
+ /* update MET 0 to set its in cache flag, and reset
+ * its destroyed flag
*/
expected[10].in_cache = TRUE;
@@ -10671,118 +10718,118 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
/* verify cache size */
- if((cache_ptr->index_len != 44) ||
+ if((cache_ptr->index_len != 44) ||
(cache_ptr->index_size != (2 * 1024 * 1024) -
- (5 * VARIABLE_ENTRY_SIZE) +
- (11 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (12 * LARGE_ENTRY_SIZE)))) {
+ (5 * VARIABLE_ENTRY_SIZE) +
+ (11 * LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE) +
+ (31 * MONSTER_ENTRY_SIZE) +
+ (12 * LARGE_ENTRY_SIZE)))) {
pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 12.";
- }
+ failure_mssg = "unexpected size/len in flush op eviction test 12.";
+ }
- /* modifications to the H5C__flush_single_entry() function have
- * changed the behavior of the cache slightly, causing
- * this test to fail. Comment out for now -- come back and
+ /* modifications to the H5C__flush_single_entry() function have
+ * changed the behavior of the cache slightly, causing
+ * this test to fail. Comment out for now -- come back and
* fix if all goes well.
*/
- /* verify entry status */
- verify_entry_status(cache_ptr,
- 10,
+ /* verify entry status */
+ verify_entry_status(cache_ptr,
+ 10,
(num_variable_entries + num_monster_entries + num_large_entries),
- expected);
+ expected);
}
if(pass) {
/* Load two more large entries.
- *
- * Since (VET, 8) is dirty, at first this will just cause (VET, 8)
- * to be flushed.
- *
- * But all other entries in the cache are dirty, so the cache will
- * flush them all, and then evict (VET, 8) on the second pass.
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) N 10 KB N N - -
- *
- * (VET, 1) N 2.5 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) N 2.5 KB N N - -
- *
- * (VET, 4) N 10 KB N N - -
- *
- * (VET, 5) N 5 KB N N - -
- *
- * (VET, 6) N 5 KB N N - -
- *
- * (VET, 7) N 5 KB N N - -
- *
- * (VET, 8) N 10 KB N N - -
- *
- * (VET, 9) N 10 KB N N - -
- *
- * Start by updating the expected table for the expected changes in
- * entry status:
- */
-
- expected[8].in_cache = FALSE;
- expected[8].is_dirty = FALSE;
- expected[8].serialized = TRUE;
- expected[8].destroyed = TRUE;
+ *
+ * Since (VET, 8) is dirty, at first this will just cause (VET, 8)
+ * to be flushed.
+ *
+ * But all other entries in the cache are dirty, so the cache will
+ * flush them all, and then evict (VET, 8) on the second pass.
+ *
+ * The following table shows the expected states of the variable
+ * size entries after the test.
+ *
+ * in
+ * entry: cache? size: dirty? pinned? pins: flush operations:
+ *
+ * (VET, 0) N 10 KB N N - -
+ *
+ * (VET, 1) N 2.5 KB N N - -
+ *
+ * (VET, 2) N 10 KB N N - -
+ *
+ * (VET, 3) N 2.5 KB N N - -
+ *
+ * (VET, 4) N 10 KB N N - -
+ *
+ * (VET, 5) N 5 KB N N - -
+ *
+ * (VET, 6) N 5 KB N N - -
+ *
+ * (VET, 7) N 5 KB N N - -
+ *
+ * (VET, 8) N 10 KB N N - -
+ *
+ * (VET, 9) N 10 KB N N - -
+ *
+ * Start by updating the expected table for the expected changes in
+ * entry status:
+ */
+
+ expected[8].in_cache = FALSE;
+ expected[8].is_dirty = FALSE;
+ expected[8].serialized = TRUE;
+ expected[8].destroyed = TRUE;
num_large_entries = 14;
- /* a newly loaded entry is not inserted in the cache until after
- * space has been made for it. Thus (LET, 13) will not be flushed.
- */
- for (i = num_variable_entries;
- i < num_variable_entries + num_monster_entries + num_large_entries - 1;
- i++)
- {
+ /* a newly loaded entry is not inserted in the cache until after
+ * space has been made for it. Thus (LET, 13) will not be flushed.
+ */
+ for (i = num_variable_entries;
+ i < num_variable_entries + num_monster_entries + num_large_entries - 1;
+ i++)
+ {
expected[i].is_dirty = FALSE;
- expected[i].serialized = TRUE;
- }
+ expected[i].serialized = TRUE;
+ }
- for (i = 12; i < 14; i++)
- {
- protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
+ for (i = 12; i < 14; i++)
+ {
+ protect_entry(file_ptr, LARGE_ENTRY_TYPE, i);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
/* verify cache size */
- if((cache_ptr->index_len != 45) ||
+ if((cache_ptr->index_len != 45) ||
(cache_ptr->index_size != (2 * 1024 * 1024) -
- (6 * VARIABLE_ENTRY_SIZE) +
- (13 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->index_size != ((31 * MONSTER_ENTRY_SIZE) +
- (14 * LARGE_ENTRY_SIZE)))) {
+ (6 * VARIABLE_ENTRY_SIZE) +
+ (13 * LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->index_size != ((31 * MONSTER_ENTRY_SIZE) +
+ (14 * LARGE_ENTRY_SIZE)))) {
pass = FALSE;
- failure_mssg = "unexpected size/len in flush op eviction test 13.";
- }
+ failure_mssg = "unexpected size/len in flush op eviction test 13.";
+ }
- /* modifications to the H5C__flush_single_entry() function have
- * changed the behavior of the cache slightly, causing
- * this test to fail. Comment out for now -- come back and
+ /* modifications to the H5C__flush_single_entry() function have
+ * changed the behavior of the cache slightly, causing
+ * this test to fail. Comment out for now -- come back and
* fix if all goes well.
*/
- /* verify entry status */
- verify_entry_status(cache_ptr,
- 11,
+ /* verify entry status */
+ verify_entry_status(cache_ptr,
+ 11,
(num_variable_entries + num_monster_entries + num_large_entries),
- expected);
+ expected);
}
/* at this point we have cycled all the variable size entries through
@@ -10820,7 +10867,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
*/
if(pass) {
- if((cache_ptr->insertions[VARIABLE_ENTRY_TYPE] != 0) ||
+ if((cache_ptr->insertions[VARIABLE_ENTRY_TYPE] != 0) ||
(cache_ptr->pinned_insertions[VARIABLE_ENTRY_TYPE] != 0) ||
(cache_ptr->clears[VARIABLE_ENTRY_TYPE] != 0) ||
(cache_ptr->flushes[VARIABLE_ENTRY_TYPE] != 9) ||
@@ -10846,7 +10893,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
if(pass) {
- if((cache_ptr->insertions[LARGE_ENTRY_TYPE] != 0) ||
+ if((cache_ptr->insertions[LARGE_ENTRY_TYPE] != 0) ||
(cache_ptr->pinned_insertions[LARGE_ENTRY_TYPE] != 0) ||
(cache_ptr->clears[LARGE_ENTRY_TYPE] != 0) ||
(cache_ptr->flushes[LARGE_ENTRY_TYPE] != 25) ||
@@ -10872,7 +10919,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
if(pass) {
- if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) ||
+ if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) ||
(cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0) ||
(cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0) ||
(cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 62) ||
@@ -10899,33 +10946,33 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
if(pass) {
- reset_entries();
+ reset_entries();
}
return;
} /* check_flush_cache__flush_op_eviction_test() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_cache__single_entry()
+ * Function: check_flush_cache__single_entry()
*
- * Purpose: Verify that flush_cache behaves as expected when the cache
- * contains only one element.
+ * Purpose: Verify that flush_cache behaves as expected when the cache
+ * contains only one element.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 1/12/05
*
* Modifications:
*
- * JRM -- 3/29/06
- * Added tests for pinned entries.
+ * JRM -- 3/29/06
+ * Added tests for pinned entries.
*
- * JRM -- 5/17/06
- * Complete reqrite of pinned entry tests to accomodate
- * the new H5C_mark_entry_dirty() call.
+ * JRM -- 5/17/06
+ * Complete reqrite of pinned entry tests to accomodate
+ * the new H5C_mark_entry_dirty() call.
*
*-------------------------------------------------------------------------
*/
@@ -12079,22 +12126,22 @@ check_flush_cache__single_entry(H5F_t * file_ptr)
/* Now run single entry tests for pinned entries. Test all combinations
* of:
*
- * 1) Unpin by unprotect vs. unpin by call to H5C_unpin_entry().
+ * 1) Unpin by unprotect vs. unpin by call to H5C_unpin_entry().
*
- * 2) Marked dirty by unprotect or not.
+ * 2) Marked dirty by unprotect or not.
*
- * 3) Marked dirty by call to H5C_mark_entry_dirty() or not.
+ * 3) Marked dirty by call to H5C_mark_entry_dirty() or not.
*
* 4) Marked dirty by call to H5C_mark_entry_dirty() while protected
* or not.
*
* 5) Marked dirty by call to H5C_mark_entry_dirty() while pinned or not.
*
- * 6) Entry marked for flush or not.
+ * 6) Entry marked for flush or not.
*
- * 7) Call flush with H5C__FLUSH_MARKED_ENTRIES_FLAG or not.
+ * 7) Call flush with H5C__FLUSH_MARKED_ENTRIES_FLAG or not.
*
- * 8) Call flush with H5C__FLUSH_CLEAR_ONLY_FLAG or not.
+ * 8) Call flush with H5C__FLUSH_CLEAR_ONLY_FLAG or not.
*
* This yields a total of 256 tests.
*
@@ -12137,320 +12184,320 @@ check_flush_cache__single_entry(H5F_t * file_ptr)
if(pass) {
- int i;
- struct pinned_single_entry_test_spec
- {
- int test_num;
- int entry_type;
- int entry_idx;
- hbool_t dirty_flag;
- hbool_t mark_dirty;
- hbool_t pop_mark_dirty_prot;
- hbool_t pop_mark_dirty_pinned;
- hbool_t unprotect_unpin;
- unsigned int flags;
- unsigned int flush_flags;
- hbool_t expected_serialized;
- hbool_t expected_destroyed;
- } spec[256] =
- /* pop pop
- * ent unprot mark mark
- * test entry -ry dirty mark dirty dirty unprot flush expect expect
+ int i;
+ struct pinned_single_entry_test_spec
+ {
+ int test_num;
+ int entry_type;
+ int entry_idx;
+ hbool_t dirty_flag;
+ hbool_t mark_dirty;
+ hbool_t pop_mark_dirty_prot;
+ hbool_t pop_mark_dirty_pinned;
+ hbool_t unprotect_unpin;
+ unsigned int flags;
+ unsigned int flush_flags;
+ hbool_t expected_serialized;
+ hbool_t expected_destroyed;
+ } spec[256] =
+ /* pop pop
+ * ent unprot mark mark
+ * test entry -ry dirty mark dirty dirty unprot flush expect expect
* num type idx flag dirty prot pinned unpin flags flags srlzd destroy
- */
- { { 1, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE },
- { 2, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE },
- { 3, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 4, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 5, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 6, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 7, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 8, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 9, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 10, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 11, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 12, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 13, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 14, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 15, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 16, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 17, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 18, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 19, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 20, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 21, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 22, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 23, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 24, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 25, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 26, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 27, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 28, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 29, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 30, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 31, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 32, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 33, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE },
- { 34, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE },
- { 35, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 36, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 37, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 38, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 39, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 40, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 41, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 42, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 43, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 44, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 45, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 46, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 47, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 48, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 49, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 50, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 51, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 52, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 53, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 54, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 55, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 56, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 57, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 58, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 59, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 60, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 61, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 62, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 63, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 64, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
- { 65, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 66, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 67, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 68, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 69, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 70, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 71, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 72, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 73, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 74, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 75, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 76, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 77, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 78, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 79, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 80, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 81, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 82, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 83, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 84, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 85, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 86, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 87, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 88, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 89, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 90, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 91, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 92, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 93, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 94, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 95, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 96, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 97, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 98, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 99, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 100, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 101, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 102, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 103, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 104, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 105, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 106, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 107, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 108, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
- { 109, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 110, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 111, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 112, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 113, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 114, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 115, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 116, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 117, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 118, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 119, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 120, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 121, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 122, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 123, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 124, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 125, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 126, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 127, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 128, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
- { 129, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 130, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 131, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 132, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 133, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 134, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 135, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 136, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 137, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 138, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 139, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 140, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 141, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 142, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 143, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 144, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 145, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 146, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 147, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 148, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 149, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 150, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 151, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 152, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 153, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 154, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 155, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 156, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 157, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 158, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 159, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 160, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 161, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 162, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 163, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 164, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 165, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 166, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 167, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 168, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 169, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 170, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 171, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 172, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 173, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 174, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 175, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 176, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 177, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 178, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 179, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 180, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 181, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 182, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 183, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 184, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 185, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 186, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 187, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 188, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 189, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 190, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 191, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 192, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 193, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 194, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 195, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 196, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 197, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 198, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 199, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 200, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 201, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 202, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 203, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 204, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 205, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 206, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 207, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 208, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 209, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 210, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 211, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 212, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 213, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 214, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 215, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 216, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 217, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 218, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 219, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 220, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 221, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 222, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 223, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 224, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 225, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 226, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 227, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 228, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 229, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 230, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 231, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 232, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 233, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 234, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 235, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 236, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 237, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 238, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 239, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 240, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 241, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 242, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 243, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 244, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 245, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 246, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 247, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 248, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 249, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 250, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 251, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 252, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 253, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 254, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 255, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
- { 256, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE } };
-
- i = 0;
- while(pass && (i < 256))
- {
- check_flush_cache__pinned_single_entry_test
- (
+ */
+ { { 1, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE },
+ { 2, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE },
+ { 3, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 4, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 5, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 6, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 7, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 8, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 9, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 10, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 11, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 12, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 13, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 14, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 15, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 16, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 17, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 18, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 19, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 20, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 21, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 22, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 23, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 24, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 25, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 26, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 27, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 28, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 29, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 30, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 31, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 32, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 33, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE },
+ { 34, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE },
+ { 35, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 36, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 37, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 38, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 39, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 40, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 41, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 42, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 43, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 44, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 45, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 46, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 47, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 48, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 49, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 50, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 51, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 52, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 53, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 54, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 55, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 56, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 57, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 58, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 59, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 60, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 61, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 62, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 63, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 64, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE },
+ { 65, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 66, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 67, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 68, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 69, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 70, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 71, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 72, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 73, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 74, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 75, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 76, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 77, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 78, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 79, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 80, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 81, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 82, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 83, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 84, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 85, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 86, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 87, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 88, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 89, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 90, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 91, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 92, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 93, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 94, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 95, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 96, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 97, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 98, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 99, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 100, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 101, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 102, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 103, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 104, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 105, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 106, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 107, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 108, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE },
+ { 109, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 110, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 111, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 112, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 113, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 114, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 115, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 116, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 117, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 118, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 119, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 120, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 121, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 122, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 123, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 124, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 125, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 126, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 127, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 128, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE },
+ { 129, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 130, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 131, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 132, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 133, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 134, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 135, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 136, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 137, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 138, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 139, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 140, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 141, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 142, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 143, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 144, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 145, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 146, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 147, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 148, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 149, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 150, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 151, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 152, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 153, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 154, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 155, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 156, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 157, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 158, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 159, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 160, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 161, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 162, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 163, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 164, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 165, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 166, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 167, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 168, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 169, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 170, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 171, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 172, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 173, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 174, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 175, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 176, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 177, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 178, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 179, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 180, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 181, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 182, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 183, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 184, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 185, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 186, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 187, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 188, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 189, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 190, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 191, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 192, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 193, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 194, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 195, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 196, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 197, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 198, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 199, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 200, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 201, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 202, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 203, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 204, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 205, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 206, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 207, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 208, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 209, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 210, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 211, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 212, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 213, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 214, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 215, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 216, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 217, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 218, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 219, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 220, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 221, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 222, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 223, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 224, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 225, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 226, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 227, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 228, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 229, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 230, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 231, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 232, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 233, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 234, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 235, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 236, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 237, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 238, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 239, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 240, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 241, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 242, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 243, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 244, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 245, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 246, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 247, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 248, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 249, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 250, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 251, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 252, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 253, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 254, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 255, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE },
+ { 256, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE } };
+
+ i = 0;
+ while(pass && (i < 256))
+ {
+ check_flush_cache__pinned_single_entry_test
+ (
/* file_ptr */ file_ptr,
/* test_num */ spec[i].test_num,
/* entry_type */ spec[i].entry_type,
/* entry_idx */ spec[i].entry_idx,
/* dirty_flag */ spec[i].dirty_flag,
- /* mark_dirty */ spec[i].mark_dirty,
+ /* mark_dirty */ spec[i].mark_dirty,
/* pop_mark_dirty_prot */ spec[i].pop_mark_dirty_prot,
/* pop_mark_dirty_pinned */ spec[i].pop_mark_dirty_pinned,
- /* unprotect_unpin */ spec[i].unprotect_unpin,
+ /* unprotect_unpin */ spec[i].unprotect_unpin,
/* flags */ spec[i].flags,
/* flush_flags */ spec[i].flush_flags,
/* expected_serialized */ spec[i].expected_serialized,
/* expected_destroyed */ spec[i].expected_destroyed
);
- i++;
- }
+ i++;
+ }
}
return;
} /* check_flush_cache__single_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_cache__single_entry_test()
+ * Function: check_flush_cache__single_entry_test()
*
- * Purpose: Run a single entry flush cache test.
+ * Purpose: Run a single entry flush cache test.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 1/12/05
*
* Modifications:
@@ -12472,7 +12519,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr,
{
H5C_t * cache_ptr = file_ptr->shared->cache;
static char msg[128];
- herr_t result;
+ herr_t result;
test_entry_t * base_addr;
test_entry_t * entry_ptr = NULL;
@@ -12612,26 +12659,26 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr,
} /* check_flush_cache__single_entry_test() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_cache__pinned_single_entry_test()
+ * Function: check_flush_cache__pinned_single_entry_test()
*
- * Purpose: Run a pinned single entry flush cache test.
+ * Purpose: Run a pinned single entry flush cache test.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 3/28/06
*
* Modifications:
*
- * JRM -- 5/17/06
- * Added the pop_mark_dirty_prot and pop_mark_dirty_pinned
- * flags and supporting code to allow us to test the
- * H5C_mark_entry_dirty() call. Use the
- * call to mark the entry dirty while the entry is protected
- * if pop_mark_dirty_prot is TRUE, and to mark the entry
- * dirty while it is pinned if pop_mark_dirty_pinned is TRUE.
+ * JRM -- 5/17/06
+ * Added the pop_mark_dirty_prot and pop_mark_dirty_pinned
+ * flags and supporting code to allow us to test the
+ * H5C_mark_entry_dirty() call. Use the
+ * call to mark the entry dirty while the entry is protected
+ * if pop_mark_dirty_prot is TRUE, and to mark the entry
+ * dirty while it is pinned if pop_mark_dirty_pinned is TRUE.
*
*-------------------------------------------------------------------------
*/
@@ -12642,10 +12689,10 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr,
int entry_type,
int entry_idx,
hbool_t unprot_dirty_flag,
- hbool_t mark_dirty,
- hbool_t pop_mark_dirty_prot,
- hbool_t pop_mark_dirty_pinned,
- hbool_t unprotect_unpin,
+ hbool_t mark_dirty,
+ hbool_t pop_mark_dirty_prot,
+ hbool_t pop_mark_dirty_pinned,
+ hbool_t unprotect_unpin,
unsigned int flags,
unsigned int flush_flags,
hbool_t expected_serialized,
@@ -12654,7 +12701,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr,
H5C_t * cache_ptr = file_ptr->shared->cache;
static char msg[128];
hbool_t expected_deserialized = TRUE;
- herr_t result;
+ herr_t result;
test_entry_t * base_addr;
test_entry_t * entry_ptr = NULL;
@@ -12692,24 +12739,24 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr,
protect_entry(file_ptr, entry_type, entry_idx);
- if(pop_mark_dirty_prot) {
+ if(pop_mark_dirty_prot) {
- mark_entry_dirty(entry_type, entry_idx);
- }
+ mark_entry_dirty(entry_type, entry_idx);
+ }
unprotect_entry(file_ptr, entry_type, entry_idx,
(unprot_dirty_flag ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) |
(flags | H5C__PIN_ENTRY_FLAG));
- if(mark_dirty) {
+ if(mark_dirty) {
mark_entry_dirty(entry_type, entry_idx);
- }
+ }
- if(pop_mark_dirty_pinned) {
+ if(pop_mark_dirty_pinned) {
- mark_entry_dirty(entry_type, entry_idx);
- }
+ mark_entry_dirty(entry_type, entry_idx);
+ }
}
if(pass) {
@@ -12820,15 +12867,15 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr,
} /* check_flush_cache__pinned_single_entry_test() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_get_entry_status()
+ * Function: check_get_entry_status()
*
- * Purpose: Verify that H5C_get_entry_status() behaves as expected.
+ * Purpose: Verify that H5C_get_entry_status() behaves as expected.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/28/06
*
* Modifications:
@@ -12841,11 +12888,11 @@ check_get_entry_status(unsigned paged)
{
static char msg[128];
herr_t result;
- hbool_t in_cache;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- size_t entry_size;
+ hbool_t in_cache;
+ hbool_t is_dirty;
+ hbool_t is_protected;
+ hbool_t is_pinned;
+ size_t entry_size;
H5F_t * file_ptr = NULL;
test_entry_t * base_addr = NULL;
test_entry_t * entry_ptr = NULL;
@@ -12886,14 +12933,14 @@ check_get_entry_status(unsigned paged)
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 1.");
failure_mssg = msg;
- } else if(in_cache) {
+ } else if(in_cache) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 1.");
@@ -12914,14 +12961,14 @@ check_get_entry_status(unsigned paged)
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 2.");
failure_mssg = msg;
- } else if(!in_cache || is_dirty || is_protected || is_pinned) {
+ } else if(!in_cache || is_dirty || is_protected || is_pinned) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 2.");
@@ -12940,14 +12987,14 @@ check_get_entry_status(unsigned paged)
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 3.");
failure_mssg = msg;
- } else if(!in_cache || is_dirty || !is_protected || is_pinned) {
+ } else if(!in_cache || is_dirty || !is_protected || is_pinned) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 3.");
@@ -12966,14 +13013,14 @@ check_get_entry_status(unsigned paged)
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 4.");
failure_mssg = msg;
- } else if(!in_cache || is_dirty || is_protected || !is_pinned) {
+ } else if(!in_cache || is_dirty || is_protected || !is_pinned) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 4.");
@@ -12992,14 +13039,14 @@ check_get_entry_status(unsigned paged)
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 5.");
failure_mssg = msg;
- } else if(!in_cache || !is_dirty || is_protected || !is_pinned) {
+ } else if(!in_cache || !is_dirty || is_protected || !is_pinned) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 5.");
@@ -13018,14 +13065,14 @@ check_get_entry_status(unsigned paged)
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 6.");
failure_mssg = msg;
- } else if(!in_cache || !is_dirty || is_protected || is_pinned) {
+ } else if(!in_cache || !is_dirty || is_protected || is_pinned) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 6.");
@@ -13050,15 +13097,15 @@ check_get_entry_status(unsigned paged)
} /* check_get_entry_status() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_expunge_entry()
+ * Function: check_expunge_entry()
*
- * Purpose: Verify that H5C_expunge_entry() behaves as expected.
+ * Purpose: Verify that H5C_expunge_entry() behaves as expected.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 7/5/06
*
* Modifications:
@@ -13072,11 +13119,11 @@ check_expunge_entry(unsigned paged)
{
static char msg[128];
herr_t result;
- hbool_t in_cache;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- size_t entry_size;
+ hbool_t in_cache;
+ hbool_t is_dirty;
+ hbool_t is_protected;
+ hbool_t is_pinned;
+ size_t entry_size;
H5F_t * file_ptr = NULL;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -13106,30 +13153,30 @@ check_expunge_entry(unsigned paged)
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected,
- &is_pinned, NULL, NULL, NULL, NULL);
+ &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 1.");
failure_mssg = msg;
- } else if(in_cache) {
+ } else if(in_cache) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 1.");
failure_mssg = msg;
} else if((entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 1.");
failure_mssg = msg;
- }
+ }
}
/* protect an entry to force the cache to load it, and then unprotect
@@ -13149,28 +13196,28 @@ check_expunge_entry(unsigned paged)
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 2.");
failure_mssg = msg;
- } else if(!in_cache || is_dirty || is_protected || is_pinned) {
+ } else if(!in_cache || is_dirty || is_protected || is_pinned) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 2.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 2.");
failure_mssg = msg;
- }
+ }
}
/* Expunge the entry and then verify that it is no longer in the cache.
@@ -13186,34 +13233,34 @@ check_expunge_entry(unsigned paged)
if(pass) {
/* entry shouldn't be in cache -- only in_cache should be touched
- * by the status call. Thus, only check that boolean.
+ * by the status call. Thus, only check that boolean.
*/
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 3.");
failure_mssg = msg;
- } else if(in_cache) {
+ } else if(in_cache) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 3.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (!entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (!entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 3.");
failure_mssg = msg;
- }
+ }
}
/* now repeat the process with a different entry. On unprotect
@@ -13231,30 +13278,30 @@ check_expunge_entry(unsigned paged)
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected,
- &is_pinned, NULL, NULL, NULL, NULL);
+ &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 4.");
failure_mssg = msg;
- } else if(in_cache) {
+ } else if(in_cache) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 4.");
failure_mssg = msg;
} else if((entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 4.");
failure_mssg = msg;
- }
+ }
}
/* protect the entry to force the cache to load it, and then unprotect
@@ -13273,30 +13320,30 @@ check_expunge_entry(unsigned paged)
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected,
- &is_pinned, NULL, NULL, NULL, NULL);
+ &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 5.");
failure_mssg = msg;
- } else if(!in_cache || !is_dirty || is_protected || is_pinned) {
+ } else if(!in_cache || !is_dirty || is_protected || is_pinned) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 5.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 5.");
failure_mssg = msg;
- }
+ }
}
/* Expunge the entry and then verify that it is no longer in the cache.
@@ -13312,35 +13359,35 @@ check_expunge_entry(unsigned paged)
if(pass) {
/* entry shouldn't be in cache -- only in_cache should be touched
- * by the status call. Thus, only check that boolean.
+ * by the status call. Thus, only check that boolean.
*/
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected,
- &is_pinned, NULL, NULL, NULL, NULL);
+ &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 6.");
failure_mssg = msg;
- } else if(in_cache) {
+ } else if(in_cache) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 6.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (!entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (!entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 6.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
@@ -13360,21 +13407,21 @@ check_expunge_entry(unsigned paged)
} /* check_expunge_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_multiple_read_protect()
+ * Function: check_multiple_read_protect()
*
- * Purpose: Verify that multiple, simultaneous read protects of a
- * single entry perform as expectd.
+ * Purpose: Verify that multiple, simultaneous read protects of a
+ * single entry perform as expectd.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/1/07
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -13427,8 +13474,8 @@ check_multiple_read_protect(unsigned paged)
entry_ptr = &((entries[0])[0]);
if((entry_ptr->header.is_protected) ||
- (entry_ptr->header.is_read_only) ||
- (entry_ptr->header.ro_ref_count != 0)) {
+ (entry_ptr->header.is_read_only) ||
+ (entry_ptr->header.ro_ref_count != 0)) {
pass = FALSE;
failure_mssg = "Unexpected ro protected status 1.\n";
@@ -13437,11 +13484,11 @@ check_multiple_read_protect(unsigned paged)
#if H5C_COLLECT_CACHE_STATS
if((cache_ptr->write_protects[0] != 0) ||
- (cache_ptr->read_protects[0] != 0) ||
- (cache_ptr->max_read_protects[0] != 0)) {
+ (cache_ptr->read_protects[0] != 0) ||
+ (cache_ptr->max_read_protects[0] != 0)) {
- pass = FALSE;
- failure_mssg = "Unexpected protect stats 1.\n";
+ pass = FALSE;
+ failure_mssg = "Unexpected protect stats 1.\n";
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -13450,8 +13497,8 @@ check_multiple_read_protect(unsigned paged)
protect_entry_ro(file_ptr, 0, 0);
if((!(entry_ptr->header.is_protected)) ||
- (!(entry_ptr->header.is_read_only)) ||
- (entry_ptr->header.ro_ref_count != 1)) {
+ (!(entry_ptr->header.is_read_only)) ||
+ (entry_ptr->header.ro_ref_count != 1)) {
pass = FALSE;
failure_mssg = "Unexpected ro protected status 2.\n";
@@ -13460,11 +13507,11 @@ check_multiple_read_protect(unsigned paged)
#if H5C_COLLECT_CACHE_STATS
if((cache_ptr->write_protects[0] != 0) ||
- (cache_ptr->read_protects[0] != 1) ||
- (cache_ptr->max_read_protects[0] != 1)) {
+ (cache_ptr->read_protects[0] != 1) ||
+ (cache_ptr->max_read_protects[0] != 1)) {
- pass = FALSE;
- failure_mssg = "Unexpected protect stats 2.\n";
+ pass = FALSE;
+ failure_mssg = "Unexpected protect stats 2.\n";
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -13473,8 +13520,8 @@ check_multiple_read_protect(unsigned paged)
protect_entry_ro(file_ptr, 0, 0);
if((!(entry_ptr->header.is_protected)) ||
- (!(entry_ptr->header.is_read_only)) ||
- (entry_ptr->header.ro_ref_count != 2)) {
+ (!(entry_ptr->header.is_read_only)) ||
+ (entry_ptr->header.ro_ref_count != 2)) {
pass = FALSE;
failure_mssg = "Unexpected ro protected status 3.\n";
@@ -13483,11 +13530,11 @@ check_multiple_read_protect(unsigned paged)
#if H5C_COLLECT_CACHE_STATS
if((cache_ptr->write_protects[0] != 0) ||
- (cache_ptr->read_protects[0] != 2) ||
- (cache_ptr->max_read_protects[0] != 2)) {
+ (cache_ptr->read_protects[0] != 2) ||
+ (cache_ptr->max_read_protects[0] != 2)) {
- pass = FALSE;
- failure_mssg = "Unexpected protect stats 3.\n";
+ pass = FALSE;
+ failure_mssg = "Unexpected protect stats 3.\n";
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -13496,8 +13543,8 @@ check_multiple_read_protect(unsigned paged)
unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
if((!(entry_ptr->header.is_protected)) ||
- (!(entry_ptr->header.is_read_only)) ||
- (entry_ptr->header.ro_ref_count != 1)) {
+ (!(entry_ptr->header.is_read_only)) ||
+ (entry_ptr->header.ro_ref_count != 1)) {
pass = FALSE;
failure_mssg = "Unexpected ro protected status 4.\n";
@@ -13506,11 +13553,11 @@ check_multiple_read_protect(unsigned paged)
#if H5C_COLLECT_CACHE_STATS
if((cache_ptr->write_protects[0] != 0) ||
- (cache_ptr->read_protects[0] != 2) ||
- (cache_ptr->max_read_protects[0] != 2)) {
+ (cache_ptr->read_protects[0] != 2) ||
+ (cache_ptr->max_read_protects[0] != 2)) {
- pass = FALSE;
- failure_mssg = "Unexpected protect stats 4.\n";
+ pass = FALSE;
+ failure_mssg = "Unexpected protect stats 4.\n";
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -13519,8 +13566,8 @@ check_multiple_read_protect(unsigned paged)
protect_entry_ro(file_ptr, 0, 0);
if((!(entry_ptr->header.is_protected)) ||
- (!(entry_ptr->header.is_read_only)) ||
- (entry_ptr->header.ro_ref_count != 2)) {
+ (!(entry_ptr->header.is_read_only)) ||
+ (entry_ptr->header.ro_ref_count != 2)) {
pass = FALSE;
failure_mssg = "Unexpected ro protected status 5.\n";
@@ -13529,11 +13576,11 @@ check_multiple_read_protect(unsigned paged)
#if H5C_COLLECT_CACHE_STATS
if((cache_ptr->write_protects[0] != 0) ||
- (cache_ptr->read_protects[0] != 3) ||
- (cache_ptr->max_read_protects[0] != 2)) {
+ (cache_ptr->read_protects[0] != 3) ||
+ (cache_ptr->max_read_protects[0] != 2)) {
- pass = FALSE;
- failure_mssg = "Unexpected protect stats 5.\n";
+ pass = FALSE;
+ failure_mssg = "Unexpected protect stats 5.\n";
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -13542,8 +13589,8 @@ check_multiple_read_protect(unsigned paged)
protect_entry_ro(file_ptr, 0, 0);
if((!(entry_ptr->header.is_protected)) ||
- (!(entry_ptr->header.is_read_only)) ||
- (entry_ptr->header.ro_ref_count != 3)) {
+ (!(entry_ptr->header.is_read_only)) ||
+ (entry_ptr->header.ro_ref_count != 3)) {
pass = FALSE;
failure_mssg = "Unexpected ro protected status 6.\n";
@@ -13552,11 +13599,11 @@ check_multiple_read_protect(unsigned paged)
#if H5C_COLLECT_CACHE_STATS
if((cache_ptr->write_protects[0] != 0) ||
- (cache_ptr->read_protects[0] != 4) ||
- (cache_ptr->max_read_protects[0] != 3)) {
+ (cache_ptr->read_protects[0] != 4) ||
+ (cache_ptr->max_read_protects[0] != 3)) {
- pass = FALSE;
- failure_mssg = "Unexpected protect stats 6.\n";
+ pass = FALSE;
+ failure_mssg = "Unexpected protect stats 6.\n";
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -13565,8 +13612,8 @@ check_multiple_read_protect(unsigned paged)
unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
if((!(entry_ptr->header.is_protected)) ||
- (!(entry_ptr->header.is_read_only)) ||
- (entry_ptr->header.ro_ref_count != 2)) {
+ (!(entry_ptr->header.is_read_only)) ||
+ (entry_ptr->header.ro_ref_count != 2)) {
pass = FALSE;
failure_mssg = "Unexpected ro protected status 7.\n";
@@ -13575,11 +13622,11 @@ check_multiple_read_protect(unsigned paged)
#if H5C_COLLECT_CACHE_STATS
if((cache_ptr->write_protects[0] != 0) ||
- (cache_ptr->read_protects[0] != 4) ||
- (cache_ptr->max_read_protects[0] != 3)) {
+ (cache_ptr->read_protects[0] != 4) ||
+ (cache_ptr->max_read_protects[0] != 3)) {
- pass = FALSE;
- failure_mssg = "Unexpected protect stats 7.\n";
+ pass = FALSE;
+ failure_mssg = "Unexpected protect stats 7.\n";
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -13588,8 +13635,8 @@ check_multiple_read_protect(unsigned paged)
unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
if((!(entry_ptr->header.is_protected)) ||
- (!(entry_ptr->header.is_read_only)) ||
- (entry_ptr->header.ro_ref_count != 1)) {
+ (!(entry_ptr->header.is_read_only)) ||
+ (entry_ptr->header.ro_ref_count != 1)) {
pass = FALSE;
failure_mssg = "Unexpected ro protected status 8.\n";
@@ -13598,11 +13645,11 @@ check_multiple_read_protect(unsigned paged)
#if H5C_COLLECT_CACHE_STATS
if((cache_ptr->write_protects[0] != 0) ||
- (cache_ptr->read_protects[0] != 4) ||
- (cache_ptr->max_read_protects[0] != 3)) {
+ (cache_ptr->read_protects[0] != 4) ||
+ (cache_ptr->max_read_protects[0] != 3)) {
- pass = FALSE;
- failure_mssg = "Unexpected protect stats 8.\n";
+ pass = FALSE;
+ failure_mssg = "Unexpected protect stats 8.\n";
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -13611,8 +13658,8 @@ check_multiple_read_protect(unsigned paged)
unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
if((entry_ptr->header.is_protected) ||
- (entry_ptr->header.is_read_only) ||
- (entry_ptr->header.ro_ref_count != 0)) {
+ (entry_ptr->header.is_read_only) ||
+ (entry_ptr->header.ro_ref_count != 0)) {
pass = FALSE;
failure_mssg = "Unexpected ro protected status 9.\n";
@@ -13621,11 +13668,11 @@ check_multiple_read_protect(unsigned paged)
#if H5C_COLLECT_CACHE_STATS
if((cache_ptr->write_protects[0] != 0) ||
- (cache_ptr->read_protects[0] != 4) ||
- (cache_ptr->max_read_protects[0] != 3)) {
+ (cache_ptr->read_protects[0] != 4) ||
+ (cache_ptr->max_read_protects[0] != 3)) {
- pass = FALSE;
- failure_mssg = "Unexpected protect stats 9.\n";
+ pass = FALSE;
+ failure_mssg = "Unexpected protect stats 9.\n";
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -13639,8 +13686,8 @@ check_multiple_read_protect(unsigned paged)
protect_entry(file_ptr, 0, 0);
if((!(entry_ptr->header.is_protected)) ||
- (entry_ptr->header.is_read_only) ||
- (entry_ptr->header.ro_ref_count != 0)) {
+ (entry_ptr->header.is_read_only) ||
+ (entry_ptr->header.ro_ref_count != 0)) {
pass = FALSE;
failure_mssg = "Unexpected ro protected status 10.\n";
@@ -13649,11 +13696,11 @@ check_multiple_read_protect(unsigned paged)
#if H5C_COLLECT_CACHE_STATS
if((cache_ptr->write_protects[0] != 1) ||
- (cache_ptr->read_protects[0] != 4) ||
- (cache_ptr->max_read_protects[0] != 3)) {
+ (cache_ptr->read_protects[0] != 4) ||
+ (cache_ptr->max_read_protects[0] != 3)) {
- pass = FALSE;
- failure_mssg = "Unexpected protect stats 10.\n";
+ pass = FALSE;
+ failure_mssg = "Unexpected protect stats 10.\n";
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -13662,8 +13709,8 @@ check_multiple_read_protect(unsigned paged)
unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
if((entry_ptr->header.is_protected) ||
- (entry_ptr->header.is_read_only) ||
- (entry_ptr->header.ro_ref_count != 0)) {
+ (entry_ptr->header.is_read_only) ||
+ (entry_ptr->header.ro_ref_count != 0)) {
pass = FALSE;
failure_mssg = "Unexpected ro protected status 11.\n";
@@ -13672,11 +13719,11 @@ check_multiple_read_protect(unsigned paged)
#if H5C_COLLECT_CACHE_STATS
if((cache_ptr->write_protects[0] != 1) ||
- (cache_ptr->read_protects[0] != 4) ||
- (cache_ptr->max_read_protects[0] != 3)) {
+ (cache_ptr->read_protects[0] != 4) ||
+ (cache_ptr->max_read_protects[0] != 3)) {
- pass = FALSE;
- failure_mssg = "Unexpected protect stats 11.\n";
+ pass = FALSE;
+ failure_mssg = "Unexpected protect stats 11.\n";
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -13691,80 +13738,80 @@ check_multiple_read_protect(unsigned paged)
if(pass) {
- protect_entry(file_ptr, 0, 2); /* (0,2) write */
+ protect_entry(file_ptr, 0, 2); /* (0,2) write */
protect_entry_ro(file_ptr, 0, 4); /* (0,4) read only (1) */
- protect_entry(file_ptr, 0, 6); /* (0,6) write */
+ protect_entry(file_ptr, 0, 6); /* (0,6) write */
unprotect_entry(file_ptr, 0, 2, /* (0,2) unprotect */
- H5C__NO_FLAGS_SET);
+ H5C__NO_FLAGS_SET);
- protect_entry_ro(file_ptr, 0, 2); /* (0,2) read only (1) */
- protect_entry(file_ptr, 0, 1); /* (0,1) write */
- protect_entry_ro(file_ptr, 0, 4); /* (0,4) read only (2) */
- protect_entry(file_ptr, 0, 0); /* (0,0) write */
- protect_entry_ro(file_ptr, 0, 2); /* (0,2) read only (2) */
+ protect_entry_ro(file_ptr, 0, 2); /* (0,2) read only (1) */
+ protect_entry(file_ptr, 0, 1); /* (0,1) write */
+ protect_entry_ro(file_ptr, 0, 4); /* (0,4) read only (2) */
+ protect_entry(file_ptr, 0, 0); /* (0,0) write */
+ protect_entry_ro(file_ptr, 0, 2); /* (0,2) read only (2) */
unprotect_entry(file_ptr, 0, 2, /* (0,2) read only (1) pin */
- H5C__PIN_ENTRY_FLAG);
+ H5C__PIN_ENTRY_FLAG);
unprotect_entry(file_ptr, 0, 6, /* (0,6) unprotect */
- H5C__NO_FLAGS_SET);
+ H5C__NO_FLAGS_SET);
- protect_entry_ro(file_ptr, 0, 4); /* (0,4) read only (3) */
+ protect_entry_ro(file_ptr, 0, 4); /* (0,4) read only (3) */
unprotect_entry(file_ptr, 0, 2, /* (0,2) unprotect */
- H5C__NO_FLAGS_SET);
+ H5C__NO_FLAGS_SET);
unprotect_entry(file_ptr, 0, 1, /* (0,1) unprotect */
- H5C__NO_FLAGS_SET);
+ H5C__NO_FLAGS_SET);
- if(pass) {
+ if(pass) {
- entry_ptr = &((entries[0])[4]);
+ entry_ptr = &((entries[0])[4]);
- if(H5C_pin_protected_entry((void *)entry_ptr) < 0) {
+ if(H5C_pin_protected_entry((void *)entry_ptr) < 0) {
- pass = FALSE;
- failure_mssg = "H5C_pin_protected_entry() failed.\n";
+ pass = FALSE;
+ failure_mssg = "H5C_pin_protected_entry() failed.\n";
- } else if(!(entry_ptr->header.is_pinned)) {
+ } else if(!(entry_ptr->header.is_pinned)) {
- pass = FALSE;
- failure_mssg = "entry (0,4) not pinned.\n";
+ pass = FALSE;
+ failure_mssg = "entry (0,4) not pinned.\n";
- } else {
+ } else {
- /* keep test bed sanity checks happy */
- entry_ptr->is_pinned = TRUE;
+ /* keep test bed sanity checks happy */
+ entry_ptr->is_pinned = TRUE;
- }
- }
+ }
+ }
unprotect_entry(file_ptr, 0, 4, /* (0,4) read only (2) */
- H5C__NO_FLAGS_SET);
+ H5C__NO_FLAGS_SET);
unprotect_entry(file_ptr, 0, 4, /* (0,4) read only (1) */
- H5C__UNPIN_ENTRY_FLAG);
+ H5C__UNPIN_ENTRY_FLAG);
if(pass && (entry_ptr->header.is_pinned)) {
pass = FALSE;
failure_mssg = "enty (0,4) still pinned.\n";
- }
+ }
unprotect_entry(file_ptr, 0, 4, /* (0,4) unprotect */
- H5C__NO_FLAGS_SET);
+ H5C__NO_FLAGS_SET);
unprotect_entry(file_ptr, 0, 0, /* (0,0) unprotect */
- H5C__NO_FLAGS_SET);
+ H5C__NO_FLAGS_SET);
- unpin_entry(0, 2);
+ unpin_entry(0, 2);
}
#if H5C_COLLECT_CACHE_STATS
if((cache_ptr->write_protects[0] != 5) ||
- (cache_ptr->read_protects[0] != 9) ||
- (cache_ptr->max_read_protects[0] != 3)) {
+ (cache_ptr->read_protects[0] != 9) ||
+ (cache_ptr->max_read_protects[0] != 3)) {
- pass = FALSE;
- failure_mssg = "Unexpected protect stats 11.\n";
+ pass = FALSE;
+ failure_mssg = "Unexpected protect stats 11.\n";
}
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -13786,17 +13833,17 @@ check_multiple_read_protect(unsigned paged)
} /* check_multiple_read_protect() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_move_entry()
+ * Function: check_move_entry()
*
- * Purpose: Verify that H5C_move_entry behaves as expected. In
- * particular, verify that it works correctly with pinned
- * entries.
+ * Purpose: Verify that H5C_move_entry behaves as expected. In
+ * particular, verify that it works correctly with pinned
+ * entries.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/26/06
*
*-------------------------------------------------------------------------
@@ -13812,26 +13859,26 @@ check_move_entry(unsigned paged)
{
/* int entry_type = */ PICO_ENTRY_TYPE,
/* int entry_index = */ 10,
- /* hbool_t is_pinned = */ FALSE,
- /* hbool_t is_protected = */ FALSE
+ /* hbool_t is_pinned = */ FALSE,
+ /* hbool_t is_protected = */ FALSE
},
{
/* int entry_type = */ PICO_ENTRY_TYPE,
/* int entry_index = */ 20,
- /* hbool_t is_pinned = */ TRUE,
- /* hbool_t is_protected = */ FALSE
+ /* hbool_t is_pinned = */ TRUE,
+ /* hbool_t is_protected = */ FALSE
},
{
/* int entry_type = */ PICO_ENTRY_TYPE,
/* int entry_index = */ 30,
- /* hbool_t is_pinned = */ FALSE,
- /* hbool_t is_protected = */ TRUE
+ /* hbool_t is_pinned = */ FALSE,
+ /* hbool_t is_protected = */ TRUE
},
{
/* int entry_type = */ PICO_ENTRY_TYPE,
/* int entry_index = */ 40,
- /* hbool_t is_pinned = */ TRUE,
- /* hbool_t is_protected = */ TRUE
+ /* hbool_t is_pinned = */ TRUE,
+ /* hbool_t is_protected = */ TRUE
},
};
@@ -13878,7 +13925,7 @@ check_move_entry(unsigned paged)
while(pass && (u < NELMTS(test_specs)))
{
check_move_entry__run_test(file_ptr, u, &(test_specs[u]));
- u++;
+ u++;
}
if(pass)
@@ -13896,13 +13943,13 @@ check_move_entry(unsigned paged)
return (unsigned)!pass;
} /* check_move_entry() */
-
+
/*-------------------------------------------------------------------------
* Function: check_move_entry__run_test()
*
* Purpose: Run a move entry test.
*
- * Do nothing if pass is FALSE on entry.
+ * Do nothing if pass is FALSE on entry.
*
* Return: void
*
@@ -13911,7 +13958,7 @@ check_move_entry(unsigned paged)
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -14080,15 +14127,15 @@ check_move_entry__run_test(H5F_t * file_ptr,
} /* check_move_entry__run_test() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_pin_protected_entry()
+ * Function: check_pin_protected_entry()
*
- * Purpose: Verify that H5C_pin_protected_entry behaves as expected.
+ * Purpose: Verify that H5C_pin_protected_entry behaves as expected.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/28/06
*
* Modifications:
@@ -14142,25 +14189,25 @@ check_pin_protected_entry(unsigned paged)
base_addr = entries[0];
entry_ptr = &(base_addr[0]);
- result = H5C_pin_protected_entry((void *)entry_ptr);
+ result = H5C_pin_protected_entry((void *)entry_ptr);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_pin_protected_entry() reports failure.");
failure_mssg = msg;
- } else if(!(entry_ptr->header.is_pinned)) {
+ } else if(!(entry_ptr->header.is_pinned)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "entry not pinned when it should be.");
failure_mssg = msg;
- } else {
+ } else {
- entry_ptr->is_pinned = TRUE;
- }
+ entry_ptr->is_pinned = TRUE;
+ }
}
unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG);
@@ -14182,16 +14229,16 @@ check_pin_protected_entry(unsigned paged)
} /* check_pin_protected_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_resize_entry()
+ * Function: check_resize_entry()
*
- * Purpose: Verify that H5C_resize_entry() and H5C_unprotect() resize
- * entries as expected.
+ * Purpose: Verify that H5C_resize_entry() and H5C_unprotect() resize
+ * entries as expected.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 7/7/06
*
*-------------------------------------------------------------------------
@@ -14202,12 +14249,12 @@ check_resize_entry(unsigned paged)
{
static char msg[128];
herr_t result;
- hbool_t in_cache;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- size_t entry_size;
- size_t reported_entry_size;
+ hbool_t in_cache;
+ hbool_t is_dirty;
+ hbool_t is_protected;
+ hbool_t is_pinned;
+ size_t entry_size;
+ size_t reported_entry_size;
H5F_t * file_ptr = NULL;
H5C_t * cache_ptr = NULL;
test_entry_t * base_addr;
@@ -14262,8 +14309,8 @@ check_resize_entry(unsigned paged)
pass = FALSE;
failure_mssg = "file_ptr NULL from setup_cache.";
- }
- else
+ }
+ else
{
cache_ptr = file_ptr->shared->cache;
@@ -14275,16 +14322,16 @@ check_resize_entry(unsigned paged)
if(pass) {
- if((cache_ptr->index_len != 0) ||
- (cache_ptr->index_size != 0) ||
- (cache_ptr->slist_len != 0) ||
- (cache_ptr->slist_size != 0)) {
+ if((cache_ptr->index_len != 0) ||
+ (cache_ptr->index_size != 0) ||
+ (cache_ptr->slist_len != 0) ||
+ (cache_ptr->slist_size != 0)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 1.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
@@ -14295,48 +14342,48 @@ check_resize_entry(unsigned paged)
if(pass) {
- if((cache_ptr->index_len != 1) ||
- (cache_ptr->index_size != LARGE_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 0) ||
- (cache_ptr->slist_size != 0)) {
+ if((cache_ptr->index_len != 1) ||
+ (cache_ptr->index_size != LARGE_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 0) ||
+ (cache_ptr->slist_size != 0)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 2.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned,
+ &reported_entry_size, &in_cache,
+ &is_dirty, &is_protected, &is_pinned,
NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 1.");
failure_mssg = msg;
- } else if(!in_cache || is_dirty || !is_protected || is_pinned) {
+ } else if(!in_cache || is_dirty || !is_protected || is_pinned) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 1.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 1.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
@@ -14374,48 +14421,48 @@ check_resize_entry(unsigned paged)
if(pass) {
- if((cache_ptr->index_len != 1) ||
- (cache_ptr->index_size != (LARGE_ENTRY_SIZE / 2)) ||
- (cache_ptr->slist_len != 1) ||
- (cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 2))) {
+ if((cache_ptr->index_len != 1) ||
+ (cache_ptr->index_size != (LARGE_ENTRY_SIZE / 2)) ||
+ (cache_ptr->slist_len != 1) ||
+ (cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 2))) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 3.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned,
+ &reported_entry_size, &in_cache,
+ &is_dirty, &is_protected, &is_pinned,
NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 2.");
failure_mssg = msg;
- } else if(!in_cache || !is_dirty || is_protected || is_pinned ||
- (reported_entry_size != (LARGE_ENTRY_SIZE / 2))) {
+ } else if(!in_cache || !is_dirty || is_protected || is_pinned ||
+ (reported_entry_size != (LARGE_ENTRY_SIZE / 2))) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 2.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 2.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
@@ -14459,48 +14506,48 @@ check_resize_entry(unsigned paged)
if(pass) {
- if((cache_ptr->index_len != 1) ||
- (cache_ptr->index_size != LARGE_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 1) ||
- (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) {
+ if((cache_ptr->index_len != 1) ||
+ (cache_ptr->index_size != LARGE_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 1) ||
+ (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 4.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned,
+ &reported_entry_size, &in_cache,
+ &is_dirty, &is_protected, &is_pinned,
NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 3.");
failure_mssg = msg;
- } else if(!in_cache || !is_dirty || is_protected || is_pinned ||
- (reported_entry_size != LARGE_ENTRY_SIZE)) {
+ } else if(!in_cache || !is_dirty || is_protected || is_pinned ||
+ (reported_entry_size != LARGE_ENTRY_SIZE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 3.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 3.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
@@ -14515,120 +14562,120 @@ check_resize_entry(unsigned paged)
result = H5C_resize_entry((void *)entry_ptr, (LARGE_ENTRY_SIZE / 4));
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
- "H5C_resize_entry() reports failure 1.");
+ "H5C_resize_entry() reports failure 1.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
- if((cache_ptr->index_len != 1) ||
- (cache_ptr->index_size != (LARGE_ENTRY_SIZE / 4)) ||
- (cache_ptr->slist_len != 1) ||
- (cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 4))) {
+ if((cache_ptr->index_len != 1) ||
+ (cache_ptr->index_size != (LARGE_ENTRY_SIZE / 4)) ||
+ (cache_ptr->slist_len != 1) ||
+ (cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 4))) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 5.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned,
+ &reported_entry_size, &in_cache,
+ &is_dirty, &is_protected, &is_pinned,
NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 4.");
failure_mssg = msg;
- } else if(!in_cache || !is_dirty || is_protected || !is_pinned ||
- (reported_entry_size != (LARGE_ENTRY_SIZE / 4))) {
+ } else if(!in_cache || !is_dirty || is_protected || !is_pinned ||
+ (reported_entry_size != (LARGE_ENTRY_SIZE / 4))) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 4.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 4.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
result = H5C_resize_entry((void *)entry_ptr, LARGE_ENTRY_SIZE);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
- "H5C_resize_entry() reports failure 2.");
+ "H5C_resize_entry() reports failure 2.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
- if((cache_ptr->index_len != 1) ||
- (cache_ptr->index_size != LARGE_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 1) ||
- (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) {
+ if((cache_ptr->index_len != 1) ||
+ (cache_ptr->index_size != LARGE_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 1) ||
+ (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 6.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned,
+ &reported_entry_size, &in_cache,
+ &is_dirty, &is_protected, &is_pinned,
NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 5.");
failure_mssg = msg;
- } else if(!in_cache || !is_dirty || is_protected || !is_pinned ||
- (reported_entry_size != LARGE_ENTRY_SIZE)) {
+ } else if(!in_cache || !is_dirty || is_protected || !is_pinned ||
+ (reported_entry_size != LARGE_ENTRY_SIZE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 5.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 5.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
@@ -14644,44 +14691,44 @@ check_resize_entry(unsigned paged)
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected,
- &is_pinned, NULL, NULL, NULL, NULL);
+ &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 6.");
failure_mssg = msg;
- } else if(in_cache) {
+ } else if(in_cache) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 6.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (!entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (!entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 6.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
- if((cache_ptr->index_len != 0) ||
- (cache_ptr->index_size != 0) ||
- (cache_ptr->slist_len != 0) ||
- (cache_ptr->slist_size != 0)) {
+ if((cache_ptr->index_len != 0) ||
+ (cache_ptr->index_size != 0) ||
+ (cache_ptr->slist_len != 0) ||
+ (cache_ptr->slist_size != 0)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 7.");
failure_mssg = msg;
- }
+ }
}
@@ -14689,19 +14736,19 @@ check_resize_entry(unsigned paged)
if(pass) {
- if((cache_ptr->index_len != 0) ||
- (cache_ptr->index_size != 0) ||
- (cache_ptr->slist_len != 0) ||
- (cache_ptr->slist_size != 0)) {
+ if((cache_ptr->index_len != 0) ||
+ (cache_ptr->index_size != 0) ||
+ (cache_ptr->slist_len != 0) ||
+ (cache_ptr->slist_size != 0)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 8.");
failure_mssg = msg;
- }
+ }
base_addr = entries[LARGE_ENTRY_TYPE];
entry_ptr = &(base_addr[3]);
- entry_size = LARGE_ENTRY_SIZE;
+ entry_size = LARGE_ENTRY_SIZE;
}
if(pass) {
@@ -14719,17 +14766,17 @@ check_resize_entry(unsigned paged)
if(pass) {
- if((cache_ptr->index_len != 3) ||
- (cache_ptr->index_size != 3 * LARGE_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 1) ||
- (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) {
+ if((cache_ptr->index_len != 3) ||
+ (cache_ptr->index_size != 3 * LARGE_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 1) ||
+ (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 9.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
@@ -14740,48 +14787,48 @@ check_resize_entry(unsigned paged)
if(pass) {
- if((cache_ptr->index_len != 4) ||
- (cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 1) ||
- (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) {
+ if((cache_ptr->index_len != 4) ||
+ (cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 1) ||
+ (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 10.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned,
+ &reported_entry_size, &in_cache,
+ &is_dirty, &is_protected, &is_pinned,
NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 7.");
failure_mssg = msg;
- } else if(!in_cache || is_dirty || !is_protected || is_pinned) {
+ } else if(!in_cache || is_dirty || !is_protected || is_pinned) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 7.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 7.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
@@ -14819,50 +14866,50 @@ check_resize_entry(unsigned paged)
if(pass) {
- if((cache_ptr->index_len != 4) ||
- (cache_ptr->index_size !=
- ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 2))) ||
- (cache_ptr->slist_len != 2) ||
- (cache_ptr->slist_size !=
- (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 2)))) {
+ if((cache_ptr->index_len != 4) ||
+ (cache_ptr->index_size !=
+ ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 2))) ||
+ (cache_ptr->slist_len != 2) ||
+ (cache_ptr->slist_size !=
+ (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 2)))) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 11.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned,
+ &reported_entry_size, &in_cache,
+ &is_dirty, &is_protected, &is_pinned,
NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 8.");
failure_mssg = msg;
- } else if(!in_cache || !is_dirty || is_protected || is_pinned ||
- (reported_entry_size != (LARGE_ENTRY_SIZE / 2))) {
+ } else if(!in_cache || !is_dirty || is_protected || is_pinned ||
+ (reported_entry_size != (LARGE_ENTRY_SIZE / 2))) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 8.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 8.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
@@ -14906,48 +14953,48 @@ check_resize_entry(unsigned paged)
if(pass) {
- if((cache_ptr->index_len != 4) ||
- (cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 2) ||
- (cache_ptr->slist_size != 2 * LARGE_ENTRY_SIZE)) {
+ if((cache_ptr->index_len != 4) ||
+ (cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 2) ||
+ (cache_ptr->slist_size != 2 * LARGE_ENTRY_SIZE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 12.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned,
+ &reported_entry_size, &in_cache,
+ &is_dirty, &is_protected, &is_pinned,
NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 9.");
failure_mssg = msg;
- } else if(!in_cache || !is_dirty || is_protected || is_pinned ||
- (reported_entry_size != LARGE_ENTRY_SIZE)) {
+ } else if(!in_cache || !is_dirty || is_protected || is_pinned ||
+ (reported_entry_size != LARGE_ENTRY_SIZE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 9.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 9.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
@@ -14962,129 +15009,129 @@ check_resize_entry(unsigned paged)
result = H5C_resize_entry((void *)entry_ptr, (LARGE_ENTRY_SIZE / 4));
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
- "H5C_resize_entry() reports failure 3.");
+ "H5C_resize_entry() reports failure 3.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
- if((cache_ptr->index_len != 4) ||
- (cache_ptr->index_size !=
- ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 4))) ||
- (cache_ptr->slist_len != 2) ||
- (cache_ptr->slist_size !=
- (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 4)))) {
+ if((cache_ptr->index_len != 4) ||
+ (cache_ptr->index_size !=
+ ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 4))) ||
+ (cache_ptr->slist_len != 2) ||
+ (cache_ptr->slist_size !=
+ (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 4)))) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 13.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned,
+ &reported_entry_size, &in_cache,
+ &is_dirty, &is_protected, &is_pinned,
NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 10.");
failure_mssg = msg;
- } else if(!in_cache || !is_dirty || is_protected || !is_pinned ||
- (reported_entry_size != (LARGE_ENTRY_SIZE / 4))) {
+ } else if(!in_cache || !is_dirty || is_protected || !is_pinned ||
+ (reported_entry_size != (LARGE_ENTRY_SIZE / 4))) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 10.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 10.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
result = H5C_resize_entry((void *)entry_ptr, LARGE_ENTRY_SIZE);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
- "H5C_resize_entry() reports failure 4.");
+ "H5C_resize_entry() reports failure 4.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
- if((cache_ptr->index_len != 4) ||
- (cache_ptr->index_size != (4 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->slist_len != 2) ||
- (cache_ptr->slist_size != (2 * LARGE_ENTRY_SIZE))) {
+ if((cache_ptr->index_len != 4) ||
+ (cache_ptr->index_size != (4 * LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->slist_len != 2) ||
+ (cache_ptr->slist_size != (2 * LARGE_ENTRY_SIZE))) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 14.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned,
+ &reported_entry_size, &in_cache,
+ &is_dirty, &is_protected, &is_pinned,
NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 11.");
failure_mssg = msg;
- } else if(!in_cache || !is_dirty || is_protected || !is_pinned ||
- (reported_entry_size != LARGE_ENTRY_SIZE)) {
+ } else if(!in_cache || !is_dirty || is_protected || !is_pinned ||
+ (reported_entry_size != LARGE_ENTRY_SIZE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 11.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 11.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3);
- unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3,
+ unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3,
H5C__UNPIN_ENTRY_FLAG | H5C__DELETED_FLAG);
}
@@ -15093,44 +15140,44 @@ check_resize_entry(unsigned paged)
result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size,
&in_cache, &is_dirty, &is_protected,
- &is_pinned, NULL, NULL, NULL, NULL);
+ &is_pinned, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 12.");
failure_mssg = msg;
- } else if(in_cache) {
+ } else if(in_cache) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 12.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (!entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (!entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 12.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
- if((cache_ptr->index_len != 3) ||
- (cache_ptr->index_size != (3 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->slist_len != 1) ||
- (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) {
+ if((cache_ptr->index_len != 3) ||
+ (cache_ptr->index_size != (3 * LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->slist_len != 1) ||
+ (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 15.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
@@ -15148,16 +15195,16 @@ check_resize_entry(unsigned paged)
if(pass) {
- if((cache_ptr->index_len != 0) ||
- (cache_ptr->index_size != 0) ||
- (cache_ptr->slist_len != 0) ||
- (cache_ptr->slist_size != 0)) {
+ if((cache_ptr->index_len != 0) ||
+ (cache_ptr->index_size != 0) ||
+ (cache_ptr->slist_len != 0) ||
+ (cache_ptr->slist_size != 0)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 16.");
failure_mssg = msg;
- }
+ }
}
if(pass) {
@@ -15177,16 +15224,16 @@ check_resize_entry(unsigned paged)
} /* check_resize_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_evictions_enabled()
+ * Function: check_evictions_enabled()
*
- * Purpose: Verify that H5C_get_evictions_enabled() and
- * H5C_set_evictions_enabled() functions perform as expected.
+ * Purpose: Verify that H5C_get_evictions_enabled() and
+ * H5C_set_evictions_enabled() functions perform as expected.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 8/2/07
*
* Modifications:
@@ -15200,11 +15247,11 @@ check_evictions_enabled(unsigned paged)
{
static char msg[128];
herr_t result;
- hbool_t show_progress = FALSE;
- hbool_t evictions_enabled;
- hbool_t in_cache;
- int i;
- int mile_stone = 1;
+ hbool_t show_progress = FALSE;
+ hbool_t evictions_enabled;
+ hbool_t in_cache;
+ int i;
+ int mile_stone = 1;
H5F_t * file_ptr = NULL;
H5C_t * cache_ptr = NULL;
test_entry_t * base_addr = NULL;
@@ -15268,8 +15315,8 @@ check_evictions_enabled(unsigned paged)
pass = FALSE;
failure_mssg = "file_ptr NULL from setup_cache.";
- }
- else
+ }
+ else
{
cache_ptr = file_ptr->shared->cache;
@@ -15284,17 +15331,17 @@ check_evictions_enabled(unsigned paged)
/* verify that it is empty */
if(pass) {
- if((cache_ptr->index_len != 0) ||
- (cache_ptr->index_size != 0) ||
- (cache_ptr->slist_len != 0) ||
- (cache_ptr->slist_size != 0) ||
- (cache_ptr->evictions_enabled != TRUE)) {
+ if((cache_ptr->index_len != 0) ||
+ (cache_ptr->index_size != 0) ||
+ (cache_ptr->slist_len != 0) ||
+ (cache_ptr->slist_size != 0) ||
+ (cache_ptr->evictions_enabled != TRUE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 1.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 3 */
@@ -15306,12 +15353,12 @@ check_evictions_enabled(unsigned paged)
result = H5C_get_evictions_enabled(cache_ptr, &evictions_enabled);
- if((result != SUCCEED) || (evictions_enabled != TRUE)) {
+ if((result != SUCCEED) || (evictions_enabled != TRUE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected evictions enabled 1.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 4 */
@@ -15336,18 +15383,18 @@ check_evictions_enabled(unsigned paged)
/* verify that the cache is full */
if(pass) {
- if((cache_ptr->index_len != 16) ||
- (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 0) ||
- (cache_ptr->slist_size != 0) ||
- (cache_ptr->evictions_enabled != TRUE)) {
+ if((cache_ptr->index_len != 16) ||
+ (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 0) ||
+ (cache_ptr->slist_size != 0) ||
+ (cache_ptr->evictions_enabled != TRUE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 2.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 6 */
@@ -15369,17 +15416,17 @@ check_evictions_enabled(unsigned paged)
/* verify that an entry has been evicted */
if(pass) {
- if((cache_ptr->index_len != 16) ||
- (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 0) ||
- (cache_ptr->slist_size != 0) ||
- (cache_ptr->evictions_enabled != TRUE)) {
+ if((cache_ptr->index_len != 16) ||
+ (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 0) ||
+ (cache_ptr->slist_size != 0) ||
+ (cache_ptr->evictions_enabled != TRUE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 3.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 8 */
@@ -15391,31 +15438,31 @@ check_evictions_enabled(unsigned paged)
entry_ptr = &(base_addr[0]);
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- NULL, &in_cache, NULL, NULL, NULL,
+ NULL, &in_cache, NULL, NULL, NULL,
NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 1.");
failure_mssg = msg;
- } else if(in_cache) {
+ } else if(in_cache) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 1.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (!entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (!entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 1.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 9 */
@@ -15436,17 +15483,17 @@ check_evictions_enabled(unsigned paged)
/* verify that another entry has been evicted */
if(pass) {
- if((cache_ptr->index_len != 16) ||
- (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 1) ||
- (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) ||
- (cache_ptr->evictions_enabled != TRUE)) {
+ if((cache_ptr->index_len != 16) ||
+ (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 1) ||
+ (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->evictions_enabled != TRUE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 4.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 11 */
@@ -15458,30 +15505,30 @@ check_evictions_enabled(unsigned paged)
entry_ptr = &(base_addr[1]);
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 2.");
failure_mssg = msg;
- } else if(in_cache) {
+ } else if(in_cache) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 2.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (!entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (!entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 2.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 12 */
@@ -15493,12 +15540,12 @@ check_evictions_enabled(unsigned paged)
result = H5C_set_evictions_enabled(cache_ptr, FALSE);
- if(result != SUCCEED) {
+ if(result != SUCCEED) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "can't disable evictions 1.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 13 */
@@ -15508,17 +15555,17 @@ check_evictions_enabled(unsigned paged)
/* verify that evictions are disabled */
if(pass) {
- if((cache_ptr->index_len != 16) ||
- (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 1) ||
- (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) ||
- (cache_ptr->evictions_enabled != FALSE)) {
+ if((cache_ptr->index_len != 16) ||
+ (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 1) ||
+ (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->evictions_enabled != FALSE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 5.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 14 */
@@ -15540,17 +15587,17 @@ check_evictions_enabled(unsigned paged)
/* verify that no entry has been evicted */
if(pass) {
- if((cache_ptr->index_len != 17) ||
- (cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 1) ||
- (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) ||
- (cache_ptr->evictions_enabled != FALSE)) {
+ if((cache_ptr->index_len != 17) ||
+ (cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 1) ||
+ (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->evictions_enabled != FALSE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 6.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 16 */
@@ -15571,17 +15618,17 @@ check_evictions_enabled(unsigned paged)
/* verify that no entry has been evicted */
if(pass) {
- if((cache_ptr->index_len != 18) ||
- (cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 2) ||
- (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->evictions_enabled != FALSE)) {
+ if((cache_ptr->index_len != 18) ||
+ (cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 2) ||
+ (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->evictions_enabled != FALSE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 7.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 18 */
@@ -15593,12 +15640,12 @@ check_evictions_enabled(unsigned paged)
result = H5C_set_evictions_enabled(cache_ptr, TRUE);
- if(result != SUCCEED) {
+ if(result != SUCCEED) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "can't enable evictions 1.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 19 */
@@ -15620,17 +15667,17 @@ check_evictions_enabled(unsigned paged)
/* verify that no entries have been evicted */
if(pass) {
- if((cache_ptr->index_len != 18) ||
- (cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 2) ||
- (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->evictions_enabled != TRUE)) {
+ if((cache_ptr->index_len != 18) ||
+ (cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 2) ||
+ (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->evictions_enabled != TRUE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 8.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 21 */
@@ -15655,17 +15702,17 @@ check_evictions_enabled(unsigned paged)
if(pass) {
- if((cache_ptr->index_len != 16) ||
- (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 2) ||
- (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->evictions_enabled != TRUE)) {
+ if((cache_ptr->index_len != 16) ||
+ (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 2) ||
+ (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->evictions_enabled != TRUE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 9.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 23 */
@@ -15677,30 +15724,30 @@ check_evictions_enabled(unsigned paged)
entry_ptr = &(base_addr[2]);
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 3.");
failure_mssg = msg;
- } else if(in_cache) {
+ } else if(in_cache) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 3.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (!entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (!entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 3.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 24 */
@@ -15712,30 +15759,30 @@ check_evictions_enabled(unsigned paged)
entry_ptr = &(base_addr[3]);
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 4.");
failure_mssg = msg;
- } else if(in_cache) {
+ } else if(in_cache) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 4.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- (entry_ptr->serialized) ||
- (!entry_ptr->destroyed)) {
+ (entry_ptr->serialized) ||
+ (!entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 4.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 25 */
@@ -15747,12 +15794,12 @@ check_evictions_enabled(unsigned paged)
result = H5C_set_evictions_enabled(cache_ptr, FALSE);
- if(result != SUCCEED) {
+ if(result != SUCCEED) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "can't disable evictions 2.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 26 */
@@ -15776,17 +15823,17 @@ check_evictions_enabled(unsigned paged)
/* verify that the cache has grown */
if(pass) {
- if((cache_ptr->index_len != 17) ||
- (cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 2) ||
- (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->evictions_enabled != FALSE)) {
+ if((cache_ptr->index_len != 17) ||
+ (cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 2) ||
+ (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->evictions_enabled != FALSE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 10.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 28 */
@@ -15798,12 +15845,12 @@ check_evictions_enabled(unsigned paged)
result = H5C_set_evictions_enabled(cache_ptr, TRUE);
- if(result != SUCCEED) {
+ if(result != SUCCEED) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "can't enable evictions 2.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 29 */
@@ -15824,17 +15871,17 @@ check_evictions_enabled(unsigned paged)
/* verify that the cache has returned to its maximum size */
if(pass) {
- if((cache_ptr->index_len != 16) ||
- (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->slist_len != 3) ||
- (cache_ptr->slist_size != 3 * MONSTER_ENTRY_SIZE) ||
- (cache_ptr->evictions_enabled != TRUE)) {
+ if((cache_ptr->index_len != 16) ||
+ (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->slist_len != 3) ||
+ (cache_ptr->slist_size != 3 * MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->evictions_enabled != TRUE)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected cache status 11.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 31 */
@@ -15846,30 +15893,30 @@ check_evictions_enabled(unsigned paged)
entry_ptr = &(base_addr[4]);
result = H5C_get_entry_status(file_ptr, entry_ptr->addr,
- NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
- if(result < 0) {
+ if(result < 0) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
"H5C_get_entry_status() reports failure 5.");
failure_mssg = msg;
- } else if(in_cache) {
+ } else if(in_cache) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected status 5.");
failure_mssg = msg;
} else if((!entry_ptr->deserialized) ||
- ( entry_ptr->serialized) ||
- (!entry_ptr->destroyed)) {
+ ( entry_ptr->serialized) ||
+ (!entry_ptr->destroyed)) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "Unexpected entry history 5.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 32 */
@@ -15881,12 +15928,12 @@ check_evictions_enabled(unsigned paged)
result = H5C_set_evictions_enabled(cache_ptr, FALSE);
- if(result != SUCCEED) {
+ if(result != SUCCEED) {
pass = FALSE;
HDsnprintf(msg, (size_t)128, "can't disable evictions 3.");
failure_mssg = msg;
- }
+ }
}
if(show_progress) /* 33 */
@@ -15914,16 +15961,16 @@ check_evictions_enabled(unsigned paged)
} /* check_evictions_enabled() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_protected_err()
+ * Function: check_flush_protected_err()
*
- * Purpose: Verify that an attempt to flush the cache when it contains
- * a protected entry will generate an error.
+ * Purpose: Verify that an attempt to flush the cache when it contains
+ * a protected entry will generate an error.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/24/04
*
* Modifications:
@@ -15989,17 +16036,17 @@ check_flush_protected_err(unsigned paged)
} /* check_flush_protected_err() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_destroy_pinned_err()
+ * Function: check_destroy_pinned_err()
*
- * Purpose: Verify that an attempt to destroy the cache when it contains
- * a pinned entry that can't be unpined during the flush destroy
- * will generate an error.
+ * Purpose: Verify that an attempt to destroy the cache when it contains
+ * a pinned entry that can't be unpined during the flush destroy
+ * will generate an error.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/7/06
*
* Modifications:
@@ -16030,7 +16077,7 @@ check_destroy_pinned_err(unsigned paged)
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged);
protect_entry(file_ptr, 0, 0);
- unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG);
+ unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG);
if(H5C_prep_for_file_close(file_ptr) < 0) {
pass = FALSE;
@@ -16041,8 +16088,8 @@ check_destroy_pinned_err(unsigned paged)
pass = FALSE;
failure_mssg = "destroy succeeded on cache with pinned entry.\n";
} /* end if */
- else {
- unpin_entry(0, 0);
+ else {
+ unpin_entry(0, 0);
if(H5C_dest(file_ptr) < 0) {
pass = FALSE;
@@ -16057,11 +16104,11 @@ check_destroy_pinned_err(unsigned paged)
saved_cache = NULL;
} /* end if */
- /* call takedown_cache() with a NULL file_ptr parameter.
- * This causes the function to close and delete the file,
- * while skipping the call to H5C_dest().
- */
- takedown_cache(NULL, FALSE, FALSE);
+ /* call takedown_cache() with a NULL file_ptr parameter.
+ * This causes the function to close and delete the file,
+ * while skipping the call to H5C_dest().
+ */
+ takedown_cache(NULL, FALSE, FALSE);
} /* end if */
if(pass) { PASSED(); } else { H5_FAILED(); }
@@ -16073,16 +16120,16 @@ check_destroy_pinned_err(unsigned paged)
} /* check_destroy_pinned_err() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_destroy_protected_err()
+ * Function: check_destroy_protected_err()
*
- * Purpose: Verify that an attempt to destroy the cache when it contains
- * a protected entry will generate an error.
+ * Purpose: Verify that an attempt to destroy the cache when it contains
+ * a protected entry will generate an error.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/24/04
*
* Modifications:
@@ -16133,27 +16180,27 @@ check_destroy_protected_err(unsigned paged)
pass = FALSE;
failure_mssg = "destroy succeeded on cache with protected entry.\n";
} /* end if */
- else {
+ else {
unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG);
if(H5C_dest(file_ptr) < 0) {
pass = FALSE;
failure_mssg = "destroy failed after unprotect.\n";
} /* end if */
- else {
+ else {
file_ptr->shared->cache = NULL;
- } /* end else */
- } /* end else */
+ } /* end else */
+ } /* end else */
if(saved_cache != NULL) {
file_ptr->shared->cache = saved_cache;
saved_cache = NULL;
} /* end if */
- /* call takedown_cache() with a NULL file_ptr parameter.
- * This causes the function to close and delete the file,
- * while skipping the call to H5C_dest().
- */
- takedown_cache(NULL, FALSE, FALSE);
+ /* call takedown_cache() with a NULL file_ptr parameter.
+ * This causes the function to close and delete the file,
+ * while skipping the call to H5C_dest().
+ */
+ takedown_cache(NULL, FALSE, FALSE);
} /* end if */
if(pass) { PASSED(); } else { H5_FAILED(); }
@@ -16165,16 +16212,16 @@ check_destroy_protected_err(unsigned paged)
} /* check_destroy_protected_err() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_duplicate_insert_err()
+ * Function: check_duplicate_insert_err()
*
- * Purpose: Verify that an attempt to insert and entry that is
- * alread in the cache will generate an error.
+ * Purpose: Verify that an attempt to insert and entry that is
+ * alread in the cache will generate an error.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/24/04
*
* Modifications:
@@ -16245,21 +16292,21 @@ check_duplicate_insert_err(unsigned paged)
} /* check_duplicate_insert_err() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_double_pin_err()
+ * Function: check_double_pin_err()
*
- * Purpose: Verify that an attempt to pin an entry that is already
- * pinned will generate an error.
+ * Purpose: Verify that an attempt to pin an entry that is already
+ * pinned will generate an error.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/24/06
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -16312,8 +16359,8 @@ check_double_pin_err(unsigned paged)
} else {
- unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG);
- }
+ unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG);
+ }
}
if(pass) {
@@ -16333,21 +16380,21 @@ check_double_pin_err(unsigned paged)
} /* check_double_pin_err() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_double_unpin_err()
+ * Function: check_double_unpin_err()
*
- * Purpose: Verify that an attempt to unpin an unpinned entry will
- * generate an error.
+ * Purpose: Verify that an attempt to unpin an unpinned entry will
+ * generate an error.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/24/06
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -16398,13 +16445,13 @@ check_double_unpin_err(unsigned paged)
} else {
- unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
- }
+ unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
+ }
}
if(pass) {
- result = H5C_unpin_entry((void *)entry_ptr);
+ result = H5C_unpin_entry((void *)entry_ptr);
if(result > 0) {
@@ -16432,21 +16479,21 @@ check_double_unpin_err(unsigned paged)
} /* check_double_unpin_err() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_pin_entry_errs()
+ * Function: check_pin_entry_errs()
*
- * Purpose: Verify that invalid calls to H5C_pin_protected_entry()
- * generate errors as expected.
+ * Purpose: Verify that invalid calls to H5C_pin_protected_entry()
+ * generate errors as expected.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/24/06
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -16485,7 +16532,7 @@ check_pin_entry_errs(unsigned paged)
protect_entry(file_ptr, 0, 0);
- unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
+ unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
entry_ptr = &((entries[0])[0]);
}
@@ -16504,10 +16551,10 @@ check_pin_entry_errs(unsigned paged)
protect_entry(file_ptr, 0, 0);
- unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG);
+ unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG);
protect_entry(file_ptr, 0, 0);
- }
+ }
}
if(pass) {
@@ -16522,9 +16569,9 @@ check_pin_entry_errs(unsigned paged)
} else {
- unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG);
+ unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG);
- }
+ }
}
if(pass) {
@@ -16544,16 +16591,16 @@ check_pin_entry_errs(unsigned paged)
} /* check_pin_entry_errs() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_double_protect_err()
+ * Function: check_double_protect_err()
*
- * Purpose: Verify that an attempt to protect an entry that is already
- * protected will generate an error.
+ * Purpose: Verify that an attempt to protect an entry that is already
+ * protected will generate an error.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/24/04
*
*-------------------------------------------------------------------------
@@ -16592,8 +16639,8 @@ check_double_protect_err(unsigned paged)
if(pass) {
cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr,
- types[0], entry_ptr->addr,
- &entry_ptr->addr, H5C__NO_FLAGS_SET);
+ types[0], entry_ptr->addr,
+ &entry_ptr->addr, H5C__NO_FLAGS_SET);
if(cache_entry_ptr != NULL) {
@@ -16624,16 +16671,16 @@ check_double_protect_err(unsigned paged)
} /* check_double_protect_err() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_double_unprotect_err()
+ * Function: check_double_unprotect_err()
*
- * Purpose: Verify that an attempt to unprotect an entry that is already
- * unprotected will generate an error.
+ * Purpose: Verify that an attempt to unprotect an entry that is already
+ * unprotected will generate an error.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/24/04
*
*-------------------------------------------------------------------------
@@ -16701,19 +16748,19 @@ check_double_unprotect_err(unsigned paged)
} /* check_double_unprotect_err() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_mark_entry_dirty_errs()
+ * Function: check_mark_entry_dirty_errs()
*
- * Purpose: Verify that:
+ * Purpose: Verify that:
*
- * 1) a call to H5C_mark_entry_dirty with
- * and unpinned and unprotected entry will generate an
- * error.
+ * 1) a call to H5C_mark_entry_dirty with
+ * and unpinned and unprotected entry will generate an
+ * error.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 5/17/06
*
*-------------------------------------------------------------------------
@@ -16747,14 +16794,14 @@ check_mark_entry_dirty_errs(unsigned paged)
protect_entry(file_ptr, 0, 0);
- unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
+ unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
entry_ptr = &((entries[0])[0]);
}
if(pass) {
- result = H5C_mark_entry_dirty((void *)entry_ptr);
+ result = H5C_mark_entry_dirty((void *)entry_ptr);
if(result > 0) {
@@ -16782,21 +16829,21 @@ check_mark_entry_dirty_errs(unsigned paged)
} /* check_mark_entry_dirty_errs() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_expunge_entry_errs()
+ * Function: check_expunge_entry_errs()
*
- * Purpose: Verify that invalid calls to H5C_expunge_entry()
- * generate errors as expected.
+ * Purpose: Verify that invalid calls to H5C_expunge_entry()
+ * generate errors as expected.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 7/6/06
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -16841,7 +16888,7 @@ check_expunge_entry_errs(unsigned paged)
if(pass) {
- result = H5C_expunge_entry(file_ptr,
+ result = H5C_expunge_entry(file_ptr,
types[0], entry_ptr->addr, H5C__NO_FLAGS_SET);
if(result > 0) {
@@ -16852,14 +16899,14 @@ check_expunge_entry_errs(unsigned paged)
} else {
- unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG);
+ unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG);
- }
+ }
}
if(pass) {
- result = H5C_expunge_entry(file_ptr,
+ result = H5C_expunge_entry(file_ptr,
types[0], entry_ptr->addr, H5C__NO_FLAGS_SET);
if(result > 0) {
@@ -16870,14 +16917,14 @@ check_expunge_entry_errs(unsigned paged)
} else {
- unpin_entry(0, 0);
+ unpin_entry(0, 0);
- }
+ }
}
if(pass) {
- result = H5C_expunge_entry(file_ptr,
+ result = H5C_expunge_entry(file_ptr,
types[0], entry_ptr->addr, H5C__NO_FLAGS_SET);
if(result < 0) {
@@ -16886,7 +16933,7 @@ check_expunge_entry_errs(unsigned paged)
failure_mssg =
"attempt to expunge an unpinned and unprotected entry failed.\n";
- }
+ }
}
@@ -16907,16 +16954,16 @@ check_expunge_entry_errs(unsigned paged)
} /* check_expunge_entry_errs() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_move_entry_errs()
+ * Function: check_move_entry_errs()
*
- * Purpose: Verify that invalid calls to H5C_move_entry()
- * generates errors as expected.
+ * Purpose: Verify that invalid calls to H5C_move_entry()
+ * generates errors as expected.
*
- * Return: void
+ * Return: void
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* 12/10/16
*
*-------------------------------------------------------------------------
@@ -17000,7 +17047,7 @@ check_move_entry_errs(unsigned paged)
} /* end if */
if(pass) {
- result = H5C_move_entry(cache_ptr, types[0], entry_ptr->header.addr, entry_ptr->header.addr + 10);
+ result = H5C_move_entry(cache_ptr, types[0], entry_ptr->header.addr, entry_ptr->header.addr + 10);
if(result >= 0) {
pass = FALSE;
@@ -17024,16 +17071,16 @@ check_move_entry_errs(unsigned paged)
return (unsigned)!pass;
} /* check_move_entry_errs() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_resize_entry_errs()
+ * Function: check_resize_entry_errs()
*
- * Purpose: Verify that invalid calls to H5C_resize_entry()
- * generates errors as expected.
+ * Purpose: Verify that invalid calls to H5C_resize_entry()
+ * generates errors as expected.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 7/7/06
*
*-------------------------------------------------------------------------
@@ -17078,7 +17125,7 @@ check_resize_entry_errs(unsigned paged)
if(pass) {
- result = H5C_resize_entry((void *)entry_ptr, (size_t)1);
+ result = H5C_resize_entry((void *)entry_ptr, (size_t)1);
if(result < 0) {
@@ -17088,14 +17135,14 @@ check_resize_entry_errs(unsigned paged)
} else {
- unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG);
+ unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG);
- }
+ }
}
if(pass) {
- result = H5C_resize_entry((void *)entry_ptr, (size_t)0);
+ result = H5C_resize_entry((void *)entry_ptr, (size_t)0);
if(result >= 0) {
@@ -17105,9 +17152,9 @@ check_resize_entry_errs(unsigned paged)
} else {
- unpin_entry(0, 0);
+ unpin_entry(0, 0);
- }
+ }
}
if(pass) {
@@ -17127,16 +17174,16 @@ check_resize_entry_errs(unsigned paged)
} /* check_resize_entry_errs() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_unprotect_ro_dirty_err()
+ * Function: check_unprotect_ro_dirty_err()
*
- * Purpose: If an entry is protected read only, verify that unprotecting
- * it dirty will generate an error.
+ * Purpose: If an entry is protected read only, verify that unprotecting
+ * it dirty will generate an error.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/3/07
*
*-------------------------------------------------------------------------
@@ -17187,7 +17234,7 @@ check_unprotect_ro_dirty_err(unsigned paged)
if(pass) {
- unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
+ unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
}
@@ -17229,8 +17276,8 @@ check_unprotect_ro_dirty_err(unsigned paged)
if(pass) {
- unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
- unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
+ unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
+ unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
}
@@ -17251,21 +17298,21 @@ check_unprotect_ro_dirty_err(unsigned paged)
} /* check_unprotect_ro_dirty_err() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_protect_ro_rw_err()
+ * Function: check_protect_ro_rw_err()
*
- * Purpose: If an entry is protected read only, verify that protecting
- * it rw will generate an error.
+ * Purpose: If an entry is protected read only, verify that protecting
+ * it rw will generate an error.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/9/07
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -17304,8 +17351,8 @@ check_protect_ro_rw_err(unsigned paged)
if(pass) {
thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr,
- types[0], entry_ptr->addr,
- &entry_ptr->addr, H5C__NO_FLAGS_SET);
+ types[0], entry_ptr->addr,
+ &entry_ptr->addr, H5C__NO_FLAGS_SET);
if(thing_ptr != NULL) {
@@ -17316,7 +17363,7 @@ check_protect_ro_rw_err(unsigned paged)
if(pass) {
- unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
+ unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
}
if(pass) {
@@ -17336,16 +17383,16 @@ check_protect_ro_rw_err(unsigned paged)
} /* check_protect_ro_rw_err() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_protect_retries()
+ * Function: check_protect_retries()
*
- * Purpose: To exercise checksum verification retries for an entry with
- * a speculative load.
+ * Purpose: To exercise checksum verification retries for an entry with
+ * a speculative load.
*
- * Return:
+ * Return:
*
- * Programmer:
+ * Programmer:
*
*-------------------------------------------------------------------------
*/
@@ -17374,8 +17421,8 @@ check_protect_retries(unsigned paged)
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged);
- /* Set up read attempts for verifying checksum */
- file_ptr->shared->read_attempts = 10;
+ /* Set up read attempts for verifying checksum */
+ file_ptr->shared->read_attempts = 10;
file_ptr->shared->retries_nbins = 1;
}
@@ -17385,30 +17432,30 @@ check_protect_retries(unsigned paged)
if(pass) {
- cache_ptr = file_ptr->shared->cache;
- base_addr = entries[type];
+ cache_ptr = file_ptr->shared->cache;
+ base_addr = entries[type];
entry_ptr = &(base_addr[idx]);
- /* test case (1):
- * --actual_len is smaller the initial length from get_load_size()
- * --verify_chksum() returns TRUE after max_verify_ct is reached
- *
- */
- entry_ptr->actual_len = entry_ptr->size/2;
+ /* test case (1):
+ * --actual_len is smaller the initial length from get_load_size()
+ * --verify_chksum() returns TRUE after max_verify_ct is reached
+ *
+ */
+ entry_ptr->actual_len = entry_ptr->size/2;
entry_ptr->max_verify_ct = 3;
entry_ptr->verify_ct = 0;
- cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr,
+ cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr,
types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG);
- if((cache_entry_ptr != (void *)entry_ptr) ||
+ if((cache_entry_ptr != (void *)entry_ptr) ||
(!(entry_ptr->header.is_protected)) ||
(!(entry_ptr->header.is_read_only)) ||
(entry_ptr->header.ro_ref_count <= 0) ||
(entry_ptr->header.type != types[type]) ||
(entry_ptr->size != entry_ptr->header.size) ||
(entry_ptr->addr != entry_ptr->header.addr) ||
- (entry_ptr->verify_ct != entry_ptr->max_verify_ct)) {
+ (entry_ptr->verify_ct != entry_ptr->max_verify_ct)) {
pass = FALSE;
failure_mssg = "error from H5C_protect().";
@@ -17429,26 +17476,26 @@ check_protect_retries(unsigned paged)
}
if(pass)
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, idx, H5C__NO_FLAGS_SET);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, idx, H5C__NO_FLAGS_SET);
if(pass) {
entry_ptr = &(base_addr[++idx]);
- /* test case (2):
- * --actual_len is greater the initial length from get_load_size()
- * --verify_chksum() returns FALSE even after all tries is reached
- * (file_ptr->shared->read_attempts is smaller then max_verify_ct)
- */
- entry_ptr->actual_len = entry_ptr->size*2;
+ /* test case (2):
+ * --actual_len is greater the initial length from get_load_size()
+ * --verify_chksum() returns FALSE even after all tries is reached
+ * (file_ptr->shared->read_attempts is smaller then max_verify_ct)
+ */
+ entry_ptr->actual_len = entry_ptr->size*2;
entry_ptr->max_verify_ct = 11;
entry_ptr->verify_ct = 0;
- cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr,
+ cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr,
types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG);
- /* H5C_protect() should fail after all retries fail */
- if(cache_entry_ptr != NULL)
- pass = FALSE;
+ /* H5C_protect() should fail after all retries fail */
+ if(cache_entry_ptr != NULL)
+ pass = FALSE;
}
@@ -17467,21 +17514,21 @@ check_protect_retries(unsigned paged)
} /* check_protect_retries() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_evictions_enabled_err()
+ * Function: check_evictions_enabled_err()
*
- * Purpose: Verify that H5C_get_evictions_enabled() and
+ * Purpose: Verify that H5C_get_evictions_enabled() and
* H5C_set_evictions_enabled() generate errors as expected.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 8/3/07
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -17524,9 +17571,9 @@ check_check_evictions_enabled_err(unsigned paged)
if(pass) {
- result = H5C_get_evictions_enabled(NULL, &evictions_enabled);
+ result = H5C_get_evictions_enabled(NULL, &evictions_enabled);
- if(result == SUCCEED) {
+ if(result == SUCCEED) {
pass = FALSE;
failure_mssg = "H5C_get_evictions_enabled succeeded() 1.\n";
@@ -17535,9 +17582,9 @@ check_check_evictions_enabled_err(unsigned paged)
if(pass) {
- result = H5C_get_evictions_enabled(cache_ptr, NULL);
+ result = H5C_get_evictions_enabled(cache_ptr, NULL);
- if(result == SUCCEED) {
+ if(result == SUCCEED) {
pass = FALSE;
failure_mssg = "H5C_get_evictions_enabled succeeded() 2.\n";
@@ -17546,30 +17593,30 @@ check_check_evictions_enabled_err(unsigned paged)
if(pass) {
- result = H5C_set_evictions_enabled(cache_ptr, TRUE);
+ result = H5C_set_evictions_enabled(cache_ptr, TRUE);
- if(result != SUCCEED) {
+ if(result != SUCCEED) {
pass = FALSE;
failure_mssg = "H5C_set_evictions_enabled failed().\n";
- }
+ }
}
if(pass) {
(cache_ptr->resize_ctl).incr_mode = H5C_incr__threshold;
- result = H5C_get_evictions_enabled(cache_ptr, FALSE);
+ result = H5C_get_evictions_enabled(cache_ptr, FALSE);
- if(result == SUCCEED) {
+ if(result == SUCCEED) {
pass = FALSE;
failure_mssg = "H5C_get_evictions_enabled succeeded() 1.\n";
} else if(cache_ptr->evictions_enabled == TRUE) {
- }
+ }
(cache_ptr->resize_ctl).incr_mode = H5C_incr__off;
}
@@ -17578,9 +17625,9 @@ check_check_evictions_enabled_err(unsigned paged)
(cache_ptr->resize_ctl).decr_mode = H5C_decr__threshold;
- result = H5C_get_evictions_enabled(cache_ptr, FALSE);
+ result = H5C_get_evictions_enabled(cache_ptr, FALSE);
- if(result == SUCCEED) {
+ if(result == SUCCEED) {
pass = FALSE;
failure_mssg = "H5C_get_evictions_enabled succeeded() 2.\n";
@@ -17607,18 +17654,18 @@ check_check_evictions_enabled_err(unsigned paged)
} /* check_evictions_enabled_err() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_auto_cache_resize()
+ * Function: check_auto_cache_resize()
*
- * Purpose: Exercise the automatic cache resizing functionality.
- * The objective is to operate the auto-resize code in
- * all possible modes. Unfortunately, there are quite
- * a few of them.
+ * Purpose: Exercise the automatic cache resizing functionality.
+ * The objective is to operate the auto-resize code in
+ * all possible modes. Unfortunately, there are quite
+ * a few of them.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 10/29/04
*
*-------------------------------------------------------------------------
@@ -17675,9 +17722,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0f,
+ /* double flash_threshold = */ 0.5f,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
@@ -18045,9 +18092,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1000 * 1000);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -18333,7 +18380,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET);
i++;
}
-
+
if((!rpt_fcn_called) ||
(rpt_status != decrease) ||
@@ -18377,9 +18424,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.apply_max_increment = FALSE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -18558,9 +18605,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -18598,7 +18645,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if(cork_ageout)
- cork_entry_type(file_ptr, MEDIUM_ENTRY_TYPE);
+ cork_entry_type(file_ptr, MEDIUM_ENTRY_TYPE);
/* fill the cache with 1024 byte entries -- nothing should happen
* for three epochs while the markers are inserted into the cache
@@ -18908,7 +18955,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
if(cork_ageout)
- uncork_entry_type(file_ptr, MEDIUM_ENTRY_TYPE);
+ uncork_entry_type(file_ptr, MEDIUM_ENTRY_TYPE);
/* repeat the above test, but with max_decrement enabled to see
@@ -18941,9 +18988,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -19453,9 +19500,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -19857,9 +19904,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -20114,9 +20161,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -20638,7 +20685,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if(pass) {
flush_cache(file_ptr, TRUE, FALSE, FALSE);
- reset_entries();
+ reset_entries();
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -20672,9 +20719,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (32 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space;
- auto_size_ctl.flash_multiple = 1.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space;
+ auto_size_ctl.flash_multiple = 1.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -20702,9 +20749,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if((cache_ptr->max_cache_size != (64 * 1024)) ||
(cache_ptr->min_clean_size != (32 * 1024)) ||
- (cache_ptr->index_len != 0) ||
- (cache_ptr->index_size != 0) ||
- (cache_ptr->cache_accesses != 0)) {
+ (cache_ptr->index_len != 0) ||
+ (cache_ptr->index_size != 0) ||
+ (cache_ptr->cache_accesses != 0)) {
pass = FALSE;
failure_mssg = "Unexpected cache config (0).\n";
@@ -20721,16 +20768,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if(pass)
unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (64 * 1024)) ||
- (cache_ptr->min_clean_size != (32 * 1024)) ||
- (cache_ptr->index_len != 1) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (64 * 1024)) ||
+ (cache_ptr->min_clean_size != (32 * 1024)) ||
+ (cache_ptr->index_len != 1) ||
(cache_ptr->index_size != HUGE_ENTRY_SIZE) ||
- (cache_ptr->cache_accesses != 1)))) {
+ (cache_ptr->cache_accesses != 1)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (1).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -20747,17 +20794,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if(pass)
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (80 * 1024)) ||
- (cache_ptr->min_clean_size != (40 * 1024)) ||
- (cache_ptr->index_len != 2) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (80 * 1024)) ||
+ (cache_ptr->min_clean_size != (40 * 1024)) ||
+ (cache_ptr->index_len != 2) ||
(cache_ptr->index_size != (HUGE_ENTRY_SIZE +
- MONSTER_ENTRY_SIZE)) ||
- (cache_ptr->cache_accesses != 1)))) {
+ MONSTER_ENTRY_SIZE)) ||
+ (cache_ptr->cache_accesses != 1)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (2).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -20773,17 +20820,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (144 * 1024)) ||
- (cache_ptr->min_clean_size != (72 * 1024)) ||
- (cache_ptr->index_len != 3) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (144 * 1024)) ||
+ (cache_ptr->min_clean_size != (72 * 1024)) ||
+ (cache_ptr->index_len != 3) ||
(cache_ptr->index_size != ((2 * MONSTER_ENTRY_SIZE) +
- HUGE_ENTRY_SIZE)) ||
- (cache_ptr->cache_accesses != 1)))) {
+ HUGE_ENTRY_SIZE)) ||
+ (cache_ptr->cache_accesses != 1)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (3).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -20797,16 +20844,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (144 * 1024)) ||
- (cache_ptr->min_clean_size != (72 * 1024)) ||
- (cache_ptr->index_len != 2) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (144 * 1024)) ||
+ (cache_ptr->min_clean_size != (72 * 1024)) ||
+ (cache_ptr->index_len != 2) ||
(cache_ptr->index_size != (2 * MONSTER_ENTRY_SIZE)) ||
- (cache_ptr->cache_accesses != 2)))) {
+ (cache_ptr->cache_accesses != 2)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (4).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -20816,8 +20863,8 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
*/
if(pass) {
- expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 1);
- expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 2);
+ expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 1);
+ expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 2);
if(pass) {
@@ -20825,19 +20872,19 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if(result != SUCCEED) {
pass = FALSE;
failure_mssg = "H5C_set_cache_auto_resize_config failed 13.\n";
- }
+ }
}
- if(pass &&
- (((cache_ptr->max_cache_size != (64 * 1024)) ||
- (cache_ptr->min_clean_size != (32 * 1024)) ||
- (cache_ptr->index_len != 0) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (64 * 1024)) ||
+ (cache_ptr->min_clean_size != (32 * 1024)) ||
+ (cache_ptr->index_len != 0) ||
(cache_ptr->index_size != 0) ||
- (cache_ptr->cache_accesses != 0)))) {
+ (cache_ptr->cache_accesses != 0)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (5).\n";
- }
+ }
}
/* repeat the above basic test, only this time, use inserts to add
@@ -20851,22 +20898,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
insert_entry(file_ptr, HUGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET);
- /* protect and unprotect a couple times to increment cache_accesses */
+ /* protect and unprotect a couple times to increment cache_accesses */
protect_entry(file_ptr, HUGE_ENTRY_TYPE, 1);
unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET);
protect_entry(file_ptr, HUGE_ENTRY_TYPE, 1);
unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (64 * 1024)) ||
- (cache_ptr->min_clean_size != (32 * 1024)) ||
- (cache_ptr->index_len != 1) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (64 * 1024)) ||
+ (cache_ptr->min_clean_size != (32 * 1024)) ||
+ (cache_ptr->index_len != 1) ||
(cache_ptr->index_size != HUGE_ENTRY_SIZE) ||
- (cache_ptr->cache_accesses != 2)))) {
+ (cache_ptr->cache_accesses != 2)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (6).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -20880,17 +20927,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 4, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (80 * 1024)) ||
- (cache_ptr->min_clean_size != (40 * 1024)) ||
- (cache_ptr->index_len != 2) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (80 * 1024)) ||
+ (cache_ptr->min_clean_size != (40 * 1024)) ||
+ (cache_ptr->index_len != 2) ||
(cache_ptr->index_size !=
- HUGE_ENTRY_SIZE + MONSTER_ENTRY_SIZE) ||
- (cache_ptr->cache_accesses != 0)))) {
+ HUGE_ENTRY_SIZE + MONSTER_ENTRY_SIZE) ||
+ (cache_ptr->cache_accesses != 0)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (7).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -20901,17 +20948,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 5, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (144 * 1024)) ||
- (cache_ptr->min_clean_size != (72 * 1024)) ||
- (cache_ptr->index_len != 3) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (144 * 1024)) ||
+ (cache_ptr->min_clean_size != (72 * 1024)) ||
+ (cache_ptr->index_len != 3) ||
(cache_ptr->index_size !=
- 2 * MONSTER_ENTRY_SIZE + HUGE_ENTRY_SIZE) ||
- (cache_ptr->cache_accesses != 0)))) {
+ 2 * MONSTER_ENTRY_SIZE + HUGE_ENTRY_SIZE) ||
+ (cache_ptr->cache_accesses != 0)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (8).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -20925,16 +20972,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 6, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (144 * 1024)) ||
- (cache_ptr->min_clean_size != (72 * 1024)) ||
- (cache_ptr->index_len != 2) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (144 * 1024)) ||
+ (cache_ptr->min_clean_size != (72 * 1024)) ||
+ (cache_ptr->index_len != 2) ||
(cache_ptr->index_size != (2 * MONSTER_ENTRY_SIZE)) ||
- (cache_ptr->cache_accesses != 1)))) {
+ (cache_ptr->cache_accesses != 1)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (9).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -20946,26 +20993,26 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
*/
if(pass) {
- expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 5);
- expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 6);
+ expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 5);
+ expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 6);
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 1024, TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 1024, TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG);
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, 1024, TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, 1024, TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG);
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, 1024, TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, 1024, TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG);
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, 1024, TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, 1024, TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, H5C__DIRTIED_FLAG);
- flush_cache(file_ptr, TRUE, FALSE, FALSE);
+ flush_cache(file_ptr, TRUE, FALSE, FALSE);
if(pass) {
@@ -20977,19 +21024,19 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
pass = FALSE;
failure_mssg = "H5C_set_cache_auto_resize_config failed 13.\n";
- }
+ }
}
- if(pass &&
- (((cache_ptr->max_cache_size != (6 * 1024)) ||
- (cache_ptr->min_clean_size != (3 * 1024)) ||
- (cache_ptr->index_len != 0) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (6 * 1024)) ||
+ (cache_ptr->min_clean_size != (3 * 1024)) ||
+ (cache_ptr->index_len != 0) ||
(cache_ptr->index_size != 0) ||
- (cache_ptr->cache_accesses != 0)))) {
+ (cache_ptr->cache_accesses != 0)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (10).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21009,16 +21056,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13);
unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (6 * 1024)) ||
- (cache_ptr->min_clean_size != (3 * 1024)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (6 * 1024)) ||
+ (cache_ptr->min_clean_size != (3 * 1024)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 4 * 1024) ||
- (cache_ptr->cache_accesses != 4)))) {
+ (cache_ptr->cache_accesses != 4)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (11).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21029,20 +21076,20 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if(pass) {
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (3 * 1024), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (3 * 1024), TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG);
- if(pass &&
- (((cache_ptr->max_cache_size != (6 * 1024)) ||
- (cache_ptr->min_clean_size != (3 * 1024)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (6 * 1024)) ||
+ (cache_ptr->min_clean_size != (3 * 1024)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 6 * 1024) ||
- (cache_ptr->cache_accesses != 5)))) {
+ (cache_ptr->cache_accesses != 5)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (12).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21054,20 +21101,20 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if(pass) {
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (10 * 1024), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (10 * 1024), TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG);
- if(pass &&
- (((cache_ptr->max_cache_size != (13 * 1024)) ||
- (cache_ptr->min_clean_size != (13 * 512)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (13 * 1024)) ||
+ (cache_ptr->min_clean_size != (13 * 512)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 13 * 1024) ||
- (cache_ptr->cache_accesses != 0)))) {
+ (cache_ptr->cache_accesses != 0)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (13).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21078,20 +21125,20 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if(pass) {
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (10 * 1024), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (10 * 1024), TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG);
- if(pass &&
- (((cache_ptr->max_cache_size != (22 * 1024)) ||
- (cache_ptr->min_clean_size != (11 * 1024)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (22 * 1024)) ||
+ (cache_ptr->min_clean_size != (11 * 1024)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 22 * 1024) ||
- (cache_ptr->cache_accesses != 0)))) {
+ (cache_ptr->cache_accesses != 0)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (14).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21102,20 +21149,20 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if(pass) {
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (10 * 1024), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (10 * 1024), TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG);
- if(pass &&
- (((cache_ptr->max_cache_size != (22 * 1024)) ||
- (cache_ptr->min_clean_size != (11 * 1024)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (22 * 1024)) ||
+ (cache_ptr->min_clean_size != (11 * 1024)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 31 * 1024) ||
- (cache_ptr->cache_accesses != 1)))) {
+ (cache_ptr->cache_accesses != 1)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (15).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21127,16 +21174,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if(pass) {
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (1 * 1024), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (1 * 1024), TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG);
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (1 * 1024), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (1 * 1024), TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG);
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (1 * 1024), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (1 * 1024), TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG);
if(pass) {
@@ -21147,19 +21194,19 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
pass = FALSE;
failure_mssg = "H5C_set_cache_auto_resize_config failed 14.\n";
- }
+ }
}
- if(pass &&
- (((cache_ptr->max_cache_size != (6 * 1024)) ||
- (cache_ptr->min_clean_size != (3 * 1024)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (6 * 1024)) ||
+ (cache_ptr->min_clean_size != (3 * 1024)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 4 * 1024) ||
- (cache_ptr->cache_accesses != 0)))) {
+ (cache_ptr->cache_accesses != 0)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (16).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21172,16 +21219,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__PIN_ENTRY_FLAG);
resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024, TRUE);
- if(pass &&
- (((cache_ptr->max_cache_size != (6 * 1024)) ||
- (cache_ptr->min_clean_size != (6 * 512)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (6 * 1024)) ||
+ (cache_ptr->min_clean_size != (6 * 512)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 5 * 1024) ||
- (cache_ptr->cache_accesses != 1)))) {
+ (cache_ptr->cache_accesses != 1)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (17).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21190,16 +21237,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024, TRUE);
- if(pass &&
- (((cache_ptr->max_cache_size != (13 * 1024)) ||
- (cache_ptr->min_clean_size != (13 * 512)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (13 * 1024)) ||
+ (cache_ptr->min_clean_size != (13 * 512)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 13 * 1024) ||
- (cache_ptr->cache_accesses != 0)))) {
+ (cache_ptr->cache_accesses != 0)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (18).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21210,16 +21257,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__PIN_ENTRY_FLAG);
resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024, TRUE);
- if(pass &&
- (((cache_ptr->max_cache_size != (22 * 1024)) ||
- (cache_ptr->min_clean_size != (11 * 1024)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (22 * 1024)) ||
+ (cache_ptr->min_clean_size != (11 * 1024)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 22 * 1024) ||
- (cache_ptr->cache_accesses != 0)))) {
+ (cache_ptr->cache_accesses != 0)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (19).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21230,16 +21277,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__PIN_ENTRY_FLAG);
resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024, TRUE);
- if(pass &&
- (((cache_ptr->max_cache_size != (22 * 1024)) ||
- (cache_ptr->min_clean_size != (11 * 1024)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (22 * 1024)) ||
+ (cache_ptr->min_clean_size != (11 * 1024)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 31 * 1024) ||
- (cache_ptr->cache_accesses != 1)))) {
+ (cache_ptr->cache_accesses != 1)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (20).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21258,16 +21305,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12);
unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__UNPIN_ENTRY_FLAG);
- if(pass &&
- (((cache_ptr->max_cache_size != (22 * 1024)) ||
- (cache_ptr->min_clean_size != (11 * 1024)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (22 * 1024)) ||
+ (cache_ptr->min_clean_size != (11 * 1024)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 31 * 1024) ||
- (cache_ptr->cache_accesses != 4)))) {
+ (cache_ptr->cache_accesses != 4)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (21).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21279,16 +21326,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if(pass) {
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (1 * 1024), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (1 * 1024), TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG);
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (1 * 1024), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (1 * 1024), TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG);
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12);
- resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (1 * 1024), TRUE);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG);
+ resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (1 * 1024), TRUE);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG);
if(pass) {
@@ -21299,19 +21346,19 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
pass = FALSE;
failure_mssg = "H5C_set_cache_auto_resize_config failed 15.\n";
- }
+ }
}
- if(pass &&
- (((cache_ptr->max_cache_size != (6 * 1024)) ||
- (cache_ptr->min_clean_size != (3 * 1024)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (6 * 1024)) ||
+ (cache_ptr->min_clean_size != (3 * 1024)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 4 * 1024) ||
- (cache_ptr->cache_accesses != 0)))) {
+ (cache_ptr->cache_accesses != 0)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (22).\n";
- }
+ }
}
if(pass) {
@@ -21320,16 +21367,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__PIN_ENTRY_FLAG);
resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024, TRUE);
- if(pass &&
- (((cache_ptr->max_cache_size != (6 * 1024)) ||
- (cache_ptr->min_clean_size != (6 * 512)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (6 * 1024)) ||
+ (cache_ptr->min_clean_size != (6 * 512)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 5 * 1024) ||
- (cache_ptr->cache_accesses != 1)))) {
+ (cache_ptr->cache_accesses != 1)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (23).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21338,16 +21385,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024, TRUE);
- if(pass &&
- (((cache_ptr->max_cache_size != (13 * 1024)) ||
- (cache_ptr->min_clean_size != (13 * 512)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (13 * 1024)) ||
+ (cache_ptr->min_clean_size != (13 * 512)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 13 * 1024) ||
- (cache_ptr->cache_accesses != 0)))) {
+ (cache_ptr->cache_accesses != 0)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (24).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21358,16 +21405,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__PIN_ENTRY_FLAG);
resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024, TRUE);
- if(pass &&
- (((cache_ptr->max_cache_size != (22 * 1024)) ||
- (cache_ptr->min_clean_size != (11 * 1024)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (22 * 1024)) ||
+ (cache_ptr->min_clean_size != (11 * 1024)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 22 * 1024) ||
- (cache_ptr->cache_accesses != 0)))) {
+ (cache_ptr->cache_accesses != 0)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (25).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21378,16 +21425,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__PIN_ENTRY_FLAG);
resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024, TRUE);
- if(pass &&
- (((cache_ptr->max_cache_size != (22 * 1024)) ||
- (cache_ptr->min_clean_size != (11 * 1024)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (22 * 1024)) ||
+ (cache_ptr->min_clean_size != (11 * 1024)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 31 * 1024) ||
- (cache_ptr->cache_accesses != 1)))) {
+ (cache_ptr->cache_accesses != 1)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (26).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21406,16 +21453,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12);
unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__UNPIN_ENTRY_FLAG);
- if(pass &&
- (((cache_ptr->max_cache_size != (22 * 1024)) ||
- (cache_ptr->min_clean_size != (11 * 1024)) ||
- (cache_ptr->index_len != 4) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (22 * 1024)) ||
+ (cache_ptr->min_clean_size != (11 * 1024)) ||
+ (cache_ptr->index_len != 4) ||
(cache_ptr->index_size != 31 * 1024) ||
- (cache_ptr->cache_accesses != 4)))) {
+ (cache_ptr->cache_accesses != 4)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (27).\n";
- }
+ }
}
/* We have finished a basic check of the flash cache size increment
@@ -21423,21 +21470,21 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
*/
if(pass) {
- expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10);
- expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11);
- expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12);
- expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13);
+ expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10);
+ expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11);
+ expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12);
+ expunge_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13);
- if(pass &&
- (((cache_ptr->max_cache_size != (22 * 1024)) ||
- (cache_ptr->min_clean_size != (11 * 1024)) ||
- (cache_ptr->index_len != 0) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (22 * 1024)) ||
+ (cache_ptr->min_clean_size != (11 * 1024)) ||
+ (cache_ptr->index_len != 0) ||
(cache_ptr->index_size != 0) ||
- (cache_ptr->cache_accesses != 4)))) {
+ (cache_ptr->cache_accesses != 4)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (28).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21471,9 +21518,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.4f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.4f;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -21503,9 +21550,9 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if((cache_ptr->max_cache_size != (4 * 1024)) ||
(cache_ptr->min_clean_size != (4 * 512)) ||
- (cache_ptr->index_len != 0) ||
- (cache_ptr->index_size != 0) ||
- (cache_ptr->cache_accesses != 0)) {
+ (cache_ptr->index_len != 0) ||
+ (cache_ptr->index_size != 0) ||
+ (cache_ptr->cache_accesses != 0)) {
pass = FALSE;
failure_mssg = "bad cache after initialization 15.\n";
@@ -21524,17 +21571,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (4 * 1024)) ||
- (cache_ptr->min_clean_size != (4 * 512)) ||
- (cache_ptr->index_len != 1) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (4 * 1024)) ||
+ (cache_ptr->min_clean_size != (4 * 512)) ||
+ (cache_ptr->index_len != 1) ||
(cache_ptr->index_size != LARGE_ENTRY_SIZE) ||
- (cache_ptr->cache_accesses != 1) ||
- (rpt_fcn_called == TRUE)))) {
+ (cache_ptr->cache_accesses != 1) ||
+ (rpt_fcn_called == TRUE)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (29).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21550,17 +21597,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (12 * 1024)) ||
- (cache_ptr->min_clean_size != (12 * 512)) ||
- (cache_ptr->index_len != 2) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (12 * 1024)) ||
+ (cache_ptr->min_clean_size != (12 * 512)) ||
+ (cache_ptr->index_len != 2) ||
(cache_ptr->index_size != 2 * LARGE_ENTRY_SIZE) ||
- (cache_ptr->cache_accesses != 1) ||
- (rpt_fcn_called != TRUE)))) {
+ (cache_ptr->cache_accesses != 1) ||
+ (rpt_fcn_called != TRUE)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (30).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21577,17 +21624,17 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (12 * 1024)) ||
- (cache_ptr->min_clean_size != (12 * 512)) ||
- (cache_ptr->index_len != 3) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (12 * 1024)) ||
+ (cache_ptr->min_clean_size != (12 * 512)) ||
+ (cache_ptr->index_len != 3) ||
(cache_ptr->index_size != 3 * LARGE_ENTRY_SIZE) ||
- (cache_ptr->cache_accesses != 3) ||
- (rpt_fcn_called != FALSE)))) {
+ (cache_ptr->cache_accesses != 3) ||
+ (rpt_fcn_called != FALSE)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (31).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21628,19 +21675,19 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0);
unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET);
- if(pass &&
- (((cache_ptr->max_cache_size != (4 * 1024 + 128)) ||
- (cache_ptr->min_clean_size != (2 * 1024 + 64)) ||
- (cache_ptr->index_len != 2) ||
+ if(pass &&
+ (((cache_ptr->max_cache_size != (4 * 1024 + 128)) ||
+ (cache_ptr->min_clean_size != (2 * 1024 + 64)) ||
+ (cache_ptr->index_len != 2) ||
(cache_ptr->index_size !=
- LARGE_ENTRY_SIZE + TINY_ENTRY_SIZE) ||
- (cache_ptr->cache_accesses != 1) ||
- (rpt_fcn_called == FALSE) ||
+ LARGE_ENTRY_SIZE + TINY_ENTRY_SIZE) ||
+ (cache_ptr->cache_accesses != 1) ||
+ (rpt_fcn_called == FALSE) ||
(rpt_status != flash_increase)))) {
pass = FALSE;
failure_mssg = "Unexpected cache config (33).\n";
- }
+ }
}
if(show_progress) HDfprintf(stderr, "check point %d\n", checkpoint++);
@@ -21661,7 +21708,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
if((cache_ptr->max_cache_size != (20 * 1024)) ||
(cache_ptr->min_clean_size != (10 * 1024)) ||
- (rpt_fcn_called == FALSE) ||
+ (rpt_fcn_called == FALSE) ||
(rpt_status != at_max_size)) {
pass = FALSE;
@@ -21692,16 +21739,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
return (unsigned)!pass;
} /* check_auto_cache_resize() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_auto_cache_resize_disable()
+ * Function: check_auto_cache_resize_disable()
*
- * Purpose: Test the various ways in which the resize code can
- * be disabled. Unfortunately, there are quite a few of them.
+ * Purpose: Test the various ways in which the resize code can
+ * be disabled. Unfortunately, there are quite a few of them.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 12/16/04
*
* Modifications:
@@ -21748,7 +21795,7 @@ check_auto_cache_resize_disable(unsigned paged)
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* flash_incr_mode = */ H5C_flash_incr__off,
/* double flash_multiple = */ 1.0f,
/* double flash_threshold = */ 0.25f,
@@ -21793,7 +21840,7 @@ check_auto_cache_resize_disable(unsigned paged)
pass = FALSE;
failure_mssg = "file_ptr NULL from setup_cache.";
- }
+ }
else {
cache_ptr = file_ptr->shared->cache;
@@ -21856,9 +21903,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = FALSE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -22014,9 +22061,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = FALSE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -22171,9 +22218,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = FALSE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -22328,9 +22375,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -22485,9 +22532,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -22641,9 +22688,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__off;
@@ -22799,9 +22846,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -23026,9 +23073,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -23260,9 +23307,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -23498,9 +23545,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -23625,9 +23672,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -23752,9 +23799,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -23879,9 +23926,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -24006,9 +24053,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -24134,9 +24181,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__off;
@@ -24290,9 +24337,9 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 1.0f;
- auto_size_ctl.flash_threshold = 0.25f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 1.0f;
+ auto_size_ctl.flash_threshold = 0.25f;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -24347,16 +24394,16 @@ check_auto_cache_resize_disable(unsigned paged)
(cache_ptr->index_size != LARGE_ENTRY_SIZE) ||
(rpt_fcn_called != FALSE)))) {
- HDfprintf(stdout, "\nmax_cache_size = %ld.\n",
- (long)(cache_ptr->max_cache_size));
- HDfprintf(stdout, "min_clean_size = %ld.\n",
- (long)(cache_ptr->min_clean_size));
- HDfprintf(stdout, "index_len = %ld.\n",
- (long)(cache_ptr->index_len));
- HDfprintf(stdout, "index_size = %ld.\n",
- (long)(cache_ptr->index_size));
- HDfprintf(stdout, "rpt_fcn_called = %ld.\n",
- (long)(rpt_fcn_called));
+ HDfprintf(stdout, "\nmax_cache_size = %ld.\n",
+ (long)(cache_ptr->max_cache_size));
+ HDfprintf(stdout, "min_clean_size = %ld.\n",
+ (long)(cache_ptr->min_clean_size));
+ HDfprintf(stdout, "index_len = %ld.\n",
+ (long)(cache_ptr->index_len));
+ HDfprintf(stdout, "index_size = %ld.\n",
+ (long)(cache_ptr->index_size));
+ HDfprintf(stdout, "rpt_fcn_called = %ld.\n",
+ (long)(rpt_fcn_called));
pass = FALSE;
failure_mssg = "Unexpected cache size change results 46.\n";
@@ -24386,16 +24433,16 @@ check_auto_cache_resize_disable(unsigned paged)
(cache_ptr->index_size != MONSTER_ENTRY_SIZE) ||
(rpt_fcn_called != FALSE)))) {
- HDfprintf(stdout, "\nmax_cache_size = %ld.\n",
- (long)(cache_ptr->max_cache_size));
- HDfprintf(stdout, "min_clean_size = %ld.\n",
- (long)(cache_ptr->min_clean_size));
- HDfprintf(stdout, "index_len = %ld.\n",
- (long)(cache_ptr->index_len));
- HDfprintf(stdout, "index_size = %ld.\n",
- (long)(cache_ptr->index_size));
- HDfprintf(stdout, "rpt_fcn_called = %ld.\n",
- (long)(rpt_fcn_called));
+ HDfprintf(stdout, "\nmax_cache_size = %ld.\n",
+ (long)(cache_ptr->max_cache_size));
+ HDfprintf(stdout, "min_clean_size = %ld.\n",
+ (long)(cache_ptr->min_clean_size));
+ HDfprintf(stdout, "index_len = %ld.\n",
+ (long)(cache_ptr->index_len));
+ HDfprintf(stdout, "index_size = %ld.\n",
+ (long)(cache_ptr->index_size));
+ HDfprintf(stdout, "rpt_fcn_called = %ld.\n",
+ (long)(rpt_fcn_called));
pass = FALSE;
failure_mssg = "Unexpected cache size change results 47.\n";
@@ -24423,16 +24470,16 @@ check_auto_cache_resize_disable(unsigned paged)
} /* check_auto_cache_resize_disable() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_auto_cache_resize_epoch_markers()
+ * Function: check_auto_cache_resize_epoch_markers()
*
- * Purpose: Verify that the auto-resize code manages epoch markers
- * correctly.
+ * Purpose: Verify that the auto-resize code manages epoch markers
+ * correctly.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 12/16/04
*
* Modifications:
@@ -24476,9 +24523,9 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0f,
+ /* double flash_threshold = */ 0.5f,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
@@ -24565,9 +24612,9 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -24739,9 +24786,9 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -24860,9 +24907,9 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -24939,9 +24986,9 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -25052,9 +25099,9 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
- auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0f;
+ auto_size_ctl.flash_threshold = 0.5f;
auto_size_ctl.decr_mode = H5C_decr__off;
@@ -25129,21 +25176,21 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
} /* check_auto_cache_resize_epoch_markers() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_auto_cache_resize_input_errs()
+ * Function: check_auto_cache_resize_input_errs()
*
- * Purpose: Verify that H5C_set_cache_auto_resize_config() detects
- * and rejects invalid input.
+ * Purpose: Verify that H5C_set_cache_auto_resize_config() detects
+ * and rejects invalid input.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 10/29/04
*
* Modifications:
*
- * Added code to verify that errors in the flash cache size
+ * Added code to verify that errors in the flash cache size
* increment related fields are caught as well.
*
* JRM -- 1/17/08
@@ -25183,9 +25230,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0f,
+ /* double flash_threshold = */ 0.5f,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
@@ -25291,9 +25338,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -25366,9 +25413,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -25442,9 +25489,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -25515,9 +25562,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -25590,9 +25637,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -25662,9 +25709,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -25738,9 +25785,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -25810,9 +25857,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -25882,9 +25929,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -25957,9 +26004,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26029,9 +26076,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26096,7 +26143,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode =
- (enum H5C_cache_incr_mode) -1; /* INVALID */
+ (enum H5C_cache_incr_mode) -1; /* INVALID */
invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
@@ -26105,9 +26152,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26169,7 +26216,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode =
- (enum H5C_cache_incr_mode) 2; /* INVALID */
+ (enum H5C_cache_incr_mode) 2; /* INVALID */
invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
@@ -26178,9 +26225,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26253,9 +26300,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26325,9 +26372,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26397,9 +26444,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26472,9 +26519,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26547,10 +26594,10 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode =
- (enum H5C_cache_flash_incr_mode) -1; /* INVALID */
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode =
+ (enum H5C_cache_flash_incr_mode) -1; /* INVALID */
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26622,10 +26669,10 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode =
- H5C_flash_incr__add_space;
- invalid_auto_size_ctl.flash_multiple = 0.09f; /* INVALID */
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode =
+ H5C_flash_incr__add_space;
+ invalid_auto_size_ctl.flash_multiple = 0.09f; /* INVALID */
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26695,10 +26742,10 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode =
- H5C_flash_incr__add_space;
- invalid_auto_size_ctl.flash_multiple = 10.01f; /* INVALID */
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode =
+ H5C_flash_incr__add_space;
+ invalid_auto_size_ctl.flash_multiple = 10.01f; /* INVALID */
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26770,10 +26817,10 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode =
- H5C_flash_incr__add_space;
- invalid_auto_size_ctl.flash_multiple = 1.0f;
- invalid_auto_size_ctl.flash_threshold = 0.09f; /* INVALID */
+ invalid_auto_size_ctl.flash_incr_mode =
+ H5C_flash_incr__add_space;
+ invalid_auto_size_ctl.flash_multiple = 1.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.09f; /* INVALID */
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26843,10 +26890,10 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode =
- H5C_flash_incr__add_space;
- invalid_auto_size_ctl.flash_multiple = 1.0f;
- invalid_auto_size_ctl.flash_threshold = 1.001f; /* INVALID */
+ invalid_auto_size_ctl.flash_incr_mode =
+ H5C_flash_incr__add_space;
+ invalid_auto_size_ctl.flash_multiple = 1.0f;
+ invalid_auto_size_ctl.flash_threshold = 1.001f; /* INVALID */
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -26919,13 +26966,13 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode =
- (enum H5C_cache_decr_mode) -1; /* INVALID */
+ (enum H5C_cache_decr_mode) -1; /* INVALID */
invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
@@ -26992,13 +27039,13 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode =
- (enum H5C_cache_decr_mode) 4; /* INVALID */
+ (enum H5C_cache_decr_mode) 4; /* INVALID */
invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
@@ -27068,9 +27115,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -27140,9 +27187,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -27215,9 +27262,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -27286,9 +27333,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -27361,9 +27408,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -27432,9 +27479,9 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
- invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
+ invalid_auto_size_ctl.flash_multiple = 2.0f;
+ invalid_auto_size_ctl.flash_threshold = 0.5f;
invalid_auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -27538,21 +27585,21 @@ check_auto_cache_resize_input_errs(unsigned paged)
} /* check_auto_cache_resize_input_errs() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_auto_cache_resize_aux_fcns()
+ * Function: check_auto_cache_resize_aux_fcns()
*
- * Purpose: Verify that the auxilary functions associated with
- * the automatic cache resize capability are operating
- * correctly. These functions are:
+ * Purpose: Verify that the auxilary functions associated with
+ * the automatic cache resize capability are operating
+ * correctly. These functions are:
*
- * H5C_get_cache_size()
- * H5C_get_cache_hit_rate()
- * H5C_reset_cache_hit_rate_stats()
+ * H5C_get_cache_size()
+ * H5C_get_cache_hit_rate()
+ * H5C_reset_cache_hit_rate_stats()
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 11/4/04
*
* Modifications:
@@ -27601,9 +27648,9 @@ check_auto_cache_resize_aux_fcns(unsigned paged)
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0f,
+ /* double flash_threshold = */ 0.5f,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off,
@@ -28078,11 +28125,11 @@ check_auto_cache_resize_aux_fcns(unsigned paged)
} /* check_auto_cache_resize_aux_fcns() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_metadata_blizzard_absence()
+ * Function: check_metadata_blizzard_absence()
*
- * Purpose: Test to verify that a 'metadata blizzard' can not occur
+ * Purpose: Test to verify that a 'metadata blizzard' can not occur
* upon insertion into the cache.
*
* A 'metadata blizzard' in this context occurs when the cache
@@ -28096,9 +28143,9 @@ check_auto_cache_resize_aux_fcns(unsigned paged)
* flushing the entire cache is what constitutes a 'metadata
* blizzard'.
*
- * Return: void
+ * Return: void
*
- * Programmer: Mike McGreevy
+ * Programmer: Mike McGreevy
* <mamcgree@hdfgroup.org>
* 12/16/08
*
@@ -28129,158 +28176,158 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
*/
struct expected_entry_status expected[150] =
{
- /* entry entry in at main flush dep flush dep child flush flush flush */
- /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
- { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 4, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 5, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 6, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 7, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 8, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 9, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 10, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 11, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 12, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 13, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 14, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 15, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 16, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 17, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 18, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 19, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 20, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 21, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 22, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 23, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 24, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 25, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 26, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 27, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 28, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 29, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 30, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 31, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 32, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 33, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 34, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 35, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 36, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 37, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 38, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 39, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 40, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 41, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 42, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 43, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 44, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 45, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 46, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 47, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 48, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 49, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 50, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 51, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 52, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 53, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 54, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 55, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 56, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 57, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 58, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 59, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 60, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 61, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 62, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 63, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 64, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 65, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 66, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 67, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 68, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 69, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 70, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 71, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 72, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 73, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 74, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 75, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 76, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 77, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 78, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 79, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 80, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 81, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 82, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 83, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 84, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 85, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 86, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 87, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 88, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 89, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 90, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 91, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 92, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 93, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 94, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 95, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 96, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 97, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 98, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 99, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 100, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 101, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 102, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 103, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 104, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 105, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 106, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 107, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 108, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 109, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 110, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 111, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 112, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 113, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 114, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 115, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 116, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 117, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 118, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 119, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 120, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 121, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 122, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 123, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 124, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 125, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 126, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 127, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 128, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 129, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 130, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 131, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 132, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 133, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 134, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 135, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 136, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 137, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 138, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 139, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 140, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 141, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 142, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 143, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 144, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 145, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 146, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 147, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 148, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 149, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
+ { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 4, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 5, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 6, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 7, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 8, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 9, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 10, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 11, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 12, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 13, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 14, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 15, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 16, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 17, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 18, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 19, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 20, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 21, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 22, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 23, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 24, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 25, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 26, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 27, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 28, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 29, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 30, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 31, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 32, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 33, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 34, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 35, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 36, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 37, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 38, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 39, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 40, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 41, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 42, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 43, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 44, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 45, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 46, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 47, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 48, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 49, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 50, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 51, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 52, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 53, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 54, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 55, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 56, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 57, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 58, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 59, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 60, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 61, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 62, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 63, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 64, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 65, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 66, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 67, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 68, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 69, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 70, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 71, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 72, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 73, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 74, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 75, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 76, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 77, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 78, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 79, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 80, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 81, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 82, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 83, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 84, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 85, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 86, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 87, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 88, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 89, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 90, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 91, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 92, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 93, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 94, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 95, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 96, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 97, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 98, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 99, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 100, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 101, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 102, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 103, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 104, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 105, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 106, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 107, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 108, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 109, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 110, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 111, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 112, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 113, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 114, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 115, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 116, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 117, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 118, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 119, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 120, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 121, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 122, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 123, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 124, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 125, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 126, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 127, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 128, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 129, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 130, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 131, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 132, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 133, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 134, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 135, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 136, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 137, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 138, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 139, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 140, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 141, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 142, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 143, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 144, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 145, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 146, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 147, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 148, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 149, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}
};
pass = TRUE;
@@ -28441,13 +28488,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
*/
/* entry w/ index 0 has now been flushed and is now clean. */
- expected[0].is_dirty = FALSE;
- expected[0].serialized = TRUE;
+ expected[0].is_dirty = FALSE;
+ expected[0].serialized = TRUE;
/* entry w/ index 26 is now in the cache and dirty. */
- expected[26].in_cache = TRUE;
- expected[26].is_dirty = TRUE;
- expected[26].deserialized = (unsigned char)deserialized;
+ expected[26].in_cache = TRUE;
+ expected[26].is_dirty = TRUE;
+ expected[26].deserialized = (unsigned char)deserialized;
/* verify the status */
verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
@@ -28495,13 +28542,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
*/
/* entry w/ index 1 has now been flushed and is now clean. */
- expected[1].is_dirty = FALSE;
- expected[1].serialized = TRUE;
+ expected[1].is_dirty = FALSE;
+ expected[1].serialized = TRUE;
/* entry w/ index 27 is now in the cache and dirty. */
- expected[27].in_cache = TRUE;
- expected[27].is_dirty = TRUE;
- expected[27].deserialized = (unsigned char)deserialized;
+ expected[27].in_cache = TRUE;
+ expected[27].is_dirty = TRUE;
+ expected[27].deserialized = (unsigned char)deserialized;
/* verify the status */
verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
@@ -28544,9 +28591,9 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
expected[entry_idx - 26].is_dirty = FALSE;
expected[entry_idx - 26].serialized = TRUE;
- expected[entry_idx].in_cache = TRUE;
- expected[entry_idx].is_dirty = TRUE;
- expected[entry_idx].deserialized = (unsigned char)deserialized;
+ expected[entry_idx].in_cache = TRUE;
+ expected[entry_idx].is_dirty = TRUE;
+ expected[entry_idx].deserialized = (unsigned char)deserialized;
/* verify the status */
verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
@@ -28617,19 +28664,19 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
*/
/* entry w/ index 0 has been evicted. */
- expected[0].in_cache = FALSE;
- expected[0].destroyed = TRUE;
+ expected[0].in_cache = FALSE;
+ expected[0].destroyed = TRUE;
/* entries w/ indices 24,25 have now been flushed and are clean. */
- expected[24].is_dirty = FALSE;
- expected[24].serialized = TRUE;
- expected[25].is_dirty = FALSE;
- expected[25].serialized = TRUE;
+ expected[24].is_dirty = FALSE;
+ expected[24].serialized = TRUE;
+ expected[25].is_dirty = FALSE;
+ expected[25].serialized = TRUE;
/* entry w/ index 50 is now in the cache and dirty */
- expected[50].in_cache = TRUE;
- expected[50].is_dirty = TRUE;
- expected[50].deserialized = (unsigned char)deserialized;
+ expected[50].in_cache = TRUE;
+ expected[50].is_dirty = TRUE;
+ expected[50].deserialized = (unsigned char)deserialized;
/* verify the status */
verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
@@ -28672,13 +28719,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
/* This past inserted entry is now in the cache and dirty */
- expected[entry_idx].in_cache = TRUE;
- expected[entry_idx].is_dirty = TRUE;
- expected[entry_idx].deserialized = (unsigned char)deserialized;
+ expected[entry_idx].in_cache = TRUE;
+ expected[entry_idx].is_dirty = TRUE;
+ expected[entry_idx].deserialized = (unsigned char)deserialized;
/* The entry inserted 50 insertions ago has been evicted */
- expected[entry_idx - 50].in_cache = FALSE;
- expected[entry_idx - 50].destroyed = TRUE;
+ expected[entry_idx - 50].in_cache = FALSE;
+ expected[entry_idx - 50].destroyed = TRUE;
/* If the newly inserted entry is among the first 24
* insertions in this loop, then the insertion will
@@ -28803,13 +28850,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
/* This past inserted entry is now in the cache and dirty */
- expected[entry_idx].in_cache = TRUE;
- expected[entry_idx].is_dirty = TRUE;
- expected[entry_idx].deserialized = (unsigned char)deserialized;
+ expected[entry_idx].in_cache = TRUE;
+ expected[entry_idx].is_dirty = TRUE;
+ expected[entry_idx].deserialized = (unsigned char)deserialized;
/* The entry with ID minus 50 will have been evicted */
- expected[entry_idx - 50].in_cache = FALSE;
- expected[entry_idx - 50].destroyed = TRUE;
+ expected[entry_idx - 50].in_cache = FALSE;
+ expected[entry_idx - 50].destroyed = TRUE;
/* verify the status */
verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
@@ -28851,17 +28898,17 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
*/
/* entry w/ index 76 has been evicted. */
- expected[76].in_cache = FALSE;
- expected[76].destroyed = TRUE;
+ expected[76].in_cache = FALSE;
+ expected[76].destroyed = TRUE;
/* entry w/ index 100 has now been flushed and is now clean. */
- expected[100].is_dirty = FALSE;
- expected[100].serialized = TRUE;
+ expected[100].is_dirty = FALSE;
+ expected[100].serialized = TRUE;
/* entry w/ index 26 is now in the cache and dirty. */
- expected[126].in_cache = TRUE;
- expected[126].is_dirty = TRUE;
- expected[126].deserialized = (unsigned char)deserialized;
+ expected[126].in_cache = TRUE;
+ expected[126].is_dirty = TRUE;
+ expected[126].deserialized = (unsigned char)deserialized;
/* verify the status */
verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
@@ -28897,13 +28944,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
/* This past inserted entry is now in the cache and dirty */
- expected[entry_idx].in_cache = TRUE;
- expected[entry_idx].is_dirty = TRUE;
- expected[entry_idx].deserialized = (unsigned char)deserialized;
+ expected[entry_idx].in_cache = TRUE;
+ expected[entry_idx].is_dirty = TRUE;
+ expected[entry_idx].deserialized = (unsigned char)deserialized;
/* The entry with ID minus 50 will have been evicted */
- expected[entry_idx - 50].in_cache = FALSE;
- expected[entry_idx - 50].destroyed = TRUE;
+ expected[entry_idx - 50].in_cache = FALSE;
+ expected[entry_idx - 50].destroyed = TRUE;
/* The entry with ID minus 26 will now be clean */
expected[entry_idx - 26].is_dirty = FALSE;
@@ -28939,15 +28986,15 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
} /* check_metadata_blizzard_absence() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_deps()
+ * Function: check_flush_deps()
*
- * Purpose: Exercise the flush dependency routines.
+ * Purpose: Exercise the flush dependency routines.
*
- * Return: 0 on success, non-zero on failure
+ * Return: 0 on success, non-zero on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* 3/12/09
*
*-------------------------------------------------------------------------
@@ -28963,13 +29010,13 @@ check_flush_deps(unsigned paged)
unsigned u; /* Local index variable */
struct expected_entry_status expected[5] =
{
- /* entry entry in at main flush dep flush dep child flush flush flush */
- /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
- { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
+ { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}
};
if(paged)
@@ -29020,16 +29067,16 @@ check_flush_deps(unsigned paged)
if(!pass) CACHE_ERROR("protect_entry failed")
/* Check the parent's entry status */
- entry_ptr = &(base_addr[1]);
- if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache,
+ entry_ptr = &(base_addr[1]);
+ if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache,
NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child, NULL) < 0)
CACHE_ERROR("H5C_get_entry_status() failed")
if(!in_cache || is_flush_dep_parent || is_flush_dep_child)
CACHE_ERROR("invalid entry status")
/* Check the child's entry status */
- entry_ptr = &(base_addr[0]);
- if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache,
+ entry_ptr = &(base_addr[0]);
+ if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache,
NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child, NULL) < 0)
CACHE_ERROR("H5C_get_entry_status() failed")
if(!in_cache || is_flush_dep_parent || is_flush_dep_child)
@@ -29039,16 +29086,16 @@ check_flush_deps(unsigned paged)
if(!pass) CACHE_ERROR("create_flush_dependency failed")
/* Check the parent's entry status */
- entry_ptr = &(base_addr[1]);
- if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache,
+ entry_ptr = &(base_addr[1]);
+ if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache,
NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child, NULL) < 0)
CACHE_ERROR("H5C_get_entry_status() failed")
if(!in_cache || !is_flush_dep_parent || is_flush_dep_child)
CACHE_ERROR("invalid entry status")
/* Check the child's entry status */
- entry_ptr = &(base_addr[0]);
- if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache,
+ entry_ptr = &(base_addr[0]);
+ if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache,
NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child, NULL) < 0)
CACHE_ERROR("H5C_get_entry_status() failed")
if(!in_cache || is_flush_dep_parent || !is_flush_dep_child)
@@ -30678,15 +30725,15 @@ done:
return (unsigned)!pass;
} /* check_flush_deps() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_deps_err()
+ * Function: check_flush_deps_err()
*
- * Purpose: Check the flush dependency routines for error conditions.
+ * Purpose: Check the flush dependency routines for error conditions.
*
- * Return: 0 on success, non-zero on failure
+ * Return: 0 on success, non-zero on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* 3/16/09
*
*-------------------------------------------------------------------------
@@ -30901,16 +30948,16 @@ done:
return (unsigned)!pass;
} /* check_flush_deps_err() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_flush_deps_order()
+ * Function: check_flush_deps_order()
*
- * Purpose: Verify that the order that entries with flush dependencies
+ * Purpose: Verify that the order that entries with flush dependencies
* is correct
*
- * Return: 0 on success, non-zero on failure
+ * Return: 0 on success, non-zero on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* 3/17/09
*
*-------------------------------------------------------------------------
@@ -30925,13 +30972,13 @@ check_flush_deps_order(unsigned paged)
unsigned u; /* Local index variable */
struct expected_entry_status expected[5] =
{
- /* entry entry in at main flush dep flush dep child flush flush flush */
- /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
- { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
+ { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}
};
unsigned flush_order; /* Index for tracking flush order */
@@ -33473,15 +33520,15 @@ done:
return (unsigned)!pass;
} /* check_flush_deps_order() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_notify_cb()
+ * Function: check_notify_cb()
*
- * Purpose: Exercise the client 'notify' callback.
+ * Purpose: Exercise the client 'notify' callback.
*
- * Return: 0 on success, non-zero on failure
+ * Return: 0 on success, non-zero on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* 4/28/09
*
*-------------------------------------------------------------------------
@@ -33498,13 +33545,13 @@ check_notify_cb(unsigned paged)
unsigned u; /* Local index variable */
struct expected_entry_status expected[5] =
{
- /* entry entry in at main flush dep flush dep child flush flush flush */
- /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
- { NOTIFY_ENTRY_TYPE, 0, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { NOTIFY_ENTRY_TYPE, 1, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { NOTIFY_ENTRY_TYPE, 2, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { NOTIFY_ENTRY_TYPE, 3, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { NOTIFY_ENTRY_TYPE, 4, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
+ { NOTIFY_ENTRY_TYPE, 0, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { NOTIFY_ENTRY_TYPE, 1, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { NOTIFY_ENTRY_TYPE, 2, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { NOTIFY_ENTRY_TYPE, 3, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { NOTIFY_ENTRY_TYPE, 4, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}
};
if(paged)
@@ -33545,7 +33592,7 @@ check_notify_cb(unsigned paged)
if(!pass) CACHE_ERROR("verify_entry_status failed")
/* Check the entry's 'after insert' count */
- entry_ptr = &(base_addr[u]);
+ entry_ptr = &(base_addr[u]);
if(1 != entry_ptr->notify_after_insert_count)
CACHE_ERROR("invalid notify after insert count")
if(0 != entry_ptr->notify_before_evict_count)
@@ -33573,7 +33620,7 @@ check_notify_cb(unsigned paged)
if(!pass) CACHE_ERROR("verify_entry_status failed")
/* Check the entry's 'before evict' count */
- entry_ptr = &(base_addr[u]);
+ entry_ptr = &(base_addr[u]);
if(1 != entry_ptr->notify_after_insert_count)
CACHE_ERROR("invalid notify after insert count")
if(1 != entry_ptr->notify_before_evict_count)
@@ -33601,7 +33648,7 @@ check_notify_cb(unsigned paged)
if(!pass) CACHE_ERROR("verify_entry_status failed")
/* Check the entry's 'after insert' count */
- entry_ptr = &(base_addr[u]);
+ entry_ptr = &(base_addr[u]);
if(2 != entry_ptr->notify_after_insert_count)
CACHE_ERROR("invalid notify after insert count")
if(1 != entry_ptr->notify_before_evict_count)
@@ -33628,7 +33675,7 @@ check_notify_cb(unsigned paged)
if(!pass) CACHE_ERROR("verify_entry_status failed")
/* Check the entry's 'after insert' count */
- entry_ptr = &(base_addr[u]);
+ entry_ptr = &(base_addr[u]);
if(2 != entry_ptr->notify_after_insert_count)
CACHE_ERROR("invalid notify after insert count")
if(1 != entry_ptr->notify_before_evict_count)
@@ -33656,7 +33703,7 @@ check_notify_cb(unsigned paged)
if(!pass) CACHE_ERROR("verify_entry_status failed")
/* Check the entry's 'before evict' count */
- entry_ptr = &(base_addr[u]);
+ entry_ptr = &(base_addr[u]);
if(2 != entry_ptr->notify_after_insert_count)
CACHE_ERROR("invalid notify after insert count")
if(2 != entry_ptr->notify_before_evict_count)
@@ -33676,18 +33723,18 @@ done:
return (unsigned)!pass;
} /* check_notify_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_metadata_cork
+ * Function: check_metadata_cork
*
- * Purpose: To verify that dirty corked entries are not evicted from the cache
- * but clean corked entries can be evicted from the cache.
- * The min_clean_size does not have effect.
- * NOTE: This is a modification of check_metadata_blizzard_absence().
+ * Purpose: To verify that dirty corked entries are not evicted from the cache
+ * but clean corked entries can be evicted from the cache.
+ * The min_clean_size does not have effect.
+ * NOTE: This is a modification of check_metadata_blizzard_absence().
*
- * Return: void
+ * Return: void
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
*
*-------------------------------------------------------------------------
*/
@@ -33714,158 +33761,158 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
*/
struct expected_entry_status expected[150] =
{
- /* entry entry in at main flush dep flush dep child flush flush flush */
- /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
- { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 4, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 5, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 6, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 7, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 8, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 9, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 10, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 11, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 12, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 13, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 14, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 15, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 16, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 17, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 18, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 19, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 20, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 21, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 22, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 23, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 24, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 25, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 26, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 27, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 28, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 29, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 30, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 31, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 32, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 33, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 34, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 35, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 36, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 37, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 38, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 39, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 40, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 41, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 42, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 43, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 44, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 45, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 46, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 47, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 48, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 49, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 50, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 51, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 52, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 53, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 54, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 55, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 56, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 57, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 58, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 59, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 60, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 61, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 62, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 63, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 64, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 65, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 66, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 67, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 68, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 69, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 70, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 71, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 72, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 73, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 74, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 75, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 76, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 77, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 78, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 79, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 80, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 81, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 82, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 83, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 84, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 85, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 86, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 87, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 88, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 89, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 90, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 91, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 92, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 93, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 94, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 95, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 96, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 97, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 98, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 99, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 100, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 101, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 102, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 103, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 104, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 105, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 106, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 107, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 108, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 109, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 110, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 111, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 112, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 113, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 114, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 115, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 116, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 117, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 118, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 119, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 120, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 121, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 122, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 123, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 124, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 125, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 126, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 127, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 128, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 129, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 130, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 131, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 132, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 133, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 134, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 135, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 136, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 137, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 138, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 139, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 140, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 141, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 142, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 143, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 144, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 145, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 146, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 147, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 148, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 149, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
+ { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 4, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 5, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 6, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 7, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 8, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 9, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 10, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 11, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 12, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 13, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 14, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 15, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 16, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 17, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 18, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 19, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 20, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 21, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 22, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 23, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 24, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 25, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 26, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 27, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 28, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 29, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 30, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 31, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 32, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 33, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 34, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 35, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 36, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 37, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 38, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 39, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 40, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 41, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 42, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 43, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 44, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 45, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 46, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 47, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 48, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 49, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 50, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 51, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 52, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 53, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 54, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 55, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 56, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 57, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 58, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 59, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 60, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 61, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 62, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 63, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 64, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 65, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 66, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 67, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 68, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 69, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 70, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 71, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 72, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 73, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 74, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 75, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 76, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 77, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 78, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 79, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 80, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 81, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 82, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 83, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 84, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 85, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 86, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 87, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 88, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 89, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 90, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 91, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 92, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 93, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 94, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 95, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 96, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 97, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 98, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 99, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 100, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 101, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 102, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 103, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 104, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 105, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 106, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 107, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 108, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 109, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 110, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 111, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 112, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 113, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 114, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 115, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 116, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 117, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 118, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 119, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 120, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 121, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 122, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 123, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 124, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 125, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 126, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 127, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 128, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 129, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 130, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 131, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 132, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 133, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 134, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 135, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 136, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 137, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 138, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 139, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 140, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 141, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 142, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 143, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 144, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 145, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 146, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 147, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 148, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 149, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}
} ;
pass = TRUE;
@@ -33912,9 +33959,9 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
* Phase 1:
*
* Inserting dirty corked entries into an empty cache, until the cache
- * violates the min_clean_size requirement.
- * Since entries are all dirty and corked, no entry will get flushed or
- * evicted.
+ * violates the min_clean_size requirement.
+ * Since entries are all dirty and corked, no entry will get flushed or
+ * evicted.
*
* ========================================================================
* ========================================================================
@@ -33966,9 +34013,9 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
* Phase 2:
*
* Inserting entries into a cache that violates the min_clean_size,
- * until the cache is full.
- * Since entries are all dirty and corked, no entry during this phase
- * will get flushed or evicted.
+ * until the cache is full.
+ * Since entries are all dirty and corked, no entry during this phase
+ * will get flushed or evicted.
*
* ========================================================================
* ========================================================================
@@ -33997,14 +34044,14 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
*
* Expected status is that there are 27 entries in the cache, and
* all entries remain the same as before since they are all corked
- * and dirty
+ * and dirty
*/
/* entry w/ index 26 is now in the cache and dirty. */
- expected[26].in_cache = TRUE;
- expected[26].is_dirty = TRUE;
- expected[26].deserialized = (unsigned char)deserialized;
- expected[26].is_corked = TRUE;
+ expected[26].in_cache = TRUE;
+ expected[26].is_dirty = TRUE;
+ expected[26].deserialized = (unsigned char)deserialized;
+ expected[26].is_corked = TRUE;
/* verify the status */
verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
@@ -34043,10 +34090,10 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
* all entries are dirty corked entries.
*
*/
- expected[27].in_cache = TRUE;
- expected[27].is_dirty = TRUE;
- expected[27].deserialized = (unsigned char)deserialized;
- expected[27].is_corked = TRUE;
+ expected[27].in_cache = TRUE;
+ expected[27].is_dirty = TRUE;
+ expected[27].deserialized = (unsigned char)deserialized;
+ expected[27].is_corked = TRUE;
/* verify the status */
verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
@@ -34082,12 +34129,12 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
H5C__DIRTIED_FLAG); /* unsigned int flags */
}
- /*
- * Expected status: all entries are dirty corked entries.
+ /*
+ * Expected status: all entries are dirty corked entries.
*/
- expected[entry_idx].in_cache = TRUE;
- expected[entry_idx].is_dirty = TRUE;
- expected[entry_idx].deserialized = (unsigned char)deserialized;
+ expected[entry_idx].in_cache = TRUE;
+ expected[entry_idx].is_dirty = TRUE;
+ expected[entry_idx].deserialized = (unsigned char)deserialized;
expected[entry_idx].is_corked = TRUE;
/* Verify the status */
@@ -34112,8 +34159,8 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
/* ========================================================================
* ========================================================================
* Phase 3:
- * Inserting entries into a cache that is completely full.
- * No entry is flushed or evicted because all entries are dirty & corked.
+ * Inserting entries into a cache that is completely full.
+ * No entry is flushed or evicted because all entries are dirty & corked.
*
* ========================================================================
* ========================================================================
@@ -34145,10 +34192,10 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
}
/* This past inserted entry is now in the cache: dirty and corked */
- expected[entry_idx].in_cache = TRUE;
- expected[entry_idx].is_dirty = TRUE;
- expected[entry_idx].deserialized = (unsigned char)deserialized;
- expected[entry_idx].is_corked = TRUE;
+ expected[entry_idx].in_cache = TRUE;
+ expected[entry_idx].is_dirty = TRUE;
+ expected[entry_idx].deserialized = (unsigned char)deserialized;
+ expected[entry_idx].is_corked = TRUE;
/* Verify this expected status */
verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
@@ -34192,7 +34239,7 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
verify_clean();
/* Verify the status of the entries. */
- /* All entries are flushed, clean but still corked */
+ /* All entries are flushed, clean but still corked */
for (i = 0; i < 100; i++) {
expected[i].serialized = TRUE;
expected[i].is_dirty = FALSE;
@@ -34211,21 +34258,21 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
if(pass) {
- /* Will evict 50 clean "corked" entries all at once when inserting the 100th entry */
- for(i = 0; i < 51; i++) {
- expected[i].in_cache = FALSE;
- expected[i].destroyed = TRUE;
- expected[i].is_corked = TRUE;
- }
+ /* Will evict 50 clean "corked" entries all at once when inserting the 100th entry */
+ for(i = 0; i < 51; i++) {
+ expected[i].in_cache = FALSE;
+ expected[i].destroyed = TRUE;
+ expected[i].is_corked = TRUE;
+ }
- /* Insert the 100th entry */
- if(fill_via_insertion) {
+ /* Insert the 100th entry */
+ if(fill_via_insertion) {
insert_entry(file_ptr, /* H5F_t * file_ptr */
entry_type, /* int32_t type */
- 100, /* int32_t idx */
+ 100, /* int32_t idx */
H5C__NO_FLAGS_SET); /* unsigned int flags */
- } else {
+ } else {
protect_entry(file_ptr, /* H5F_t * file_ptr */
entry_type, /* int32_t type */
100); /* int32-t idx */
@@ -34234,16 +34281,16 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
entry_type, /* int32_t type */
100, /* int32_t idx */
H5C__DIRTIED_FLAG); /* unsigned int flags */
- }
+ }
- /* The 100th inserted entry is now in the cache and dirty */
- expected[100].in_cache = TRUE;
- expected[100].is_dirty = TRUE;
- expected[100].deserialized = (unsigned char)deserialized;
- expected[100].is_corked = TRUE;
+ /* The 100th inserted entry is now in the cache and dirty */
+ expected[100].in_cache = TRUE;
+ expected[100].is_dirty = TRUE;
+ expected[100].deserialized = (unsigned char)deserialized;
+ expected[100].is_corked = TRUE;
- /* verify the status */
- verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ /* verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
100, /* int tag */
150, /* int num_entries */
expected); /* struct expected_entry_staus[] */
@@ -34257,13 +34304,13 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
if(pass) {
/* Insert 25 more corked entries (indexes 101 through 125) into the cache. */
- /* Clean entry will be evicted one a time */
+ /* Clean entry will be evicted one a time */
for (entry_idx = 101; entry_idx < 126; entry_idx++) {
if(fill_via_insertion) {
insert_entry(file_ptr, /* H5F_t * file_ptr */
entry_type, /* int32_t type */
- entry_idx, /* int32_t idx */
+ entry_idx, /* int32_t idx */
H5C__NO_FLAGS_SET); /* unsigned int flags */
} else {
@@ -34278,21 +34325,21 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
}
/* The inserted entry is now in the cache and dirty */
- expected[entry_idx].in_cache = TRUE;
- expected[entry_idx].is_dirty = TRUE;
- expected[entry_idx].deserialized = (unsigned char)deserialized;
- expected[entry_idx].is_corked = TRUE;
+ expected[entry_idx].in_cache = TRUE;
+ expected[entry_idx].is_dirty = TRUE;
+ expected[entry_idx].deserialized = (unsigned char)deserialized;
+ expected[entry_idx].is_corked = TRUE;
- expected[entry_idx - 50].in_cache = FALSE;
- expected[entry_idx - 50].destroyed = TRUE;
- expected[entry_idx - 50].is_corked = TRUE;
+ expected[entry_idx - 50].in_cache = FALSE;
+ expected[entry_idx - 50].destroyed = TRUE;
+ expected[entry_idx - 50].is_corked = TRUE;
/* verify the status */
verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
entry_idx, /* int tag */
150, /* int num_entries */
expected); /* struct expected_entry_staus[] */
- } /* end for */
+ } /* end for */
}
@@ -34306,30 +34353,30 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
/* Insert the 127th entry (index = 126) into the cache. */
if(fill_via_insertion) {
- insert_entry(file_ptr, /* H5F_t * file_ptr */
- entry_type, /* int32_t type */
- 126, /* int32_t idx */
- H5C__NO_FLAGS_SET); /* unsigned int flags */
+ insert_entry(file_ptr, /* H5F_t * file_ptr */
+ entry_type, /* int32_t type */
+ 126, /* int32_t idx */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
} else {
- protect_entry(file_ptr, /* H5F_t * file_ptr */
- entry_type, /* int32_t type */
- 126); /* int32-t idx */
+ protect_entry(file_ptr, /* H5F_t * file_ptr */
+ entry_type, /* int32_t type */
+ 126); /* int32-t idx */
- unprotect_entry(file_ptr, /* H5F_t * file_ptr */
+ unprotect_entry(file_ptr, /* H5F_t * file_ptr */
entry_type, /* int32_t type */
- 126, /* int32_t idx */
+ 126, /* int32_t idx */
H5C__DIRTIED_FLAG); /* unsigned int flags */
}
/* Verify the status of the entries. */
- expected[126].in_cache = TRUE;
- expected[126].is_dirty = TRUE;
- expected[126].deserialized = (unsigned char)deserialized;
- expected[126].is_corked = TRUE;
+ expected[126].in_cache = TRUE;
+ expected[126].is_dirty = TRUE;
+ expected[126].deserialized = (unsigned char)deserialized;
+ expected[126].is_corked = TRUE;
- expected[126 - 50].in_cache = FALSE;
- expected[126 - 50].destroyed = TRUE;
- expected[126 - 50].is_corked = TRUE;
+ expected[126 - 50].in_cache = FALSE;
+ expected[126 - 50].destroyed = TRUE;
+ expected[126 - 50].is_corked = TRUE;
/* verify the status */
verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
@@ -34367,15 +34414,15 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
}
/* This past inserted entry is now in the cache, dirty and corked */
- expected[entry_idx].in_cache = TRUE;
- expected[entry_idx].is_dirty = TRUE;
- expected[entry_idx].deserialized = (unsigned char)deserialized;
- expected[entry_idx].is_corked = TRUE;
+ expected[entry_idx].in_cache = TRUE;
+ expected[entry_idx].is_dirty = TRUE;
+ expected[entry_idx].deserialized = (unsigned char)deserialized;
+ expected[entry_idx].is_corked = TRUE;
- /* Entry that is 50 entries away will be evicted since it is clean even though corked */
- expected[entry_idx - 50].in_cache = FALSE;
- expected[entry_idx - 50].destroyed = TRUE;
- expected[entry_idx - 50].is_corked = TRUE;
+ /* Entry that is 50 entries away will be evicted since it is clean even though corked */
+ expected[entry_idx - 50].in_cache = FALSE;
+ expected[entry_idx - 50].destroyed = TRUE;
+ expected[entry_idx - 50].is_corked = TRUE;
/* verify the status */
verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
@@ -34405,34 +34452,34 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
} /* check_metadata_cork() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_entry_deletions_during_scans()
+ * Function: check_entry_deletions_during_scans()
*
- * Purpose: With the addition of the H5C__TAKE_OWNERSHIP_FLAG, it is
- * possible for an entry to be removed from the cache as a
- * side effect of flushing an entry.
+ * Purpose: With the addition of the H5C__TAKE_OWNERSHIP_FLAG, it is
+ * possible for an entry to be removed from the cache as a
+ * side effect of flushing an entry.
*
- * For the most part, this doesn't cause problems. However,
- * during the scans of lists, it is possible that the entry
- * removed will be the next entry in the scan -- which if not
- * detected, will typeically cause the cache to attempt to flush
- * an entry that is no longer in the cache, and which may have
- * been deleted.
+ * For the most part, this doesn't cause problems. However,
+ * during the scans of lists, it is possible that the entry
+ * removed will be the next entry in the scan -- which if not
+ * detected, will typeically cause the cache to attempt to flush
+ * an entry that is no longer in the cache, and which may have
+ * been deleted.
*
- * This function contans tests for correct handling on this
- * situation.
+ * This function contans tests for correct handling on this
+ * situation.
*
* Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/3/15
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -34460,9 +34507,9 @@ check_entry_deletions_during_scans(unsigned paged)
file_ptr = setup_cache((size_t)(2 * 1024 * 1024), (size_t)(1 * 1024 * 1024), paged);
}
- /* run the tests. This set of tests is somewhat eclectic, as
- * we are trying to test all locations where the deletion of
- * an entry from the cache as a side effect of the fluch of
+ /* run the tests. This set of tests is somewhat eclectic, as
+ * we are trying to test all locations where the deletion of
+ * an entry from the cache as a side effect of the fluch of
* a different entry could cause problems.
*/
@@ -34502,32 +34549,32 @@ check_entry_deletions_during_scans(unsigned paged)
} /* check_entry_deletions_during_scans() */
-
+
/*-------------------------------------------------------------------------
- * Function: cedds__expunge_dirty_entry_in_flush_test()
+ * Function: cedds__expunge_dirty_entry_in_flush_test()
*
- * Purpose: Verify that H5C_flush_cache() can handle the removal of
- * a dirty entry from the cache during its scan of the
- * skip list.
+ * Purpose: Verify that H5C_flush_cache() can handle the removal of
+ * a dirty entry from the cache during its scan of the
+ * skip list.
*
- * Do this by setting up a full cache, with the last entry
- * on the LRU being both dirty and having a flush operation
- * that deletes the second to last entry on the LRU. Then
- * flush the cache, triggering the flush of the last
- * item, and thereby the deletion of the second to last item.
+ * Do this by setting up a full cache, with the last entry
+ * on the LRU being both dirty and having a flush operation
+ * that deletes the second to last entry on the LRU. Then
+ * flush the cache, triggering the flush of the last
+ * item, and thereby the deletion of the second to last item.
*
- * H5C_flush_cache() should handle this deletion gracefully.
+ * H5C_flush_cache() should handle this deletion gracefully.
*
* Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/4/15
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -34536,8 +34583,8 @@ static void
cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr)
{
H5C_t * cache_ptr = file_ptr->shared->cache;
- int i;
- herr_t result;
+ int i;
+ herr_t result;
struct expected_entry_status expected[36] =
{
/* the expected array is used to maintain a table of the expected status of every
@@ -34545,12 +34592,12 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr)
* array only processes as much of it as it is told to, we don't have to
* worry about maintaining the status of entries that we haven't used yet.
*/
- /* entry entry in at main flush dep flush dep child flush flush flush */
- /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
- { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
+ { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}
};
if(pass) {
@@ -34569,15 +34616,15 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr)
else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) ||
(cache_ptr->min_clean_size != (1 * 1024 * 1024))) {
- pass = FALSE;
- failure_mssg =
- "unexpected cache config at start of cedds expunge dirty entry in flush test.";
+ pass = FALSE;
+ failure_mssg =
+ "unexpected cache config at start of cedds expunge dirty entry in flush test.";
} else {
/* set min clean size to zero for this test as it simplifies
- * computing the expected cache size after each operation.
- */
+ * computing the expected cache size after each operation.
+ */
cache_ptr->min_clean_size = 0;
}
@@ -34585,50 +34632,50 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr)
if(pass) {
- /* The basic idea of this test is to setup the cache such
- * that:
- *
- * 1) the cache contains several dirty entries.
- *
- * 2) the first entry on the slist is dirty, and has a flush
- * operation that will remove the second entry on the
+ /* The basic idea of this test is to setup the cache such
+ * that:
+ *
+ * 1) the cache contains several dirty entries.
+ *
+ * 2) the first entry on the slist is dirty, and has a flush
+ * operation that will remove the second entry on the
* slist.
*
- * Then load flush the cache. Cache should handle the
- * removal of the next entry in the slist scan gracefully.
+ * Then load flush the cache. Cache should handle the
+ * removal of the next entry in the slist scan gracefully.
*/
- /* reset the stats before we start. If stats are enabled, we will
- * check to see if they are as expected at the end.
- */
- H5C_stats__reset(cache_ptr);
+ /* reset the stats before we start. If stats are enabled, we will
+ * check to see if they are as expected at the end.
+ */
+ H5C_stats__reset(cache_ptr);
- /* Load four huge entries into the cache. Recall that huge entries
+ /* Load four huge entries into the cache. Recall that huge entries
* are one fourth the size of monster entries (16 KB vs. 64 KB).
*/
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
- protect_entry(file_ptr, HUGE_ENTRY_TYPE, i);
- unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
+ protect_entry(file_ptr, HUGE_ENTRY_TYPE, i);
+ unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
}
- if((cache_ptr->index_len != 4) ||
+ if((cache_ptr->index_len != 4) ||
(cache_ptr->index_size != (4 * HUGE_ENTRY_SIZE))) {
pass = FALSE;
- failure_mssg = "unexpected size/len in cedds expunge dirty entry in flush test (1)";
- }
+ failure_mssg = "unexpected size/len in cedds expunge dirty entry in flush test (1)";
+ }
}
if(pass) {
- /* Next, set up the flush operation:
- *
- * (HET, 0) expunges (HET, 1)
- *
- */
+ /* Next, set up the flush operation:
+ *
+ * (HET, 0) expunges (HET, 1)
+ *
+ */
add_flush_op(HUGE_ENTRY_TYPE, 0, FLUSH_OP__EXPUNGE,
HUGE_ENTRY_TYPE, 1, FALSE, (size_t)0, NULL);
@@ -34636,27 +34683,27 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr)
if(pass) {
- /* to summarize, at present the following entries
- * are in cache with the following characteristics:
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (HET, 0) Y 16 KB Y N - expunge (HET 1)
- *
- * (HET, 1) Y 16 KB Y N - -
+ /* to summarize, at present the following entries
+ * are in cache with the following characteristics:
+ *
+ * in
+ * entry: cache? size: dirty? pinned? pins: flush operations:
+ *
+ * (HET, 0) Y 16 KB Y N - expunge (HET 1)
+ *
+ * (HET, 1) Y 16 KB Y N - -
*
- * (HET, 2) Y 16 KB Y N - -
+ * (HET, 2) Y 16 KB Y N - -
*
- * (HET, 3) Y 16 KB Y N - -
- *
- * Recall that in this test bed, flush operations are excuted the
- * first time the associated entry is flushed, and are then
- * deleted.
- */
+ * (HET, 3) Y 16 KB Y N - -
+ *
+ * Recall that in this test bed, flush operations are excuted the
+ * first time the associated entry is flushed, and are then
+ * deleted.
+ */
- /* verify the expected status of all entries we have loaded to date: */
- verify_entry_status(cache_ptr, 0, 4, expected);
+ /* verify the expected status of all entries we have loaded to date: */
+ verify_entry_status(cache_ptr, 0, 4, expected);
}
/* flush the cache to run the test. In the process, clean up after test. */
@@ -34684,7 +34731,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr)
* values.
*/
if(pass)
- if((cache_ptr->insertions[HUGE_ENTRY_TYPE] != 0) ||
+ if((cache_ptr->insertions[HUGE_ENTRY_TYPE] != 0) ||
(cache_ptr->pinned_insertions[HUGE_ENTRY_TYPE] != 0) ||
(cache_ptr->clears[HUGE_ENTRY_TYPE] != 1) ||
(cache_ptr->flushes[HUGE_ENTRY_TYPE] != 3) ||
@@ -34708,7 +34755,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr)
} /* end if */
if(pass)
- if((cache_ptr->slist_scan_restarts != 1) ||
+ if((cache_ptr->slist_scan_restarts != 1) ||
(cache_ptr->LRU_scan_restarts != 0) ||
(cache_ptr->index_scan_restarts != 0)) {
pass = FALSE;
@@ -34727,34 +34774,34 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr)
} /* cedds__expunge_dirty_entry_in_flush_test() */
-
+
/*-------------------------------------------------------------------------
- * Function: cedds__H5C_make_space_in_cache()
+ * Function: cedds__H5C_make_space_in_cache()
*
- * Purpose: Verify that H5C__make_space_in_cache() can handle the
- * removal from the cache of the next item in its reverse scan
- * of the LRU list.
+ * Purpose: Verify that H5C__make_space_in_cache() can handle the
+ * removal from the cache of the next item in its reverse scan
+ * of the LRU list.
*
- * Do this by setting up a full cache, with the last entry
- * on the LRU being both dirty and having a flush operation
- * that deleted the second to last entry on the LRU. Then
- * load an additional entry, triggering the flush of the last
- * item, and thereby the deletion of the second to last item.
+ * Do this by setting up a full cache, with the last entry
+ * on the LRU being both dirty and having a flush operation
+ * that deleted the second to last entry on the LRU. Then
+ * load an additional entry, triggering the flush of the last
+ * item, and thereby the deletion of the second to last item.
*
- * H5C__make_space_in_cache() should detect this deletion, and
- * restart its scan of the LRU from the tail, instead of
- * examining the now deleted next item up on the LRU.
+ * H5C__make_space_in_cache() should detect this deletion, and
+ * restart its scan of the LRU from the tail, instead of
+ * examining the now deleted next item up on the LRU.
*
* Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/4/15
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -34763,10 +34810,10 @@ static void
cedds__H5C_make_space_in_cache(H5F_t * file_ptr)
{
H5C_t * cache_ptr = file_ptr->shared->cache;
- int i;
- const int num_huge_entries = 4;
- const int num_monster_entries = 32;
- herr_t result;
+ int i;
+ const int num_huge_entries = 4;
+ const int num_monster_entries = 32;
+ herr_t result;
struct expected_entry_status expected[36] =
{
/* the expected array is used to maintain a table of the expected status of every
@@ -34774,44 +34821,44 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr)
* array only processes as much of it as it is told to, we don't have to
* worry about maintaining the status of entries that we haven't used yet.
*/
- /* entry entry in at main flush dep flush dep child flush flush flush */
- /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
- { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
+ { HUGE_ENTRY_TYPE, 0, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 1, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
};
if(pass) {
@@ -34830,15 +34877,15 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr)
else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) ||
(cache_ptr->min_clean_size != (1 * 1024 * 1024))) {
- pass = FALSE;
- failure_mssg =
- "unexpected cache config at start of cedds H5C__make_space_in_cache() test.";
+ pass = FALSE;
+ failure_mssg =
+ "unexpected cache config at start of cedds H5C__make_space_in_cache() test.";
} else {
/* set min clean size to zero for this test as it simplifies
- * computing the expected cache size after each operation.
- */
+ * computing the expected cache size after each operation.
+ */
cache_ptr->min_clean_size = 0;
}
@@ -34846,54 +34893,54 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr)
if(pass) {
- /* The basic idea of this test is to setup the cache such
- * that:
- *
- * 1) the cache is full
- *
- * 2) the last entry on the LRU is dirty, and has a flush
- * operation that will remove the second to last entry
+ /* The basic idea of this test is to setup the cache such
+ * that:
+ *
+ * 1) the cache is full
+ *
+ * 2) the last entry on the LRU is dirty, and has a flush
+ * operation that will remove the second to last entry
* on the LRU from the cache.
*
- * Then load another entry into the cache. See if
- * H5C__make_space_in_cache() detects the removal of
- * the next item in the scan, and restarts the scan
- * from the bottom of the LRU. Note that the newly
+ * Then load another entry into the cache. See if
+ * H5C__make_space_in_cache() detects the removal of
+ * the next item in the scan, and restarts the scan
+ * from the bottom of the LRU. Note that the newly
* loaded entry must be large enough to require that
* the scan continue after the entry is expunged.
*/
- /* reset the stats before we start. If stats are enabled, we will
- * check to see if they are as expected at the end.
- */
- H5C_stats__reset(cache_ptr);
+ /* reset the stats before we start. If stats are enabled, we will
+ * check to see if they are as expected at the end.
+ */
+ H5C_stats__reset(cache_ptr);
- /* Load four huge entries into the cache. Recall that huge entries
+ /* Load four huge entries into the cache. Recall that huge entries
* are one fourth the size of monster entries (16 KB vs. 64 KB).
*/
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
- protect_entry(file_ptr, HUGE_ENTRY_TYPE, i);
- unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
+ protect_entry(file_ptr, HUGE_ENTRY_TYPE, i);
+ unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
}
- if((cache_ptr->index_len != 4) ||
+ if((cache_ptr->index_len != 4) ||
(cache_ptr->index_size != (4 * HUGE_ENTRY_SIZE))) {
pass = FALSE;
- failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (1)";
- }
+ failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (1)";
+ }
}
if(pass) {
- /* Next, set up the flush operation:
- *
- * (HET, 0) expunges (HET, 1)
- *
- */
+ /* Next, set up the flush operation:
+ *
+ * (HET, 0) expunges (HET, 1)
+ *
+ */
add_flush_op(HUGE_ENTRY_TYPE, 0, FLUSH_OP__EXPUNGE,
HUGE_ENTRY_TYPE, 1, FALSE, (size_t)0, NULL);
@@ -34901,62 +34948,62 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr)
if(pass) {
- /* to summarize, at present the following entries
- * are in cache with the following characteristics:
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (HET, 0) Y 16 KB Y N - expunge (HET 1)
- *
- * (HET, 1) Y 16 KB N N - -
+ /* to summarize, at present the following entries
+ * are in cache with the following characteristics:
+ *
+ * in
+ * entry: cache? size: dirty? pinned? pins: flush operations:
+ *
+ * (HET, 0) Y 16 KB Y N - expunge (HET 1)
+ *
+ * (HET, 1) Y 16 KB N N - -
*
- * (HET, 2) Y 16 KB N N - -
+ * (HET, 2) Y 16 KB N N - -
*
- * (HET, 3) Y 16 KB N N - -
- *
- * Recall that in this test bed, flush operations are excuted the
- * first time the associated entry is flushed, and are then
- * deleted.
- */
+ * (HET, 3) Y 16 KB N N - -
+ *
+ * Recall that in this test bed, flush operations are excuted the
+ * first time the associated entry is flushed, and are then
+ * deleted.
+ */
/* Now fill up the cache with other, unrelated entries. Recall
* that the cache size is 2 MB and 31 * 64 KB + 4 * 16 KP == 2 MB.
*/
- for (i = 0; i < 31; i++)
- {
- protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
+ for (i = 0; i < 31; i++)
+ {
+ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG);
- }
+ }
- /* The cache should now be exactly full */
- if((cache_ptr->index_len != 35) ||
+ /* The cache should now be exactly full */
+ if((cache_ptr->index_len != 35) ||
(cache_ptr->index_size != 2 * 1024 * 1024) ||
- (cache_ptr->index_size != ((4 * HUGE_ENTRY_SIZE) +
+ (cache_ptr->index_size != ((4 * HUGE_ENTRY_SIZE) +
(31 * MONSTER_ENTRY_SIZE)))) {
pass = FALSE;
- failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (2)";
+ failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (2)";
- } else {
+ } else {
- /* verify the expected status of all entries we have loaded to date: */
- verify_entry_status(cache_ptr, 0, 35, expected);
- }
+ /* verify the expected status of all entries we have loaded to date: */
+ verify_entry_status(cache_ptr, 0, 35, expected);
+ }
}
if(pass) {
- /* now load another monster entry. This should cause
- * H5C__make_space_in_cache() to be called. (HET 0) is dirty, and is at
- * the bottom of the LRU. * Thus it will be flushed, and moved to the
- * head of the LRU. However, during the flush, (HET 1) should be expunged
- * from the cache. Since (MET 1) is the next item in
- * H5C__make_space_in_cache(), must detect its removal from the cache,
+ /* now load another monster entry. This should cause
+ * H5C__make_space_in_cache() to be called. (HET 0) is dirty, and is at
+ * the bottom of the LRU. * Thus it will be flushed, and moved to the
+ * head of the LRU. However, during the flush, (HET 1) should be expunged
+ * from the cache. Since (MET 1) is the next item in
+ * H5C__make_space_in_cache(), must detect its removal from the cache,
* and refrain from trying to flush it.
*
* Since all entries in the cache are dirty, all entries will be flushed,
- * and HET 0, 2, and 3 will be evicted to make room for the new
+ * and HET 0, 2, and 3 will be evicted to make room for the new
* monster entry (MET, 31).
*
* Verify this. If H5C__make_space_in_cache() chokes, failure will
@@ -34969,45 +35016,45 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr)
if(pass) {
- /* if the protect succeeded, unprotect and verify that all is at
+ /* if the protect succeeded, unprotect and verify that all is at
* it should be.
*/
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__DIRTIED_FLAG);
- /* The cache should now be exactly full */
- if((cache_ptr->index_len != 32) ||
+ /* The cache should now be exactly full */
+ if((cache_ptr->index_len != 32) ||
(cache_ptr->index_size != 2 * 1024 * 1024) ||
- (cache_ptr->index_size != (32 * MONSTER_ENTRY_SIZE))) {
+ (cache_ptr->index_size != (32 * MONSTER_ENTRY_SIZE))) {
pass = FALSE;
- failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (3)";
+ failure_mssg = "unexpected size/len in H5C__make_space_in_cache() test (3)";
- } else {
+ } else {
- /* modify the expected table to match the new situation, and
+ /* modify the expected table to match the new situation, and
* then call verify_entry_status().
*/
for (i = 0; i < num_huge_entries; i++)
{
- expected[i].in_cache = FALSE;
- expected[i].is_dirty = FALSE;
- expected[i].serialized = TRUE;
- expected[i].destroyed = TRUE;
+ expected[i].in_cache = FALSE;
+ expected[i].is_dirty = FALSE;
+ expected[i].serialized = TRUE;
+ expected[i].destroyed = TRUE;
}
/* (HET, 1) was expunged, so touch its entry up accordingly */
- expected[1].is_dirty = TRUE;
- expected[1].serialized = FALSE;
+ expected[1].is_dirty = TRUE;
+ expected[1].serialized = FALSE;
for (i = num_huge_entries; i < num_huge_entries + num_monster_entries - 1; i++)
{
- expected[i].is_dirty = FALSE;
- expected[i].serialized = TRUE;
+ expected[i].is_dirty = FALSE;
+ expected[i].serialized = TRUE;
}
- /* verify the expected status of all entries: */
- verify_entry_status(cache_ptr, 0, 36, expected);
+ /* verify the expected status of all entries: */
+ verify_entry_status(cache_ptr, 0, 36, expected);
}
}
@@ -35038,7 +35085,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr)
if(pass) {
- if((cache_ptr->insertions[HUGE_ENTRY_TYPE] != 0) ||
+ if((cache_ptr->insertions[HUGE_ENTRY_TYPE] != 0) ||
(cache_ptr->pinned_insertions[HUGE_ENTRY_TYPE] != 0) ||
(cache_ptr->clears[HUGE_ENTRY_TYPE] != 1) ||
(cache_ptr->flushes[HUGE_ENTRY_TYPE] != 3) ||
@@ -35063,7 +35110,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr)
}
if(pass)
- if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) ||
+ if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) ||
(cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0) ||
(cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0) ||
(cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 32) ||
@@ -35087,7 +35134,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr)
} /* end if */
if(pass)
- if((cache_ptr->slist_scan_restarts != 0) ||
+ if((cache_ptr->slist_scan_restarts != 0) ||
(cache_ptr->LRU_scan_restarts != 1) ||
(cache_ptr->index_scan_restarts != 0)) {
@@ -35108,34 +35155,34 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr)
} /* cedds__H5C_make_space_in_cache() */
-
+
/*-------------------------------------------------------------------------
- * Function: cedds__H5C__autoadjust__ageout__evict_aged_out_entries()
+ * Function: cedds__H5C__autoadjust__ageout__evict_aged_out_entries()
*
- * Purpose: Verify that H5C__autoadjust__ageout__evict_aged_out_entries()
- * can handle the removal from the cache of the next item in
- * its reverse scan of the LRU list.
+ * Purpose: Verify that H5C__autoadjust__ageout__evict_aged_out_entries()
+ * can handle the removal from the cache of the next item in
+ * its reverse scan of the LRU list.
*
- * Do this by setting up a full cache, with the last entry
- * on the LRU being both dirty and having a flush operation
- * that deletes the second to last entry on the LRU. Then
- * access the first item in the LRU repeatedly until the
- * item, and thereby the deletion of the second to last item.
+ * Do this by setting up a full cache, with the last entry
+ * on the LRU being both dirty and having a flush operation
+ * that deletes the second to last entry on the LRU. Then
+ * access the first item in the LRU repeatedly until the
+ * item, and thereby the deletion of the second to last item.
*
- * H5C__make_space_in_cache() should detect this deletion, and
- * restart its scan of the LRU from the tail, instead of
- * examining the now deleted next item up on the LRU.
+ * H5C__make_space_in_cache() should detect this deletion, and
+ * restart its scan of the LRU from the tail, instead of
+ * examining the now deleted next item up on the LRU.
*
* Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/4/15
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -35144,8 +35191,8 @@ static void
cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
{
H5C_t * cache_ptr = file_ptr->shared->cache;
- int i;
- herr_t result;
+ int i;
+ herr_t result;
struct expected_entry_status expected[36] =
{
/* the expected array is used to maintain a table of the expected status of every
@@ -35153,40 +35200,40 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
* array only processes as much of it as it is told to, we don't have to
* worry about maintaining the status of entries that we haven't used yet.
*/
- /* entry entry in at main flush dep flush dep child flush flush flush */
- /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
- { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
+ { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE},
};
H5C_auto_size_ctl_t saved_auto_size_ctl;
H5C_auto_size_ctl_t test_auto_size_ctl =
@@ -35215,9 +35262,9 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0f,
+ /* double flash_threshold = */ 0.5f,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out,
@@ -35251,15 +35298,15 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) ||
(cache_ptr->min_clean_size != (1 * 1024 * 1024))) {
- pass = FALSE;
- failure_mssg =
- "unexpected cache config at start of cedds H5C__autoadjust__ageout__evict_aged_out_entries() test.";
+ pass = FALSE;
+ failure_mssg =
+ "unexpected cache config at start of cedds H5C__autoadjust__ageout__evict_aged_out_entries() test.";
} else {
/* set min clean size to zero for this test as it simplifies
- * computing the expected cache size after each operation.
- */
+ * computing the expected cache size after each operation.
+ */
cache_ptr->min_clean_size = 0;
}
@@ -35295,49 +35342,49 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
if(pass) {
- /* The basic idea of this test is to setup the cache such
- * that:
- *
- * 1) the cache is full
- *
- * 2) the last entry on the LRU is dirty, and has a flush
- * operation that will remove the second to last entry
+ /* The basic idea of this test is to setup the cache such
+ * that:
+ *
+ * 1) the cache is full
+ *
+ * 2) the last entry on the LRU is dirty, and has a flush
+ * operation that will remove the second to last entry
* on the LRU from the cache.
*
* Then access the first item in the LRU until the epoch
- * and H5C__autoadjust__ageout__evict_aged_out_entries()
- * is invoked. Verify that the function deals with the
- * deletion of the next item in its scan cleanly.
+ * and H5C__autoadjust__ageout__evict_aged_out_entries()
+ * is invoked. Verify that the function deals with the
+ * deletion of the next item in its scan cleanly.
*/
- /* reset the stats before we start. If stats are enabled, we will
- * check to see if they are as expected at the end.
- */
- H5C_stats__reset(cache_ptr);
+ /* reset the stats before we start. If stats are enabled, we will
+ * check to see if they are as expected at the end.
+ */
+ H5C_stats__reset(cache_ptr);
/* load the first entry -- mark it dirty */
- protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0);
- unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG);
+ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0);
+ unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG);
- /* Then load the rest of the entries to fill the cache:
+ /* Then load the rest of the entries to fill the cache:
*
* Recall that the cache size is 2 MB and 32 * 64 KB == 2 MB.
*/
- for (i = 1; i < 32; i++)
- {
- protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
+ for (i = 1; i < 32; i++)
+ {
+ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET);
- }
+ }
}
if(pass) {
- /* Next, set up the flush operation:
- *
- * (MET, 0) expunges (MET, 1)
- *
- */
+ /* Next, set up the flush operation:
+ *
+ * (MET, 0) expunges (MET, 1)
+ *
+ */
add_flush_op(MONSTER_ENTRY_TYPE, 0, FLUSH_OP__EXPUNGE,
MONSTER_ENTRY_TYPE, 1, FALSE, (size_t)0, NULL);
@@ -35345,34 +35392,34 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
if(pass) {
- /* to summarize, at present the following entries
- * are in cache with the following characteristics:
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (MET, 0) Y 64 KB Y N - expunge (MET 1)
- *
- * (MET, 1-31) Y 64 KB N N - -
- *
- * Recall that in this test bed, flush operations are excuted the
- * first time the associated entry is flushed, and are then
- * deleted.
- */
+ /* to summarize, at present the following entries
+ * are in cache with the following characteristics:
+ *
+ * in
+ * entry: cache? size: dirty? pinned? pins: flush operations:
+ *
+ * (MET, 0) Y 64 KB Y N - expunge (MET 1)
+ *
+ * (MET, 1-31) Y 64 KB N N - -
+ *
+ * Recall that in this test bed, flush operations are excuted the
+ * first time the associated entry is flushed, and are then
+ * deleted.
+ */
- /* The cache should now be exactly full */
- if((cache_ptr->index_len != 32) ||
+ /* The cache should now be exactly full */
+ if((cache_ptr->index_len != 32) ||
(cache_ptr->index_size != 2 * 1024 * 1024) ||
- (cache_ptr->index_size != (32 * MONSTER_ENTRY_SIZE))) {
+ (cache_ptr->index_size != (32 * MONSTER_ENTRY_SIZE))) {
pass = FALSE;
- failure_mssg = "unexpected size/len in H5C__autoadjust__ageout__evict_aged_out_entries() test (1)";
+ failure_mssg = "unexpected size/len in H5C__autoadjust__ageout__evict_aged_out_entries() test (1)";
- } else {
+ } else {
- /* verify the expected status of all entries we have loaded to date: */
- verify_entry_status(cache_ptr, 0, 32, expected);
- }
+ /* verify the expected status of all entries we have loaded to date: */
+ verify_entry_status(cache_ptr, 0, 32, expected);
+ }
}
/* protect and unprotect (MET, 31) repeatedly until the end of the first epoch */
@@ -35398,38 +35445,38 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__NO_FLAGS_SET);
}
- /* at this point, only (MET, 0) and (MET, 31) should remain in the cache,
- * all other entries having been evicted by the ageout adaptive cache
- * resizing algorithm. (Since (MET, 0) was dirty, it was flushed and
+ /* at this point, only (MET, 0) and (MET, 31) should remain in the cache,
+ * all other entries having been evicted by the ageout adaptive cache
+ * resizing algorithm. (Since (MET, 0) was dirty, it was flushed and
* moved to the head of the LRU by the ageout algorithm.)
*/
if(pass) {
- if((cache_ptr->index_len != 2) ||
+ if((cache_ptr->index_len != 2) ||
(cache_ptr->index_size != 2 * MONSTER_ENTRY_SIZE)) {
pass = FALSE;
- failure_mssg = "unexpected size/len in H5C__autoadjust__ageout__evict_aged_out_entries() test (2)";
+ failure_mssg = "unexpected size/len in H5C__autoadjust__ageout__evict_aged_out_entries() test (2)";
- } else {
+ } else {
- /* update the expected table to reflect the expected values at
+ /* update the expected table to reflect the expected values at
* this point, and then verify.
*/
expected[0].is_dirty = FALSE;
- expected[0].serialized = TRUE;
+ expected[0].serialized = TRUE;
for (i = 1; i < 31; i++)
{
- expected[i].in_cache = FALSE;
- expected[i].is_dirty = FALSE;
- expected[i].destroyed = TRUE;
+ expected[i].in_cache = FALSE;
+ expected[i].is_dirty = FALSE;
+ expected[i].destroyed = TRUE;
}
- verify_entry_status(cache_ptr, 0, 32, expected);
- }
+ verify_entry_status(cache_ptr, 0, 32, expected);
+ }
}
/* restore the initial resize configuration */
@@ -35473,7 +35520,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
*/
if(pass)
- if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) ||
+ if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) ||
(cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0) ||
(cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0) ||
(cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 1) ||
@@ -35497,7 +35544,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
} /* end if */
if(pass)
- if((cache_ptr->slist_scan_restarts != 0) ||
+ if((cache_ptr->slist_scan_restarts != 0) ||
(cache_ptr->LRU_scan_restarts != 1) ||
(cache_ptr->index_scan_restarts != 0)) {
@@ -35518,95 +35565,95 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
} /* cedds__H5C__autoadjust__ageout__evict_aged_out_entries() */
-
+
/*-------------------------------------------------------------------------
- * Function: cedds__H5C_flush_invalidate_cache__bucket_scan()
- *
- * Purpose: Note: We now use the index list when we scan the
- * contents of the metadata cache, so in principal,
- * this test is obsolete. However, even using the
- * index list, restarts are possible, and must be
- * handled gracefully.
- *
- * As it turns out, this test triggers index list
- * scan restarts, and thus with minor changes is
- * still a useful test.
- *
- * For this reason, with the exception of changing
- * to check the index_scan_restart stat instead of
- * hash bucket restarts, I'm leaving the test
- * alone. If and when it starts to fail due to
- * other changes, we can re-work it to test
- * index list scan restarts explicitly.
- *
- * JRM -- 11/2/16
- *
- * Verify that H5C_flush_invalidate_cache() can handle
- * the removal from the cache of the next item in
- * its scans of hash buckets.
- *
- * !!!!!!!!!!WARNING !!!!!!!!!!
- *
- * This test may fail to function correctly if the hash
- * table size or hash function is altered.
- *
- * To setup the test, this function depends on the fact that
- * H5C_flush_invalidate_cache() does alternating scans of the
- * slist and the index. If this changes, the test will likely
- * also cease to function correctly.
- *
- * The test relies on a known hash function and hash table
- * size to select a set of test entries that will all hash
- * to the same hash bucket -- call it the test hash bucket.
- * It also relies on known behavior of the cache to place
- * the entries in the test bucket in a known order.
- *
- * To avoid pre-mature flushes of the entries in the
- * test hash bucket, all entries are initially clean,
- * with the exception of the first entry which is dirty.
- * It avoids premature flushing by being the parent in
- * a flush dependency. The first entry in the test bucket
- * also has a flush op which expunges the second entry --
- * setting up the failure.
- *
- * An additional dirty entry is added (which must hash
- * to a different bucket, and must have a higher address
- * than at least the first entry in the test hash bucket.
- * This entry is the child in a flush dependency with the
- * first entry in the above hash bucket, and contains
- * a flush op to destroy this flush dependency.
- *
- * Since the first entry in the test hash bucket has a lower
- * address that the other dirty entry, the scan of the
- * slist encounters it first, and passes over it because
- * it has a flush dependency height of 1.
- *
- * The scan then encounters the second dirty entry and flushes
- * it -- causing it to destroy the flush dependency and thus
- * reducing the flush dependency height of the first entry in
- * the test hash bucket to zero.
- *
- * After completing a scan of the slist,
- * H5C_flush_invalidate_cache() then scans the index,
- * flushing all entries of flush dependency height zero.
- *
- * This sets up the potential error when the first entry
- * in the test hash bucket is flushed -- expunging the
- * second entry as a side effect. If
- * H5C_flush_invalidate_cache() fails to detect this,
- * it will attempt to continue its scan of the bucket with
- * an entry that has been deleted from the cache.
+ * Function: cedds__H5C_flush_invalidate_cache__bucket_scan()
+ *
+ * Purpose: Note: We now use the index list when we scan the
+ * contents of the metadata cache, so in principal,
+ * this test is obsolete. However, even using the
+ * index list, restarts are possible, and must be
+ * handled gracefully.
+ *
+ * As it turns out, this test triggers index list
+ * scan restarts, and thus with minor changes is
+ * still a useful test.
+ *
+ * For this reason, with the exception of changing
+ * to check the index_scan_restart stat instead of
+ * hash bucket restarts, I'm leaving the test
+ * alone. If and when it starts to fail due to
+ * other changes, we can re-work it to test
+ * index list scan restarts explicitly.
+ *
+ * JRM -- 11/2/16
+ *
+ * Verify that H5C_flush_invalidate_cache() can handle
+ * the removal from the cache of the next item in
+ * its scans of hash buckets.
+ *
+ * !!!!!!!!!!WARNING !!!!!!!!!!
+ *
+ * This test may fail to function correctly if the hash
+ * table size or hash function is altered.
+ *
+ * To setup the test, this function depends on the fact that
+ * H5C_flush_invalidate_cache() does alternating scans of the
+ * slist and the index. If this changes, the test will likely
+ * also cease to function correctly.
+ *
+ * The test relies on a known hash function and hash table
+ * size to select a set of test entries that will all hash
+ * to the same hash bucket -- call it the test hash bucket.
+ * It also relies on known behavior of the cache to place
+ * the entries in the test bucket in a known order.
+ *
+ * To avoid pre-mature flushes of the entries in the
+ * test hash bucket, all entries are initially clean,
+ * with the exception of the first entry which is dirty.
+ * It avoids premature flushing by being the parent in
+ * a flush dependency. The first entry in the test bucket
+ * also has a flush op which expunges the second entry --
+ * setting up the failure.
+ *
+ * An additional dirty entry is added (which must hash
+ * to a different bucket, and must have a higher address
+ * than at least the first entry in the test hash bucket.
+ * This entry is the child in a flush dependency with the
+ * first entry in the above hash bucket, and contains
+ * a flush op to destroy this flush dependency.
+ *
+ * Since the first entry in the test hash bucket has a lower
+ * address that the other dirty entry, the scan of the
+ * slist encounters it first, and passes over it because
+ * it has a flush dependency height of 1.
+ *
+ * The scan then encounters the second dirty entry and flushes
+ * it -- causing it to destroy the flush dependency and thus
+ * reducing the flush dependency height of the first entry in
+ * the test hash bucket to zero.
+ *
+ * After completing a scan of the slist,
+ * H5C_flush_invalidate_cache() then scans the index,
+ * flushing all entries of flush dependency height zero.
+ *
+ * This sets up the potential error when the first entry
+ * in the test hash bucket is flushed -- expunging the
+ * second entry as a side effect. If
+ * H5C_flush_invalidate_cache() fails to detect this,
+ * it will attempt to continue its scan of the bucket with
+ * an entry that has been deleted from the cache.
*
* Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/9/15
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -35615,9 +35662,9 @@ static void
cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
{
H5C_t * cache_ptr = file_ptr->shared->cache;
- int i;
- int expected_hash_bucket = 0;
- herr_t result;
+ int i;
+ int expected_hash_bucket = 0;
+ herr_t result;
haddr_t entry_addr;
test_entry_t * entry_ptr;
test_entry_t * base_addr = NULL;
@@ -35629,13 +35676,13 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
* array only processes as much of it as it is told to, we don't have to
* worry about maintaining the status of entries that we haven't used yet.
*/
- /* entry entry in at main flush dep flush dep child flush flush flush */
- /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
- { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 1, 1, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
- { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {MONSTER_ENTRY_TYPE,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 1, 0, 0, -1, FALSE},
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */
+ { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 1, 1, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE},
+ { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {MONSTER_ENTRY_TYPE,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 1, 0, 0, -1, FALSE},
};
if(pass) {
@@ -35654,15 +35701,15 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) ||
(cache_ptr->min_clean_size != (1 * 1024 * 1024))) {
- pass = FALSE;
- failure_mssg =
- "unexpected cache config at start of cedds cedds__H5C_flush_invalidate_cache__bucket_scan() test.";
+ pass = FALSE;
+ failure_mssg =
+ "unexpected cache config at start of cedds cedds__H5C_flush_invalidate_cache__bucket_scan() test.";
} else {
/* set min clean size to zero for this test as it simplifies
- * computing the expected cache size after each operation.
- */
+ * computing the expected cache size after each operation.
+ */
cache_ptr->min_clean_size = 0;
}
@@ -35671,25 +35718,25 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
if(pass) {
- /* reset the stats before we start. If stats are enabled, we will
- * check to see if they are as expected at the end.
- */
+ /* reset the stats before we start. If stats are enabled, we will
+ * check to see if they are as expected at the end.
+ */
- H5C_stats__reset(cache_ptr);
+ H5C_stats__reset(cache_ptr);
- /* load one dirty and three clean entries that should hash to the
- * same hash bucket.
+ /* load one dirty and three clean entries that should hash to the
+ * same hash bucket.
*/
protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0);
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG);
- for (i = 8; i <= 24; i += 8)
- {
- protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
+ for (i = 8; i <= 24; i += 8)
+ {
+ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET);
- }
+ }
}
if(pass) {
@@ -35704,7 +35751,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
expected_hash_bucket = H5C__HASH_FCN(entry_addr);
for (i = 8; i <= 24; i += 8) {
-
+
entry_ptr = &(base_addr[i]);
entry_addr = entry_ptr->header.addr;
@@ -35719,10 +35766,10 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
if(pass) {
/* setup the expunge flush operation:
- *
- * (MET, 0) expunges (MET, 8)
- *
- */
+ *
+ * (MET, 0) expunges (MET, 8)
+ *
+ */
add_flush_op(MONSTER_ENTRY_TYPE, 0, FLUSH_OP__EXPUNGE,
MONSTER_ENTRY_TYPE, 8, FALSE, (size_t)0, NULL);
}
@@ -35731,16 +35778,16 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
/* load the entry that will have a flush dependencey with (MET, 0),
* thus preventing it from being flushed on the first pass through
- * the skip list.
+ * the skip list.
*/
- protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31);
- unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__DIRTIED_FLAG);
+ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31);
+ unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 31, H5C__DIRTIED_FLAG);
}
if(pass) {
- /* verify that the dirty entry doesn't map to the same
+ /* verify that the dirty entry doesn't map to the same
* hash bucket as the clean entries.
*/
@@ -35756,9 +35803,9 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
if(pass) {
- /* Next, create the flush dependency requiring (MET, 31) to
+ /* Next, create the flush dependency requiring (MET, 31) to
* be flushed prior to (MET, 0).
- */
+ */
protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0);
create_flush_dependency(MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_TYPE, 31);
@@ -35768,11 +35815,11 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
if(pass) {
- /* Then, setup the flush operation to take down the flush
+ /* Then, setup the flush operation to take down the flush
* dependency when (MET, 31) is flushed.
- *
- * (MET, 31) destroys flush dependency with (MET, 8)
- *
+ *
+ * (MET, 31) destroys flush dependency with (MET, 8)
+ *
*/
add_flush_op(MONSTER_ENTRY_TYPE, 31, FLUSH_OP__DEST_FLUSH_DEP,
MONSTER_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL);
@@ -35781,23 +35828,23 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
if(pass) {
- /* verify the expected status of all entries we have loaded to date: */
+ /* verify the expected status of all entries we have loaded to date: */
verify_entry_status(cache_ptr, 0, 5, expected);
}
if(pass) {
- /* now do some protect / unprotect cycles to force the
+ /* now do some protect / unprotect cycles to force the
* entries into the desired order in the hash bucket.
- * Recall that entries are moved to the head of the
+ * Recall that entries are moved to the head of the
* hash bucket list on lookup.
*/
- for (i = 24; i >= 0; i -= 8)
- {
- protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
+ for (i = 24; i >= 0; i -= 8)
+ {
+ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET);
- }
+ }
}
if(pass) {
@@ -35810,7 +35857,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
i = 0;
while(pass && (i <= 24))
- {
+ {
entry_ptr = &(base_addr[i]);
if(scan_ptr == NULL) {
@@ -35830,7 +35877,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
scan_ptr = scan_ptr->ht_next;
i += 8;
}
- }
+ }
}
@@ -35860,7 +35907,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
*/
if(pass)
- if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) ||
+ if((cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0) ||
(cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0) ||
(cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0) ||
(cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 2) ||
@@ -35885,10 +35932,10 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
if(pass)
/* as this test is now checking for index list scan restarts,
- * the following has been modified to check this instead of
+ * the following has been modified to check this instead of
* hash bucket scan restarts.
*/
- if((cache_ptr->slist_scan_restarts != 0) ||
+ if((cache_ptr->slist_scan_restarts != 0) ||
(cache_ptr->LRU_scan_restarts != 0) ||
(cache_ptr->index_scan_restarts != 1)) {
pass = FALSE;
@@ -35908,21 +35955,21 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
} /* cedds__H5C_flush_invalidate_cache__bucket_scan() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_stats()
+ * Function: check_stats()
*
- * Purpose: If stats are enabled, conduct tests to verify correct
- * functioning of the cache statistics collection code.
+ * Purpose: If stats are enabled, conduct tests to verify correct
+ * functioning of the cache statistics collection code.
*
- * Skip the test if stats are not enabled.
+ * Skip the test if stats are not enabled.
*
- * At present this test is a shell -- fill it out at time
- * permits.
+ * At present this test is a shell -- fill it out at time
+ * permits.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/12/15
*
* Modifications:
@@ -35977,7 +36024,7 @@ check_stats(unsigned paged)
SKIPPED();
- HDfprintf(stdout, " Statistics collection disabled.\n");
+ HDfprintf(stdout, " Statistics collection disabled.\n");
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -35985,30 +36032,30 @@ check_stats(unsigned paged)
} /* check_stats() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_stats__smoke_check_1()
+ * Function: check_stats__smoke_check_1()
*
- * Purpose: Test to see if the statistics collection code is working
- * more or less as expected. Do this by performing a number
- * of operations in the cache, and checking to verify that
- * they result in the expected statistics.
+ * Purpose: Test to see if the statistics collection code is working
+ * more or less as expected. Do this by performing a number
+ * of operations in the cache, and checking to verify that
+ * they result in the expected statistics.
*
- * Note that this function is not intended to be a full test
- * of the statistics collection facility -- only a cursory
- * check that will serve as a place holder until more complete
- * tests are implemented.
+ * Note that this function is not intended to be a full test
+ * of the statistics collection facility -- only a cursory
+ * check that will serve as a place holder until more complete
+ * tests are implemented.
*
* Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/22/15
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -36017,8 +36064,8 @@ static void
check_stats__smoke_check_1(H5F_t * file_ptr)
{
H5C_t * cache_ptr = file_ptr->shared->cache;
- int i;
- herr_t result;
+ int i;
+ herr_t result;
if(pass) {
if(cache_ptr == NULL) {
@@ -36035,15 +36082,15 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) ||
(cache_ptr->min_clean_size != (1 * 1024 * 1024))) {
- pass = FALSE;
- failure_mssg = "unexpected cache config at start of check_stats__smoke_check_1().";
+ pass = FALSE;
+ failure_mssg = "unexpected cache config at start of check_stats__smoke_check_1().";
} /* end else-if */
- else {
+ else {
/* set min clean size to zero for this test as it simplifies
- * computing the expected cache size after each operation.
- */
+ * computing the expected cache size after each operation.
+ */
cache_ptr->min_clean_size = 0;
} /* end else */
} /* end if */
@@ -36129,13 +36176,13 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
if(pass)
- /* protect and unprotect each entry once. Note
+ /* protect and unprotect each entry once. Note
* that all entries are already dirty, as they
* entered the cache via insertion
*/
for(i = 0; i < 32; i++) {
- protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
- unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET);
+ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
+ unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET);
} /* end for */
if(pass)
@@ -36216,7 +36263,7 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
if(pass) {
/* protect and unprotect an entry that is not currently
* in the cache. Since the cache is full and all entries
- * are dirty, this will force a flush of each entry, and
+ * are dirty, this will force a flush of each entry, and
* the eviction of (MET, 0).
*/
protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 32);
@@ -36416,7 +36463,439 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
#endif /* H5C_COLLECT_CACHE_STATS */
-
+
+/* Call back functions: */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: check_if_write_permitted
+ *
+ * Purpose: Determine if a write is permitted under the current
+ * circumstances, and set *write_permitted_ptr accordingly.
+ * As a general rule it is, but when we are running in parallel
+ * mode with collective I/O, we must ensure that a read cannot
+ * cause a write.
+ *
+ * In the event of failure, the value of *write_permitted_ptr
+ * is undefined.
+ *
+ * Return: Non-negative on success/Negative on failure.
+ *
+ * Programmer: John Mainzer, 5/15/04
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+check_write_permitted(const H5F_t H5_ATTR_UNUSED *f, hbool_t *write_permitted_ptr)
+{
+ HDassert( write_permitted_ptr );
+
+ *write_permitted_ptr = write_permitted;
+
+ return(SUCCEED);
+} /* check_write_permitted() */
+
+
+/*****************************************************************************
+ *
+ * Function: setup_cache()
+ *
+ * Purpose: Open an HDF file. This will allocate an instance and
+ * initialize an associated instance of H5C_t. However,
+ * we want to test an instance of H5C_t, so allocate and
+ * initialize one with the file ID returned by the call to
+ * H5Fcreate(). Return a pointer to this instance of H5C_t.
+ *
+ * Observe that we open a HDF file because the cache now
+ * writes directly to file, and we need the file I/O facilities
+ * associated with the file.
+ *
+ * To avoid tripping on error check code, must allocate enough
+ * space in the file to hold all the test entries and their
+ * alternates. This is a little sticky, as the addresses of
+ * all the test entries are determined at compile time.
+ *
+ * Deal with this by choosing BASE_ADDR large enough that
+ * the base address of the allocate space will be less than
+ * or equal to BASE_ADDR, and then requesting an extra BASE_ADDR
+ * bytes, so we don't have to wory about exceeding the allocation.
+ *
+ * Return: Success: Ptr to H5C_t
+ *
+ * Failure: NULL
+ *
+ * Programmer: JRM -- 9/13/07
+ *
+ *****************************************************************************/
+
+H5F_t *
+setup_cache(size_t max_cache_size,
+ size_t min_clean_size,
+ unsigned paged)
+{
+ char filename[512];
+ hbool_t show_progress = FALSE;
+ hbool_t verbose = TRUE;
+ int mile_stone = 1;
+ hid_t fid = -1;
+ H5F_t * file_ptr = NULL;
+ H5C_t * cache_ptr = NULL;
+ H5F_t * ret_val = NULL;
+ haddr_t actual_base_addr;
+ hid_t fapl_id = H5P_DEFAULT;
+ hid_t fcpl_id = H5P_DEFAULT;
+
+ if(show_progress) /* 1 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ saved_fid = -1;
+
+ if(pass) {
+ if((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) == FAIL) {
+ pass = FALSE;
+ failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n";
+ }
+ }
+
+ if(pass && paged) {
+ /* Set up paged aggregation strategy */
+ if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)1) == FAIL) {
+ pass = FALSE;
+ failure_mssg = "H5Pset_file_space_strategy() failed.\n";
+ H5Pclose(fcpl_id);
+ fcpl_id = H5P_DEFAULT;
+ }
+ }
+
+ if(pass && paged) {
+ /* Set up file space page size to BASE_ADDR */
+ if(H5Pset_file_space_page_size(fcpl_id, (hsize_t)BASE_ADDR) == FAIL) {
+ pass = FALSE;
+ failure_mssg = "H5Pset_file_space_page_size() failed.\n";
+ H5Pclose(fcpl_id);
+ fcpl_id = H5P_DEFAULT;
+ }
+ }
+
+ if(pass)
+ saved_fcpl_id = fcpl_id;
+
+ /* setup the file name */
+ if(pass) {
+ if(NULL == h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))) {
+ pass = FALSE;
+ failure_mssg = "h5_fixname() failed.\n";
+ }
+ }
+
+ if(show_progress) /* 2 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ if(pass && try_core_file_driver) {
+ if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == FAIL) {
+ pass = FALSE;
+ failure_mssg = "H5Pcreate(H5P_FILE_ACCESS) failed.\n";
+ }
+ else if(H5Pset_fapl_core(fapl_id, MAX_ADDR, FALSE) < 0) {
+ H5Pclose(fapl_id);
+ fapl_id = H5P_DEFAULT;
+ pass = FALSE;
+ failure_mssg = "H5P_set_fapl_core() failed.\n";
+ }
+ else if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) {
+ core_file_driver_failed = TRUE;
+
+ if(verbose)
+ HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", FUNC);
+ } else {
+ saved_fapl_id = fapl_id;
+ }
+ }
+
+ if(show_progress) /* 3 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ /* if we either aren't using the core file driver, or a create
+ * with the core file driver failed, try again with a regular file.
+ * If this fails, we are cooked.
+ */
+ if(pass && fid < 0) {
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id);
+ saved_fid = fid;
+
+ if(fid < 0) {
+ pass = FALSE;
+ failure_mssg = "H5Fcreate() failed.";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC);
+ } /* end if */
+ } /* end if */
+
+ /* Push API context */
+ H5CX_push();
+
+ if(show_progress) /* 4 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ if(pass) {
+ HDassert(fid >= 0);
+ saved_fid = fid;
+ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
+ pass = FALSE;
+ failure_mssg = "H5Fflush() failed.";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
+ }
+ else {
+ file_ptr = (H5F_t *)H5I_object_verify(fid, H5I_FILE);
+ if(file_ptr == NULL) {
+ pass = FALSE;
+ failure_mssg = "Can't get file_ptr.";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
+ }
+ }
+ }
+
+ if(show_progress) /* 5 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ if(pass) {
+
+ /* A bit of fancy footwork here:
+ *
+ * The call to H5Fcreate() allocates an instance of H5C_t,
+ * initializes it, and stores its address in f->shared->cache.
+ *
+ * We don't want to use this cache, as it has a bunch of extra
+ * initialization that may change over time, and in any case
+ * it will not in general be configured the way we want it.
+ *
+ * We used to deal with this problem by storing the file pointer
+ * in another instance of H5C_t, and then ignoring the original
+ * version. However, this strategy doesn't work any more, as
+ * we can't store the file pointer in the instance of H5C_t,
+ * and we have modified many cache routines to use a file
+ * pointer to look up the target cache.
+ *
+ * Thus we now make note of the address of the instance of
+ * H5C_t created by the call to H5Fcreate(), set
+ * file_ptr->shared->cache to NULL, call H5C_create()
+ * to allocate a new instance of H5C_t for test purposes,
+ * and store than new instance's address in
+ * file_ptr->shared->cache.
+ *
+ * On shut down, we call H5C_dest on our instance of H5C_t,
+ * set file_ptr->shared->cache to point to the original
+ * instance, and then close the file normally.
+ */
+
+ HDassert(saved_cache == NULL);
+ saved_cache = file_ptr->shared->cache;
+ file_ptr->shared->cache = NULL;
+
+ cache_ptr = H5C_create(max_cache_size,
+ min_clean_size,
+ (NUMBER_OF_ENTRY_TYPES - 1),
+ types,
+ check_write_permitted,
+ TRUE,
+ NULL,
+ NULL);
+
+ file_ptr->shared->cache = cache_ptr;
+ }
+
+ if(show_progress) /* 6 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ if(pass) {
+ if(cache_ptr == NULL) {
+ pass = FALSE;
+ failure_mssg = "H5C_create() failed.";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: H5C_create() failed.\n", FUNC);
+ }
+ else if(cache_ptr->magic != H5C__H5C_T_MAGIC) {
+ pass = FALSE;
+ failure_mssg = "Bad cache_ptr magic.";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", FUNC);
+ }
+ }
+
+ if(show_progress) /* 7 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ if(pass) { /* allocate space for test entries */
+ actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR));
+
+ if(actual_base_addr == HADDR_UNDEF) {
+ pass = FALSE;
+ failure_mssg = "H5MF_alloc() failed.";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", FUNC);
+ } else if(actual_base_addr > BASE_ADDR) {
+ /* If this happens, must increase BASE_ADDR so that the
+ * actual_base_addr is <= BASE_ADDR. This should only happen
+ * if the size of the superblock is increase.
+ */
+ pass = FALSE;
+ failure_mssg = "actual_base_addr > BASE_ADDR";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", FUNC);
+ }
+
+ saved_actual_base_addr = actual_base_addr;
+ }
+
+ if(show_progress) /* 8 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ if(pass) {
+ /* Need to set this else all cache tests will fail */
+ cache_ptr->ignore_tags = TRUE;
+
+ H5C_stats__reset(cache_ptr);
+ ret_val = file_ptr;
+ }
+
+ if(show_progress) /* 9 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ return(ret_val);
+} /* setup_cache() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: takedown_cache()
+ *
+ * Purpose: Flush the specified cache and destroy it. If requested,
+ * dump stats first. Then close and delete the associate
+ * file.
+ *
+ * If pass is FALSE, do nothing.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 9/14/07
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+takedown_cache(H5F_t * file_ptr,
+ hbool_t dump_stats,
+ hbool_t dump_detailed_stats)
+{
+ char filename[512];
+
+ if ( file_ptr != NULL ) {
+ H5C_t * cache_ptr = file_ptr->shared->cache;
+
+ if ( dump_stats ) {
+
+ H5C_stats(cache_ptr, "test cache", dump_detailed_stats);
+ }
+
+ if ( H5C_prep_for_file_close(file_ptr) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "unexpected failure of prep for file close.\n";
+ }
+
+ flush_cache(file_ptr, TRUE, FALSE, FALSE);
+
+ H5C_dest(file_ptr);
+
+ if ( saved_cache != NULL ) {
+
+ file_ptr->shared->cache = saved_cache;
+ saved_cache = NULL;
+ }
+
+ }
+
+ if ( saved_fapl_id != H5P_DEFAULT ) {
+
+ H5Pclose(saved_fapl_id);
+ saved_fapl_id = H5P_DEFAULT;
+ }
+
+ if ( saved_fcpl_id != H5P_DEFAULT ) {
+ H5Pclose(saved_fcpl_id);
+ saved_fcpl_id = H5P_DEFAULT;
+ }
+
+ if ( saved_fid != -1 ) {
+
+ if ( H5F_addr_defined(saved_actual_base_addr) ) {
+
+ if ( NULL == file_ptr ) {
+ file_ptr = (H5F_t *)H5I_object_verify(saved_fid, H5I_FILE);
+ HDassert ( file_ptr );
+ }
+
+ H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, saved_actual_base_addr,
+ (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR));
+ saved_actual_base_addr = HADDR_UNDEF;
+ }
+
+ if ( H5Fclose(saved_fid) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "couldn't close test file.";
+
+ } else {
+
+ saved_fid = -1;
+
+ }
+
+ /* Pop API context */
+ H5CX_pop();
+
+ if ( ( ! try_core_file_driver ) || ( core_file_driver_failed ) ) {
+
+ if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
+ == NULL ) {
+
+ pass = FALSE;
+ failure_mssg = "h5_fixname() failed.\n";
+ }
+
+ if ( HDremove(filename) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "couldn't delete test file.";
+
+ }
+ }
+ }
+
+ return;
+
+} /* takedown_cache() */
+
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -36439,14 +36918,14 @@ main(void)
express_test = GetTestExpress();
- printf("=========================================\n");
- printf("Internal cache tests\n");
- printf(" express_test = %d\n", express_test);
- printf("=========================================\n");
+ HDprintf("=========================================\n");
+ HDprintf("Internal cache tests\n");
+ HDprintf(" express_test = %d\n", express_test);
+ HDprintf("=========================================\n");
if(create_entry_arrays() < 0) {
- printf("ERROR: Unable to create entries arrays. Aborting.\n");
+ HDprintf("ERROR: Unable to create entries arrays. Aborting.\n");
return EXIT_FAILURE;
} /* end if */
diff --git a/test/cache_api.c b/test/cache_api.c
index 7c0ffa3..1e1a2c9 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -14,8 +14,8 @@
/* Programmer: John Mainzer
* 11/10/05
*
- * This file contains tests for the API calls associated
- * with the cache implemented in H5C.c
+ * This file contains tests for the API calls associated
+ * with the cache implemented in H5C.c
*/
#include "cache_common.h"
@@ -24,6 +24,11 @@
/* global variable declarations: */
+const char *FILENAME[] = {
+ "cache_api_test",
+ NULL
+};
+
/* macro definitions */
/* private function declarations: */
@@ -36,7 +41,7 @@ static hbool_t check_fapl_mdc_api_errs(void);
static hbool_t check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id);
-
+
/**************************************************************************/
/**************************************************************************/
/********************************* tests: *********************************/
@@ -104,8 +109,8 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
- /* int metadata_write_strategy = */
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY
+ /* int metadata_write_strategy = */
+ H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
H5AC_cache_config_t scratch;
H5C_auto_size_ctl_t default_auto_size_ctl;
@@ -207,7 +212,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* setup the file name */
if ( pass ) {
- if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
+ if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
== NULL ) {
pass = FALSE;
@@ -355,7 +360,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* setup the file name */
if ( pass ) {
- if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
+ if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
== NULL ) {
pass = FALSE;
@@ -495,7 +500,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
} /* check_fapl_mdc_api_calls() */
-
+
/*-------------------------------------------------------------------------
* Function: check_file_mdc_api_calls()
*
@@ -560,8 +565,8 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
- /* int metadata_write_strategy = */
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY
+ /* int metadata_write_strategy = */
+ H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
H5AC_cache_config_t mod_config_2 =
{
@@ -595,8 +600,8 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
- /* int metadata_write_strategy = */
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY
+ /* int metadata_write_strategy = */
+ H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
H5AC_cache_config_t mod_config_3 =
{
@@ -630,8 +635,8 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ FALSE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
- /* int metadata_write_strategy = */
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY
+ /* int metadata_write_strategy = */
+ H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
H5AC_cache_config_t mod_config_4 =
{
@@ -666,8 +671,8 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.1f,
/* int dirty_bytes_threshold = */ (256 * 1024),
- /* int metadata_write_strategy = */
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY
+ /* int metadata_write_strategy = */
+ H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
if(paged)
@@ -688,7 +693,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* setup the file name */
if ( pass ) {
- if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
+ if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
== NULL ) {
pass = FALSE;
@@ -813,9 +818,9 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
else {
HDfprintf(stdout, "H5Fget_mdc_size() reports:\n");
- HDfprintf(stdout, " max_size: %ld, min_clean_size: %ld\n",
+ HDfprintf(stdout, " max_size: %ld, min_clean_size: %ld\n",
(long)max_size, (long)min_clean_size);
- HDfprintf(stdout, " cur_size: %ld, cur_num_entries: %d\n",
+ HDfprintf(stdout, " cur_size: %ld, cur_num_entries: %d\n",
(long)cur_size, cur_num_entries);
}
#endif
@@ -846,7 +851,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
}
if ( ! pass ) {
-
+
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
}
@@ -854,14 +859,14 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
} /* check_file_mdc_api_calls() */
-
+
/*-------------------------------------------------------------------------
- * Function: mdc_api_call_smoke_check()
+ * Function: mdc_api_call_smoke_check()
*
* Purpose: Initial basic functional test to see if there are problems
* with the cache API calls.
*
- * NOTE: This test takes some time to run and checks the
+ * NOTE: This test takes some time to run and checks the
* HDF5TestExpress environment variable.
*
* Return: Test pass status (TRUE/FALSE)
@@ -933,8 +938,8 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
- /* int metadata_write_strategy = */
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY
+ /* int metadata_write_strategy = */
+ H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
H5AC_cache_config_t mod_config_2 =
{
@@ -968,8 +973,8 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
- /* int metadata_write_strategy = */
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY
+ /* int metadata_write_strategy = */
+ H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
H5AC_cache_config_t mod_config_3 =
{
@@ -1003,8 +1008,8 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* hbool_t apply_empty_reserve = */ TRUE,
/* double empty_reserve = */ 0.05f,
/* int dirty_bytes_threshold = */ (256 * 1024),
- /* int metadata_write_strategy = */
- H5AC__DEFAULT_METADATA_WRITE_STRATEGY
+ /* int metadata_write_strategy = */
+ H5AC__DEFAULT_METADATA_WRITE_STRATEGY
};
if(paged)
@@ -1034,7 +1039,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* setup the file name */
if ( pass ) {
- if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
+ if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
== NULL ) {
pass = FALSE;
@@ -1117,9 +1122,9 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* create the dataset */
if ( pass ) {
- sprintf(dset_name, "/dset%03d", i);
+ HDsprintf(dset_name, "/dset%03d", i);
dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE,
- dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT);
+ dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT);
if ( dataset_ids[i] < 0 ) {
@@ -1327,7 +1332,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
pass = FALSE;
failure_mssg = "slab validation failed.";
#else /* as above */
- fprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n",
+ HDfprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, m);
#endif
}
@@ -1448,7 +1453,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
pass = FALSE;
failure_mssg = "slab validation failed.";
#if 0 /* as above */
- fprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n",
+ HDfprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, m);
#endif
}
@@ -1523,9 +1528,9 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
}
if ( pass ) {
-
+
PASSED();
-
+
} else {
H5_FAILED();
@@ -1561,7 +1566,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
*-------------------------------------------------------------------------
*/
-#define NUM_INVALID_CONFIGS 36
+#define NUM_INVALID_CONFIGS 36
static H5AC_cache_config_t * invalid_configs = NULL;
static H5AC_cache_config_t *
@@ -1737,7 +1742,7 @@ init_invalid_configs(void) {
} /* initialize_invalid_configs() */
-
+
/*-------------------------------------------------------------------------
* Function: check_fapl_mdc_api_errs()
*
@@ -1913,7 +1918,7 @@ check_fapl_mdc_api_errs(void)
} /* check_fapl_mdc_api_errs() */
-
+
/*-------------------------------------------------------------------------
* Function: check_file_mdc_api_errs()
*
@@ -1963,7 +1968,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
HDfprintf(stdout, "%s: calling h5_fixname().\n", FUNC);
}
- if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
+ if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
== NULL ) {
pass = FALSE;
@@ -2259,7 +2264,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
} /* check_file_mdc_api_errs() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -2285,10 +2290,10 @@ main(void)
express_test = GetTestExpress();
- printf("===================================\n");
- printf("Cache API tests\n");
- printf(" express_test = %d\n", express_test);
- printf("===================================\n");
+ HDprintf("===================================\n");
+ HDprintf("Cache API tests\n");
+ HDprintf(" express_test = %d\n", express_test);
+ HDprintf("===================================\n");
/* Initialize invalid configurations.
diff --git a/test/cache_common.c b/test/cache_common.c
index 2cc188e..ae2a9cc 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -14,54 +14,15 @@
/* Programmer: John Mainzer
* 10/27/05
*
- * This file contains common code for tests of the cache
- * implemented in H5C.c
+ * This file contains common code for tests of the cache
+ * implemented in H5C.c
*/
#include "H5CXprivate.h" /* API Contexts */
-#include "H5MFprivate.h"
#include "H5MMprivate.h"
-#include "cache_common.h"
-
-
-/* global variable declarations: */
-const char *FILENAME[] = {
- "cache_test",
- "cache_api_test",
- NULL
-};
+#include "cache_common.h"
-hid_t saved_fapl_id = H5P_DEFAULT; /* store the fapl id here between
- * cache setup and takedown. Note
- * that if saved_fapl_id == H5P_DEFAULT,
- * we assume that there is no fapl to
- * close.
- */
-
-hid_t saved_fcpl_id = H5P_DEFAULT; /* store the fcpl id here between
- * cache setup and takedown. Note
- * that if saved_fcpl_id == H5P_DEFAULT,
- * we assume that there is no fcpl to
- * close.
- */
-hid_t saved_fid = -1; /* store the file id here between cache setup
- * and takedown.
- */
-
-H5C_t * saved_cache = NULL; /* store the pointer to the instance of
- * of H5C_t created by H5Fcreate()
- * here between test cache setup and
- * shutdown.
- */
-
-haddr_t saved_actual_base_addr = HADDR_UNDEF; /* Store the address of the
- space allocated for cache items in the file between
- cache setup & takedown */
-
-hbool_t write_permitted = TRUE;
hbool_t pass = TRUE; /* set to false on error */
-hbool_t try_core_file_driver = FALSE;
-hbool_t core_file_driver_failed = FALSE;
const char *failure_mssg = NULL;
static test_entry_t *pico_entries = NULL, *orig_pico_entries = NULL;
@@ -131,37 +92,37 @@ static herr_t variable_image_len(const void *thing, size_t *image_len_ptr);
static herr_t notify_image_len(const void *thing, size_t *image_len_ptr);
static herr_t pico_pre_serialize(H5F_t *f, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t nano_pre_serialize(H5F_t *f, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t micro_pre_serialize(H5F_t *f, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t tiny_pre_serialize(H5F_t *f, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t small_pre_serialize(H5F_t *f, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t medium_pre_serialize(H5F_t *f, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t large_pre_serialize(H5F_t *f, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t huge_pre_serialize(H5F_t *f, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t monster_pre_serialize(H5F_t *f, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t variable_pre_serialize(H5F_t *f, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t notify_pre_serialize(H5F_t *f, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t pico_serialize(const H5F_t *f, void *image_ptr,
@@ -214,11 +175,11 @@ static void *deserialize(const void *image_ptr, size_t len, void *udata_ptr,
hbool_t *dirty_ptr, int32_t entry_type);
static herr_t image_len(const void *thing, size_t *image_len_ptr, int32_t entry_type);
static herr_t pre_serialize(H5F_t *f, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr,
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr,
unsigned *flags_ptr);
-static herr_t serialize(const H5F_t *f, void *image_ptr, size_t len,
+static herr_t serialize(const H5F_t *f, void *image_ptr, size_t len,
void *thing);
-static herr_t notify(H5C_notify_action_t action, void *thing, int32_t
+static herr_t notify(H5C_notify_action_t action, void *thing, int32_t
entry_type);
static herr_t free_icr(test_entry_t *entry, int32_t entry_type);
@@ -290,7 +251,7 @@ const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES] =
NOTIFY_ALT_BASE_ADDR
};
-
+
/* Callback classes */
static const H5C_class_t pico_class[1] = {{
PICO_ENTRY_TYPE,
@@ -497,16 +458,16 @@ const H5C_class_t *types[NUMBER_OF_ENTRY_TYPES] = {
/* address translation functions: */
-
+
/*-------------------------------------------------------------------------
- * Function: addr_to_type_and_index
+ * Function: addr_to_type_and_index
*
- * Purpose: Given an address, compute the type and index of the
- * associated entry.
+ * Purpose: Given an address, compute the type and index of the
+ * associated entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/10/04
*
*-------------------------------------------------------------------------
@@ -576,46 +537,17 @@ addr_to_type_and_index(haddr_t addr,
/* Call back functions: */
-
-/*-------------------------------------------------------------------------
- *
- * Function: check_if_write_permitted
- *
- * Purpose: Determine if a write is permitted under the current
- * circumstances, and set *write_permitted_ptr accordingly.
- * As a general rule it is, but when we are running in parallel
- * mode with collective I/O, we must ensure that a read cannot
- * cause a write.
- *
- * In the event of failure, the value of *write_permitted_ptr
- * is undefined.
- *
- * Return: Non-negative on success/Negative on failure.
- *
- * Programmer: John Mainzer, 5/15/04
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-check_write_permitted(const H5F_t H5_ATTR_UNUSED *f, hbool_t *write_permitted_ptr)
-{
- HDassert( write_permitted_ptr );
-
- *write_permitted_ptr = write_permitted;
- return(SUCCEED);
-} /* check_write_permitted() */
-
/*-------------------------------------------------------------------------
- * Function: get_initial_load_size & friends
+ * Function: get_initial_load_size & friends
*
- * Purpose: Query the image size for loading an entry. The helper
+ * Purpose: Query the image size for loading an entry. The helper
* functions funnel into get_initial_load_size proper.
*
- * Return: SUCCEED
+ * Return: SUCCEED
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* 5/18/10
*
*-------------------------------------------------------------------------
@@ -715,16 +647,16 @@ notify_get_initial_load_size(void *udata, size_t *image_length)
return get_initial_load_size(udata, image_length, NOTIFY_ENTRY_TYPE);
}
-
+
/*-------------------------------------------------------------------------
- * Function: get_final_load_size & friends
+ * Function: get_final_load_size & friends
*
- * Purpose: Query the final image size for loading an entry. The helper
+ * Purpose: Query the final image size for loading an entry. The helper
* functions funnel into get_final_load_size proper.
*
- * Return: SUCCEED
+ * Return: SUCCEED
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* 11/18/16
*
*-------------------------------------------------------------------------
@@ -773,19 +705,19 @@ variable_get_final_load_size(const void *image, size_t image_len,
return get_final_load_size(image, image_len, udata, actual_len, VARIABLE_ENTRY_TYPE);
}
-
+
/*-------------------------------------------------------------------------
- * Function: verify_chksum & friends
- * (only done for VARIABLE_ENTRY_TYPE which has a speculative read)
+ * Function: verify_chksum & friends
+ * (only done for VARIABLE_ENTRY_TYPE which has a speculative read)
*
- * Purpose: Simulate checksum verification:
- * --check is ok only after 'max_verify_ct' is reached
- * --otherwise check is not ok
+ * Purpose: Simulate checksum verification:
+ * --check is ok only after 'max_verify_ct' is reached
+ * --otherwise check is not ok
*
- * Return: TRUE: checksum is ok
- * FALSE: checksum is not ok
+ * Return: TRUE: checksum is ok
+ * FALSE: checksum is not ok
*
- * Programmer:
+ * Programmer:
*
*-------------------------------------------------------------------------
*/
@@ -816,9 +748,9 @@ verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void
HDassert(entry->addr == addr);
if(++entry->verify_ct >= entry->max_verify_ct)
- return(TRUE);
- else
- return(FALSE);
+ return(TRUE);
+ else
+ return(FALSE);
} /* verify_chksum() */
@@ -828,17 +760,17 @@ variable_verify_chksum(const void *image, size_t len, void *udata)
return verify_chksum(image, len, udata, VARIABLE_ENTRY_TYPE);
}
-
+
/*-------------------------------------------------------------------------
- * Function: deserialize & friends
+ * Function: deserialize & friends
*
- * Purpose: deserialize the entry. The helper functions verify that the
- * correct version of deserialize is being called, and then call
- * deserialize proper.
+ * Purpose: deserialize the entry. The helper functions verify that the
+ * correct version of deserialize is being called, and then call
+ * deserialize proper.
*
- * Return: void * (pointer to the in core representation of the entry)
+ * Return: void * (pointer to the in core representation of the entry)
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 9/20/07
*
*-------------------------------------------------------------------------
@@ -890,7 +822,7 @@ deserialize(const void *image, size_t len, void *udata, hbool_t *dirty,
HDfprintf(stdout, "expected *image = 0x%x\n",
(int)(idx & 0xFF));
} /* end if */
- HDassert((*((const char *)image)) == (char)(idx & 0xFF));
+ HDassert((*((const char *)image)) == (char)(idx & 0xFF));
} /* end if */
else {
if((*(((const char *)image) + 2)) != (char)(idx & 0xFF)) {
@@ -904,9 +836,9 @@ deserialize(const void *image, size_t len, void *udata, hbool_t *dirty,
(int)(idx & 0xFF),
(int)((idx & 0xFF00) >> 8));
} /* end if */
- HDassert((*((const char *)image)) == (char)(type & 0xFF));
- HDassert((*(((const char *)image) + 1)) == (char)((idx & 0xFF00) >> 8));
- HDassert((*(((const char *)image) + 2)) == (char)(idx & 0xFF));
+ HDassert((*((const char *)image)) == (char)(type & 0xFF));
+ HDassert((*(((const char *)image) + 1)) == (char)((idx & 0xFF00) >> 8));
+ HDassert((*(((const char *)image) + 2)) == (char)(idx & 0xFF));
} /* end else */
} /* end if */
@@ -984,18 +916,18 @@ notify_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty)
return deserialize(image, len, udata, dirty, NOTIFY_ENTRY_TYPE);
}
-
+
/*-------------------------------------------------------------------------
- * Function: image_len & friends
+ * Function: image_len & friends
*
- * Purpose: Return the real (and possibly reduced) length of the image.
- * The helper functions verify that the correct version of
- * deserialize is being called, and then call deserialize
- * proper.
+ * Purpose: Return the real (and possibly reduced) length of the image.
+ * The helper functions verify that the correct version of
+ * deserialize is being called, and then call deserialize
+ * proper.
*
- * Return: SUCCEED
+ * Return: SUCCEED
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 9/19/07
*
*-------------------------------------------------------------------------
@@ -1026,10 +958,10 @@ image_len(const void *thing, size_t *image_length, int32_t entry_type)
HDassert(entry == &(base_addr[idx]));
if(type != VARIABLE_ENTRY_TYPE)
- HDassert(entry->size == entry_sizes[type]);
+ HDassert(entry->size == entry_sizes[type]);
else {
- HDassert(entry->size <= entry_sizes[type]);
- HDassert(entry->size > 0);
+ HDassert(entry->size <= entry_sizes[type]);
+ HDassert(entry->size > 0);
} /* end else */
*image_length = entry->size;
@@ -1103,21 +1035,21 @@ notify_image_len(const void *thing, size_t *image_length)
return image_len(thing, image_length, NOTIFY_ENTRY_TYPE);
}
-
+
/*-------------------------------------------------------------------------
- * Function: pre_serialize & friends
+ * Function: pre_serialize & friends
*
- * Purpose: Pre_serialize the supplied entry. For now this consistes of
- * executing any flush operations and loading the appropriate
- * values into *new_addr_ptr, *new_len_ptr, and *flags_ptr.
+ * Purpose: Pre_serialize the supplied entry. For now this consistes of
+ * executing any flush operations and loading the appropriate
+ * values into *new_addr_ptr, *new_len_ptr, and *flags_ptr.
*
- * The helper functions verify that the correct version of
- * serialize is being called, and then call serialize
- * proper.
+ * The helper functions verify that the correct version of
+ * serialize is being called, and then call serialize
+ * proper.
*
- * Return: SUCCEED if successful, FAIL otherwise.
+ * Return: SUCCEED if successful, FAIL otherwise.
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 8/07/14
*
*-------------------------------------------------------------------------
@@ -1215,7 +1147,7 @@ pico_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
@@ -1228,7 +1160,7 @@ nano_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
@@ -1241,7 +1173,7 @@ micro_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
@@ -1254,7 +1186,7 @@ tiny_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
@@ -1267,7 +1199,7 @@ small_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
@@ -1280,7 +1212,7 @@ medium_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
@@ -1293,7 +1225,7 @@ large_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
@@ -1306,7 +1238,7 @@ huge_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
@@ -1319,7 +1251,7 @@ monster_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
@@ -1332,7 +1264,7 @@ variable_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
@@ -1345,28 +1277,28 @@ notify_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
-
+
/*-------------------------------------------------------------------------
- * Function: serialize & friends
+ * Function: serialize & friends
*
- * Purpose: Serialize the supplied entry. For now this consistes of
- * loading the type and index of the entry into the first
- * three bytes of the image (if it is long enough -- if not
- * just load the low order byte of the index into the first
- * byte of the image).
+ * Purpose: Serialize the supplied entry. For now this consistes of
+ * loading the type and index of the entry into the first
+ * three bytes of the image (if it is long enough -- if not
+ * just load the low order byte of the index into the first
+ * byte of the image).
*
- * The helper functions verify that the correct version of
- * serialize is being called, and then call serialize
- * proper.
+ * The helper functions verify that the correct version of
+ * serialize is being called, and then call serialize
+ * proper.
*
- * Return: SUCCEED if successful, FAIL otherwise.
+ * Return: SUCCEED if successful, FAIL otherwise.
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 9/19/07
*
*-------------------------------------------------------------------------
@@ -1407,14 +1339,14 @@ serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thin
if((type == PICO_ENTRY_TYPE) || (type == VARIABLE_ENTRY_TYPE) ||
(type == NOTIFY_ENTRY_TYPE )) {
- HDassert(entry->size >= PICO_ENTRY_SIZE);
- *((char *)image_ptr) = (char)((entry->index) & 0xFF);
+ HDassert(entry->size >= PICO_ENTRY_SIZE);
+ *((char *)image_ptr) = (char)((entry->index) & 0xFF);
} /* end if */
else {
- HDassert(entry->size >= NANO_ENTRY_SIZE);
- *((char *)image_ptr) = (char)((entry->type) & 0xFF);
- *(((char *)image_ptr) + 1) = (char)(((entry->index) & 0xFF00) >> 8);
- *(((char *)image_ptr) + 2) = (char)((entry->index) & 0xFF);
+ HDassert(entry->size >= NANO_ENTRY_SIZE);
+ *((char *)image_ptr) = (char)((entry->type) & 0xFF);
+ *(((char *)image_ptr) + 1) = (char)(((entry->index) & 0xFF00) >> 8);
+ *(((char *)image_ptr) + 2) = (char)((entry->index) & 0xFF);
} /* end else */
/* We no longer do the actual write through an callback -- this is
@@ -1424,7 +1356,7 @@ serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thin
entry->is_dirty = FALSE;
if(entry->flush_dep_npar > 0) {
- HDassert(entry->flush_dep_ndirty_chd == 0);
+ HDassert(entry->flush_dep_ndirty_chd == 0);
mark_flush_dep_clean(entry);
} /* end if */
@@ -1432,9 +1364,9 @@ serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thin
* as initialized.
*/
if(entry->at_main_addr)
- entry->written_to_main_addr = TRUE;
+ entry->written_to_main_addr = TRUE;
else
- entry->written_to_alt_addr = TRUE;
+ entry->written_to_alt_addr = TRUE;
/* do book keeping */
(entry->serializes)++;
@@ -1474,7 +1406,7 @@ small_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void
}
herr_t
-medium_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len,
+medium_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len,
void *thing)
{
return serialize(f, image_ptr, len, thing);
@@ -1493,37 +1425,37 @@ huge_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void
}
herr_t
-monster_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len,
+monster_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len,
void *thing)
{
return serialize(f, image_ptr, len, thing);
}
herr_t
-variable_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len,
+variable_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len,
void *thing)
{
return serialize(f, image_ptr, len, thing);
}
herr_t
-notify_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len,
+notify_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len,
void *thing)
{
return serialize(f, image_ptr, len, thing);
}
-
+
/*-------------------------------------------------------------------------
- * Function: notify & friends
+ * Function: notify & friends
*
- * Purpose: Record notifications of cache events for the entry.
+ * Purpose: Record notifications of cache events for the entry.
* The helper functions verify that the correct version of notify
* is being called, and then call notify proper.
*
- * Return: SUCCEED
+ * Return: SUCCEED
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* 4/28/09
*
*-------------------------------------------------------------------------
@@ -1552,8 +1484,8 @@ notify(H5C_notify_action_t action, void *thing, int32_t entry_type)
/* Increment count for appropriate action */
switch(action) {
- case H5C_NOTIFY_ACTION_AFTER_INSERT: /* Entry has been added */
- case H5C_NOTIFY_ACTION_AFTER_LOAD: /* to the cache. */
+ case H5C_NOTIFY_ACTION_AFTER_INSERT: /* Entry has been added */
+ case H5C_NOTIFY_ACTION_AFTER_LOAD: /* to the cache. */
entry->notify_after_insert_count++;
break;
@@ -1564,8 +1496,8 @@ notify(H5C_notify_action_t action, void *thing, int32_t entry_type)
case H5C_NOTIFY_ACTION_CHILD_CLEANED:
case H5C_NOTIFY_ACTION_CHILD_UNSERIALIZED:
case H5C_NOTIFY_ACTION_CHILD_SERIALIZED:
- /* do nothing */
- break;
+ /* do nothing */
+ break;
case H5C_NOTIFY_ACTION_BEFORE_EVICT: /* Entry is about to be evicted from cache */
entry->notify_before_evict_count++;
@@ -1584,25 +1516,25 @@ notify_notify(H5C_notify_action_t action, void *thing)
return(notify(action, thing, NOTIFY_ENTRY_TYPE));
}
-
+
/*-------------------------------------------------------------------------
- * Function: free_icr & friends
+ * Function: free_icr & friends
*
- * Purpose: Nominally, this callback is supposed to free the
- * in core representation of the entry.
+ * Purpose: Nominally, this callback is supposed to free the
+ * in core representation of the entry.
*
- * In the context of this test bed, we use it to do
- * do all the processing we used to do on a destroy.
- * In particular, we use it to release all the pins
- * that this entry may have on other entries.
+ * In the context of this test bed, we use it to do
+ * do all the processing we used to do on a destroy.
+ * In particular, we use it to release all the pins
+ * that this entry may have on other entries.
*
- * The helper functions verify that the correct version of
- * serialize is being called, and then call free_icr
- * proper.
+ * The helper functions verify that the correct version of
+ * serialize is being called, and then call free_icr
+ * proper.
*
- * Return: SUCCEED
+ * Return: SUCCEED
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 9/19/07
*
*-------------------------------------------------------------------------
@@ -1628,43 +1560,43 @@ free_icr(test_entry_t *entry, int32_t entry_type)
HDassert(entry->header.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC);
HDassert(entry->header.size == entry->size);
HDassert((entry->type == VARIABLE_ENTRY_TYPE) ||
- (entry->size == entry_sizes[entry->type]));
+ (entry->size == entry_sizes[entry->type]));
HDassert(entry->header.tl_next == NULL);
HDassert(entry->header.tl_prev == NULL);
if(entry->num_pins > 0) {
int i;
- for(i = 0; i < entry->num_pins; i++) {
+ for(i = 0; i < entry->num_pins; i++) {
test_entry_t *pinned_entry;
test_entry_t *pinned_base_addr;
- pinned_base_addr = entries[entry->pin_type[i]];
- pinned_entry = &(pinned_base_addr[entry->pin_idx[i]]);
+ pinned_base_addr = entries[entry->pin_type[i]];
+ pinned_entry = &(pinned_base_addr[entry->pin_idx[i]]);
- HDassert(0 <= pinned_entry->type);
+ HDassert(0 <= pinned_entry->type);
HDassert(pinned_entry->type < NUMBER_OF_ENTRY_TYPES);
- HDassert(pinned_entry->type == entry->pin_type[i]);
- HDassert(pinned_entry->index >= 0);
- HDassert(pinned_entry->index <= max_indices[pinned_entry->type]);
- HDassert(pinned_entry->index == entry->pin_idx[i]);
- HDassert(pinned_entry == pinned_entry->self);
- HDassert(pinned_entry->header.is_pinned);
- HDassert(pinned_entry->is_pinned);
- HDassert(pinned_entry->pinning_ref_count > 0);
-
- pinned_entry->pinning_ref_count--;
-
- if(pinned_entry->pinning_ref_count <= 0) {
+ HDassert(pinned_entry->type == entry->pin_type[i]);
+ HDassert(pinned_entry->index >= 0);
+ HDassert(pinned_entry->index <= max_indices[pinned_entry->type]);
+ HDassert(pinned_entry->index == entry->pin_idx[i]);
+ HDassert(pinned_entry == pinned_entry->self);
+ HDassert(pinned_entry->header.is_pinned);
+ HDassert(pinned_entry->is_pinned);
+ HDassert(pinned_entry->pinning_ref_count > 0);
+
+ pinned_entry->pinning_ref_count--;
+
+ if(pinned_entry->pinning_ref_count <= 0) {
HDassert(pinned_entry->file_ptr);
- unpin_entry(pinned_entry->type, pinned_entry->index);
- } /* end if */
+ unpin_entry(pinned_entry->type, pinned_entry->index);
+ } /* end if */
- entry->pin_type[i] = -1;
- entry->pin_idx[i] = -1;
- } /* end if */
- entry->num_pins = 0;
+ entry->pin_type[i] = -1;
+ entry->pin_idx[i] = -1;
+ } /* end if */
+ entry->num_pins = 0;
} /* end if */
entry->destroyed = TRUE;
@@ -1739,7 +1671,7 @@ notify_free_icr(void *thing)
return free_icr((test_entry_t *)thing, NOTIFY_ENTRY_TYPE);
}
-
+
/**************************************************************************/
/**************************************************************************/
/************************** test utility functions: ***********************/
@@ -1747,16 +1679,16 @@ notify_free_icr(void *thing)
/**************************************************************************/
/*-------------------------------------------------------------------------
- * Function: add_flush_op
+ * Function: add_flush_op
*
- * Purpose: Do nothing if pass is FALSE on entry.
+ * Purpose: Do nothing if pass is FALSE on entry.
*
* Otherwise, add the specified flush operation to the
* target instance of test_entry_t.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 9/1/06
*
*-------------------------------------------------------------------------
@@ -1764,12 +1696,12 @@ notify_free_icr(void *thing)
void
add_flush_op(int target_type,
- int target_idx,
- int op_code,
- int type,
- int idx,
- hbool_t flag,
- size_t new_size,
+ int target_idx,
+ int op_code,
+ int type,
+ int idx,
+ hbool_t flag,
+ size_t new_size,
unsigned * order_ptr)
{
int i;
@@ -1778,10 +1710,10 @@ add_flush_op(int target_type,
HDassert( ( 0 <= target_type ) && ( target_type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= target_idx ) &&
- ( target_idx <= max_indices[target_type] ) );
+ ( target_idx <= max_indices[target_type] ) );
HDassert( ( 0 <= op_code ) && ( op_code <= FLUSH_OP__MAX_OP ) );
HDassert( ( op_code != FLUSH_OP__RESIZE ) ||
- ( type == VARIABLE_ENTRY_TYPE ) );
+ ( type == VARIABLE_ENTRY_TYPE ) );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) );
HDassert( new_size <= VARIABLE_ENTRY_SIZE );
@@ -1800,15 +1732,15 @@ add_flush_op(int target_type,
HDassert( target_entry_ptr->index == target_idx );
HDassert( target_entry_ptr->type == target_type );
HDassert( target_entry_ptr == target_entry_ptr->self );
- HDassert( target_entry_ptr->num_flush_ops < MAX_FLUSH_OPS );
+ HDassert( target_entry_ptr->num_flush_ops < MAX_FLUSH_OPS );
- i = (target_entry_ptr->num_flush_ops)++;
- (target_entry_ptr->flush_ops)[i].op_code = op_code;
- (target_entry_ptr->flush_ops)[i].type = type;
- (target_entry_ptr->flush_ops)[i].idx = idx;
- (target_entry_ptr->flush_ops)[i].flag = flag;
- (target_entry_ptr->flush_ops)[i].size = new_size;
- (target_entry_ptr->flush_ops)[i].order_ptr = order_ptr;
+ i = (target_entry_ptr->num_flush_ops)++;
+ (target_entry_ptr->flush_ops)[i].op_code = op_code;
+ (target_entry_ptr->flush_ops)[i].type = type;
+ (target_entry_ptr->flush_ops)[i].idx = idx;
+ (target_entry_ptr->flush_ops)[i].flag = flag;
+ (target_entry_ptr->flush_ops)[i].size = new_size;
+ (target_entry_ptr->flush_ops)[i].order_ptr = order_ptr;
}
@@ -1816,24 +1748,24 @@ add_flush_op(int target_type,
} /* add_flush_op() */
-
+
/*-------------------------------------------------------------------------
- * Function: create_pinned_entry_dependency
+ * Function: create_pinned_entry_dependency
*
- * Purpose: Do nothing if pass is FALSE on entry.
+ * Purpose: Do nothing if pass is FALSE on entry.
*
* Otherwise, set up a pinned entry dependency so we can
* test the pinned entry modifications to the flush routine.
*
- * Given the types and indicies of the pinned and pinning
- * entries, add the pinned entry to the list of pinned
- * entries in the pinning entry, increment the
- * pinning reference count of the pinned entry, and
- * if that count was zero initially, pin the entry.
+ * Given the types and indicies of the pinned and pinning
+ * entries, add the pinned entry to the list of pinned
+ * entries in the pinning entry, increment the
+ * pinning reference count of the pinned entry, and
+ * if that count was zero initially, pin the entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/10/04
*
*-------------------------------------------------------------------------
@@ -1841,10 +1773,10 @@ add_flush_op(int target_type,
void
create_pinned_entry_dependency(H5F_t * file_ptr,
- int pinning_type,
+ int pinning_type,
int pinning_idx,
- int pinned_type,
- int pinned_idx)
+ int pinned_type,
+ int pinned_idx)
{
test_entry_t * pinning_base_addr;
test_entry_t * pinning_entry_ptr;
@@ -1854,13 +1786,13 @@ create_pinned_entry_dependency(H5F_t * file_ptr,
if ( pass ) {
HDassert( ( 0 <= pinning_type ) &&
- ( pinning_type < NUMBER_OF_ENTRY_TYPES ) );
+ ( pinning_type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= pinning_idx ) &&
- ( pinning_idx <= max_indices[pinning_type] ) );
+ ( pinning_idx <= max_indices[pinning_type] ) );
HDassert( ( 0 <= pinned_type ) &&
- ( pinned_type < NUMBER_OF_ENTRY_TYPES ) );
+ ( pinned_type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= pinned_idx ) &&
- ( pinned_idx <= max_indices[pinned_type] ) );
+ ( pinned_idx <= max_indices[pinned_type] ) );
pinning_base_addr = entries[pinning_type];
pinning_entry_ptr = &(pinning_base_addr[pinning_idx]);
@@ -1871,47 +1803,47 @@ create_pinned_entry_dependency(H5F_t * file_ptr,
HDassert( pinning_entry_ptr->index == pinning_idx );
HDassert( pinning_entry_ptr->type == pinning_type );
HDassert( pinning_entry_ptr == pinning_entry_ptr->self );
- HDassert( pinning_entry_ptr->num_pins < MAX_PINS );
+ HDassert( pinning_entry_ptr->num_pins < MAX_PINS );
HDassert( pinning_entry_ptr->index == pinning_idx );
HDassert( pinning_entry_ptr->type == pinning_type );
HDassert( pinning_entry_ptr == pinning_entry_ptr->self );
- HDassert( ! ( pinning_entry_ptr->is_protected ) );
+ HDassert( ! ( pinning_entry_ptr->is_protected ) );
- pinning_entry_ptr->pin_type[pinning_entry_ptr->num_pins] = pinned_type;
- pinning_entry_ptr->pin_idx[pinning_entry_ptr->num_pins] = pinned_idx;
- (pinning_entry_ptr->num_pins)++;
+ pinning_entry_ptr->pin_type[pinning_entry_ptr->num_pins] = pinned_type;
+ pinning_entry_ptr->pin_idx[pinning_entry_ptr->num_pins] = pinned_idx;
+ (pinning_entry_ptr->num_pins)++;
if ( pinned_entry_ptr->pinning_ref_count == 0 ) {
- protect_entry(file_ptr, pinned_type, pinned_idx);
- unprotect_entry(file_ptr, pinned_type, pinned_idx, H5C__PIN_ENTRY_FLAG);
- }
+ protect_entry(file_ptr, pinned_type, pinned_idx);
+ unprotect_entry(file_ptr, pinned_type, pinned_idx, H5C__PIN_ENTRY_FLAG);
+ }
- (pinned_entry_ptr->pinning_ref_count)++;
+ (pinned_entry_ptr->pinning_ref_count)++;
}
return;
} /* create_pinned_entry_dependency() */
-
+
/*-------------------------------------------------------------------------
- * Function: dirty_entry
+ * Function: dirty_entry
*
- * Purpose: Given a pointer to a cache, an entry type, and an index,
- * dirty the target entry.
+ * Purpose: Given a pointer to a cache, an entry type, and an index,
+ * dirty the target entry.
*
- * If the dirty_pin parameter is true, verify that the
- * target entry is in the cache and is pinned. If it
- * isn't, scream and die. If it is, use the
- * H5C_mark_entry_dirty() call to dirty it.
+ * If the dirty_pin parameter is true, verify that the
+ * target entry is in the cache and is pinned. If it
+ * isn't, scream and die. If it is, use the
+ * H5C_mark_entry_dirty() call to dirty it.
*
- * Do nothing if pass is false on entry.
+ * Do nothing if pass is false on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/10/04
*
*-------------------------------------------------------------------------
@@ -1921,7 +1853,7 @@ void
dirty_entry(H5F_t * file_ptr,
int32_t type,
int32_t idx,
- hbool_t dirty_pin)
+ hbool_t dirty_pin)
{
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -1937,54 +1869,54 @@ dirty_entry(H5F_t * file_ptr,
HDassert(cache_ptr);
- if ( ! entry_in_cache(cache_ptr, type, idx) ) {
+ if ( ! entry_in_cache(cache_ptr, type, idx) ) {
- pass = FALSE;
+ pass = FALSE;
failure_mssg = "entry to be dirty pinned is not in cache.";
- } else {
+ } else {
base_addr = entries[type];
entry_ptr = &(base_addr[idx]);
- HDassert( entry_ptr->index == idx );
- HDassert( entry_ptr->type == type );
+ HDassert( entry_ptr->index == idx );
+ HDassert( entry_ptr->type == type );
HDassert( entry_ptr == entry_ptr->self );
- if ( ! ( (entry_ptr->header).is_pinned ) ) {
+ if ( ! ( (entry_ptr->header).is_pinned ) ) {
pass = FALSE;
failure_mssg = "entry to be dirty pinned is not pinned.";
} else {
- mark_entry_dirty(type, idx);
+ mark_entry_dirty(type, idx);
- }
- }
+ }
+ }
} else {
- protect_entry(file_ptr, type, idx);
+ protect_entry(file_ptr, type, idx);
unprotect_entry(file_ptr, type, idx, H5C__DIRTIED_FLAG);
- }
+ }
}
return;
} /* dirty_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: execute_flush_op
+ * Function: execute_flush_op
*
- * Purpose: Given a pointer to an instance of struct flush_op, execute
- * it.
+ * Purpose: Given a pointer to an instance of struct flush_op, execute
+ * it.
*
- * Do nothing if pass is false on entry.
+ * Do nothing if pass is false on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 9/1/06
*
*-------------------------------------------------------------------------
@@ -1992,9 +1924,9 @@ dirty_entry(H5F_t * file_ptr,
void
execute_flush_op(H5F_t * file_ptr,
- struct test_entry_t * entry_ptr,
- struct flush_op * op_ptr,
- unsigned * flags_ptr)
+ struct test_entry_t * entry_ptr,
+ struct flush_op * op_ptr,
+ unsigned * flags_ptr)
{
H5C_t * cache_ptr;
@@ -2026,56 +1958,56 @@ execute_flush_op(H5F_t * file_ptr,
if ( pass ) {
- switch ( op_ptr->op_code )
- {
- case FLUSH_OP__NO_OP:
- break;
+ switch ( op_ptr->op_code )
+ {
+ case FLUSH_OP__NO_OP:
+ break;
- case FLUSH_OP__DIRTY:
- HDassert( ( entry_ptr->type != op_ptr->type ) ||
- ( entry_ptr->index != op_ptr->idx ) );
+ case FLUSH_OP__DIRTY:
+ HDassert( ( entry_ptr->type != op_ptr->type ) ||
+ ( entry_ptr->index != op_ptr->idx ) );
- dirty_entry(file_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag);
- break;
+ dirty_entry(file_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag);
+ break;
case FLUSH_OP__RESIZE:
- if ( ( entry_ptr->type == op_ptr->type ) &&
+ if ( ( entry_ptr->type == op_ptr->type ) &&
( entry_ptr->index == op_ptr->idx ) ) {
/* the flush operation is acting on the entry to
- * which it is attached. Handle this here:
- */
+ * which it is attached. Handle this here:
+ */
HDassert( entry_ptr->type == VARIABLE_ENTRY_TYPE );
- HDassert( op_ptr->size > 0 );
- HDassert( op_ptr->size <= VARIABLE_ENTRY_SIZE );
+ HDassert( op_ptr->size > 0 );
+ HDassert( op_ptr->size <= VARIABLE_ENTRY_SIZE );
entry_ptr->size = op_ptr->size;
- (*flags_ptr) |= H5C__SERIALIZE_RESIZED_FLAG;
+ (*flags_ptr) |= H5C__SERIALIZE_RESIZED_FLAG;
- entry_ptr->flush_op_self_resize_in_progress = TRUE;
+ entry_ptr->flush_op_self_resize_in_progress = TRUE;
- } else {
+ } else {
- /* change the size of some other entry */
+ /* change the size of some other entry */
- resize_entry(file_ptr, op_ptr->type, op_ptr->idx,
+ resize_entry(file_ptr, op_ptr->type, op_ptr->idx,
op_ptr->size, op_ptr->flag);
- }
- break;
+ }
+ break;
- case FLUSH_OP__MOVE:
- if((entry_ptr->type == op_ptr->type) &&
+ case FLUSH_OP__MOVE:
+ if((entry_ptr->type == op_ptr->type) &&
(entry_ptr->index == op_ptr->idx)) {
/* the flush operation is acting on the entry to
- * which it is attached. Handle this here:
- */
+ * which it is attached. Handle this here:
+ */
- HDassert(((*flags_ptr) & H5C__SERIALIZE_RESIZED_FLAG) != 0);
+ HDassert(((*flags_ptr) & H5C__SERIALIZE_RESIZED_FLAG) != 0);
(*flags_ptr) |= H5C__SERIALIZE_MOVED_FLAG;
- if(op_ptr->flag) {
+ if(op_ptr->flag) {
HDassert(entry_ptr->addr == entry_ptr->alt_addr);
entry_ptr->addr = entry_ptr->main_addr;
entry_ptr->at_main_addr = TRUE;
@@ -2085,65 +2017,65 @@ execute_flush_op(H5F_t * file_ptr,
entry_ptr->addr = entry_ptr->alt_addr;
entry_ptr->at_main_addr = FALSE;
} /* end else */
- } /* end if */
+ } /* end if */
else
- move_entry(cache_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag);
- break;
+ move_entry(cache_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag);
+ break;
- case FLUSH_OP__ORDER:
+ case FLUSH_OP__ORDER:
HDassert( op_ptr->order_ptr );
entry_ptr->flush_order = *op_ptr->order_ptr;
(*op_ptr->order_ptr)++;
- break;
-
- case FLUSH_OP__EXPUNGE:
- /* the expunge flush op exists to allow us to simulate the
- * case in which an entry is removed from the cashe as the
- * the result of the flush of a second entry. At present,
- * this can only happen via the take ownership flag, but
- * we will make this test feature more general to as to make
- * tests easier to write.
- *
- * When this operation is executed, the target entry is
- * removed from the cache without being flushed if dirty
- * via the expunge_entry() test function (which calls
- * H5C_expunge_entry()). Note that this flush operation
- * must always be executed on an entry other than the
- * entry being flushed.
- */
- HDassert( ( entry_ptr->type != op_ptr->type ) ||
+ break;
+
+ case FLUSH_OP__EXPUNGE:
+ /* the expunge flush op exists to allow us to simulate the
+ * case in which an entry is removed from the cashe as the
+ * the result of the flush of a second entry. At present,
+ * this can only happen via the take ownership flag, but
+ * we will make this test feature more general to as to make
+ * tests easier to write.
+ *
+ * When this operation is executed, the target entry is
+ * removed from the cache without being flushed if dirty
+ * via the expunge_entry() test function (which calls
+ * H5C_expunge_entry()). Note that this flush operation
+ * must always be executed on an entry other than the
+ * entry being flushed.
+ */
+ HDassert( ( entry_ptr->type != op_ptr->type ) ||
( entry_ptr->index != op_ptr->idx ) );
- expunge_entry(file_ptr, op_ptr->type, op_ptr->idx);
- break;
+ expunge_entry(file_ptr, op_ptr->type, op_ptr->idx);
+ break;
- case FLUSH_OP__DEST_FLUSH_DEP:
- HDassert( ( entry_ptr->type != op_ptr->type ) ||
+ case FLUSH_OP__DEST_FLUSH_DEP:
+ HDassert( ( entry_ptr->type != op_ptr->type ) ||
( entry_ptr->index != op_ptr->idx ) );
- destroy_flush_dependency(op_ptr->type, op_ptr->idx,
+ destroy_flush_dependency(op_ptr->type, op_ptr->idx,
entry_ptr->type, entry_ptr->index);
break;
- default:
+ default:
pass = FALSE;
failure_mssg = "Undefined flush op code.";
- break;
- }
+ break;
+ }
}
return;
} /* execute_flush_op() */
-
+
/*-------------------------------------------------------------------------
- * Function: entry_in_cache
+ * Function: entry_in_cache
*
- * Purpose: Given a pointer to a cache, an entry type, and an index,
- * determine if the entry is currently in the cache.
+ * Purpose: Given a pointer to a cache, an entry type, and an index,
+ * determine if the entry is currently in the cache.
*
- * Return: TRUE if the entry is in the cache, and FALSE otherwise.
+ * Return: TRUE if the entry is in the cache, and FALSE otherwise.
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/10/04
*
*-------------------------------------------------------------------------
@@ -2183,7 +2115,7 @@ entry_in_cache(H5C_t * cache_ptr,
} /* entry_in_cache() */
-
+
/*-------------------------------------------------------------------------
* Function: create_entry_arrays
*
@@ -2191,7 +2123,7 @@ entry_in_cache(H5C_t * cache_ptr,
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
+ * Programmer: Dana Robinson
* Spring 2016
*
*-------------------------------------------------------------------------
@@ -2299,7 +2231,7 @@ error:
} /* create_entry_arrays() */
-
+
/*-------------------------------------------------------------------------
* Function: free_entry_arrays
*
@@ -2307,7 +2239,7 @@ error:
*
* Return: void
*
- * Programmer: Dana Robinson
+ * Programmer: Dana Robinson
* Spring 2016
*
*-------------------------------------------------------------------------
@@ -2365,15 +2297,15 @@ free_entry_arrays(void)
} /* free_entry_arrays() */
-
+
/*-------------------------------------------------------------------------
- * Function: reset_entries
+ * Function: reset_entries
*
- * Purpose: reset the contents of the entries arrays to known values.
+ * Purpose: reset the contents of the entries arrays to known values.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/10/04
*
*-------------------------------------------------------------------------
@@ -2517,15 +2449,15 @@ reset_entries(void)
} /* reset_entries() */
-
+
/*-------------------------------------------------------------------------
* Function: resize_entry
*
* Purpose: Given a pointer to a cache, an entry type, an index, and
- * a new size, set the size of the target entry to the new size.
+ * a new size, set the size of the target entry to the new size.
*
- * Note that at present, the type of the entry must be
- * VARIABLE_ENTRY_TYPE.
+ * Note that at present, the type of the entry must be
+ * VARIABLE_ENTRY_TYPE.
*
* Do nothing if pass is false on entry.
*
@@ -2542,7 +2474,7 @@ resize_entry(H5F_t * file_ptr,
int32_t type,
int32_t idx,
size_t new_size,
- hbool_t in_cache)
+ hbool_t in_cache)
{
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -2605,28 +2537,28 @@ resize_entry(H5F_t * file_ptr,
}
} else {
- protect_entry(file_ptr, type, idx);
+ protect_entry(file_ptr, type, idx);
resize_entry(file_ptr, type, idx, new_size, TRUE);
- unprotect_entry(file_ptr, type, idx, H5C__DIRTIED_FLAG);
- }
+ unprotect_entry(file_ptr, type, idx, H5C__DIRTIED_FLAG);
+ }
}
return;
} /* resize_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: verify_clean
+ * Function: verify_clean
*
- * Purpose: Verify that all cache entries are marked as clean. If any
- * are not, set pass to FALSE.
+ * Purpose: Verify that all cache entries are marked as clean. If any
+ * are not, set pass to FALSE.
*
- * Do nothing if pass is FALSE on entry.
+ * Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/10/04
*
*-------------------------------------------------------------------------
@@ -2654,7 +2586,7 @@ verify_clean(void)
for ( j = 0; j <= max_index; j++ )
{
if ( ( base_addr[j].header.is_dirty ) ||
- ( base_addr[j].is_dirty ) ) {
+ ( base_addr[j].is_dirty ) ) {
dirty_count++;
}
@@ -2672,19 +2604,19 @@ verify_clean(void)
} /* verify_clean() */
-
+
/*-------------------------------------------------------------------------
- * Function: verify_entry_status
+ * Function: verify_entry_status
*
- * Purpose: Verify that a list of entries have the expected status.
- * If any discrepencies are found, set the failure message
- * and set pass to FALSE.
+ * Purpose: Verify that a list of entries have the expected status.
+ * If any discrepencies are found, set the failure message
+ * and set pass to FALSE.
*
- * Do nothing if pass is FALSE on entry.
+ * Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 10/8/04
*
*-------------------------------------------------------------------------
@@ -2692,9 +2624,9 @@ verify_clean(void)
void
verify_entry_status(H5C_t * cache_ptr,
- int tag,
- int num_entries,
- struct expected_entry_status expected[])
+ int tag,
+ int num_entries,
+ struct expected_entry_status expected[])
{
static char msg[256];
int i;
@@ -2707,222 +2639,222 @@ verify_entry_status(H5C_t * cache_ptr,
hbool_t in_cache = FALSE; /* will set to TRUE if necessary */
unsigned u; /* Local index variable */
- if ( ( ! expected[i].in_cache ) &&
+ if ( ( ! expected[i].in_cache ) &&
( ( expected[i].is_protected ) || ( expected[i].is_pinned ) ) ) {
- pass = FALSE;
- sprintf(msg, "%d: Contradictory data in expected[%d].\n", tag, i);
- failure_mssg = msg;
- }
+ pass = FALSE;
+ HDsprintf(msg, "%d: Contradictory data in expected[%d].\n", tag, i);
+ failure_mssg = msg;
+ }
if ( ( ! expected[i].in_cache ) &&
( expected[i].is_dirty ) &&
( ! entry_ptr->expunged ) ) {
- pass = FALSE;
- sprintf(msg,
+ pass = FALSE;
+ HDsprintf(msg,
"%d: expected[%d] specs non-expunged, dirty, non-resident.\n",
tag, i);
- failure_mssg = msg;
+ failure_mssg = msg;
}
if ( pass ) {
- in_cache = entry_in_cache(cache_ptr, expected[i].entry_type,
- expected[i].entry_index);
+ in_cache = entry_in_cache(cache_ptr, expected[i].entry_type,
+ expected[i].entry_index);
- if ( in_cache != expected[i].in_cache ) {
+ if ( in_cache != expected[i].in_cache ) {
- pass = FALSE;
- sprintf(msg,
- "%d entry (%d, %d) in cache actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)in_cache,
- (int)expected[i].in_cache);
- failure_mssg = msg;
- }
- }
+ pass = FALSE;
+ HDsprintf(msg,
+ "%d entry (%d, %d) in cache actual/expected = %d/%d.\n",
+ tag,
+ (int)expected[i].entry_type,
+ (int)expected[i].entry_index,
+ (int)in_cache,
+ (int)expected[i].in_cache);
+ failure_mssg = msg;
+ }
+ }
if ( pass ) {
- if ( entry_ptr->size != expected[i].size ) {
+ if ( entry_ptr->size != expected[i].size ) {
- pass = FALSE;
- sprintf(msg,
+ pass = FALSE;
+ HDsprintf(msg,
"%d entry (%d, %d) size actual/expected = %ld/%ld.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (long)(entry_ptr->size),
- (long)expected[i].size);
- failure_mssg = msg;
- }
- }
+ tag,
+ (int)expected[i].entry_type,
+ (int)expected[i].entry_index,
+ (long)(entry_ptr->size),
+ (long)expected[i].size);
+ failure_mssg = msg;
+ }
+ }
if ( ( pass ) && ( in_cache ) ) {
- if ( entry_ptr->header.size != expected[i].size ) {
+ if ( entry_ptr->header.size != expected[i].size ) {
- pass = FALSE;
- sprintf(msg,
+ pass = FALSE;
+ HDsprintf(msg,
"%d entry (%d, %d) header size actual/expected = %ld/%ld.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (long)(entry_ptr->header.size),
- (long)expected[i].size);
- failure_mssg = msg;
- }
- }
+ tag,
+ (int)expected[i].entry_type,
+ (int)expected[i].entry_index,
+ (long)(entry_ptr->header.size),
+ (long)expected[i].size);
+ failure_mssg = msg;
+ }
+ }
- if ( pass ) {
+ if ( pass ) {
- if ( entry_ptr->at_main_addr != expected[i].at_main_addr ) {
+ if ( entry_ptr->at_main_addr != expected[i].at_main_addr ) {
- pass = FALSE;
- sprintf(msg,
+ pass = FALSE;
+ HDsprintf(msg,
"%d entry (%d, %d) at main addr actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->at_main_addr),
- (int)expected[i].at_main_addr);
- failure_mssg = msg;
- }
- }
+ tag,
+ (int)expected[i].entry_type,
+ (int)expected[i].entry_index,
+ (int)(entry_ptr->at_main_addr),
+ (int)expected[i].at_main_addr);
+ failure_mssg = msg;
+ }
+ }
- if ( pass ) {
+ if ( pass ) {
- if ( entry_ptr->is_dirty != expected[i].is_dirty ) {
+ if ( entry_ptr->is_dirty != expected[i].is_dirty ) {
- pass = FALSE;
- sprintf(msg,
+ pass = FALSE;
+ HDsprintf(msg,
"%d entry (%d, %d) is_dirty actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->is_dirty),
- (int)expected[i].is_dirty);
- failure_mssg = msg;
- }
- }
+ tag,
+ (int)expected[i].entry_type,
+ (int)expected[i].entry_index,
+ (int)(entry_ptr->is_dirty),
+ (int)expected[i].is_dirty);
+ failure_mssg = msg;
+ }
+ }
- if ( ( pass ) && ( in_cache ) ) {
+ if ( ( pass ) && ( in_cache ) ) {
- if ( entry_ptr->header.is_dirty != expected[i].is_dirty ) {
+ if ( entry_ptr->header.is_dirty != expected[i].is_dirty ) {
- pass = FALSE;
- sprintf(msg,
+ pass = FALSE;
+ HDsprintf(msg,
"%d entry (%d, %d) header is_dirty actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->header.is_dirty),
- (int)expected[i].is_dirty);
- failure_mssg = msg;
- }
- }
+ tag,
+ (int)expected[i].entry_type,
+ (int)expected[i].entry_index,
+ (int)(entry_ptr->header.is_dirty),
+ (int)expected[i].is_dirty);
+ failure_mssg = msg;
+ }
+ }
- if ( pass ) {
+ if ( pass ) {
- if ( entry_ptr->is_protected != expected[i].is_protected ) {
+ if ( entry_ptr->is_protected != expected[i].is_protected ) {
- pass = FALSE;
- sprintf(msg,
+ pass = FALSE;
+ HDsprintf(msg,
"%d entry (%d, %d) is_protected actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->is_protected),
- (int)expected[i].is_protected);
- failure_mssg = msg;
- }
- }
+ tag,
+ (int)expected[i].entry_type,
+ (int)expected[i].entry_index,
+ (int)(entry_ptr->is_protected),
+ (int)expected[i].is_protected);
+ failure_mssg = msg;
+ }
+ }
- if ( ( pass ) && ( in_cache ) ) {
+ if ( ( pass ) && ( in_cache ) ) {
- if ( entry_ptr->header.is_protected != expected[i].is_protected ) {
+ if ( entry_ptr->header.is_protected != expected[i].is_protected ) {
- pass = FALSE;
- sprintf(msg,
+ pass = FALSE;
+ HDsprintf(msg,
"%d entry (%d, %d) header is_protected actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->header.is_protected),
- (int)expected[i].is_protected);
- failure_mssg = msg;
- }
- }
+ tag,
+ (int)expected[i].entry_type,
+ (int)expected[i].entry_index,
+ (int)(entry_ptr->header.is_protected),
+ (int)expected[i].is_protected);
+ failure_mssg = msg;
+ }
+ }
- if ( pass ) {
+ if ( pass ) {
- if ( entry_ptr->is_pinned != expected[i].is_pinned ) {
+ if ( entry_ptr->is_pinned != expected[i].is_pinned ) {
- pass = FALSE;
- sprintf(msg,
+ pass = FALSE;
+ HDsprintf(msg,
"%d entry (%d, %d) is_pinned actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->is_pinned),
- (int)expected[i].is_pinned);
- failure_mssg = msg;
- }
- }
+ tag,
+ (int)expected[i].entry_type,
+ (int)expected[i].entry_index,
+ (int)(entry_ptr->is_pinned),
+ (int)expected[i].is_pinned);
+ failure_mssg = msg;
+ }
+ }
- if ( pass ) {
+ if ( pass ) {
- if ( entry_ptr->is_corked != expected[i].is_corked) {
+ if ( entry_ptr->is_corked != expected[i].is_corked) {
- pass = FALSE;
- sprintf(msg,
+ pass = FALSE;
+ HDsprintf(msg,
"%d entry (%d, %d) is_corked actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->is_corked),
- (int)expected[i].is_corked);
- failure_mssg = msg;
- }
- }
+ tag,
+ (int)expected[i].entry_type,
+ (int)expected[i].entry_index,
+ (int)(entry_ptr->is_corked),
+ (int)expected[i].is_corked);
+ failure_mssg = msg;
+ }
+ }
- if ( ( pass ) && ( in_cache ) ) {
+ if ( ( pass ) && ( in_cache ) ) {
- if ( entry_ptr->header.is_pinned != expected[i].is_pinned ) {
+ if ( entry_ptr->header.is_pinned != expected[i].is_pinned ) {
- pass = FALSE;
- sprintf(msg,
+ pass = FALSE;
+ HDsprintf(msg,
"%d entry (%d, %d) header is_pinned actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->header.is_pinned),
- (int)expected[i].is_pinned);
- failure_mssg = msg;
- }
- }
+ tag,
+ (int)expected[i].entry_type,
+ (int)expected[i].entry_index,
+ (int)(entry_ptr->header.is_pinned),
+ (int)expected[i].is_pinned);
+ failure_mssg = msg;
+ }
+ }
- if ( pass ) {
+ if ( pass ) {
if ( ( entry_ptr->deserialized != expected[i].deserialized ) ||
- ( entry_ptr->serialized != expected[i].serialized ) ||
- ( entry_ptr->destroyed != expected[i].destroyed ) ) {
+ ( entry_ptr->serialized != expected[i].serialized ) ||
+ ( entry_ptr->destroyed != expected[i].destroyed ) ) {
- pass = FALSE;
- sprintf(msg,
+ pass = FALSE;
+ HDsprintf(msg,
"%d entry (%d,%d) deserialized = %d(%d), serialized = %d(%d), dest = %d(%d)\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->deserialized),
- (int)(expected[i].deserialized),
- (int)(entry_ptr->serialized),
- (int)(expected[i].serialized),
- (int)(entry_ptr->destroyed),
- (int)(expected[i].destroyed));
+ tag,
+ (int)expected[i].entry_type,
+ (int)expected[i].entry_index,
+ (int)(entry_ptr->deserialized),
+ (int)(expected[i].deserialized),
+ (int)(entry_ptr->serialized),
+ (int)(expected[i].serialized),
+ (int)(entry_ptr->destroyed),
+ (int)(expected[i].destroyed));
failure_mssg = msg;
}
}
@@ -2933,7 +2865,7 @@ verify_entry_status(H5C_t * cache_ptr,
if ( pass ) {
if ( entry_ptr->flush_dep_npar != expected[i].flush_dep_npar ) {
pass = FALSE;
- sprintf(msg,
+ HDsprintf(msg,
"%d entry (%d, %d) flush_dep_npar actual/expected = %u/%u.\n",
tag,
expected[i].entry_type,
@@ -2946,7 +2878,7 @@ verify_entry_status(H5C_t * cache_ptr,
if ( ( pass ) && ( in_cache ) ) {
if ( entry_ptr->header.flush_dep_nparents != expected[i].flush_dep_npar ) {
pass = FALSE;
- sprintf(msg,
+ HDsprintf(msg,
"%d entry (%d, %d) header flush_dep_nparents actual/expected = %u/%u.\n",
tag,
expected[i].entry_type,
@@ -2963,7 +2895,7 @@ verify_entry_status(H5C_t * cache_ptr,
for ( u = 0; u < entry_ptr->flush_dep_npar; u++ ) {
if ( entry_ptr->flush_dep_par_type[u] != expected[i].flush_dep_par_type[u] ) {
pass = FALSE;
- sprintf(msg,
+ HDsprintf(msg,
"%d entry (%d, %d) flush_dep_par_type[%u] actual/expected = %d/%d.\n",
tag,
expected[i].entry_type,
@@ -2979,7 +2911,7 @@ verify_entry_status(H5C_t * cache_ptr,
for ( u = 0; u < entry_ptr->flush_dep_npar; u++ ) {
if ( entry_ptr->flush_dep_par_idx[u] != expected[i].flush_dep_par_idx[u] ) {
pass = FALSE;
- sprintf(msg,
+ HDsprintf(msg,
"%d entry (%d, %d) flush_dep_par_idx[%u] actual/expected = %d/%d.\n",
tag,
expected[i].entry_type,
@@ -2996,7 +2928,7 @@ verify_entry_status(H5C_t * cache_ptr,
if ( pass ) {
if ( entry_ptr->flush_dep_nchd != expected[i].flush_dep_nchd ) {
pass = FALSE;
- sprintf(msg,
+ HDsprintf(msg,
"%d entry (%d, %d) flush_dep_nchd actual/expected = %u/%u.\n",
tag,
expected[i].entry_type,
@@ -3009,7 +2941,7 @@ verify_entry_status(H5C_t * cache_ptr,
if ( ( pass ) && ( in_cache ) ) {
if ( entry_ptr->header.flush_dep_nchildren != expected[i].flush_dep_nchd ) {
pass = FALSE;
- sprintf(msg,
+ HDsprintf(msg,
"%d entry (%d, %d) header flush_dep_nchildren actual/expected = %u/%u.\n",
tag,
expected[i].entry_type,
@@ -3022,7 +2954,7 @@ verify_entry_status(H5C_t * cache_ptr,
if ( pass ) {
if ( entry_ptr->flush_dep_ndirty_chd != expected[i].flush_dep_ndirty_chd ) {
pass = FALSE;
- sprintf(msg,
+ HDsprintf(msg,
"%d entry (%d, %d) flush_dep_ndirty_chd actual/expected = %u/%u.\n",
tag,
expected[i].entry_type,
@@ -3035,7 +2967,7 @@ verify_entry_status(H5C_t * cache_ptr,
if ( ( pass ) && ( in_cache ) ) {
if ( entry_ptr->header.flush_dep_ndirty_children != expected[i].flush_dep_ndirty_chd ) {
pass = FALSE;
- sprintf(msg,
+ HDsprintf(msg,
"%d entry (%d, %d) header flush_dep_ndirty_children actual/expected = %u/%u.\n",
tag,
expected[i].entry_type,
@@ -3050,7 +2982,7 @@ verify_entry_status(H5C_t * cache_ptr,
if ( pass ) {
if ( expected[i].flush_order >= 0 && entry_ptr->flush_order != (unsigned)expected[i].flush_order ) {
pass = FALSE;
- sprintf(msg,
+ HDsprintf(msg,
"%d entry (%d, %d) flush_order actual/expected = %u/%d.\n",
tag,
expected[i].entry_type,
@@ -3068,18 +3000,18 @@ verify_entry_status(H5C_t * cache_ptr,
} /* verify_entry_status() */
-
+
/*-------------------------------------------------------------------------
- * Function: verify_unprotected
+ * Function: verify_unprotected
*
- * Purpose: Verify that no cache entries are marked as protected. If
- * any are, set pass to FALSE.
+ * Purpose: Verify that no cache entries are marked as protected. If
+ * any are, set pass to FALSE.
*
- * Do nothing if pass is FALSE on entry.
+ * Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/10/04
*
*-------------------------------------------------------------------------
@@ -3128,419 +3060,23 @@ verify_unprotected(void)
} /* verify_unprotected() */
-
-/*****************************************************************************
- *
- * Function: setup_cache()
- *
- * Purpose: Open an HDF file. This will allocate an instance and
- * initialize an associated instance of H5C_t. However,
- * we want to test an instance of H5C_t, so allocate and
- * initialize one with the file ID returned by the call to
- * H5Fcreate(). Return a pointer to this instance of H5C_t.
- *
- * Observe that we open a HDF file because the cache now
- * writes directly to file, and we need the file I/O facilities
- * associated with the file.
- *
- * To avoid tripping on error check code, must allocate enough
- * space in the file to hold all the test entries and their
- * alternates. This is a little sticky, as the addresses of
- * all the test entries are determined at compile time.
- *
- * Deal with this by choosing BASE_ADDR large enough that
- * the base address of the allocate space will be less than
- * or equal to BASE_ADDR, and then requesting an extra BASE_ADDR
- * bytes, so we don't have to wory about exceeding the allocation.
- *
- * Return: Success: Ptr to H5C_t
- *
- * Failure: NULL
- *
- * Programmer: JRM -- 9/13/07
- *
- *****************************************************************************/
-
-H5F_t *
-setup_cache(size_t max_cache_size,
- size_t min_clean_size,
- unsigned paged)
-{
- char filename[512];
- hbool_t show_progress = FALSE;
- hbool_t verbose = TRUE;
- int mile_stone = 1;
- hid_t fid = -1;
- H5F_t * file_ptr = NULL;
- H5C_t * cache_ptr = NULL;
- H5F_t * ret_val = NULL;
- haddr_t actual_base_addr;
- hid_t fapl_id = H5P_DEFAULT;
- hid_t fcpl_id = H5P_DEFAULT;
-
- if(show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- saved_fid = -1;
-
- if(pass) {
- if((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) == FAIL) {
- pass = FALSE;
- failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n";
- }
- }
-
- if(pass && paged) {
- /* Set up paged aggregation strategy */
- if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)1) == FAIL) {
- pass = FALSE;
- failure_mssg = "H5Pset_file_space_strategy() failed.\n";
- H5Pclose(fcpl_id);
- fcpl_id = H5P_DEFAULT;
- }
- }
-
- if(pass && paged) {
- /* Set up file space page size to BASE_ADDR */
- if(H5Pset_file_space_page_size(fcpl_id, (hsize_t)BASE_ADDR) == FAIL) {
- pass = FALSE;
- failure_mssg = "H5Pset_file_space_page_size() failed.\n";
- H5Pclose(fcpl_id);
- fcpl_id = H5P_DEFAULT;
- }
- }
-
- if(pass)
- saved_fcpl_id = fcpl_id;
-
- /* setup the file name */
- if(pass) {
- if(NULL == h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))) {
- pass = FALSE;
- failure_mssg = "h5_fixname() failed.\n";
- }
- }
-
- if(show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- if(pass && try_core_file_driver) {
- if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == FAIL) {
- pass = FALSE;
- failure_mssg = "H5Pcreate(H5P_FILE_ACCESS) failed.\n";
- }
- else if(H5Pset_fapl_core(fapl_id, MAX_ADDR, FALSE) < 0) {
- H5Pclose(fapl_id);
- fapl_id = H5P_DEFAULT;
- pass = FALSE;
- failure_mssg = "H5P_set_fapl_core() failed.\n";
- }
- else if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) {
- core_file_driver_failed = TRUE;
-
- if(verbose)
- HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", FUNC);
- } else {
- saved_fapl_id = fapl_id;
- }
- }
-
- if(show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- /* if we either aren't using the core file driver, or a create
- * with the core file driver failed, try again with a regular file.
- * If this fails, we are cooked.
- */
- if(pass && fid < 0) {
- fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id);
- saved_fid = fid;
-
- if(fid < 0) {
- pass = FALSE;
- failure_mssg = "H5Fcreate() failed.";
-
- if(verbose)
- HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC);
- } /* end if */
- } /* end if */
-
- /* Push API context */
- H5CX_push();
-
- if(show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- if(pass) {
- HDassert(fid >= 0);
- saved_fid = fid;
- if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
- pass = FALSE;
- failure_mssg = "H5Fflush() failed.";
-
- if(verbose)
- HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
- } else {
- file_ptr = (H5F_t *)H5I_object_verify(fid, H5I_FILE);
- if(file_ptr == NULL) {
- pass = FALSE;
- failure_mssg = "Can't get file_ptr.";
-
- if(verbose)
- HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
- }
- }
- }
-
- if(show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- if(pass) {
-
- /* A bit of fancy footwork here:
- *
- * The call to H5Fcreate() allocates an instance of H5C_t,
- * initializes it, and stores its address in f->shared->cache.
- *
- * We don't want to use this cache, as it has a bunch of extra
- * initialization that may change over time, and in any case
- * it will not in general be configured the way we want it.
- *
- * We used to deal with this problem by storing the file pointer
- * in another instance of H5C_t, and then ignoring the original
- * version. However, this strategy doesn't work any more, as
- * we can't store the file pointer in the instance of H5C_t,
- * and we have modified many cache routines to use a file
- * pointer to look up the target cache.
- *
- * Thus we now make note of the address of the instance of
- * H5C_t created by the call to H5Fcreate(), set
- * file_ptr->shared->cache to NULL, call H5C_create()
- * to allocate a new instance of H5C_t for test purposes,
- * and store than new instance's address in
- * file_ptr->shared->cache.
- *
- * On shut down, we call H5C_dest on our instance of H5C_t,
- * set file_ptr->shared->cache to point to the original
- * instance, and then close the file normally.
- */
-
- HDassert(saved_cache == NULL);
- saved_cache = file_ptr->shared->cache;
- file_ptr->shared->cache = NULL;
-
- cache_ptr = H5C_create(max_cache_size,
- min_clean_size,
- (NUMBER_OF_ENTRY_TYPES - 1),
- types,
- check_write_permitted,
- TRUE,
- NULL,
- NULL);
-
- file_ptr->shared->cache = cache_ptr;
- }
-
- if(show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- if(pass) {
- if(cache_ptr == NULL) {
- pass = FALSE;
- failure_mssg = "H5C_create() failed.";
-
- if(verbose)
- HDfprintf(stdout, "%s: H5C_create() failed.\n", FUNC);
- } else if(cache_ptr->magic != H5C__H5C_T_MAGIC) {
- pass = FALSE;
- failure_mssg = "Bad cache_ptr magic.";
-
- if(verbose)
- HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", FUNC);
- }
- }
-
- if(show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- if(pass) { /* allocate space for test entries */
- actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR));
-
- if(actual_base_addr == HADDR_UNDEF) {
- pass = FALSE;
- failure_mssg = "H5MF_alloc() failed.";
-
- if(verbose)
- HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", FUNC);
- } else if(actual_base_addr > BASE_ADDR) {
- /* If this happens, must increase BASE_ADDR so that the
- * actual_base_addr is <= BASE_ADDR. This should only happen
- * if the size of the superblock is increase.
- */
- pass = FALSE;
- failure_mssg = "actual_base_addr > BASE_ADDR";
-
- if(verbose)
- HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", FUNC);
- }
-
- saved_actual_base_addr = actual_base_addr;
- }
-
- if(show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- if(pass) {
- /* Need to set this else all cache tests will fail */
- cache_ptr->ignore_tags = TRUE;
-
- H5C_stats__reset(cache_ptr);
- ret_val = file_ptr;
- }
- if(show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
- return(ret_val);
-} /* setup_cache() */
-
-
/*-------------------------------------------------------------------------
- * Function: takedown_cache()
- *
- * Purpose: Flush the specified cache and destroy it. If requested,
- * dump stats first. Then close and delete the associate
- * file.
+ * Function: expunge_entry()
*
- * If pass is FALSE, do nothing.
+ * Purpose: Expunge the entry indicated by the type and index.
*
- * Return: void
*
- * Programmer: John Mainzer
- * 9/14/07
+ * Return: void
*
- *-------------------------------------------------------------------------
- */
-
-void
-takedown_cache(H5F_t * file_ptr,
- hbool_t dump_stats,
- hbool_t dump_detailed_stats)
-{
- char filename[512];
-
- if ( file_ptr != NULL ) {
- H5C_t * cache_ptr = file_ptr->shared->cache;
-
- if ( dump_stats ) {
-
- H5C_stats(cache_ptr, "test cache", dump_detailed_stats);
- }
-
- if ( H5C_prep_for_file_close(file_ptr) < 0 ) {
-
- pass = FALSE;
- failure_mssg = "unexpected failure of prep for file close.\n";
- }
-
- flush_cache(file_ptr, TRUE, FALSE, FALSE);
-
- H5C_dest(file_ptr);
-
- if ( saved_cache != NULL ) {
-
- file_ptr->shared->cache = saved_cache;
- saved_cache = NULL;
- }
-
- }
-
- if ( saved_fapl_id != H5P_DEFAULT ) {
-
- H5Pclose(saved_fapl_id);
- saved_fapl_id = H5P_DEFAULT;
- }
-
- if ( saved_fcpl_id != H5P_DEFAULT ) {
- H5Pclose(saved_fcpl_id);
- saved_fcpl_id = H5P_DEFAULT;
- }
-
- if ( saved_fid != -1 ) {
-
- if ( H5F_addr_defined(saved_actual_base_addr) ) {
-
- if ( NULL == file_ptr ) {
- file_ptr = (H5F_t *)H5I_object_verify(saved_fid, H5I_FILE);
- HDassert ( file_ptr );
- }
-
- H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, saved_actual_base_addr,
- (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR));
- saved_actual_base_addr = HADDR_UNDEF;
- }
-
- if ( H5Fclose(saved_fid) < 0 ) {
-
- pass = FALSE;
- failure_mssg = "couldn't close test file.";
-
- } else {
-
- saved_fid = -1;
-
- }
-
- /* Pop API context */
- H5CX_pop();
-
- if ( ( ! try_core_file_driver ) || ( core_file_driver_failed ) ) {
-
- if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
- == NULL ) {
-
- pass = FALSE;
- failure_mssg = "h5_fixname() failed.\n";
- }
-
- if ( HDremove(filename) < 0 ) {
-
- pass = FALSE;
- failure_mssg = "couldn't delete test file.";
-
- }
- }
- }
-
- return;
-
-} /* takedown_cache() */
-
-
-/*-------------------------------------------------------------------------
- * Function: expunge_entry()
- *
- * Purpose: Expunge the entry indicated by the type and index.
- *
- *
- * Return: void
- *
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 7/6/06
*
- * Changes: Added code to set entry_ptr->expunged to TRUE if
- * H5C_expunge_entry() returns without error.
+ * Changes: Added code to set entry_ptr->expunged to TRUE if
+ * H5C_expunge_entry() returns without error.
*
- * JRM -- 8/21/14
+ * JRM -- 8/21/14
*
*-------------------------------------------------------------------------
*/
@@ -3570,11 +3106,11 @@ expunge_entry(H5F_t * file_ptr,
HDassert( entry_ptr->index == idx );
HDassert( entry_ptr->type == type );
HDassert( entry_ptr == entry_ptr->self );
- HDassert( entry_ptr->cache_ptr == cache_ptr );
+ HDassert( entry_ptr->cache_ptr == cache_ptr );
HDassert( ! ( entry_ptr->header.is_protected ) );
HDassert( ! ( entry_ptr->is_protected ) );
HDassert( ! ( entry_ptr->header.is_pinned ) );
- HDassert( ! ( entry_ptr->is_pinned ) );
+ HDassert( ! ( entry_ptr->is_pinned ) );
result = H5C_expunge_entry(file_ptr, types[type], entry_ptr->addr, H5C__NO_FLAGS_SET);
@@ -3585,7 +3121,7 @@ expunge_entry(H5F_t * file_ptr,
} else {
- entry_ptr->expunged = TRUE;
+ entry_ptr->expunged = TRUE;
}
}
@@ -3593,16 +3129,16 @@ expunge_entry(H5F_t * file_ptr,
} /* expunge_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: flush_cache()
+ * Function: flush_cache()
*
- * Purpose: Flush the specified cache, destroying all entries if
+ * Purpose: Flush the specified cache, destroying all entries if
requested. If requested, dump stats first.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/23/04
*
*-------------------------------------------------------------------------
@@ -3662,18 +3198,18 @@ flush_cache(H5F_t * file_ptr,
} /* flush_cache() */
-
+
/*-------------------------------------------------------------------------
- * Function: cork_entry_type()
+ * Function: cork_entry_type()
*
- * Purpose: To "cork" an object:
- * --insert the base address of an entry type into
- * the cache's list of corked object addresses
+ * Purpose: To "cork" an object:
+ * --insert the base address of an entry type into
+ * the cache's list of corked object addresses
*
- * Return: void
+ * Return: void
*
- * Programmer: Vailin Choi
- * Jan 2014
+ * Programmer: Vailin Choi
+ * Jan 2014
*
*-------------------------------------------------------------------------
*/
@@ -3698,18 +3234,18 @@ cork_entry_type(H5F_t *file_ptr, int32_t type)
} /* cork_entry_type() */
-
+
/*-------------------------------------------------------------------------
- * Function: uncork_entry_type()
+ * Function: uncork_entry_type()
*
- * Purpose: To "uncork" an object:
- * --insert the base address of an entry type into
- * the cache's list of corked object addresses
+ * Purpose: To "uncork" an object:
+ * --insert the base address of an entry type into
+ * the cache's list of corked object addresses
*
- * Return: void
+ * Return: void
*
- * Programmer: Vailin Choi
- * Jan 2014
+ * Programmer: Vailin Choi
+ * Jan 2014
*
*-------------------------------------------------------------------------
*/
@@ -3734,17 +3270,17 @@ uncork_entry_type(H5F_t *file_ptr, int32_t type)
} /* uncork_entry_type() */
-
+
/*-------------------------------------------------------------------------
- * Function: insert_entry()
+ * Function: insert_entry()
*
- * Purpose: Insert the entry indicated by the type and index.
+ * Purpose: Insert the entry indicated by the type and index.
*
- * Do nothing if pass is false.
+ * Do nothing if pass is false.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/16/04
*
*-------------------------------------------------------------------------
@@ -3807,7 +3343,7 @@ insert_entry(H5F_t * file_ptr,
HDfprintf(stdout, "entry_ptr->header.is_protected = %d\n",
(int)(entry_ptr->header.is_protected));
HDfprintf(stdout,
- "entry_ptr->header.type != types[type] = %d\n",
+ "entry_ptr->header.type != types[type] = %d\n",
(int)(entry_ptr->header.type != types[type]));
HDfprintf(stdout,
"entry_ptr->size != entry_ptr->header.size = %d\n",
@@ -3840,17 +3376,17 @@ insert_entry(H5F_t * file_ptr,
} /* insert_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: mark_entry_dirty()
+ * Function: mark_entry_dirty()
*
- * Purpose: Mark the specified entry as dirty.
+ * Purpose: Mark the specified entry as dirty.
*
- * Do nothing if pass is FALSE on entry.
+ * Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 3/28/06
*
*-------------------------------------------------------------------------
@@ -3877,10 +3413,10 @@ mark_entry_dirty(int32_t type,
HDassert( entry_ptr->type == type );
HDassert( entry_ptr == entry_ptr->self );
HDassert( entry_ptr->header.is_protected ||
- entry_ptr->header.is_pinned );
+ entry_ptr->header.is_pinned );
was_dirty = entry_ptr->is_dirty;
- entry_ptr->is_dirty = TRUE;
+ entry_ptr->is_dirty = TRUE;
if(entry_ptr->flush_dep_npar > 0 && !was_dirty)
mark_flush_dep_dirty(entry_ptr);
@@ -3908,17 +3444,17 @@ mark_entry_dirty(int32_t type,
} /* mark_entry_dirty() */
-
+
/*-------------------------------------------------------------------------
- * Function: move_entry()
+ * Function: move_entry()
*
- * Purpose: Move the entry indicated by the type and index to its
- * main or alternate address as indicated. If the entry is
- * already at the desired entry, do nothing.
+ * Purpose: Move the entry indicated by the type and index to its
+ * main or alternate address as indicated. If the entry is
+ * already at the desired entry, do nothing.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/21/04
*
*-------------------------------------------------------------------------
@@ -3931,7 +3467,7 @@ move_entry(H5C_t * cache_ptr,
hbool_t main_addr)
{
herr_t result;
- hbool_t done = TRUE; /* will set to FALSE if we have work to do */
+ hbool_t done = TRUE; /* will set to FALSE if we have work to do */
haddr_t old_addr = HADDR_UNDEF;
haddr_t new_addr = HADDR_UNDEF;
test_entry_t * base_addr;
@@ -3991,8 +3527,8 @@ move_entry(H5C_t * cache_ptr,
if ( ! done ) {
if ( ( result < 0 ) ||
- ( ( ! ( entry_ptr->header.destroy_in_progress ) ) &&
- ( entry_ptr->header.addr != new_addr ) ) ) {
+ ( ( ! ( entry_ptr->header.destroy_in_progress ) ) &&
+ ( entry_ptr->header.addr != new_addr ) ) ) {
pass = FALSE;
failure_mssg = "error in H5C_move_entry().";
@@ -4014,17 +3550,17 @@ move_entry(H5C_t * cache_ptr,
} /* move_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: protect_entry()
+ * Function: protect_entry()
*
- * Purpose: Protect the entry indicated by the type and index.
+ * Purpose: Protect the entry indicated by the type and index.
*
- * Do nothing if pass is FALSE on entry.
+ * Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/11/04
*
*-------------------------------------------------------------------------
@@ -4058,8 +3594,8 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx)
/* Use to cork entries for the object */
H5AC_tag(baddrs, NULL);
- cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr,
- types[type], entry_ptr->addr, &entry_ptr->addr,
+ cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr,
+ types[type], entry_ptr->addr, &entry_ptr->addr,
H5C__NO_FLAGS_SET);
if ( ( cache_entry_ptr != (void *)entry_ptr ) ||
@@ -4089,7 +3625,7 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx)
HDfprintf(stdout,
"entry_ptr->addr = %d, entry_ptr->header.addr = %d\n",
(int)(entry_ptr->addr), (int)(entry_ptr->header.addr));
- HDfprintf(stdout,
+ HDfprintf(stdout,
"entry_ptr->verify_ct = %d, entry_ptr->max_verify_ct = %d\n",
entry_ptr->verify_ct, entry_ptr->max_verify_ct);
H5Eprint2(H5E_DEFAULT, stdout);
@@ -4100,35 +3636,35 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx)
} /* end if */
else {
- HDassert( ( entry_ptr->cache_ptr == NULL ) ||
- ( entry_ptr->cache_ptr == cache_ptr ) );
+ HDassert( ( entry_ptr->cache_ptr == NULL ) ||
+ ( entry_ptr->cache_ptr == cache_ptr ) );
- entry_ptr->cache_ptr = cache_ptr;
- entry_ptr->file_ptr = file_ptr;
+ entry_ptr->cache_ptr = cache_ptr;
+ entry_ptr->file_ptr = file_ptr;
entry_ptr->is_protected = TRUE;
} /* end else */
if(entry_ptr->header.tag_info && entry_ptr->header.tag_info->corked)
- entry_ptr->is_corked = TRUE;
+ entry_ptr->is_corked = TRUE;
HDassert(((entry_ptr->header).type)->id == type);
} /* end if */
} /* protect_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: protect_entry_ro()
+ * Function: protect_entry_ro()
*
- * Purpose: Do a read only protect the entry indicated by the type
- * and index.
+ * Purpose: Do a read only protect the entry indicated by the type
+ * and index.
*
- * Do nothing if pass is FALSE on entry.
+ * Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/1/07
*
*-------------------------------------------------------------------------
@@ -4159,8 +3695,8 @@ protect_entry_ro(H5F_t * file_ptr,
HDassert( entry_ptr->type == type );
HDassert( entry_ptr == entry_ptr->self );
HDassert( ( ! ( entry_ptr->is_protected ) ) ||
- ( ( entry_ptr->is_read_only ) &&
- ( entry_ptr->ro_ref_count > 0 ) ) );
+ ( ( entry_ptr->is_read_only ) &&
+ ( entry_ptr->ro_ref_count > 0 ) ) );
cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr,
types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG);
@@ -4178,14 +3714,14 @@ protect_entry_ro(H5F_t * file_ptr,
} else {
- HDassert( ( entry_ptr->cache_ptr == NULL ) ||
- ( entry_ptr->cache_ptr == cache_ptr ) );
+ HDassert( ( entry_ptr->cache_ptr == NULL ) ||
+ ( entry_ptr->cache_ptr == cache_ptr ) );
- entry_ptr->cache_ptr = cache_ptr;
- entry_ptr->file_ptr = file_ptr;
+ entry_ptr->cache_ptr = cache_ptr;
+ entry_ptr->file_ptr = file_ptr;
entry_ptr->is_protected = TRUE;
- entry_ptr->is_read_only = TRUE;
- entry_ptr->ro_ref_count++;
+ entry_ptr->is_read_only = TRUE;
+ entry_ptr->ro_ref_count++;
}
HDassert( ((entry_ptr->header).type)->id == type );
@@ -4195,17 +3731,17 @@ protect_entry_ro(H5F_t * file_ptr,
} /* protect_entry_ro() */
-
+
/*-------------------------------------------------------------------------
- * Function: pin_entry()
+ * Function: pin_entry()
*
- * Purpose: Pin the entry indicated by the type and index.
+ * Purpose: Pin the entry indicated by the type and index.
*
- * Do nothing if pass is FALSE on entry.
+ * Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* 3/17/09
*
*-------------------------------------------------------------------------
@@ -4232,41 +3768,41 @@ pin_entry(int32_t type,
HDassert( entry_ptr->is_protected );
HDassert( !(entry_ptr->pinned_from_client) );
- result = H5C_pin_protected_entry((void *)entry_ptr);
+ result = H5C_pin_protected_entry((void *)entry_ptr);
- if ( result < 0 ) {
+ if ( result < 0 ) {
pass = FALSE;
failure_mssg = "H5C_pin_protected_entry() reports failure.";
- } else if ( ! ( entry_ptr->header.is_pinned ) ) {
+ } else if ( ! ( entry_ptr->header.is_pinned ) ) {
pass = FALSE;
failure_mssg = "entry not pinned when it should be.";
- } else {
+ } else {
entry_ptr->pinned_from_client = TRUE;
- entry_ptr->is_pinned = TRUE;
+ entry_ptr->is_pinned = TRUE;
- }
+ }
} /* end if */
return;
} /* pin_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: unpin_entry()
+ * Function: unpin_entry()
*
- * Purpose: Unpin the entry indicated by the type and index.
+ * Purpose: Unpin the entry indicated by the type and index.
*
- * Do nothing if pass is FALSE on entry.
+ * Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 3/28/06
*
*-------------------------------------------------------------------------
@@ -4292,8 +3828,8 @@ unpin_entry(int32_t type,
HDassert( entry_ptr == entry_ptr->self );
HDassert( entry_ptr->header.is_pinned );
HDassert( entry_ptr->header.pinned_from_client );
- HDassert( entry_ptr->is_pinned );
- HDassert( entry_ptr->pinned_from_client );
+ HDassert( entry_ptr->is_pinned );
+ HDassert( entry_ptr->pinned_from_client );
result = H5C_unpin_entry(entry_ptr);
@@ -4311,7 +3847,7 @@ unpin_entry(int32_t type,
entry_ptr->pinned_from_client = FALSE;
- entry_ptr->is_pinned = entry_ptr->pinned_from_cache;
+ entry_ptr->is_pinned = entry_ptr->pinned_from_cache;
HDassert( ((entry_ptr->header).type)->id == type );
@@ -4321,17 +3857,17 @@ unpin_entry(int32_t type,
} /* unpin_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: unprotect_entry()
+ * Function: unprotect_entry()
*
- * Purpose: Unprotect the entry indicated by the type and index.
+ * Purpose: Unprotect the entry indicated by the type and index.
*
- * Do nothing if pass is FALSE on entry.
+ * Do nothing if pass is FALSE on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/12/04
*
*-------------------------------------------------------------------------
@@ -4362,12 +3898,12 @@ unprotect_entry(H5F_t * file_ptr,
HDassert( entry_ptr->header.is_protected );
HDassert( entry_ptr->is_protected );
- pin_flag_set = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0);
- unpin_flag_set = (hbool_t)((flags & H5C__UNPIN_ENTRY_FLAG) != 0);
+ pin_flag_set = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0);
+ unpin_flag_set = (hbool_t)((flags & H5C__UNPIN_ENTRY_FLAG) != 0);
- HDassert ( ! ( pin_flag_set && unpin_flag_set ) );
- HDassert ( ( ! pin_flag_set ) || ( ! (entry_ptr->is_pinned) ) );
- HDassert ( ( ! unpin_flag_set ) || ( entry_ptr->is_pinned ) );
+ HDassert ( ! ( pin_flag_set && unpin_flag_set ) );
+ HDassert ( ( ! pin_flag_set ) || ( ! (entry_ptr->is_pinned) ) );
+ HDassert ( ( ! unpin_flag_set ) || ( entry_ptr->is_pinned ) );
if(flags & H5C__DIRTIED_FLAG) {
hbool_t was_dirty = entry_ptr->is_dirty;
@@ -4382,8 +3918,8 @@ unprotect_entry(H5F_t * file_ptr,
if ( ( result < 0 ) ||
( ( entry_ptr->header.is_protected ) &&
- ( ( ! ( entry_ptr->is_read_only ) ) ||
- ( entry_ptr->ro_ref_count <= 0 ) ) ) ||
+ ( ( ! ( entry_ptr->is_read_only ) ) ||
+ ( entry_ptr->ro_ref_count <= 0 ) ) ) ||
( entry_ptr->header.type != types[type] ) ||
( entry_ptr->size != entry_ptr->header.size ) ||
( entry_ptr->addr != entry_ptr->header.addr ) ) {
@@ -4394,33 +3930,33 @@ unprotect_entry(H5F_t * file_ptr,
}
else
{
- if ( entry_ptr->ro_ref_count > 1 ) {
+ if ( entry_ptr->ro_ref_count > 1 ) {
- entry_ptr->ro_ref_count--;
+ entry_ptr->ro_ref_count--;
- } else if ( entry_ptr->ro_ref_count == 1 ) {
+ } else if ( entry_ptr->ro_ref_count == 1 ) {
- entry_ptr->is_protected = FALSE;
- entry_ptr->is_read_only = FALSE;
- entry_ptr->ro_ref_count = 0;
+ entry_ptr->is_protected = FALSE;
+ entry_ptr->is_read_only = FALSE;
+ entry_ptr->ro_ref_count = 0;
- } else {
+ } else {
- entry_ptr->is_protected = FALSE;
+ entry_ptr->is_protected = FALSE;
- }
+ }
- if ( pin_flag_set ) {
+ if ( pin_flag_set ) {
- HDassert(entry_ptr->header.is_pinned);
- entry_ptr->pinned_from_client = TRUE;
- entry_ptr->is_pinned = TRUE;
+ HDassert(entry_ptr->header.is_pinned);
+ entry_ptr->pinned_from_client = TRUE;
+ entry_ptr->is_pinned = TRUE;
- } else if ( unpin_flag_set ) {
+ } else if ( unpin_flag_set ) {
- HDassert(entry_ptr->header.is_pinned == entry_ptr->header.pinned_from_cache);
- entry_ptr->pinned_from_client = FALSE;
- entry_ptr->is_pinned = entry_ptr->pinned_from_cache;
+ HDassert(entry_ptr->header.is_pinned == entry_ptr->header.pinned_from_cache);
+ entry_ptr->pinned_from_client = FALSE;
+ entry_ptr->is_pinned = entry_ptr->pinned_from_cache;
}
}
@@ -4434,26 +3970,26 @@ unprotect_entry(H5F_t * file_ptr,
HDassert( entry_ptr->is_dirty );
}
- HDassert( entry_ptr->header.is_protected == entry_ptr->is_protected );
- HDassert( entry_ptr->header.is_read_only == entry_ptr->is_read_only );
- HDassert( entry_ptr->header.ro_ref_count == entry_ptr->ro_ref_count );
+ HDassert( entry_ptr->header.is_protected == entry_ptr->is_protected );
+ HDassert( entry_ptr->header.is_read_only == entry_ptr->is_read_only );
+ HDassert( entry_ptr->header.ro_ref_count == entry_ptr->ro_ref_count );
}
return;
} /* unprotect_entry() */
-
+
/*-------------------------------------------------------------------------
- * Function: row_major_scan_forward()
+ * Function: row_major_scan_forward()
*
- * Purpose: Do a sequence of inserts, protects, unprotects, moves,
- * destroys while scanning through the set of entries. If
- * pass is false on entry, do nothing.
+ * Purpose: Do a sequence of inserts, protects, unprotects, moves,
+ * destroys while scanning through the set of entries. If
+ * pass is false on entry, do nothing.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/12/04
*
*-------------------------------------------------------------------------
@@ -4470,7 +4006,7 @@ row_major_scan_forward(H5F_t * file_ptr,
hbool_t do_moves,
hbool_t move_to_main_addr,
hbool_t do_destroys,
- hbool_t do_mult_ro_protects,
+ hbool_t do_mult_ro_protects,
int dirty_destroys,
int dirty_unprotects)
{
@@ -4498,7 +4034,7 @@ row_major_scan_forward(H5F_t * file_ptr,
while(pass && idx <= (local_max_index + lag)) {
int32_t tmp_idx;
- if(verbose)
+ if(verbose)
HDfprintf(stdout, "%d:%d: ", type, idx);
tmp_idx = idx + lag;
@@ -4509,7 +4045,7 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "1(i, %d, %d) ", type, tmp_idx);
insert_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end if */
tmp_idx--;
@@ -4520,7 +4056,7 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "2(p, %d, %d) ", type, tmp_idx);
protect_entry(file_ptr, type, tmp_idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end if */
tmp_idx--;
@@ -4531,7 +4067,7 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "3(u, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end if */
/* (don't decrement tmp_idx) */
@@ -4542,7 +4078,7 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "4(r, %d, %d, %d) ", type, tmp_idx, (int)move_to_main_addr);
move_entry(cache_ptr, type, tmp_idx, move_to_main_addr);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end if */
tmp_idx--;
@@ -4553,7 +4089,7 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "5(p, %d, %d) ", type, tmp_idx);
protect_entry(file_ptr, type, tmp_idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end if */
tmp_idx -= 2;
@@ -4564,83 +4100,83 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "6(u, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end if */
- if(do_mult_ro_protects) {
+ if(do_mult_ro_protects) {
/* (don't decrement tmp_idx) */
- if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) &&
+ if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) &&
(tmp_idx % 9) == 0) {
if(verbose)
HDfprintf(stdout, "7(p-ro, %d, %d) ", type, tmp_idx);
- protect_entry_ro(file_ptr, type, tmp_idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
- } /* end if */
+ protect_entry_ro(file_ptr, type, tmp_idx);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ } /* end if */
tmp_idx--;
- if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) &&
+ if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) &&
(tmp_idx % 11) == 0) {
if(verbose)
HDfprintf(stdout, "8(p-ro, %d, %d) ", type, tmp_idx);
- protect_entry_ro(file_ptr, type, tmp_idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
- } /* end if */
+ protect_entry_ro(file_ptr, type, tmp_idx);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ } /* end if */
tmp_idx--;
- if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) &&
+ if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) &&
(tmp_idx % 13) == 0) {
if(verbose)
HDfprintf(stdout, "9(p-ro, %d, %d) ", type, tmp_idx);
- protect_entry_ro(file_ptr, type, tmp_idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
- } /* end if */
+ protect_entry_ro(file_ptr, type, tmp_idx);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ } /* end if */
/* (don't decrement tmp_idx) */
- if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) &&
+ if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) &&
(tmp_idx % 9) == 0) {
if(verbose)
HDfprintf(stdout, "10(u-ro, %d, %d) ", type, tmp_idx);
- unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
- } /* end if */
+ unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ } /* end if */
tmp_idx--;
- if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) &&
+ if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) &&
(tmp_idx % 11) == 0) {
if(verbose)
HDfprintf(stdout, "11(u-ro, %d, %d) ", type, tmp_idx);
- unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
- } /* end if */
+ unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ } /* end if */
tmp_idx--;
- if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) &&
+ if(pass && (tmp_idx >= 0) && (tmp_idx < local_max_index) &&
(tmp_idx % 13) == 0) {
if(verbose)
HDfprintf(stdout, "12(u-ro, %d, %d) ", type, tmp_idx);
- unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
- } /* end if */
- } /* if ( do_mult_ro_protects ) */
+ unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ } /* end if */
+ } /* if ( do_mult_ro_protects ) */
if(pass && (idx >= 0) && (idx <= local_max_index)) {
if(verbose)
HDfprintf(stdout, "13(p, %d, %d) ", type, idx);
protect_entry(file_ptr, type, idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end if */
tmp_idx = idx - lag + 2;
@@ -4651,7 +4187,7 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "14(u, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end if */
tmp_idx--;
@@ -4662,7 +4198,7 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "15(p, %d, %d) ", type, tmp_idx);
protect_entry(file_ptr, type, tmp_idx);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end if */
if(do_destroys) {
@@ -4674,7 +4210,7 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "16(u, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
break;
case 1:
@@ -4683,14 +4219,14 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "17(u, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end if */
else {
if(verbose)
HDfprintf(stdout, "18(u, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET));
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end else */
break;
@@ -4699,7 +4235,7 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "19(u-del, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
break;
case 3:
@@ -4708,14 +4244,14 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "20(u-del, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end if */
else {
if(verbose)
HDfprintf(stdout, "21(u-del, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, (dirty_destroys ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | H5C__DELETED_FLAG);
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end else */
break;
@@ -4732,7 +4268,7 @@ row_major_scan_forward(H5F_t * file_ptr,
HDfprintf(stdout, "22(u, %d, %d) ", type, tmp_idx);
unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET));
- HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
+ HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size);
} /* end if */
} /* end elsef */
@@ -4750,17 +4286,17 @@ row_major_scan_forward(H5F_t * file_ptr,
} /* row_major_scan_forward() */
-
+
/*-------------------------------------------------------------------------
- * Function: hl_row_major_scan_forward()
+ * Function: hl_row_major_scan_forward()
*
- * Purpose: Do a high locality sequence of inserts, protects, and
- * unprotects while scanning through the set of entries.
- * If pass is false on entry, do nothing.
+ * Purpose: Do a high locality sequence of inserts, protects, and
+ * unprotects while scanning through the set of entries.
+ * If pass is false on entry, do nothing.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 10/21/04
*
*-------------------------------------------------------------------------
@@ -4855,17 +4391,17 @@ hl_row_major_scan_forward(H5F_t * file_ptr,
} /* hl_row_major_scan_forward() */
-
+
/*-------------------------------------------------------------------------
- * Function: row_major_scan_backward()
+ * Function: row_major_scan_backward()
*
- * Purpose: Do a sequence of inserts, protects, unprotects, moves,
- * destroys while scanning backwards through the set of
- * entries. If pass is false on entry, do nothing.
+ * Purpose: Do a sequence of inserts, protects, unprotects, moves,
+ * destroys while scanning backwards through the set of
+ * entries. If pass is false on entry, do nothing.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/12/04
*
*-------------------------------------------------------------------------
@@ -4883,7 +4419,7 @@ row_major_scan_backward(H5F_t * file_ptr,
hbool_t do_moves,
hbool_t move_to_main_addr,
hbool_t do_destroys,
- hbool_t do_mult_ro_protects,
+ hbool_t do_mult_ro_protects,
int dirty_destroys,
int dirty_unprotects)
{
@@ -4959,7 +4495,7 @@ row_major_scan_backward(H5F_t * file_ptr,
if ( verbose )
HDfprintf(stdout, "(r, %d, %d, %d) ",
- type, tmp_idx, (int)move_to_main_addr);
+ type, tmp_idx, (int)move_to_main_addr);
move_entry(cache_ptr, type, tmp_idx, move_to_main_addr);
}
@@ -4987,73 +4523,73 @@ row_major_scan_backward(H5F_t * file_ptr,
}
/* (don't increment tmp_idx) */
- if ( do_mult_ro_protects )
- {
- if ( ( pass ) && ( tmp_idx >= 0 ) &&
- ( tmp_idx < local_max_index ) &&
- ( tmp_idx % 9 == 0 ) ) {
+ if ( do_mult_ro_protects )
+ {
+ if ( ( pass ) && ( tmp_idx >= 0 ) &&
+ ( tmp_idx < local_max_index ) &&
+ ( tmp_idx % 9 == 0 ) ) {
if ( verbose )
HDfprintf(stdout, "(p-ro, %d, %d) ", type, tmp_idx);
- protect_entry_ro(file_ptr, type, tmp_idx);
- }
+ protect_entry_ro(file_ptr, type, tmp_idx);
+ }
tmp_idx++;
- if ( ( pass ) && ( tmp_idx >= 0 ) &&
- ( tmp_idx < local_max_index ) &&
- ( tmp_idx % 11 == 0 ) ) {
+ if ( ( pass ) && ( tmp_idx >= 0 ) &&
+ ( tmp_idx < local_max_index ) &&
+ ( tmp_idx % 11 == 0 ) ) {
if ( verbose )
HDfprintf(stdout, "(p-ro, %d, %d) ", type, tmp_idx);
- protect_entry_ro(file_ptr, type, tmp_idx);
- }
+ protect_entry_ro(file_ptr, type, tmp_idx);
+ }
tmp_idx++;
- if ( ( pass ) && ( tmp_idx >= 0 ) &&
- ( tmp_idx < local_max_index ) &&
- ( tmp_idx % 13 == 0 ) ) {
+ if ( ( pass ) && ( tmp_idx >= 0 ) &&
+ ( tmp_idx < local_max_index ) &&
+ ( tmp_idx % 13 == 0 ) ) {
if ( verbose )
HDfprintf(stdout, "(p-ro, %d, %d) ", type, tmp_idx);
- protect_entry_ro(file_ptr, type, tmp_idx);
- }
+ protect_entry_ro(file_ptr, type, tmp_idx);
+ }
/* (don't increment tmp_idx) */
- if ( ( pass ) && ( tmp_idx >= 0 ) &&
- ( tmp_idx < local_max_index ) &&
- ( tmp_idx % 9 == 0 ) ) {
+ if ( ( pass ) && ( tmp_idx >= 0 ) &&
+ ( tmp_idx < local_max_index ) &&
+ ( tmp_idx % 9 == 0 ) ) {
if ( verbose )
HDfprintf(stdout, "(u-ro, %d, %d) ", type, tmp_idx);
- unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- }
+ unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
+ }
tmp_idx++;
- if ( ( pass ) && ( tmp_idx >= 0 ) &&
- ( tmp_idx < local_max_index ) &&
- ( tmp_idx % 11 == 0 ) ) {
+ if ( ( pass ) && ( tmp_idx >= 0 ) &&
+ ( tmp_idx < local_max_index ) &&
+ ( tmp_idx % 11 == 0 ) ) {
if ( verbose )
HDfprintf(stdout, "(u-ro, %d, %d) ", type, tmp_idx);
- unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- }
+ unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
+ }
tmp_idx++;
- if ( ( pass ) && ( tmp_idx >= 0 ) &&
- ( tmp_idx < local_max_index ) &&
- ( tmp_idx % 13 == 0 ) ) {
+ if ( ( pass ) && ( tmp_idx >= 0 ) &&
+ ( tmp_idx < local_max_index ) &&
+ ( tmp_idx % 13 == 0 ) ) {
if ( verbose )
HDfprintf(stdout, "(u-ro, %d, %d) ", type, tmp_idx);
- unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
- }
- } /* if ( do_mult_ro_protects ) */
+ unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET);
+ }
+ } /* if ( do_mult_ro_protects ) */
if ( ( pass ) && ( idx >= 0 ) && ( idx <= local_max_index ) ) {
@@ -5159,17 +4695,17 @@ row_major_scan_backward(H5F_t * file_ptr,
} /* row_major_scan_backward() */
-
+
/*-------------------------------------------------------------------------
- * Function: hl_row_major_scan_backward()
+ * Function: hl_row_major_scan_backward()
*
- * Purpose: Do a high locality sequence of inserts, protects, and
- * unprotects while scanning through the set of entries.
- * If pass is false on entry, do nothing.
+ * Purpose: Do a high locality sequence of inserts, protects, and
+ * unprotects while scanning through the set of entries.
+ * If pass is false on entry, do nothing.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 10/21/04
*
*-------------------------------------------------------------------------
@@ -5264,17 +4800,17 @@ hl_row_major_scan_backward(H5F_t * file_ptr,
} /* hl_row_major_scan_backward() */
-
+
/*-------------------------------------------------------------------------
- * Function: col_major_scan_forward()
+ * Function: col_major_scan_forward()
*
- * Purpose: Do a sequence of inserts, protects, and unprotects
- * while scanning through the set of entries. If
- * pass is false on entry, do nothing.
+ * Purpose: Do a sequence of inserts, protects, and unprotects
+ * while scanning through the set of entries. If
+ * pass is false on entry, do nothing.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/23/04
*
*-------------------------------------------------------------------------
@@ -5282,7 +4818,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr,
void
col_major_scan_forward(H5F_t * file_ptr,
- int32_t max_index,
+ int32_t max_index,
int32_t lag,
hbool_t verbose,
hbool_t reset_stats,
@@ -5372,17 +4908,17 @@ col_major_scan_forward(H5F_t * file_ptr,
} /* col_major_scan_forward() */
-
+
/*-------------------------------------------------------------------------
- * Function: hl_col_major_scan_forward()
+ * Function: hl_col_major_scan_forward()
*
- * Purpose: Do a high locality sequence of inserts, protects, and
- * unprotects while scanning through the set of entries. If
- * pass is false on entry, do nothing.
+ * Purpose: Do a high locality sequence of inserts, protects, and
+ * unprotects while scanning through the set of entries. If
+ * pass is false on entry, do nothing.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 19/25/04
*
*-------------------------------------------------------------------------
@@ -5488,17 +5024,17 @@ hl_col_major_scan_forward(H5F_t * file_ptr,
} /* hl_col_major_scan_forward() */
-
+
/*-------------------------------------------------------------------------
- * Function: col_major_scan_backward()
+ * Function: col_major_scan_backward()
*
- * Purpose: Do a sequence of inserts, protects, and unprotects
- * while scanning backwards through the set of
- * entries. If pass is false on entry, do nothing.
+ * Purpose: Do a sequence of inserts, protects, and unprotects
+ * while scanning backwards through the set of
+ * entries. If pass is false on entry, do nothing.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/23/04
*
*-------------------------------------------------------------------------
@@ -5506,7 +5042,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr,
void
col_major_scan_backward(H5F_t * file_ptr,
- int32_t max_index,
+ int32_t max_index,
int32_t lag,
hbool_t verbose,
hbool_t reset_stats,
@@ -5566,8 +5102,8 @@ col_major_scan_backward(H5F_t * file_ptr,
}
if ( ( pass ) &&
- ( idx >= 0 ) &&
- ( idx <= local_max_index[type] ) ) {
+ ( idx >= 0 ) &&
+ ( idx <= local_max_index[type] ) ) {
if ( verbose )
HDfprintf(stdout, "(p, %d, %d) ", type, idx);
@@ -5609,17 +5145,17 @@ col_major_scan_backward(H5F_t * file_ptr,
} /* col_major_scan_backward() */
-
+
/*-------------------------------------------------------------------------
- * Function: hl_col_major_scan_backward()
+ * Function: hl_col_major_scan_backward()
*
- * Purpose: Do a high locality sequence of inserts, protects, and
- * unprotects while scanning backwards through the set of
- * entries. If pass is false on entry, do nothing.
+ * Purpose: Do a high locality sequence of inserts, protects, and
+ * unprotects while scanning backwards through the set of
+ * entries. If pass is false on entry, do nothing.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 10/25/04
*
*-------------------------------------------------------------------------
@@ -5724,17 +5260,17 @@ hl_col_major_scan_backward(H5F_t * file_ptr,
} /* hl_col_major_scan_backward() */
-
+
/*-------------------------------------------------------------------------
- * Function: create_flush_dependency()
+ * Function: create_flush_dependency()
*
- * Purpose: Create a 'flush dependency' between two entries.
+ * Purpose: Create a 'flush dependency' between two entries.
*
- * Do nothing if pass is false.
+ * Do nothing if pass is false.
*
- * Return: void
+ * Return: void
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* 3/16/09
*
*-------------------------------------------------------------------------
@@ -5805,17 +5341,17 @@ create_flush_dependency(int32_t par_type,
} /* end if */
} /* create_flush_dependency() */
-
+
/*-------------------------------------------------------------------------
- * Function: destroy_flush_dependency()
+ * Function: destroy_flush_dependency()
*
- * Purpose: Destroy a 'flush dependency' between two entries.
+ * Purpose: Destroy a 'flush dependency' between two entries.
*
- * Do nothing if pass is false.
+ * Do nothing if pass is false.
*
- * Return: void
+ * Return: void
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* 3/16/09
*
*-------------------------------------------------------------------------
@@ -5896,7 +5432,7 @@ destroy_flush_dependency(int32_t par_type,
} /* end if */
} /* destroy_flush_dependency() */
-
+
/*-------------------------------------------------------------------------
* Function: mark_flush_dep_dirty()
*
@@ -5939,7 +5475,7 @@ mark_flush_dep_dirty(test_entry_t * entry_ptr)
} /* end if */
} /* end mark_flush_dep_dirty() */
-
+
/*-------------------------------------------------------------------------
* Function: mark_flush_dep_clean()
*
@@ -5982,31 +5518,31 @@ mark_flush_dep_clean(test_entry_t * entry_ptr)
} /* end if */
} /* end mark_flush_dep_clean() */
-
+
/*** H5AC level utility functions ***/
-
+
/*-------------------------------------------------------------------------
- * Function: check_and_validate_cache_hit_rate()
+ * Function: check_and_validate_cache_hit_rate()
*
- * Purpose: Use the API functions to get and reset the cache hit rate.
- * Verify that the value returned by the API call agrees with
- * the cache internal data structures.
+ * Purpose: Use the API functions to get and reset the cache hit rate.
+ * Verify that the value returned by the API call agrees with
+ * the cache internal data structures.
*
- * If the number of cache accesses exceeds the value provided
- * in the min_accesses parameter, and the hit rate is less than
- * min_hit_rate, set pass to FALSE, and set failure_mssg to
- * a string indicating that hit rate was unexpectedly low.
+ * If the number of cache accesses exceeds the value provided
+ * in the min_accesses parameter, and the hit rate is less than
+ * min_hit_rate, set pass to FALSE, and set failure_mssg to
+ * a string indicating that hit rate was unexpectedly low.
*
- * Return hit rate in *hit_rate_ptr, and print the data to
- * stdout if requested.
+ * Return hit rate in *hit_rate_ptr, and print the data to
+ * stdout if requested.
*
- * If an error is detected, set pass to FALSE, and set
- * failure_mssg to an appropriate value.
+ * If an error is detected, set pass to FALSE, and set
+ * failure_mssg to an appropriate value.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/18/04
*
*-------------------------------------------------------------------------
@@ -6121,24 +5657,24 @@ check_and_validate_cache_hit_rate(hid_t file_id,
} /* check_and_validate_cache_hit_rate() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_and_validate_cache_size()
+ * Function: check_and_validate_cache_size()
*
- * Purpose: Use the API function to get the cache size data. Verify
- * that the values returned by the API call agree with
- * the cache internal data structures.
+ * Purpose: Use the API function to get the cache size data. Verify
+ * that the values returned by the API call agree with
+ * the cache internal data structures.
*
- * Return size data in the locations specified by the pointer
- * parameters if these parameters are not NULL. Print the
- * data to stdout if requested.
+ * Return size data in the locations specified by the pointer
+ * parameters if these parameters are not NULL. Print the
+ * data to stdout if requested.
*
- * If an error is detected, set pass to FALSE, and set
- * failure_mssg to an appropriate value.
+ * If an error is detected, set pass to FALSE, and set
+ * failure_mssg to an appropriate value.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/18/04
*
*-------------------------------------------------------------------------
@@ -6312,21 +5848,21 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
return(TRUE);
}
-
+
/*-------------------------------------------------------------------------
- * Function: validate_mdc_config()
+ * Function: validate_mdc_config()
*
- * Purpose: Verify that the file indicated by the file_id parameter
- * has both internal and external configuration matching
- * *config_ptr.
+ * Purpose: Verify that the file indicated by the file_id parameter
+ * has both internal and external configuration matching
+ * *config_ptr.
*
- * Do nothin on success. On failure, set pass to FALSE, and
- * load an error message into failue_mssg. Note that
- * failure_msg is assumed to be at least 128 bytes in length.
+ * Do nothin on success. On failure, set pass to FALSE, and
+ * load an error message into failue_mssg. Note that
+ * failure_msg is assumed to be at least 128 bytes in length.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 4/14/04
*
*-------------------------------------------------------------------------
@@ -6380,7 +5916,7 @@ validate_mdc_config(hid_t file_id,
/* compare the cache's internal configuration with the expected value */
if ( pass ) {
- if ( ! resize_configs_are_equal(&int_config, &cache_ptr->resize_ctl,
+ if ( ! resize_configs_are_equal(&int_config, &cache_ptr->resize_ctl,
compare_init) ) {
pass = FALSE;
@@ -6431,12 +5967,12 @@ validate_mdc_config(hid_t file_id,
} /* validate_mdc_config() */
-
+
#if 0 /* debugging functions -- normally commented out */
/*-------------------------------------------------------------------------
* Function: dump_LRU
*
- * Purpose: Display a summarize list of the contents of the LRU
+ * Purpose: Display a summarize list of the contents of the LRU
* from head to tail.
*
* Return: void
@@ -6464,7 +6000,7 @@ dump_LRU(H5F_t * file_ptr)
entry_ptr = cache_ptr->LRU_head_ptr;
- HDfprintf(stdout,
+ HDfprintf(stdout,
"\n\nIndex len/size/clean size/dirty size = %u/%lld/%lld/%lld\n",
cache_ptr->index_len, (long long)(cache_ptr->index_size),
(long long)(cache_ptr->clean_index_size),
@@ -6479,17 +6015,17 @@ dump_LRU(H5F_t * file_ptr)
while ( entry_ptr != NULL )
{
- HDfprintf(stdout,
+ HDfprintf(stdout,
" %3d %d %10lld 0x%010llx %s(%d)\n",
- i,
- (int)(entry_ptr->is_dirty),
+ i,
+ (int)(entry_ptr->is_dirty),
(long long)(entry_ptr->size),
(long long)(entry_ptr->addr),
entry_ptr->type->name,
entry_ptr->type->id);
i++;
entry_ptr = entry_ptr->next;
- }
+ }
if ( cache_ptr->LRU_list_len > 0 )
{
diff --git a/test/cache_common.h b/test/cache_common.h
index 9c66357..afe1646 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -14,14 +14,14 @@
/* Programmer: John Mainzer
* 10/27/05
*
- * This file contains common #defines, type definitions, and
- * externs for tests of the cache implemented in H5C.c
+ * This file contains common #defines, type definitions, and
+ * externs for tests of the cache implemented in H5C.c
*/
#ifndef _CACHE_COMMON_H
#define _CACHE_COMMON_H
-#define H5C_FRIEND /*suppress error about including H5Cpkg */
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5C_FRIEND /*suppress error about including H5Cpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
/* Include library header files */
#include "H5ACprivate.h"
@@ -35,174 +35,174 @@
/* Macro to make error reporting easier */
#define CACHE_ERROR(s) {failure_mssg = "Line #" H5_TOSTRING(__LINE__) ": " s ; pass = FALSE; goto done;}
-#define NO_CHANGE -1
+#define NO_CHANGE -1
/* with apologies for the abuse of terminology... */
-#define PICO_ENTRY_TYPE 0
-#define NANO_ENTRY_TYPE 1
-#define MICRO_ENTRY_TYPE 2
-#define TINY_ENTRY_TYPE 3
-#define SMALL_ENTRY_TYPE 4
-#define MEDIUM_ENTRY_TYPE 5
-#define LARGE_ENTRY_TYPE 6
-#define HUGE_ENTRY_TYPE 7
-#define MONSTER_ENTRY_TYPE 8
-#define VARIABLE_ENTRY_TYPE 9
-#define NOTIFY_ENTRY_TYPE 10
+#define PICO_ENTRY_TYPE 0
+#define NANO_ENTRY_TYPE 1
+#define MICRO_ENTRY_TYPE 2
+#define TINY_ENTRY_TYPE 3
+#define SMALL_ENTRY_TYPE 4
+#define MEDIUM_ENTRY_TYPE 5
+#define LARGE_ENTRY_TYPE 6
+#define HUGE_ENTRY_TYPE 7
+#define MONSTER_ENTRY_TYPE 8
+#define VARIABLE_ENTRY_TYPE 9
+#define NOTIFY_ENTRY_TYPE 10
#define NUMBER_OF_ENTRY_TYPES 11
-#define PICO_ENTRY_SIZE (size_t)1
-#define NANO_ENTRY_SIZE (size_t)4
-#define MICRO_ENTRY_SIZE (size_t)16
-#define TINY_ENTRY_SIZE (size_t)64
-#define SMALL_ENTRY_SIZE (size_t)256
-#define MEDIUM_ENTRY_SIZE (size_t)1024
-#define LARGE_ENTRY_SIZE (size_t)(4 * 1024)
-#define HUGE_ENTRY_SIZE (size_t)(16 * 1024)
-#define MONSTER_ENTRY_SIZE (size_t)(64 * 1024)
-#define VARIABLE_ENTRY_SIZE (size_t)(10 * 1024)
-#define NOTIFY_ENTRY_SIZE (size_t)1
-
-#define NUM_PICO_ENTRIES (10 * 1024)
-#define NUM_NANO_ENTRIES (10 * 1024)
-#define NUM_MICRO_ENTRIES (10 * 1024)
-#define NUM_TINY_ENTRIES (10 * 1024)
-#define NUM_SMALL_ENTRIES (10 * 1024)
-#define NUM_MEDIUM_ENTRIES (10 * 1024)
-#define NUM_LARGE_ENTRIES (10 * 1024)
-#define NUM_HUGE_ENTRIES (10 * 1024)
-#define NUM_MONSTER_ENTRIES (10 * 1024)
-#define NUM_VARIABLE_ENTRIES (10 * 1024)
-#define NUM_NOTIFY_ENTRIES (10 * 1024)
-
-#define MAX_ENTRIES (10 * 1024)
+#define PICO_ENTRY_SIZE (size_t)1
+#define NANO_ENTRY_SIZE (size_t)4
+#define MICRO_ENTRY_SIZE (size_t)16
+#define TINY_ENTRY_SIZE (size_t)64
+#define SMALL_ENTRY_SIZE (size_t)256
+#define MEDIUM_ENTRY_SIZE (size_t)1024
+#define LARGE_ENTRY_SIZE (size_t)(4 * 1024)
+#define HUGE_ENTRY_SIZE (size_t)(16 * 1024)
+#define MONSTER_ENTRY_SIZE (size_t)(64 * 1024)
+#define VARIABLE_ENTRY_SIZE (size_t)(10 * 1024)
+#define NOTIFY_ENTRY_SIZE (size_t)1
+
+#define NUM_PICO_ENTRIES (10 * 1024)
+#define NUM_NANO_ENTRIES (10 * 1024)
+#define NUM_MICRO_ENTRIES (10 * 1024)
+#define NUM_TINY_ENTRIES (10 * 1024)
+#define NUM_SMALL_ENTRIES (10 * 1024)
+#define NUM_MEDIUM_ENTRIES (10 * 1024)
+#define NUM_LARGE_ENTRIES (10 * 1024)
+#define NUM_HUGE_ENTRIES (10 * 1024)
+#define NUM_MONSTER_ENTRIES (10 * 1024)
+#define NUM_VARIABLE_ENTRIES (10 * 1024)
+#define NUM_NOTIFY_ENTRIES (10 * 1024)
+
+#define MAX_ENTRIES (10 * 1024)
/* The choice of the BASE_ADDR below is arbitrary -- it just has to be
* larger than the superblock.
*/
-#define BASE_ADDR (haddr_t)1024
-#define PICO_BASE_ADDR BASE_ADDR
-#define NANO_BASE_ADDR (haddr_t)(PICO_BASE_ADDR + \
+#define BASE_ADDR (haddr_t)1024
+#define PICO_BASE_ADDR BASE_ADDR
+#define NANO_BASE_ADDR (haddr_t)(PICO_BASE_ADDR + \
(PICO_ENTRY_SIZE * NUM_PICO_ENTRIES))
-#define MICRO_BASE_ADDR (haddr_t)(NANO_BASE_ADDR + \
+#define MICRO_BASE_ADDR (haddr_t)(NANO_BASE_ADDR + \
(NANO_ENTRY_SIZE * NUM_NANO_ENTRIES))
-#define TINY_BASE_ADDR (haddr_t)(MICRO_BASE_ADDR + \
- (MICRO_ENTRY_SIZE * NUM_MICRO_ENTRIES))
-#define SMALL_BASE_ADDR (haddr_t)(TINY_BASE_ADDR + \
+#define TINY_BASE_ADDR (haddr_t)(MICRO_BASE_ADDR + \
+ (MICRO_ENTRY_SIZE * NUM_MICRO_ENTRIES))
+#define SMALL_BASE_ADDR (haddr_t)(TINY_BASE_ADDR + \
(TINY_ENTRY_SIZE * NUM_TINY_ENTRIES))
-#define MEDIUM_BASE_ADDR (haddr_t)(SMALL_BASE_ADDR + \
+#define MEDIUM_BASE_ADDR (haddr_t)(SMALL_BASE_ADDR + \
(SMALL_ENTRY_SIZE * NUM_SMALL_ENTRIES))
-#define LARGE_BASE_ADDR (haddr_t)(MEDIUM_BASE_ADDR + \
+#define LARGE_BASE_ADDR (haddr_t)(MEDIUM_BASE_ADDR + \
(MEDIUM_ENTRY_SIZE * NUM_MEDIUM_ENTRIES))
-#define HUGE_BASE_ADDR (haddr_t)(LARGE_BASE_ADDR + \
+#define HUGE_BASE_ADDR (haddr_t)(LARGE_BASE_ADDR + \
(LARGE_ENTRY_SIZE * NUM_LARGE_ENTRIES))
-#define MONSTER_BASE_ADDR (haddr_t)(HUGE_BASE_ADDR + \
+#define MONSTER_BASE_ADDR (haddr_t)(HUGE_BASE_ADDR + \
(HUGE_ENTRY_SIZE * NUM_HUGE_ENTRIES))
-#define VARIABLE_BASE_ADDR (haddr_t)(MONSTER_BASE_ADDR + \
- (MONSTER_ENTRY_SIZE * NUM_MONSTER_ENTRIES))
-#define NOTIFY_BASE_ADDR (haddr_t)(VARIABLE_BASE_ADDR + \
- (VARIABLE_ENTRY_SIZE * NUM_VARIABLE_ENTRIES))
-
-#define PICO_ALT_BASE_ADDR (haddr_t)(NOTIFY_BASE_ADDR + \
- (NOTIFY_ENTRY_SIZE * NUM_NOTIFY_ENTRIES))
-#define NANO_ALT_BASE_ADDR (haddr_t)(PICO_ALT_BASE_ADDR + \
+#define VARIABLE_BASE_ADDR (haddr_t)(MONSTER_BASE_ADDR + \
+ (MONSTER_ENTRY_SIZE * NUM_MONSTER_ENTRIES))
+#define NOTIFY_BASE_ADDR (haddr_t)(VARIABLE_BASE_ADDR + \
+ (VARIABLE_ENTRY_SIZE * NUM_VARIABLE_ENTRIES))
+
+#define PICO_ALT_BASE_ADDR (haddr_t)(NOTIFY_BASE_ADDR + \
+ (NOTIFY_ENTRY_SIZE * NUM_NOTIFY_ENTRIES))
+#define NANO_ALT_BASE_ADDR (haddr_t)(PICO_ALT_BASE_ADDR + \
(PICO_ENTRY_SIZE * NUM_PICO_ENTRIES))
-#define MICRO_ALT_BASE_ADDR (haddr_t)(NANO_ALT_BASE_ADDR + \
+#define MICRO_ALT_BASE_ADDR (haddr_t)(NANO_ALT_BASE_ADDR + \
(NANO_ENTRY_SIZE * NUM_NANO_ENTRIES))
-#define TINY_ALT_BASE_ADDR (haddr_t)(MICRO_ALT_BASE_ADDR + \
- (MICRO_ENTRY_SIZE * NUM_MICRO_ENTRIES))
-#define SMALL_ALT_BASE_ADDR (haddr_t)(TINY_ALT_BASE_ADDR + \
+#define TINY_ALT_BASE_ADDR (haddr_t)(MICRO_ALT_BASE_ADDR + \
+ (MICRO_ENTRY_SIZE * NUM_MICRO_ENTRIES))
+#define SMALL_ALT_BASE_ADDR (haddr_t)(TINY_ALT_BASE_ADDR + \
(TINY_ENTRY_SIZE * NUM_TINY_ENTRIES))
-#define MEDIUM_ALT_BASE_ADDR (haddr_t)(SMALL_ALT_BASE_ADDR + \
+#define MEDIUM_ALT_BASE_ADDR (haddr_t)(SMALL_ALT_BASE_ADDR + \
(SMALL_ENTRY_SIZE * NUM_SMALL_ENTRIES))
-#define LARGE_ALT_BASE_ADDR (haddr_t)(MEDIUM_ALT_BASE_ADDR + \
+#define LARGE_ALT_BASE_ADDR (haddr_t)(MEDIUM_ALT_BASE_ADDR + \
(MEDIUM_ENTRY_SIZE * NUM_MEDIUM_ENTRIES))
-#define HUGE_ALT_BASE_ADDR (haddr_t)(LARGE_ALT_BASE_ADDR + \
+#define HUGE_ALT_BASE_ADDR (haddr_t)(LARGE_ALT_BASE_ADDR + \
(LARGE_ENTRY_SIZE * NUM_LARGE_ENTRIES))
-#define MONSTER_ALT_BASE_ADDR (haddr_t)(HUGE_ALT_BASE_ADDR + \
+#define MONSTER_ALT_BASE_ADDR (haddr_t)(HUGE_ALT_BASE_ADDR + \
(HUGE_ENTRY_SIZE * NUM_HUGE_ENTRIES))
-#define VARIABLE_ALT_BASE_ADDR (haddr_t)(MONSTER_ALT_BASE_ADDR + \
+#define VARIABLE_ALT_BASE_ADDR (haddr_t)(MONSTER_ALT_BASE_ADDR + \
(MONSTER_ENTRY_SIZE * NUM_MONSTER_ENTRIES))
-#define NOTIFY_ALT_BASE_ADDR (haddr_t)(VARIABLE_ALT_BASE_ADDR + \
+#define NOTIFY_ALT_BASE_ADDR (haddr_t)(VARIABLE_ALT_BASE_ADDR + \
(VARIABLE_ENTRY_SIZE * NUM_VARIABLE_ENTRIES))
-#define MAX_ADDR (haddr_t)(NOTIFY_ALT_BASE_ADDR + \
- (NOTIFY_ENTRY_SIZE * NUM_NOTIFY_ENTRIES))
-#define ADDR_SPACE_SIZE (haddr_t)(MAX_ADDR - BASE_ADDR)
-
-#define MAX_PINS 8 /* Maximum number of entries that can be
- * directly pinned by a single entry.
- */
-
-#define FLUSH_OP__NO_OP 0
-#define FLUSH_OP__DIRTY 1
-#define FLUSH_OP__RESIZE 2
-#define FLUSH_OP__MOVE 3
-#define FLUSH_OP__ORDER 4
-#define FLUSH_OP__EXPUNGE 5
-#define FLUSH_OP__DEST_FLUSH_DEP 6
-#define FLUSH_OP__MAX_OP 6
-
-#define MAX_FLUSH_OPS 10 /* Maximum number of flush operations
- * that can be associated with a
- * cache entry.
- */
+#define MAX_ADDR (haddr_t)(NOTIFY_ALT_BASE_ADDR + \
+ (NOTIFY_ENTRY_SIZE * NUM_NOTIFY_ENTRIES))
+#define ADDR_SPACE_SIZE (haddr_t)(MAX_ADDR - BASE_ADDR)
+
+#define MAX_PINS 8 /* Maximum number of entries that can be
+ * directly pinned by a single entry.
+ */
+
+#define FLUSH_OP__NO_OP 0
+#define FLUSH_OP__DIRTY 1
+#define FLUSH_OP__RESIZE 2
+#define FLUSH_OP__MOVE 3
+#define FLUSH_OP__ORDER 4
+#define FLUSH_OP__EXPUNGE 5
+#define FLUSH_OP__DEST_FLUSH_DEP 6
+#define FLUSH_OP__MAX_OP 6
+
+#define MAX_FLUSH_OPS 10 /* Maximum number of flush operations
+ * that can be associated with a
+ * cache entry.
+ */
#define MAX_FLUSH_DEP_PARS 8 /* Maximum number of flush dependency
* parents in the test */
typedef struct flush_op
{
- int op_code; /* integer op code indicating the
- * operation to be performed. At
- * present it must be one of:
- *
- * FLUSH_OP__NO_OP
- * FLUSH_OP__DIRTY
- * FLUSH_OP__RESIZE
- * FLUSH_OP__MOVE
- * FLUSH_OP__ORDER
- */
- int type; /* type code of the cache entry that
- * is the target of the operation.
- * This value is passed into the
- * function implementing the flush
- * operation.
- */
- int idx; /* index of the cache entry that
- * is the target of the operation.
- * This value is passed into the
+ int op_code; /* integer op code indicating the
+ * operation to be performed. At
+ * present it must be one of:
+ *
+ * FLUSH_OP__NO_OP
+ * FLUSH_OP__DIRTY
+ * FLUSH_OP__RESIZE
+ * FLUSH_OP__MOVE
+ * FLUSH_OP__ORDER
+ */
+ int type; /* type code of the cache entry that
+ * is the target of the operation.
+ * This value is passed into the
+ * function implementing the flush
+ * operation.
+ */
+ int idx; /* index of the cache entry that
+ * is the target of the operation.
+ * This value is passed into the
* function implementing the flush
* operation.
- */
- hbool_t flag; /* boolean flag passed into the
- * function implementing the flush
- * operation. The meaning of the
- * flag is dependent upon the flush
- * operation:
- *
- * FLUSH_OP__DIRTY: TRUE iff the
- * target is pinned, and is to
- * be dirtied via the
- * H5C_mark_entry_dirty()
- * call.
- *
- * FLUSH_OP__RESIZE: TRUE iff the
- * target is pinned, and is to
- * be resized via the
- * H5C_resize_entry()
- * call.
- *
- * FLUSH_OP__MOVE: TRUE iff the
- * target is to be moved to
- * its main address.
- */
- size_t size; /* New target size in the
- * FLUSH_OP__MOVE operation.
- * Unused elsewhere.
- */
+ */
+ hbool_t flag; /* boolean flag passed into the
+ * function implementing the flush
+ * operation. The meaning of the
+ * flag is dependent upon the flush
+ * operation:
+ *
+ * FLUSH_OP__DIRTY: TRUE iff the
+ * target is pinned, and is to
+ * be dirtied via the
+ * H5C_mark_entry_dirty()
+ * call.
+ *
+ * FLUSH_OP__RESIZE: TRUE iff the
+ * target is pinned, and is to
+ * be resized via the
+ * H5C_resize_entry()
+ * call.
+ *
+ * FLUSH_OP__MOVE: TRUE iff the
+ * target is to be moved to
+ * its main address.
+ */
+ size_t size; /* New target size in the
+ * FLUSH_OP__MOVE operation.
+ * Unused elsewhere.
+ */
unsigned * order_ptr; /* Pointer to outside counter for
* recording the order of entries
* flushed.
@@ -216,135 +216,135 @@ typedef enum test_entry_action_t {
typedef struct test_entry_t
{
- H5C_cache_entry_t header; /* entry data used by the cache
- * -- must be first
- */
- struct test_entry_t * self; /* pointer to this entry -- used for
- * sanity checking.
+ H5C_cache_entry_t header; /* entry data used by the cache
+ * -- must be first
+ */
+ struct test_entry_t * self; /* pointer to this entry -- used for
+ * sanity checking.
*/
test_entry_action_t action; /* Action being performed on a test entry */
H5F_t * file_ptr; /* pointer to the file in which the
* entry resides, or NULL if the entry
* is not in a file.
*/
- H5C_t * cache_ptr; /* pointer to the cache in which
- * the entry resides, or NULL if the
- * entry is not in cache.
- */
- hbool_t written_to_main_addr;
- /* Flag indicating whether an image
- * of the entry has been written to
- * its main address. Since we no
- * longer have a flush callback, we
- * set this field to true whenever the
- * entry is serialized while at its
- * main address.
- */
- hbool_t written_to_alt_addr;
+ H5C_t * cache_ptr; /* pointer to the cache in which
+ * the entry resides, or NULL if the
+ * entry is not in cache.
+ */
+ hbool_t written_to_main_addr;
+ /* Flag indicating whether an image
+ * of the entry has been written to
+ * its main address. Since we no
+ * longer have a flush callback, we
+ * set this field to true whenever the
+ * entry is serialized while at its
+ * main address.
+ */
+ hbool_t written_to_alt_addr;
/* Flag indicating whether an image
- * of the entry has been written to
- * its alternate address. Since we no
- * longer have a flush callback, we
- * set this field to true whenever the
- * entry is serialized while at its
- * alternate address.
- */
- haddr_t addr; /* where the cache thinks this entry
+ * of the entry has been written to
+ * its alternate address. Since we no
+ * longer have a flush callback, we
+ * set this field to true whenever the
+ * entry is serialized while at its
+ * alternate address.
+ */
+ haddr_t addr; /* where the cache thinks this entry
* is located
*/
- hbool_t at_main_addr; /* boolean flag indicating whether
- * the entry is supposed to be at
- * either its main or alternate
- * address.
- */
- haddr_t main_addr; /* initial location of the entry
+ hbool_t at_main_addr; /* boolean flag indicating whether
+ * the entry is supposed to be at
+ * either its main or alternate
+ * address.
+ */
+ haddr_t main_addr; /* initial location of the entry
*/
- haddr_t alt_addr; /* location to which the entry
- * can be relocated or "moved"
+ haddr_t alt_addr; /* location to which the entry
+ * can be relocated or "moved"
*/
- size_t size; /* how big the cache thinks this
+ size_t size; /* how big the cache thinks this
* entry is
*/
- int32_t type; /* indicates which entry array this
- * entry is in
+ int32_t type; /* indicates which entry array this
+ * entry is in
*/
- int32_t index; /* index in its entry array
+ int32_t index; /* index in its entry array
*/
- int32_t serializes; /* number of times this entry has
- * been serialized.
+ int32_t serializes; /* number of times this entry has
+ * been serialized.
*/
- int32_t deserializes; /* number of times this entry has
+ int32_t deserializes; /* number of times this entry has
* been deserialized
*/
- hbool_t is_dirty; /* entry has been modified since
+ hbool_t is_dirty; /* entry has been modified since
* last write
*/
- hbool_t is_protected; /* entry should currently be on
- * the cache's protected list.
+ hbool_t is_protected; /* entry should currently be on
+ * the cache's protected list.
*/
- hbool_t is_read_only; /* TRUE iff the entry should be
- * protected read only.
- */
- int ro_ref_count; /* Number of outstanding read only
- * protects on the entry.
- */
- hbool_t is_pinned; /* entry is currently pinned in
- * the cache.
+ hbool_t is_read_only; /* TRUE iff the entry should be
+ * protected read only.
+ */
+ int ro_ref_count; /* Number of outstanding read only
+ * protects on the entry.
+ */
+ hbool_t is_pinned; /* entry is currently pinned in
+ * the cache.
*/
- haddr_t tag; /* the base_addr as tag for corking entries */
- hbool_t is_corked; /* entry is currently corked or not */
- int pinning_ref_count; /* Number of entries that
- * pin this entry in the cache.
- * When this count drops to zero,
- * this entry should be unpinned.
- */
- int num_pins; /* Number of entries that this
- * entry pins in the cache. This
- * value must be in the range
- * [0, MAX_PINS].
- */
- int pin_type[MAX_PINS]; /* array of the types of entries
- * pinned by this entry.
- */
- int pin_idx[MAX_PINS]; /* array of the indicies of
- * entries pinned by this entry.
- */
- int num_flush_ops; /* integer field containing the
- * number of flush operations to
- * be executed when the entry is
- * flushed. This value must lie in
- * the closed interval
- * [0, MAX_FLUSH_OPS].
- */
- struct flush_op flush_ops[MAX_FLUSH_OPS]; /* Array of instances
- * of struct flush_op detailing the
- * flush operations (if any) that
- * are to be executed when the entry
- * is flushed from the cache.
- *
- * num_flush_ops contains the number
- * of valid entries in this array.
- */
- hbool_t flush_op_self_resize_in_progress; /* Boolean flag
- * that is set to TRUE iff this
- * entry is being flushed, it has
- * been resized by a resize flush
- * op, and the flush function has
- * not yet returned, This field is
- * used to turn off overactive santity
- * checking code that would otherwise
- * cause a false test failure.
- */
- hbool_t deserialized; /* entry has been deserialized since
- * the last time it was reset.
+ haddr_t tag; /* the base_addr as tag for corking entries */
+ hbool_t is_corked; /* entry is currently corked or not */
+ int pinning_ref_count; /* Number of entries that
+ * pin this entry in the cache.
+ * When this count drops to zero,
+ * this entry should be unpinned.
+ */
+ int num_pins; /* Number of entries that this
+ * entry pins in the cache. This
+ * value must be in the range
+ * [0, MAX_PINS].
+ */
+ int pin_type[MAX_PINS]; /* array of the types of entries
+ * pinned by this entry.
+ */
+ int pin_idx[MAX_PINS]; /* array of the indicies of
+ * entries pinned by this entry.
+ */
+ int num_flush_ops; /* integer field containing the
+ * number of flush operations to
+ * be executed when the entry is
+ * flushed. This value must lie in
+ * the closed interval
+ * [0, MAX_FLUSH_OPS].
+ */
+ struct flush_op flush_ops[MAX_FLUSH_OPS]; /* Array of instances
+ * of struct flush_op detailing the
+ * flush operations (if any) that
+ * are to be executed when the entry
+ * is flushed from the cache.
+ *
+ * num_flush_ops contains the number
+ * of valid entries in this array.
+ */
+ hbool_t flush_op_self_resize_in_progress; /* Boolean flag
+ * that is set to TRUE iff this
+ * entry is being flushed, it has
+ * been resized by a resize flush
+ * op, and the flush function has
+ * not yet returned, This field is
+ * used to turn off overactive santity
+ * checking code that would otherwise
+ * cause a false test failure.
+ */
+ hbool_t deserialized; /* entry has been deserialized since
+ * the last time it was reset.
*/
- hbool_t serialized; /* entry has been serialized since the
+ hbool_t serialized; /* entry has been serialized since the
* last time it was reset.
*/
hbool_t destroyed; /* entry has been destroyed since the
* last time it was reset.
*/
- hbool_t expunged; /* entry has been expunged since the
+ hbool_t expunged; /* entry has been expunged since the
* last time it was reset.
*/
int flush_dep_par_type[MAX_FLUSH_DEP_PARS]; /* Entry types of flush dependency parents */
@@ -352,15 +352,15 @@ typedef struct test_entry_t
unsigned flush_dep_npar; /* Number of flush dependency parents */
unsigned flush_dep_nchd; /* Number of flush dependency children */
unsigned flush_dep_ndirty_chd; /* Number of dirty flush dependency children (including granchildren, etc.) */
- hbool_t pinned_from_client; /* entry was pinned by client call */
- hbool_t pinned_from_cache; /* entry was pinned by cache internally */
+ hbool_t pinned_from_client; /* entry was pinned by client call */
+ hbool_t pinned_from_cache; /* entry was pinned by cache internally */
unsigned flush_order; /* Order that entry was flushed in */
unsigned notify_after_insert_count; /* Count of times that entry was inserted in cache */
unsigned notify_before_evict_count; /* Count of times that entry was removed in cache */
- size_t actual_len; /* Simulate the entry's actual size for a speculative load */
- unsigned max_verify_ct; /* Maximum # of times to verify an entry's checksum */
- unsigned verify_ct; /* Count the # of checksum verification for an entry */
+ size_t actual_len; /* Simulate the entry's actual size for a speculative load */
+ unsigned max_verify_ct; /* Maximum # of times to verify an entry's checksum */
+ unsigned verify_ct; /* Count the # of checksum verification for an entry */
} test_entry_t;
/* The following are cut down test versions of the hash table manipulation
@@ -508,41 +508,35 @@ if ( ( (cache_ptr) == NULL ) || \
(i).empty_reserve = (e).empty_reserve; \
}
-
+
/* misc type definitions */
struct expected_entry_status
{
- int entry_type;
+ int entry_type;
int entry_index;
size_t size;
- hbool_t in_cache;
+ hbool_t in_cache;
hbool_t at_main_addr;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- hbool_t deserialized;
- hbool_t serialized;
- hbool_t destroyed;
+ hbool_t is_dirty;
+ hbool_t is_protected;
+ hbool_t is_pinned;
+ hbool_t deserialized;
+ hbool_t serialized;
+ hbool_t destroyed;
int flush_dep_par_type[MAX_FLUSH_DEP_PARS]; /* Entry types of flush dependency parents */
int flush_dep_par_idx[MAX_FLUSH_DEP_PARS]; /* Indices of flush dependency parents */
unsigned flush_dep_npar; /* Number of flush dependency parents */
unsigned flush_dep_nchd; /* Number of flush dependency children */
unsigned flush_dep_ndirty_chd; /* Number of dirty flush dependency children */
int flush_order; /* flush order of entry */
- unsigned char is_corked; /* cork status of entry */
+ unsigned char is_corked; /* cork status of entry */
};
-
-/* global variable externs: */
-H5TEST_DLLVAR H5C_t * saved_cache;
-
-H5TEST_DLLVAR const char *FILENAME[];
-H5TEST_DLLVAR haddr_t saved_actual_base_addr;
-H5TEST_DLLVAR hbool_t write_permitted;
+/* global variable externs: */
H5TEST_DLLVAR hbool_t pass; /* set to false on error */
H5TEST_DLLVAR const char *failure_mssg;
@@ -556,7 +550,7 @@ H5TEST_DLLVAR const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES];
H5TEST_DLLVAR const H5C_class_t *types[NUMBER_OF_ENTRY_TYPES];
-
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -641,8 +635,6 @@ H5TEST_DLL void resize_entry(H5F_t * file_ptr,
size_t new_size,
hbool_t in_cache);
-H5TEST_DLL H5F_t *setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged);
-
H5TEST_DLL void row_major_scan_forward(H5F_t * file_ptr,
int32_t max_index,
int32_t lag,
@@ -727,10 +719,6 @@ H5TEST_DLL void hl_col_major_scan_backward(H5F_t * file_ptr,
hbool_t do_inserts,
int dirty_unprotects);
-H5TEST_DLL void takedown_cache(H5F_t * file_ptr,
- hbool_t dump_stats,
- hbool_t dump_detailed_stats);
-
H5TEST_DLL void flush_cache(H5F_t * file_ptr,
hbool_t destroy_entries,
hbool_t dump_stats,
@@ -747,7 +735,7 @@ H5TEST_DLL void unprotect_entry(H5F_t * file_ptr,
H5TEST_DLL void verify_clean(void);
H5TEST_DLL void verify_entry_status(H5C_t * cache_ptr,
- int tag,
+ int tag,
int num_entries,
struct expected_entry_status expected[]);
diff --git a/test/cache_image.c b/test/cache_image.c
index 5967ecc..d5d3d95 100644
--- a/test/cache_image.c
+++ b/test/cache_image.c
@@ -14,8 +14,8 @@
/* Programmer: John Mainzer
* 7/13/15
*
- * This file contains tests specific to the cache image
- * feature implemented in H5C.c
+ * This file contains tests specific to the cache image
+ * feature implemented in H5C.c
*/
#include "cache_common.h"
#include "genall5.h"
@@ -33,7 +33,7 @@ static void create_datasets(hid_t file_id, int min_dset, int max_dset);
static void delete_datasets(hid_t file_id, int min_dset, int max_dset);
static void open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
hbool_t read_only, hbool_t set_mdci_fapl, hbool_t config_fsm,
- hbool_t set_eoc, const char *hdf_file_name, unsigned cache_image_flags,
+ hbool_t set_eoc, const char *hdf_file_name, unsigned cache_image_flags,
hid_t *file_id_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr);
static void attempt_swmr_open_hdf5_file(hbool_t create_file,
hbool_t set_mdci_fapl, const char *hdf_file_name);
@@ -62,7 +62,6 @@ static unsigned cache_image_api_error_check_4(void);
static unsigned get_free_sections_test(void);
static unsigned evict_on_close_test(void);
-
/****************************************************************************/
/***************************** Utility Functions ****************************/
/****************************************************************************/
@@ -71,10 +70,10 @@ static unsigned evict_on_close_test(void);
* Function: create_datasets()
*
* Purpose: If pass is TRUE on entry, create the specified datasets
- * in the indicated file.
+ * in the indicated file.
*
- * Datasets and their contents must be well known, as we
- * will verify that they contain the expected data later.
+ * Datasets and their contents must be well known, as we
+ * will verify that they contain the expected data later.
*
* On failure, set pass to FALSE, and set failure_mssg
* to point to an appropriate failure message.
@@ -93,7 +92,7 @@ static unsigned evict_on_close_test(void);
#define DSET_SIZE (40 * CHUNK_SIZE)
#define MAX_NUM_DSETS 256
-static void
+static void
create_datasets(hid_t file_id, int min_dset, int max_dset)
{
const char * fcn_name = "create_datasets()";
@@ -169,7 +168,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset)
/* create the dataset */
if ( pass ) {
- sprintf(dset_name, "/dset%03d", i);
+ HDsprintf(dset_name, "/dset%03d", i);
dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE,
dataspace_id, H5P_DEFAULT,
properties, H5P_DEFAULT);
@@ -315,8 +314,8 @@ create_datasets(hid_t file_id, int min_dset, int max_dset)
/* read the chunk from file */
if ( pass ) {
- status = H5Dread(dataset_ids[m], H5T_NATIVE_INT,
- memspace_id, filespace_ids[m],
+ status = H5Dread(dataset_ids[m], H5T_NATIVE_INT,
+ memspace_id, filespace_ids[m],
H5P_DEFAULT, data_chunk);
if ( status < 0 ) {
@@ -341,7 +340,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset)
valid_chunk = FALSE;
- if ( verbose ) {
+ if ( verbose ) {
HDfprintf(stdout,
"data_chunk[%0d][%0d] = %0d, expect %0d.\n",
@@ -351,7 +350,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset)
HDfprintf(stdout,
"m = %d, i = %d, j = %d, k = %d, l = %d\n",
m, i, j, k, l);
- }
+ }
}
}
}
@@ -361,12 +360,12 @@ create_datasets(hid_t file_id, int min_dset, int max_dset)
pass = FALSE;
failure_mssg = "slab validation failed.";
- if ( verbose ) {
+ if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, m);
- }
+ }
}
}
m++;
@@ -417,16 +416,16 @@ create_datasets(hid_t file_id, int min_dset, int max_dset)
} /* create_datasets() */
-
+
/*-------------------------------------------------------------------------
* Function: delete_datasets()
*
- * Purpose: If pass is TRUE on entry, verify and then delete the
- * dataset(s) indicated by min_dset and max_dset in the
- * indicated file.
+ * Purpose: If pass is TRUE on entry, verify and then delete the
+ * dataset(s) indicated by min_dset and max_dset in the
+ * indicated file.
*
- * Datasets and their contents must be well know, as we
- * will verify that they contain the expected data later.
+ * Datasets and their contents must be well know, as we
+ * will verify that they contain the expected data later.
*
* On failure, set pass to FALSE, and set failure_mssg
* to point to an appropriate failure message.
@@ -441,7 +440,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset)
*-------------------------------------------------------------------------
*/
-static void
+static void
delete_datasets(hid_t file_id, int min_dset, int max_dset)
{
const char * fcn_name = "delete_datasets()";
@@ -470,13 +469,13 @@ delete_datasets(hid_t file_id, int min_dset, int max_dset)
while ( ( pass ) && ( i <= max_dset ) )
{
- sprintf(dset_name, "/dset%03d", i);
+ HDsprintf(dset_name, "/dset%03d", i);
- if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) {
+ if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) {
pass = FALSE;
failure_mssg = "H5Ldelete() failed.";
- }
+ }
i++;
}
@@ -488,32 +487,32 @@ delete_datasets(hid_t file_id, int min_dset, int max_dset)
} /* delete_datasets() */
-
+
/*-------------------------------------------------------------------------
* Function: open_hdf5_file()
*
- * Purpose: If pass is true on entry, create or open the specified HDF5
- * and test to see if it has a metadata cache image superblock
- * extension message.
+ * Purpose: If pass is true on entry, create or open the specified HDF5
+ * and test to see if it has a metadata cache image superblock
+ * extension message.
*
- * Set pass to FALSE and issue a suitable failure
- * message if either the file contains a metadata cache image
- * superblock extension and mdci_sbem_expected is TRUE, or
- * vise versa.
+ * Set pass to FALSE and issue a suitable failure
+ * message if either the file contains a metadata cache image
+ * superblock extension and mdci_sbem_expected is TRUE, or
+ * vise versa.
*
- * If mdci_sbem_expected is TRUE, also verify that the metadata
- * cache has been advised of this.
+ * If mdci_sbem_expected is TRUE, also verify that the metadata
+ * cache has been advised of this.
*
- * If read_only is TRUE, open the file read only. Otherwise
- * open the file read/write.
+ * If read_only is TRUE, open the file read only. Otherwise
+ * open the file read/write.
*
- * If set_mdci_fapl is TRUE, set the metadata cache image
- * FAPL entry when opening the file, and verify that the
- * metadata cache is notified.
+ * If set_mdci_fapl is TRUE, set the metadata cache image
+ * FAPL entry when opening the file, and verify that the
+ * metadata cache is notified.
*
- * If config_fsm is TRUE, setup the persistent free space
- * manager. Note that this flag may only be set if
- * create_file is also TRUE.
+ * If config_fsm is TRUE, setup the persistent free space
+ * manager. Note that this flag may only be set if
+ * create_file is also TRUE.
*
* Return pointers to the cache data structure and file data
* structures.
@@ -556,8 +555,8 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
if ( pass )
{
- /* opening the file both read only and with a cache image
- * requested is a contradiction. We resolve it by ignoring
+ /* opening the file both read only and with a cache image
+ * requested is a contradiction. We resolve it by ignoring
* the cache image request silently.
*/
if ( ( create_file && mdci_sbem_expected ) ||
@@ -600,7 +599,7 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
/* call H5Pset_libver_bounds() on the fapl_id */
if ( pass ) {
- if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST,
+ if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST,
H5F_LIBVER_LATEST) < 0 ) {
pass = FALSE;
@@ -625,7 +624,7 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) ||
( cache_image_config.generate_image != FALSE ) ||
( cache_image_config.save_resize_status != FALSE ) ||
- ( cache_image_config.entry_ageout !=
+ ( cache_image_config.entry_ageout !=
H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) ) {
pass = FALSE;
@@ -657,17 +656,17 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
/* setup the persistent free space manager if indicated */
if ( ( pass ) && ( config_fsm ) ) {
- fcpl_id = H5Pcreate(H5P_FILE_CREATE);
+ fcpl_id = H5Pcreate(H5P_FILE_CREATE);
- if ( fcpl_id <= 0 ) {
+ if ( fcpl_id <= 0 ) {
- pass = FALSE;
- failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.";
- }
+ pass = FALSE;
+ failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.";
+ }
}
if ( ( pass ) && ( config_fsm ) ) {
- if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE,
+ if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE,
TRUE, (hsize_t)1) < 0) {
pass = FALSE;
failure_mssg = "H5Pset_file_space_strategy() failed.";
@@ -693,13 +692,13 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
if ( create_file ) {
- if ( fcpl_id != -1 )
+ if ( fcpl_id != -1 )
- file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC,
+ file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC,
fcpl_id, fapl_id);
- else
+ else
- file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC,
+ file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC,
H5P_DEFAULT, fapl_id);
} else {
@@ -713,6 +712,9 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
file_id = H5Fopen(hdf_file_name, H5F_ACC_RDWR, fapl_id);
}
+ /* tidy up */
+ H5Pclose(fapl_id);
+
if ( file_id < 0 ) {
pass = FALSE;
@@ -776,26 +778,26 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
if ( set_mdci_fapl ) {
- if ( read_only ) {
+ if ( read_only ) {
- if ( ( image_ctl.version !=
+ if ( ( image_ctl.version !=
H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) ||
( image_ctl.generate_image != FALSE ) ||
( image_ctl.save_resize_status != FALSE ) ||
- ( image_ctl.entry_ageout !=
+ ( image_ctl.entry_ageout !=
H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) ||
( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) {
pass = FALSE;
failure_mssg = "Unexpected image_ctl values(1).\n";
}
- } else {
+ } else {
- if ( ( image_ctl.version !=
+ if ( ( image_ctl.version !=
H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) ||
( image_ctl.generate_image != TRUE ) ||
( image_ctl.save_resize_status != FALSE ) ||
- ( image_ctl.entry_ageout !=
+ ( image_ctl.entry_ageout !=
H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) ||
( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) {
@@ -805,11 +807,11 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
}
} else {
- if ( ( image_ctl.version !=
+ if ( ( image_ctl.version !=
H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) ||
( image_ctl.generate_image != FALSE ) ||
( image_ctl.save_resize_status != FALSE ) ||
- ( image_ctl.entry_ageout !=
+ ( image_ctl.entry_ageout !=
H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) ||
( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) {
@@ -860,15 +862,15 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
pass = FALSE;
failure_mssg = "mdci sb extension message not present?\n";
}
- }
+ }
} else {
- if ( ( cache_ptr->load_image == TRUE ) ||
+ if ( ( cache_ptr->load_image == TRUE ) ||
( cache_ptr->delete_image == TRUE ) ) {
pass = FALSE;
failure_mssg = "mdci sb extension message present?\n";
- }
+ }
}
}
@@ -888,12 +890,12 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
} /* open_hdf5_file() */
-
+
/*-------------------------------------------------------------------------
* Function: attempt_swmr_open_hdf5_file()
*
- * Purpose: If pass is true on entry, attempt to create or open the
- * specified HDF5 file with SWMR, and also with cache image
+ * Purpose: If pass is true on entry, attempt to create or open the
+ * specified HDF5 file with SWMR, and also with cache image
* creation if requested.
*
* In all cases, the attempted open or create should fail.
@@ -910,8 +912,8 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
static void
attempt_swmr_open_hdf5_file(const hbool_t create_file,
- const hbool_t set_mdci_fapl,
- const char * hdf_file_name)
+ const hbool_t set_mdci_fapl,
+ const char * hdf_file_name)
{
const char * fcn_name = "attempt_swmr_open_hdf5_file()";
hbool_t show_progress = FALSE;
@@ -942,7 +944,7 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file,
/* call H5Pset_libver_bounds() on the fapl_id */
if ( pass ) {
- if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST)
+ if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST)
< 0 ) {
pass = FALSE;
@@ -977,8 +979,8 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file,
if ( create_file ) {
H5E_BEGIN_TRY {
- file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE,
- H5P_DEFAULT, fapl_id);
+ file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE,
+ H5P_DEFAULT, fapl_id);
} H5E_END_TRY;
} else {
@@ -992,7 +994,7 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file,
pass = FALSE;
failure_mssg = "SWMR H5Fcreate() or H5Fopen() succeeded.\n";
- }
+ }
}
if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++);
@@ -1001,17 +1003,17 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file,
} /* attempt_swmr_open_hdf5_file() */
-
+
/*-------------------------------------------------------------------------
* Function: verify_datasets()
*
- * Purpose: If pass is TRUE on entry, verify that the datasets in the
- * file exist and contain the expected data.
+ * Purpose: If pass is TRUE on entry, verify that the datasets in the
+ * file exist and contain the expected data.
*
- * Note that these datasets were created by
- * create_datasets() above. Thus any changes in that
- * function must be reflected in this function, and
- * vise-versa.
+ * Note that these datasets were created by
+ * create_datasets() above. Thus any changes in that
+ * function must be reflected in this function, and
+ * vise-versa.
*
* On failure, set pass to FALSE, and set failure_mssg
* to point to an appropriate failure message.
@@ -1026,7 +1028,7 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file,
*-------------------------------------------------------------------------
*/
-static void
+static void
verify_datasets(hid_t file_id, int min_dset, int max_dset)
{
const char * fcn_name = "verify_datasets()";
@@ -1062,7 +1064,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset)
/* open the dataset */
if ( pass ) {
- sprintf(dset_name, "/dset%03d", i);
+ HDsprintf(dset_name, "/dset%03d", i);
dataset_ids[i] = H5Dopen2(file_id, dset_name, H5P_DEFAULT);
if ( dataset_ids[i] < 0 ) {
@@ -1154,8 +1156,8 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset)
/* read the chunk from file */
if ( pass ) {
- status = H5Dread(dataset_ids[m], H5T_NATIVE_INT,
- memspace_id, filespace_ids[m],
+ status = H5Dread(dataset_ids[m], H5T_NATIVE_INT,
+ memspace_id, filespace_ids[m],
H5P_DEFAULT, data_chunk);
if ( status < 0 ) {
@@ -1180,8 +1182,8 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset)
valid_chunk = FALSE;
- if ( verbose ) {
-
+ if ( verbose ) {
+
HDfprintf(stdout,
"data_chunk[%0d][%0d] = %0d, expect %0d.\n",
k, l, data_chunk[k][l],
@@ -1190,7 +1192,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset)
HDfprintf(stdout,
"m = %d, i = %d, j = %d, k = %d, l = %d\n",
m, i, j, k, l);
- }
+ }
}
}
}
@@ -1200,12 +1202,12 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset)
pass = FALSE;
failure_mssg = "slab validation failed.";
- if ( verbose ) {
+ if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, m);
- }
+ }
}
}
m++;
@@ -1256,7 +1258,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset)
} /* verify_datasets() */
-
+
/****************************************************************************/
/******************************* Test Functions *****************************/
/****************************************************************************/
@@ -1265,60 +1267,60 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset)
* Function: check_cache_image_ctl_flow_1()
*
* Purpose: This test is one of a sequence of control flow tests intended
- * to verify that control flow for the cache image feature works
- * as expected.
+ * to verify that control flow for the cache image feature works
+ * as expected.
*
- * This test is an initial smoke check, so the sequence of
- * operations is relatively simple. In particular, we are
- * testing:
+ * This test is an initial smoke check, so the sequence of
+ * operations is relatively simple. In particular, we are
+ * testing:
*
- * i) Creation of file with cache image FAPL entry set
- * and insertion of metadata cache image superblock
- * message on file close.
+ * i) Creation of file with cache image FAPL entry set
+ * and insertion of metadata cache image superblock
+ * message on file close.
*
- * ii) Open of file with metadata cache image superblock
- * message, transmission of message to metadata cache,
- * and deletion of superblock message prior to close.
+ * ii) Open of file with metadata cache image superblock
+ * message, transmission of message to metadata cache,
+ * and deletion of superblock message prior to close.
*
- * Note that in all cases we are performing operations on the
- * file. While this is the typical case, we must repeat this
- * test without operations on the file.
+ * Note that in all cases we are performing operations on the
+ * file. While this is the typical case, we must repeat this
+ * test without operations on the file.
*
- * 1) Create a HDF5 file with the cache image FAPL entry.
+ * 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set flags forcing creation of metadata cache image
- * super block extension message only.
+ * Set flags forcing creation of metadata cache image
+ * super block extension message only.
*
- * 2) Create some datasets in the file.
+ * 2) Create some datasets in the file.
*
- * 3) Close the file.
+ * 3) Close the file.
*
- * 4) Open the file.
+ * 4) Open the file.
*
- * Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
- * zero respectively. Note that these values indicate
- * that the metadata image block doesn't exist.
+ * Verify that the metadata cache is instructed
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
+ * zero respectively. Note that these values indicate
+ * that the metadata image block doesn't exist.
*
- * 5) Open a dataset.
+ * 5) Open a dataset.
*
- * Verify that the metadata cache image superblock
- * extension message has been deleted.
+ * Verify that the metadata cache image superblock
+ * extension message has been deleted.
*
- * 6) Close the file.
+ * 6) Close the file.
*
- * 7) Open the file.
+ * 7) Open the file.
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*
- * 8) Close the file.
+ * 8) Close the file.
*
- * 9) Delete the file.
+ * 9) Delete the file.
*
* Return: void
*
@@ -1343,7 +1345,7 @@ check_cache_image_ctl_flow_1(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -1358,16 +1360,16 @@ check_cache_image_ctl_flow_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 1) Create a HDF5 file with the cache image FAPL entry.
+ /* 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image FAPL entry.
+ * Verify that the cache is informed of the cache image FAPL entry.
*
- * Set flags forcing creation of metadata cache image super block
- * extension message only.
+ * Set flags forcing creation of metadata cache image super block
+ * extension message only.
*/
if ( pass ) {
@@ -1376,8 +1378,8 @@ check_cache_image_ctl_flow_1(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG,
/* file_id_ptr */ &file_id,
@@ -1385,10 +1387,10 @@ check_cache_image_ctl_flow_1(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Create some datasets in the file. */
if ( pass ) {
@@ -1396,10 +1398,10 @@ check_cache_image_ctl_flow_1(void)
create_datasets(file_id, 0, 5);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 3) Close the file. */
if ( pass ) {
@@ -1412,26 +1414,26 @@ check_cache_image_ctl_flow_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 4) Open the file.
+
+
+ /* 4) Open the file.
*
- * Verify that the metadata cache is instructed to load the
- * metadata cache image, and that the supplied address and length
- * are HADDR_UNDEF and zero respectively. Note that these values
+ * Verify that the metadata cache is instructed to load the
+ * metadata cache image, and that the supplied address and length
+ * are HADDR_UNDEF and zero respectively. Note that these values
* indicate that the metadata image block doesn't exist.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -1439,13 +1441,13 @@ check_cache_image_ctl_flow_1(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 5) Open and close a dataset.
*
- * Verify that the metadata cache image superblock
+ * Verify that the metadata cache image superblock
* extension message has been deleted.
*/
@@ -1461,9 +1463,9 @@ check_cache_image_ctl_flow_1(void)
*/
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
@@ -1476,24 +1478,24 @@ check_cache_image_ctl_flow_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 7) Open the file.
+
+
+ /* 7) Open the file.
*
- * Verify that the file doesn't contain a metadata cache image
+ * Verify that the file doesn't contain a metadata cache image
* superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -1501,9 +1503,9 @@ check_cache_image_ctl_flow_1(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 8) Close the file. */
@@ -1516,9 +1518,9 @@ check_cache_image_ctl_flow_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 9) Delete the file */
@@ -1541,63 +1543,63 @@ check_cache_image_ctl_flow_1(void)
} /* check_cache_image_ctl_flow_1() */
-
+
/*-------------------------------------------------------------------------
* Function: check_cache_image_ctl_flow_2()
*
* Purpose: This test is one of a sequence of control flow tests intended
- * to verify that control flow for the cache image feature works
- * as expected.
+ * to verify that control flow for the cache image feature works
+ * as expected.
*
- * This test is an initial smoke check, so the sequence of
- * operations is relatively simple. In particular, we are
- * testing:
+ * This test is an initial smoke check, so the sequence of
+ * operations is relatively simple. In particular, we are
+ * testing:
*
- * i) Creation of file with cache image FAPL entry set
- * and insertion of metadata cache image superblock
- * message on file close.
+ * i) Creation of file with cache image FAPL entry set
+ * and insertion of metadata cache image superblock
+ * message on file close.
*
- * ii) Open of file with metadata cache image superblock
- * message, transmission of message to metadata cache,
- * and deletion of superblock message prior to close.
+ * ii) Open of file with metadata cache image superblock
+ * message, transmission of message to metadata cache,
+ * and deletion of superblock message prior to close.
*
- * Note that unlike the previous test, no operations are performed
- * on the file. As a result of this, the metadata cache image
- * message is not processed until the metadata cache receives
- * the file close warning. (Under normal circumstances, it is
- * processed as part of the first protect operation after the
- * superblock is loaded.)
+ * Note that unlike the previous test, no operations are performed
+ * on the file. As a result of this, the metadata cache image
+ * message is not processed until the metadata cache receives
+ * the file close warning. (Under normal circumstances, it is
+ * processed as part of the first protect operation after the
+ * superblock is loaded.)
*
- * In this particular test, we preform the following operations:
+ * In this particular test, we preform the following operations:
*
- * 1) Create a HDF5 file with the cache image FAPL entry.
+ * 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set flags forcing creation of metadata cache image
- * super block extension message only.
+ * Set flags forcing creation of metadata cache image
+ * super block extension message only.
*
- * 2) Close the file.
+ * 2) Close the file.
*
- * 3) Open the file.
+ * 3) Open the file.
*
- * Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
- * zero respectively. Note that these values indicate
- * that the metadata image block doesn't exist.
+ * Verify that the metadata cache is instructed
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
+ * zero respectively. Note that these values indicate
+ * that the metadata image block doesn't exist.
*
- * 6) Close the file.
+ * 6) Close the file.
*
- * 7) Open the file.
+ * 7) Open the file.
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*
- * 8) Close the file.
+ * 8) Close the file.
*
- * 9) Delete the file.
+ * 9) Delete the file.
*
* Return: void
*
@@ -1622,7 +1624,7 @@ check_cache_image_ctl_flow_2(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* setup the file name */
@@ -1636,16 +1638,16 @@ check_cache_image_ctl_flow_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 1) Create a HDF5 file with the cache image FAPL entry.
+ /* 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image FAPL entry.
+ * Verify that the cache is informed of the cache image FAPL entry.
*
- * Set flags forcing creation of metadata cache image super block
- * extension message only.
+ * Set flags forcing creation of metadata cache image super block
+ * extension message only.
*/
if ( pass ) {
@@ -1654,8 +1656,8 @@ check_cache_image_ctl_flow_2(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG,
/* file_id_ptr */ &file_id,
@@ -1663,10 +1665,10 @@ check_cache_image_ctl_flow_2(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Close the file. */
if ( pass ) {
@@ -1679,26 +1681,26 @@ check_cache_image_ctl_flow_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 3) Open the file.
+
+
+ /* 3) Open the file.
*
- * Verify that the metadata cache is instructed to load the
- * metadata cache image, and that the supplied address and length
- * are HADDR_UNDEF and zero respectively. Note that these values
+ * Verify that the metadata cache is instructed to load the
+ * metadata cache image, and that the supplied address and length
+ * are HADDR_UNDEF and zero respectively. Note that these values
* indicate that the metadata image block doesn't exist.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -1706,10 +1708,10 @@ check_cache_image_ctl_flow_2(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 4) Close the file. */
if ( pass ) {
@@ -1721,24 +1723,24 @@ check_cache_image_ctl_flow_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 5) Open the file.
+
+
+ /* 5) Open the file.
*
- * Verify that the file doesn't contain a metadata cache image
+ * Verify that the file doesn't contain a metadata cache image
* superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -1746,9 +1748,9 @@ check_cache_image_ctl_flow_2(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
@@ -1761,9 +1763,9 @@ check_cache_image_ctl_flow_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 7) Delete the file */
@@ -1786,81 +1788,81 @@ check_cache_image_ctl_flow_2(void)
} /* check_cache_image_ctl_flow_2() */
-
+
/*-------------------------------------------------------------------------
* Function: check_cache_image_ctl_flow_3()
*
* Purpose: This test is one of a sequence of control flow tests intended
- * to verify that control flow for the cache image feature works
- * as expected.
+ * to verify that control flow for the cache image feature works
+ * as expected.
*
- * The objectives of this test are to:
+ * The objectives of this test are to:
*
- * i) Test operation of the metadata cache image FAPL
- * entry set on open of an existing file. This
- * should result in the insertion of a metadata
- * cache image superblock message on file close.
+ * i) Test operation of the metadata cache image FAPL
+ * entry set on open of an existing file. This
+ * should result in the insertion of a metadata
+ * cache image superblock message on file close.
*
- * ii) Test operation of the metadata cache image super
- * block extension message when it appears in a file
- * that is opened READ ONLY.
+ * ii) Test operation of the metadata cache image super
+ * block extension message when it appears in a file
+ * that is opened READ ONLY.
*
- * Note that in all cases we are performing operations on the
- * file between file open and close. While this is the
- * typical case, we must repeat this test without operations
- * on the file.
+ * Note that in all cases we are performing operations on the
+ * file between file open and close. While this is the
+ * typical case, we must repeat this test without operations
+ * on the file.
*
- * 1) Create a HDF5 file WITHOUT the cache image FAPL entry.
+ * 1) Create a HDF5 file WITHOUT the cache image FAPL entry.
*
- * Verify that the cache is NOT informed of the cache image
- * FAPL entry.
+ * Verify that the cache is NOT informed of the cache image
+ * FAPL entry.
*
- * 2) Close the file.
+ * 2) Close the file.
*
- * 3) Open the file WITH the cache image FAPL entry.
+ * 3) Open the file WITH the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set flags forcing creation of metadata cache image
- * super block extension message only.
+ * Set flags forcing creation of metadata cache image
+ * super block extension message only.
*
- * 4) Create some datasets.
+ * 4) Create some datasets.
*
- * 5) Close the file.
+ * 5) Close the file.
*
- * 6) Open the file READ ONLY.
+ * 6) Open the file READ ONLY.
*
- * Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
- * zero respectively. Note that these values indicate
- * that the metadata image block doesn't exist.
+ * Verify that the metadata cache is instructed
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
+ * zero respectively. Note that these values indicate
+ * that the metadata image block doesn't exist.
*
- * 7) Verify the contents of the datasets.
+ * 7) Verify the contents of the datasets.
*
- * 8) Close the file.
+ * 8) Close the file.
*
- * 9) Open the file READ/WRITE.
+ * 9) Open the file READ/WRITE.
*
- * Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
- * zero respectively. Note that these values indicate
- * that the metadata image block doesn't exist.
+ * Verify that the metadata cache is instructed
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
+ * zero respectively. Note that these values indicate
+ * that the metadata image block doesn't exist.
*
- * 10) Verify the contents of the datasets.
+ * 10) Verify the contents of the datasets.
*
- * 11) Close the file.
+ * 11) Close the file.
*
- * 12) Open the file
+ * 12) Open the file
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*
- * 13) Close the file.
+ * 13) Close the file.
*
- * 14) Delete the file.
+ * 14) Delete the file.
*
* Return: void
*
@@ -1901,10 +1903,10 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
- /* 1) Create a HDF5 file WITHOUT the cache image FAPL entry.
+
+ /* 1) Create a HDF5 file WITHOUT the cache image FAPL entry.
*
- * Verify that the cache is NOT informed of the cache image
+ * Verify that the cache is NOT informed of the cache image
* FAPL entry.
*/
@@ -1914,8 +1916,8 @@ check_cache_image_ctl_flow_3(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -1926,7 +1928,7 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Close the file. */
if ( pass ) {
@@ -1940,13 +1942,13 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 3) Open the file WITH the cache image FAPL entry.
+
+
+ /* 3) Open the file WITH the cache image FAPL entry.
*
* Verify that the cache is informed of the cache image FAPL entry.
*
- * Set flags forcing creation of metadata cache image super block
+ * Set flags forcing creation of metadata cache image super block
* extension message only.
*/
@@ -1956,8 +1958,8 @@ check_cache_image_ctl_flow_3(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG,
/* file_id_ptr */ &file_id,
@@ -1993,13 +1995,13 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Open the file READ ONLY.
*
* Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
* zero respectively. Note that these values indicate
* that the metadata image block doesn't exist.
*/
@@ -2007,11 +2009,11 @@ check_cache_image_ctl_flow_3(void)
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ TRUE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -2021,7 +2023,7 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 7) Verify the contents of the datasets. */
@@ -2047,13 +2049,13 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 9) Open the file READ/WRITE.
*
* Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
* zero respectively. Note that these values indicate
* that the metadata image block doesn't exist.
*/
@@ -2061,11 +2063,11 @@ check_cache_image_ctl_flow_3(void)
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -2087,7 +2089,7 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 11) Close the file. */
if ( pass ) {
@@ -2102,21 +2104,21 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 12 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 12) Open the file
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -2142,7 +2144,7 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 14 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 14) Delete the file. */
if ( pass ) {
@@ -2165,73 +2167,73 @@ check_cache_image_ctl_flow_3(void)
} /* check_cache_image_ctl_flow_3() */
-
+
/*-------------------------------------------------------------------------
* Function: check_cache_image_ctl_flow_4()
*
* Purpose: This test is one of a sequence of control flow tests intended
- * to verify that control flow for the cache image feature works
- * as expected.
+ * to verify that control flow for the cache image feature works
+ * as expected.
*
- * The objectives of this test are to:
+ * The objectives of this test are to:
*
- * i) Test operation of the metadata cache image FAPL
- * entry set on open of an existing file. This
- * should result in the insertion of a metadata
- * cache image superblock message on file close.
+ * i) Test operation of the metadata cache image FAPL
+ * entry set on open of an existing file. This
+ * should result in the insertion of a metadata
+ * cache image superblock message on file close.
*
- * ii) Test operation of the metadata cache image super
- * block extension message when it appears in a file
- * that is opened READ ONLY.
+ * ii) Test operation of the metadata cache image super
+ * block extension message when it appears in a file
+ * that is opened READ ONLY.
*
- * In this test we avoid all file access beyond file open
- * and close.
+ * In this test we avoid all file access beyond file open
+ * and close.
*
- * 1) Create a HDF5 file WITHOUT the cache image FAPL entry.
+ * 1) Create a HDF5 file WITHOUT the cache image FAPL entry.
*
- * Verify that the cache is NOT informed of the cache image
- * FAPL entry.
+ * Verify that the cache is NOT informed of the cache image
+ * FAPL entry.
*
- * 2) Close the file.
+ * 2) Close the file.
*
- * 3) Open the file WITH the cache image FAPL entry.
+ * 3) Open the file WITH the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set flags forcing creation of metadata cache image
- * super block extension message only.
+ * Set flags forcing creation of metadata cache image
+ * super block extension message only.
*
- * 4) Close the file.
+ * 4) Close the file.
*
- * 5) Open the file READ ONLY.
+ * 5) Open the file READ ONLY.
*
- * Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
- * zero respectively. Note that these values indicate
- * that the metadata image block doesn't exist.
+ * Verify that the metadata cache is instructed
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
+ * zero respectively. Note that these values indicate
+ * that the metadata image block doesn't exist.
*
- * 6) Close the file.
+ * 6) Close the file.
*
- * 7) Open the file READ/WRITE.
+ * 7) Open the file READ/WRITE.
*
- * Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
- * zero respectively. Note that these values indicate
- * that the metadata image block doesn't exist.
+ * Verify that the metadata cache is instructed
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
+ * zero respectively. Note that these values indicate
+ * that the metadata image block doesn't exist.
*
- * 8) Close the file.
+ * 8) Close the file.
*
- * 9) Open the file
+ * 9) Open the file
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*
- * 10) Close the file.
+ * 10) Close the file.
*
- * 11) Delete the file.
+ * 11) Delete the file.
*
* Return: void
*
@@ -2272,10 +2274,10 @@ check_cache_image_ctl_flow_4(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
- /* 1) Create a HDF5 file WITHOUT the cache image FAPL entry.
+
+ /* 1) Create a HDF5 file WITHOUT the cache image FAPL entry.
*
- * Verify that the cache is NOT informed of the cache image
+ * Verify that the cache is NOT informed of the cache image
* FAPL entry.
*/
@@ -2285,8 +2287,8 @@ check_cache_image_ctl_flow_4(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -2297,7 +2299,7 @@ check_cache_image_ctl_flow_4(void)
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Close the file. */
if ( pass ) {
@@ -2311,13 +2313,13 @@ check_cache_image_ctl_flow_4(void)
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 3) Open the file WITH the cache image FAPL entry.
+
+
+ /* 3) Open the file WITH the cache image FAPL entry.
*
* Verify that the cache is informed of the cache image FAPL entry.
*
- * Set flags forcing creation of metadata cache image super block
+ * Set flags forcing creation of metadata cache image super block
* extension message only.
*/
@@ -2327,8 +2329,8 @@ check_cache_image_ctl_flow_4(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG,
/* file_id_ptr */ &file_id,
@@ -2353,13 +2355,13 @@ check_cache_image_ctl_flow_4(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 5) Open the file READ ONLY.
*
* Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
* zero respectively. Note that these values indicate
* that the metadata image block doesn't exist.
*/
@@ -2367,11 +2369,11 @@ check_cache_image_ctl_flow_4(void)
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ TRUE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -2381,7 +2383,7 @@ check_cache_image_ctl_flow_4(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
@@ -2396,13 +2398,13 @@ check_cache_image_ctl_flow_4(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 7) Open the file READ/WRITE.
*
* Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
* zero respectively. Note that these values indicate
* that the metadata image block doesn't exist.
*/
@@ -2410,11 +2412,11 @@ check_cache_image_ctl_flow_4(void)
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -2440,21 +2442,21 @@ check_cache_image_ctl_flow_4(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 9) Open the file
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -2480,7 +2482,7 @@ check_cache_image_ctl_flow_4(void)
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 11) Delete the file. */
if ( pass ) {
@@ -2503,66 +2505,66 @@ check_cache_image_ctl_flow_4(void)
} /* check_cache_image_ctl_flow_4() */
-
+
/*-------------------------------------------------------------------------
* Function: check_cache_image_ctl_flow_5()
*
* Purpose: This test is one of a sequence of control flow tests intended
- * to verify that control flow for the cache image feature works
- * as expected.
+ * to verify that control flow for the cache image feature works
+ * as expected.
*
- * The objective of this test is verify correct control flow
- * when a file with a metadata cache image superblock extension
- * message is opened with the metadata cache image FAPL entry.
+ * The objective of this test is verify correct control flow
+ * when a file with a metadata cache image superblock extension
+ * message is opened with the metadata cache image FAPL entry.
*
- * Note that in all cases we are performing operations on the
- * file between file open and close. While this is the
- * typical case, we must repeat this test without operations
- * on the file.
+ * Note that in all cases we are performing operations on the
+ * file between file open and close. While this is the
+ * typical case, we must repeat this test without operations
+ * on the file.
*
- * 1) Create a HDF5 file with the cache image FAPL entry.
+ * 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set flags forcing creation of metadata cache image
- * super block extension message only.
+ * Set flags forcing creation of metadata cache image
+ * super block extension message only.
*
- * 2) Create some datasets.
+ * 2) Create some datasets.
*
- * 3) Close the file.
+ * 3) Close the file.
*
- * 4) Open the file WITH the cache image FAPL entry.
+ * 4) Open the file WITH the cache image FAPL entry.
*
- * Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
- * zero respectively. Note that these values indicate
- * that the metadata image block doesn't exist.
+ * Verify that the metadata cache is instructed
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
+ * zero respectively. Note that these values indicate
+ * that the metadata image block doesn't exist.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set flags forcing creation of metadata cache image
- * super block extension message only.
+ * Set flags forcing creation of metadata cache image
+ * super block extension message only.
*
- * 5) Verify the contents of the datasets.
+ * 5) Verify the contents of the datasets.
*
- * 6) Close the file.
+ * 6) Close the file.
*
- * 7) Open the file.
+ * 7) Open the file.
*
- * Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
- * zero respectively. Note that these values indicate
- * that the metadata image block doesn't exist.
+ * Verify that the metadata cache is instructed
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
+ * zero respectively. Note that these values indicate
+ * that the metadata image block doesn't exist.
*
- * 8) Verify the contents of the datasets.
+ * 8) Verify the contents of the datasets.
*
- * 9) Close the file.
+ * 9) Close the file.
*
- * 10) Delete the file.
+ * 10) Delete the file.
*
* Return: void
*
@@ -2604,12 +2606,12 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
- /* 1) Create a HDF5 file with the cache image FAPL entry.
+
+ /* 1) Create a HDF5 file with the cache image FAPL entry.
*
* Verify that the cache is informed of the cache image FAPL entry.
*
- * Set flags forcing creation of metadata cache image
+ * Set flags forcing creation of metadata cache image
* super block extension message only.
*/
@@ -2619,8 +2621,8 @@ check_cache_image_ctl_flow_5(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG,
/* file_id_ptr */ &file_id,
@@ -2630,7 +2632,7 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Create some datasets. */
@@ -2642,7 +2644,7 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 3) Close the file. */
if ( pass ) {
@@ -2657,30 +2659,30 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
- /* 4) Open the file WITH the cache image FAPL entry.
+
+ /* 4) Open the file WITH the cache image FAPL entry.
*
* Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
* zero respectively. Note that these values indicate
* that the metadata image block doesn't exist.
*
- * Verify that the cache is informed of the cache image
+ * Verify that the cache is informed of the cache image
* FAPL entry.
*
- * Set flags forcing creation of metadata cache image
+ * Set flags forcing creation of metadata cache image
* super block extension message only.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG,
/* file_id_ptr */ &file_id,
@@ -2701,7 +2703,7 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
if ( pass ) {
@@ -2716,12 +2718,12 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
- /* 7) Open the file.
+
+ /* 7) Open the file.
*
* Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
* zero respectively. Note that these values indicate
* that the metadata image block doesn't exist.
*/
@@ -2729,11 +2731,11 @@ check_cache_image_ctl_flow_5(void)
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -2753,8 +2755,8 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 9) Close the file. */
if ( pass ) {
@@ -2769,7 +2771,7 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 10) Delete the file. */
if ( pass ) {
@@ -2792,58 +2794,58 @@ check_cache_image_ctl_flow_5(void)
} /* check_cache_image_ctl_flow_5() */
-
+
/*-------------------------------------------------------------------------
* Function: check_cache_image_ctl_flow_6()
*
* Purpose: This test is one of a sequence of control flow tests intended
- * to verify that control flow for the cache image feature works
- * as expected.
+ * to verify that control flow for the cache image feature works
+ * as expected.
*
- * The objective of this test is verify correct control flow
- * when a file with a metadata cache image superblock extension
- * message is opened with the metadata cache image FAPL entry.
+ * The objective of this test is verify correct control flow
+ * when a file with a metadata cache image superblock extension
+ * message is opened with the metadata cache image FAPL entry.
*
- * In this test we avoid all file activity other than open
- * and close.
+ * In this test we avoid all file activity other than open
+ * and close.
*
- * 1) Create a HDF5 file with the cache image FAPL entry.
+ * 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set flags forcing creation of metadata cache image
- * super block extension message only.
+ * Set flags forcing creation of metadata cache image
+ * super block extension message only.
*
- * 2) Close the file.
+ * 2) Close the file.
*
- * 3) Open the file WITH the cache image FAPL entry.
+ * 3) Open the file WITH the cache image FAPL entry.
*
- * Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
- * zero respectively. Note that these values indicate
- * that the metadata image block doesn't exist.
+ * Verify that the metadata cache is instructed
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
+ * zero respectively. Note that these values indicate
+ * that the metadata image block doesn't exist.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set flags forcing creation of metadata cache image
- * super block extension message only.
+ * Set flags forcing creation of metadata cache image
+ * super block extension message only.
*
- * 4) Close the file.
+ * 4) Close the file.
*
- * 5) Open the file.
+ * 5) Open the file.
*
- * Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
- * zero respectively. Note that these values indicate
- * that the metadata image block doesn't exist.
+ * Verify that the metadata cache is instructed
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
+ * zero respectively. Note that these values indicate
+ * that the metadata image block doesn't exist.
*
- * 6) Close the file.
+ * 6) Close the file.
*
- * 7) Delete the file.
+ * 7) Delete the file.
*
* Return: void
*
@@ -2885,12 +2887,12 @@ check_cache_image_ctl_flow_6(void)
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
- /* 1) Create a HDF5 file with the cache image FAPL entry.
+
+ /* 1) Create a HDF5 file with the cache image FAPL entry.
*
* Verify that the cache is informed of the cache image FAPL entry.
*
- * Set flags forcing creation of metadata cache image
+ * Set flags forcing creation of metadata cache image
* super block extension message only.
*/
@@ -2900,8 +2902,8 @@ check_cache_image_ctl_flow_6(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG,
/* file_id_ptr */ &file_id,
@@ -2911,7 +2913,7 @@ check_cache_image_ctl_flow_6(void)
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Close the file. */
@@ -2927,30 +2929,30 @@ check_cache_image_ctl_flow_6(void)
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
- /* 4) Open the file WITH the cache image FAPL entry.
+
+ /* 4) Open the file WITH the cache image FAPL entry.
*
* Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
* zero respectively. Note that these values indicate
* that the metadata image block doesn't exist.
*
- * Verify that the cache is informed of the cache image
+ * Verify that the cache is informed of the cache image
* FAPL entry.
*
- * Set flags forcing creation of metadata cache image
+ * Set flags forcing creation of metadata cache image
* super block extension message only.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG,
/* file_id_ptr */ &file_id,
@@ -2961,7 +2963,7 @@ check_cache_image_ctl_flow_6(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 5) Close the file. */
if ( pass ) {
@@ -2976,12 +2978,12 @@ check_cache_image_ctl_flow_6(void)
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
- /* 5) Open the file.
+
+ /* 5) Open the file.
*
* Verify that the metadata cache is instructed
- * to load the metadata cache image, and that the
- * supplied address and length are HADDR_UNDEF and
+ * to load the metadata cache image, and that the
+ * supplied address and length are HADDR_UNDEF and
* zero respectively. Note that these values indicate
* that the metadata image block doesn't exist.
*/
@@ -2989,11 +2991,11 @@ check_cache_image_ctl_flow_6(void)
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -3004,7 +3006,7 @@ check_cache_image_ctl_flow_6(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
if ( pass ) {
@@ -3019,7 +3021,7 @@ check_cache_image_ctl_flow_6(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 7) Delete the file. */
if ( pass ) {
@@ -3042,93 +3044,93 @@ check_cache_image_ctl_flow_6(void)
} /* check_cache_image_ctl_flow_6() */
-
+
/*-------------------------------------------------------------------------
* Function: cache_image_smoke_check_1()
*
* Purpose: This test is one of a sequence of tests intended
- * to exercise the cache image feature verifying that it
- * works more or less correctly in common cases.
+ * to exercise the cache image feature verifying that it
+ * works more or less correctly in common cases.
*
- * This test is an initial smoke check, so the sequence of
- * operations is relatively simple. In particular, we are
- * testing:
+ * This test is an initial smoke check, so the sequence of
+ * operations is relatively simple. In particular, we are
+ * testing:
*
- * i) Creation of file with metadata cache image
- * superblock extension message and cache image
- * block.
+ * i) Creation of file with metadata cache image
+ * superblock extension message and cache image
+ * block.
*
- * ii) Open of file with metadata cache image superblock
- * extension message and cache image block.
- * Deserialization and removal of both, insertion
- * of prefetched cache entries, and deserialization
- * of prefetched cache entries as they are protected.
+ * ii) Open of file with metadata cache image superblock
+ * extension message and cache image block.
+ * Deserialization and removal of both, insertion
+ * of prefetched cache entries, and deserialization
+ * of prefetched cache entries as they are protected.
*
- * iii) Subsequent write of file without metadata cache
- * image.
+ * iii) Subsequent write of file without metadata cache
+ * image.
*
- * iv) Open and close of file with metadata cache image
- * image requested, but with no operations on the
- * file.
+ * iv) Open and close of file with metadata cache image
+ * image requested, but with no operations on the
+ * file.
*
- * To do this:
+ * To do this:
*
- * 1) Create a HDF5 file with the cache image FAPL entry.
+ * 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set all cache image flags, forcing full functionality.
+ * Set all cache image flags, forcing full functionality.
*
- * 2) Create some datasets in the file.
+ * 2) Create some datasets in the file.
*
- * 3) Close the file.
+ * 3) Close the file.
*
- * 4) Open the file.
+ * 4) Open the file.
*
- * Verify that the metadata cache is instructed
- * to load the metadata cache image.
+ * Verify that the metadata cache is instructed
+ * to load the metadata cache image.
*
- * 5) Open a dataset.
+ * 5) Open a dataset.
*
- * Verify that it contains the expected data
+ * Verify that it contains the expected data
*
- * 6) Close the file.
+ * 6) Close the file.
*
- * 7) Open the file.
+ * 7) Open the file.
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*
- * 8) Open a dataset.
+ * 8) Open a dataset.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*
- * 9) Close the file.
+ * 9) Close the file.
*
- * 10) Open the file with the cache image FAPL entry.
+ * 10) Open the file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set all cache image flags, forcing full functionality.
+ * Set all cache image flags, forcing full functionality.
*
- * 11) Close the file. Since there has been no access to
- * any entries that would be included in the cache image,
- * there should be no cache image.
+ * 11) Close the file. Since there has been no access to
+ * any entries that would be included in the cache image,
+ * there should be no cache image.
*
- * 12) Open the file.
+ * 12) Open the file.
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*
- * 13) Open a dataset.
+ * 13) Open a dataset.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*
- * 14) Close the file.
+ * 14) Close the file.
*
- * 15) Delete the file.
+ * 15) Delete the file.
*
* Return: void
*
@@ -3153,7 +3155,7 @@ cache_image_smoke_check_1(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3168,13 +3170,13 @@ cache_image_smoke_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 1) Create a HDF5 file with the cache image FAPL entry.
+ /* 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image FAPL entry.
+ * Verify that the cache is informed of the cache image FAPL entry.
*
* Set flags forcing full function of the cache image feature.
*/
@@ -3185,8 +3187,8 @@ cache_image_smoke_check_1(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -3194,10 +3196,10 @@ cache_image_smoke_check_1(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Create some datasets in the file. */
if ( pass ) {
@@ -3218,10 +3220,10 @@ cache_image_smoke_check_1(void)
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 3) Close the file. */
if ( pass ) {
@@ -3234,26 +3236,26 @@ cache_image_smoke_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 4) Open the file.
+
+
+ /* 4) Open the file.
*
- * Verify that the metadata cache is instructed to load the
- * metadata cache image, and that the supplied address and length
- * are HADDR_UNDEF and zero respectively. Note that these values
+ * Verify that the metadata cache is instructed to load the
+ * metadata cache image, and that the supplied address and length
+ * are HADDR_UNDEF and zero respectively. Note that these values
* indicate that the metadata image block doesn't exist.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -3261,13 +3263,13 @@ cache_image_smoke_check_1(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 5) Open and close a dataset.
*
- * Verify that the metadata cache image superblock
+ * Verify that the metadata cache image superblock
* extension message has been deleted.
*/
@@ -3287,9 +3289,9 @@ cache_image_smoke_check_1(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
@@ -3302,24 +3304,24 @@ cache_image_smoke_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 7) Open the file.
+
+
+ /* 7) Open the file.
*
- * Verify that the file doesn't contain a metadata cache image
+ * Verify that the file doesn't contain a metadata cache image
* superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -3327,13 +3329,13 @@ cache_image_smoke_check_1(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 8) Open and close a dataset.
*
- * Verify that the metadata cache image superblock
+ * Verify that the metadata cache image superblock
* extension message has been deleted.
*/
@@ -3354,7 +3356,7 @@ cache_image_smoke_check_1(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3369,24 +3371,24 @@ cache_image_smoke_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 10) Open the file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -3394,13 +3396,13 @@ cache_image_smoke_check_1(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
- /* 11) Close the file. Since there has been no access to
- * any entries that would be included in the cache image,
- * there should be no cache image.
+
+ /* 11) Close the file. Since there has been no access to
+ * any entries that would be included in the cache image,
+ * there should be no cache image.
*/
if ( pass ) {
@@ -3412,24 +3414,24 @@ cache_image_smoke_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 12) Open the file.
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -3437,13 +3439,13 @@ cache_image_smoke_check_1(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 13) Open a dataset.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*/
if ( pass ) {
@@ -3463,10 +3465,10 @@ cache_image_smoke_check_1(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 14) Close the file. */
if ( pass ) {
@@ -3478,9 +3480,9 @@ cache_image_smoke_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 15) Delete the file */
@@ -3503,55 +3505,55 @@ cache_image_smoke_check_1(void)
} /* cache_image_smoke_check_1() */
-
+
/*-------------------------------------------------------------------------
* Function: cache_image_smoke_check_2()
*
* Purpose: This test is one of a sequence of tests intended
- * to exercise the cache image feature verifying that it
- * works more or less correctly in common cases.
+ * to exercise the cache image feature verifying that it
+ * works more or less correctly in common cases.
*
- * This test is an initial smoke check, so the sequence of
- * operations is relatively simple. In particular, we are
- * testing:
+ * This test is an initial smoke check, so the sequence of
+ * operations is relatively simple. In particular, we are
+ * testing:
*
- * i) Creation of file with metadata cache image
- * superblock extension message and cache image
- * block.
+ * i) Creation of file with metadata cache image
+ * superblock extension message and cache image
+ * block.
*
- * ii) Open of file with metadata cache image superblock
- * extension message and cache image block. Write
- * of prefetched entries to file on file close.
+ * ii) Open of file with metadata cache image superblock
+ * extension message and cache image block. Write
+ * of prefetched entries to file on file close.
*
- * To do this:
+ * To do this:
*
- * 1) Create a HDF5 file with the cache image FAPL entry.
+ * 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set all cache image flags, forcing full functionality.
+ * Set all cache image flags, forcing full functionality.
*
- * 2) Create some datasets in the file.
+ * 2) Create some datasets in the file.
*
- * 3) Close the file.
+ * 3) Close the file.
*
- * 4) Open the file.
+ * 4) Open the file.
*
- * 5) Close the file.
+ * 5) Close the file.
*
- * 6) Open the file.
+ * 6) Open the file.
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*
- * 7) Open a dataset.
+ * 7) Open a dataset.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*
- * 8) Close the file.
+ * 8) Close the file.
*
- * 9) Delete the file.
+ * 9) Delete the file.
*
* Return: void
*
@@ -3576,7 +3578,7 @@ cache_image_smoke_check_2(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3591,13 +3593,13 @@ cache_image_smoke_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 1) Create a HDF5 file with the cache image FAPL entry.
+ /* 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image FAPL entry.
+ * Verify that the cache is informed of the cache image FAPL entry.
*
* Set flags forcing full function of the cache image feature.
*/
@@ -3608,8 +3610,8 @@ cache_image_smoke_check_2(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ TRUE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ TRUE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -3617,10 +3619,10 @@ cache_image_smoke_check_2(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Create some datasets in the file. */
if ( pass ) {
@@ -3640,10 +3642,10 @@ cache_image_smoke_check_2(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 3) Close the file. */
if ( pass ) {
@@ -3656,24 +3658,23 @@ cache_image_smoke_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 4) Open the file.
+
+ /* 4) Open the file.
*
- * Verify that the metadata cache is instructed to load the
+ * Verify that the metadata cache is instructed to load the
* metadata cache image.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -3682,15 +3683,15 @@ cache_image_smoke_check_2(void)
}
/* can't verify that metadata cache image has been loaded directly,
- * as in this cache, the load will not happen until close, and thus
- * the images_created stat will not be readily available as it is
+ * as in this cache, the load will not happen until close, and thus
+ * the images_created stat will not be readily available as it is
* incremented just before the cache is shut down.
*/
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 5) Close the file. */
if ( pass ) {
@@ -3702,24 +3703,24 @@ cache_image_smoke_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 6) Open the file.
+
+
+ /* 6) Open the file.
*
- * Verify that the file doesn't contain a metadata cache image
+ * Verify that the file doesn't contain a metadata cache image
* superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -3727,13 +3728,13 @@ cache_image_smoke_check_2(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 7) Open and close a dataset.
*
- * Verify that the metadata cache image superblock
+ * Verify that the metadata cache image superblock
* extension message has been deleted.
*/
@@ -3742,7 +3743,7 @@ cache_image_smoke_check_2(void)
verify_datasets(file_id, 0, 5);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3757,9 +3758,9 @@ cache_image_smoke_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 9) Delete the file */
@@ -3782,77 +3783,77 @@ cache_image_smoke_check_2(void)
} /* cache_image_smoke_check_2() */
-
+
/*-------------------------------------------------------------------------
* Function: cache_image_smoke_check_3()
*
* Purpose: This test is one of a sequence of tests intended
- * to exercise the cache image feature verifying that it
- * works more or less correctly in common cases.
+ * to exercise the cache image feature verifying that it
+ * works more or less correctly in common cases.
*
- * This test is an initial smoke check, so the sequence of
- * operations is relatively simple. In particular, we are
- * testing:
+ * This test is an initial smoke check, so the sequence of
+ * operations is relatively simple. In particular, we are
+ * testing:
*
- * i) Creation of file with metadata cache image
- * superblock extension message and cache image
- * block.
+ * i) Creation of file with metadata cache image
+ * superblock extension message and cache image
+ * block.
*
- * ii) Read only open and close of file with metadata
- * cache image superblock extension message and
- * cache image block.
+ * ii) Read only open and close of file with metadata
+ * cache image superblock extension message and
+ * cache image block.
*
- * iii) Subsequent R/W open and close of file with metadata
- * cache image superblock extension message and
+ * iii) Subsequent R/W open and close of file with metadata
+ * cache image superblock extension message and
* cache image block.
*
- * To do this:
+ * To do this:
*
- * 1) Create a HDF5 file with the cache image FAPL entry.
+ * 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set all cache image flags, forcing full functionality.
+ * Set all cache image flags, forcing full functionality.
*
- * 2) Create some datasets in the file.
+ * 2) Create some datasets in the file.
*
- * 3) Close the file.
+ * 3) Close the file.
*
- * 4) Open the file read only.
+ * 4) Open the file read only.
*
- * Verify that the file contains a metadata cache
- * image superblock extension message.
+ * Verify that the file contains a metadata cache
+ * image superblock extension message.
*
- * 5 Open a dataset.
+ * 5 Open a dataset.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*
- * 6) Close the file.
+ * 6) Close the file.
*
- * 7) Open the file.
+ * 7) Open the file.
*
- * Verify that the file contains a metadata cache
- * image superblock extension message.
+ * Verify that the file contains a metadata cache
+ * image superblock extension message.
*
- * 8 Open a dataset.
+ * 8 Open a dataset.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*
- * 9) Close the file.
+ * 9) Close the file.
*
- * 10) Open the file.
+ * 10) Open the file.
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*
- * 11) Open a dataset.
+ * 11) Open a dataset.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*
- * 12) Close the file.
+ * 12) Close the file.
*
- * 13) Delete the file.
+ * 13) Delete the file.
*
* Return: void
*
@@ -3877,7 +3878,7 @@ cache_image_smoke_check_3(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3892,13 +3893,13 @@ cache_image_smoke_check_3(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 1) Create a HDF5 file with the cache image FAPL entry.
+ /* 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image FAPL entry.
+ * Verify that the cache is informed of the cache image FAPL entry.
*
* Set flags forcing full function of the cache image feature.
*/
@@ -3909,8 +3910,8 @@ cache_image_smoke_check_3(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ TRUE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ TRUE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -3918,10 +3919,10 @@ cache_image_smoke_check_3(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Create some datasets in the file. */
if ( pass ) {
@@ -3940,10 +3941,10 @@ cache_image_smoke_check_3(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 3) Close the file. */
if ( pass ) {
@@ -3956,24 +3957,24 @@ cache_image_smoke_check_3(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 4) Open the file read only.
+
+
+ /* 4) Open the file read only.
*
- * Verify that the metadata cache is instructed to load the
+ * Verify that the metadata cache is instructed to load the
* metadata cache image.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ TRUE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -3981,13 +3982,13 @@ cache_image_smoke_check_3(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 5) Open and close a dataset.
*
- * Verify that the metadata cache image superblock
+ * Verify that the metadata cache image superblock
* extension message has been deleted.
*/
@@ -4007,10 +4008,10 @@ cache_image_smoke_check_3(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
if ( pass ) {
@@ -4022,24 +4023,24 @@ cache_image_smoke_check_3(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 7) Open the file.
+
+
+ /* 7) Open the file.
*
- * Verify that the file contains a metadata cache image
+ * Verify that the file contains a metadata cache image
* superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -4047,13 +4048,13 @@ cache_image_smoke_check_3(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 8) Open and close a dataset.
*
- * Verify that the metadata cache image superblock
+ * Verify that the metadata cache image superblock
* extension message has been deleted.
*/
@@ -4074,7 +4075,7 @@ cache_image_smoke_check_3(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4088,22 +4089,22 @@ cache_image_smoke_check_3(void)
failure_mssg = "H5Fclose() failed.\n";
}
}
-
-
- /* 10) Open the file.
+
+
+ /* 10) Open the file.
*
- * Verify that the file doesn't contain a metadata cache image
+ * Verify that the file doesn't contain a metadata cache image
* superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -4111,13 +4112,13 @@ cache_image_smoke_check_3(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 11) Open and close a dataset.
*
- * Verify that the metadata cache image superblock
+ * Verify that the metadata cache image superblock
* extension message has been deleted.
*/
@@ -4138,7 +4139,7 @@ cache_image_smoke_check_3(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4153,9 +4154,9 @@ cache_image_smoke_check_3(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 13) Delete the file */
@@ -4178,66 +4179,66 @@ cache_image_smoke_check_3(void)
} /* cache_image_smoke_check_3() */
-
+
/*-------------------------------------------------------------------------
* Function: cache_image_smoke_check_4()
*
- * Purpose: This test attempts to mimic the typical "poor man's
- * parallel use case in which the file is passed between
- * processes, each of which open the file, write some data,
- * close the file, and then pass control on to the next
- * process.
+ * Purpose: This test attempts to mimic the typical "poor man's
+ * parallel use case in which the file is passed between
+ * processes, each of which open the file, write some data,
+ * close the file, and then pass control on to the next
+ * process.
*
- * In this case, we only write one dataset per process.
+ * In this case, we only write one dataset per process.
*
- * Cycle of operation
+ * Cycle of operation
*
- * 1) Create a HDF5 file with the cache image FAPL entry.
+ * 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set all cache image flags, forcing full functionality.
+ * Set all cache image flags, forcing full functionality.
*
- * 2) Create and write a dataset in the file.
+ * 2) Create and write a dataset in the file.
*
- * 3) Close the file.
+ * 3) Close the file.
*
- * 4) Open the file with the cache image FAPL entry.
+ * 4) Open the file with the cache image FAPL entry.
*
- * Verify that the file contains a metadata cache
- * image superblock extension message.
+ * Verify that the file contains a metadata cache
+ * image superblock extension message.
*
- * 5 Create and write a new dataset
+ * 5 Create and write a new dataset
*
- * 6) Close the file.
+ * 6) Close the file.
*
- * If sufficient datasets have been created, continue to
+ * If sufficient datasets have been created, continue to
* 7). Otherwise goto 4)
*
- * 7) Open the file.
+ * 7) Open the file.
*
- * Verify that the file contains a metadata cache
- * image superblock extension message.
+ * Verify that the file contains a metadata cache
+ * image superblock extension message.
*
- * 8) Open all datasets that have been created, and
- * verify that they contain the expected data.
+ * 8) Open all datasets that have been created, and
+ * verify that they contain the expected data.
*
- * 9) Close the file.
+ * 9) Close the file.
*
- * 10) Open the file.
+ * 10) Open the file.
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*
- * 11) Open all datasets that have been created, and
+ * 11) Open all datasets that have been created, and
* verify that they contain the expected data.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*
- * 12) Close the file.
+ * 12) Close the file.
*
- * 13) Delete the file.
+ * 13) Delete the file.
*
* Return: void
*
@@ -4264,7 +4265,7 @@ cache_image_smoke_check_4(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4279,13 +4280,13 @@ cache_image_smoke_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 1) Create a HDF5 file with the cache image FAPL entry.
+ /* 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image FAPL entry.
+ * Verify that the cache is informed of the cache image FAPL entry.
*
* Set flags forcing full function of the cache image feature.
*/
@@ -4296,8 +4297,8 @@ cache_image_smoke_check_4(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ TRUE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ TRUE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -4305,10 +4306,10 @@ cache_image_smoke_check_4(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Create a dataset in the file. */
if ( pass ) {
@@ -4327,10 +4328,10 @@ cache_image_smoke_check_4(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 3) Close the file. */
if ( pass ) {
@@ -4343,26 +4344,26 @@ cache_image_smoke_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
while ( ( pass ) && ( max_dset < MAX_NUM_DSETS ) )
{
-
- /* 4) Open the file.
+
+ /* 4) Open the file.
*
- * Verify that the metadata cache is instructed to load the
+ * Verify that the metadata cache is instructed to load the
* metadata cache image.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -4370,11 +4371,11 @@ cache_image_smoke_check_4(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
- HDfprintf(stdout, "%s:L1 cp = %d, max_dset = %d, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s:L1 cp = %d, max_dset = %d, pass = %d.\n",
fcn_name, cp, max_dset, pass);
-
+
/* 5) Create a dataset in the file. */
if ( pass ) {
@@ -4393,11 +4394,11 @@ cache_image_smoke_check_4(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
- HDfprintf(stdout, "%s:L2 cp = %d, max_dset = %d, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s:L2 cp = %d, max_dset = %d, pass = %d.\n",
fcn_name, cp + 1, max_dset, pass);
-
+
/* 6) Close the file. */
if ( pass ) {
@@ -4410,27 +4411,27 @@ cache_image_smoke_check_4(void)
}
}
- if ( show_progress )
- HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n",
fcn_name, cp + 2, max_dset, pass);
} /* end while */
cp += 3;
-
-
- /* 7) Open the file.
+
+
+ /* 7) Open the file.
*
- * Verify that the file contains a metadata cache image
+ * Verify that the file contains a metadata cache image
* superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -4438,13 +4439,13 @@ cache_image_smoke_check_4(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 8) Open and close all datasets.
*
- * Verify that the metadata cache image superblock
+ * Verify that the metadata cache image superblock
* extension message has been deleted.
*/
@@ -4465,7 +4466,7 @@ cache_image_smoke_check_4(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4479,22 +4480,22 @@ cache_image_smoke_check_4(void)
failure_mssg = "H5Fclose() failed.\n";
}
}
-
-
- /* 10) Open the file.
+
+
+ /* 10) Open the file.
*
- * Verify that the file doesn't contain a metadata cache image
+ * Verify that the file doesn't contain a metadata cache image
* superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -4502,13 +4503,13 @@ cache_image_smoke_check_4(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 11) Open and close all datasets.
*
- * Verify that the metadata cache image superblock
+ * Verify that the metadata cache image superblock
* extension message has been deleted.
*/
@@ -4529,7 +4530,7 @@ cache_image_smoke_check_4(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4544,7 +4545,7 @@ cache_image_smoke_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* 13) Delete the file */
@@ -4565,82 +4566,81 @@ cache_image_smoke_check_4(void)
FUNC, failure_mssg);
return !pass;
-
} /* cache_image_smoke_check_4() */
-
+
/*-------------------------------------------------------------------------
* Function: cache_image_smoke_check_5()
*
- * Purpose: This test attempts to mimic the typical "poor man's
- * parallel use case in which the file is passed between
- * processes, each of which open the file, write some data,
- * close the file, and then pass control on to the next
- * process.
+ * Purpose: This test attempts to mimic the typical "poor man's
+ * parallel use case in which the file is passed between
+ * processes, each of which open the file, write some data,
+ * close the file, and then pass control on to the next
+ * process.
+ *
+ * In this case, we create one group for each process, and
+ * populate it with a "zoo" of HDF5 objects selected to
+ * (ideally) exercise all HDF5 on disk data structures.
*
- * In this case, we create one group for each process, and
- * populate it with a "zoo" of HDF5 objects selected to
- * (ideally) exercise all HDF5 on disk data structures.
+ * Cycle of operation
*
- * Cycle of operation
+ * 1) Create a HDF5 file with the cache image FAPL entry.
*
- * 1) Create a HDF5 file with the cache image FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Set all cache image flags, forcing full functionality.
*
- * Set all cache image flags, forcing full functionality.
+ * 2) Create a process specific group.
*
- * 2) Create a process specific group.
+ * 3) Construct a "zoo" in the above group, and validate it.
*
- * 3) Construct a "zoo" in the above group, and validate it.
+ * 4) Close the file.
*
- * 4) Close the file.
+ * 5) Open the file with the cache image FAPL entry.
*
- * 5) Open the file with the cache image FAPL entry.
+ * Verify that the file contains a metadata cache
+ * image superblock extension message.
*
- * Verify that the file contains a metadata cache
- * image superblock extension message.
+ * 6) Validate the "zoo" created in the previous file open.
*
- * 6) Validate the "zoo" created in the previous file open.
+ * 7) Create a process specific group for this file open
*
- * 7) Create a process specific group for this file open
+ * 8) Construct a "zoo" in the above group, and validate it.
*
- * 8) Construct a "zoo" in the above group, and validate it.
- *
- * 9) Close the file.
+ * 9) Close the file.
*
- * If sufficient zoos have been created, continue to
+ * If sufficient zoos have been created, continue to
* 10). Otherwise goto 5)
*
- * 10) Open the file R/O.
+ * 10) Open the file R/O.
*
- * Verify that the file contains a metadata cache
- * image superblock extension message.
+ * Verify that the file contains a metadata cache
+ * image superblock extension message.
*
- * 11) Validate all the zoos.
+ * 11) Validate all the zoos.
*
- * 12) Close the file.
+ * 12) Close the file.
*
- * 13) Open the file.
+ * 13) Open the file.
*
- * Verify that the file contains a metadata cache
- * image superblock extension message.
+ * Verify that the file contains a metadata cache
+ * image superblock extension message.
*
- * 14) Validate all the zoos.
+ * 14) Validate all the zoos.
*
- * 15) Close the file.
+ * 15) Close the file.
*
- * 16) Open the file.
+ * 16) Open the file.
*
- * Verify that the file doesn't contain a metadata cache
- * image superblock extension message.
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
*
- * 17) Validate all the zoos.
+ * 17) Validate all the zoos.
*
- * 18) Close the file.
+ * 18) Close the file.
*
- * 19) Delete the file.
+ * 19) Delete the file.
*
* Return: void
*
@@ -4672,7 +4672,7 @@ cache_image_smoke_check_5(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4687,13 +4687,13 @@ cache_image_smoke_check_5(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 1) Create a HDF5 file with the cache image FAPL entry.
+ /* 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image FAPL entry.
+ * Verify that the cache is informed of the cache image FAPL entry.
*
* Set flags forcing full function of the cache image feature.
*/
@@ -4704,8 +4704,8 @@ cache_image_smoke_check_5(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ TRUE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ TRUE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -4713,31 +4713,31 @@ cache_image_smoke_check_5(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* 2) Create a process specific group. */
if ( pass ) {
- sprintf(process_group_name, "/process_%d", min_group);
+ HDsprintf(process_group_name, "/process_%d", min_group);
- proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT,
+ proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
if ( proc_gid < 0 ) {
- pass = FALSE;
- failure_mssg = "H5Gcreate2() failed (1).\n";
+ pass = FALSE;
+ failure_mssg = "H5Gcreate2() failed (1).\n";
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* 3) Construct a "zoo" in the above group, and validate it. */
- if ( pass )
+ if ( pass )
create_zoo(file_id, process_group_name, min_group);
#if H5C_COLLECT_CACHE_STATS
@@ -4751,16 +4751,16 @@ cache_image_smoke_check_5(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 4) Close the file. */
if ( pass ) {
- if ( H5Gclose(proc_gid) < 0 ) {
-
+ if ( H5Gclose(proc_gid) < 0 ) {
+
pass = FALSE;
failure_mssg = "H5Gclose(proc_gid) failed. (1)";
}
@@ -4776,26 +4776,26 @@ cache_image_smoke_check_5(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
while ( ( pass ) && ( max_group < MAX_NUM_GROUPS ) )
{
-
- /* 5) Open the file.
+
+ /* 5) Open the file.
*
- * Verify that the metadata cache is instructed to load the
+ * Verify that the metadata cache is instructed to load the
* metadata cache image.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -4803,13 +4803,13 @@ cache_image_smoke_check_5(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
- HDfprintf(stdout, "%s:L1 cp = %d, max_group = %d, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s:L1 cp = %d, max_group = %d, pass = %d.\n",
fcn_name, cp, max_group, pass);
/* 6) Validate the "zoo" created in the previous file open. */
- if ( pass )
+ if ( pass )
validate_zoo(file_id, process_group_name, max_group);
#if H5C_COLLECT_CACHE_STATS
@@ -4823,47 +4823,47 @@ cache_image_smoke_check_5(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
- HDfprintf(stdout, "%s:L2 cp = %d, max_group = %d, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s:L2 cp = %d, max_group = %d, pass = %d.\n",
fcn_name, cp + 1, max_group, pass);
- /* 7) Create a process specific group for this file open */
+ /* 7) Create a process specific group for this file open */
if ( pass ) {
- max_group++;
- sprintf(process_group_name, "/process_%d", max_group);
+ max_group++;
+ HDsprintf(process_group_name, "/process_%d", max_group);
- proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT,
+ proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
if ( proc_gid < 0 ) {
- pass = FALSE;
- failure_mssg = "H5Gcreate2() failed (2).\n";
+ pass = FALSE;
+ failure_mssg = "H5Gcreate2() failed (2).\n";
}
}
- if ( show_progress )
- HDfprintf(stdout, "%s:L3 cp = %d, max_group = %d, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s:L3 cp = %d, max_group = %d, pass = %d.\n",
fcn_name, cp + 2, max_group, pass);
-
- /* 8) Construct a "zoo" in the above group, and validate it. */
- if ( pass )
+
+ /* 8) Construct a "zoo" in the above group, and validate it. */
+ if ( pass )
create_zoo(file_id, process_group_name, max_group);
- if ( show_progress )
- HDfprintf(stdout, "%s:L4 cp = %d, max_group = %d, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s:L4 cp = %d, max_group = %d, pass = %d.\n",
fcn_name, cp + 3, max_group, pass);
-
+
/* 9) Close the file. */
if ( pass ) {
- if ( H5Gclose(proc_gid) < 0 ) {
-
+ if ( H5Gclose(proc_gid) < 0 ) {
+
pass = FALSE;
failure_mssg = "H5Gclose(process_gid) failed. (2)";
}
@@ -4879,24 +4879,24 @@ cache_image_smoke_check_5(void)
}
}
- if ( show_progress )
- HDfprintf(stdout, "%s:L5 cp = %d, max_group = %d, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s:L5 cp = %d, max_group = %d, pass = %d.\n",
fcn_name, cp + 4, max_group, pass);
} /* end while */
cp += 5;
-
- /* 10) Open the file read only.
+
+ /* 10) Open the file read only.
*
- * Verify that the file contains a metadata cache image
+ * Verify that the file contains a metadata cache image
* superblock extension message.
*/
if(pass) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ TRUE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -4911,10 +4911,10 @@ cache_image_smoke_check_5(void)
/* 11) Validate all the zoos. */
i = min_group;
while(pass && i <= max_group) {
- sprintf(process_group_name, "/process_%d", i);
+ HDsprintf(process_group_name, "/process_%d", i);
validate_zoo(file_id, process_group_name, i++);
}
-
+
#if H5C_COLLECT_CACHE_STATS
if( pass) {
if(cache_ptr->images_loaded == 0) {
@@ -4935,20 +4935,20 @@ cache_image_smoke_check_5(void)
}
}
- /* 13) Open the file R/W.
+ /* 13) Open the file R/W.
*
- * Verify that the file contains a metadata cache image
+ * Verify that the file contains a metadata cache image
* superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -4956,7 +4956,7 @@ cache_image_smoke_check_5(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4964,10 +4964,10 @@ cache_image_smoke_check_5(void)
i = min_group;
while ( ( pass ) && ( i <= max_group ) ) {
- sprintf(process_group_name, "/process_%d", i);
+ HDsprintf(process_group_name, "/process_%d", i);
validate_zoo(file_id, process_group_name, i++);
}
-
+
#if H5C_COLLECT_CACHE_STATS
if ( pass ) {
@@ -4980,7 +4980,7 @@ cache_image_smoke_check_5(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4994,22 +4994,22 @@ cache_image_smoke_check_5(void)
failure_mssg = "H5Fclose() failed.\n";
}
}
-
-
- /* 16) Open the file.
+
+
+ /* 16) Open the file.
*
- * Verify that the file doesn't contain a metadata cache image
+ * Verify that the file doesn't contain a metadata cache image
* superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -5017,22 +5017,21 @@ cache_image_smoke_check_5(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 17) Validate all the zoos.
*
- * Verify that the metadata cache image superblock
+ * Verify that the metadata cache image superblock
* extension message has been deleted.
*/
i = min_group;
while ( ( pass ) && ( i <= max_group ) ) {
-
- sprintf(process_group_name, "/process_%d", i);
+ HDsprintf(process_group_name, "/process_%d", i);
validate_zoo(file_id, process_group_name, i++);
}
-
+
#if H5C_COLLECT_CACHE_STATS
if ( pass ) {
@@ -5045,7 +5044,7 @@ cache_image_smoke_check_5(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5060,9 +5059,9 @@ cache_image_smoke_check_5(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 19) Delete the file */
@@ -5086,78 +5085,78 @@ cache_image_smoke_check_5(void)
} /* cache_image_smoke_check_5() */
-
+
/*-------------------------------------------------------------------------
* Function: cache_image_smoke_check_6()
*
* Purpose: As the free space manager metadata is now included in the
- * cache image, a smoke check to verify generally correct
- * behaviour of the persistent free space managers seems
- * prudent.
+ * cache image, a smoke check to verify generally correct
+ * behaviour of the persistent free space managers seems
+ * prudent.
*
- * The basic idea of this test is to construct a long
- * sequence of dataset creations and deletions, all separated
- * by file open/close cycles with cache image enabled. If the
- * perisistant free space managers are performing as expected,
- * the size of the file should stabilize.
+ * The basic idea of this test is to construct a long
+ * sequence of dataset creations and deletions, all separated
+ * by file open/close cycles with cache image enabled. If the
+ * perisistant free space managers are performing as expected,
+ * the size of the file should stabilize.
*
- * To implement this, proceed as outlined in the cycle of
- * operation below:
+ * To implement this, proceed as outlined in the cycle of
+ * operation below:
*
- * Cycle of operation
+ * Cycle of operation
*
- * 1) Create a HDF5 file with the cache image FAPL entry.
+ * 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image
- * FAPL entry.
+ * Verify that the cache is informed of the cache image
+ * FAPL entry.
*
- * Set all cache image flags, forcing full functionality.
+ * Set all cache image flags, forcing full functionality.
*
- * 2) Create and write a dataset in the file.
+ * 2) Create and write a dataset in the file.
*
- * 3) Close the file.
+ * 3) Close the file.
*
- * 4) Open the file with the cache image FAPL entry.
+ * 4) Open the file with the cache image FAPL entry.
*
- * Verify that the file contains a metadata cache
- * image superblock extension message.
+ * Verify that the file contains a metadata cache
+ * image superblock extension message.
*
- * 5) Create and write a new dataset.
+ * 5) Create and write a new dataset.
*
- * 6) Verify and delete the old dataset.
+ * 6) Verify and delete the old dataset.
*
- * 7) Close the file.
+ * 7) Close the file.
*
- * If sufficient datasets have been created, and then
- * deleteded continue to 8). Otherwise goto 4)
+ * If sufficient datasets have been created, and then
+ * deleteded continue to 8). Otherwise goto 4)
*
- * 8) Open the file.
+ * 8) Open the file.
*
- * Verify that the file contains a metadata cache
- * image superblock extension message.
+ * Verify that the file contains a metadata cache
+ * image superblock extension message.
*
- * 9) Verify the last dataset created.
+ * 9) Verify the last dataset created.
*
- * 10) Close the file.
+ * 10) Close the file.
*
- * 11) Open the file.
+ * 11) Open the file.
*
- * 12) Verify and delete the last dataset.
+ * 12) Verify and delete the last dataset.
*
- * Verify that a metadata cache image is not loaded.
+ * Verify that a metadata cache image is not loaded.
*
- * 13) Close the file.
+ * 13) Close the file.
*
- * 14) Get the size of the file. Verify that it is less
- * than 20 KB. Without deletions and persistent free
- * space managers, size size is about 167 MB, so this
- * is sufficient to verify that the persistent free
- * space managers are more or less doing their job.
+ * 14) Get the size of the file. Verify that it is less
+ * than 20 KB. Without deletions and persistent free
+ * space managers, size size is about 167 MB, so this
+ * is sufficient to verify that the persistent free
+ * space managers are more or less doing their job.
*
* Note that in the absence of paged allocation, file
* size gets below 1 KB.
*
- * 15) Delete the file.
+ * 15) Delete the file.
*
* Return: void
*
@@ -5185,7 +5184,7 @@ cache_image_smoke_check_6(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5200,13 +5199,13 @@ cache_image_smoke_check_6(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 1) Create a HDF5 file with the cache image FAPL entry.
+ /* 1) Create a HDF5 file with the cache image FAPL entry.
*
- * Verify that the cache is informed of the cache image FAPL entry.
+ * Verify that the cache is informed of the cache image FAPL entry.
*
* Set flags forcing full function of the cache image feature.
*/
@@ -5217,8 +5216,8 @@ cache_image_smoke_check_6(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ TRUE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ TRUE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -5226,10 +5225,10 @@ cache_image_smoke_check_6(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Create a dataset in the file. */
if ( pass ) {
@@ -5248,10 +5247,10 @@ cache_image_smoke_check_6(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 3) Close the file. */
if ( pass ) {
@@ -5264,26 +5263,26 @@ cache_image_smoke_check_6(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
while ( ( pass ) && ( max_dset < MAX_NUM_DSETS ) )
{
-
- /* 4) Open the file.
+
+ /* 4) Open the file.
*
- * Verify that the metadata cache is instructed to load the
+ * Verify that the metadata cache is instructed to load the
* metadata cache image.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -5291,11 +5290,11 @@ cache_image_smoke_check_6(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
- HDfprintf(stdout, "%s:L1 cp = %d, max_dset = %d, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s:L1 cp = %d, max_dset = %d, pass = %d.\n",
fcn_name, cp, max_dset, pass);
-
+
/* 5) Create a dataset in the file. */
if ( pass ) {
@@ -5314,22 +5313,22 @@ cache_image_smoke_check_6(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
- HDfprintf(stdout, "%s:L2 cp = %d, max_dset = %d, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s:L2 cp = %d, max_dset = %d, pass = %d.\n",
fcn_name, cp + 1, max_dset, pass);
- /* 6) Verify and delete the old dataset. */
- if ( pass ) {
+ /* 6) Verify and delete the old dataset. */
+ if ( pass ) {
- delete_datasets(file_id, min_dset - 2, max_dset - 2);
- }
+ delete_datasets(file_id, min_dset - 2, max_dset - 2);
+ }
- if ( show_progress )
- HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n",
fcn_name, cp + 2, max_dset, pass);
-
+
/* 7) Close the file. */
if ( pass ) {
@@ -5342,27 +5341,27 @@ cache_image_smoke_check_6(void)
}
}
- if ( show_progress )
- HDfprintf(stdout, "%s:L4 cp = %d, max_dset = %d, pass = %d.\n",
+ if ( show_progress )
+ HDfprintf(stdout, "%s:L4 cp = %d, max_dset = %d, pass = %d.\n",
fcn_name, cp + 3, max_dset, pass);
} /* end while */
cp += 4;
-
-
- /* 8) Open the file.
+
+
+ /* 8) Open the file.
*
- * Verify that the file contains a metadata cache image
+ * Verify that the file contains a metadata cache image
* superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -5370,10 +5369,10 @@ cache_image_smoke_check_6(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 9) Verify the last dataset created. */
if ( pass ) {
@@ -5393,7 +5392,7 @@ cache_image_smoke_check_6(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5407,22 +5406,22 @@ cache_image_smoke_check_6(void)
failure_mssg = "H5Fclose() failed.\n";
}
}
-
-
- /* 11) Open the file.
+
+
+ /* 11) Open the file.
*
- * Verify that the file doesn't contain a metadata cache image
+ * Verify that the file doesn't contain a metadata cache image
* superblock extension message.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -5430,13 +5429,13 @@ cache_image_smoke_check_6(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* 12) Verify and delete the last dataset.
*
- * Verify that a metadata cache image is not loaded.
+ * Verify that a metadata cache image is not loaded.
*/
if ( pass ) {
@@ -5455,7 +5454,7 @@ cache_image_smoke_check_6(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
-
+
/* 13) Close the file. */
@@ -5468,7 +5467,7 @@ cache_image_smoke_check_6(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5479,7 +5478,7 @@ cache_image_smoke_check_6(void)
* space managers are more or less doing their job.
*
* Note that in the absence of paged allocation, file
- * size gets below 1 KB, but since this test is run both
+ * size gets below 1 KB, but since this test is run both
* with and without paged allocation, we must leave some
* extra space for the paged allocation case.
*/
@@ -5493,9 +5492,9 @@ cache_image_smoke_check_6(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 15) Delete the file */
if ( pass ) {
@@ -5518,56 +5517,56 @@ cache_image_smoke_check_6(void)
} /* cache_image_smoke_check_6() */
-
+
/*-------------------------------------------------------------------------
* Function: cache_image_api_error_check_1()
*
* Purpose: This test is one of a sequence of tests intended
- * to verify correct management of API errors.
+ * to verify correct management of API errors.
*
- * The object of this test is to verify that a file without
- * a pre-existing cache image that is opened both read only
- * and with a cache image requested is handle correctly
- * (the cache image request should be ignored silently).
+ * The object of this test is to verify that a file without
+ * a pre-existing cache image that is opened both read only
+ * and with a cache image requested is handle correctly
+ * (the cache image request should be ignored silently).
*
- * The test is set up as follows:
+ * The test is set up as follows:
*
- * 1) Create a HDF5 file.
+ * 1) Create a HDF5 file.
*
- * 2) Create some datasets in the file.
+ * 2) Create some datasets in the file.
*
- * 3) Close the file.
+ * 3) Close the file.
*
- * 4) Open the file read only with a cache image FAPL entry
- * requested.
+ * 4) Open the file read only with a cache image FAPL entry
+ * requested.
*
- * 5) Open a dataset.
+ * 5) Open a dataset.
*
- * Verify that it contains the expected data
+ * Verify that it contains the expected data
*
- * Verify that the cache image was not loaded.
+ * Verify that the cache image was not loaded.
*
- * 6) Close the file.
+ * 6) Close the file.
*
- * 7) Open the file read only.
+ * 7) Open the file read only.
*
- * 8) Open a dataset.
+ * 8) Open a dataset.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*
- * Verify that the cache image was not loaded.
+ * Verify that the cache image was not loaded.
*
- * 9) Close the file.
+ * 9) Close the file.
*
- * 10) Open the file read write.
+ * 10) Open the file read write.
*
- * 11) Open a dataset.
+ * 11) Open a dataset.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*
- * 12) Close the file.
+ * 12) Close the file.
*
- * 13) Delete the file.
+ * 13) Delete the file.
*
* Return: void
*
@@ -5592,7 +5591,7 @@ cache_image_api_error_check_1(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5607,7 +5606,7 @@ cache_image_api_error_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5619,8 +5618,8 @@ cache_image_api_error_check_1(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ TRUE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ TRUE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -5628,10 +5627,10 @@ cache_image_api_error_check_1(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Create some datasets in the file. */
if ( pass ) {
@@ -5652,10 +5651,10 @@ cache_image_api_error_check_1(void)
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 3) Close the file. */
if ( pass ) {
@@ -5668,20 +5667,20 @@ cache_image_api_error_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 4) Open the file read only with a cache image FAPL entry requested. */
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ TRUE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -5689,10 +5688,10 @@ cache_image_api_error_check_1(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 5) Open and close a dataset.
*
* Verify that it contains the expected data.
@@ -5716,9 +5715,9 @@ cache_image_api_error_check_1(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
@@ -5731,20 +5730,20 @@ cache_image_api_error_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 7) Open the file read only. */
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ TRUE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -5752,10 +5751,10 @@ cache_image_api_error_check_1(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 8) Open and close a dataset.
*
* Verify that it contains the expected data.
@@ -5780,7 +5779,7 @@ cache_image_api_error_check_1(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5795,20 +5794,20 @@ cache_image_api_error_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 10) Open the file read / write. */
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -5816,9 +5815,9 @@ cache_image_api_error_check_1(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 11) Open and close a dataset.
*
* Verify that it contains the expected data.
@@ -5842,9 +5841,9 @@ cache_image_api_error_check_1(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 12) Close the file. */
@@ -5857,9 +5856,9 @@ cache_image_api_error_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 13) Delete the file */
@@ -5882,68 +5881,68 @@ cache_image_api_error_check_1(void)
} /* cache_image_api_error_check_1() */
-
+
/*-------------------------------------------------------------------------
* Function: cache_image_api_error_check_2()
*
* Purpose: This test is one of a sequence of tests intended
- * to verify correct management of API errors.
+ * to verify correct management of API errors.
*
- * The object of this test is to verify that a file with
- * a pre-existing cache image that is opened both read only
- * and with a cache image requested is handled correctly
- * (the cache image request should be ignored silently).
+ * The object of this test is to verify that a file with
+ * a pre-existing cache image that is opened both read only
+ * and with a cache image requested is handled correctly
+ * (the cache image request should be ignored silently).
*
- * The test is set up as follows:
+ * The test is set up as follows:
*
- * 1) Create a HDF5 file with a cache image requested..
+ * 1) Create a HDF5 file with a cache image requested..
*
- * 2) Create some datasets in the file.
+ * 2) Create some datasets in the file.
*
- * 3) Close the file.
+ * 3) Close the file.
*
- * 4) Open the file read only with a cache image FAPL entry
- * requested.
+ * 4) Open the file read only with a cache image FAPL entry
+ * requested.
*
- * 5) Open a dataset.
+ * 5) Open a dataset.
*
- * Verify that it contains the expected data
+ * Verify that it contains the expected data
*
- * Verify that the cache image was loaded.
+ * Verify that the cache image was loaded.
*
- * 6) Close the file.
+ * 6) Close the file.
*
- * 7) Open the file read only.
+ * 7) Open the file read only.
*
- * 8) Open a dataset.
+ * 8) Open a dataset.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*
- * Verify that the cache image was loaded.
+ * Verify that the cache image was loaded.
*
- * 9) Close the file.
+ * 9) Close the file.
*
- * 10) Open the file read write.
+ * 10) Open the file read write.
*
- * 11) Open a dataset.
+ * 11) Open a dataset.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*
- * Verify that the cache image was loaded.
+ * Verify that the cache image was loaded.
*
- * 12) Close the file.
+ * 12) Close the file.
*
- * 13) Open the file read write.
+ * 13) Open the file read write.
*
- * 14) Open a dataset.
+ * 14) Open a dataset.
*
- * Verify that it contains the expected data.
+ * Verify that it contains the expected data.
*
- * Verify that the cache image was NOT loaded.
+ * Verify that the cache image was NOT loaded.
*
- * 15) Close the file.
+ * 15) Close the file.
*
- * 16) Delete the file.
+ * 16) Delete the file.
*
* Return: void
*
@@ -5968,7 +5967,7 @@ cache_image_api_error_check_2(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5983,7 +5982,7 @@ cache_image_api_error_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5995,8 +5994,8 @@ cache_image_api_error_check_2(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ TRUE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ TRUE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -6004,10 +6003,10 @@ cache_image_api_error_check_2(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Create some datasets in the file. */
if ( pass ) {
@@ -6028,10 +6027,10 @@ cache_image_api_error_check_2(void)
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 3) Close the file. */
if ( pass ) {
@@ -6044,20 +6043,20 @@ cache_image_api_error_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 4) Open the file read only with a cache image FAPL entry requested. */
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ TRUE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -6065,10 +6064,10 @@ cache_image_api_error_check_2(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 5) Open and close a dataset.
*
* Verify that it contains the expected data.
@@ -6092,9 +6091,9 @@ cache_image_api_error_check_2(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
@@ -6107,20 +6106,20 @@ cache_image_api_error_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 7) Open the file read only. */
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ TRUE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ 0,
/* file_id_ptr */ &file_id,
@@ -6128,10 +6127,10 @@ cache_image_api_error_check_2(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 8) Open and close a dataset.
*
* Verify that it contains the expected data.
@@ -6156,7 +6155,7 @@ cache_image_api_error_check_2(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6171,20 +6170,20 @@ cache_image_api_error_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 10) Open the file read / write. */
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ TRUE,
+ /* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -6192,9 +6191,9 @@ cache_image_api_error_check_2(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 11) Open and close a dataset.
*
* Verify that it contains the expected data.
@@ -6218,9 +6217,9 @@ cache_image_api_error_check_2(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 12) Close the file. */
@@ -6233,7 +6232,7 @@ cache_image_api_error_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6242,11 +6241,11 @@ cache_image_api_error_check_2(void)
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -6254,9 +6253,9 @@ cache_image_api_error_check_2(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 14) Open and close a dataset.
*
* Verify that it contains the expected data.
@@ -6280,9 +6279,9 @@ cache_image_api_error_check_2(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 15) Close the file. */
@@ -6295,9 +6294,9 @@ cache_image_api_error_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 13) Delete the file */
@@ -6320,36 +6319,36 @@ cache_image_api_error_check_2(void)
} /* cache_image_api_error_check_2() */
-
+
/*-------------------------------------------------------------------------
* Function: cache_image_api_error_check_3()
*
* Purpose: This test is one of a sequence of tests intended
- * to verify correct management of API errors.
+ * to verify correct management of API errors.
*
- * At present, SWMR and cache image may not be active
- * at the same time. The purpose of this test is to
- * verify that attempts to run SWMR and cache image
- * at the same time will fail.
+ * At present, SWMR and cache image may not be active
+ * at the same time. The purpose of this test is to
+ * verify that attempts to run SWMR and cache image
+ * at the same time will fail.
*
- * The test is set up as follows:
+ * The test is set up as follows:
*
- * 1) Create a HDF5 file with a cache image requested..
+ * 1) Create a HDF5 file with a cache image requested..
*
- * 2) Try to start SWMR write -- should fail.
+ * 2) Try to start SWMR write -- should fail.
*
* 3) Discard the file if necessary
*
- * 4) Attempt to create a HDF5 file with SWMR write
- * access and cache image requested -- should fail.
+ * 4) Attempt to create a HDF5 file with SWMR write
+ * access and cache image requested -- should fail.
*
* 5) Discard the file if necessary
*
* 6) Create a HDF5 file with a cache image requested.
*
- * 7) Create some datasets in the file.
+ * 7) Create some datasets in the file.
*
- * 8) Close the file.
+ * 8) Close the file.
*
* 9) Attempt to open the file with SWMR write access --
* should fail.
@@ -6379,7 +6378,7 @@ cache_image_api_error_check_3(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6394,7 +6393,7 @@ cache_image_api_error_check_3(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6406,8 +6405,8 @@ cache_image_api_error_check_3(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ TRUE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ TRUE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -6415,9 +6414,9 @@ cache_image_api_error_check_3(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Try to start SWMR write -- should fail. */
@@ -6432,9 +6431,9 @@ cache_image_api_error_check_3(void)
} H5E_END_TRY;
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 3) Discard the file if necessary */
@@ -6454,19 +6453,19 @@ cache_image_api_error_check_3(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
- /* 4) Attempt to create a HDF5 file with SWMR write
+
+ /* 4) Attempt to create a HDF5 file with SWMR write
* access and cache image requested -- should fail.
*/
-
+
attempt_swmr_open_hdf5_file(/* create_file */ TRUE,
- /* set_mdci_fapl */ TRUE,
+ /* set_mdci_fapl */ TRUE,
/* hdf_file_name */ filename);
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6474,16 +6473,16 @@ cache_image_api_error_check_3(void)
if ( pass ) {
- /* file probably doesn't exist, so don't
+ /* file probably doesn't exist, so don't
* error check the remove call.
*/
HDremove(filename);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Create a HDF5 file with a cache image requested. */
if ( pass ) {
@@ -6492,8 +6491,8 @@ cache_image_api_error_check_3(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ TRUE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ TRUE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -6501,10 +6500,10 @@ cache_image_api_error_check_3(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 7) Create some datasets in the file. */
if ( pass ) {
@@ -6523,9 +6522,9 @@ cache_image_api_error_check_3(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 8) Close the file. */
@@ -6539,20 +6538,20 @@ cache_image_api_error_check_3(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 9) Attempt to open the file with SWMR write access -- should fail. */
-
+
attempt_swmr_open_hdf5_file(/* create_file */ FALSE,
- /* set_mdci_fapl */ TRUE,
+ /* set_mdci_fapl */ TRUE,
/* hdf_file_name */ filename);
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 10) Discard the file if necessary. */
if ( pass ) {
@@ -6564,7 +6563,7 @@ cache_image_api_error_check_3(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6578,67 +6577,67 @@ cache_image_api_error_check_3(void)
} /* cache_image_api_error_check_3() */
-
+
/*-------------------------------------------------------------------------
* Function: cache_image_api_error_check_4()
*
* Purpose: This test is one of a sequence of tests intended
- * to verify correct management of API errors.
+ * to verify correct management of API errors.
+ *
+ * The object of this test is to verify that a request for
+ * a cache image when a version 2 superblock is not available/
+ * not requested is handled correctly.
+ * (the cache image request should be ignored silently).
*
- * The object of this test is to verify that a request for
- * a cache image when a version 2 superblock is not available/
- * not requested is handled correctly.
- * (the cache image request should be ignored silently).
+ * The test is set up as follows:
*
- * The test is set up as follows:
+ * 1) Create a FAPL requesting a cache image, but WITHOUT
+ * specifying the latest file format.
*
- * 1) Create a FAPL requesting a cache image, but WITHOUT
- * specifying the latest file format.
+ * 2) Create a HDF5 file using the above FAPL.
*
- * 2) Create a HDF5 file using the above FAPL.
+ * 3) Create some datasets in the file.
*
- * 3) Create some datasets in the file.
+ * 4) Close the file.
*
- * 4) Close the file.
+ * 5) Open the file read only. Verify that the file doesn't
+ * contain a cache image.
*
- * 5) Open the file read only. Verify that the file doesn't
- * contain a cache image.
+ * 6) Verify that the datasets exist and contain the
+ * expected data
*
- * 6) Verify that the datasets exist and contain the
- * expected data
+ * Verify that the cache image was not loaded.
*
- * Verify that the cache image was not loaded.
+ * 7) Close the file.
*
- * 7) Close the file.
+ * 8) Open the file R/W using the FAPL defined in 1) above.
+ * Verify that the file does not contain a cache image.
*
- * 8) Open the file R/W using the FAPL defined in 1) above.
- * Verify that the file does not contain a cache image.
+ * 9) Close the file.
*
- * 9) Close the file.
+ * 10) Open the file R/W using the FAPL defined in 1) above.
+ * Verify that the file does not contain a cache image.
*
- * 10) Open the file R/W using the FAPL defined in 1) above.
- * Verify that the file does not contain a cache image.
+ * 11) Verify that the data sets contain the expected data
*
- * 11) Verify that the data sets contain the expected data
+ * Verify that a cache image was not loaded.
*
- * Verify that a cache image was not loaded.
+ * 12) Create several more data sets.
*
- * 12) Create several more data sets.
+ * 13) Close the file.
*
- * 13) Close the file.
+ * 14) Open the file read write.
*
- * 14) Open the file read write.
- *
- * Verify that the file does not contain a cache image.
+ * Verify that the file does not contain a cache image.
*
- * 15) Verify the data sets exist and contain the expected
- * data.
+ * 15) Verify the data sets exist and contain the expected
+ * data.
*
- * Verify that a cache image was not loaded.
+ * Verify that a cache image was not loaded.
*
- * 16) Close the file.
+ * 16) Close the file.
*
- * 17) Delete the file.
+ * 17) Delete the file.
*
* Return: void
*
@@ -6665,7 +6664,7 @@ cache_image_api_error_check_4(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6680,11 +6679,11 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 1) Create a FAPL requesting a cache image, but WITHOUT
- * specifying the latest file format.
+ /* 1) Create a FAPL requesting a cache image, but WITHOUT
+ * specifying the latest file format.
*/
if ( pass ) {
@@ -6697,7 +6696,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -6715,7 +6714,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6743,7 +6742,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* get a pointer to the files internal data structure and then
@@ -6762,10 +6761,10 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 3) Create some datasets in the file. */
if ( pass ) {
@@ -6786,10 +6785,10 @@ cache_image_api_error_check_4(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 4) Close the file. */
if ( pass ) {
@@ -6802,20 +6801,20 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 5) Open the file read only. */
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ TRUE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -6823,11 +6822,11 @@ cache_image_api_error_check_4(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 6) Verify that the datasets exist and contain the
+
+
+ /* 6) Verify that the datasets exist and contain the
* expected data
*/
@@ -6847,9 +6846,9 @@ cache_image_api_error_check_4(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 7) Close the file. */
@@ -6862,11 +6861,11 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
- /* 8) Open the file R/W using the FAPL defined in 1) above.
+
+
+ /* 8) Open the file R/W using the FAPL defined in 1) above.
*
* Verify that the file does not contain a cache image.
*/
@@ -6893,7 +6892,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* get a pointer to the files internal data structure and then
@@ -6912,7 +6911,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -6925,7 +6924,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6940,9 +6939,9 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 10) Open the file R/W using the FAPL defined in 1) above.
@@ -6971,7 +6970,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* get a pointer to the files internal data structure and then
@@ -6990,7 +6989,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -7003,7 +7002,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7028,7 +7027,7 @@ cache_image_api_error_check_4(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7039,7 +7038,7 @@ cache_image_api_error_check_4(void)
create_datasets(file_id, 6, 10);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7054,23 +7053,23 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 14) Open the file read write.
- *
+ *
* Verify that the file does not contain a cache image.
*/
if ( pass ) {
open_hdf5_file(/* create_file */ FALSE,
- /* mdci_sbem_expected */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -7078,10 +7077,10 @@ cache_image_api_error_check_4(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 15) Verify the data sets exist and contain the expected data.
*
* Verify that a cache image was not loaded.
@@ -7103,7 +7102,7 @@ cache_image_api_error_check_4(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7118,9 +7117,9 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 17) Delete the file */
@@ -7133,7 +7132,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7152,36 +7151,36 @@ cache_image_api_error_check_4(void)
} /* cache_image_api_error_check_4() */
-
+
/*-------------------------------------------------------------------------
* Function: get_free_sections_test()
*
* Purpose: It is possible that H5Fget_free_sections() to be
- * called before any activity on the metadata cache.
- * This is a potential problem, as satisfying the
- * H5Fget_free_sections() call requires access to all
- * free space managers. When persistent free space
+ * called before any activity on the metadata cache.
+ * This is a potential problem, as satisfying the
+ * H5Fget_free_sections() call requires access to all
+ * free space managers. When persistent free space
* managers are enabled, this will require calling
- * H5MF_tidy_self_referential_fsm_hack(). This is a
+ * H5MF_tidy_self_referential_fsm_hack(). This is a
* non issue in the absence of a cache image. However,
- * this is a problem if a cache image exists, as
- * the call to H5MF_tidy_self_referential_fsm_hack()
- * will free the file space allocated to the cache
- * image.
- *
- * The objective of this test is to create a test file
- * with both non-empty self referential presistant
- * free space managers, and a cache image, and then
- * verify that this situation is handled correctly if
+ * this is a problem if a cache image exists, as
+ * the call to H5MF_tidy_self_referential_fsm_hack()
+ * will free the file space allocated to the cache
+ * image.
+ *
+ * The objective of this test is to create a test file
+ * with both non-empty self referential presistant
+ * free space managers, and a cache image, and then
+ * verify that this situation is handled correctly if
* H5Fget_free_sections() is called before the metadata
* cache image is loaded.
*
- * The test is set up as follows:
+ * The test is set up as follows:
*
- * 1) Create a HDF5 file with a cache image requested
- * and persistent free space managers enabled.
+ * 1) Create a HDF5 file with a cache image requested
+ * and persistent free space managers enabled.
*
- * 2) Create some data sets, and then delete some of
+ * 2) Create some data sets, and then delete some of
* of those near the beginning of the file.
*
* 3) Close the file.
@@ -7192,12 +7191,12 @@ cache_image_api_error_check_4(void)
* been loaded.
*
* 6) Verify that one or more self referential FSMs
- * have been stored at the end of the file just
+ * have been stored at the end of the file just
* before the cache image.
*
* 7) Call H5Fget_free_sections().
*
- * 8) Verify that the cache image has been loaded and
+ * 8) Verify that the cache image has been loaded and
* that the self referential FSMs have been floated.
*
* 9) Verify that the remaining data sets contain the
@@ -7211,12 +7210,12 @@ cache_image_api_error_check_4(void)
* been loaded.
*
* 13) Verify that one or more self referential FSMs
- * have been stored at the end of the file just
+ * have been stored at the end of the file just
* before the cache image.
*
* 14) Call H5Fget_free_sections().
*
- * 15) Verify that the cache image has been loaded and
+ * 15) Verify that the cache image has been loaded and
* that the self referential FSMs have been floated.
*
* 16) Verify that the remaining data sets contain the
@@ -7224,7 +7223,7 @@ cache_image_api_error_check_4(void)
*
* 17) Delete the remaining data sets.
*
- * 18) Close the file.
+ * 18) Close the file.
*
* 19) Verify that file space has been reclaimed.
*
@@ -7253,7 +7252,7 @@ get_free_sections_test(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7268,12 +7267,12 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* 1) Create a HDF5 file with a cache image requested
- * and persistent free space managers enabled.
+ * and persistent free space managers enabled.
*/
if ( pass ) {
@@ -7282,8 +7281,8 @@ get_free_sections_test(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ TRUE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ TRUE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -7291,11 +7290,11 @@ get_free_sections_test(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 2) Create some data sets, and then delete some of
+ /* 2) Create some data sets, and then delete some of
* of those near the beginning of the file.
*/
@@ -7304,7 +7303,7 @@ get_free_sections_test(void)
create_datasets(file_id, 1, 10);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -7312,7 +7311,7 @@ get_free_sections_test(void)
verify_datasets(file_id, 1, 10);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -7320,10 +7319,10 @@ get_free_sections_test(void)
delete_datasets(file_id, 1, 5);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 3) Close the file. */
if ( pass ) {
@@ -7336,10 +7335,10 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 4) Open the file read only. */
if ( pass ) {
@@ -7348,8 +7347,8 @@ get_free_sections_test(void)
/* mdci_sbem_expected */ TRUE,
/* read_only */ TRUE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -7357,10 +7356,10 @@ get_free_sections_test(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 5) Verify that a cache image exists, and has not been loaded. */
if ( pass ) {
@@ -7373,18 +7372,18 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Verify that one or more self referential FSMs
- * have been stored at the end of the file just
+ * have been stored at the end of the file just
* before the cache image.
*/
if ( pass ) {
- /* file_ptr->shared->first_alloc_dealloc is set to FALSE if the
+ /* file_ptr->shared->first_alloc_dealloc is set to FALSE if the
* file is opened R/O.
*/
if ( ( file_ptr->shared->first_alloc_dealloc ) ||
@@ -7398,15 +7397,15 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 7) Call H5Fget_free_sections(). */
if ( pass ) {
- if ( H5Fget_free_sections(file_id, H5FD_MEM_DEFAULT, (size_t)0, NULL)
+ if ( H5Fget_free_sections(file_id, H5FD_MEM_DEFAULT, (size_t)0, NULL)
< 0 ){
pass = FALSE;
@@ -7414,11 +7413,11 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
- /* 8) Verify that the cache image has been loaded and
+
+ /* 8) Verify that the cache image has been loaded and
* that the self referential FSMs have been floated.
*/
if ( pass ) {
@@ -7435,7 +7434,7 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7446,10 +7445,10 @@ get_free_sections_test(void)
verify_datasets(file_id, 6, 10);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 10) Close the file. */
if ( pass ) {
@@ -7461,10 +7460,10 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 11) Open the file R/W. */
if ( pass ) {
@@ -7473,8 +7472,8 @@ get_free_sections_test(void)
/* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -7482,10 +7481,10 @@ get_free_sections_test(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 12) Verify that a cache image exists, and has not been loaded. */
if ( pass ) {
@@ -7498,12 +7497,12 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 13) Verify that one or more self referential FSMs
- * have been stored at the end of the file just
+ * have been stored at the end of the file just
* before the cache image.
*/
if ( pass ) {
@@ -7519,15 +7518,15 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 14) Call H5Fget_free_sections(). */
if ( pass ) {
- if ( H5Fget_free_sections(file_id, H5FD_MEM_DEFAULT, (size_t)0, NULL)
+ if ( H5Fget_free_sections(file_id, H5FD_MEM_DEFAULT, (size_t)0, NULL)
< 0 ){
pass = FALSE;
@@ -7535,11 +7534,11 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
- /* 15) Verify that the cache image has been loaded and
+
+ /* 15) Verify that the cache image has been loaded and
* that the self referential FSMs have been floated.
*/
if ( pass ) {
@@ -7556,7 +7555,7 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7567,10 +7566,10 @@ get_free_sections_test(void)
verify_datasets(file_id, 6, 10);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 17) Delete the remaining data sets. */
if ( pass ) {
@@ -7578,10 +7577,10 @@ get_free_sections_test(void)
delete_datasets(file_id, 6, 10);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 18) Close the file. */
if ( pass ) {
@@ -7593,7 +7592,7 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7613,10 +7612,10 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 20) Discard the file. */
if ( pass ) {
@@ -7628,7 +7627,7 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) { PASSED(); } else { H5_FAILED(); }
@@ -7641,40 +7640,40 @@ get_free_sections_test(void)
} /* get_free_sections_test() */
-
+
/*-------------------------------------------------------------------------
* Function: evict_on_close_test()
*
- * Purpose: If a file containing a cache image which in turn
- * contains dirty entries is opened R/O, the metadata
- * cache must refuse to evict the dirty entries, as
+ * Purpose: If a file containing a cache image which in turn
+ * contains dirty entries is opened R/O, the metadata
+ * cache must refuse to evict the dirty entries, as
* it will not be able to reload them from file. This
* is a bit tricky, as the dirty entries must marked as
- * clean in the metadata cache so that the MDC will not
+ * clean in the metadata cache so that the MDC will not
* attempt to flush then on file close.
*
- * The objective of this test is to verify that the
+ * The objective of this test is to verify that the
* metadata will not evict dirty entries in the above
* context when the file is opened with the evict on close
* FAPL entry.
*
- * Do this by creating a HDF5 file with a cache image
- * containing dirty metadata.
+ * Do this by creating a HDF5 file with a cache image
+ * containing dirty metadata.
*
- * Then close the file, re-open it R/O, and scan its
+ * Then close the file, re-open it R/O, and scan its
* contents twice. If evict on close succeeds in evicting
- * the dirty metadata, the second scan will fail, as valid
+ * the dirty metadata, the second scan will fail, as valid
* versions of the dirty metadata will not be available.
*
- * To make the test more useful, enable persistent free
+ * To make the test more useful, enable persistent free
* space managers.
*
- * The test is set up as follows:
+ * The test is set up as follows:
*
- * 1) Create a HDF5 file without a cache image requested
- * and persistent free space managers enabled.
+ * 1) Create a HDF5 file without a cache image requested
+ * and persistent free space managers enabled.
*
- * 2) Create some data sets and verify them.
+ * 2) Create some data sets and verify them.
*
* 3) Close the file.
*
@@ -7733,7 +7732,7 @@ evict_on_close_test(void)
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7748,12 +7747,12 @@ evict_on_close_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* 1) Create a HDF5 file without a cache image requested
- * and persistent free space managers enabled.
+ * and persistent free space managers enabled.
*/
if ( pass ) {
@@ -7761,8 +7760,8 @@ evict_on_close_test(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ TRUE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ TRUE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -7770,7 +7769,7 @@ evict_on_close_test(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7781,7 +7780,7 @@ evict_on_close_test(void)
create_datasets(file_id, 1, 10);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -7789,10 +7788,10 @@ evict_on_close_test(void)
verify_datasets(file_id, 1, 10);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 3) Close the file. */
if ( pass ) {
@@ -7805,10 +7804,10 @@ evict_on_close_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 4) Open the file R/W, and with cache image requested. */
if ( pass ) {
@@ -7817,8 +7816,8 @@ evict_on_close_test(void)
/* mdci_sbem_expected */ FALSE,
/* read_only */ FALSE,
/* set_mdci_fapl */ TRUE,
- /* config_fsm */ FALSE,
- /* set_eoc */ FALSE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ FALSE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -7826,7 +7825,7 @@ evict_on_close_test(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7840,10 +7839,10 @@ evict_on_close_test(void)
verify_datasets(file_id, 1, 10);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Create some more datasets and verify them */
if ( pass ) {
@@ -7851,7 +7850,7 @@ evict_on_close_test(void)
create_datasets(file_id, 11, 20);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -7864,15 +7863,15 @@ evict_on_close_test(void)
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
- HDfprintf(stdout, "index size / index dirty size = %lld / %lld\n",
+ HDfprintf(stdout, "index size / index dirty size = %lld / %lld\n",
(long long)(cache_ptr->index_size),
(long long)(cache_ptr->dirty_index_size));
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 7) Close the file. */
if ( pass ) {
@@ -7884,10 +7883,10 @@ evict_on_close_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 8) Open the file R/O and with evict on close enabled. */
if ( pass ) {
@@ -7896,8 +7895,8 @@ evict_on_close_test(void)
/* mdci_sbem_expected */ TRUE,
/* read_only */ TRUE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ TRUE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ TRUE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -7905,7 +7904,7 @@ evict_on_close_test(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s*: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7916,7 +7915,7 @@ evict_on_close_test(void)
verify_datasets(file_id, 1, 20);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -7924,7 +7923,7 @@ evict_on_close_test(void)
verify_datasets(file_id, 1, 20);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7939,10 +7938,10 @@ evict_on_close_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 11) Open the file R/w and with evict on close enabled. */
if ( pass ) {
@@ -7951,8 +7950,8 @@ evict_on_close_test(void)
/* mdci_sbem_expected */ TRUE,
/* read_only */ FALSE,
/* set_mdci_fapl */ FALSE,
- /* config_fsm */ FALSE,
- /* set_eoc */ TRUE,
+ /* config_fsm */ FALSE,
+ /* set_eoc */ TRUE,
/* hdf_file_name */ filename,
/* cache_image_flags */ H5C_CI__ALL_FLAGS,
/* file_id_ptr */ &file_id,
@@ -7960,7 +7959,7 @@ evict_on_close_test(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s*: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7971,7 +7970,7 @@ evict_on_close_test(void)
verify_datasets(file_id, 1, 20);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -7979,7 +7978,7 @@ evict_on_close_test(void)
verify_datasets(file_id, 1, 20);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7994,7 +7993,7 @@ evict_on_close_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -8009,7 +8008,7 @@ evict_on_close_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) { PASSED(); } else { H5_FAILED(); }
@@ -8023,7 +8022,7 @@ evict_on_close_test(void)
} /* evict_on_close_test() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -8048,10 +8047,10 @@ main(void)
express_test = GetTestExpress();
- printf("=========================================\n");
- printf("Cache image tests\n");
- printf(" express_test = %d\n", express_test);
- printf("=========================================\n");
+ HDprintf("=========================================\n");
+ HDprintf("Cache image tests\n");
+ HDprintf(" express_test = %d\n", express_test);
+ HDprintf("=========================================\n");
nerrs += check_cache_image_ctl_flow_1();
nerrs += check_cache_image_ctl_flow_2();
diff --git a/test/cache_logging.c b/test/cache_logging.c
index 1eb9d41..c43609b 100644
--- a/test/cache_logging.c
+++ b/test/cache_logging.c
@@ -40,10 +40,10 @@ test_logging_api(void)
char *location = NULL;
size_t size;
- hid_t fid;
- hid_t gid;
+ hid_t fid = -1;
+ hid_t gid = -1;
hbool_t is_currently_logging;
- char group_name[8];
+ char group_name[12];
char filename[1024];
int i;
@@ -111,8 +111,8 @@ test_logging_api(void)
/* Perform some manipulations */
for(i = 0; i < N_GROUPS; i++) {
- HDmemset(group_name, 0, 8);
- HDsnprintf(group_name, 8, "%d", i);
+ HDmemset(group_name, 0, sizeof(group_name));
+ HDsnprintf(group_name, sizeof(group_name), "%d", i);
if((gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if(H5Gclose(gid) < 0)
@@ -166,10 +166,11 @@ main(void)
if(nerrors) {
HDprintf("***** %d Metadata cache logging TEST%s FAILED! *****\n",
nerrors, nerrors > 1 ? "S" : "");
- return 1;
+ HDexit(EXIT_FAILURE);
}
HDprintf("All Metadata Cache Logging tests passed.\n");
- return 0;
+
+ HDexit(EXIT_SUCCESS);
}
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index 119ba62..77554fd 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -15,7 +15,7 @@
*
* This file contains tests for metadata tagging.
*/
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_TESTING
#include "H5Fpkg.h"
@@ -29,16 +29,16 @@
/* Test Defines */
/* ============ */
-#define FILENAME "tagging_test.h5"
-#define FILENAME2 "tagging_ext_test.h5"
-#define GROUPNAME "Group"
+#define FILENAME "tagging_test.h5"
+#define FILENAME2 "tagging_ext_test.h5"
+#define GROUPNAME "Group"
#define GROUPNAMEPATH "/Group"
#define GROUPNAMECOPY "GroupCopy"
-#define ATTRNAME "Attribute 1"
-#define ATTRNAME3 "Attribute 3"
-#define DATASETNAME "Dataset"
-#define DATASETNAME2 "Dataset2"
-#define LINKNAME "Link"
+#define ATTRNAME "Attribute 1"
+#define ATTRNAME3 "Attribute 3"
+#define DATASETNAME "Dataset"
+#define DATASETNAME2 "Dataset2"
+#define LINKNAME "Link"
#define RANK 2
#define DIMS 32
@@ -47,7 +47,7 @@
#define TEST_DEFAULT 0
#define TEST_SHMESG 1
#define NUM_TEST_TYPES 2
-
+
/* ===================== */
/* Function Declarations */
/* ===================== */
@@ -98,7 +98,7 @@ static unsigned check_invalid_tag_application(void);
#ifndef NDEBUG
-
+
/*-------------------------------------------------------------------------
* Function: dump_cache()
*
@@ -127,19 +127,19 @@ static int dump_cache(hid_t fid)
TEST_ERROR;
return 0;
-
+
error:
return -1;
} /* dump_cache */
#endif /* NDEBUG */ /* end debugging functions */
-
+
/*-------------------------------------------------------------------------
* Function: verify_no_unknown_tags()
*
* Purpose: Verifies that all tags in the provided cache have the
- * 'dirtied' flag set. Other verification functions in this
- * test file set this flag after checking them, so
+ * 'dirtied' flag set. Other verification functions in this
+ * test file set this flag after checking them, so
* this is handy to verify that tests have checked all entries
* in the cache.
*
@@ -181,7 +181,7 @@ error:
return -1;
} /* verify_no_unknown_tags */
-
+
/*-------------------------------------------------------------------------
* Function: mark_all_entries_investigated()
*
@@ -229,7 +229,7 @@ error:
return -1;
} /* mark_all_entries_investigated */
-
+
/*-------------------------------------------------------------------------
* Function: reset_all_entries_investigated()
*
@@ -275,15 +275,15 @@ error:
return -1;
} /* reset_all_entries_investigated */
-
+
/*-------------------------------------------------------------------------
* Function: verify_tag()
*
* Purpose: Asserts that there is an entry in the specified cache with
* the provided entry id and provided tag. The function will
- * fail if this is not the case. If found, this function will
- * set the entry's flush_marker flag, so future verification
- * attempts can skip over this entry, knowing it has already been
+ * fail if this is not the case. If found, this function will
+ * set the entry's flush_marker flag, so future verification
+ * attempts can skip over this entry, knowing it has already been
* checked.
*
* Return: 0 on Success, -1 on Failure
@@ -327,7 +327,7 @@ verify_tag(hid_t fid, int id, haddr_t tag)
/* Didn't find the tagged entry, throw an error */
TEST_ERROR;
-
+
done:
return 0;
@@ -358,7 +358,7 @@ error:
return -1;
} /* evict entries */
-
+
/*-------------------------------------------------------------------------
* Function: get_object_header_tag()
*
@@ -389,12 +389,12 @@ error:
return -1;
} /* get_object_header_tag */
-
+
/*-------------------------------------------------------------------------
* Function: get_sbe_tag()
*
* Purpose: This function retrieves the tag associated with the superblock
- * extension (the object header address stored in the superblock)
+ * extension (the object header address stored in the superblock)
*
* Return: 0 on Success; 1 on Failure
*
@@ -420,7 +420,7 @@ error:
/* Test Functions */
/* ============== */
-
+
/*-------------------------------------------------------------------------
* Function: check_file_creation_tags
*
@@ -434,7 +434,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_file_creation_tags(hid_t fcpl_id, int type)
{
/* Variable Declarations */
@@ -501,7 +501,7 @@ error:
return 1;
} /* check_file_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_file_open_tags
*
@@ -515,7 +515,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_file_open_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -539,12 +539,12 @@ check_file_open_tags(hid_t fcpl, int type)
/* Retrieve various tags */
if ( type == TEST_SHMESG ) {
-
+
/* determine tag value of superblock extension object header */
if ( get_sbe_tag(fid, &sbe_tag) < 0 ) TEST_ERROR;
} /* end if */
-
+
/* Close the file */
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
@@ -607,7 +607,7 @@ error:
return 1;
} /* check_file_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_group_creation_tags
*
@@ -621,7 +621,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_group_creation_tags(void)
{
/* Variable Declarations */
@@ -633,7 +633,7 @@ check_group_creation_tags(void)
/* Testing Macro */
TESTING("tag application during group creation");
-
+
/* ===== */
/* Setup */
/* ===== */
@@ -665,7 +665,7 @@ check_group_creation_tags(void)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
-
+
/* Verify root group's tagged metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
if ( verify_tag(fid, H5AC_SNODE_ID, root_tag) < 0 ) TEST_ERROR;
@@ -702,7 +702,7 @@ error:
return 1;
} /* check_group_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_multi_group_creation_tags
*
@@ -716,14 +716,14 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_multi_group_creation_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file outout */
- char gname[10]; /* group name buffer */
+ char gname[16]; /* group name buffer */
int i = 0; /* iterator */
hid_t fapl = -1; /* File access prop list */
haddr_t g_tag = 0; /* Group tag value */
@@ -756,7 +756,7 @@ check_multi_group_creation_tags(void)
for (i = 0; i < MULTIGROUPS; i++) {
- sprintf(gname, "%d", i);
+ HDsprintf(gname, "%d", i);
if ( (gid = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( H5Gclose(gid) < 0 ) TEST_ERROR;
@@ -775,7 +775,7 @@ check_multi_group_creation_tags(void)
for (i = 0; i < MULTIGROUPS; i++) {
/* Re-open the group */
- sprintf(gname, "%d", i);
+ HDsprintf(gname, "%d", i);
if ( (gid = H5Gopen2(fid, gname, H5P_DEFAULT)) < 0 ) TEST_ERROR;
/* Verify object header for root group */
@@ -829,7 +829,7 @@ error:
return 1;
} /* check_multi_group_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_link_iteration_tags
*
@@ -843,7 +843,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_link_iteration_tags(void)
{
/* Variable Declarations */
@@ -874,7 +874,7 @@ check_link_iteration_tags(void)
/* Create many datasets in root group */
for (i=0;i<500;i++) {
- sprintf(dsetname, "Dset %d", i);
+ HDsprintf(dsetname, "Dset %d", i);
if ( (did = H5Dcreate2(fid, dsetname, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( H5Dclose(did) < 0 ) TEST_ERROR;
}
@@ -941,7 +941,7 @@ error:
return 1;
} /* check_link_iteration_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dense_attribute_tags
*
@@ -955,7 +955,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dense_attribute_tags(void)
{
/* Variable Declarations */
@@ -969,7 +969,7 @@ check_dense_attribute_tags(void)
hid_t fapl = -1; /* File access property list */
haddr_t d_tag = 0; /* Dataset tag value */
haddr_t root_tag = 0; /* Root group tag value */
- char attrname[500]; /* Name of attribute */
+ char attrname[500]; /* Name of attribute */
/* Testing Macro */
TESTING("tag application during dense attribute manipulation");
@@ -995,10 +995,10 @@ check_dense_attribute_tags(void)
/* Create dataset */
if ( (did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( H5Pclose(dcpl) < 0 ) TEST_ERROR;
-
+
/* get dataset object header */
if ( get_object_header_tag(did, &d_tag) < 0 ) TEST_ERROR;
-
+
/* Clear Metadata Tags (don't care about them for this test */
mark_all_entries_investigated(fid);
@@ -1008,7 +1008,7 @@ check_dense_attribute_tags(void)
for (i=0;i<50;i++) {
- sprintf(attrname, "attr %d", i);
+ HDsprintf(attrname, "attr %d", i);
if ( (aid = H5Acreate2(did, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0 ) TEST_ERROR;
if ( H5Aclose(aid) < 0 ) TEST_ERROR;
@@ -1124,7 +1124,7 @@ error:
return 1;
} /* check_dense_attribute_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_group_open_tags
*
@@ -1138,7 +1138,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_group_open_tags(void)
{
/* Variable Declarations */
@@ -1150,7 +1150,7 @@ check_group_open_tags(void)
/* Testing Macro */
TESTING("tag application during group open");
-
+
/* ===== */
/* Setup */
/* ===== */
@@ -1225,7 +1225,7 @@ error:
return 1;
} /* check_group_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_creation_tags
*
@@ -1239,7 +1239,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_creation_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -1312,7 +1312,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
/* verify shared message index tagged with sohm */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
-
+
/* verify fractal heap header belonging to group */
if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
@@ -1331,7 +1331,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
/* verify no other entries present */
if ( verify_no_unknown_tags(fid) < 0 ) TEST_ERROR;
-
+
/* Reset the changes we've made to the cache's data structures */
if(reset_all_entries_investigated(fid) < 0) TEST_ERROR;
@@ -1354,7 +1354,7 @@ error:
return 1;
} /* check_attribute_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_open_tags
*
@@ -1368,7 +1368,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_open_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -1439,7 +1439,7 @@ check_attribute_open_tags(hid_t fcpl, int type)
/* verify object header chunk belonging to group */
if ( verify_tag(fid, H5AC_OHDR_CHK_ID, g_tag) < 0 ) TEST_ERROR;
-
+
if ( type == TEST_SHMESG ) {
/* verify (another) object header chunk belonging to group */
@@ -1485,7 +1485,7 @@ error:
return 1;
} /* check_attribute_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_rename_tags
*
@@ -1499,7 +1499,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_rename_tags(hid_t fcpl, int type)
{
/* Variable declarations */
@@ -1547,7 +1547,7 @@ check_attribute_rename_tags(hid_t fcpl, int type)
/* Create attribute */
if ( (aid = H5Acreate2(gid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
-
+
/* fill out data buffer */
for(i = 0; i < DIMS; i++)
for(j = 0; j < DIMS; j++)
@@ -1613,11 +1613,11 @@ check_attribute_rename_tags(hid_t fcpl, int type)
/* verify shared header message stored as a list */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
- /*
- * 3 calls to verify_tag() for verifying free space:
- * one freespace header tag for H5FD_MEM_DRAW manager,
- * one freespace header tag for H5FD_MEM_SUPER manager
- * one freespace section info tag for H5FD_MEM_SUPER manager
+ /*
+ * 3 calls to verify_tag() for verifying free space:
+ * one freespace header tag for H5FD_MEM_DRAW manager,
+ * one freespace header tag for H5FD_MEM_SUPER manager
+ * one freespace section info tag for H5FD_MEM_SUPER manager
*/
if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR;
@@ -1664,7 +1664,7 @@ error:
return 1;
} /* check_attribute_rename_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_delete_tags
*
@@ -1678,7 +1678,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_delete_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -1726,7 +1726,7 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/* Create attribute */
if ( (aid = H5Acreate2(gid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
-
+
/* fill out data buffer */
for(i = 0;i < DIMS; i++)
for(j = 0;j < DIMS; j++)
@@ -1764,30 +1764,30 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/* verify object header belonging to group */
if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR;
-
+
if ( type == TEST_SHMESG ) {
/* verify shared header message master table */
if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
- /*
- * 2 calls to verify_tag() for verifying free space:
+ /*
+ * 2 calls to verify_tag() for verifying free space:
* one freespace header tag for free-space header,
* one freespace header tag for free-space section info
*/
- if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 )
+ if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 )
TEST_ERROR;
- if ( verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0 )
+ if ( verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0 )
TEST_ERROR;
#if 0
- /* If the free space managers are persistent, the
+ /* If the free space managers are persistent, the
* H5MF_tidy_self_referential_fsm_hack() must have been run.
- * Since this function floats all self referential free space
- * managers, the H5FD_MEM_SUPER FSM will not be in the metadata
+ * Since this function floats all self referential free space
+ * managers, the H5FD_MEM_SUPER FSM will not be in the metadata
* cache.
*/
- if ( ( ! persistent_fsms ) &&
+ if ( ( ! persistent_fsms ) &&
( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) )
TEST_ERROR;
#endif
@@ -1822,7 +1822,7 @@ error:
return 1;
} /* check_attribute_delete_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_creation_tags
*
@@ -1836,7 +1836,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_creation_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -1874,10 +1874,10 @@ check_dataset_creation_tags(hid_t fcpl, int type)
/* ============================ */
/* Create Dataset in Root Group */
/* ============================ */
-
+
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -1919,7 +1919,7 @@ check_dataset_creation_tags(hid_t fcpl, int type)
/* Verify dataset's tagged metadata */
if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
-
+
/* Verify shared object header message tags */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
@@ -1949,7 +1949,7 @@ error:
return 1;
} /* check_dataset_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_creation_earlyalloc_tags
*
@@ -1963,7 +1963,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -2046,7 +2046,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
/* Verify dataset's tagged metadata */
if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
-
+
/* Verify shared object header message tags */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
@@ -2080,7 +2080,7 @@ error:
return 1;
} /* check_dataset_creation_earlyalloc_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_open_tags
*
@@ -2094,7 +2094,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_open_tags(void)
{
/* Variable Declarations */
@@ -2125,7 +2125,7 @@ check_dataset_open_tags(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2155,7 +2155,7 @@ check_dataset_open_tags(void)
/* ========================== */
/* Open Dataset in Root Group */
/* ========================== */
-
+
if (( did = H5Dopen2(fid, DATASETNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR;
/* =================================== */
@@ -2200,7 +2200,7 @@ error:
return 1;
} /* check_dataset_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_write_tags
*
@@ -2214,7 +2214,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_write_tags(void)
{
/* Variable Declarations */
@@ -2250,7 +2250,7 @@ check_dataset_write_tags(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2299,7 +2299,7 @@ check_dataset_write_tags(void)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
-
+
/* Verify 10 b-tree nodes belonging to dataset */
for (i=0; i<10; i++)
if ( verify_tag(fid, H5AC_BT_ID, d_tag) < 0 ) TEST_ERROR;
@@ -2335,7 +2335,7 @@ error:
return 1;
} /* check_dataset_write_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_write_tags
*
@@ -2349,7 +2349,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_write_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -2424,7 +2424,7 @@ check_attribute_write_tags(hid_t fcpl, int type)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
-
+
/* Verify object header of group */
if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR;
@@ -2483,7 +2483,7 @@ error:
return 1;
} /* check_attribute_write_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_read_tags
*
@@ -2497,7 +2497,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_read_tags(void)
{
/* Variable Declarations */
@@ -2533,7 +2533,7 @@ check_dataset_read_tags(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2581,7 +2581,7 @@ check_dataset_read_tags(void)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
-
+
/* Verify 19 b-tree nodes belonging to dataset */
for (i=0; i<19; i++)
if ( verify_tag(fid, H5AC_BT_ID, d_tag) < 0 ) TEST_ERROR;
@@ -2614,7 +2614,7 @@ error:
return 1;
} /* check_dataset_read_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_size_retrieval
*
@@ -2628,7 +2628,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_size_retrieval(void)
{
/* Variable Declarations */
@@ -2665,7 +2665,7 @@ check_dataset_size_retrieval(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2746,7 +2746,7 @@ error:
return 1;
} /* check_dataset_size_retrieval */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_extend_tags
*
@@ -2760,7 +2760,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_extend_tags(void)
{
@@ -2798,7 +2798,7 @@ check_dataset_extend_tags(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2879,7 +2879,7 @@ error:
return 1;
} /* check_dataset_extend_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_object_info_tags
*
@@ -2893,7 +2893,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_object_info_tags(void)
{
/* Variable Declarations */
@@ -2902,7 +2902,7 @@ check_object_info_tags(void)
int verbose = FALSE; /* verbose file output */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
- H5O_info_t oinfo; /* Object info struct */
+ H5O_info_t oinfo; /* Object info struct */
/* Testing Macro */
TESTING("tag application during object info retrieval");
@@ -2982,7 +2982,7 @@ error:
return 1;
} /* check_object_info_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_object_copy_tags
*
@@ -2996,7 +2996,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_object_copy_tags(void)
{
/* Variable Declarations */
@@ -3046,7 +3046,7 @@ check_object_copy_tags(void)
if ( (gid = H5Gopen2(fid, GROUPNAMECOPY, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( get_object_header_tag(gid, &copy_tag) < 0 ) TEST_ERROR;
if (H5Gclose(gid) < 0) TEST_ERROR;
-
+
/* =================================== */
/* Verification of Metadata Tag Values */
/* =================================== */
@@ -3095,7 +3095,7 @@ error:
return 1;
} /* check_object_copy_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_link_removal_tags
*
@@ -3109,7 +3109,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_link_removal_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -3156,7 +3156,7 @@ check_link_removal_tags(hid_t fcpl, int type)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -3219,7 +3219,7 @@ check_link_removal_tags(hid_t fcpl, int type)
if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
} /* end if */
-
+
/* verify no other entries present */
if ( verify_no_unknown_tags(fid) < 0 ) TEST_ERROR;
@@ -3247,7 +3247,7 @@ error:
return 1;
} /* check_link_removal_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_link_getname_tags
*
@@ -3261,7 +3261,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_link_getname_tags(void)
{
/* Variable Declarations */
@@ -3309,7 +3309,7 @@ check_link_getname_tags(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -3392,7 +3392,7 @@ error:
return 1;
} /* check_link_getname_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_external_link_creation_tags
*
@@ -3406,7 +3406,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_external_link_creation_tags(void)
{
/* Variable Declarations */
@@ -3449,7 +3449,7 @@ check_external_link_creation_tags(void)
/* ==================== */
/* Create External Link */
/* ==================== */
-
+
if (H5Lcreate_external(FILENAME2, GROUPNAMEPATH, fid, LINKNAME, H5P_DEFAULT, H5P_DEFAULT) < 0 ) TEST_ERROR;
/* =================================== */
@@ -3460,7 +3460,7 @@ check_external_link_creation_tags(void)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
-
+
/* Verify root group metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
if ( verify_tag(fid, H5AC_OHDR_CHK_ID, root_tag) < 0 ) TEST_ERROR;
@@ -3490,7 +3490,7 @@ error:
return 1;
} /* check_external_link_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_external_link_open_tags
*
@@ -3504,7 +3504,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_external_link_open_tags(void)
{
/* Variable Declarations */
@@ -3556,11 +3556,11 @@ check_external_link_open_tags(void)
/* ================== */
/* Open External Link */
/* ================== */
-
+
if ( (xid = H5Gopen2(fid, LINKNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( (fid2 = H5Iget_file_id(xid)) < 0) TEST_ERROR;
if ( get_object_header_tag(xid, &link_tag) < 0 ) TEST_ERROR;
-
+
/* =================================== */
/* Verification of Metadata Tag Values */
/* =================================== */
@@ -3614,12 +3614,12 @@ error:
return 1;
} /* check_external_link_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_invalid_tag_application
*
* Purpose: This function verifies that an error occurs if a tag
- * has not been set up during a protect or set of
+ * has not been set up during a protect or set of
* a new piece of metadata.
*
* Return: 0 on Success, 1 on Failure
@@ -3643,7 +3643,7 @@ check_invalid_tag_application(void)
/* Testing Macro */
TESTING("failure on invalid tag application");
-
+
#if H5C_DO_TAGGING_SANITY_CHECKS
/* Create a test file */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
@@ -3705,23 +3705,21 @@ error:
return 1;
} /* check_invalid_tag_application */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: Run tests on library's ability to tag metadata entries.
*
- * Return: Success:
- *
- * Failure:
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Mike McGreevy
* January 15, 2009
*
*-------------------------------------------------------------------------
*/
-int
-main(void)
+int
+main(void)
{
/* Variable Declarations */
hid_t fcpl_default = -1; /* file creation prop list */
@@ -3729,13 +3727,13 @@ main(void)
hid_t fcpl = -1; /* file creation prop list */
unsigned nerrs = 0; /* Error Encountered */
int test_type = 0; /* test type iterator */
-
+
/* Open the HDF5 Library */
H5open();
-
- /* ========== */
+
+ /* ========== */
/* Test Setup */
- /* ========== */
+ /* ========== */
/* Create a standard file creation property list */
fcpl_default = H5Pcreate(H5P_FILE_CREATE);
@@ -3751,16 +3749,16 @@ main(void)
/* ========= */
for (test_type=0; test_type<NUM_TEST_TYPES; test_type++) {
-
+
/* Run tests on each fcpl set up above. */
if (test_type == TEST_DEFAULT) {
- if (!nerrs) printf("Testing standard tag application cases w/ default fcpl:\n");
+ if (!nerrs) HDprintf("Testing standard tag application cases w/ default fcpl:\n");
fcpl = fcpl_default;
-
+
} else if (test_type == TEST_SHMESG) {
- if (!nerrs) printf("Testing standard tag application cases w/ shared messages:\n");
+ if (!nerrs) HDprintf("Testing standard tag application cases w/ shared messages:\n");
fcpl = fcpl_shmesg_all;
} else {
@@ -3780,7 +3778,7 @@ main(void)
if (!nerrs) nerrs += check_link_removal_tags(fcpl, test_type);
} /* end for */
- if (!nerrs) printf("Testing other specific tag application cases:\n");
+ if (!nerrs) HDprintf("Testing other specific tag application cases:\n");
if (!nerrs) nerrs += check_group_creation_tags();
if (!nerrs) nerrs += check_multi_group_creation_tags();
if (!nerrs) nerrs += check_group_open_tags();
@@ -3794,7 +3792,7 @@ main(void)
if (!nerrs) nerrs += check_link_getname_tags();
if (!nerrs) nerrs += check_external_link_creation_tags();
if (!nerrs) nerrs += check_external_link_open_tags();
-
+
if (!nerrs) nerrs += check_dense_attribute_tags();
if (!nerrs) nerrs += check_link_iteration_tags();
if (!nerrs) nerrs += check_invalid_tag_application();
@@ -3804,10 +3802,13 @@ main(void)
HDremove(FILENAME2);
/* Return Errors */
- return nerrs > 0;
+ if (nerrs > 0)
+ return EXIT_FAILURE;
+ else
+ return EXIT_SUCCESS;
error:
/* Return with Error */
- return 1;
+ return EXIT_FAILURE;
} /* main */
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 5d6cfc7..ff3767c 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -19,8 +19,8 @@
/* See H5private.h for how to include headers */
#undef NDEBUG
-#define H5T_FRIEND /*suppress error about including H5Tpkg */
-#include "H5Tpkg.h" /*to turn off hardware conversions*/
+#define H5T_FRIEND /*suppress error about including H5Tpkg */
+#include "H5Tpkg.h" /*to turn off hardware conversions*/
#include "H5Iprivate.h"
#include "h5test.h"
@@ -120,29 +120,29 @@ typedef struct {
long long r, s, t;
} stype4;
-#define NX 100u
-#define NY 2000u
+#define NX 100u
+#define NY 2000u
#define PACK_NMEMBS 100
-
+
/*-------------------------------------------------------------------------
- * Function: test_compound
+ * Function: test_compound
*
- * Purpose: Creates a simple dataset of a compound type and then reads
- * it back. The dataset is read back in various ways to
- * exercise the I/O pipeline and compound type conversion.
+ * Purpose: Creates a simple dataset of a compound type and then reads
+ * it back. The dataset is read back in various ways to
+ * exercise the I/O pipeline and compound type conversion.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, January 23, 1998
*
* Modifications:
- * Robb Matzke, 1999-06-23
- * If the command line switch `--noopt' is present then the fast
- * compound datatype conversion is turned off.
+ * Robb Matzke, 1999-06-23
+ * If the command line switch `--noopt' is present then the fast
+ * compound datatype conversion is turned off.
*
* Raymond Lu, 15 June 2007
* Moved this part of code from MAIN to TEST_COMPOUND function.
@@ -152,53 +152,53 @@ static unsigned
test_compound (char *filename, hid_t fapl)
{
/* First dataset */
- s1_t *s1 = NULL;
- hid_t s1_tid;
+ s1_t *s1 = NULL;
+ hid_t s1_tid;
/* Second dataset */
- s2_t *s2 = NULL;
- hid_t s2_tid;
+ s2_t *s2 = NULL;
+ hid_t s2_tid;
/* Third dataset */
- s3_t *s3 = NULL;
- hid_t s3_tid;
+ s3_t *s3 = NULL;
+ hid_t s3_tid;
/* Fourth dataset */
- s4_t *s4 = NULL;
- hid_t s4_tid;
+ s4_t *s4 = NULL;
+ hid_t s4_tid;
/* Fifth dataset */
- s5_t *s5 = NULL;
- hid_t s5_tid;
+ s5_t *s5 = NULL;
+ hid_t s5_tid;
/* Sixth dataset */
- s6_t *s6 = NULL;
- hid_t s6_tid;
+ s6_t *s6 = NULL;
+ hid_t s6_tid;
/* Seventh dataset */
- hid_t s7_sid;
+ hid_t s7_sid;
/* Eighth dataset */
- s1_t *s8 = NULL;
- hid_t s8_f_sid; /*file data space */
- hid_t s8_m_sid; /*memory data space */
+ s1_t *s8 = NULL;
+ hid_t s8_f_sid; /*file data space */
+ hid_t s8_m_sid; /*memory data space */
/* Ninth dataset */
/* Tenth dataset */
/* Eleventh dataset */
- s4_t *s11 = NULL;
+ s4_t *s11 = NULL;
/* Other variables */
- unsigned int i, j;
- hid_t file, dataset, space, PRESERVE;
+ unsigned int i, j;
+ hid_t file, dataset, space, PRESERVE;
hid_t array_dt;
- static hsize_t dim[] = {NX, NY};
- hsize_t f_offset[2]; /*offset of hyperslab in file */
- hsize_t h_size[2]; /*size of hyperslab */
- hsize_t memb_size[1] = {4};
- int ret_code;
+ static hsize_t dim[] = {NX, NY};
+ hsize_t f_offset[2]; /*offset of hyperslab in file */
+ hsize_t h_size[2]; /*size of hyperslab */
+ hsize_t memb_size[1] = {4};
+ int ret_code;
/* Allocate buffers for datasets */
if(NULL == (s1 = (s1_t *)HDmalloc(sizeof(s1_t) * NX * NY)))
@@ -216,7 +216,7 @@ test_compound (char *filename, hid_t fapl)
/* Create the file */
if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
- goto error;
+ goto error;
}
/* Create the data space */
@@ -226,15 +226,15 @@ test_compound (char *filename, hid_t fapl)
/* Also verify H5Pset_preserve is initially 0 and then is set to 1. */
if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) goto error;
if ((ret_code=H5Pget_preserve (PRESERVE)) != 0){
- printf("Preserve status of dataset transfer property list should be"
- " 0 (FALSE), got %d\n", ret_code);
- goto error;
+ HDprintf("Preserve status of dataset transfer property list should be"
+ " 0 (FALSE), got %d\n", ret_code);
+ goto error;
}
if (H5Pset_preserve (PRESERVE, 1)<0) goto error;
if ((ret_code=H5Pget_preserve (PRESERVE)) != 1){
- printf("Preserve status of dataset transfer property list should be"
- " 1 (TRUE), got %d\n", ret_code);
- goto error;
+ HDprintf("Preserve status of dataset transfer property list should be"
+ " 1 (TRUE), got %d\n", ret_code);
+ goto error;
}
/*
@@ -245,14 +245,14 @@ test_compound (char *filename, hid_t fapl)
/* Initialize the dataset */
for (i=0; i<NX*NY; i++) {
- s1[i].a = 8*i+0;
- s1[i].b = 2000+2*i;
- s1[i].c[0] = 8*i+2;
- s1[i].c[1] = 8*i+3;
- s1[i].c[2] = 8*i+4;
- s1[i].c[3] = 8*i+5;
- s1[i].d = 2001+2*i;
- s1[i].e = 8*i+7;
+ s1[i].a = 8*i+0;
+ s1[i].b = 2000+2*i;
+ s1[i].c[0] = 8*i+2;
+ s1[i].c[1] = 8*i+3;
+ s1[i].c[2] = 8*i+4;
+ s1[i].c[3] = 8*i+5;
+ s1[i].d = 2001+2*i;
+ s1[i].e = 8*i+7;
}
/* Create the memory data type */
@@ -269,19 +269,19 @@ test_compound (char *filename, hid_t fapl)
/* Create the dataset */
if((dataset = H5Dcreate2(file, "s1", s1_tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
/* Write the data */
if(H5Dwrite(dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1) < 0)
- goto error;
+ goto error;
PASSED();
/*
*######################################################################
* STEP 2: We create a new type ID for the second dataset even though
- * it's the same as the first just to test things better, but
- * in fact, we could have used s1_tid.
+ * it's the same as the first just to test things better, but
+ * in fact, we could have used s1_tid.
*/
TESTING("basic compound read");
@@ -299,31 +299,31 @@ test_compound (char *filename, hid_t fapl)
/* Read the data */
if (H5Dread (dataset, s2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s2) < 0) {
- goto error;
+ goto error;
}
/* Compare s2 with s1. They should be the same */
for (i=0; i<NX*NY; i++) {
- if (s1[i].a!=s2[i].a ||
- s1[i].b!=s2[i].b ||
- s1[i].c[0]!=s2[i].c[0] ||
- s1[i].c[1]!=s2[i].c[1] ||
- s1[i].c[2]!=s2[i].c[2] ||
- s1[i].c[3]!=s2[i].c[3] ||
- s1[i].d!=s2[i].d ||
- s1[i].e!=s2[i].e) {
- H5_FAILED();
- puts(" Incorrect values read from the file");
- goto error;
- }
+ if (s1[i].a!=s2[i].a ||
+ s1[i].b!=s2[i].b ||
+ s1[i].c[0]!=s2[i].c[0] ||
+ s1[i].c[1]!=s2[i].c[1] ||
+ s1[i].c[2]!=s2[i].c[2] ||
+ s1[i].c[3]!=s2[i].c[3] ||
+ s1[i].d!=s2[i].d ||
+ s1[i].e!=s2[i].e) {
+ H5_FAILED();
+ puts(" Incorrect values read from the file");
+ goto error;
+ }
}
PASSED();
/*
*######################################################################
* STEP 3: Read the dataset back into a third memory buffer. This buffer
- * has the same data space but the data type is different: the
- * data type is a struct whose members are in the opposite order.
+ * has the same data space but the data type is different: the
+ * data type is a struct whose members are in the opposite order.
*/
TESTING("reversal of struct members");
@@ -341,23 +341,23 @@ test_compound (char *filename, hid_t fapl)
/* Read the data */
if (H5Dread (dataset, s3_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s3) < 0) {
- goto error;
+ goto error;
}
/* Compare s3 with s1. They should be the same */
for (i=0; i<NX*NY; i++) {
- if (s1[i].a!=s3[i].a ||
- s1[i].b!=s3[i].b ||
- s1[i].c[0]!=s3[i].c[0] ||
- s1[i].c[1]!=s3[i].c[1] ||
- s1[i].c[2]!=s3[i].c[2] ||
- s1[i].c[3]!=s3[i].c[3] ||
- s1[i].d!=s3[i].d ||
- s1[i].e!=s3[i].e) {
- H5_FAILED();
- puts(" Incorrect values read from the file");
- goto error;
- }
+ if (s1[i].a!=s3[i].a ||
+ s1[i].b!=s3[i].b ||
+ s1[i].c[0]!=s3[i].c[0] ||
+ s1[i].c[1]!=s3[i].c[1] ||
+ s1[i].c[2]!=s3[i].c[2] ||
+ s1[i].c[3]!=s3[i].c[3] ||
+ s1[i].d!=s3[i].d ||
+ s1[i].e!=s3[i].e) {
+ H5_FAILED();
+ puts(" Incorrect values read from the file");
+ goto error;
+ }
}
PASSED();
@@ -375,33 +375,33 @@ test_compound (char *filename, hid_t fapl)
/* Read the data */
if (H5Dread (dataset, s4_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s4) < 0) {
- goto error;
+ goto error;
}
/* Compare s4 with s1 */
for (i=0; i<NX*NY; i++) {
- if (s1[i].b!=s4[i].b ||
- s1[i].d!=s4[i].d) {
- H5_FAILED();
- puts(" Incorrect values read from the file");
- goto error;
- }
+ if (s1[i].b!=s4[i].b ||
+ s1[i].d!=s4[i].d) {
+ H5_FAILED();
+ puts(" Incorrect values read from the file");
+ goto error;
+ }
}
PASSED();
/*
*######################################################################
* STEP 5: Read all the members into a struct which has other members
- * which have already been initialized.
+ * which have already been initialized.
*/
TESTING("partially initialized superset read");
/* Initialize some members */
for (i=0; i<NX*NY; i++) {
- s5[i].pre = 1000+4*i;
- s5[i].mid1 = 1001+4*i;
- s5[i].mid2 = 1002+4*i;
- s5[i].post = 1003+4*i;
+ s5[i].pre = 1000+4*i;
+ s5[i].mid1 = 1001+4*i;
+ s5[i].mid2 = 1002+4*i;
+ s5[i].post = 1003+4*i;
}
/* Create a data type for s5 */
@@ -418,42 +418,42 @@ test_compound (char *filename, hid_t fapl)
/* Read the data */
if (H5Dread (dataset, s5_tid, H5S_ALL, H5S_ALL, PRESERVE, s5) < 0) {
- goto error;
+ goto error;
}
/* Check that the data was read properly */
for (i=0; i<NX*NY; i++) {
- if (s1[i].a!=s5[i].a ||
- s1[i].b!=s5[i].b ||
- s1[i].c[0]!=s5[i].c[0] ||
- s1[i].c[1]!=s5[i].c[1] ||
- s1[i].c[2]!=s5[i].c[2] ||
- s1[i].c[3]!=s5[i].c[3] ||
- s1[i].d!=s5[i].d ||
- s1[i].e!=s5[i].e) {
- H5_FAILED();
- puts(" Incorrect values read from the file");
- goto error;
- }
+ if (s1[i].a!=s5[i].a ||
+ s1[i].b!=s5[i].b ||
+ s1[i].c[0]!=s5[i].c[0] ||
+ s1[i].c[1]!=s5[i].c[1] ||
+ s1[i].c[2]!=s5[i].c[2] ||
+ s1[i].c[3]!=s5[i].c[3] ||
+ s1[i].d!=s5[i].d ||
+ s1[i].e!=s5[i].e) {
+ H5_FAILED();
+ puts(" Incorrect values read from the file");
+ goto error;
+ }
}
/* Check that no previous values were clobbered */
for (i=0; i<NX*NY; i++) {
- if (s5[i].pre != 1000+4*i ||
- s5[i].mid1 != 1001+4*i ||
- s5[i].mid2 != 1002+4*i ||
- s5[i].post != 1003+4*i) {
- H5_FAILED();
- puts(" Memory values were clobbered");
- goto error;
- }
+ if (s5[i].pre != 1000+4*i ||
+ s5[i].mid1 != 1001+4*i ||
+ s5[i].mid2 != 1002+4*i ||
+ s5[i].post != 1003+4*i) {
+ H5_FAILED();
+ puts(" Memory values were clobbered");
+ goto error;
+ }
}
PASSED();
/*
*######################################################################
* STEP 6: Read all the members into a struct which has other members
- * which have already been initialized. This is to test the
+ * which have already been initialized. This is to test the
* optimization for the Chicago company. The optimization is
* for the special case when the source members are a subset of
* destination, and the order is the same, and no conversion
@@ -470,10 +470,10 @@ test_compound (char *filename, hid_t fapl)
/* Initialize some members */
for (i=0; i<NX*NY; i++) {
- s6[i].pre = 1000+4*i;
- s6[i].mid1 = 1001+4*i;
- s6[i].mid2 = 1002+4*i;
- s6[i].post = 1003+4*i;
+ s6[i].pre = 1000+4*i;
+ s6[i].mid1 = 1001+4*i;
+ s6[i].mid2 = 1002+4*i;
+ s6[i].post = 1003+4*i;
}
/* Create a data type for s6 */
@@ -494,35 +494,35 @@ test_compound (char *filename, hid_t fapl)
/* Read the data */
if (H5Dread (dataset, s6_tid, H5S_ALL, H5S_ALL, PRESERVE, s6) < 0) {
- goto error;
+ goto error;
}
/* Check that the data was read properly */
for (i=0; i<NX*NY; i++) {
- if (s1[i].a!=s6[i].a ||
- s1[i].b!=s6[i].b ||
- s1[i].c[0]!=s6[i].c[0] ||
- s1[i].c[1]!=s6[i].c[1] ||
- s1[i].c[2]!=s6[i].c[2] ||
- s1[i].c[3]!=s6[i].c[3] ||
- s1[i].d!=s6[i].d ||
- s1[i].e!=s6[i].e) {
- H5_FAILED();
- puts(" Incorrect values read from the file");
- goto error;
- }
+ if (s1[i].a!=s6[i].a ||
+ s1[i].b!=s6[i].b ||
+ s1[i].c[0]!=s6[i].c[0] ||
+ s1[i].c[1]!=s6[i].c[1] ||
+ s1[i].c[2]!=s6[i].c[2] ||
+ s1[i].c[3]!=s6[i].c[3] ||
+ s1[i].d!=s6[i].d ||
+ s1[i].e!=s6[i].e) {
+ H5_FAILED();
+ puts(" Incorrect values read from the file");
+ goto error;
+ }
}
/* Check that no previous values were clobbered */
for (i=0; i<NX*NY; i++) {
- if (s6[i].pre != 1000+4*i ||
- s6[i].mid1 != 1001+4*i ||
- s6[i].mid2 != 1002+4*i ||
- s6[i].post != 1003+4*i) {
- H5_FAILED();
- puts(" Memory values were clobbered");
- goto error;
- }
+ if (s6[i].pre != 1000+4*i ||
+ s6[i].mid1 != 1001+4*i ||
+ s6[i].mid2 != 1002+4*i ||
+ s6[i].post != 1003+4*i) {
+ H5_FAILED();
+ puts(" Memory values were clobbered");
+ goto error;
+ }
}
PASSED();
@@ -531,45 +531,45 @@ test_compound (char *filename, hid_t fapl)
*######################################################################
* STEP 7: Update fields `b' and `d' on the file leaving the other
* fields unchanged. This tests member alignment and background
- * buffers.
+ * buffers.
*/
TESTING("partially initialized superset write");
/* Initialize `s4' with new values */
for (i=0; i<NX*NY; i++) {
- s4[i].b = 8*i+1;
- s4[i].d = 8*i+6;
+ s4[i].b = 8*i+1;
+ s4[i].d = 8*i+6;
}
/* Write the data to file */
if (H5Dwrite (dataset, s4_tid, H5S_ALL, H5S_ALL, PRESERVE, s4) < 0) {
- goto error;
+ goto error;
}
/* Read the data back */
if (H5Dread (dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1) < 0) {
- goto error;
+ goto error;
}
/* Compare */
for (i=0; i<NX*NY; i++) {
- if (s1[i].a != 8*i+0 ||
- s1[i].b != 8*i+1 ||
- s1[i].c[0] != 8*i+2 ||
- s1[i].c[1] != 8*i+3 ||
- s1[i].c[2] != 8*i+4 ||
- s1[i].c[3] != 8*i+5 ||
- s1[i].d != 8*i+6 ||
- s1[i].e != 8*i+7) {
- H5_FAILED();
- printf(" i==%u, row=%u, col=%u\n", i, i/NY, i%NY);
- printf(" got: {%7d,%7d,[%7d,%7d,%7d,%7d],%7d,%7d}\n",
- s1[i].a, s1[i].b, s1[i].c[0], s1[i].c[1], s1[i].c[2],
- s1[i].c[3], s1[i].d, s1[i].e);
- printf(" ans: {%7d,%7d,[%7d,%7d,%7d,%7d],%7d,%7d}\n",
- 8*i+0, 8*i+1, 8*i+2, 8*i+3, 8*i+4, 8*i+5, 8*i+6, 8*i+7);
- goto error;
- }
+ if (s1[i].a != 8*i+0 ||
+ s1[i].b != 8*i+1 ||
+ s1[i].c[0] != 8*i+2 ||
+ s1[i].c[1] != 8*i+3 ||
+ s1[i].c[2] != 8*i+4 ||
+ s1[i].c[3] != 8*i+5 ||
+ s1[i].d != 8*i+6 ||
+ s1[i].e != 8*i+7) {
+ H5_FAILED();
+ HDprintf(" i==%u, row=%u, col=%u\n", i, i/NY, i%NY);
+ HDprintf(" got: {%7d,%7d,[%7d,%7d,%7d,%7d],%7d,%7d}\n",
+ s1[i].a, s1[i].b, s1[i].c[0], s1[i].c[1], s1[i].c[2],
+ s1[i].c[3], s1[i].d, s1[i].e);
+ HDprintf(" ans: {%7d,%7d,[%7d,%7d,%7d,%7d],%7d,%7d}\n",
+ 8*i+0, 8*i+1, 8*i+2, 8*i+3, 8*i+4, 8*i+5, 8*i+6, 8*i+7);
+ goto error;
+ }
}
PASSED();
@@ -586,23 +586,23 @@ test_compound (char *filename, hid_t fapl)
/* Read the dataset */
if (H5Dread (dataset, s2_tid, s7_sid, H5S_ALL, H5P_DEFAULT, s2) < 0) {
- goto error;
+ goto error;
}
/* Compare */
for (i=0; i<NX*NY; i++) {
- if (s2[i].a != s1[i].a ||
- s2[i].b != s1[i].b ||
- s2[i].c[0] != s1[i].c[0] ||
- s2[i].c[1] != s1[i].c[1] ||
- s2[i].c[2] != s1[i].c[2] ||
- s2[i].c[3] != s1[i].c[3] ||
- s2[i].d != s1[i].d ||
- s2[i].e != s1[i].e) {
- H5_FAILED();
- puts(" Incorrect values read from file");
- goto error;
- }
+ if (s2[i].a != s1[i].a ||
+ s2[i].b != s1[i].b ||
+ s2[i].c[0] != s1[i].c[0] ||
+ s2[i].c[1] != s1[i].c[1] ||
+ s2[i].c[2] != s1[i].c[2] ||
+ s2[i].c[3] != s1[i].c[3] ||
+ s2[i].d != s1[i].d ||
+ s2[i].e != s1[i].e) {
+ H5_FAILED();
+ puts(" Incorrect values read from file");
+ goto error;
+ }
}
PASSED();
@@ -621,7 +621,7 @@ test_compound (char *filename, hid_t fapl)
h_size[0] = 2*NX/3 - f_offset[0];
h_size[1] = 2*NY/3 - f_offset[1];
if (H5Sselect_hyperslab (s8_f_sid, H5S_SELECT_SET, f_offset, NULL,
- h_size, NULL) < 0) goto error;
+ h_size, NULL) < 0) goto error;
/* Create memory data space */
if ((s8_m_sid = H5Screate_simple (2, h_size, NULL)) < 0) goto error;
@@ -630,28 +630,28 @@ test_compound (char *filename, hid_t fapl)
s8 = (s1_t *) HDcalloc ((size_t)(h_size[0]*h_size[1]), sizeof(s1_t));
assert (s8);
if (H5Dread (dataset, s1_tid, s8_m_sid, s8_f_sid, H5P_DEFAULT, s8) < 0) {
- goto error;
+ goto error;
}
/* Compare */
for (i=0; i<h_size[0]; i++) {
- for (j=0; j<h_size[1]; j++) {
- s1_t *ps1 = s1 + (f_offset[0]+i)*NY + f_offset[1] + j;
- s1_t *ps8 = s8 + i*h_size[1] + j;
-
- if (ps8->a != ps1->a ||
- ps8->b != ps1->b ||
- ps8->c[0] != ps1->c[0] ||
- ps8->c[1] != ps1->c[1] ||
- ps8->c[2] != ps1->c[2] ||
- ps8->c[3] != ps1->c[3] ||
- ps8->d != ps1->d ||
- ps8->e != ps1->e) {
- H5_FAILED();
- puts(" Incorrect values read from file");
- goto error;
- }
- }
+ for (j=0; j<h_size[1]; j++) {
+ s1_t *ps1 = s1 + (f_offset[0]+i)*NY + f_offset[1] + j;
+ s1_t *ps8 = s8 + i*h_size[1] + j;
+
+ if (ps8->a != ps1->a ||
+ ps8->b != ps1->b ||
+ ps8->c[0] != ps1->c[0] ||
+ ps8->c[1] != ps1->c[1] ||
+ ps8->c[2] != ps1->c[2] ||
+ ps8->c[3] != ps1->c[3] ||
+ ps8->d != ps1->d ||
+ ps8->e != ps1->e) {
+ H5_FAILED();
+ puts(" Incorrect values read from file");
+ goto error;
+ }
+ }
}
HDfree (s8);
@@ -668,51 +668,51 @@ test_compound (char *filename, hid_t fapl)
/* Initialize */
for (i=0; i<NX*NY; i++) {
- s2[i].a = s2[i].b = s2[i].d = s2[i].e = (unsigned)(-1);
- s2[i].c[0] = s2[i].c[1] = s2[i].c[2] = s2[i].c[3] = (unsigned)(-1);
+ s2[i].a = s2[i].b = s2[i].d = s2[i].e = (unsigned)(-1);
+ s2[i].c[0] = s2[i].c[1] = s2[i].c[2] = s2[i].c[3] = (unsigned)(-1);
}
/* Read the hyperslab */
if (H5Dread (dataset, s2_tid, s8_f_sid, s8_f_sid, H5P_DEFAULT, s2) < 0) {
- goto error;
+ goto error;
}
/* Compare */
for (i=0; i<NX; i++) {
- for (j=0; j<NY; j++) {
- s1_t *ps1 = s1 + i*NY + j;
- s2_t *ps2 = s2 + i*NY + j;
- if (i>=f_offset[0] &&
- i<f_offset[0]+h_size[0] &&
- j>=f_offset[1] &&
- j<f_offset[1]+h_size[1]) {
- if (ps2->a != ps1->a ||
- ps2->b != ps1->b ||
- ps2->c[0] != ps1->c[0] ||
- ps2->c[1] != ps1->c[1] ||
- ps2->c[2] != ps1->c[2] ||
- ps2->c[3] != ps1->c[3] ||
- ps2->d != ps1->d ||
- ps2->e != ps1->e) {
- H5_FAILED();
- puts(" Memory values clobbered");
- goto error;
- }
- } else {
- if (ps2->a != (unsigned)(-1) ||
- ps2->b != (unsigned)(-1) ||
- ps2->c[0] != (unsigned)(-1) ||
- ps2->c[1] != (unsigned)(-1) ||
- ps2->c[2] != (unsigned)(-1) ||
- ps2->c[3] != (unsigned)(-1) ||
- ps2->d != (unsigned)(-1) ||
- ps2->e != (unsigned)(-1)) {
- H5_FAILED();
- puts(" Incorrect values read from file");
- goto error;
- }
- }
- }
+ for (j=0; j<NY; j++) {
+ s1_t *ps1 = s1 + i*NY + j;
+ s2_t *ps2 = s2 + i*NY + j;
+ if (i>=f_offset[0] &&
+ i<f_offset[0]+h_size[0] &&
+ j>=f_offset[1] &&
+ j<f_offset[1]+h_size[1]) {
+ if (ps2->a != ps1->a ||
+ ps2->b != ps1->b ||
+ ps2->c[0] != ps1->c[0] ||
+ ps2->c[1] != ps1->c[1] ||
+ ps2->c[2] != ps1->c[2] ||
+ ps2->c[3] != ps1->c[3] ||
+ ps2->d != ps1->d ||
+ ps2->e != ps1->e) {
+ H5_FAILED();
+ puts(" Memory values clobbered");
+ goto error;
+ }
+ } else {
+ if (ps2->a != (unsigned)(-1) ||
+ ps2->b != (unsigned)(-1) ||
+ ps2->c[0] != (unsigned)(-1) ||
+ ps2->c[1] != (unsigned)(-1) ||
+ ps2->c[2] != (unsigned)(-1) ||
+ ps2->c[3] != (unsigned)(-1) ||
+ ps2->d != (unsigned)(-1) ||
+ ps2->e != (unsigned)(-1)) {
+ H5_FAILED();
+ puts(" Incorrect values read from file");
+ goto error;
+ }
+ }
+ }
}
PASSED();
@@ -725,60 +725,60 @@ test_compound (char *filename, hid_t fapl)
/* Initialize */
for (i=0; i<NX*NY; i++) {
- s5[i].a = s5[i].b = s5[i].d = s5[i].e = (unsigned)(-1);
- s5[i].c[0] = s5[i].c[1] = s5[i].c[2] = s5[i].c[3] = (unsigned)(-1);
- s5[i].pre = s5[i].mid1 = s5[i].mid2 = s5[i].post = (unsigned)(-1);
+ s5[i].a = s5[i].b = s5[i].d = s5[i].e = (unsigned)(-1);
+ s5[i].c[0] = s5[i].c[1] = s5[i].c[2] = s5[i].c[3] = (unsigned)(-1);
+ s5[i].pre = s5[i].mid1 = s5[i].mid2 = s5[i].post = (unsigned)(-1);
}
/* Read the hyperslab */
if (H5Dread (dataset, s5_tid, s8_f_sid, s8_f_sid, PRESERVE, s5) < 0) {
- goto error;
+ goto error;
}
/* Compare */
for (i=0; i<NX; i++) {
- for (j=0; j<NY; j++) {
- s1_t *ps1 = s1 + i*NY + j;
- s5_t *ps5 = s5 + i*NY + j;
- if (i>=f_offset[0] &&
- i<f_offset[0]+h_size[0] &&
- j>=f_offset[1] &&
- j<f_offset[1]+h_size[1]) {
- if (ps5->pre != (unsigned)(-1) ||
- ps5->a != ps1->a ||
- ps5->b != ps1->b ||
- ps5->mid1 != (unsigned)(-1) ||
- ps5->c[0] != ps1->c[0] ||
- ps5->c[1] != ps1->c[1] ||
- ps5->c[2] != ps1->c[2] ||
- ps5->c[3] != ps1->c[3] ||
- ps5->mid2 != (unsigned)(-1) ||
- ps5->d != ps1->d ||
- ps5->e != ps1->e ||
- ps5->post != (unsigned)(-1)) {
- H5_FAILED();
- puts(" Memory values clobbered");
- goto error;
- }
- } else {
- if (ps5->pre != (unsigned)(-1) ||
- ps5->a != (unsigned)(-1) ||
- ps5->b != (unsigned)(-1) ||
- ps5->mid1 != (unsigned)(-1) ||
- ps5->c[0] != (unsigned)(-1) ||
- ps5->c[1] != (unsigned)(-1) ||
- ps5->c[2] != (unsigned)(-1) ||
- ps5->c[3] != (unsigned)(-1) ||
- ps5->mid2 != (unsigned)(-1) ||
- ps5->d != (unsigned)(-1) ||
- ps5->e != (unsigned)(-1) ||
- ps5->post != (unsigned)(-1)) {
- H5_FAILED();
- puts(" Incorrect values read from file");
- goto error;
- }
- }
- }
+ for (j=0; j<NY; j++) {
+ s1_t *ps1 = s1 + i*NY + j;
+ s5_t *ps5 = s5 + i*NY + j;
+ if (i>=f_offset[0] &&
+ i<f_offset[0]+h_size[0] &&
+ j>=f_offset[1] &&
+ j<f_offset[1]+h_size[1]) {
+ if (ps5->pre != (unsigned)(-1) ||
+ ps5->a != ps1->a ||
+ ps5->b != ps1->b ||
+ ps5->mid1 != (unsigned)(-1) ||
+ ps5->c[0] != ps1->c[0] ||
+ ps5->c[1] != ps1->c[1] ||
+ ps5->c[2] != ps1->c[2] ||
+ ps5->c[3] != ps1->c[3] ||
+ ps5->mid2 != (unsigned)(-1) ||
+ ps5->d != ps1->d ||
+ ps5->e != ps1->e ||
+ ps5->post != (unsigned)(-1)) {
+ H5_FAILED();
+ puts(" Memory values clobbered");
+ goto error;
+ }
+ } else {
+ if (ps5->pre != (unsigned)(-1) ||
+ ps5->a != (unsigned)(-1) ||
+ ps5->b != (unsigned)(-1) ||
+ ps5->mid1 != (unsigned)(-1) ||
+ ps5->c[0] != (unsigned)(-1) ||
+ ps5->c[1] != (unsigned)(-1) ||
+ ps5->c[2] != (unsigned)(-1) ||
+ ps5->c[3] != (unsigned)(-1) ||
+ ps5->mid2 != (unsigned)(-1) ||
+ ps5->d != (unsigned)(-1) ||
+ ps5->e != (unsigned)(-1) ||
+ ps5->post != (unsigned)(-1)) {
+ H5_FAILED();
+ puts(" Incorrect values read from file");
+ goto error;
+ }
+ }
+ }
}
PASSED();
@@ -799,56 +799,56 @@ test_compound (char *filename, hid_t fapl)
/* Initialize */
for (i=0; i<h_size[0]*h_size[1]; i++) {
- s11[i].b = s11[i].d = (unsigned)(-1);
+ s11[i].b = s11[i].d = (unsigned)(-1);
}
/* Write to disk */
if (H5Dwrite (dataset, s4_tid, s8_m_sid, s8_f_sid, PRESERVE, s11) < 0) {
- goto error;
+ goto error;
}
HDfree (s11);
s11=NULL;
/* Read the whole thing */
if (H5Dread (dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1) < 0) {
- goto error;
+ goto error;
}
/* Compare */
for (i=0; i<NX; i++) {
- for (j=0; j<NY; j++) {
- s1_t *ps1 = s1 + i*NY + j;
-
- if (ps1->a != 8*(i*NY+j)+0 ||
- ps1->c[0] != 8*(i*NY+j)+2 ||
- ps1->c[1] != 8*(i*NY+j)+3 ||
- ps1->c[2] != 8*(i*NY+j)+4 ||
- ps1->c[3] != 8*(i*NY+j)+5 ||
- ps1->e != 8*(i*NY+j)+7) {
- H5_FAILED();
- puts(" Write clobbered values");
- goto error;
- }
-
- if (i>=f_offset[0] &&
- i<f_offset[0]+h_size[0] &&
- j>=f_offset[1] &&
- j<f_offset[1]+h_size[1]) {
- if (ps1->b != (unsigned)(-1) ||
- ps1->d != (unsigned)(-1)) {
- H5_FAILED();
- puts(" Wrong values written or read");
- goto error;
- }
- } else {
- if (ps1->b != 8*(i*NY+j)+1 ||
- ps1->d != 8*(i*NY+j)+6) {
- H5_FAILED();
- puts(" Write clobbered values");
- goto error;
- }
- }
- }
+ for (j=0; j<NY; j++) {
+ s1_t *ps1 = s1 + i*NY + j;
+
+ if (ps1->a != 8*(i*NY+j)+0 ||
+ ps1->c[0] != 8*(i*NY+j)+2 ||
+ ps1->c[1] != 8*(i*NY+j)+3 ||
+ ps1->c[2] != 8*(i*NY+j)+4 ||
+ ps1->c[3] != 8*(i*NY+j)+5 ||
+ ps1->e != 8*(i*NY+j)+7) {
+ H5_FAILED();
+ puts(" Write clobbered values");
+ goto error;
+ }
+
+ if (i>=f_offset[0] &&
+ i<f_offset[0]+h_size[0] &&
+ j>=f_offset[1] &&
+ j<f_offset[1]+h_size[1]) {
+ if (ps1->b != (unsigned)(-1) ||
+ ps1->d != (unsigned)(-1)) {
+ H5_FAILED();
+ puts(" Wrong values written or read");
+ goto error;
+ }
+ } else {
+ if (ps1->b != 8*(i*NY+j)+1 ||
+ ps1->d != 8*(i*NY+j)+6) {
+ H5_FAILED();
+ puts(" Write clobbered values");
+ goto error;
+ }
+ }
+ }
}
/*
@@ -873,29 +873,29 @@ error:
puts("*** DATASET TESTS FAILED ***");
/* Release resources */
- if(s1)
+ if(s1)
HDfree(s1);
- if(s2)
+ if(s2)
HDfree(s2);
- if(s3)
+ if(s3)
HDfree(s3);
- if(s4)
+ if(s4)
HDfree(s4);
- if(s5)
+ if(s5)
HDfree(s5);
- if(s6)
+ if(s6)
HDfree(s6);
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: initialize_stype1
+ * Function: initialize_stype1
*
- * Purpose: Initialize data buffer.
+ * Purpose: Initialize data buffer.
*
- * Return: void
+ * Return: void
*
* Programmer: Raymond Lu
* Friday, 15 June 2007
@@ -906,22 +906,22 @@ error:
static void
initialize_stype1(unsigned char *buf, size_t num)
{
- int i, j;
+ int i, j;
stype1 *s_ptr;
for(i = 0; i < (int)num; i++) {
- s_ptr = (stype1 *)buf + i;
- s_ptr->a = i * 8 + 0;
- s_ptr->b = i * 8 + 1;
+ s_ptr = (stype1 *)((void *)buf) + i;
+ s_ptr->a = i * 8 + 0;
+ s_ptr->b = i * 8 + 1;
for(j = 0; j < 8; j++)
- s_ptr->c[j] = i * 8 + j;
- s_ptr->d = i * 8 + 6;
- s_ptr->e = i * 8 + 7;
+ s_ptr->c[j] = i * 8 + j;
+ s_ptr->d = i * 8 + 6;
+ s_ptr->e = i * 8 + 7;
s_ptr->f = (float)(i * 2 / 3);
s_ptr->g = (float)(i * 2 / 3 + 1);
for(j = 0; j < 16; j++)
- s_ptr->h[j] = (float)(i * j / 5 + j);
+ s_ptr->h[j] = (float)(i * j / 5 + j);
s_ptr->i = (float)(i * 2 / 3 + 2);
s_ptr->j = (float)(i * 2 / 3 + 3);
@@ -932,13 +932,13 @@ initialize_stype1(unsigned char *buf, size_t num)
}
}
-
+
/*-------------------------------------------------------------------------
- * Function: initialize_stype2
+ * Function: initialize_stype2
*
- * Purpose: Initialize data buffer.
+ * Purpose: Initialize data buffer.
*
- * Return: void
+ * Return: void
*
* Programmer: Raymond Lu
* Friday, 15 June 2007
@@ -953,18 +953,18 @@ initialize_stype2(unsigned char *buf, size_t num)
stype2 *s_ptr;
for(i = 0; i < num; i++) {
- s_ptr = (stype2 *)buf + i;
- s_ptr->a = (int)(i * 8 + 0);
- s_ptr->b = (int)(i * 8 + 1);
+ s_ptr = (stype2 *)((void *)buf) + i;
+ s_ptr->a = (int)(i * 8 + 0);
+ s_ptr->b = (int)(i * 8 + 1);
for(j = 0; j < 8; j++)
- s_ptr->c[j] = (int)(i * 8 + j);
- s_ptr->d = (int)(i * 8 + 6);
- s_ptr->e = (int)(i * 8 + 7);
+ s_ptr->c[j] = (int)(i * 8 + j);
+ s_ptr->d = (int)(i * 8 + 6);
+ s_ptr->e = (int)(i * 8 + 7);
s_ptr->f = (float)(i * 2 / 3);
s_ptr->g = (float)(i * 2 / 3 + 1);
for(j = 0; j < 16; j++)
- s_ptr->h[j] = (float)(i * j / 5 + j);
+ s_ptr->h[j] = (float)(i * j / 5 + j);
s_ptr->i = (float)(i * 2 / 3 + 2);
s_ptr->j = (float)(i * 2 / 3 + 3);
@@ -979,13 +979,13 @@ initialize_stype2(unsigned char *buf, size_t num)
}
}
-
+
/*-------------------------------------------------------------------------
- * Function: initialize_stype3
+ * Function: initialize_stype3
*
- * Purpose: Initialize data buffer.
+ * Purpose: Initialize data buffer.
*
- * Return: Success:
+ * Return: Success:
*
* Programmer: Raymond Lu
* Friday, 15 June 2007
@@ -996,27 +996,27 @@ initialize_stype2(unsigned char *buf, size_t num)
static void
initialize_stype3(unsigned char *buf, size_t num)
{
- int i, j;
+ int i, j;
stype3 *s_ptr;
for(i = 0; i < (int)num; i++) {
- s_ptr = (stype3 *)buf + i;
- s_ptr->a = i * 8 + 0;
- s_ptr->b = i * 8 + 1;
+ s_ptr = (stype3 *)((void *)buf) + i;
+ s_ptr->a = i * 8 + 0;
+ s_ptr->b = i * 8 + 1;
for(j = 0; j < 8; j++)
- s_ptr->c[j] = i * 8 + j;
- s_ptr->d = i * 8 + 6;
- s_ptr->e = i * 8 + 7;
+ s_ptr->c[j] = i * 8 + j;
+ s_ptr->d = i * 8 + 6;
+ s_ptr->e = i * 8 + 7;
}
}
-
+
/*-------------------------------------------------------------------------
- * Function: initialize_stype4
+ * Function: initialize_stype4
*
- * Purpose: Initialize data buffer.
+ * Purpose: Initialize data buffer.
*
- * Return: void
+ * Return: void
*
* Programmer: Raymond Lu
* Friday, 15 June 2007
@@ -1031,18 +1031,18 @@ initialize_stype4(unsigned char *buf, size_t num)
stype4 *s_ptr;
for(i = 0; i < num; i++) {
- s_ptr = (stype4 *)buf + i;
- s_ptr->a = (int)(i * 8 + 0);
- s_ptr->b = (int)(i * 8 + 1);
+ s_ptr = (stype4 *)((void *)buf) + i;
+ s_ptr->a = (int)(i * 8 + 0);
+ s_ptr->b = (int)(i * 8 + 1);
for(j = 0; j < 8; j++)
- s_ptr->c[j] = (int)(i * 8 + j);
- s_ptr->d = (int)(i * 8 + 6);
- s_ptr->e = (int)(i * 8 + 7);
+ s_ptr->c[j] = (int)(i * 8 + j);
+ s_ptr->d = (int)(i * 8 + 6);
+ s_ptr->e = (int)(i * 8 + 7);
s_ptr->f = (float)(i * 2 / 3);
s_ptr->g = (float)(i * 2 / 3 + 1);
for(j = 0; j < 16; j++)
- s_ptr->h[j] = (float)(i * j / 5 + j);
+ s_ptr->h[j] = (float)(i * j / 5 + j);
s_ptr->i = (float)(i * 2 / 3 + 2);
s_ptr->j = (float)(i * 2 / 3 + 3);
@@ -1061,13 +1061,13 @@ initialize_stype4(unsigned char *buf, size_t num)
}
}
-
+
/*-------------------------------------------------------------------------
- * Function: create_stype1
+ * Function: create_stype1
*
- * Purpose: Create HDF5 compound datatype for stype1.
+ * Purpose: Create HDF5 compound datatype for stype1.
*
- * Return: Success: datatype ID
+ * Return: Success: datatype ID
*
* Failure: negative
*
@@ -1081,7 +1081,7 @@ static hid_t
create_stype1(void)
{
hid_t array_dt1, array_dt2, tid;
- const hsize_t eight = 8, sixteen = 16;
+ const hsize_t eight = 8, sixteen = 16;
/* Build hdf5 datatypes */
if((array_dt1 = H5Tarray_create2(H5T_NATIVE_INT,1, &eight)) < 0)
@@ -1117,13 +1117,13 @@ error:
return FAIL;
}
-
+
/*-------------------------------------------------------------------------
- * Function: create_stype2
+ * Function: create_stype2
*
- * Purpose: Create HDF5 compound datatype for stype2.
+ * Purpose: Create HDF5 compound datatype for stype2.
*
- * Return: Success: datatype ID
+ * Return: Success: datatype ID
*
* Failure: negative
*
@@ -1137,7 +1137,7 @@ static hid_t
create_stype2(void)
{
hid_t array_dt1, array_dt2, tid;
- const hsize_t eight = 8, sixteen = 16;
+ const hsize_t eight = 8, sixteen = 16;
/* Build hdf5 datatypes */
if((array_dt1 = H5Tarray_create2(H5T_NATIVE_INT,1, &eight)) < 0)
@@ -1176,13 +1176,13 @@ error:
return FAIL;
}
-
+
/*-------------------------------------------------------------------------
- * Function: create_stype3
+ * Function: create_stype3
*
- * Purpose: Create HDF5 compound datatype for stype3.
+ * Purpose: Create HDF5 compound datatype for stype3.
*
- * Return: Success: datatype ID
+ * Return: Success: datatype ID
*
* Failure: negative
*
@@ -1196,7 +1196,7 @@ static hid_t
create_stype3(void)
{
hid_t array_dt1, tid;
- const hsize_t eight = 8;
+ const hsize_t eight = 8;
/* Build hdf5 datatypes */
if((array_dt1 = H5Tarray_create2(H5T_NATIVE_INT,1, &eight)) < 0)
@@ -1219,13 +1219,13 @@ error:
return FAIL;
}
-
+
/*-------------------------------------------------------------------------
- * Function: create_stype4
+ * Function: create_stype4
*
- * Purpose: Create HDF5 compound datatype for stype4.
+ * Purpose: Create HDF5 compound datatype for stype4.
*
- * Return: Success: datatype ID
+ * Return: Success: datatype ID
*
* Failure: negative
*
@@ -1239,7 +1239,7 @@ static hid_t
create_stype4(void)
{
hid_t array_dt1, array_dt2, tid;
- const hsize_t eight = 8, sixteen = 16;
+ const hsize_t eight = 8, sixteen = 16;
/* Build hdf5 datatypes */
if((array_dt1 = H5Tarray_create2(H5T_NATIVE_INT,1, &eight)) < 0)
@@ -1281,13 +1281,13 @@ error:
return FAIL;
}
-
+
/*-------------------------------------------------------------------------
- * Function: compare_data
+ * Function: compare_data
*
- * Purpose: Compare data of stype1 and stype2.
+ * Purpose: Compare data of stype1 and stype2.
*
- * Return: Success: 0
+ * Return: Success: 0
*
* Failure: negative
*
@@ -1306,21 +1306,21 @@ compare_data(void *src_data, void *dst_data, hbool_t src_subset)
for(i = 0; i < (int)(NX * NY); i++) {
if(src_subset) {
- s_ptr = ((stype1 *)src_data) + i;
- d_ptr = ((stype2 *)dst_data) + i;
+ s_ptr = ((stype1 *)src_data) + i;
+ d_ptr = ((stype2 *)dst_data) + i;
} else {
- s_ptr = (stype1 *)(((stype2 *)src_data) + i);
- d_ptr = (stype2 *)(((stype1 *)dst_data) + i);
+ s_ptr = (stype1 *)(((stype2 *)src_data) + i);
+ d_ptr = (stype2 *)(((stype1 *)dst_data) + i);
}
- if (s_ptr->a != d_ptr->a ||
- s_ptr->b != d_ptr->b ||
- s_ptr->c[0] != d_ptr->c[0] ||
- s_ptr->c[1] != d_ptr->c[1] ||
- s_ptr->c[2] != d_ptr->c[2] ||
- s_ptr->c[3] != d_ptr->c[3] ||
- s_ptr->d != d_ptr->d ||
- s_ptr->e != d_ptr->e ||
+ if (s_ptr->a != d_ptr->a ||
+ s_ptr->b != d_ptr->b ||
+ s_ptr->c[0] != d_ptr->c[0] ||
+ s_ptr->c[1] != d_ptr->c[1] ||
+ s_ptr->c[2] != d_ptr->c[2] ||
+ s_ptr->c[3] != d_ptr->c[3] ||
+ s_ptr->d != d_ptr->d ||
+ s_ptr->e != d_ptr->e ||
!H5_FLT_ABS_EQUAL(s_ptr->f, d_ptr->f) ||
!H5_FLT_ABS_EQUAL(s_ptr->g, d_ptr->g) ||
!H5_FLT_ABS_EQUAL(s_ptr->h[0], d_ptr->h[0]) ||
@@ -1332,25 +1332,25 @@ compare_data(void *src_data, void *dst_data, hbool_t src_subset)
!H5_DBL_ABS_EQUAL(s_ptr->m, d_ptr->m) ||
!H5_DBL_ABS_EQUAL(s_ptr->n, d_ptr->n) ) {
- H5_FAILED();
- printf(" i=%d\n", i);
- printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, h=[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f], i=%f, j=%f, k=%f, l=%f, m=%f, n=%f}\n",
- s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2],
- s_ptr->c[3], s_ptr->c[4], s_ptr->c[5], s_ptr->c[6], s_ptr->c[7],
+ H5_FAILED();
+ HDprintf(" i=%d\n", i);
+ HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, h=[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f], i=%f, j=%f, k=%f, l=%f, m=%f, n=%f}\n",
+ s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2],
+ s_ptr->c[3], s_ptr->c[4], s_ptr->c[5], s_ptr->c[6], s_ptr->c[7],
s_ptr->d, s_ptr->e, (double)s_ptr->f, (double)s_ptr->g,(double)s_ptr->h[0],(double)s_ptr->h[1],(double)s_ptr->h[2],
(double)s_ptr->h[3],(double)s_ptr->h[4],(double)s_ptr->h[5],(double)s_ptr->h[6],(double)s_ptr->h[7],(double)s_ptr->h[8],
(double)s_ptr->h[9],(double)s_ptr->h[10],(double)s_ptr->h[11],(double)s_ptr->h[12],(double)s_ptr->h[13],(double)s_ptr->h[14],
(double)s_ptr->h[15], (double)s_ptr->i,(double)s_ptr->j,s_ptr->k,s_ptr->l,s_ptr->m,s_ptr->n);
- printf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, h=[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f], i=%f, j=%f, k=%f, l=%f, m=%f, n=%f}\n",
- d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2],
- d_ptr->c[3], d_ptr->c[4], d_ptr->c[5], d_ptr->c[6], d_ptr->c[7],
+ HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, h=[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f], i=%f, j=%f, k=%f, l=%f, m=%f, n=%f}\n",
+ d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2],
+ d_ptr->c[3], d_ptr->c[4], d_ptr->c[5], d_ptr->c[6], d_ptr->c[7],
d_ptr->d, d_ptr->e, (double)d_ptr->f, (double)d_ptr->g,(double)d_ptr->h[0],(double)d_ptr->h[1],(double)d_ptr->h[2],
(double)d_ptr->h[3],(double)d_ptr->h[4],(double)d_ptr->h[5],(double)d_ptr->h[6],(double)d_ptr->h[7],(double)d_ptr->h[8],
(double)d_ptr->h[9],(double)d_ptr->h[10],(double)d_ptr->h[11],(double)d_ptr->h[12],(double)d_ptr->h[13],
(double)d_ptr->h[14],(double)d_ptr->h[15],(double)d_ptr->i,(double)d_ptr->j,d_ptr->k,d_ptr->l,
d_ptr->m,d_ptr->n);
- goto error;
- }
+ goto error;
+ }
}
return SUCCEED;
@@ -1359,11 +1359,11 @@ error:
return FAIL;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_hdf5_src_subset
+ * Function: test_hdf5_src_subset
*
- * Purpose: Test the optimization of compound data writing, rewriting,
+ * Purpose: Test the optimization of compound data writing, rewriting,
* and reading when the source type is a subset of destination
* type. For example:
* struct source { struct destination {
@@ -1375,11 +1375,11 @@ error:
* };
* This optimization is for the Chicago company.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Friday, 15 June 2007
*
* Modifications:
@@ -1399,7 +1399,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
/* Create the file for this test */
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
/* Build hdf5 datatypes */
if ((src_tid=create_stype1()) < 0)
@@ -1413,7 +1413,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
/* Create the data space */
if((space = H5Screate_simple(2, dims, NULL)) < 0)
- goto error;
+ goto error;
/* Allocate space and initialize data */
orig = (unsigned char*)HDmalloc(NX * NY * sizeof(stype1));
@@ -1441,7 +1441,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
/* Write the data to the dataset */
if(H5Dwrite(dataset, src_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig) < 0)
- goto error;
+ goto error;
if(H5Dclose(dataset) < 0)
goto error;
@@ -1456,7 +1456,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
/* Write the data to the dataset */
if(H5Dwrite(dataset, src_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig) < 0)
- goto error;
+ goto error;
if(H5Dclose(dataset) < 0)
goto error;
@@ -1482,7 +1482,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
/* Write the data to the dataset */
if(H5Dwrite(dataset, rew_tid, H5S_ALL, H5S_ALL, dxpl, rew_buf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0)
FAIL_STACK_ERROR
@@ -1493,7 +1493,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
/* Write the data to the dataset */
if(H5Dwrite(dataset, rew_tid, H5S_ALL, H5S_ALL, dxpl, rew_buf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0)
FAIL_STACK_ERROR
@@ -1559,15 +1559,15 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
return 0;
error:
- puts("*** DATASET TESTS FAILED ***");
+ HDputs("*** DATASET TESTS FAILED ***");
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_hdf5_dst_subset
+ * Function: test_hdf5_dst_subset
*
- * Purpose: Test the optimization of compound data writing, rewriting,
+ * Purpose: Test the optimization of compound data writing, rewriting,
* and reading when the destination type is a subset of the
* source type. For example:
* struct source { struct destination {
@@ -1580,11 +1580,11 @@ error:
* This optimization is for the Chicago company. This test
* is in opposite of test_hdf5_src_subset.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Friday, 15 June 2007
*
* Modifications:
@@ -1604,7 +1604,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl)
/* Create the file for this test */
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
/* Build hdf5 datatypes */
if ((src_tid=create_stype2()) < 0)
@@ -1618,7 +1618,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl)
/* Create the data space */
if((space = H5Screate_simple(2, dims, NULL)) < 0)
- goto error;
+ goto error;
/* Allocate space and initialize data */
orig = (unsigned char*)HDmalloc(NX * NY * sizeof(stype2));
@@ -1645,7 +1645,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl)
/* Write the data to the dataset */
if(H5Dwrite(dataset, src_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig) < 0)
- goto error;
+ goto error;
if(H5Dclose(dataset) < 0)
goto error;
@@ -1660,7 +1660,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl)
/* Write the data to the dataset */
if(H5Dwrite(dataset, src_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig) < 0)
- goto error;
+ goto error;
if(H5Dclose(dataset) < 0)
goto error;
@@ -1686,7 +1686,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl)
/* Write the data to the dataset */
if(H5Dwrite(dataset, rew_tid, H5S_ALL, H5S_ALL, dxpl, rew_buf) < 0)
- goto error;
+ goto error;
if(H5Dclose(dataset) < 0)
goto error;
@@ -1697,7 +1697,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl)
/* Write the data to the dataset */
if(H5Dwrite(dataset, rew_tid, H5S_ALL, H5S_ALL, dxpl, rew_buf) < 0)
- goto error;
+ goto error;
if(H5Dclose(dataset) < 0)
goto error;
@@ -1773,27 +1773,27 @@ error:
{ \
int _i; \
H5_FAILED(); AT(); \
- printf(" Insertion order ="); \
+ HDprintf(" Insertion order ="); \
for(_i=0; _i<PACK_NMEMBS; _i++) \
- printf(" %d", order[_i]); \
- printf("\n Inner compound order = %d, location = %d\n", sub_cmpd_order, order[sub_cmpd_order]); \
+ HDprintf(" %d", order[_i]); \
+ HDprintf("\n Inner compound order = %d, location = %d\n", sub_cmpd_order, order[sub_cmpd_order]); \
fflush(stdout); \
goto error; \
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_pack_ooo
+ * Function: test_pack_ooo
*
- * Purpose: Test inserting fields into a compound out of offset order.
+ * Purpose: Test inserting fields into a compound out of offset order.
* Verifies that the compound is correctly marked as packed
* or non-packed.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Neil Fortner
+ * Programmer: Neil Fortner
* Thursday, 22 January 2009
*
* Modifications:
@@ -1808,7 +1808,7 @@ test_pack_ooo(void)
unsigned free_order[PACK_NMEMBS]; /* Index of remaining free slots in order */
unsigned num_free; /* Number of free slots in order */
unsigned sub_cmpd_order; /* Order to insert the inner compound */
- char name[6]; /* Member name */
+ char name[16]; /* Member name */
unsigned extra_space; /* Whether to add extra space to the end of
* the compound */
unsigned i, j; /* Indices */
@@ -1840,9 +1840,9 @@ test_pack_ooo(void)
for(extra_space=0; extra_space<2; extra_space ++) {
if(extra_space)
- puts("With extra space at the end of compound...");
+ HDputs("With extra space at the end of compound...");
else
- puts("Without extra space at the end of compound...");
+ HDputs("Without extra space at the end of compound...");
TESTING("random member insertion with empty compound subtype");
@@ -1854,7 +1854,7 @@ test_pack_ooo(void)
/* Insert the compound members in the random order previously generated */
for(i=0; i<PACK_NMEMBS; i++) {
- sprintf(name, "%05d", i);
+ HDsprintf(name, "%05d", i);
if(i == sub_cmpd_order) {
if(H5Tinsert(cmpd, name, (size_t)(4 * order[i]), sub_cmpd) < 0) PACK_OOO_ERROR
} else
@@ -1880,7 +1880,7 @@ test_pack_ooo(void)
/* Insert the compound members in the random order previously generated */
for(i=0; i<PACK_NMEMBS; i++) {
- sprintf(name, "%05d", i);
+ HDsprintf(name, "%05d", i);
if(i == sub_cmpd_order) {
if(H5Tinsert(cmpd, name, (size_t)(4 * order[i]), sub_cmpd) < 0) PACK_OOO_ERROR
} else
@@ -1907,7 +1907,7 @@ test_pack_ooo(void)
/* Insert the compound members in reverse order, with compound last */
for(i=0; i<PACK_NMEMBS; i++) {
- sprintf(name, "%05d", i);
+ HDsprintf(name, "%05d", i);
if(i == PACK_NMEMBS - 1) {
if(H5Tinsert(cmpd, name, (size_t)(4 * (PACK_NMEMBS - i - 1)), sub_cmpd) < 0) PACK_OOO_ERROR
} else
@@ -1933,7 +1933,7 @@ test_pack_ooo(void)
/* Insert the compound members in reverse order, with compound last */
for(i=0; i<PACK_NMEMBS; i++) {
- sprintf(name, "%05d", i);
+ HDsprintf(name, "%05d", i);
if(i == PACK_NMEMBS - 1) {
if(H5Tinsert(cmpd, name, (size_t)(4 * (PACK_NMEMBS - i - 1)), sub_cmpd) < 0) PACK_OOO_ERROR
} else
@@ -1960,7 +1960,7 @@ test_pack_ooo(void)
/* Insert the compound members in forward order, with compound first */
for(i=0; i<PACK_NMEMBS; i++) {
- sprintf(name, "%05d", i);
+ HDsprintf(name, "%05d", i);
if(i == 0) {
if(H5Tinsert(cmpd, name, (size_t)(4 * i), sub_cmpd) < 0) PACK_OOO_ERROR
} else
@@ -1986,7 +1986,7 @@ test_pack_ooo(void)
/* Insert the compound members in forward order */
for(i=0; i<PACK_NMEMBS; i++) {
- sprintf(name, "%05d", i);
+ HDsprintf(name, "%05d", i);
if(i == 0) {
if(H5Tinsert(cmpd, name, (size_t)(4 * i), sub_cmpd) < 0) PACK_OOO_ERROR
} else
@@ -2007,32 +2007,32 @@ test_pack_ooo(void)
return 0;
error:
- puts("*** DATASET TESTS FAILED ***");
+HDputs("*** DATASET TESTS FAILED ***");
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_ooo_order
+ * Function: test_ooo_order
*
- * Purpose: Test inserting fields into a compound out of offset order.
+ * Purpose: Test inserting fields into a compound out of offset order.
* Verifies that the order of compound members is the same as
* the order in which they were inserted. While this is
* explicitly not guaranteed by the documentation, the H5TB
* API currently makes this assumption.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Neil Fortner
+ * Programmer: Neil Fortner
* Monday, 19 October 2009
*
* Modifications:
*-------------------------------------------------------------------------
*/
static unsigned
-test_ooo_order(char *filename)
+test_ooo_order(char *filename, hid_t fapl_id)
{
hid_t file = -1; /* File ID */
hid_t dtype = -1; /* Datatype IDs */
@@ -2042,7 +2042,7 @@ test_ooo_order(char *filename)
TESTING("that compound member insertion order is preserved")
/* Create the file */
- if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR
/* Create the compound */
@@ -2070,7 +2070,7 @@ test_ooo_order(char *filename)
/* Close and reopen the file */
if(H5Tclose(dtype)) TEST_ERROR
if(H5Fclose(file)) TEST_ERROR
- if((file = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) TEST_ERROR
/* Open the type */
if((dtype_tmp = H5Topen2(file, "dtype", H5P_DEFAULT)) < 0) TEST_ERROR
@@ -2123,7 +2123,7 @@ test_ooo_order(char *filename)
if(H5Tclose(dtype_tmp)) TEST_ERROR
if(H5Tclose(dtype)) TEST_ERROR
if(H5Fclose(file)) TEST_ERROR
- if((file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id)) < 0) TEST_ERROR
/* Open the type, and verify status */
if((dtype_tmp = H5Topen2(file, "dtype2", H5P_DEFAULT)) < 0) TEST_ERROR
@@ -2183,18 +2183,18 @@ error:
H5Tclose(dtype);
H5Fclose(file);
} H5E_END_TRY
- puts("*** DATASET TESTS FAILED ***");
+ HDputs("*** DATASET TESTS FAILED ***");
return 1;
} /* test_ooo_order */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test different cases of I/O for compound data and the
+ * Purpose: Test different cases of I/O for compound data and the
* compound optimization for the Chicago company.
*
- * Return: Success: 0
+ * Return: Success: 0
*
* Failure: 1
*
@@ -2207,19 +2207,19 @@ error:
int
main (int argc, char *argv[])
{
- hid_t fapl_id;
- char fname[256];
- unsigned nerrors = 0;
+ hid_t fapl_id;
+ char fname[256];
+ unsigned nerrors = 0;
h5_reset();
/* Turn off optimized compound converter? */
if (argc>1) {
- if (argc>2 || strcmp("--noopt", argv[1])) {
- fprintf(stderr, "usage: %s [--noopt]\n", argv[0]);
- exit(EXIT_FAILURE);
- }
- H5Tunregister(H5T_PERS_DONTCARE, NULL, (hid_t)-1, (hid_t)-1, H5T__conv_struct_opt);
+ if (argc>2 || strcmp("--noopt", argv[1])) {
+ HDfprintf(stderr, "usage: %s [--noopt]\n", argv[0]);
+ HDexit(EXIT_FAILURE);
+ }
+ H5Tunregister(H5T_PERS_DONTCARE, NULL, (hid_t)-1, (hid_t)-1, (H5T_conv_t)((void (*) (void))H5T__conv_struct_opt));
}
/* Create the file */
@@ -2227,33 +2227,33 @@ main (int argc, char *argv[])
h5_fixname(FILENAME[0], fapl_id, fname, sizeof(fname));
- puts("Testing compound dataset:");
+ HDputs("Testing compound dataset:");
nerrors += test_compound(fname, fapl_id);
- puts("Testing the optimization of when the source type is a subset of the dest:");
+ HDputs("Testing the optimization of when the source type is a subset of the dest:");
h5_fixname(FILENAME[1], fapl_id, fname, sizeof(fname));
nerrors += test_hdf5_src_subset(fname, fapl_id);
- puts("Testing the optimization of when the dest type is a subset of the source:");
+ HDputs("Testing the optimization of when the dest type is a subset of the source:");
h5_fixname(FILENAME[2], fapl_id, fname, sizeof(fname));
nerrors += test_hdf5_dst_subset(fname, fapl_id);
- puts("Testing that compound types can be packed out of order:");
+ HDputs("Testing that compound types can be packed out of order:");
nerrors += test_pack_ooo();
- puts("Testing compound member ordering:");
- nerrors += test_ooo_order(fname);
+ HDputs("Testing compound member ordering:");
+ nerrors += test_ooo_order(fname, fapl_id);
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0);
if (nerrors) {
- printf("***** %u FAILURE%s! *****\n",
+ HDprintf("***** %u FAILURE%s! *****\n",
nerrors, 1==nerrors?"":"S");
HDexit(EXIT_FAILURE);
}
h5_cleanup(FILENAME, fapl_id);
- puts("All compound dataset tests passed.");
+ HDputs("All compound dataset tests passed.");
return 0;
}
diff --git a/test/cork.c b/test/cork.c
index 240be77..06a520d 100644
--- a/test/cork.c
+++ b/test/cork.c
@@ -24,9 +24,9 @@
* This file needs to access private information from the H5C package.
* This file also needs to access the metadata cache testing code.
*/
-#define H5C_FRIEND /*suppress error about including H5Cpkg */
-#define H5C_TESTING /*suppress warning about H5C testing funcs*/
-#include "H5Cpkg.h" /* Cache */
+#define H5C_FRIEND /*suppress error about including H5Cpkg */
+#define H5C_TESTING /*suppress warning about H5C testing funcs*/
+#include "H5Cpkg.h" /* Cache */
/* ============ */
@@ -74,7 +74,7 @@ static unsigned verify_group_cork(hbool_t swmr);
static unsigned verify_named_cork(hbool_t swmr);
static unsigned verify_multiple_cork(hbool_t swmr);
-
+
/*-------------------------------------------------------------------------
* Function: verify_old_dset_cork
*
@@ -120,15 +120,15 @@ verify_old_dset_cork(void)
FAIL_STACK_ERROR
/* Create chunked dataset with v1-btree indexing: DSET_BT1 */
- if((sid = H5Screate_simple(2, dims, max_dims)) < 0)
+ if((sid = H5Screate_simple(2, dims, max_dims)) < 0)
TEST_ERROR
if((did = H5Dcreate2(fid, DSET_BT1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
TEST_ERROR
-
+
/* Get dataset object header address: DSET_BT1 */
if(H5Oget_info2(did, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR
-
+
/* Cork the dataset: DSET_BT1 */
if(H5Odisable_mdc_flushes(did) < 0)
TEST_ERROR
@@ -159,13 +159,13 @@ verify_old_dset_cork(void)
FAIL_STACK_ERROR
if(H5Pset_alloc_time(dcpl2, H5D_ALLOC_TIME_EARLY) < 0)
FAIL_STACK_ERROR
- if((did2 = H5Dcreate2(fid, DSET_COMPACT, H5T_NATIVE_INT, sid2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0)
+ if((did2 = H5Dcreate2(fid, DSET_COMPACT, H5T_NATIVE_INT, sid2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Get dataset object address */
if(H5Oget_info2(did2, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
-
+
/* Cork the dataset: DSET_COMPACT */
if(H5Odisable_mdc_flushes(did2) < 0)
TEST_ERROR
@@ -212,7 +212,7 @@ verify_old_dset_cork(void)
FAIL_STACK_ERROR
if(H5Pset_layout(dcpl3, H5D_CONTIGUOUS) < 0)
FAIL_STACK_ERROR
- if((did3 = H5Dcreate2(fid, DSET_CONTIG, H5T_NATIVE_INT, sid3, H5P_DEFAULT, dcpl3, H5P_DEFAULT)) < 0)
+ if((did3 = H5Dcreate2(fid, DSET_CONTIG, H5T_NATIVE_INT, sid3, H5P_DEFAULT, dcpl3, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Get dataset object address: DSET_CONTIG */
@@ -224,11 +224,11 @@ verify_old_dset_cork(void)
TEST_ERROR
/* Verify the cork status for DSET_CONTIG */
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
TEST_ERROR
/* Verify the cork status for DSET_BT1 */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
TEST_ERROR
/* Un-cork the dataset: DSET_CONTIG */
@@ -236,7 +236,7 @@ verify_old_dset_cork(void)
TEST_ERROR
/* Verify the cork status for DSET_CONTIG */
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
TEST_ERROR
/* Closing */
@@ -268,7 +268,7 @@ error:
return 1;
} /* verify_old_dset_cork */
-
+
/*-------------------------------------------------------------------------
* Function: verify_obj_dset_cork
*
@@ -325,23 +325,23 @@ verify_obj_dset_cork(hbool_t swmr)
TEST_ERROR
/* Create dataset: DSET */
- if((did = H5Dcreate2(fid, DSET, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((did = H5Dcreate2(fid, DSET, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Get dataset object header address */
if(H5Oget_info2(did, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR
-
+
/* Verify cork status of the dataset: DSET */
if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
TEST_ERROR
-
+
/* Cork the dataset: DSET */
if(H5Odisable_mdc_flushes(did) < 0)
TEST_ERROR
/* Attach and write to an attribute to the dataset: DSET */
- if((aid = H5Acreate2(did, ATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((aid = H5Acreate2(did, ATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Verify cork status of the dataset: DSET */
@@ -349,24 +349,24 @@ verify_obj_dset_cork(hbool_t swmr)
TEST_ERROR
/* Close the attribute */
- if(H5Aclose(aid) < 0)
+ if(H5Aclose(aid) < 0)
TEST_ERROR
/* Verify cork status of the dataset: DSET */
if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
TEST_ERROR
-
+
/* Create dcpl */
if((dcpl2 = H5Pcreate(H5P_DATASET_CREATE)) < 0)
TEST_ERROR
/* Set to early allocation for dataset space */
- if(H5Pset_alloc_time(dcpl2, H5D_ALLOC_TIME_EARLY) < 0)
+ if(H5Pset_alloc_time(dcpl2, H5D_ALLOC_TIME_EARLY) < 0)
TEST_ERROR
/* Create chunked dataset with implicit indexing: DSET_NONE */
if(H5Pset_chunk(dcpl2, 1, chunk_dim) < 0)
FAIL_STACK_ERROR
- if((sid2 = H5Screate_simple(1, dim, NULL)) < 0)
+ if((sid2 = H5Screate_simple(1, dim, NULL)) < 0)
TEST_ERROR
if((did2 = H5Dcreate2(fid, DSET_NONE, H5T_NATIVE_INT, sid2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0)
TEST_ERROR
@@ -391,7 +391,7 @@ verify_obj_dset_cork(hbool_t swmr)
} /* end for */
/* Verify cork status of the dataset: DSET_NONE */
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
TEST_ERROR
/* Closing */
@@ -412,11 +412,11 @@ verify_obj_dset_cork(hbool_t swmr)
flags = H5F_ACC_RDWR;
if(swmr)
flags |= H5F_ACC_SWMR_WRITE;
- if((fid = H5Fopen(FILENAME, flags, fapl)) < 0)
+ if((fid = H5Fopen(FILENAME, flags, fapl)) < 0)
TEST_ERROR
/* Open the dataset object: DSET_NONE */
- if((oid = H5Oopen(fid, DSET_NONE, H5P_DEFAULT)) < 0)
+ if((oid = H5Oopen(fid, DSET_NONE, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Verify cork status of the dataset: DSET */
@@ -469,7 +469,7 @@ error:
return 1;
} /* verify_obj_dset_cork */
-
+
/*-------------------------------------------------------------------------
* Function: verify_dset_cork
*
@@ -540,15 +540,15 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
FAIL_STACK_ERROR
/* Create chunked dataset with extensive array indexing: DSET_EA */
- if((sid = H5Screate_simple(2, dims, max_dims)) < 0)
+ if((sid = H5Screate_simple(2, dims, max_dims)) < 0)
TEST_ERROR
if((did = H5Dcreate2(fid, DSET_EA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
TEST_ERROR
-
+
/* Get dataset object header address: DSET_EA */
if(H5Oget_info2(did, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR
-
+
/* Cork the dataset: DSET_EA */
if(H5Odisable_mdc_flushes(did) < 0)
TEST_ERROR
@@ -558,7 +558,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Create chunked dataset with fixed array indexing: DSET_FA */
- if((sid2 = H5Screate_simple(2, dims, NULL)) < 0)
+ if((sid2 = H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR
if((did2 = H5Dcreate2(fid, DSET_FA, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
@@ -566,7 +566,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
/* Get dataset object header address: DSET_FA */
if(H5Oget_info2(did2, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
-
+
/* Cork the dataset: DSET_FA */
if(H5Odisable_mdc_flushes(did2) < 0)
TEST_ERROR
@@ -585,7 +585,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
/* Create chunked dataset with v2-Btree indexing */
max_dims[0] = H5S_UNLIMITED;
- if((sid3 = H5Screate_simple(2, dims, max_dims)) < 0)
+ if((sid3 = H5Screate_simple(2, dims, max_dims)) < 0)
TEST_ERROR
if((did3 = H5Dcreate2(fid, DSET_BT2, H5T_NATIVE_INT, sid3, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
TEST_ERROR
@@ -708,7 +708,7 @@ error:
} /* verify_dset_cork */
-
+
/*-------------------------------------------------------------------------
* Function: verify_group_cork
*
@@ -758,11 +758,11 @@ verify_group_cork(hbool_t swmr)
TEST_ERROR
/* Create 3 groups */
- if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
- if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
- if((gid3 = H5Gcreate2(gid2, GRP3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid3 = H5Gcreate2(gid2, GRP3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Cork the second group: GRP2 */
@@ -778,23 +778,23 @@ verify_group_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the groups */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
TEST_ERROR
-
+
/* Close the second group: GRP2 */
if(H5Gclose(gid2) < 0)
TEST_ERROR
/* Re-open the second group: GRP2 */
- if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
+ if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Verify cork status of the second group: GRP2 */
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
TEST_ERROR
/* Closing */
@@ -813,11 +813,11 @@ verify_group_cork(hbool_t swmr)
flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fopen(FILENAME, flags, fapl)) < 0)
FAIL_STACK_ERROR
- if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0)
+ if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
+ if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- if((gid3 = H5Gopen2(gid2, GRP3, H5P_DEFAULT)) < 0)
+ if((gid3 = H5Gopen2(gid2, GRP3, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Create dataspace */
@@ -826,7 +826,7 @@ verify_group_cork(hbool_t swmr)
/* Attach 8 attributes to the third group: GRP3 */
for(i = 0;i < 8; i++) {
- sprintf(attrname, "attr %d", i);
+ HDsprintf(attrname, "attr %d", i);
if((aid = H5Acreate2(gid3, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
if(H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0)
@@ -835,7 +835,7 @@ verify_group_cork(hbool_t swmr)
if(i == 3) {
if(H5Odisable_mdc_flushes(gid3) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
TEST_ERROR
}
if(H5Aclose(aid) < 0)
@@ -843,7 +843,7 @@ verify_group_cork(hbool_t swmr)
} /* end for */
/* Verify cork status of the third group: GRP3 */
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
TEST_ERROR
/* Closing */
@@ -875,7 +875,7 @@ error:
return 1;
} /* verify_group_cork */
-
+
/*-------------------------------------------------------------------------
* Function: verify_named_cork
*
@@ -935,21 +935,21 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Commit datatype /DT */
- if(H5Tcommit2(fid, DT, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ if(H5Tcommit2(fid, DT, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
/* Create /GRP */
- if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Commit datatype /GRP/DT2 */
- if(H5Tcommit2(gid, DT2, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ if(H5Tcommit2(gid, DT2, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
/* Create /GRP/GRP2 */
- if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Commit datatype /GRP/GRP2/DT3 */
- if(H5Tcommit2(gid2, DT3, tid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ if(H5Tcommit2(gid2, DT3, tid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
/* Cork 2 named datatypes: /DT and /GRP/GRP2/DT3 */
@@ -967,11 +967,11 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the named datatypes */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
TEST_ERROR
/* Close the datatypes */
@@ -983,19 +983,19 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Re-open the named datatypes */
- if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0)
+ if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0)
+ if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0)
+ if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Verify cork status of the named datatypes */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
TEST_ERROR
/* Closing */
@@ -1019,17 +1019,17 @@ verify_named_cork(hbool_t swmr)
flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fopen(FILENAME, flags, fapl)) < 0)
FAIL_STACK_ERROR
- if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0)
+ if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
+ if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Re-open the named datatypes */
- if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0)
+ if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0)
+ if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0)
+ if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Cork the datatype: DT2 */
@@ -1042,7 +1042,7 @@ verify_named_cork(hbool_t swmr)
/* Attach 8 attributes to datatype: DT3 */
for(i = 0;i < 8; i++) {
- sprintf(attrname, "attr %d", i);
+ HDsprintf(attrname, "attr %d", i);
if((aid = H5Acreate2(tid3, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
if(H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0)
@@ -1051,7 +1051,7 @@ verify_named_cork(hbool_t swmr)
if(i == 3) {
if(H5Odisable_mdc_flushes(tid3) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
TEST_ERROR
}
if(H5Aclose(aid) < 0)
@@ -1059,7 +1059,7 @@ verify_named_cork(hbool_t swmr)
} /* end for */
/* Create a dataset with named datatype: DT */
- if((did = H5Dcreate2(fid, DSET, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((did = H5Dcreate2(fid, DSET, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Get dataset object header address */
@@ -1071,20 +1071,20 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the datatype: DT */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
TEST_ERROR
/* Verify cork status of the datatype: DT2 */
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
TEST_ERROR
/* Verify cork status of the datatype: DT3 */
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
TEST_ERROR
/* Un-cork the datatype: DT3 */
if(H5Oenable_mdc_flushes(tid3) < 0)
TEST_ERROR
/* Verify cork status of the datatype: DT3 */
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
TEST_ERROR
/* Cork the datatype: DT */
@@ -1092,14 +1092,14 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the datatype: DT */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
TEST_ERROR
/* Verify cork status of the datatype: DT2 */
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
TEST_ERROR
/* Verify cork status of the dataset: DSET */
- if(H5C__verify_cork_tag_test(fid, oinfo4.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo4.addr, TRUE) < 0)
TEST_ERROR
/* Close the dataset */
@@ -1107,11 +1107,11 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the datatype: DT */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
TEST_ERROR
/* Verify cork status of the dataset: DSET */
- if(H5C__verify_cork_tag_test(fid, oinfo4.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo4.addr, FALSE) < 0)
TEST_ERROR
/* Closing */
@@ -1149,7 +1149,7 @@ error:
return 1;
} /* verify_named_cork */
-
+
/*-------------------------------------------------------------------------
* Function: verify_multiple_cork
*
@@ -1279,7 +1279,7 @@ verify_multiple_cork(hbool_t swmr)
/* Verify cork status of the group: gid2 */
if(H5Oget_info2(gid2, &oinfo1, H5O_INFO_BASIC) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid2, oinfo1.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid2, oinfo1.addr, TRUE) < 0)
TEST_ERROR
/* Check cork status of the group: gid1 */
@@ -1307,7 +1307,7 @@ verify_multiple_cork(hbool_t swmr)
/* Verify cork status of the dataset: did1 */
if(H5Oget_info2(did1, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid1, oinfo2.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid1, oinfo2.addr, TRUE) < 0)
TEST_ERROR
/* Check cork status of the dataset: did2 */
@@ -1335,7 +1335,7 @@ verify_multiple_cork(hbool_t swmr)
/* Verify cork status of the datatype: tid2 */
if(H5Oget_info2(tid2, &oinfo3, H5O_INFO_BASIC) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid2, oinfo3.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid2, oinfo3.addr, TRUE) < 0)
TEST_ERROR
/* Check cork status of the datatype: tid1 */
@@ -1351,7 +1351,7 @@ verify_multiple_cork(hbool_t swmr)
/* Verify cork status of the group: gid1 */
if(H5Oget_info2(gid1, &oinfo1, H5O_INFO_BASIC) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid1, oinfo1.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid1, oinfo1.addr, FALSE) < 0)
TEST_ERROR
/* Check cork status of the group: gid2 */
@@ -1371,7 +1371,7 @@ verify_multiple_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the group: gid1 */
- if(H5C__verify_cork_tag_test(fid1, oinfo1.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid1, oinfo1.addr, FALSE) < 0)
TEST_ERROR
/* Close the group: gid1 */
@@ -1385,7 +1385,7 @@ verify_multiple_cork(hbool_t swmr)
/* Verify cork status of the dataset: did2 */
if(H5Oget_info2(did2, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid2, oinfo2.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid2, oinfo2.addr, FALSE) < 0)
TEST_ERROR
/* Check cork status of the dataset: did1 */
@@ -1405,7 +1405,7 @@ verify_multiple_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the dataset: did1 */
- if(H5C__verify_cork_tag_test(fid1, oinfo2.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid1, oinfo2.addr, FALSE) < 0)
TEST_ERROR
/* Close the dataset: did1 */
@@ -1517,7 +1517,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_objs_cork
*
- * Purpose: This function verifies H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled public
+ * Purpose: This function verifies H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled public
* routines are working as specified.
*
* Return: 0 on Success, 1 on Failure
@@ -1529,11 +1529,13 @@ error:
static unsigned
test_objs_cork(hbool_t swmr, hbool_t new_format)
{
- hid_t fid; /* HDF5 File ID */
- hid_t fapl; /* File access property list */
- hid_t gid, did, tid; /* Object IDs */
- hid_t sid; /* Dataspace ID */
- hid_t aid; /* Attribute ID */
+ hid_t fid = H5I_INVALID_HID; /* HDF5 File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t gid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID; /* Object IDs */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
hsize_t dims[RANK]; /* Dataset dimension sizes */
hbool_t corked; /* Cork status of an object */
unsigned flags; /* File access flags */
@@ -1723,7 +1725,7 @@ test_objs_cork(hbool_t swmr, hbool_t new_format)
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
-
+
/* Cork the named datatype */
if(H5Odisable_mdc_flushes(tid) < 0)
TEST_ERROR
@@ -1796,7 +1798,7 @@ error:
return 1;
} /* test_objs_cork() */
-
+
/*-------------------------------------------------------------------------
* Function: test_dset_cork
*
@@ -1847,7 +1849,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
} /* end if */
/* Create fapl */
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR
/* Set to use latest format */
@@ -1880,7 +1882,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
/* Set up dataset creation property list */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
TEST_ERROR
-
+
/* Enable chunking */
if(H5Pset_chunk(dcpl, RANK, cdims) < 0)
TEST_ERROR
@@ -2003,7 +2005,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
if(!corked)
TEST_ERROR
-
+
/* Close the dataset */
if(H5Dclose(did1) < 0)
TEST_ERROR
@@ -2053,7 +2055,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Second open of the named datatype */
- if((tid2 = H5Topen2(gid, "datatype", H5P_DEFAULT)) < 0)
+ if((tid2 = H5Topen2(gid, "datatype", H5P_DEFAULT)) < 0)
TEST_ERROR
/* Check cork status of the second opened named datatype */
@@ -2124,7 +2126,7 @@ error:
} /* test_dset_cork() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -2138,12 +2140,12 @@ error:
*
*-------------------------------------------------------------------------
*/
-int
-main(void)
+int
+main(void)
{
unsigned swmr; /* Loop over SWMR/non-SWMR */
unsigned nerrs = 0; /* Error Encountered */
-
+
/* Test for dataset created with old library format */
nerrs += verify_old_dset_cork();
@@ -2158,10 +2160,10 @@ main(void)
/* Tests with/without SWMR access */
nerrs += verify_obj_dset_cork(swmr);
- nerrs += verify_dset_cork(swmr, TRUE);
- nerrs += verify_dset_cork(swmr, FALSE);
- nerrs += verify_group_cork(swmr);
- nerrs += verify_named_cork(swmr);
+ nerrs += verify_dset_cork(swmr, TRUE);
+ nerrs += verify_dset_cork(swmr, FALSE);
+ nerrs += verify_group_cork(swmr);
+ nerrs += verify_named_cork(swmr);
nerrs += verify_multiple_cork(swmr);
} /* end for */
diff --git a/test/cross_read.c b/test/cross_read.c
index 2219151..5444aae 100644
--- a/test/cross_read.c
+++ b/test/cross_read.c
@@ -109,7 +109,7 @@ check_data_i(const char *dsetname, hid_t fid)
if(data_out[i][j] != data_in[i][j])
if(!nerrors++) {
H5_FAILED();
- printf("element [%d][%d] is %lld but should have been %lld\n",
+ HDprintf("element [%d][%d] is %lld but should have been %lld\n",
(int)i, (int)j, data_out[i][j], data_in[i][j]);
} /* end if */
@@ -119,7 +119,7 @@ check_data_i(const char *dsetname, hid_t fid)
/* Failure */
if(nerrors) {
- printf("total of %d errors out of %d elements\n", nerrors, (int)(NX*NY));
+ HDprintf("total of %d errors out of %d elements\n", nerrors, (int)(NX*NY));
return 1;
} /* end if */
@@ -182,7 +182,7 @@ check_data_f(const char *dsetname, hid_t fid)
if(!H5_DBL_REL_EQUAL(data_out[i][j], data_in[i][j], (double)0.001F))
if(!nerrors++) {
H5_FAILED();
- printf("element [%d][%d] is %g but should have been %g\n",
+ HDprintf("element [%d][%d] is %g but should have been %g\n",
(int)i, (int)j, data_out[i][j], data_in[i][j]);
} /* end if */
@@ -192,7 +192,7 @@ check_data_f(const char *dsetname, hid_t fid)
/* Failure */
if(nerrors) {
- printf("total of %d errors out of %d elements\n", nerrors, (int)(NX*NY));
+ HDprintf("total of %d errors out of %d elements\n", nerrors, (int)(NX*NY));
return 1;
} /* end if */
@@ -369,11 +369,11 @@ main(void)
nerrors += check_file(filename);
if(nerrors) {
- printf("***** %d FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S");
+ HDprintf("***** %d FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S");
return EXIT_FAILURE;
} /* end if */
- printf("All data type tests passed.\n");
+ HDprintf("All data type tests passed.\n");
return EXIT_SUCCESS;
} /* end main() */
diff --git a/test/dangle.c b/test/dangle.c
index 75e9c84..9f30f10 100644
--- a/test/dangle.c
+++ b/test/dangle.c
@@ -602,7 +602,8 @@ test_dangle_force(void)
TEST_ERROR;
/* Allocate the array of object IDs */
- objs = (hid_t*)HDmalloc(sizeof(hid_t) * (size_t)count);
+ if(NULL == (objs = (hid_t *)HDcalloc((size_t)count, sizeof(hid_t))))
+ TEST_ERROR;
/* Get the list of open IDs */
if(H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)count, objs) < 0)
diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c
index d88045c..ada7a6f 100644
--- a/test/del_many_dense_attrs.c
+++ b/test/del_many_dense_attrs.c
@@ -41,7 +41,7 @@ const char *FILENAME[] = {
*/
static void catch_signal(int H5_ATTR_UNUSED signo)
{
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* catch_signal() */
diff --git a/test/direct_chunk.c b/test/direct_chunk.c
index 1c5862d..7b17043 100644
--- a/test/direct_chunk.c
+++ b/test/direct_chunk.c
@@ -58,6 +58,14 @@
#define OVERWRITE_CHUNK_NY 2
#define OVERWRITE_VALUE 42
+/* Test configurations */
+#define CONFIG_LATEST 0x01
+#define CONFIG_REOPEN_FILE 0x02
+#define CONFIG_REOPEN_DSET 0x04
+#define CONFIG_DIRECT_WRITE 0x08
+#define CONFIG_DIRECT_READ 0x10
+#define CONFIG_END 0x20
+
/* Defines used in test_single_chunk_latest() */
#define FILE "single_latest.h5"
#define DATASET "dataset"
@@ -1973,7 +1981,7 @@ error:
} /* test_read_unallocated_chunk() */
/*-------------------------------------------------------------------------
- * Function: test_single_chunk_latest
+ * Function: test_single_chunk
*
* Purpose: This is to verify the fix for jira issue HDFFV-10425.
* The problem was due to a bug in the internal ilbrary routine
@@ -1989,27 +1997,31 @@ error:
* index for the dataset.
* Verify that the data read is the same as the written data.
*
+ * Since expanded to test multiple combinations of cases
+ * involving a single chunk
+ *
* Return: Success: 0
* Failure: 1
*
*-------------------------------------------------------------------------
*/
static int
-test_single_chunk_latest(void)
+test_single_chunk(unsigned config)
{
- hid_t fid; /* File ID */
- hid_t fapl; /* File access property list ID */
- hid_t sid; /* Dataspace ID */
- hid_t did; /* Dataset ID */
- hid_t dcpl; /* Dataset creation property list */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
hsize_t dims[2] = {DIM0, DIM1}; /* Dimension sizes */
hsize_t chunk[2] = {CHUNK0, CHUNK1}; /* Chunk dimension sizes */
hsize_t offset[2] = {0,0}; /* Offset for writing */
+ uint32_t filters; /* Filter mask out */
int wdata[DIM0][DIM1]; /* Write buffer */
int rdata[DIM0][DIM1]; /* Read buffer */
int i, j; /* Local index variable */
- TESTING("H5Dwrite_chunk with single chunk and latest format");
+ TESTING("Single chunk I/O");
/* Initialize data */
for (i=0; i<DIM0; i++) {
@@ -2020,8 +2032,9 @@ test_single_chunk_latest(void)
/* Create a new file with the latest format */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
goto error;
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- goto error;
+ if(config & CONFIG_LATEST)
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ goto error;
if((fid = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
@@ -2039,37 +2052,57 @@ test_single_chunk_latest(void)
if((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
- /* Write the data directly to the dataset */
- if(H5Dwrite_chunk(did, H5P_DEFAULT, 0, offset, CHUNK0*CHUNK1*4, (void *)wdata) < 0)
- goto error;
+ if(config & CONFIG_DIRECT_WRITE) {
+ /* Write the data directly to the dataset */
+ if(H5Dwrite_chunk(did, H5P_DEFAULT, 0, offset, CHUNK0*CHUNK1*4, (void *)wdata) < 0)
+ goto error;
+ } /* end if */
+ else
+ /* Write the data to the dataset */
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)wdata) < 0)
+ goto error;
/*
* Close and release resources.
*/
if(H5Pclose(dcpl) < 0)
goto error;
- if(H5Dclose(did) < 0)
- goto error;
+ if(config & CONFIG_REOPEN_DSET)
+ if(H5Dclose(did) < 0)
+ goto error;
if(H5Sclose(sid) < 0)
goto error;
if(H5Pclose(fapl) < 0)
goto error;
- if(H5Fclose(fid) < 0)
- goto error;
+ if(config & CONFIG_REOPEN_FILE)
+ if(H5Fclose(fid) < 0)
+ goto error;
/* Open the file and dataset with default properties */
- if((fid = H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- goto error;
- if((did = H5Dopen2(fid, DATASET, H5P_DEFAULT)) < 0)
- goto error;
+ if(config & CONFIG_REOPEN_FILE)
+ if((fid = H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ goto error;
+ if(config & CONFIG_REOPEN_DSET)
+ if((did = H5Dopen2(fid, DATASET, H5P_DEFAULT)) < 0)
+ goto error;
/* Retrieve dataset creation property list */
if((dcpl = H5Dget_create_plist(did)) < 0)
goto error;
- /* Read the data */
- if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata) < 0)
- goto error;
+ if(config & CONFIG_DIRECT_READ) {
+ /* Read the data directly */
+ if(H5Dread_chunk(did, H5P_DEFAULT, offset, &filters, rdata) < 0)
+ goto error;
+
+ /* Verify returned filter mask */
+ if(filters != 0)
+ goto error;
+ } /* end if */
+ else
+ /* Read the data */
+ if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata) < 0)
+ goto error;
/* Verify that the data read was correct. */
for (i = 0; i < DIM0; i++) {
@@ -2122,6 +2155,7 @@ error:
int main( void )
{
hid_t file_id;
+ unsigned config;
int nerrors=0;
/*
@@ -2149,7 +2183,53 @@ int main( void )
nerrors += test_read_unfiltered_dset(file_id);
nerrors += test_read_unallocated_chunk(file_id);
- nerrors += test_single_chunk_latest();
+ /* Loop over test configurations */
+ for(config = 0; config < CONFIG_END; config++) {
+ hbool_t need_comma = FALSE;
+
+ /* Check for invalid combinations */
+ if((config & CONFIG_REOPEN_FILE) && !(config & CONFIG_REOPEN_DSET))
+ continue;
+
+ /* Print configuration */
+ HDprintf("Configuration: ");
+ if(config == 0)
+ HDprintf("<empty>");
+ if(config & CONFIG_LATEST) {
+ if(need_comma)
+ HDprintf(", ");
+ HDprintf("latest format");
+ need_comma = TRUE;
+ } /* end if */
+ if(config & CONFIG_REOPEN_FILE) {
+ if(need_comma)
+ HDprintf(", ");
+ HDprintf("reopen file");
+ need_comma = TRUE;
+ } /* end if */
+ else if(config & CONFIG_REOPEN_DSET) {
+ if(need_comma)
+ HDprintf(", ");
+ HDprintf("reopen dataset");
+ need_comma = TRUE;
+ } /* end if */
+ if(config & CONFIG_DIRECT_WRITE) {
+ if(need_comma)
+ HDprintf(", ");
+ HDprintf("direct write");
+ need_comma = TRUE;
+ } /* end if */
+ if(config & CONFIG_DIRECT_READ) {
+ if(need_comma)
+ HDprintf(", ");
+ HDprintf("direct read");
+ need_comma = TRUE;
+ } /* end if */
+ HDprintf(":\n");
+ fflush(stdout);
+
+ nerrors += test_single_chunk(config);
+ } /* end for */
if(H5Fclose(file_id) < 0)
goto error;
@@ -2165,3 +2245,4 @@ error:
HDputs("*** TESTS FAILED ***");
return EXIT_FAILURE;
}
+
diff --git a/test/dsets.c b/test/dsets.c
index 9562ec9..66313a5 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -408,7 +408,7 @@ test_create(hid_t file)
} H5E_END_TRY;
if(dataset >= 0) {
H5_FAILED();
- puts(" Library allowed overwrite of existing dataset.");
+ HDputs(" Library allowed overwrite of existing dataset.");
goto error;
}
@@ -430,7 +430,7 @@ test_create(hid_t file)
} H5E_END_TRY;
if(dataset >= 0) {
H5_FAILED();
- puts(" Opened a non-existent dataset.");
+ HDputs(" Opened a non-existent dataset.");
goto error;
}
@@ -452,7 +452,7 @@ test_create(hid_t file)
} H5E_END_TRY;
if(dataset >= 0) {
H5_FAILED();
- puts(" Opened a dataset with incorrect chunking parameters.");
+ HDputs(" Opened a dataset with incorrect chunking parameters.");
goto error;
}
@@ -491,10 +491,10 @@ test_create(hid_t file)
if(H5Dclose(dataset) < 0) goto error;
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_create() */
@@ -573,8 +573,8 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl)
for(j = 0; j < DSET_DIM2; j++) {
if(points[i][j] != check[i][j]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
goto error;
}
}
@@ -597,8 +597,8 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl)
for(j = 0; j < DSET_DIM2; j++) {
if(points[i][j] != rdata[i][j]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
goto error;
}
}
@@ -612,10 +612,10 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl)
} /* end if */
else {
SKIPPED();
- puts(" Current VFD doesn't support continuous address space");
+ HDputs(" Current VFD doesn't support continuous address space");
} /* end else */
- return 0;
+ return SUCCEED;
error:
if(space > 0)
@@ -630,7 +630,7 @@ error:
HDclose(f);
if(tconv_buf)
HDfree(tconv_buf);
- return -1;
+ return FAIL;
} /* end test_simple_io() */
@@ -706,8 +706,8 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
for(j = 0; j < DSET_DIM2; j++) {
if(points[i][j] != rdata[i][j]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
goto error;
}
}
@@ -720,10 +720,10 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
} /* end if */
else {
SKIPPED();
- puts(" Current VFD doesn't support continuous address space");
+ HDputs(" Current VFD doesn't support continuous address space");
} /* end else */
- return 0;
+ return SUCCEED;
error:
if(space > 0)
@@ -736,7 +736,7 @@ error:
if(H5Fclose(file) < 0) TEST_ERROR
if(f > 0)
HDclose(f);
- return -1;
+ return FAIL;
} /* end test_userblock_offset() */
@@ -821,10 +821,10 @@ test_compact_io(hid_t fapl)
for(j = 0; j < 8; j++)
if(rbuf[i][j] != wbuf[i][j]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
- printf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]);
- printf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
+ HDprintf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]);
+ HDprintf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]);
goto error;
} /* end */
@@ -879,10 +879,10 @@ test_compact_io(hid_t fapl)
for(j = 0; j < 8; j++)
if(rbuf[i][j] != wbuf[i][j]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
- printf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]);
- printf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
+ HDprintf(" wbuf[%d][%d]=%d\n", i, j, wbuf[i][j]);
+ HDprintf(" rbuf[%d][%d]=%d\n", i, j, rbuf[i][j]);
goto error;
} /* end */
@@ -917,7 +917,7 @@ test_compact_io(hid_t fapl)
if(H5Pclose(plist) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -929,7 +929,7 @@ test_compact_io(hid_t fapl)
H5Fclose(verfile);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_compact_io() */
@@ -1020,8 +1020,8 @@ test_max_compact(hid_t fapl)
for(u = 0; u < compact_size; u++)
if(rbuf[u] != wbuf[u]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %u\n", (unsigned)u);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %u\n", (unsigned)u);
goto error;
} /* end if */
@@ -1066,7 +1066,7 @@ test_max_compact(hid_t fapl)
FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
if(wbuf)
@@ -1082,7 +1082,7 @@ error:
H5Fclose(file);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_max_compact() */
@@ -1191,7 +1191,7 @@ test_layout_extend(hid_t fapl)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -1205,7 +1205,7 @@ error:
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_layout_extend() */
@@ -1240,14 +1240,19 @@ test_conv_buffer(hid_t fid)
CmpField *cf = NULL;
CmpFieldR *cfrR = NULL;
- hid_t dataset = -1; /* dataset ID */
- hid_t space = -1; /* data space ID */
- hid_t ctype1, ctype2; /* data type ID */
- hid_t arr_type1, arr_type2, arr_type3, arr_type4, arr_type5;
+ hid_t dataset = H5I_INVALID_HID; /* dataset ID */
+ hid_t space = H5I_INVALID_HID; /* data space ID */
+ hid_t ctype1 = H5I_INVALID_HID,
+ ctype2 = H5I_INVALID_HID; /* data type ID */
+ hid_t arr_type1 = H5I_INVALID_HID,
+ arr_type2 = H5I_INVALID_HID,
+ arr_type3 = H5I_INVALID_HID,
+ arr_type4 = H5I_INVALID_HID,
+ arr_type5 = H5I_INVALID_HID;
hsize_t dimsa[3];
hsize_t dimsb[1];
hsize_t dimsc[1];
- hid_t xfer_list;
+ hid_t xfer_list = H5I_INVALID_HID;
size_t size;
TESTING("data type conversion buffer size");
@@ -1315,7 +1320,7 @@ test_conv_buffer(hid_t fid)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Library shouldn't allow conversion buffer too small");
+ HDputs(" Library shouldn't allow conversion buffer too small");
goto error;
}
@@ -1340,11 +1345,24 @@ test_conv_buffer(hid_t fid)
HDfree(cf);
HDfree(cfrR);
- puts(" PASSED");
- return 0;
+ HDputs(" PASSED");
+ return SUCCEED;
error:
- return -1;
+ H5E_BEGIN_TRY {
+ H5Pclose(xfer_list);
+ H5Sclose(space);
+ H5Tclose(arr_type1);
+ H5Tclose(arr_type2);
+ H5Tclose(arr_type3);
+ H5Tclose(ctype1);
+ H5Tclose(ctype2);
+ H5Tclose(arr_type4);
+ H5Tclose(arr_type5);
+ H5Dclose(dataset);
+ } H5E_END_TRY;
+
+ return FAIL;
} /* end test_conv_buffer() */
@@ -1404,7 +1422,7 @@ test_tconv(hid_t file)
in[4 * i + 2] != out[4 * i + 1] ||
in[4 * i + 3] != out[4 * i + 0]) {
H5_FAILED();
- puts(" Read with byte order conversion failed.");
+ HDputs(" Read with byte order conversion failed.");
goto error;
}
}
@@ -1414,8 +1432,8 @@ test_tconv(hid_t file)
HDfree(out);
HDfree(in);
- puts(" PASSED");
- return 0;
+ HDputs(" PASSED");
+ return SUCCEED;
error:
if(out)
@@ -1428,7 +1446,7 @@ error:
H5Sclose(space);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_tconv() */
/* This message derives from H5Z */
@@ -1760,7 +1778,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
/* Check if all the filters are available */
if(H5Pall_filters_avail(dcpl)!=TRUE) {
H5_FAILED();
- printf(" Line %d: Incorrect filter availability\n",__LINE__);
+ HDprintf(" Line %d: Incorrect filter availability\n",__LINE__);
goto error;
} /* end if */
@@ -1783,8 +1801,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
for(j=0; j<(size_t)size[1]; j++) {
if(0!=check[i][j]) {
H5_FAILED();
- printf(" Read a non-zero value.\n");
- printf(" At index %lu,%lu\n",
+ HDprintf(" Read a non-zero value.\n");
+ HDprintf(" At index %lu,%lu\n",
(unsigned long)i, (unsigned long)j);
goto error;
}
@@ -1849,10 +1867,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
for(j=0; j<size[1]; j++) {
if(points[i][j] != check[i][j]) {
H5_FAILED();
- fprintf(stderr," Read different values than written.\n");
- fprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
- fprintf(stderr," At original: %d\n", (int)points[i][j]);
- fprintf(stderr," At returned: %d\n", (int)check[i][j]);
+ HDfprintf(stderr," Read different values than written.\n");
+ HDfprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ HDfprintf(stderr," At original: %d\n", (int)points[i][j]);
+ HDfprintf(stderr," At returned: %d\n", (int)check[i][j]);
goto error;
}
}
@@ -1909,8 +1927,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
for(j=0; j<size[1]; j++) {
if(points[i][j] != check[i][j]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n",
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n",
(unsigned long)i, (unsigned long)j);
goto error;
}
@@ -1963,8 +1981,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
for(j = 0; j < size[1]; j++)
if(points[i][j] != check[i][j]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n",
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n",
(unsigned long)i, (unsigned long)j);
goto error;
} /* end if */
@@ -2023,13 +2041,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] !=
check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) {
H5_FAILED();
- fprintf(stderr," Read different values than written.\n");
- fprintf(stderr," At index %lu,%lu\n",
+ HDfprintf(stderr," Read different values than written.\n");
+ HDfprintf(stderr," At index %lu,%lu\n",
(unsigned long)((size_t)hs_offset[0]+i),
(unsigned long)((size_t)hs_offset[1]+j));
- fprintf(stderr," At original: %d\n",
+ HDfprintf(stderr," At original: %d\n",
(int)points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]);
- fprintf(stderr," At returned: %d\n",
+ HDfprintf(stderr," At returned: %d\n",
(int)check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]);
goto error;
}
@@ -2049,12 +2067,12 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if(H5Pclose (write_dxpl) < 0) goto error;
HDfree (tconv_buf);
- return(0);
+ return SUCCEED;
error:
if(tconv_buf)
HDfree (tconv_buf);
- return -1;
+ return FAIL;
} /* end test_filter_internal() */
/*-------------------------------------------------------------------------
@@ -2157,7 +2175,7 @@ test_filter_noencoder(const char *dset_name)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5_FAILED();
@@ -2172,7 +2190,7 @@ error:
if(file_id != -1)
H5Fclose(file_id);
- return -1;
+ return FAIL;
} /* end test_filter_noencoder() */
#endif /* H5_HAVE_FILTER_SZIP */
@@ -2239,10 +2257,10 @@ test_get_filter_info(void)
if(err >= 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_get_filter_info() */
/*-------------------------------------------------------------------------
@@ -2291,7 +2309,7 @@ H5_ATTR_UNUSED
* STEP 0: Test null I/O filter by itself.
*----------------------------------------------------------
*/
- puts("Testing 'null' filter");
+ HDputs("Testing 'null' filter");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
if(H5Zregister (H5Z_BOGUS) < 0) goto error;
@@ -2306,7 +2324,7 @@ H5_ATTR_UNUSED
* STEP 1: Test Fletcher32 Checksum by itself.
*----------------------------------------------------------
*/
- puts("Testing Fletcher32 checksum(enabled for read)");
+ HDputs("Testing Fletcher32 checksum(enabled for read)");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
if(H5Pset_filter(dc, H5Z_FILTER_FLETCHER32, 0, (size_t)0, NULL) < 0) goto error;
@@ -2315,21 +2333,21 @@ H5_ATTR_UNUSED
if(test_filter_internal(file,DSET_FLETCHER32_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&fletcher32_size) < 0) goto error;
if(fletcher32_size<=null_size) {
H5_FAILED();
- puts(" Size after checksumming is incorrect.");
+ HDputs(" Size after checksumming is incorrect.");
goto error;
} /* end if */
/* Disable checksum during read */
- puts("Testing Fletcher32 checksum(disabled for read)");
+ HDputs("Testing Fletcher32 checksum(disabled for read)");
if(test_filter_internal(file,DSET_FLETCHER32_NAME_2,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&fletcher32_size) < 0) goto error;
if(fletcher32_size<=null_size) {
H5_FAILED();
- puts(" Size after checksumming is incorrect.");
+ HDputs(" Size after checksumming is incorrect.");
goto error;
} /* end if */
/* Try to corrupt data and see if checksum fails */
- puts("Testing Fletcher32 checksum(when data is corrupted)");
+ HDputs("Testing Fletcher32 checksum(when data is corrupted)");
data_corrupt[0] = 52;
data_corrupt[1] = 33;
data_corrupt[2] = 27;
@@ -2339,7 +2357,7 @@ H5_ATTR_UNUSED
if(test_filter_internal(file,DSET_FLETCHER32_NAME_3,dc,DISABLE_FLETCHER32,DATA_CORRUPTED,&fletcher32_size) < 0) goto error;
if(fletcher32_size<=null_size) {
H5_FAILED();
- puts(" Size after checksumming is incorrect.");
+ HDputs(" Size after checksumming is incorrect.");
goto error;
} /* end if */
@@ -2352,7 +2370,7 @@ H5_ATTR_UNUSED
*----------------------------------------------------------
*/
#ifdef H5_HAVE_FILTER_DEFLATE
- puts("Testing deflate filter");
+ HDputs("Testing deflate filter");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
if(H5Pset_deflate (dc, 6) < 0) goto error;
@@ -2363,7 +2381,7 @@ H5_ATTR_UNUSED
#else /* H5_HAVE_FILTER_DEFLATE */
TESTING("deflate filter");
SKIPPED();
- puts(" Deflate filter not enabled");
+ HDputs(" Deflate filter not enabled");
#endif /* H5_HAVE_FILTER_DEFLATE */
/*----------------------------------------------------------
@@ -2376,7 +2394,7 @@ H5_ATTR_UNUSED
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- puts("");
+ HDputs("");
if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size) < 0) goto error;
if(H5Pclose (dc) < 0) goto error;
@@ -2388,7 +2406,7 @@ H5_ATTR_UNUSED
TESTING("szip filter (without encoder)");
if( h5_szip_can_encode() != 1) {
- puts("");
+ HDputs("");
if(test_filter_noencoder(NOENCODER_SZIP_DATASET) < 0) goto error;
}
else {
@@ -2398,14 +2416,14 @@ H5_ATTR_UNUSED
#else /* H5_HAVE_FILTER_SZIP */
TESTING("szip filter");
SKIPPED();
- puts(" Szip filter not enabled");
+ HDputs(" Szip filter not enabled");
#endif /* H5_HAVE_FILTER_SZIP */
/*----------------------------------------------------------
* STEP 4: Test shuffling by itself.
*----------------------------------------------------------
*/
- puts("Testing shuffle filter");
+ HDputs("Testing shuffle filter");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
if(H5Pset_shuffle (dc) < 0) goto error;
@@ -2413,7 +2431,7 @@ H5_ATTR_UNUSED
if(test_filter_internal(file,DSET_SHUFFLE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&shuffle_size) < 0) goto error;
if(shuffle_size!=null_size) {
H5_FAILED();
- puts(" Shuffled size not the same as uncompressed size.");
+ HDputs(" Shuffled size not the same as uncompressed size.");
goto error;
} /* end if */
@@ -2425,7 +2443,7 @@ H5_ATTR_UNUSED
*----------------------------------------------------------
*/
#ifdef H5_HAVE_FILTER_DEFLATE
- puts("Testing shuffle+deflate+checksum filters(checksum first)");
+ HDputs("Testing shuffle+deflate+checksum filters(checksum first)");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
if(H5Pset_fletcher32 (dc) < 0) goto error;
@@ -2437,7 +2455,7 @@ H5_ATTR_UNUSED
/* Clean up objects used for this test */
if(H5Pclose (dc) < 0) goto error;
- puts("Testing shuffle+deflate+checksum filters(checksum last)");
+ HDputs("Testing shuffle+deflate+checksum filters(checksum last)");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
if(H5Pset_shuffle (dc) < 0) goto error;
@@ -2451,7 +2469,7 @@ H5_ATTR_UNUSED
#else /* H5_HAVE_FILTER_DEFLATE */
TESTING("shuffle+deflate+fletcher32 filters");
SKIPPED();
- puts(" Deflate filter not enabled");
+ HDputs(" Deflate filter not enabled");
#endif /* H5_HAVE_FILTER_DEFLATE */
/*----------------------------------------------------------
@@ -2468,7 +2486,7 @@ H5_ATTR_UNUSED
/* Make sure encoding is enabled */
if( h5_szip_can_encode() == 1) {
- puts("");
+ HDputs("");
if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
}
@@ -2479,7 +2497,7 @@ H5_ATTR_UNUSED
TESTING("shuffle+szip+checksum filters(checksum first, without encoder)");
if( h5_szip_can_encode() != 1) {
- puts("");
+ HDputs("");
if(test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET) < 0) goto error;
}
else {
@@ -2493,7 +2511,7 @@ H5_ATTR_UNUSED
/* Make sure encoding is enabled */
if( h5_szip_can_encode() == 1) {
- puts("");
+ HDputs("");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
if(H5Pset_shuffle (dc) < 0) goto error;
@@ -2512,12 +2530,12 @@ H5_ATTR_UNUSED
#else /* H5_HAVE_FILTER_SZIP */
TESTING("shuffle+szip+fletcher32 filters");
SKIPPED();
- puts(" szip filter not enabled");
+ HDputs(" szip filter not enabled");
#endif /* H5_HAVE_FILTER_SZIP */
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_filters() */
@@ -2526,8 +2544,7 @@ error:
*
* Purpose: Tests library behavior when filter is missing
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2552,7 +2569,7 @@ test_missing_filter(hid_t file)
/* Verify deflate filter is registered currently */
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE)!=TRUE) {
H5_FAILED();
- printf(" Line %d: Deflate filter not available\n",__LINE__);
+ HDprintf(" Line %d: Deflate filter not available\n",__LINE__);
goto error;
} /* end if */
@@ -2564,31 +2581,31 @@ test_missing_filter(hid_t file)
/* (Use private routine, to avoid range checking on filter ID) */
if(H5Z__unregister(H5Z_FILTER_DEFLATE) < 0) {
H5_FAILED();
- printf(" Line %d: Can't unregister deflate filter\n",__LINE__);
+ HDprintf(" Line %d: Can't unregister deflate filter\n",__LINE__);
goto error;
} /* end if */
#endif /* H5_HAVE_FILTER_DEFLATE */
/* Verify deflate filter is not registered currently */
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE)!=FALSE) {
H5_FAILED();
- printf(" Line %d: Deflate filter available\n",__LINE__);
+ HDprintf(" Line %d: Deflate filter available\n",__LINE__);
goto error;
} /* end if */
/* Create dcpl with deflate filter */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't create dcpl\n",__LINE__);
goto error;
} /* end if */
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set chunk sizes\n",__LINE__);
+ HDprintf(" Line %d: Can't set chunk sizes\n",__LINE__);
goto error;
} /* end if */
if(H5Pset_deflate(dcpl, 9) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set deflate filter\n",__LINE__);
+ HDprintf(" Line %d: Can't set deflate filter\n",__LINE__);
goto error;
} /* end if */
@@ -2596,47 +2613,47 @@ test_missing_filter(hid_t file)
ret=H5Pall_filters_avail(dcpl);
if(ret<0) {
H5_FAILED();
- printf(" Line %d: Can't check filter availability\n",__LINE__);
+ HDprintf(" Line %d: Can't check filter availability\n",__LINE__);
goto error;
} /* end if */
if(ret!=FALSE) {
H5_FAILED();
- printf(" Line %d: Filter shouldn't be available\n",__LINE__);
+ HDprintf(" Line %d: Filter shouldn't be available\n",__LINE__);
goto error;
} /* end if */
/* Create the data space */
if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create new dataset */
if((dsid = H5Dcreate2(file, DSET_MISSING_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
- printf(" Line %d: Error writing dataset data\n",__LINE__);
+ HDprintf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Flush the file (to clear the cache) */
if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
H5_FAILED();
- printf(" Line %d: Error flushing file\n",__LINE__);
+ HDprintf(" Line %d: Error flushing file\n",__LINE__);
goto error;
} /* end if */
/* Query the dataset's size on disk */
if(0 == (dset_size = H5Dget_storage_size(dsid))) {
H5_FAILED();
- printf(" Line %d: Error querying dataset size, dset_size=%lu\n",__LINE__,(unsigned long)dset_size);
+ HDprintf(" Line %d: Error querying dataset size, dset_size=%lu\n",__LINE__,(unsigned long)dset_size);
goto error;
} /* end if */
@@ -2644,14 +2661,14 @@ test_missing_filter(hid_t file)
/* (i.e. the deflation filter we asked for was silently ignored) */
if((H5Tget_size(H5T_NATIVE_INT) * DSET_DIM1 * DSET_DIM2) != dset_size) {
H5_FAILED();
- printf(" Line %d: Incorrect dataset size: %lu\n",__LINE__,(unsigned long)dset_size);
+ HDprintf(" Line %d: Incorrect dataset size: %lu\n",__LINE__,(unsigned long)dset_size);
goto error;
} /* end if */
/* Read data */
if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
H5_FAILED();
- printf(" Line %d: Error reading dataset data\n",__LINE__);
+ HDprintf(" Line %d: Error reading dataset data\n",__LINE__);
goto error;
} /* end if */
@@ -2661,10 +2678,10 @@ test_missing_filter(hid_t file)
for(j=0; j<(size_t)dims[1]; j++) {
if(points[i][j] != check[i][j]) {
H5_FAILED();
- printf(" Line %d: Read different values than written.\n",__LINE__);
- printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
- printf(" At original: %d\n",points[i][j]);
- printf(" At returned: %d\n",check[i][j]);
+ HDprintf(" Line %d: Read different values than written.\n",__LINE__);
+ HDprintf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
+ HDprintf(" At original: %d\n",points[i][j]);
+ HDprintf(" At returned: %d\n",check[i][j]);
goto error;
} /* end if */
} /* end for */
@@ -2673,21 +2690,21 @@ test_missing_filter(hid_t file)
/* Close dataset */
if(H5Dclose(dsid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close dataspace */
if(H5Sclose(sid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataspace\n",__LINE__);
goto error;
} /* end if */
/* Close dataset creation property list */
if(H5Pclose(dcpl) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't close dcpl\n",__LINE__);
goto error;
} /* end if */
@@ -2697,14 +2714,14 @@ test_missing_filter(hid_t file)
/* Open existing file */
if((fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open existing deflated file\n", __LINE__);
+ HDprintf(" Line %d: Can't open existing deflated file\n", __LINE__);
goto error;
} /* end if */
/* Open dataset */
if((dsid = H5Dopen2(fid, "Dataset1", H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open dataset\n", __LINE__);
+ HDprintf(" Line %d: Can't open dataset\n", __LINE__);
goto error;
} /* end if */
@@ -2714,21 +2731,21 @@ test_missing_filter(hid_t file)
} H5E_END_TRY;
if(ret>=0) {
H5_FAILED();
- printf(" Line %d: Should not be able to read dataset data\n", __LINE__);
+ HDprintf(" Line %d: Should not be able to read dataset data\n", __LINE__);
goto error;
} /* end if */
/* Close dataset */
if(H5Dclose(dsid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataset\n", __LINE__);
+ HDprintf(" Line %d: Can't close dataset\n", __LINE__);
goto error;
} /* end if */
/* Close existing file */
if(H5Fclose(fid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close file\n", __LINE__);
+ HDprintf(" Line %d: Can't close file\n", __LINE__);
goto error;
} /* end if */
@@ -2736,21 +2753,21 @@ test_missing_filter(hid_t file)
/* Verify deflate filter is not registered currently */
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE)!=FALSE) {
H5_FAILED();
- printf(" Line %d: Deflate filter available\n",__LINE__);
+ HDprintf(" Line %d: Deflate filter available\n",__LINE__);
goto error;
} /* end if */
#ifdef H5_HAVE_FILTER_DEFLATE
/* Register deflate filter (use internal function to avoid range checks) */
if(H5Z_register(H5Z_DEFLATE) < 0) {
H5_FAILED();
- printf(" Line %d: Can't unregister deflate filter\n",__LINE__);
+ HDprintf(" Line %d: Can't unregister deflate filter\n",__LINE__);
goto error;
} /* end if */
/* Verify deflate filter is registered currently */
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE)!=TRUE) {
H5_FAILED();
- printf(" Line %d: Deflate filter not available\n",__LINE__);
+ HDprintf(" Line %d: Deflate filter not available\n",__LINE__);
goto error;
} /* end if */
#endif /* H5_HAVE_FILTER_DEFLATE */
@@ -2760,13 +2777,13 @@ test_missing_filter(hid_t file)
api_ctx_pushed = FALSE;
PASSED();
- return 0;
+ return SUCCEED;
error:
if(api_ctx_pushed) H5CX_pop();
- return -1;
-}
+ return FAIL;
+} /* end test_missing_filter() */
/*-------------------------------------------------------------------------
@@ -2837,8 +2854,8 @@ test_onebyte_shuffle(hid_t file)
for(j=0; j<(size_t)size[1]; j++) {
if(new_data[i][j] != orig_data[i][j]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n",
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n",
(unsigned long)i, (unsigned long)j);
goto error;
}
@@ -2854,10 +2871,10 @@ test_onebyte_shuffle(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_onebyte_shuffle() */
@@ -2883,7 +2900,7 @@ test_nbit_int(hid_t file)
double power;
size_t i, j;
- puts("Testing nbit filter");
+ HDputs("Testing nbit filter");
TESTING(" nbit int (setup)");
/* Define dataset datatype (integer), and set precision, offset */
@@ -2953,8 +2970,8 @@ test_nbit_int(hid_t file)
for(j=0; j<(size_t)size[1]; j++) {
if(((unsigned)new_data[i][j] & mask) != ((unsigned)orig_data[i][j] & mask)) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
goto error;
}
}
@@ -2972,10 +2989,10 @@ test_nbit_int(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_nbit_int() */
@@ -3068,8 +3085,8 @@ test_nbit_float(hid_t file)
continue; /* skip if value is NaN */
if(!H5_FLT_ABS_EQUAL(new_data[i][j], orig_data[i][j])) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
goto error;
}
}
@@ -3090,10 +3107,10 @@ test_nbit_float(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_nbit_float() */
@@ -3200,8 +3217,8 @@ test_nbit_double(hid_t file)
continue; /* skip if value is NaN */
if(!H5_DBL_ABS_EQUAL(new_data[i][j], orig_data[i][j])) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
goto error;
}
}
@@ -3222,10 +3239,10 @@ test_nbit_double(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_nbit_double() */
@@ -3328,8 +3345,8 @@ test_nbit_array(hid_t file)
for(n = 0; n < (size_t)adims[1]; n++) {
if(new_data[i][j][m][n]!= orig_data[i][j][m][n]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu,%lu,%lu\n",
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu,%lu,%lu\n",
(unsigned long)i, (unsigned long)j, (unsigned long)m, (unsigned long)n);
goto error;
}
@@ -3349,10 +3366,10 @@ test_nbit_array(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_nbit_array() */
@@ -3534,8 +3551,8 @@ test_nbit_compound(hid_t file)
(orig_data[i][j].f == orig_data[i][j].f && !H5_FLT_ABS_EQUAL(new_data[i][j].f, orig_data[i][j].f)))
{
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
goto error;
}
}
@@ -3566,10 +3583,10 @@ test_nbit_compound(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_nbit_compound() */
@@ -3865,8 +3882,8 @@ out:
(new_data[i][j].a.f == new_data[i][j].a.f && !H5_FLT_ABS_EQUAL(new_data[i][j].a.f, new_data[i][j].a.f)) ||
new_data[i][j].v != orig_data[i][j].v || b_failed || d_failed) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
goto error;
}
}
@@ -3911,10 +3928,10 @@ out:
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_nbit_compound_2() */
@@ -4048,8 +4065,8 @@ test_nbit_compound_3(hid_t file)
new_data[i].r != orig_data[i].r)
{
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu\n", (unsigned long)i);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu\n", (unsigned long)i);
goto error;
}
@@ -4057,8 +4074,8 @@ test_nbit_compound_3(hid_t file)
if(((unsigned int *)orig_data[i].v.p)[k] !=((unsigned int *)new_data[i].v.p)[k])
{
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu\n", (unsigned long)i);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu\n", (unsigned long)i);
goto error;
}
@@ -4066,8 +4083,8 @@ test_nbit_compound_3(hid_t file)
if(orig_data[i].o[j] != new_data[i].o[j])
{
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu\n", (unsigned long)i);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu\n", (unsigned long)i);
goto error;
}
}
@@ -4091,10 +4108,10 @@ test_nbit_compound_3(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_nbit_compound_3() */
@@ -4128,41 +4145,41 @@ test_nbit_int_size(hid_t file)
/* Define dataset datatype (integer), and set precision, offset */
if((datatype = H5Tcopy(H5T_NATIVE_INT)) < 0) {
H5_FAILED();
- printf(" line %d: H5Tcopy failed\n",__LINE__);
+ HDprintf(" line %d: H5Tcopy failed\n",__LINE__);
goto error;
} /* end if */
precision = 16; /* precision includes sign bit */
if(H5Tset_precision(datatype,precision)<0) {
H5_FAILED();
- printf(" line %d: H5Pset_precision failed\n",__LINE__);
+ HDprintf(" line %d: H5Pset_precision failed\n",__LINE__);
goto error;
} /* end if */
offset = 8;
if(H5Tset_offset(datatype,offset)<0) {
H5_FAILED();
- printf(" line %d: H5Tset_offset failed\n",__LINE__);
+ HDprintf(" line %d: H5Tset_offset failed\n",__LINE__);
goto error;
} /* end if */
/* Copy to memory datatype */
if((mem_datatype = H5Tcopy(datatype)) < 0) {
H5_FAILED();
- printf(" line %d: H5Tcopy failed\n",__LINE__);
+ HDprintf(" line %d: H5Tcopy failed\n",__LINE__);
goto error;
} /* end if */
/* Set order of dataset datatype */
if(H5Tset_order(datatype, H5T_ORDER_BE)<0) {
H5_FAILED();
- printf(" line %d: H5Pset_order failed\n",__LINE__);
+ HDprintf(" line %d: H5Pset_order failed\n",__LINE__);
goto error;
} /* end if */
if(H5Tset_size(datatype, 4)<0) {
H5_FAILED();
- printf(" line %d: H5Pset_size failed\n",__LINE__);
+ HDprintf(" line %d: H5Pset_size failed\n",__LINE__);
goto error;
} /* end if */
@@ -4181,7 +4198,7 @@ test_nbit_int_size(hid_t file)
dims[1] = DSET_DIM2;
if((dataspace = H5Screate_simple (2, dims, NULL))<0) {
H5_FAILED();
- printf(" line %d: H5Pcreate failed\n",__LINE__);
+ HDprintf(" line %d: H5Pcreate failed\n",__LINE__);
goto error;
} /* end if */
@@ -4192,13 +4209,13 @@ test_nbit_int_size(hid_t file)
chunk_size[1] = DSET_DIM2/10;
if((dset_create_props = H5Pcreate (H5P_DATASET_CREATE))<0) {
H5_FAILED();
- printf(" line %d: H5Pcreate failed\n",__LINE__);
+ HDprintf(" line %d: H5Pcreate failed\n",__LINE__);
goto error;
} /* end if */
if(H5Pset_chunk (dset_create_props, 2, chunk_size)<0) {
H5_FAILED();
- printf(" line %d: H5Pset_chunk failed\n",__LINE__);
+ HDprintf(" line %d: H5Pset_chunk failed\n",__LINE__);
goto error;
} /* end if */
@@ -4207,7 +4224,7 @@ test_nbit_int_size(hid_t file)
*/
if(H5Pset_nbit (dset_create_props)<0) {
H5_FAILED();
- printf(" line %d: H5Pset_nbit failed\n",__LINE__);
+ HDprintf(" line %d: H5Pset_nbit failed\n",__LINE__);
goto error;
} /* end if */
@@ -4218,7 +4235,7 @@ test_nbit_int_size(hid_t file)
dataspace, H5P_DEFAULT,
dset_create_props, H5P_DEFAULT))<0) {
H5_FAILED();
- printf(" line %d: H5dwrite failed\n",__LINE__);
+ HDprintf(" line %d: H5dwrite failed\n",__LINE__);
goto error;
} /* end if */
@@ -4228,7 +4245,7 @@ test_nbit_int_size(hid_t file)
if(H5Dwrite (dataset, mem_datatype, H5S_ALL, H5S_ALL,
H5P_DEFAULT, orig_data)<0) {
H5_FAILED();
- printf(" Line %d: H5Dwrite failed\n",__LINE__);
+ HDprintf(" Line %d: H5Dwrite failed\n",__LINE__);
goto error;
} /* end if */
@@ -4237,7 +4254,7 @@ test_nbit_int_size(hid_t file)
*/
if((precision = H5Tget_precision(datatype)) == 0) {
H5_FAILED();
- printf(" Line %d: wrong precision size: %zu\n",__LINE__, precision);
+ HDprintf(" Line %d: wrong precision size: %zu\n",__LINE__, precision);
goto error;
} /* end if */
@@ -4259,9 +4276,9 @@ test_nbit_int_size(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_nbit_int_size() */
@@ -4317,7 +4334,7 @@ test_nbit_flt_size(hid_t file)
*-------------------------------------------------------------------*/
if((datatype = H5Tcopy(H5T_IEEE_F32LE)) < 0) {
H5_FAILED();
- printf(" line %d: H5Tcopy failed\n",__LINE__);
+ HDprintf(" line %d: H5Tcopy failed\n",__LINE__);
goto error;
} /* end if */
@@ -4331,38 +4348,38 @@ test_nbit_flt_size(hid_t file)
if(H5Tset_fields(datatype, spos, epos, esize, mpos, msize)<0) {
H5_FAILED();
- printf(" line %d: H5Tset_fields failed\n",__LINE__);
+ HDprintf(" line %d: H5Tset_fields failed\n",__LINE__);
goto error;
} /* end if */
if(H5Tset_offset(datatype,offset)<0) {
H5_FAILED();
- printf(" line %d: H5Tset_offset failed\n",__LINE__);
+ HDprintf(" line %d: H5Tset_offset failed\n",__LINE__);
goto error;
} /* end if */
if(H5Tset_precision(datatype,precision)<0) {
H5_FAILED();
- printf(" line %d: H5Tset_precision failed\n",__LINE__);
+ HDprintf(" line %d: H5Tset_precision failed\n",__LINE__);
goto error;
} /* end if */
if(H5Tset_size(datatype, 4)<0) {
H5_FAILED();
- printf(" line %d: H5Pset_size failed\n",__LINE__);
+ HDprintf(" line %d: H5Pset_size failed\n",__LINE__);
goto error;
} /* end if */
/* Set order of dataset datatype */
if(H5Tset_order(datatype, H5T_ORDER_BE)<0) {
H5_FAILED();
- printf(" line %d: H5Pset_order failed\n",__LINE__);
+ HDprintf(" line %d: H5Pset_order failed\n",__LINE__);
goto error;
} /* end if */
if(H5Tset_ebias(datatype, 31)<0) {
H5_FAILED();
- printf(" line %d: H5Pset_size failed\n",__LINE__);
+ HDprintf(" line %d: H5Pset_size failed\n",__LINE__);
goto error;
} /* end if */
@@ -4379,7 +4396,7 @@ test_nbit_flt_size(hid_t file)
dims[1] = DSET_DIM2;
if((dataspace = H5Screate_simple (2, dims, NULL))<0) {
H5_FAILED();
- printf(" line %d: H5Pcreate failed\n",__LINE__);
+ HDprintf(" line %d: H5Pcreate failed\n",__LINE__);
goto error;
} /* end if */
@@ -4390,13 +4407,13 @@ test_nbit_flt_size(hid_t file)
chunk_size[1] = DSET_DIM2/10;
if((dset_create_props = H5Pcreate (H5P_DATASET_CREATE))<0) {
H5_FAILED();
- printf(" line %d: H5Pcreate failed\n",__LINE__);
+ HDprintf(" line %d: H5Pcreate failed\n",__LINE__);
goto error;
} /* end if */
if(H5Pset_chunk (dset_create_props, 2, chunk_size)<0) {
H5_FAILED();
- printf(" line %d: H5Pset_chunk failed\n",__LINE__);
+ HDprintf(" line %d: H5Pset_chunk failed\n",__LINE__);
goto error;
} /* end if */
@@ -4405,7 +4422,7 @@ test_nbit_flt_size(hid_t file)
*/
if(H5Pset_nbit (dset_create_props)<0) {
H5_FAILED();
- printf(" line %d: H5Pset_nbit failed\n",__LINE__);
+ HDprintf(" line %d: H5Pset_nbit failed\n",__LINE__);
goto error;
} /* end if */
@@ -4416,7 +4433,7 @@ test_nbit_flt_size(hid_t file)
dataspace, H5P_DEFAULT,
dset_create_props, H5P_DEFAULT))<0) {
H5_FAILED();
- printf(" line %d: H5dwrite failed\n",__LINE__);
+ HDprintf(" line %d: H5dwrite failed\n",__LINE__);
goto error;
} /* end if */
@@ -4426,7 +4443,7 @@ test_nbit_flt_size(hid_t file)
if(H5Dwrite (dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, orig_data)<0) {
H5_FAILED();
- printf(" Line %d: H5Dwrite failed\n",__LINE__);
+ HDprintf(" Line %d: H5Dwrite failed\n",__LINE__);
goto error;
} /* end if */
@@ -4435,7 +4452,7 @@ test_nbit_flt_size(hid_t file)
*/
if((precision = H5Tget_precision(datatype)) == 0) {
H5_FAILED();
- printf(" Line %d: wrong precision size: %zu\n",__LINE__, precision);
+ HDprintf(" Line %d: wrong precision size: %zu\n",__LINE__, precision);
goto error;
} /* end if */
@@ -4456,9 +4473,9 @@ test_nbit_flt_size(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_nbit_flt_size() */
/*-------------------------------------------------------------------------
@@ -4486,7 +4503,7 @@ test_scaleoffset_int(hid_t file)
int new_data[2][5];
size_t i, j;
- puts("Testing scaleoffset filter");
+ HDputs("Testing scaleoffset filter");
TESTING(" scaleoffset int without fill value (setup)");
datatype = H5Tcopy(H5T_NATIVE_INT);
@@ -4549,8 +4566,8 @@ test_scaleoffset_int(hid_t file)
for(j=0; j<(size_t)size[1]; j++) {
if(new_data[i][j] != orig_data[i][j]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
goto error;
}
}
@@ -4567,9 +4584,9 @@ test_scaleoffset_int(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_scaleoffset_int() */
@@ -4678,8 +4695,8 @@ test_scaleoffset_int_2(hid_t file)
for(j=0; j<(size_t)size[1]; j++) {
if(new_data[0][j] != orig_data[0][j]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
goto error;
}
}
@@ -4695,9 +4712,9 @@ test_scaleoffset_int_2(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_scaleoffset_int_2() */
@@ -4790,8 +4807,8 @@ test_scaleoffset_float(hid_t file)
for(j=0; j<(size_t)size[1]; j++) {
if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0F, -3.0F)) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
goto error;
}
}
@@ -4808,9 +4825,9 @@ test_scaleoffset_float(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_scaleoffset_float() */
@@ -4921,8 +4938,8 @@ test_scaleoffset_float_2(hid_t file)
for(j=0; j<(size_t)size[1]; j++) {
if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0F, -3.0F)) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
goto error;
}
}
@@ -4937,9 +4954,9 @@ test_scaleoffset_float_2(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_scaleoffset_float_2() */
@@ -5032,8 +5049,8 @@ test_scaleoffset_double(hid_t file)
for(j=0; j<(size_t)size[1]; j++) {
if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0F, -7.0F)) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
goto error;
}
}
@@ -5050,9 +5067,9 @@ test_scaleoffset_double(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_scaleoffset_double() */
@@ -5163,8 +5180,8 @@ test_scaleoffset_double_2(hid_t file)
for(j=0; j<(size_t)size[1]; j++) {
if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0F, -7.0F)) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
goto error;
}
}
@@ -5180,9 +5197,9 @@ test_scaleoffset_double_2(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_scaleoffset_double_2() */
@@ -5230,7 +5247,7 @@ test_multiopen (hid_t file)
if(H5Sget_simple_extent_dims(space, tmp_size, NULL) < 0) goto error;
if(cur_size[0] != tmp_size[0]) {
H5_FAILED();
- printf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]);
+ HDprintf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]);
goto error;
} /* end if */
@@ -5240,17 +5257,17 @@ test_multiopen (hid_t file)
if(H5Pclose(dcpl) < 0) goto error;
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Dclose(dset1);
- H5Dclose(dset2);
- H5Sclose(space);
- H5Pclose(dcpl);
+ H5Dclose(dset1);
+ H5Dclose(dset2);
+ H5Sclose(space);
+ H5Pclose(dcpl);
} H5E_END_TRY;
- return -1;
-} /* end test_multiopen () */
+ return FAIL;
+} /* end test_multiopen() */
/*-------------------------------------------------------------------------
@@ -5336,7 +5353,7 @@ test_types(hid_t file)
/* Cleanup */
if(H5Gclose(grp) < 0) goto error;
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -5345,7 +5362,7 @@ test_types(hid_t file)
H5Sclose(space);
H5Dclose(dset);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_types() */
/* This message derives from H5Z */
@@ -5392,30 +5409,30 @@ test_can_apply(hid_t file)
/* Create dcpl with special filter */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't create dcpl\n",__LINE__);
goto error;
} /* end if */
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set chunk sizes\n",__LINE__);
+ HDprintf(" Line %d: Can't set chunk sizes\n",__LINE__);
goto error;
} /* end if */
if(H5Zregister (H5Z_CAN_APPLY_TEST) < 0) {
H5_FAILED();
- printf(" Line %d: Can't register 'can apply' filter\n",__LINE__);
+ HDprintf(" Line %d: Can't register 'can apply' filter\n",__LINE__);
goto error;
}
/* The filter is mandate. */
if(H5Pset_filter(dcpl, H5Z_FILTER_CAN_APPLY_TEST, 0, (size_t)0, NULL) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set bogus filter\n",__LINE__);
+ HDprintf(" Line %d: Can't set bogus filter\n",__LINE__);
goto error;
}
/* Create the data space */
if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
@@ -5427,7 +5444,7 @@ test_can_apply(hid_t file)
} H5E_END_TRY;
if(dsid >=0) {
H5_FAILED();
- printf(" Line %d: Shouldn't have created dataset!\n",__LINE__);
+ HDprintf(" Line %d: Shouldn't have created dataset!\n",__LINE__);
H5Dclose(dsid);
goto error;
} /* end if */
@@ -5438,7 +5455,7 @@ test_can_apply(hid_t file)
} H5E_END_TRY;
if(dsid >=0) {
H5_FAILED();
- printf(" Line %d: Shouldn't have created dataset!\n",__LINE__);
+ HDprintf(" Line %d: Shouldn't have created dataset!\n",__LINE__);
H5Dclose(dsid);
goto error;
} /* end if */
@@ -5446,42 +5463,42 @@ test_can_apply(hid_t file)
/* Create new dataset */
if((dsid = H5Dcreate2(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
- printf(" Line %d: Error writing dataset data\n",__LINE__);
+ HDprintf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Flush the file (to clear the cache) */
if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
H5_FAILED();
- printf(" Line %d: Error flushing file\n",__LINE__);
+ HDprintf(" Line %d: Error flushing file\n",__LINE__);
goto error;
} /* end if */
/* Query the dataset's size on disk */
if((dset_size=H5Dget_storage_size(dsid))==0) {
H5_FAILED();
- printf(" Line %d: Error querying dataset size\n",__LINE__);
+ HDprintf(" Line %d: Error querying dataset size\n",__LINE__);
goto error;
} /* end if */
/* Verify that the size indicates data is uncompressed */
if((H5Tget_size(H5T_NATIVE_INT)*dims[0]*dims[1])!=dset_size) {
H5_FAILED();
- printf(" Line %d: Incorrect dataset size: %lu\n",__LINE__,(unsigned long)dset_size);
+ HDprintf(" Line %d: Incorrect dataset size: %lu\n",__LINE__,(unsigned long)dset_size);
goto error;
} /* end if */
/* Read data */
if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
H5_FAILED();
- printf(" Line %d: Error reading dataset data\n",__LINE__);
+ HDprintf(" Line %d: Error reading dataset data\n",__LINE__);
goto error;
} /* end if */
@@ -5491,10 +5508,10 @@ test_can_apply(hid_t file)
for(j=0; j<(size_t)dims[1]; j++) {
if(points[i][j] != check[i][j]) {
H5_FAILED();
- printf(" Line %d: Read different values than written.\n",__LINE__);
- printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
- printf(" At original: %d\n",points[i][j]);
- printf(" At returned: %d\n",check[i][j]);
+ HDprintf(" Line %d: Read different values than written.\n",__LINE__);
+ HDprintf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
+ HDprintf(" At original: %d\n",points[i][j]);
+ HDprintf(" At returned: %d\n",check[i][j]);
goto error;
} /* end if */
} /* end for */
@@ -5503,30 +5520,30 @@ test_can_apply(hid_t file)
/* Close dataset */
if(H5Dclose(dsid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close dataspace */
if(H5Sclose(sid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataspace\n",__LINE__);
goto error;
} /* end if */
/* Close dataset creation property list */
if(H5Pclose(dcpl) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't close dcpl\n",__LINE__);
goto error;
} /* end if */
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_can_apply() */
/* This message derives from H5Z */
@@ -5575,72 +5592,72 @@ test_can_apply2(hid_t file)
/* Create dcpl with special filter */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't create dcpl\n",__LINE__);
goto error;
} /* end if */
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set chunk sizes\n",__LINE__);
+ HDprintf(" Line %d: Can't set chunk sizes\n",__LINE__);
goto error;
} /* end if */
if(H5Zregister (H5Z_CAN_APPLY_TEST2) < 0) {
H5_FAILED();
- printf(" Line %d: Can't register 'can apply' filter\n",__LINE__);
+ HDprintf(" Line %d: Can't register 'can apply' filter\n",__LINE__);
goto error;
}
/* The filter is optional. */
if(H5Pset_filter(dcpl, H5Z_FILTER_CAN_APPLY_TEST2, H5Z_FLAG_OPTIONAL, (size_t)0, NULL) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set bogus filter\n",__LINE__);
+ HDprintf(" Line %d: Can't set bogus filter\n",__LINE__);
goto error;
}
/* Create the data space */
if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create new dataset */
if((dsid = H5Dcreate2(file, DSET_CAN_APPLY_NAME2, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
- printf(" Line %d: Error writing dataset data\n",__LINE__);
+ HDprintf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Flush the file (to clear the cache) */
if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
H5_FAILED();
- printf(" Line %d: Error flushing file\n",__LINE__);
+ HDprintf(" Line %d: Error flushing file\n",__LINE__);
goto error;
} /* end if */
/* Query the dataset's size on disk */
if((dset_size=H5Dget_storage_size(dsid))==0) {
H5_FAILED();
- printf(" Line %d: Error querying dataset size\n",__LINE__);
+ HDprintf(" Line %d: Error querying dataset size\n",__LINE__);
goto error;
} /* end if */
/* Verify that the size indicates data is uncompressed */
if((H5Tget_size(H5T_NATIVE_DOUBLE)*dims[0]*dims[1])!=dset_size) {
H5_FAILED();
- printf(" Line %d: Incorrect dataset size: %lu\n",__LINE__,(unsigned long)dset_size);
+ HDprintf(" Line %d: Incorrect dataset size: %lu\n",__LINE__,(unsigned long)dset_size);
goto error;
} /* end if */
/* Read data */
if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
H5_FAILED();
- printf(" Line %d: Error reading dataset data\n",__LINE__);
+ HDprintf(" Line %d: Error reading dataset data\n",__LINE__);
goto error;
} /* end if */
@@ -5650,10 +5667,10 @@ test_can_apply2(hid_t file)
for(j=0; j<(size_t)dims[1]; j++) {
if(points[i][j] != check[i][j]) {
H5_FAILED();
- printf(" Line %d: Read different values than written.\n",__LINE__);
- printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
- printf(" At original: %d\n",points[i][j]);
- printf(" At returned: %d\n",check[i][j]);
+ HDprintf(" Line %d: Read different values than written.\n",__LINE__);
+ HDprintf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
+ HDprintf(" At original: %d\n",points[i][j]);
+ HDprintf(" At returned: %d\n",check[i][j]);
goto error;
} /* end if */
} /* end for */
@@ -5662,30 +5679,30 @@ test_can_apply2(hid_t file)
/* Close dataset */
if(H5Dclose(dsid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close dataspace */
if(H5Sclose(sid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataspace\n",__LINE__);
goto error;
} /* end if */
/* Close dataset creation property list */
if(H5Pclose(dcpl) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't close dcpl\n",__LINE__);
goto error;
} /* end if */
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_can_apply2() */
@@ -5732,19 +5749,19 @@ file)
/* Create the data space */
if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create dcpl with special filter */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't create dcpl\n",__LINE__);
goto error;
} /* end if */
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set chunk sizes\n",__LINE__);
+ HDprintf(" Line %d: Can't set chunk sizes\n",__LINE__);
goto error;
} /* end if */
@@ -5755,7 +5772,7 @@ file)
} H5E_END_TRY;
if(ret>=0) {
H5_FAILED();
- printf(" Line %d: Shouldn't be able to set szip filter\n",__LINE__);
+ HDprintf(" Line %d: Shouldn't be able to set szip filter\n",__LINE__);
goto error;
}
@@ -5766,7 +5783,7 @@ file)
} H5E_END_TRY;
if(ret>=0) {
H5_FAILED();
- printf(" Line %d: Shouldn't be able to set szip filter\n",__LINE__);
+ HDprintf(" Line %d: Shouldn't be able to set szip filter\n",__LINE__);
goto error;
}
@@ -5774,7 +5791,7 @@ file)
szip_pixels_per_block=2;
if(H5Pset_szip (dcpl, szip_options_mask, szip_pixels_per_block) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set szip filter\n",__LINE__);
+ HDprintf(" Line %d: Can't set szip filter\n",__LINE__);
goto error;
}
@@ -5786,47 +5803,47 @@ file)
} H5E_END_TRY;
if(dsid <=0) {
H5_FAILED();
- printf(" Line %d: Should have created dataset!\n",__LINE__);
+ HDprintf(" Line %d: Should have created dataset!\n",__LINE__);
goto error;
} /* end if */
/* Close dataset */
if(H5Dclose(dsid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close dataspace */
if(H5Sclose(sid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataspace\n",__LINE__);
goto error;
} /* end if */
/* Close dataset creation property list */
if(H5Pclose(dcpl) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't close dcpl\n",__LINE__);
goto error;
} /* end if */
/* Create another data space */
if((sid = H5Screate_simple(2, dims2, NULL)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create dcpl with special filter */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't create dcpl\n",__LINE__);
goto error;
} /* end if */
if(H5Pset_chunk(dcpl, 2, chunk_dims2) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set chunk sizes\n",__LINE__);
+ HDprintf(" Line %d: Can't set chunk sizes\n",__LINE__);
goto error;
} /* end if */
@@ -5834,7 +5851,7 @@ file)
szip_pixels_per_block=32;
if(H5Pset_szip (dcpl, szip_options_mask, szip_pixels_per_block) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set szip filter\n",__LINE__);
+ HDprintf(" Line %d: Can't set szip filter\n",__LINE__);
goto error;
}
@@ -5845,7 +5862,7 @@ file)
} H5E_END_TRY;
if(dsid >=0) {
H5_FAILED();
- printf(" Line %d: Shouldn't have created dataset!\n",__LINE__);
+ HDprintf(" Line %d: Shouldn't have created dataset!\n",__LINE__);
H5Dclose(dsid);
goto error;
} /* end if */
@@ -5853,14 +5870,14 @@ file)
/* Close dataspace */
if(H5Sclose(sid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataspace\n",__LINE__);
goto error;
} /* end if */
/* Close dataset creation property list */
if(H5Pclose(dcpl) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't close dcpl\n",__LINE__);
goto error;
} /* end if */
@@ -5868,17 +5885,17 @@ file)
PASSED();
} else {
SKIPPED();
- puts(" Szip encoding is not enabled.");
+ HDputs(" Szip encoding is not enabled.");
}
#else /* H5_HAVE_FILTER_SZIP */
SKIPPED();
- puts(" Szip filter is not enabled.");
+ HDputs(" Szip filter is not enabled.");
#endif /* H5_HAVE_FILTER_SZIP */
- return 0;
+ return SUCCEED;
#ifdef H5_HAVE_FILTER_SZIP
error:
- return -1;
+ return FAIL;
#endif /* H5_HAVE_FILTER_SZIP */
} /* end test_can_apply_szip() */
@@ -5938,57 +5955,57 @@ test_set_local(hid_t fapl)
/* Open file */
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open file\n",__LINE__);
+ HDprintf(" Line %d: Can't open file\n",__LINE__);
goto error;
}
/* Create dcpl with special filter */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't create dcpl\n",__LINE__);
goto error;
} /* end if */
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set chunk sizes\n",__LINE__);
+ HDprintf(" Line %d: Can't set chunk sizes\n",__LINE__);
goto error;
} /* end if */
if(H5Zregister (H5Z_SET_LOCAL_TEST) < 0) {
H5_FAILED();
- printf(" Line %d: Can't register 'set local' filter\n",__LINE__);
+ HDprintf(" Line %d: Can't register 'set local' filter\n",__LINE__);
goto error;
}
if(H5Pset_filter(dcpl, H5Z_FILTER_SET_LOCAL_TEST, 0, (size_t)BOGUS2_PERM_NPARMS, cd_values) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set bogus2 filter\n",__LINE__);
+ HDprintf(" Line %d: Can't set bogus2 filter\n",__LINE__);
goto error;
}
/* Create the data space */
if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create new dataset */
if((dsid = H5Dcreate2(file, DSET_SET_LOCAL_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
- printf(" Line %d: Error writing dataset data\n",__LINE__);
+ HDprintf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Close dataset */
if(H5Dclose(dsid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
@@ -5996,77 +6013,77 @@ test_set_local(hid_t fapl)
/* (Shouldn't get modified by output filter) */
if((dsid = H5Dcreate2(file, DSET_SET_LOCAL_NAME_2, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
if(H5Dwrite(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_dbl) < 0) {
H5_FAILED();
- printf(" Line %d: Error writing dataset data\n",__LINE__);
+ HDprintf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Close dataset */
if(H5Dclose(dsid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close dataspace */
if(H5Sclose(sid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataspace\n", __LINE__);
+ HDprintf(" Line %d: Can't close dataspace\n", __LINE__);
goto error;
} /* end if */
/* Close dataset creation property list */
if(H5Pclose(dcpl) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dcpl\n", __LINE__);
+ HDprintf(" Line %d: Can't close dcpl\n", __LINE__);
goto error;
} /* end if */
/* Close file (flushes & empties cache) */
if(H5Fclose(file) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close file\n", __LINE__);
+ HDprintf(" Line %d: Can't close file\n", __LINE__);
goto error;
} /* end if */
/* Open file */
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open file\n", __LINE__);
+ HDprintf(" Line %d: Can't open file\n", __LINE__);
goto error;
}
/* Re-open dataset */
if((dsid = H5Dopen2(file, DSET_SET_LOCAL_NAME, H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open dataset\n", __LINE__);
+ HDprintf(" Line %d: Can't open dataset\n", __LINE__);
goto error;
} /* end if */
/* Query the dataset's size on disk */
if((dset_size = H5Dget_storage_size(dsid)) == 0) {
H5_FAILED();
- printf(" Line %d: Error querying dataset size\n", __LINE__);
+ HDprintf(" Line %d: Error querying dataset size\n", __LINE__);
goto error;
} /* end if */
/* Verify that the size indicates data is uncompressed */
if((H5Tget_size(H5T_NATIVE_INT) * dims[0] * dims[1]) != dset_size) {
H5_FAILED();
- printf(" Line %d: Incorrect dataset size: %lu\n", __LINE__, (unsigned long)dset_size);
+ HDprintf(" Line %d: Incorrect dataset size: %lu\n", __LINE__, (unsigned long)dset_size);
goto error;
} /* end if */
/* Read data */
if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
H5_FAILED();
- printf(" Line %d: Error reading dataset data\n", __LINE__);
+ HDprintf(" Line %d: Error reading dataset data\n", __LINE__);
goto error;
} /* end if */
@@ -6076,10 +6093,10 @@ test_set_local(hid_t fapl)
for(j=0; j<dims[1]; j++) {
if((points[i][j]+(int)sizeof(int)) != check[i][j]) {
H5_FAILED();
- printf(" Line %d: Read different values than written.\n",__LINE__);
- printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
- printf(" At original: %d\n",points[i][j]);
- printf(" At returned: %d\n",check[i][j]);
+ HDprintf(" Line %d: Read different values than written.\n",__LINE__);
+ HDprintf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
+ HDprintf(" At original: %d\n",points[i][j]);
+ HDprintf(" At returned: %d\n",check[i][j]);
goto error;
} /* end if */
} /* end for */
@@ -6088,35 +6105,35 @@ test_set_local(hid_t fapl)
/* Close dataset */
if(H5Dclose(dsid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataset\n", __LINE__);
+ HDprintf(" Line %d: Can't close dataset\n", __LINE__);
goto error;
} /* end if */
/* Re-open second dataset */
if((dsid = H5Dopen2(file, DSET_SET_LOCAL_NAME_2, H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open dataset\n", __LINE__);
+ HDprintf(" Line %d: Can't open dataset\n", __LINE__);
goto error;
} /* end if */
/* Query the dataset's size on disk */
if((dset_size = H5Dget_storage_size(dsid)) == 0) {
H5_FAILED();
- printf(" Line %d: Error querying dataset size\n", __LINE__);
+ HDprintf(" Line %d: Error querying dataset size\n", __LINE__);
goto error;
} /* end if */
/* Verify that the size indicates data is uncompressed */
if((H5Tget_size(H5T_NATIVE_DOUBLE) * dims[0] * dims[1]) != dset_size) {
H5_FAILED();
- printf(" Line %d: Incorrect dataset size: %lu\n", __LINE__, (unsigned long)dset_size);
+ HDprintf(" Line %d: Incorrect dataset size: %lu\n", __LINE__, (unsigned long)dset_size);
goto error;
} /* end if */
/* Read data */
if(H5Dread(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_dbl) < 0) {
H5_FAILED();
- printf(" Line %d: Error reading dataset data\n", __LINE__);
+ HDprintf(" Line %d: Error reading dataset data\n", __LINE__);
goto error;
} /* end if */
@@ -6128,10 +6145,10 @@ test_set_local(hid_t fapl)
* considered not equal. */
if(!H5_DBL_REL_EQUAL(points_dbl[i][j], check_dbl[i][j], (double)0.00001F)) {
H5_FAILED();
- printf(" Line %d: Read different values than written.\n",__LINE__);
- printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
- printf(" At original: %f\n",points_dbl[i][j]);
- printf(" At returned: %f\n",check_dbl[i][j]);
+ HDprintf(" Line %d: Read different values than written.\n",__LINE__);
+ HDprintf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
+ HDprintf(" At original: %f\n",points_dbl[i][j]);
+ HDprintf(" At returned: %f\n",check_dbl[i][j]);
goto error;
} /* end if */
} /* end for */
@@ -6140,23 +6157,23 @@ test_set_local(hid_t fapl)
/* Close dataset */
if(H5Dclose(dsid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close file */
if(H5Fclose(file) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close file\n",__LINE__);
+ HDprintf(" Line %d: Can't close file\n",__LINE__);
goto error;
} /* end if */
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_set_local() */
@@ -6231,7 +6248,7 @@ test_compare_dcpl(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6241,7 +6258,7 @@ error:
H5Pclose(dcpl1);
H5Pclose(dcpl2);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_compare_dcpl() */
@@ -6358,7 +6375,7 @@ test_copy_dcpl(hid_t file, hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6373,7 +6390,7 @@ error:
H5Pclose(dcpl1_copy);
H5Pclose(dcpl2_copy);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_copy_dcpl() */
@@ -6448,7 +6465,7 @@ test_filter_delete(hid_t file)
} H5E_END_TRY;
if(ret >=0) {
H5_FAILED();
- printf(" Line %d: Shouldn't have deleted filter!\n",__LINE__);
+ HDprintf(" Line %d: Shouldn't have deleted filter!\n",__LINE__);
goto error;
} /* end if */
@@ -6458,7 +6475,7 @@ test_filter_delete(hid_t file)
} H5E_END_TRY;
if(ret >=0) {
H5_FAILED();
- printf(" Line %d: Shouldn't have deleted filter!\n",__LINE__);
+ HDprintf(" Line %d: Shouldn't have deleted filter!\n",__LINE__);
goto error;
} /* end if */
@@ -6490,7 +6507,7 @@ test_filter_delete(hid_t file)
#else
SKIPPED();
#endif
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6499,7 +6516,7 @@ error:
H5Dclose(dsid);
H5Sclose(sid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_filter_delete() */
@@ -6556,7 +6573,7 @@ auxread_fdata(hid_t fid, const char *name)
if(nelmts) {
buf = (void *)HDmalloc((size_t)(nelmts * msize));
if(buf == NULL) {
- printf( "cannot read into memory\n" );
+ HDprintf( "cannot read into memory\n" );
goto error;
}
if(H5Dread(dset_id, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
@@ -6572,7 +6589,7 @@ auxread_fdata(hid_t fid, const char *name)
if(buf)
HDfree(buf);
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6584,7 +6601,7 @@ error:
if(buf)
HDfree(buf);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end auxread_fdata() */
@@ -6645,7 +6662,7 @@ test_filters_endianess(void)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6654,7 +6671,7 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_filters_endianess() */
@@ -6804,7 +6821,7 @@ test_zero_dims(hid_t file)
if(H5Sclose(s2) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6818,7 +6835,7 @@ error:
H5Dclose(d2);
H5Sclose(s2);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_zero_dims() */
@@ -6955,13 +6972,13 @@ test_missing_chunk(hid_t file)
for(u=0; u<MISSING_CHUNK_DIM; u++) {
if((u%10)>=5) {
if(rdata[u]!=911) {
- printf(" Line %d: Incorrect value, rdata[%u]=%d\n",__LINE__,(unsigned)u,rdata[u]);
+ HDprintf(" Line %d: Incorrect value, rdata[%u]=%d\n",__LINE__,(unsigned)u,rdata[u]);
TEST_ERROR;
} /* end if */
} /* end if */
else {
if(rdata[u]!=wdata[u]) {
- printf(" Line %d: Incorrect value, wdata[%u]=%d, rdata[%u]=%d\n",__LINE__,(unsigned)u,wdata[u],(unsigned)u,rdata[u]);
+ HDprintf(" Line %d: Incorrect value, wdata[%u]=%d, rdata[%u]=%d\n",__LINE__,(unsigned)u,wdata[u],(unsigned)u,rdata[u]);
TEST_ERROR;
} /* end if */
} /* end else */
@@ -6973,14 +6990,14 @@ test_missing_chunk(hid_t file)
if((i % 10) >= 5 || (j % 10) >= 5) {
if(rdata2[i][j] != 911) {
- printf(" Line %d: Incorrect value, rdata2[%u][%u] = %d\n",
+ HDprintf(" Line %d: Incorrect value, rdata2[%u][%u] = %d\n",
__LINE__,(unsigned)i, (unsigned)j, rdata2[i][j]);
TEST_ERROR;
} /* end if */
} /* end if */
else {
if(rdata2[i][j] != wdata2[i][j]) {
- printf(" Line %d: Incorrect value, wdata2[%u][%u] = %d, rdata2[%u][%u] = %d\n",
+ HDprintf(" Line %d: Incorrect value, wdata2[%u][%u] = %d, rdata2[%u][%u] = %d\n",
__LINE__,(unsigned)i, (unsigned)j, wdata2[i][j],(unsigned)i, (unsigned)j, rdata2[i][j]);
TEST_ERROR;
} /* end if */
@@ -6997,7 +7014,7 @@ test_missing_chunk(hid_t file)
if(H5Dclose(did2) < 0) TEST_ERROR;
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -7010,7 +7027,7 @@ error:
H5Sclose(s);
H5Sclose(sid2);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_missing_chunk() */
@@ -7144,8 +7161,8 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
/* Verify that written and read data are the same */
for(i = 0; i < NPOINTS; i++)
if(rbuf[i] != wbuf[i]){
- printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]);
- printf(" coord[%u] = {%lu, %lu}\n", (unsigned)i, (unsigned long)coord[i][0], (unsigned long)coord[i][1]);
+ HDprintf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]);
+ HDprintf(" coord[%u] = {%lu, %lu}\n", (unsigned)i, (unsigned long)coord[i][0], (unsigned long)coord[i][1]);
TEST_ERROR;
} /* end if */
@@ -7251,7 +7268,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
/* Verify that written and read data are the same */
for(i = 0; i < NPOINTS; i++)
if(rbuf[i] != wbuf[i]){
- printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]);
+ HDprintf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]);
TEST_ERROR;
} /* end if */
@@ -7357,7 +7374,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
/* Verify that written and read data are the same */
for(i = 0; i < NPOINTS; i++)
if(rbuf[i] != wbuf[i]){
- printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]);
+ HDprintf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]);
TEST_ERROR;
} /* end if */
@@ -7368,7 +7385,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR;
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -7378,7 +7395,7 @@ error:
H5Dclose(d);
H5Fclose(file);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_random_chunks_real() */
@@ -7498,7 +7515,7 @@ test_deprec(hid_t file)
} H5E_END_TRY;
if(dataset >= 0) {
H5_FAILED();
- puts(" Library allowed overwrite of existing dataset.");
+ HDputs(" Library allowed overwrite of existing dataset.");
goto error;
}
@@ -7519,7 +7536,7 @@ test_deprec(hid_t file)
} H5E_END_TRY;
if(dataset >= 0) {
H5_FAILED();
- puts(" Opened a non-existent dataset.");
+ HDputs(" Opened a non-existent dataset.");
goto error;
}
@@ -7568,7 +7585,7 @@ test_deprec(hid_t file)
} H5E_END_TRY;
if(dataset >= 0) {
H5_FAILED();
- puts(" Opened a dataset with incorrect chunking parameters.");
+ HDputs(" Opened a dataset with incorrect chunking parameters.");
goto error;
}
@@ -7620,15 +7637,15 @@ test_deprec(hid_t file)
if(H5Zregister(H5Z_DEPREC) < 0) goto error;
if(H5Pset_filter(dcpl, H5Z_FILTER_DEPREC, 0, (size_t)0, NULL) < 0) goto error;
- puts("");
+ HDputs("");
if(test_filter_internal(file,DSET_DEPREC_NAME_FILTER,dcpl,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&deprec_size) < 0) goto error;
if(H5Pclose(dcpl) < 0) goto error;
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_deprec() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
@@ -7732,7 +7749,7 @@ test_huge_chunks(hid_t fapl)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -7741,7 +7758,7 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_huge_chunks() */
@@ -7936,7 +7953,7 @@ test_chunk_cache(hid_t fapl)
if (H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -7949,7 +7966,7 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_chunk_cache() */
@@ -8120,15 +8137,15 @@ test_big_chunks_bypass_cache(hid_t fapl)
/* Verify data for the first 1-D dataset */
for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++)
if(rdata1[i] != i) {
- printf(" Read different values than written in the 1st chunk.\n");
- printf(" At line %d and index %d, rdata1 = %d. It should be %d.\n", __LINE__, i, rdata1[i], i);
+ HDprintf(" Read different values than written in the 1st chunk.\n");
+ HDprintf(" At line %d and index %d, rdata1 = %d. It should be %d.\n", __LINE__, i, rdata1[i], i);
TEST_ERROR
} /* end if */
for(j = BYPASS_CHUNK_DIM / 2; j < BYPASS_DIM; j++)
if(rdata1[j] != fvalue) {
- printf(" Read different values than written in the 2nd chunk.\n");
- printf(" At line %d and index %d, rdata1 = %d. It should be %d.\n", __LINE__, i, rdata1[i], fvalue);
+ HDprintf(" Read different values than written in the 2nd chunk.\n");
+ HDprintf(" At line %d and index %d, rdata1 = %d. It should be %d.\n", __LINE__, i, rdata1[i], fvalue);
TEST_ERROR
} /* end if */
@@ -8136,8 +8153,8 @@ test_big_chunks_bypass_cache(hid_t fapl)
for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++)
for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++)
if(t_rdata1[i][j] != j) {
- printf(" Read different values than written in the 1st chunk.\n");
- printf(" At line %d and index (%d, %d), t_rdata1 = %d. It should be %d.\n",
+ HDprintf(" Read different values than written in the 1st chunk.\n");
+ HDprintf(" At line %d and index (%d, %d), t_rdata1 = %d. It should be %d.\n",
__LINE__, i, j, t_rdata1[i][j], j);
TEST_ERROR
} /* end if */
@@ -8145,8 +8162,8 @@ test_big_chunks_bypass_cache(hid_t fapl)
for(i = BYPASS_CHUNK_DIM / 2; i < BYPASS_DIM; i++)
for(j = BYPASS_CHUNK_DIM / 2; j < BYPASS_DIM; j++)
if(t_rdata1[i][j] != fvalue) {
- printf(" Read different values than written in the 2nd chunk.\n");
- printf(" At line %d and index (%d, %d), t_rdata1 = %d. It should be %d.\n",
+ HDprintf(" Read different values than written in the 2nd chunk.\n");
+ HDprintf(" At line %d and index (%d, %d), t_rdata1 = %d. It should be %d.\n",
__LINE__, i, j, t_rdata1[i][j], fvalue);
TEST_ERROR
} /* end if */
@@ -8192,8 +8209,8 @@ test_big_chunks_bypass_cache(hid_t fapl)
/* Verify data for the second 1-D dataset */
for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++)
if(rdata2[i] != i) {
- printf(" Read different values than written in the chunk.\n");
- printf(" At line %d and index %d, rdata2 = %d. It should be %d.\n", __LINE__, i, rdata2[i], i);
+ HDprintf(" Read different values than written in the chunk.\n");
+ HDprintf(" At line %d and index %d, rdata2 = %d. It should be %d.\n", __LINE__, i, rdata2[i], i);
TEST_ERROR
} /* end if */
@@ -8201,8 +8218,8 @@ test_big_chunks_bypass_cache(hid_t fapl)
for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++)
for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++)
if(t_rdata2[i][j] != j) {
- printf(" Read different values than written in the chunk.\n");
- printf(" At line %d and index (%d, %d), t_rdata2 = %d. It should be %d.\n",
+ HDprintf(" Read different values than written in the chunk.\n");
+ HDprintf(" At line %d and index (%d, %d), t_rdata2 = %d. It should be %d.\n",
__LINE__, i, j, t_rdata2[i][j], j);
TEST_ERROR
} /* end if */
@@ -8223,7 +8240,7 @@ test_big_chunks_bypass_cache(hid_t fapl)
HDfree(rdata2);
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -8242,7 +8259,7 @@ error:
HDfree(rdata1);
if(rdata2)
HDfree(rdata2);
- return -1;
+ return FAIL;
} /* end test_big_chunks_bypass_cache() */
@@ -8310,10 +8327,10 @@ test_chunk_fast(const char *env_h5_driver, hid_t fapl)
/* Loop over using SWMR access to write */
for(swmr = 0; swmr <= 1; swmr++) {
- int compress; /* Whether chunks should be compressed */
+ int compress; /* Whether chunks should be compressed */
/* SWMR is now supported with/without latest format: */
- /* (1) write+latest-format (2) SWMR-write+non-latest-format */
+ /* (1) write+latest-format (2) SWMR-write+non-latest-format */
/* Skip this iteration if SWMR I/O is not supported for the VFD specified
* by the environment variable.
@@ -8325,10 +8342,10 @@ test_chunk_fast(const char *env_h5_driver, hid_t fapl)
/* Loop over compressing chunks */
for(compress = 0; compress <= 1; compress++)
#else
- /* Loop over without compression */
+ /* Loop over without compression */
for(compress = 0; compress <= 0; compress++)
#endif /* H5_HAVE_FILTER_DEFLATE */
- {
+ {
H5D_alloc_time_t alloc_time; /* Storage allocation time */
/* Loop over storage allocation time */
@@ -8578,7 +8595,7 @@ test_chunk_fast(const char *env_h5_driver, hid_t fapl)
if(H5Pclose(my_fapl) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -8589,7 +8606,7 @@ error:
H5Fclose(fid);
H5Pclose(my_fapl);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_chunk_fast() */
@@ -8702,7 +8719,7 @@ test_reopen_chunk_fast(hid_t fapl)
} /* end for */
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -8712,7 +8729,7 @@ error:
H5Sclose(scalar_sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_reopen_chunk_fast() */
@@ -8811,7 +8828,7 @@ test_chunk_fast_bug1(hid_t fapl)
if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -8820,7 +8837,7 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_chunk_fast_bug1() */
/* This message derives from H5Z */
@@ -8931,7 +8948,7 @@ test_chunk_expand(hid_t fapl)
if(sizeof(size_t) <= 4 && low != H5F_LIBVER_LATEST) {
SKIPPED();
- puts(" Current machine can't test for error w/old file format");
+ HDputs(" Current machine can't test for error w/old file format");
} /* end if */
else {
/* Register "expansion" filter */
@@ -9266,7 +9283,7 @@ test_chunk_expand(hid_t fapl)
PASSED();
} /* end else */
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -9279,7 +9296,7 @@ error:
H5Sclose(scalar_sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_chunk_expand() */
@@ -9594,7 +9611,7 @@ test_fixed_array(hid_t fapl)
/* Verify that written and read data are the same */
for(i = 0; i < POINTS; i++)
if(rbuf[i] != wbuf[i]){
- printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",
+ HDprintf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",
__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]);
TEST_ERROR;
} /* end if */
@@ -9622,7 +9639,7 @@ test_fixed_array(hid_t fapl)
/* Verify that written and read data are the same */
for(i = 0; i < POINTS; i++)
if(rbuf[i] != wbuf[i]){
- printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",
+ HDprintf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",
__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]);
TEST_ERROR;
} /* end if */
@@ -9648,7 +9665,7 @@ test_fixed_array(hid_t fapl)
/* Verify that written and read data are the same */
for(i = 0; i < POINTS_BIG; i++)
if(rbuf_big[i] != wbuf_big[i]) {
- printf(" Line %d: Incorrect value, wbuf_bif[%u]=%d, rbuf_big[%u]=%d\n",
+ HDprintf(" Line %d: Incorrect value, wbuf_bif[%u]=%d, rbuf_big[%u]=%d\n",
__LINE__,(unsigned)i,wbuf_big[i],(unsigned)i,rbuf_big[i]);
TEST_ERROR;
} /* end if */
@@ -9684,7 +9701,7 @@ test_fixed_array(hid_t fapl)
HDfree(rbuf_big);
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -9698,7 +9715,7 @@ error:
HDfree(wbuf_big);
if(rbuf_big)
HDfree(rbuf_big);
- return -1;
+ return FAIL;
} /* end test_fixed_array() */
@@ -9887,7 +9904,7 @@ test_single_chunk(hid_t fapl)
/* Verify that written and read data are the same */
for(i = 0; i < (DSET_DIM1 * DSET_DIM2); i++)
if(rbuf[i] != wbuf[i]){
- printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",
+ HDprintf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n",
__LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]);
TEST_ERROR;
} /* end if */
@@ -9906,7 +9923,7 @@ test_single_chunk(hid_t fapl)
/* Verify that written and read data are the same */
for(i = 0; i < (DSET_TMP_DIM1* DSET_TMP_DIM2); i++)
if(t_rbuf[i] != t_wbuf[i]) {
- printf(" Line %d: Incorrect value, t_wbuf[%u]=%d, t_rbuf[%u]=%d\n",
+ HDprintf(" Line %d: Incorrect value, t_wbuf[%u]=%d, t_rbuf[%u]=%d\n",
__LINE__,(unsigned)i,t_wbuf[i],(unsigned)i,t_rbuf[i]);
TEST_ERROR;
} /* end if */
@@ -9942,7 +9959,7 @@ test_single_chunk(hid_t fapl)
HDfree(t_rbuf);
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -9962,7 +9979,7 @@ error:
HDfree(t_wbuf);
if(t_rbuf)
HDfree(t_rbuf);
- return -1;
+ return FAIL;
} /* end test_single_chunk() */
@@ -10028,14 +10045,14 @@ test_idx_compatible(void)
}
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Dclose(did);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_idx_compatible() */
/*-------------------------------------------------------------------------
@@ -10166,7 +10183,7 @@ test_unfiltered_edge_chunks(hid_t fapl)
TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10175,7 +10192,7 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_unfiltered_edge_chunks() */
@@ -10280,7 +10297,7 @@ test_large_chunk_shrink(hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10290,7 +10307,7 @@ error:
H5Sclose(scalar_sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_large_chunk_shrink() */
@@ -10374,7 +10391,7 @@ test_zero_dim_dset(hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10383,7 +10400,7 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_zero_dim_dset() */
@@ -10424,8 +10441,8 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
if(!H5FD_supports_swmr_test(env_h5_driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
- return 0;
- } /* end if */
+ return SUCCEED;
+ }
/* Check if we are using the latest version of the format */
if(H5Pget_libver_bounds(fapl, &low, NULL) < 0)
@@ -10437,7 +10454,8 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
/* Create file with write+latest-format */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
- } else {
+ }
+ else {
/* Create file with SWMR-write+non-latest-format */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
@@ -10622,7 +10640,7 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10632,7 +10650,7 @@ error:
H5Gclose(gid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* test_swmr_non_latest() */
@@ -10673,8 +10691,8 @@ test_earray_hdr_fd(const char *env_h5_driver, hid_t fapl)
if(!H5FD_supports_swmr_test(env_h5_driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
- return 0;
- } /* end if */
+ return SUCCEED;
+ }
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
FAIL_STACK_ERROR;
@@ -10740,7 +10758,7 @@ test_earray_hdr_fd(const char *env_h5_driver, hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10752,7 +10770,7 @@ error:
H5Sclose(sid);
H5Sclose(msid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* test_earray_hdr_fd() */
@@ -10793,8 +10811,8 @@ test_farray_hdr_fd(const char *env_h5_driver, hid_t fapl)
if(!H5FD_supports_swmr_test(env_h5_driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
- return 0;
- } /* end if */
+ return SUCCEED;
+ }
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
FAIL_STACK_ERROR;
@@ -10860,7 +10878,7 @@ test_farray_hdr_fd(const char *env_h5_driver, hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10872,7 +10890,7 @@ error:
H5Sclose(sid);
H5Sclose(msid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_farray_hdr_fd() */
@@ -10913,8 +10931,8 @@ test_bt2_hdr_fd(const char *env_h5_driver, hid_t fapl)
if(!H5FD_supports_swmr_test(env_h5_driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
- return 0;
- } /* end if */
+ return SUCCEED;
+ }
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
FAIL_STACK_ERROR;
@@ -10980,7 +10998,7 @@ test_bt2_hdr_fd(const char *env_h5_driver, hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10992,7 +11010,7 @@ error:
H5Sclose(sid);
H5Sclose(msid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_bt2_hdr_fd() */
@@ -11376,7 +11394,7 @@ test_storage_size(hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -11386,7 +11404,7 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_storage_size() */
@@ -11467,7 +11485,7 @@ test_power2up(hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -11477,7 +11495,7 @@ error:
H5Pclose(dcpl);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_power2up() */
@@ -11507,7 +11525,7 @@ typedef struct scatter_info_t {
for(k=0; k<(int)(sizeof(ARR[0][0])/sizeof(ARR[0][0][0])); k++) \
if(ARR[i][j][k] != EXP[i][j][k]) { \
H5_FAILED(); AT(); \
- printf(" " #ARR "[%d][%d][%d] == %d, " #EXP "[%d][%d][%d] == %d\n", i, j, k, ARR[i][j][k], i, j, k, EXP[i][j][k]); \
+ HDprintf(" " #ARR "[%d][%d][%d] == %d, " #EXP "[%d][%d][%d] == %d\n", i, j, k, ARR[i][j][k], i, j, k, EXP[i][j][k]); \
goto error; \
}
@@ -11789,13 +11807,13 @@ test_scatter(void)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Sclose(sid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_scatter() */
@@ -11857,7 +11875,7 @@ gather_cb(const void *dst_buf, size_t dst_buf_bytes_used,
error:
return FAIL;
-}
+} /* end gather_cb() */
static herr_t
test_gather(void)
@@ -12151,13 +12169,13 @@ test_gather(void)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Sclose(sid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_gather() */
@@ -12220,7 +12238,7 @@ scatter_error_cb_unalign(void **src_buf/*out*/, size_t *src_buf_bytes_used/*out*
*src_buf_bytes_used = *(size_t *)_src_buf_bytes_used;
return SUCCEED;
-} /* end scatter_error_cb_unalign() */
+} /* endscatter_error_cb_unalign() */
static herr_t
test_scatter_error(void)
@@ -12354,13 +12372,13 @@ test_scatter_error(void)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Sclose(sid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_scatter_error() */
@@ -12493,13 +12511,13 @@ test_gather_error(void)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Sclose(sid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_gather_error() */
/*-------------------------------------------------------------------------
@@ -12598,7 +12616,6 @@ static herr_t dls_01_main( void );
static herr_t
dls_01_setup_file( hid_t fid )
{
-
int status = 0;
hid_t sid = 0, did = 0, tid = 0, dcpl = 0;
int ndims = 1;
@@ -12636,18 +12653,15 @@ dls_01_setup_file( hid_t fid )
status = H5Sclose( sid );
if ( status != 0 ) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
-
- return -1;
-
+ return FAIL;
} /* end dls_01_setup_file() */
static herr_t
dls_01_write_data( hid_t fid, char* buffer )
{
-
int status = 0;
hid_t did = 0, tid = 0;
hsize_t extent[1] = {4};
@@ -12673,18 +12687,15 @@ dls_01_write_data( hid_t fid, char* buffer )
status = H5Dclose( did );
if ( status != 0 ) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
-
- return -1;
-
+ return FAIL;
} /* end dls_01_write_data() */
static herr_t
dls_01_read_stuff( hid_t fid )
{
-
int status = 0;
hid_t did = 0;
H5O_info_t info;
@@ -12698,18 +12709,15 @@ dls_01_read_stuff( hid_t fid )
status = H5Dclose( did );
if ( status != 0 ) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
-
- return -1;
-
+ return FAIL;
} /* end dls_01_read_stuff() */
static herr_t
dls_01_main( void )
{
-
char filename[512];
int status = 0;
hid_t fapl = 0, fid = 0;
@@ -12766,14 +12774,11 @@ dls_01_main( void )
PASSED();
- return 0;
+ return SUCCEED;
error:
-
if ( buffer ) HDfree(buffer);
-
- return -1;
-
+ return FAIL;
} /* end dls_01_main() */
/*-------------------------------------------------------------------------
@@ -12882,7 +12887,7 @@ test_compact_open_close_dirty(hid_t fapl)
TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -12891,7 +12896,7 @@ error:
H5Dclose(did);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_compact_open_close_dirty() */
@@ -13119,25 +13124,25 @@ test_object_header_minimization_dcpl(hid_t fapl_id)
ret = H5Pget_dset_no_attrs_hint(-1, &minimize);
} H5E_END_TRY;
if (ret == SUCCEED)
- TEST_ERROR
+ TEST_ERROR /* Invalid DCPL ID should fail */
H5E_BEGIN_TRY {
ret = H5Pset_dset_no_attrs_hint(-1, FALSE);
} H5E_END_TRY;
if (ret == SUCCEED)
- TEST_ERROR
+ TEST_ERROR /* Invalid DCPL ID should fail */
H5E_BEGIN_TRY {
ret = H5Pset_dset_no_attrs_hint(-1, TRUE);
} H5E_END_TRY;
if (ret == SUCCEED)
- TEST_ERROR
+ TEST_ERROR /* Invalid DCPL ID should fail */
H5E_BEGIN_TRY {
ret = H5Pget_dset_no_attrs_hint(dcpl_id, NULL);
} H5E_END_TRY;
if (ret == SUCCEED)
- TEST_ERROR
+ TEST_ERROR /* NULL out pointer should fail */
/************/
/* TEARDOWN */
@@ -13166,8 +13171,7 @@ error:
*
* Purpose: Tests the dataset interface (H5D)
*
- * Return: Success: exit(EXIT_SUCCESS)
- * Failure: exit(EXIT_FAILURE)
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Robb Matzke
* Tuesday, December 9, 1997
@@ -13249,20 +13253,20 @@ main(void)
my_fapl = fapl2;
if(paged) {
my_fcpl = fcpl2;
- puts("\nTesting with new file format and paged aggregation");
+ HDputs("\nTesting with new file format and paged aggregation");
} else {
my_fcpl = fcpl;
- puts("\nTesting with new file format and non-paged aggregation");
+ HDputs("\nTesting with new file format and non-paged aggregation");
}
} /* end if */
else {
my_fapl = fapl;
if(paged) {
my_fcpl = fcpl2;
- puts("Testing with old file format and paged aggregation:");
+ HDputs("Testing with old file format and paged aggregation:");
} else {
my_fcpl = fcpl;
- puts("Testing with old file format and non-paged aggregation:");
+ HDputs("Testing with old file format and non-paged aggregation:");
}
} /* end else */
@@ -13273,7 +13277,7 @@ main(void)
if (TRUE == minimized_ohdr) {
if (0 > H5Fset_dset_no_attrs_hint(file, TRUE))
goto error;
- puts("(minimized dataset object headers with file setting)");
+ HDputs("(minimized dataset object headers with file setting)");
}
/* Cause the library to emit initial messages */
@@ -13380,19 +13384,19 @@ main(void)
if(nerrors)
goto error;
- printf("All dataset tests passed.\n");
+ HDprintf("All dataset tests passed.\n");
#ifdef H5_HAVE_FILTER_SZIP
if (GetTestCleanup())
HDremove(NOENCODER_COPY_FILENAME);
#endif /* H5_HAVE_FILTER_SZIP */
h5_cleanup(FILENAME, fapl);
- return EXIT_SUCCESS;
+ HDexit(EXIT_SUCCESS);
error:
nerrors = MAX(1, nerrors);
- printf("***** %d DATASET TEST%s FAILED! *****\n",
+ HDprintf("***** %d DATASET TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
- return EXIT_FAILURE;
+ HDexit(EXIT_FAILURE);
} /* end main() */
diff --git a/test/dt_arith.c b/test/dt_arith.c
index 2729ba1..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,25 +621,25 @@ 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;
}
/* Unregister the hard conversion from int to float. Verify the conversion
* is a soft conversion. */
- H5Tunregister(H5T_PERS_HARD, NULL, H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T__conv_int_float);
+ 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;
}
/* Register the hard conversion from int to float. Verify the conversion
* is a hard conversion. */
- H5Tregister(H5T_PERS_HARD, "int_flt", H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T__conv_int_float);
+ 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<src_size1; j++)
- printf(" %02x", saved_buf1[ENDIAN(src_size1, j, endian)]);
+ HDprintf(" %02x", saved_buf1[ENDIAN(src_size1, j, endian)]);
HDmemcpy(&x, saved_buf1, src_size1);
- printf(" %29.20e\n", x);
+ HDprintf(" %29.20e\n", x);
- printf(" dst = ");
+ HDprintf(" dst = ");
for (j=0; j<dst_size1; j++)
- printf(" %02x", buf1[ENDIAN(dst_size1, j, endian)]);
+ HDprintf(" %02x", buf1[ENDIAN(dst_size1, j, endian)]);
HDmemcpy(&y, buf1, dst_size1);
- printf(" %29d\n", y);
+ HDprintf(" %29d\n", y);
}
/* Test conversion from float (the value is INT_MAX) to int. */
@@ -812,11 +806,11 @@ static int test_particular_fp_integer(void)
/* Do conversion */
if(H5Tconvert(H5T_NATIVE_FLOAT, H5T_NATIVE_INT, (size_t)1, buf2, NULL, dxpl_id) < 0) {
H5_FAILED();
- printf("Can't convert data\n");
+ HDprintf("Can't convert data\n");
goto error;
}
- memcpy(&dst_i, buf2, dst_size2);
+ HDmemcpy(&dst_i, buf2, dst_size2);
/* Print errors */
if(dst_i != fill_value) {
@@ -826,20 +820,20 @@ static int test_particular_fp_integer(void)
if(0 == fails_this_test++)
H5_FAILED();
- printf(" test float to int:\n");
- printf(" src = ");
+ HDprintf(" test float to int:\n");
+ HDprintf(" src = ");
for (j=0; j<src_size2; j++)
- printf(" %02x", saved_buf2[ENDIAN(src_size2, j, endian)]);
+ HDprintf(" %02x", saved_buf2[ENDIAN(src_size2, j, endian)]);
HDmemcpy(&x, saved_buf2, src_size2);
- printf(" %29.20e\n", (double)x);
+ HDprintf(" %29.20e\n", (double)x);
- printf(" dst = ");
+ HDprintf(" dst = ");
for (j=0; j<dst_size2; j++)
- printf(" %02x", buf2[ENDIAN(dst_size2, j, endian)]);
+ HDprintf(" %02x", buf2[ENDIAN(dst_size2, j, endian)]);
HDmemcpy(&y, buf2, dst_size2);
- printf(" %29d\n", y);
+ HDprintf(" %29d\n", y);
}
if(fails_this_test)
@@ -847,7 +841,7 @@ static int test_particular_fp_integer(void)
if(H5Pclose(dxpl_id) < 0) {
H5_FAILED();
- printf("Can't close property list\n");
+ HDprintf("Can't close property list\n");
goto error;
}
@@ -885,7 +879,7 @@ error:
return MAX((int)fails_this_test, 1);
}
-
+
/*-------------------------------------------------------------------------
* Function: test_derived_flt
*
@@ -912,11 +906,11 @@ test_derived_flt(void)
size_t src_size, dst_size;
unsigned char *buf=NULL, *saved_buf=NULL;
int *aligned=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 floating-point types");
@@ -925,25 +919,25 @@ test_derived_flt(void)
h5_fixname(FILENAME[0], 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_IEEE_F64LE)) < 0) {
H5_FAILED();
- printf("Can't copy data type\n");
+ HDprintf("Can't copy data type\n");
goto error;
}
if((tid2 = H5Tcopy(H5T_IEEE_F32LE)) < 0) {
H5_FAILED();
- printf("Can't copy data type\n");
+ HDprintf("Can't copy data type\n");
goto error;
}
@@ -967,44 +961,44 @@ test_derived_flt(void)
*-----------------------------------------------------------------------*/
if(H5Tset_fields(tid1, (size_t)44, (size_t)34, (size_t)10, (size_t)3, (size_t)31) < 0) {
H5_FAILED();
- printf("Can't set fields\n");
+ HDprintf("Can't set fields\n");
goto error;
}
if(H5Tset_offset(tid1, (size_t)3) < 0) {
H5_FAILED();
- printf("Can't set offset\n");
+ HDprintf("Can't set offset\n");
goto error;
}
if(H5Tset_precision(tid1, (size_t)42) < 0) {
H5_FAILED();
- printf("Can't set precision 1\n");
+ HDprintf("Can't set precision 1\n");
goto error;
}
if(H5Tset_size(tid1, (size_t)7) < 0) {
H5_FAILED();
- printf("Can't set size\n");
+ HDprintf("Can't set size\n");
goto error;
}
if(H5Tset_ebias(tid1, (size_t)511) < 0) {
H5_FAILED();
- printf("Can't set exponent bias\n");
+ HDprintf("Can't set exponent bias\n");
goto error;
}
if(H5Tset_pad(tid1, 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 1", tid1, 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(tid1) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
}
@@ -1012,33 +1006,33 @@ test_derived_flt(void)
FAIL_PUTS_ERROR("Can't open datatype")
if(H5Tget_fields(tid1, &spos, &epos, &esize, &mpos, &msize) < 0) {
H5_FAILED();
- printf("Can't get fields\n");
+ HDprintf("Can't get fields\n");
goto error;
}
if(spos != 44 || epos != 34 || esize != 10 || mpos != 3 || msize != 31) {
H5_FAILED();
- printf("Wrong field values\n");
+ HDprintf("Wrong field values\n");
goto error;
}
if(H5Tget_precision(tid1) != 42) {
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)!=3) {
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(tid1))!=7) {
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(tid1)!=511) {
H5_FAILED();
- printf("Can't get exponent bias or wrong bias\n");
+ HDprintf("Can't get exponent bias or wrong bias\n");
goto error;
}
@@ -1061,13 +1055,13 @@ test_derived_flt(void)
* The mantissa is big enough to retain the integer's precision. */
if(H5Tconvert(H5T_NATIVE_INT, 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 derived floating-point type back to native integer. */
if(H5Tconvert(tid1, H5T_NATIVE_INT, nelmts, buf, NULL, dxpl_id) < 0) {
H5_FAILED();
- printf("Can't convert data\n");
+ HDprintf("Can't convert data\n");
goto error;
}
@@ -1081,26 +1075,26 @@ 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<src_size; j++)
- printf(" %02x", saved_buf[i*src_size+ENDIAN(src_size, j, endian)]);
+ HDprintf(" %02x", saved_buf[i*src_size+ENDIAN(src_size, j, endian)]);
HDmemcpy(aligned, saved_buf+i*sizeof(int), sizeof(int));
- printf(" %29d\n", *aligned);
+ HDprintf(" %29d\n", *aligned);
- printf(" dst = ");
+ HDprintf(" dst = ");
for (j=0; j<src_size; j++)
- printf(" %02x", buf[i*src_size+ENDIAN(src_size, j, endian)]);
+ HDprintf(" %02x", buf[i*src_size+ENDIAN(src_size, j, endian)]);
HDmemcpy(aligned, buf+i*sizeof(int), sizeof(int));
- printf(" %29d\n", *aligned);
+ HDprintf(" %29d\n", *aligned);
if (fails_this_test>=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<src_size; j++)
- printf(" %02x", saved_buf[i*src_size+ENDIAN(src_size, j, endian)]);
- printf("\n");
+ HDprintf(" %02x", saved_buf[i*src_size+ENDIAN(src_size, j, endian)]);
+ HDprintf("\n");
- printf(" dst = ");
+ HDprintf(" dst = ");
for (j=0; j<src_size; j++)
- printf(" %02x", buf[i*src_size+ENDIAN(src_size, j, endian)]);
- printf("\n");
+ HDprintf(" %02x", buf[i*src_size+ENDIAN(src_size, j, endian)]);
+ HDprintf("\n");
if (fails_this_test>=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<src_size; j++)
- printf(" %02x", saved_buf[i*src_size+ENDIAN(src_size, j, endian)]);
- printf("\n");
+ HDprintf(" %02x", saved_buf[i*src_size+ENDIAN(src_size, j, endian)]);
+ HDprintf("\n");
- printf(" dst = ");
+ HDprintf(" dst = ");
for (j=0; j<src_size; j++)
- printf(" %02x", buf[i*src_size+ENDIAN(src_size, j, endian)]);
- printf("\n");
+ HDprintf(" %02x", buf[i*src_size+ENDIAN(src_size, j, endian)]);
+ HDprintf("\n");
if (fails_this_test>=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; k<src_size; k++)
- printf(" %02x", saved[j*src_size+ENDIAN(src_size, k, endian)]);
- printf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), "");
+ HDprintf(" %02x", saved[j*src_size+ENDIAN(src_size, k, endian)]);
+ HDprintf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), "");
switch (src_type) {
case INT_SCHAR:
HDmemcpy(aligned, saved+j*sizeof(signed char), sizeof(signed char));
- printf(" %29d\n", (int)*((signed char*)aligned));
+ HDprintf(" %29d\n", (int)*((signed char*)aligned));
break;
case INT_UCHAR:
HDmemcpy(aligned, saved+j*sizeof(unsigned char), sizeof(unsigned char));
- printf(" %29u\n", (unsigned)*((unsigned char*)aligned));
+ HDprintf(" %29u\n", (unsigned)*((unsigned char*)aligned));
break;
case INT_SHORT:
HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short));
- printf(" %29hd\n", *((short*)aligned));
+ HDprintf(" %29hd\n", *((short*)aligned));
break;
case INT_USHORT:
HDmemcpy(aligned, saved+j*sizeof(unsigned short), sizeof(unsigned short));
- printf(" %29hu\n", *((unsigned short*)aligned));
+ HDprintf(" %29hu\n", *((unsigned short*)aligned));
break;
case INT_INT:
HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int));
- printf(" %29d\n", *((int*)aligned));
+ HDprintf(" %29d\n", *((int*)aligned));
break;
case INT_UINT:
HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned));
- printf(" %29u\n", *((unsigned*)aligned));
+ HDprintf(" %29u\n", *((unsigned*)aligned));
break;
case INT_LONG:
HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long));
- printf(" %29ld\n", *((long*)aligned));
+ HDprintf(" %29ld\n", *((long*)aligned));
break;
case INT_ULONG:
HDmemcpy(aligned, saved+j*sizeof(unsigned long), sizeof(unsigned long));
- printf(" %29lu\n", *((unsigned long*)aligned));
+ HDprintf(" %29lu\n", *((unsigned long*)aligned));
break;
case INT_LLONG:
HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long));
@@ -2518,42 +2512,42 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
break;
}
- printf(" dst = ");
+ HDprintf(" dst = ");
for (k=0; k<dst_size; k++)
- printf(" %02x", buf[j*dst_size+ENDIAN(dst_size, k, endian)]);
- printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
+ HDprintf(" %02x", buf[j*dst_size+ENDIAN(dst_size, k, endian)]);
+ HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
switch (dst_type) {
case INT_SCHAR:
HDmemcpy(aligned, buf+j*sizeof(signed char), sizeof(signed char));
- printf(" %29d\n", (int)*((signed char*)aligned));
+ HDprintf(" %29d\n", (int)*((signed char*)aligned));
break;
case INT_UCHAR:
HDmemcpy(aligned, buf+j*sizeof(unsigned char), sizeof(unsigned char));
- printf(" %29u\n", (unsigned)*((unsigned char*)aligned));
+ HDprintf(" %29u\n", (unsigned)*((unsigned char*)aligned));
break;
case INT_SHORT:
HDmemcpy(aligned, buf+j*sizeof(short), sizeof(short));
- printf(" %29hd\n", *((short*)aligned));
+ HDprintf(" %29hd\n", *((short*)aligned));
break;
case INT_USHORT:
HDmemcpy(aligned, buf+j*sizeof(unsigned short), sizeof(unsigned short));
- printf(" %29hu\n", *((unsigned short*)aligned));
+ HDprintf(" %29hu\n", *((unsigned short*)aligned));
break;
case INT_INT:
HDmemcpy(aligned, buf+j*sizeof(int), sizeof(int));
- printf(" %29d\n", *((int*)aligned));
+ HDprintf(" %29d\n", *((int*)aligned));
break;
case INT_UINT:
HDmemcpy(aligned, buf+j*sizeof(unsigned), sizeof(unsigned));
- printf(" %29u\n", *((unsigned*)aligned));
+ HDprintf(" %29u\n", *((unsigned*)aligned));
break;
case INT_LONG:
HDmemcpy(aligned, buf+j*sizeof(long), sizeof(long));
- printf(" %29ld\n", *((long*)aligned));
+ HDprintf(" %29ld\n", *((long*)aligned));
break;
case INT_ULONG:
HDmemcpy(aligned, buf+j*sizeof(unsigned long), sizeof(unsigned long));
- printf(" %29lu\n", *((unsigned long*)aligned));
+ HDprintf(" %29lu\n", *((unsigned long*)aligned));
break;
case INT_LLONG:
HDmemcpy(aligned, buf+j*sizeof(long long), sizeof(long long));
@@ -2572,40 +2566,40 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
break;
}
- printf(" ans = ");
+ HDprintf(" ans = ");
for (k=0; k<dst_size; k++)
- printf(" %02x", hw[ENDIAN(dst_size, k, endian)]);
- printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
+ HDprintf(" %02x", hw[ENDIAN(dst_size, k, endian)]);
+ HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
switch (dst_type) {
case INT_SCHAR:
- printf(" %29d\n", (int)*((signed char*)hw));
+ HDprintf(" %29d\n", (int)*((signed char*)((void *)hw)));
break;
case INT_UCHAR:
- printf(" %29u\n", (unsigned)*((unsigned char*)hw));
+ HDprintf(" %29u\n", (unsigned)*((unsigned char*)((void *)hw)));
break;
case INT_SHORT:
- printf(" %29hd\n", *((short*)hw));
+ HDprintf(" %29hd\n", *((short*)((void *)hw)));
break;
case INT_USHORT:
- printf(" %29hu\n", *((unsigned short*)hw));
+ HDprintf(" %29hu\n", *((unsigned short*)((void *)hw)));
break;
case INT_INT:
- printf(" %29d\n", *((int*)hw));
+ HDprintf(" %29d\n", *((int*)((void *)hw)));
break;
case INT_UINT:
- printf(" %29u\n", *((unsigned*)hw));
+ HDprintf(" %29u\n", *((unsigned*)((void *)hw)));
break;
case INT_LONG:
- printf(" %29ld\n", *((long*)hw));
+ HDprintf(" %29ld\n", *((long*)((void *)hw)));
break;
case INT_ULONG:
- printf(" %29lu\n", *((unsigned long*)hw));
+ HDprintf(" %29lu\n", *((unsigned long*)((void *)hw)));
break;
case INT_LLONG:
- HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)hw));
+ HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)((void *)hw)));
break;
case INT_ULLONG:
- HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)hw));
+ HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)((void *)hw)));
break;
case FLT_FLOAT:
case FLT_DOUBLE:
@@ -2633,7 +2627,7 @@ done:
/* Restore the default error handler (set in h5_reset()) */
h5_restore_err();
- reset_hdf5(); /*print statistics*/
+ reset_hdf5(); /*print statistics*/
return (int)fails_all_tests;
@@ -2646,23 +2640,23 @@ error:
/* Restore the default error handler (set in h5_reset()) */
h5_restore_err();
- reset_hdf5(); /*print statistics*/
+ reset_hdf5(); /*print statistics*/
return MAX((int)fails_all_tests, 1);
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_conv_int_2
+ * Function: test_conv_int_2
*
- * Purpose: Tests overlap calculates in H5T__conv_i_i(), which should be
- * the same as for H5T__conv_f_f() and H5T__conv_s_s().
+ * Purpose: Tests overlap calculates in H5T__conv_i_i(), which should be
+ * the same as for H5T__conv_f_f() and H5T__conv_s_s().
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, April 30, 1999
*
* Modifications:
@@ -2672,50 +2666,50 @@ error:
static int
test_conv_int_2(void)
{
- int i, j;
- hid_t src_type, dst_type;
- char *buf;
+ int i, j;
+ hid_t src_type, dst_type;
+ char *buf;
- printf("%-70s", "Testing overlap calculations");
+ HDprintf("%-70s", "Testing overlap calculations");
HDfflush(stdout);
buf = (char *)HDcalloc(TMP_BUF_DIM1, TMP_BUF_DIM2);
HDassert(buf);
for(i = 1; i <= TMP_BUF_DIM1; i++) {
- for(j = 1; j <= TMP_BUF_DIM1; j++) {
-
- /* Source type */
- src_type = H5Tcopy(H5T_NATIVE_CHAR);
- H5Tset_size(src_type, (size_t)i);
-
- /* Destination type */
- dst_type = H5Tcopy(H5T_NATIVE_CHAR);
- H5Tset_size(dst_type, (size_t)j);
-
- /*
- * Conversion. If overlap calculations aren't right then an
- * assertion will fail in H5T__conv_i_i()
- */
- H5Tconvert(src_type, dst_type, (size_t)TMP_BUF_DIM2, buf, NULL, H5P_DEFAULT);
- H5Tclose(src_type);
- H5Tclose(dst_type);
- }
+ for(j = 1; j <= TMP_BUF_DIM1; j++) {
+
+ /* Source type */
+ src_type = H5Tcopy(H5T_NATIVE_CHAR);
+ H5Tset_size(src_type, (size_t)i);
+
+ /* Destination type */
+ dst_type = H5Tcopy(H5T_NATIVE_CHAR);
+ H5Tset_size(dst_type, (size_t)j);
+
+ /*
+ * Conversion. If overlap calculations aren't right then an
+ * assertion will fail in H5T__conv_i_i()
+ */
+ H5Tconvert(src_type, dst_type, (size_t)TMP_BUF_DIM2, buf, NULL, H5P_DEFAULT);
+ H5Tclose(src_type);
+ H5Tclose(dst_type);
+ }
}
PASSED();
HDfree(buf);
return 0;
}
-
+
/*-------------------------------------------------------------------------
- * Function: my_isnan
+ * Function: my_isnan
*
- * Purpose: Determines whether VAL points to NaN.
+ * Purpose: Determines whether VAL points to NaN.
*
- * Return: TRUE or FALSE
+ * Return: TRUE or FALSE
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, July 6, 1998
*
* Modifications:
@@ -2729,21 +2723,21 @@ my_isnan(dtype_t type, void *val)
char s[256];
if (FLT_FLOAT==type) {
- float x;
- HDmemcpy(&x, val, sizeof(float));
- retval = (x!=x);
+ float x;
+ HDmemcpy(&x, val, sizeof(float));
+ retval = (x!=x);
} else if (FLT_DOUBLE==type) {
- double x;
- HDmemcpy(&x, val, sizeof(double));
- retval = (x!=x);
+ double x;
+ HDmemcpy(&x, val, sizeof(double));
+ retval = (x!=x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0
} else if (FLT_LDOUBLE==type) {
- long double x;
- HDmemcpy(&x, val, sizeof(long double));
- retval = (x!=x);
+ long double x;
+ HDmemcpy(&x, val, sizeof(long double));
+ retval = (x!=x);
#endif
} else {
- return 0;
+ return 0;
}
/*
@@ -2751,42 +2745,42 @@ my_isnan(dtype_t type, void *val)
* the result contains a NaN string.
*/
if (!retval) {
- if (FLT_FLOAT==type) {
- float x;
+ if (FLT_FLOAT==type) {
+ float x;
- HDmemcpy(&x, val, sizeof(float));
- HDsnprintf(s, sizeof(s), "%g", (double)x);
- } else if (FLT_DOUBLE==type) {
- double x;
+ HDmemcpy(&x, val, sizeof(float));
+ HDsnprintf(s, sizeof(s), "%g", (double)x);
+ } else if (FLT_DOUBLE==type) {
+ double x;
- HDmemcpy(&x, val, sizeof(double));
- HDsnprintf(s, sizeof(s), "%g", x);
+ HDmemcpy(&x, val, sizeof(double));
+ HDsnprintf(s, sizeof(s), "%g", x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0
- } else if (FLT_LDOUBLE==type) {
- long double x;
+ } else if (FLT_LDOUBLE==type) {
+ long double x;
- HDmemcpy(&x, val, sizeof(long double));
- HDsnprintf(s, sizeof(s), "%Lg", x);
+ HDmemcpy(&x, val, sizeof(long double));
+ HDsnprintf(s, sizeof(s), "%Lg", x);
#endif
- } else {
- return 0;
- }
- if (HDstrstr(s, "NaN") || HDstrstr(s, "NAN") || HDstrstr(s, "nan"))
- retval = 1;
+ } else {
+ return 0;
+ }
+ if (HDstrstr(s, "NaN") || HDstrstr(s, "NAN") || HDstrstr(s, "nan"))
+ retval = 1;
}
return retval;
}
-
+
/*-------------------------------------------------------------------------
- * Function: my_isinf
+ * Function: my_isinf
*
- * Purpose: Determines whether VAL points to +/-infinity.
+ * Purpose: Determines whether VAL points to +/-infinity.
*
- * Return: TRUE or FALSE
+ * Return: TRUE or FALSE
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Monday, June 20, 2005
*
* Modifications:
@@ -2815,70 +2809,70 @@ my_isinf(int endian, unsigned char *val, size_t size,
return retval;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_conv_flt_1
+ * Function: test_conv_flt_1
*
- * Purpose: Test conversion of floating point values from SRC to
- * DST. These types should be H5T_NATIVE_FLOAT,
- * H5T_NATIVE_DOUBLE, or H5T_NATIVE_LDOUBLE.
+ * Purpose: Test conversion of floating point values from SRC to
+ * DST. These types should be H5T_NATIVE_FLOAT,
+ * H5T_NATIVE_DOUBLE, or H5T_NATIVE_LDOUBLE.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, June 23, 1998
*
* Modifications:
- * Albert Cheng, Apr 16, 2004
- * Check for underflow condition. If the src number is
- * smaller than the dst MIN float number, consider it okay
- * if the converted sw and hw dst are both less than or
- * equal to the dst MIN float number.
+ * Albert Cheng, Apr 16, 2004
+ * Check for underflow condition. If the src number is
+ * smaller than the dst MIN float number, consider it okay
+ * if the converted sw and hw dst are both less than or
+ * equal to the dst MIN float number.
*
*-------------------------------------------------------------------------
*/
static int
test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
{
- dtype_t src_type, dst_type; /*data types */
- 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 */
- const char *src_type_name = NULL; /*source type name */
- const char *dst_type_name = NULL; /*destination type name */
- size_t src_size, dst_size; /*type sizes */
- unsigned char *buf = NULL; /*buffer for conversion */
- unsigned char *saved = NULL; /*original values */
- char str[256]; /*hello string */
- void *aligned=NULL; /*aligned buffer */
- float hw_f; /*hardware-converted */
- double hw_d; /*hardware-converted */
+ dtype_t src_type, dst_type; /*data types */
+ 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 */
+ const char *src_type_name = NULL; /*source type name */
+ const char *dst_type_name = NULL; /*destination type name */
+ size_t src_size, dst_size; /*type sizes */
+ unsigned char *buf = NULL; /*buffer for conversion */
+ unsigned char *saved = NULL; /*original values */
+ char str[256]; /*hello string */
+ void *aligned=NULL; /*aligned buffer */
+ float hw_f; /*hardware-converted */
+ double hw_d; /*hardware-converted */
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE
- long double hw_ld; /*hardware-converted */
+ long double hw_ld; /*hardware-converted */
#endif
- unsigned char *hw=NULL; /*ptr to hardware-conv'd*/
- int underflow; /*underflow occurred */
- int overflow = 0; /*overflow occurred */
- int uflow=0; /*underflow debug counters*/
- size_t j, k; /*counters */
- int sendian; /* source type endianess */
- int dendian; /* Destination type endianess */
- size_t dst_ebias; /* Destination type's exponent bias */
- size_t src_epos; /* Source type's exponent position */
- size_t src_esize; /* Source type's exponent size */
- size_t dst_epos; /* Destination type's exponent position */
- size_t dst_esize; /* Destination type's exponent size */
- size_t dst_mpos; /* Destination type's mantissa position */
- size_t dst_msize; /* Destination type's mantissa size */
- size_t src_nbits; /* source length in bits */
- size_t dst_nbits; /* dst length in bits */
+ unsigned char *hw=NULL; /*ptr to hardware-conv'd*/
+ int underflow; /*underflow occurred */
+ int overflow = 0; /*overflow occurred */
+ int uflow=0; /*underflow debug counters*/
+ size_t j, k; /*counters */
+ int sendian; /* source type endianess */
+ int dendian; /* Destination type endianess */
+ size_t dst_ebias; /* Destination type's exponent bias */
+ size_t src_epos; /* Source type's exponent position */
+ size_t src_esize; /* Source type's exponent size */
+ size_t dst_epos; /* Destination type's exponent position */
+ size_t dst_esize; /* Destination type's exponent size */
+ size_t dst_mpos; /* Destination type's mantissa position */
+ size_t dst_msize; /* Destination type's mantissa size */
+ size_t src_nbits; /* source length in bits */
+ size_t dst_nbits; /* dst length in bits */
#ifdef HANDLE_SIGFPE
- pid_t child_pid; /*process ID of child */
- int status; /*child exit status */
+ pid_t child_pid; /*process ID of child */
+ int status; /*child exit status */
/*
* Some systems generage SIGFPE during floating point overflow and we
@@ -2889,22 +2883,22 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
HDfflush(stdout);
HDfflush(stderr);
if ((child_pid=fork()) < 0) {
- HDperror("fork");
- return 1;
+ HDperror("fork");
+ return 1;
} else if (child_pid>0) {
- 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<src_size; k++)
- printf(" %02x", saved[j*src_size+ENDIAN(src_size,k,sendian)]);
- printf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), "");
+ HDprintf(" %02x", saved[j*src_size+ENDIAN(src_size,k,sendian)]);
+ HDprintf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), "");
if (FLT_FLOAT==src_type) {
float x;
HDmemcpy(&x, &saved[j*src_size], sizeof(float));
- printf(" %29.20e\n", (double)x);
+ HDprintf(" %29.20e\n", (double)x);
} else if (FLT_DOUBLE==src_type) {
double x;
HDmemcpy(&x, &saved[j*src_size], sizeof(double));
- printf(" %29.20e\n", x);
+ HDprintf(" %29.20e\n", x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE
} else {
long double x;
@@ -3286,18 +3280,18 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
#endif
}
- printf(" dst =");
+ HDprintf(" dst =");
for (k=0; k<dst_size; k++)
- printf(" %02x", buf[j*dst_size+ENDIAN(dst_size,k,dendian)]);
- printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
+ HDprintf(" %02x", buf[j*dst_size+ENDIAN(dst_size,k,dendian)]);
+ HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
if (FLT_FLOAT==dst_type) {
float x;
HDmemcpy(&x, &buf[j*dst_size], sizeof(float));
- printf(" %29.20e\n", (double)x);
+ HDprintf(" %29.20e\n", (double)x);
} else if (FLT_DOUBLE==dst_type) {
double x;
HDmemcpy(&x, &buf[j*dst_size], sizeof(double));
- printf(" %29.20e\n", x);
+ HDprintf(" %29.20e\n", x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE
} else {
long double x;
@@ -3306,14 +3300,14 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
#endif
}
- printf(" ans =");
+ HDprintf(" ans =");
for (k=0; k<dst_size; k++)
- printf(" %02x", hw[ENDIAN(dst_size,k,dendian)]);
- printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
+ HDprintf(" %02x", hw[ENDIAN(dst_size,k,dendian)]);
+ HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
if (FLT_FLOAT==dst_type)
- printf(" %29.20e\n", (double)hw_f);
+ HDprintf(" %29.20e\n", (double)hw_f);
else if (FLT_DOUBLE==dst_type)
- printf(" %29.20e\n", hw_d);
+ HDprintf(" %29.20e\n", hw_d);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE
else
HDfprintf(stdout," %29.20Le\n", hw_ld);
@@ -3386,24 +3380,24 @@ error:
#endif
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_conv_int_fp
+ * Function: test_conv_int_fp
*
- * Purpose: Test conversion between integer and float values
+ * Purpose: Test conversion between integer and float values
* from SRC to DST. These types should be any combination of:
*
- * H5T_NATIVE_SCHAR H5T_NATIVE_FLOAT
- * H5T_NATIVE_SHORT H5T_NATIVE_DOUBLE
- * H5T_NATIVE_INT H5T_NATIVE_LDOUBLE
- * H5T_NATIVE_LONG
- * H5T_NATIVE_LLONG
+ * H5T_NATIVE_SCHAR H5T_NATIVE_FLOAT
+ * H5T_NATIVE_SHORT H5T_NATIVE_DOUBLE
+ * H5T_NATIVE_INT H5T_NATIVE_LDOUBLE
+ * H5T_NATIVE_LONG
+ * H5T_NATIVE_LLONG
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Thursday, November 6, 2003
*
* Modifications:
@@ -3418,143 +3412,143 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
H5T_conv_except_func_t op; /*returned callback function for conversion exception*/
void *user_data; /*returned pointer to user data passed in to the callback*/
hbool_t except_set = FALSE; /*whether user's exception handling is set*/
- size_t nelmts=0; /*num values per test */
- const size_t max_fails=40; /*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; /*data types */
- dtype_t dst_type; /*data types */
- const char *src_type_name=NULL; /*source type name */
- const char *dst_type_name=NULL; /*destination type name */
- int sendian; /*source endianess */
- int dendian; /*destination 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 */
- void *aligned=NULL; /*aligned temp buffer */
- float hw_float=0;
- double hw_double=0;
- long double hw_ldouble=0;
- signed char hw_schar=0;
- unsigned char hw_uchar=0;
- short hw_short=0;
- unsigned short hw_ushort=0;
- int hw_int=0;
- unsigned hw_uint=0;
- long hw_long=0;
- unsigned long hw_ulong=0;
- long long hw_llong=0;
- unsigned long long hw_ullong=0;
+ size_t nelmts=0; /*num values per test */
+ const size_t max_fails=40; /*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; /*data types */
+ dtype_t dst_type; /*data types */
+ const char *src_type_name=NULL; /*source type name */
+ const char *dst_type_name=NULL; /*destination type name */
+ int sendian; /*source endianess */
+ int dendian; /*destination 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 */
+ void *aligned=NULL; /*aligned temp buffer */
+ float hw_float=0;
+ double hw_double=0;
+ long double hw_ldouble=0;
+ signed char hw_schar=0;
+ unsigned char hw_uchar=0;
+ short hw_short=0;
+ unsigned short hw_ushort=0;
+ int hw_int=0;
+ unsigned hw_uint=0;
+ long hw_long=0;
+ unsigned long hw_ulong=0;
+ long long hw_llong=0;
+ unsigned long long hw_ullong=0;
/* What is the name of the source type */
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 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;
}
/* What is the name of the destination type */
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 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 */
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;
}
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<src_size; k++)
- printf(" %02x", saved[j*src_size+ENDIAN(src_size, k, sendian)]);
- printf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), "");
+ HDprintf(" %02x", saved[j*src_size+ENDIAN(src_size, k, sendian)]);
+ HDprintf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), "");
switch (src_type) {
case INT_SCHAR:
HDmemcpy(aligned, saved+j*sizeof(signed char), sizeof(signed char));
- printf(" %29d\n", (int)*((signed char*)aligned));
+ HDprintf(" %29d\n", (int)*((signed char*)aligned));
break;
case INT_UCHAR:
HDmemcpy(aligned, saved+j*sizeof(unsigned char), sizeof(unsigned char));
- printf(" %29u\n", (unsigned)*((unsigned char*)aligned));
+ HDprintf(" %29u\n", (unsigned)*((unsigned char*)aligned));
break;
case INT_SHORT:
HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short));
- printf(" %29hd\n", *((short*)aligned));
+ HDprintf(" %29hd\n", *((short*)aligned));
break;
case INT_USHORT:
HDmemcpy(aligned, saved+j*sizeof(unsigned short), sizeof(unsigned short));
- printf(" %29hu\n", *((unsigned short*)aligned));
+ HDprintf(" %29hu\n", *((unsigned short*)aligned));
break;
case INT_INT:
HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int));
- printf(" %29d\n", *((int*)aligned));
+ HDprintf(" %29d\n", *((int*)aligned));
break;
case INT_UINT:
HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned));
- printf(" %29u\n", *((unsigned*)aligned));
+ HDprintf(" %29u\n", *((unsigned*)aligned));
break;
case INT_LONG:
HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long));
- printf(" %29ld\n", *((long*)aligned));
+ HDprintf(" %29ld\n", *((long*)aligned));
break;
case INT_ULONG:
HDmemcpy(aligned, saved+j*sizeof(unsigned long), sizeof(unsigned long));
- printf(" %29lu\n", *((unsigned long*)aligned));
+ HDprintf(" %29lu\n", *((unsigned long*)aligned));
break;
case INT_LLONG:
HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long));
@@ -4396,16 +4390,16 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
break;
case FLT_FLOAT:
HDmemcpy(aligned, saved+j*sizeof(float), sizeof(float));
- printf(" %29f\n", (double)*((float*)aligned));
+ HDprintf(" %29f\n", (double)*((float*)aligned));
break;
case FLT_DOUBLE:
HDmemcpy(aligned, saved+j*sizeof(double), sizeof(double));
- printf(" %29f\n", *((double*)aligned));
+ HDprintf(" %29f\n", *((double*)aligned));
break;
#if H5_SIZEOF_LONG_DOUBLE !=0
case FLT_LDOUBLE:
HDmemcpy(aligned, saved+j*sizeof(long double), sizeof(long double));
- printf(" %29Lf\n", *((long double*)aligned));
+ HDprintf(" %29Lf\n", *((long double*)aligned));
break;
#endif
case OTHER:
@@ -4414,42 +4408,42 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
break;
}
- printf(" dst = ");
+ HDprintf(" dst = ");
for (k=0; k<dst_size; k++)
- printf(" %02x", buf[j*dst_size+ENDIAN(dst_size, k, dendian)]);
- printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
+ HDprintf(" %02x", buf[j*dst_size+ENDIAN(dst_size, k, dendian)]);
+ HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
switch (dst_type) {
case INT_SCHAR:
HDmemcpy(aligned, buf+j*sizeof(signed char), sizeof(signed char));
- printf(" %29d\n", (int)*((signed char*)aligned));
+ HDprintf(" %29d\n", (int)*((signed char*)aligned));
break;
case INT_UCHAR:
HDmemcpy(aligned, buf+j*sizeof(unsigned char), sizeof(unsigned char));
- printf(" %29u\n", (unsigned)*((unsigned char*)aligned));
+ HDprintf(" %29u\n", (unsigned)*((unsigned char*)aligned));
break;
case INT_SHORT:
HDmemcpy(aligned, buf+j*sizeof(short), sizeof(short));
- printf(" %29hd\n", *((short*)aligned));
+ HDprintf(" %29hd\n", *((short*)aligned));
break;
case INT_USHORT:
HDmemcpy(aligned, buf+j*sizeof(unsigned short), sizeof(unsigned short));
- printf(" %29hu\n", *((unsigned short*)aligned));
+ HDprintf(" %29hu\n", *((unsigned short*)aligned));
break;
case INT_INT:
HDmemcpy(aligned, buf+j*sizeof(int), sizeof(int));
- printf(" %29d\n", *((int*)aligned));
+ HDprintf(" %29d\n", *((int*)aligned));
break;
case INT_UINT:
HDmemcpy(aligned, buf+j*sizeof(unsigned), sizeof(unsigned));
- printf(" %29u\n", *((unsigned*)aligned));
+ HDprintf(" %29u\n", *((unsigned*)aligned));
break;
case INT_LONG:
HDmemcpy(aligned, buf+j*sizeof(long), sizeof(long));
- printf(" %29ld\n", *((long*)aligned));
+ HDprintf(" %29ld\n", *((long*)aligned));
break;
case INT_ULONG:
HDmemcpy(aligned, buf+j*sizeof(unsigned long), sizeof(unsigned long));
- printf(" %29lu\n", *((unsigned long*)aligned));
+ HDprintf(" %29lu\n", *((unsigned long*)aligned));
break;
case INT_LLONG:
HDmemcpy(aligned, buf+j*sizeof(long long), sizeof(long long));
@@ -4461,16 +4455,16 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
break;
case FLT_FLOAT:
HDmemcpy(aligned, buf+j*sizeof(float), sizeof(float));
- printf(" %29f\n", (double)*((float*)aligned));
+ HDprintf(" %29f\n", (double)*((float*)aligned));
break;
case FLT_DOUBLE:
HDmemcpy(aligned, buf+j*sizeof(double), sizeof(double));
- printf(" %29f\n", *((double*)aligned));
+ HDprintf(" %29f\n", *((double*)aligned));
break;
#if H5_SIZEOF_LONG_DOUBLE !=0
case FLT_LDOUBLE:
HDmemcpy(aligned, buf+j*sizeof(long double), sizeof(long double));
- printf(" %29Lf\n", *((long double*)aligned));
+ HDprintf(" %29Lf\n", *((long double*)aligned));
break;
#endif
case OTHER:
@@ -4479,50 +4473,50 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
break;
}
- printf(" ans = ");
+ HDprintf(" ans = ");
for (k=0; k<dst_size; k++)
- printf(" %02x", hw[ENDIAN(dst_size, k, dendian)]);
- printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
+ HDprintf(" %02x", hw[ENDIAN(dst_size, k, dendian)]);
+ HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
switch (dst_type) {
case INT_SCHAR:
- printf(" %29d\n", (int)*((signed char*)hw));
+ HDprintf(" %29d\n", (int)*((signed char*)((void *)hw)));
break;
case INT_UCHAR:
- printf(" %29u\n", (unsigned)*((unsigned char*)hw));
+ HDprintf(" %29u\n", (unsigned)*((unsigned char*)((void *)hw)));
break;
case INT_SHORT:
- printf(" %29hd\n", *((short*)hw));
+ HDprintf(" %29hd\n", *((short*)((void *)hw)));
break;
case INT_USHORT:
- printf(" %29hu\n", *((unsigned short*)hw));
+ HDprintf(" %29hu\n", *((unsigned short*)((void *)hw)));
break;
case INT_INT:
- printf(" %29d\n", *((int*)hw));
+ HDprintf(" %29d\n", *((int*)((void *)hw)));
break;
case INT_UINT:
- printf(" %29u\n", *((unsigned int*)hw));
+ HDprintf(" %29u\n", *((unsigned int*)((void *)hw)));
break;
case INT_LONG:
- printf(" %29ld\n", *((long*)hw));
+ HDprintf(" %29ld\n", *((long*)((void *)hw)));
break;
case INT_ULONG:
- printf(" %29lu\n", *((unsigned long*)hw));
+ HDprintf(" %29lu\n", *((unsigned long*)((void *)hw)));
break;
case INT_LLONG:
- HDfprintf(stdout, " %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)hw));
+ HDfprintf(stdout, " %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)((void *)hw)));
break;
case INT_ULLONG:
- HDfprintf(stdout, " %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)hw));
+ HDfprintf(stdout, " %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)((void *)hw)));
break;
case FLT_FLOAT:
- printf(" %29f\n", (double)*((float*)hw));
+ HDprintf(" %29f\n", (double)*((float*)((void *)hw)));
break;
case FLT_DOUBLE:
- printf(" %29f\n", *((double*)hw));
+ HDprintf(" %29f\n", *((double*)((void *)hw)));
break;
#if H5_SIZEOF_LONG_DOUBLE !=0
case FLT_LDOUBLE:
- printf(" %29Lf\n", *((long double*)hw));
+ HDprintf(" %29Lf\n", *((long double*)((void *)hw)));
break;
#endif
case OTHER:
@@ -4555,7 +4549,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
/* Restore the default error handler (set in h5_reset()) */
h5_restore_err();
- reset_hdf5(); /*print statistics*/
+ reset_hdf5(); /*print statistics*/
/* If the source is normalized floating values, treat the failures as error;
* if it is denormalized or special floating values, treat the failure as warning.*/
@@ -4573,7 +4567,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
/* Restore the default error handler (set in h5_reset()) */
h5_restore_err();
- reset_hdf5(); /*print statistics*/
+ reset_hdf5(); /*print statistics*/
if(run_test==TEST_NORMAL)
return MAX((int)fails_all_tests, 1);
@@ -4583,19 +4577,19 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
}
}
-
+
/*-------------------------------------------------------------------------
- * Function: overflows
+ * Function: overflows
*
- * Purpose: When convert from float or double to any integer type,
+ * Purpose: When convert from float or double to any integer type,
* check if overflow occurs.
*
*
- * Return: TRUE: overflow happens
+ * Return: TRUE: overflow happens
*
* FALSE: no overflow
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Monday, Nov 17, 2003
*
* Modifications:
@@ -4675,15 +4669,15 @@ done:
return ret_value;
}
-
+
/*-------------------------------------------------------------------------
- * Function: run_integer_tests
+ * Function: run_integer_tests
*
- * Purpose: Runs all integer tests.
+ * Purpose: Runs all integer tests.
*
- * Return: Number of errors
+ * Return: Number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, November 24, 1998
*
* Modifications:
@@ -4693,7 +4687,7 @@ done:
static int
run_integer_tests(const char *name)
{
- int nerrors = 0;
+ int nerrors = 0;
nerrors += test_conv_int_1(name, H5T_NATIVE_SCHAR, H5T_NATIVE_UCHAR);
nerrors += test_conv_int_1(name, H5T_NATIVE_SCHAR, H5T_NATIVE_SHORT);
@@ -4838,15 +4832,15 @@ run_integer_tests(const char *name)
return nerrors;
}
-
+
/*-------------------------------------------------------------------------
- * Function: run_fp_tests
+ * Function: run_fp_tests
*
- * Purpose: Runs all floating-point tests.
+ * Purpose: Runs all floating-point tests.
*
- * Return: Number of errors
+ * Return: Number of errors
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Tuesday, March 22, 2005
*
* Modifications:
@@ -4856,7 +4850,7 @@ run_integer_tests(const char *name)
static int
run_fp_tests(const char *name)
{
- int nerrors = 0;
+ int nerrors = 0;
if(!strcmp(name, "noop")) {
nerrors += test_conv_flt_1("noop", TEST_NOOP, H5T_NATIVE_FLOAT, H5T_NATIVE_FLOAT);
@@ -4887,11 +4881,11 @@ run_fp_tests(const char *name)
nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT);
#else
{
- char str[256]; /*string */
+ char str[256]; /*string */
HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %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/dtransform.c b/test/dtransform.c
index f022699..6f7e8a4 100644
--- a/test/dtransform.c
+++ b/test/dtransform.c
@@ -34,17 +34,17 @@ hid_t dset_id_float_chunk = -1;
const float windchillFfloat[ROWS][COLS] =
{ {36.0f, 31.0f, 25.0f, 19.0f, 13.0f, 7.0f, 1.0f, -5.0f, -11.0f, -16.0f, -22.0f, -28.0f, -34.0f, -40.0f, -46.0f, -52.0f, -57.0f, -63.0f},
- {34.0f, 27.0f, 21.0f, 15.0f, 9.0f, 3.0f, -4.0f, -10.0f, -16.0f, -22.0f, -28.0f, -35.0f, -41.0f, -47.0f, -53.0f, -59.0f, -66.0f, -72.0f} ,
- {32.0f, 25.0f, 19.0f, 13.0f, 6.0f, 0.0f, -7.0f, -13.0f, -19.0f, -26.0f, -32.0f, -39.0f, -45.0f, -51.0f, -58.0f, -64.0f, -71.0f, -77.0f},
- {30.0f, 24.0f, 17.0f, 11.0f, 4.0f, -2.0f, -9.0f, -15.0f, -22.0f, -29.0f, -35.0f, -42.0f, -48.0f, -55.0f, -61.0f, -68.0f, -74.0f, -81.0f},
- {29.0f, 23.0f, 16.0f, 9.0f, 3.0f, -4.0f, -11.0f, -17.0f, -24.0f, -31.0f, -37.0f, -44.0f, -51.0f, -58.0f, -64.0f, -71.0f, -78.0f, -84.0f},
- {28.0f, 22.0f, 15.0f, 8.0f, 1.0f, -5.0f, -12.0f, -19.0f, -26.0f, -33.0f, -39.0f, -46.0f, -53.0f, -60.0f, -67.0f, -73.0f, -80.0f, -87.0f},
- {28.0f, 21.0f, 14.0f, 7.0f, 0.0f, -7.0f, -14.0f, -21.0f, -27.0f, -34.0f, -41.0f, -48.0f, -55.0f, -62.0f, -69.0f, -76.0f, -82.0f, -89.0f},
- {27.0f, 20.0f, 13.0f, 6.0f, -1.0f, -8.0f, -15.0f, -22.0f, -29.0f, -36.0f, -43.0f, -50.0f, -57.0f, -64.0f, -71.0f, -78.0f, -84.0f, -91.0f},
- {26.0f, 19.0f, 12.0f, 5.0f, -2.0f, -9.0f, -16.0f, -23.0f, -30.0f, -37.0f, -44.0f, -51.0f, -58.0f, -65.0f, -72.0f, -79.0f, -86.0f, -93.0f},
- {26.0f, 19.0f, 12.0f, 4.0f, -3.0f, -10.0f, -17.0f, -24.0f, -31.0f, -38.0f, -45.0f, -52.0f, -60.0f, -67.0f, -74.0f, -81.0f, -88.0f, -95.0f},
- {25.0f, 18.0f, 11.0f, 4.0f, -3.0f, -11.0f, -18.0f, -25.0f, -32.0f, -39.0f, -46.0f, -54.0f, -61.0f, -68.0f, -75.0f, -82.0f, -89.0f, -97.0f},
- {25.0f, 17.0f, 10.0f, 3.0f, -4.0f, -11.0f, -19.0f, -26.0f, -33.0f, -40.0f, -48.0f, -55.0f, -62.0f, -69.0f, -76.0f, -84.0f, -91.0f, -98.0f}
+ {34.0f, 27.0f, 21.0f, 15.0f, 9.0f, 3.0f, -4.0f, -10.0f, -16.0f, -22.0f, -28.0f, -35.0f, -41.0f, -47.0f, -53.0f, -59.0f, -66.0f, -72.0f} ,
+ {32.0f, 25.0f, 19.0f, 13.0f, 6.0f, 0.0f, -7.0f, -13.0f, -19.0f, -26.0f, -32.0f, -39.0f, -45.0f, -51.0f, -58.0f, -64.0f, -71.0f, -77.0f},
+ {30.0f, 24.0f, 17.0f, 11.0f, 4.0f, -2.0f, -9.0f, -15.0f, -22.0f, -29.0f, -35.0f, -42.0f, -48.0f, -55.0f, -61.0f, -68.0f, -74.0f, -81.0f},
+ {29.0f, 23.0f, 16.0f, 9.0f, 3.0f, -4.0f, -11.0f, -17.0f, -24.0f, -31.0f, -37.0f, -44.0f, -51.0f, -58.0f, -64.0f, -71.0f, -78.0f, -84.0f},
+ {28.0f, 22.0f, 15.0f, 8.0f, 1.0f, -5.0f, -12.0f, -19.0f, -26.0f, -33.0f, -39.0f, -46.0f, -53.0f, -60.0f, -67.0f, -73.0f, -80.0f, -87.0f},
+ {28.0f, 21.0f, 14.0f, 7.0f, 0.0f, -7.0f, -14.0f, -21.0f, -27.0f, -34.0f, -41.0f, -48.0f, -55.0f, -62.0f, -69.0f, -76.0f, -82.0f, -89.0f},
+ {27.0f, 20.0f, 13.0f, 6.0f, -1.0f, -8.0f, -15.0f, -22.0f, -29.0f, -36.0f, -43.0f, -50.0f, -57.0f, -64.0f, -71.0f, -78.0f, -84.0f, -91.0f},
+ {26.0f, 19.0f, 12.0f, 5.0f, -2.0f, -9.0f, -16.0f, -23.0f, -30.0f, -37.0f, -44.0f, -51.0f, -58.0f, -65.0f, -72.0f, -79.0f, -86.0f, -93.0f},
+ {26.0f, 19.0f, 12.0f, 4.0f, -3.0f, -10.0f, -17.0f, -24.0f, -31.0f, -38.0f, -45.0f, -52.0f, -60.0f, -67.0f, -74.0f, -81.0f, -88.0f, -95.0f},
+ {25.0f, 18.0f, 11.0f, 4.0f, -3.0f, -11.0f, -18.0f, -25.0f, -32.0f, -39.0f, -46.0f, -54.0f, -61.0f, -68.0f, -75.0f, -82.0f, -89.0f, -97.0f},
+ {25.0f, 17.0f, 10.0f, 3.0f, -4.0f, -11.0f, -19.0f, -26.0f, -33.0f, -40.0f, -48.0f, -55.0f, -62.0f, -69.0f, -76.0f, -84.0f, -91.0f, -98.0f}
};
const int transformData[ROWS][COLS] =
@@ -62,202 +62,202 @@ const int transformData[ROWS][COLS] =
{25, 17, 10, 3, 4, 11, 19, 26, 33, 40, 48, 55, 62, 69, 4, 12, 19, 26}
};
-#define UCOMPARE(TYPE,VAR1,VAR2,TOL) \
-{ \
- size_t i,j; \
- \
- for(i=0; i<ROWS; i++) \
- for(j=0; j<COLS; j++) \
- { \
- if(!( (((VAR1)[i][j] >= (TYPE)((VAR2)[i][j])) && ( ((VAR1)[i][j] - TOL) < (TYPE)((VAR2)[i][j]))) || ( ((VAR1)[i][j] <= (TYPE)((VAR2)[i][j])) && ( ((VAR1)[i][j] + TOL) > (TYPE)((VAR2)[i][j]))))) \
- { \
- H5_FAILED(); \
- fprintf(stderr, " ERROR: Conversion failed to match computed data\n"); \
- goto error; \
- } \
- } \
- PASSED(); \
+#define UCOMPARE(TYPE,VAR1,VAR2,TOL) \
+{ \
+ size_t i,j; \
+ \
+ for(i=0; i<ROWS; i++) \
+ for(j=0; j<COLS; j++) \
+ { \
+ if(!( (((VAR1)[i][j] >= (TYPE)((VAR2)[i][j])) && ( ((VAR1)[i][j] - TOL) < (TYPE)((VAR2)[i][j]))) || ( ((VAR1)[i][j] <= (TYPE)((VAR2)[i][j])) && ( ((VAR1)[i][j] + TOL) > (TYPE)((VAR2)[i][j]))))) \
+ { \
+ H5_FAILED(); \
+ HDfprintf(stderr, " ERROR: Conversion failed to match computed data\n"); \
+ goto error; \
+ } \
+ } \
+ PASSED(); \
}
-#define COMPARE(TYPE,VAR1,VAR2,TOL) \
-{ \
- size_t i,j; \
- \
- for(i=0; i<ROWS; i++) \
- for(j=0; j<COLS; j++) \
- { \
- if( !(((VAR1)[i][j] <= ((TYPE)(VAR2)[i][j] + TOL)) && ((VAR1)[i][j] >= ((TYPE)(VAR2)[i][j] - TOL))) ) \
- { \
- H5_FAILED(); \
- fprintf(stderr, " ERROR: Conversion failed to match computed data\n"); \
- goto error; \
- } \
- } \
- PASSED(); \
+#define COMPARE(TYPE,VAR1,VAR2,TOL) \
+{ \
+ size_t i,j; \
+ \
+ for(i=0; i<ROWS; i++) \
+ for(j=0; j<COLS; j++) \
+ { \
+ if( !(((VAR1)[i][j] <= ((TYPE)(VAR2)[i][j] + TOL)) && ((VAR1)[i][j] >= ((TYPE)(VAR2)[i][j] - TOL))) ) \
+ { \
+ H5_FAILED(); \
+ HDfprintf(stderr, " ERROR: Conversion failed to match computed data\n"); \
+ goto error; \
+ } \
+ } \
+ PASSED(); \
}
-#define COMPARE_INT(VAR1,VAR2) \
-{ \
- size_t i,j; \
- \
- for(i=0; i<ROWS; i++) \
- for(j=0; j<COLS; j++) \
- { \
- if( (VAR1)[i][j] != (VAR2)[i][j] ) \
- { \
- H5_FAILED(); \
- fprintf(stderr, " ERROR: data failed to match computed data\n"); \
- goto error; \
- } \
- } \
+#define COMPARE_INT(VAR1,VAR2) \
+{ \
+ size_t i,j; \
+ \
+ for(i=0; i<ROWS; i++) \
+ for(j=0; j<COLS; j++) \
+ { \
+ if( (VAR1)[i][j] != (VAR2)[i][j] ) \
+ { \
+ H5_FAILED(); \
+ HDfprintf(stderr, " ERROR: data failed to match computed data\n"); \
+ goto error; \
+ } \
+ } \
}
-#define TEST_TYPE_CONTIG(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \
-{ \
- TYPE array[ROWS][COLS]; \
- const char* f_to_c = "(5/9.0)*(x-32)"; \
+#define TEST_TYPE_CONTIG(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \
+{ \
+ TYPE array[ROWS][COLS]; \
+ const char* f_to_c = "(5/9.0)*(x-32)"; \
/* utrans is a transform for unsigned types: no negative numbers involved and results are < 255 to fit into uchar */ \
- const char* utrans = "((x+100)/4)*3"; \
- \
- hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, dset, dset_nn, dt_nn; \
+ const char* utrans = "((x+100)/4)*3"; \
+ \
+ hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, dset, dset_nn, dt_nn; \
H5T_order_t order; \
- hsize_t dim[2] = {ROWS, COLS}; \
- \
- if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \
+ hsize_t dim[2] = {ROWS, COLS}; \
+ \
+ if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \
if((dset = H5Dcreate2(file_id, "/transformtest_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; \
\
if((dt_nn = H5Tcopy(HDF_TYPE)) < 0) TEST_ERROR \
if((order = H5Tget_order(dt_nn)) == H5T_ORDER_ERROR) TEST_ERROR \
if(H5Tset_order(dt_nn, order == H5T_ORDER_LE ? H5T_ORDER_BE : H5T_ORDER_LE) < 0) TEST_ERROR \
- if((dset_nn = H5Dcreate2(file_id, "/nonnative_transformtest_"TEST_STR, dt_nn, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR \
+ if((dset_nn = H5Dcreate2(file_id, "/nonnative_transformtest_"TEST_STR, dt_nn, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR \
if(H5Tclose(dt_nn) < 0) TEST_ERROR \
- \
- if(SIGNED) \
- { \
- if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \
- if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \
- if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \
- if(H5Dwrite(dset_nn, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \
- if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \
- } \
- else \
- { \
- if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \
- if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \
- if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \
- if(H5Dwrite(dset_nn, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \
- if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \
- } \
- \
- \
- TESTING("contiguous, no data type conversion ("TEST_STR"->"TEST_STR")") \
- \
- if(H5Dread(dset, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \
- if(SIGNED) \
- COMPARE(TYPE, array, COMPARE_DATA, 2) \
- else \
- UCOMPARE(TYPE, array, COMPARE_DATA, 4) \
+ \
+ if(SIGNED) \
+ { \
+ if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \
+ if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \
+ if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \
+ if(H5Dwrite(dset_nn, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \
+ if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \
+ } \
+ else \
+ { \
+ if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \
+ if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \
+ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \
+ if(H5Dwrite(dset_nn, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \
+ if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \
+ } \
+ \
+ \
+ TESTING("contiguous, no data type conversion ("TEST_STR"->"TEST_STR")") \
+ \
+ if(H5Dread(dset, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \
+ if(SIGNED) \
+ COMPARE(TYPE, array, COMPARE_DATA, 2) \
+ else \
+ UCOMPARE(TYPE, array, COMPARE_DATA, 4) \
\
- TESTING("contiguous, byte order conversion ("TEST_STR"->"TEST_STR")") \
- \
- if(H5Dread(dset_nn, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \
- if(SIGNED) \
- COMPARE(TYPE, array, COMPARE_DATA, 2) \
- else \
- UCOMPARE(TYPE, array, COMPARE_DATA, 4) \
- \
- if(SIGNED) \
- { \
- TESTING("contiguous, with type conversion (float->"TEST_STR")") \
- \
- if(H5Dread(dset_id_float, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \
- COMPARE(TYPE, array, COMPARE_DATA, 2) \
- } \
- \
- if(H5Dclose(dset) < 0) TEST_ERROR; \
- if(H5Sclose(dataspace) < 0) TEST_ERROR; \
+ TESTING("contiguous, byte order conversion ("TEST_STR"->"TEST_STR")") \
+ \
+ if(H5Dread(dset_nn, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \
+ if(SIGNED) \
+ COMPARE(TYPE, array, COMPARE_DATA, 2) \
+ else \
+ UCOMPARE(TYPE, array, COMPARE_DATA, 4) \
+ \
+ if(SIGNED) \
+ { \
+ TESTING("contiguous, with type conversion (float->"TEST_STR")") \
+ \
+ if(H5Dread(dset_id_float, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \
+ COMPARE(TYPE, array, COMPARE_DATA, 2) \
+ } \
+ \
+ if(H5Dclose(dset) < 0) TEST_ERROR; \
+ if(H5Sclose(dataspace) < 0) TEST_ERROR; \
}
-#define TEST_TYPE_CHUNK(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \
-{ \
- TYPE array[ROWS][COLS]; \
- const char* f_to_c = "(5/9.0)*(x-32)"; \
+#define TEST_TYPE_CHUNK(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \
+{ \
+ TYPE array[ROWS][COLS]; \
+ const char* f_to_c = "(5/9.0)*(x-32)"; \
/* utrans is a transform for unsigned types: no negative numbers involved and results are < 255 to fit into uchar */ \
- const char* utrans = "((x+100)/4)*3"; \
- \
- hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, cparms, memspace, dset_chunk, filespace; \
- hsize_t dim[2] = {ROWS, COLS}; \
- hsize_t offset[2] = {0, 0}; \
- \
- \
- if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \
- \
- if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; \
- if(H5Pset_chunk(cparms, 2, dim) < 0) TEST_ERROR; \
- \
- if((dset_chunk = H5Dcreate2(file_id, "/transformtest_chunk_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; \
- if((filespace = H5Dget_space(dset_chunk)) < 0) TEST_ERROR \
- if((memspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR \
- if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) TEST_ERROR; \
- \
- if(SIGNED) \
- { \
- if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \
- if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \
- if(H5Dwrite(dset_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \
- if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \
- } \
- else \
- { \
- if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \
- if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \
- if(H5Dwrite(dset_chunk, H5T_NATIVE_INT, dataspace, filespace, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \
- if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \
- } \
- \
- \
- TESTING("chunked, no data type conversion ("TEST_STR"->"TEST_STR")") \
- \
- if(H5Dread(dset_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \
- if(SIGNED) \
- COMPARE(TYPE, array, COMPARE_DATA, 2) \
- else \
- UCOMPARE(TYPE, array, COMPARE_DATA, 4) \
- \
- if(SIGNED) \
- { \
- TESTING("chunked, with type conversion (float->"TEST_STR")") \
- \
- if(H5Dread(dset_id_float_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \
- COMPARE(TYPE, array, COMPARE_DATA, 2) \
- } \
- \
- \
- if(H5Pclose(cparms) < 0) TEST_ERROR; \
- if(H5Dclose(dset_chunk) < 0) TEST_ERROR; \
- if(H5Sclose(dataspace) < 0) TEST_ERROR; \
- if(H5Sclose(memspace) < 0) TEST_ERROR; \
+ const char* utrans = "((x+100)/4)*3"; \
+ \
+ hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, cparms, memspace, dset_chunk, filespace; \
+ hsize_t dim[2] = {ROWS, COLS}; \
+ hsize_t offset[2] = {0, 0}; \
+ \
+ \
+ if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \
+ \
+ if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; \
+ if(H5Pset_chunk(cparms, 2, dim) < 0) TEST_ERROR; \
+ \
+ if((dset_chunk = H5Dcreate2(file_id, "/transformtest_chunk_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; \
+ if((filespace = H5Dget_space(dset_chunk)) < 0) TEST_ERROR \
+ if((memspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR \
+ if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) TEST_ERROR; \
+ \
+ if(SIGNED) \
+ { \
+ if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \
+ if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \
+ if(H5Dwrite(dset_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \
+ if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \
+ } \
+ else \
+ { \
+ if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \
+ if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \
+ if(H5Dwrite(dset_chunk, H5T_NATIVE_INT, dataspace, filespace, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \
+ if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \
+ } \
+ \
+ \
+ TESTING("chunked, no data type conversion ("TEST_STR"->"TEST_STR")") \
+ \
+ if(H5Dread(dset_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \
+ if(SIGNED) \
+ COMPARE(TYPE, array, COMPARE_DATA, 2) \
+ else \
+ UCOMPARE(TYPE, array, COMPARE_DATA, 4) \
+ \
+ if(SIGNED) \
+ { \
+ TESTING("chunked, with type conversion (float->"TEST_STR")") \
+ \
+ if(H5Dread(dset_id_float_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \
+ COMPARE(TYPE, array, COMPARE_DATA, 2) \
+ } \
+ \
+ \
+ if(H5Pclose(cparms) < 0) TEST_ERROR; \
+ if(H5Dclose(dset_chunk) < 0) TEST_ERROR; \
+ if(H5Sclose(dataspace) < 0) TEST_ERROR; \
+ if(H5Sclose(memspace) < 0) TEST_ERROR; \
}
-#define INVALID_SET_TEST(TRANSFORM) \
-{ \
- if(H5Pset_data_transform(dxpl_id, TRANSFORM) < 0) \
- { \
- PASSED(); \
- } \
- else \
- { \
- H5_FAILED(); \
- fprintf(stderr, " ERROR: Data transform allowed invalid TRANSFORM transform to be set\n"); \
- goto error; \
- } \
+#define INVALID_SET_TEST(TRANSFORM) \
+{ \
+ if(H5Pset_data_transform(dxpl_id, TRANSFORM) < 0) \
+ { \
+ PASSED(); \
+ } \
+ else \
+ { \
+ H5_FAILED(); \
+ HDfprintf(stderr, " ERROR: Data transform allowed invalid TRANSFORM transform to be set\n"); \
+ goto error; \
+ } \
}
int main(void)
{
hid_t dxpl_id_c_to_f = -1;
hid_t dxpl_id_c_to_f_copy = 1;
- hid_t dxpl_id_simple = -1;
+ hid_t dxpl_id_simple = -1;
hid_t dxpl_id_polynomial = -1;
hid_t dxpl_id_polynomial_copy = -1;
hid_t dxpl_id_utrans_inv = -1;
@@ -440,8 +440,8 @@ init_test(hid_t file_id)
PASSED();
return 0;
-
-error:
+
+error:
H5E_BEGIN_TRY {
H5Pclose(cparms);
H5Pclose(dxpl_id_f_to_c);
@@ -472,7 +472,7 @@ test_poly(const hid_t dxpl_id_polynomial)
if(H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,
dxpl_id_polynomial, polyflread) < 0)
TEST_ERROR
-
+
COMPARE(float, polyflread, polyflres, 2.0f)
for(row = 0; row < ROWS; row++)
@@ -485,12 +485,12 @@ test_poly(const hid_t dxpl_id_polynomial)
if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
dxpl_id_polynomial, polyintread) < 0)
TEST_ERROR
-
+
COMPARE(int, polyintread, polyflres, 4)
return 0;
-error:
+error:
return -1;
}
@@ -533,7 +533,7 @@ test_specials(hid_t file)
if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, read_buf) < 0)
TEST_ERROR
-
+
COMPARE_INT(read_buf, data_res)
if(H5Dclose(dset_id) < 0)
@@ -557,7 +557,7 @@ test_specials(hid_t file)
if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, read_buf) < 0)
TEST_ERROR
-
+
COMPARE_INT(read_buf, data_res)
if(H5Dclose(dset_id) < 0)
@@ -581,7 +581,7 @@ test_specials(hid_t file)
if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, read_buf) < 0)
TEST_ERROR
-
+
COMPARE_INT(read_buf, data_res)
if(H5Dclose(dset_id) < 0)
@@ -605,7 +605,7 @@ test_specials(hid_t file)
if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, read_buf) < 0)
TEST_ERROR
-
+
COMPARE_INT(read_buf, data_res)
if(H5Dclose(dset_id) < 0)
@@ -629,7 +629,7 @@ test_specials(hid_t file)
if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, read_buf) < 0)
TEST_ERROR
-
+
COMPARE_INT(read_buf, data_res)
if(H5Dclose(dset_id) < 0)
@@ -644,7 +644,7 @@ test_specials(hid_t file)
PASSED();
return 0;
-error:
+error:
return -1;
}
@@ -667,19 +667,19 @@ test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy)
if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
dxpl_id_c_to_f_copy, windchillFintread) < 0)
TEST_ERROR
-
+
COMPARE(int, windchillFintread, windchillFfloat, 2)
TESTING("data transform, polynomial transform w/ copied property")
if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
dxpl_id_polynomial_copy, polyintread) < 0)
TEST_ERROR
-
+
COMPARE(int, polyintread, polyflres, 2)
return 0;
-error:
+error:
return -1;
}
@@ -696,7 +696,7 @@ test_trivial(const hid_t dxpl_id_simple)
TEST_ERROR
for(row = 0; row < ROWS; row++)
for(col = 0; col < COLS; col++) {
- if((windchillFfloatread[row][col] - 4.8f) > FLOAT_TOL)
+ if((windchillFfloatread[row][col] - 4.8f) > FLOAT_TOL)
FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n");
}
@@ -708,7 +708,7 @@ test_trivial(const hid_t dxpl_id_simple)
TEST_ERROR
for(row = 0; row < ROWS; row++)
for(col = 0; col < COLS; col++) {
- if(windchillFintread[row][col] != 4)
+ if(windchillFintread[row][col] != 4)
FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n")
}
@@ -740,7 +740,7 @@ test_getset(const hid_t dxpl_id_c_to_f)
FAIL_PUTS_ERROR(" ERROR: Data transform failed to match what was set\n")
PASSED()
-
+
HDfree(ptrgetTest);
ptrgetTest = NULL;
@@ -752,10 +752,10 @@ test_getset(const hid_t dxpl_id_c_to_f)
if(H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,
dxpl_id_c_to_f, windchillFfloatread) < 0)
TEST_ERROR
-
+
for(row = 0; row < ROWS; row++)
for(col = 0; col < COLS; col++) {
- if((windchillFfloatread[row][col] - 4.8f) > FLOAT_TOL)
+ if((windchillFfloatread[row][col] - 4.8f) > FLOAT_TOL)
FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n")
}
@@ -767,7 +767,7 @@ test_getset(const hid_t dxpl_id_c_to_f)
TEST_ERROR
if(H5Pget_data_transform(dxpl_id_c_to_f, ptrgetTest, HDstrlen(simple) + 1) < 0)
TEST_ERROR
- if(HDstrcmp(simple, ptrgetTest) != 0)
+ if(HDstrcmp(simple, ptrgetTest) != 0)
FAIL_PUTS_ERROR(" ERROR: Data transform failed to match what was set\n")
PASSED()
@@ -793,11 +793,11 @@ test_set(void)
char *ptrgetTest = NULL;
TESTING("H5Pget_data_transform (get before set)")
-
+
if(NULL == (ptrgetTest = (char *)HDmalloc(HDstrlen(str) + 1)))
TEST_ERROR
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
TEST_ERROR
/* Test get before set */
@@ -807,7 +807,7 @@ test_set(void)
if(H5Pget_data_transform(dxpl_id, ptrgetTest, HDstrlen(str) + 1) < 0)
PASSED()
- else
+ else
FAIL_PUTS_ERROR(" ERROR: Data transform get before set succeeded (it shouldn't have)\n");
HDfree(ptrgetTest);
diff --git a/test/dtypes.c b/test/dtypes.c
index 3253d6c..a177026 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -23,7 +23,7 @@
#include "H5Iprivate.h" /* For checking that datatype id's don't leak */
/* Number of elements in each test */
-#define NTESTELEM 100000
+#define NTESTELEM 100000
/* For test_compound_8 and test_compound_10 */
#define ARRAY_DIM 4
@@ -32,7 +32,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
@@ -43,7 +43,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
@@ -71,7 +71,7 @@
FAIL_STACK_ERROR \
if((NMEMBS) != H5I_nmembers(H5I_DATATYPE)) { \
H5_FAILED(); \
- printf(" #dtype ids expected: %lld; found: %lld\n", \
+ HDprintf(" #dtype ids expected: %lld; found: %lld\n", \
(long long)NMEMBS, (long long)H5I_nmembers(H5I_DATATYPE)); \
goto error; \
}
@@ -134,28 +134,23 @@ typedef enum {
static int num_opaque_conversions_g = 0;
static int opaque_check(int tag_it);
-static herr_t convert_opaque(hid_t st, hid_t dt,
- H5T_cdata_t *cdata,
- size_t nelmts, size_t buf_stride,
- size_t bkg_stride, void *_buf,
- void *bkg, hid_t dset_xfer_plid);
+static herr_t convert_opaque(hid_t st, hid_t dt, H5T_cdata_t *cdata,
+ size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf,
+ void *bkg, hid_t dset_xfer_plid);
static int opaque_long(void);
static int opaque_funcs(void);
-
+
/*-------------------------------------------------------------------------
- * 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:
- *
*-------------------------------------------------------------------------
*/
static void
@@ -182,21 +177,17 @@ reset_hdf5(void)
}
-
+
/*-------------------------------------------------------------------------
* Function: test_classes
*
* Purpose: Test type classes
*
* Return: Success: 0
- *
* Failure: number of errors
*
* Programmer: Robb Matzke
* Tuesday, December 9, 1997
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -283,28 +274,24 @@ test_classes(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_copy
*
* Purpose: Are we able to copy a datatype?
*
* Return: Success: 0
- *
* Failure: number of errors
*
* Programmer: Robb Matzke
* Tuesday, December 9, 1997
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_copy(void)
{
- hid_t a_copy;
- herr_t status;
+ hid_t a_copy;
+ herr_t status;
TESTING("H5Tcopy()");
@@ -313,12 +300,12 @@ test_copy(void)
/* We should not be able to close a built-in byte */
H5E_BEGIN_TRY {
- status = H5Tclose (H5T_NATIVE_SCHAR);
+ status = H5Tclose (H5T_NATIVE_SCHAR);
} H5E_END_TRY;
if (status>=0) {
- H5_FAILED();
- HDputs (" Should not be able to close a predefined type!");
- goto error;
+ H5_FAILED();
+ HDputs (" Should not be able to close a predefined type!");
+ goto error;
}
PASSED();
@@ -328,7 +315,7 @@ test_copy(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_detect
*
@@ -336,7 +323,6 @@ test_copy(void)
* in nested types)
*
* Return: Success: 0
- *
* Failure: number of errors
*
* Programmer: Quincey Koziol
@@ -505,21 +491,17 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_1
*
* Purpose: Tests various things about compound datatypes.
*
* Return: Success: 0
- *
* Failure: number of errors
*
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -669,42 +651,38 @@ error:
return retval;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_compound_2
- *
- * Purpose: Tests a compound type conversion where the source and
- * destination are the same except for the order of the
- * elements.
+ * Function: test_compound_2
*
- * Return: Success: 0
+ * Purpose: Tests a compound type conversion where the source and
+ * destination are the same except for the order of the
+ * elements.
*
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, June 17, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_compound_2(void)
{
struct st {
- int a, b, c[4], d, e;
+ int a, b, c[4], d, e;
} *s_ptr;
struct dt {
- int e, d, c[4], b, a;
+ int e, d, c[4], b, a;
} *d_ptr;
- const size_t nelmts = NTESTELEM;
- const hsize_t four = 4;
- unsigned char *buf=NULL, *orig=NULL, *bkg=NULL;
- hid_t st=-1, dt=-1;
- hid_t array_dt;
- int64_t nmembs;
- int i;
+ const size_t nelmts = NTESTELEM;
+ const hsize_t four = 4;
+ unsigned char *buf=NULL, *orig=NULL, *bkg=NULL;
+ hid_t st=-1, dt=-1;
+ hid_t array_dt;
+ int64_t nmembs;
+ int i;
TESTING("compound element reordering");
@@ -716,15 +694,15 @@ test_compound_2(void)
bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt));
orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st));
for (i=0; i<(int)nelmts; i++) {
- s_ptr = ((struct st*)orig) + i;
- s_ptr->a = i*8+0;
- s_ptr->b = i*8+1;
- s_ptr->c[0] = i*8+2;
- s_ptr->c[1] = i*8+3;
- s_ptr->c[2] = i*8+4;
- s_ptr->c[3] = i*8+5;
- s_ptr->d = i*8+6;
- s_ptr->e = i*8+7;
+ s_ptr = ((struct st*)((void *)orig)) + i;
+ s_ptr->a = i*8+0;
+ s_ptr->b = i*8+1;
+ s_ptr->c[0] = i*8+2;
+ s_ptr->c[1] = i*8+3;
+ s_ptr->c[2] = i*8+4;
+ s_ptr->c[3] = i*8+5;
+ s_ptr->d = i*8+6;
+ s_ptr->e = i*8+7;
}
HDmemcpy(buf, orig, nelmts*sizeof(struct st));
@@ -754,26 +732,26 @@ test_compound_2(void)
/* Compare results */
for (i=0; i<(int)nelmts; i++) {
- s_ptr = ((struct st*)orig) + i;
- d_ptr = ((struct dt*)buf) + i;
- if (s_ptr->a != d_ptr->a ||
- s_ptr->b != d_ptr->b ||
- s_ptr->c[0] != d_ptr->c[0] ||
- s_ptr->c[1] != d_ptr->c[1] ||
- s_ptr->c[2] != d_ptr->c[2] ||
- s_ptr->c[3] != d_ptr->c[3] ||
- s_ptr->d != d_ptr->d ||
- s_ptr->e != d_ptr->e) {
- H5_FAILED();
- printf(" i=%d\n", i);
- printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n",
- s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2],
- s_ptr->c[3], s_ptr->d, s_ptr->e);
- printf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n",
- d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2],
- d_ptr->c[3], d_ptr->d, d_ptr->e);
- goto error;
- }
+ s_ptr = ((struct st*)((void *)orig)) + i;
+ d_ptr = ((struct dt*)((void *)buf)) + i;
+ if (s_ptr->a != d_ptr->a ||
+ s_ptr->b != d_ptr->b ||
+ s_ptr->c[0] != d_ptr->c[0] ||
+ s_ptr->c[1] != d_ptr->c[1] ||
+ s_ptr->c[2] != d_ptr->c[2] ||
+ s_ptr->c[3] != d_ptr->c[3] ||
+ s_ptr->d != d_ptr->d ||
+ s_ptr->e != d_ptr->e) {
+ H5_FAILED();
+ HDprintf(" i=%d\n", i);
+ HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n",
+ s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2],
+ s_ptr->c[3], s_ptr->d, s_ptr->e);
+ HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n",
+ d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2],
+ d_ptr->c[3], d_ptr->d, d_ptr->e);
+ goto error;
+ }
}
/* Release resources */
@@ -800,42 +778,38 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_compound_3
- *
- * Purpose: Tests compound conversions where the source and destination
- * are the same except the destination is missing a couple
- * members which appear in the source.
+ * Function: test_compound_3
*
- * Return: Success: 0
+ * Purpose: Tests compound conversions where the source and destination
+ * are the same except the destination is missing a couple
+ * members which appear in the source.
*
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, June 17, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_compound_3(void)
{
struct st {
- int a, b, c[4], d, e;
+ int a, b, c[4], d, e;
} *s_ptr;
- struct dt {
- int a, c[4], e;
+ struct dt {
+ int a, c[4], e;
} *d_ptr;
- const size_t nelmts = NTESTELEM;
- const hsize_t four = 4;
- unsigned char *buf=NULL, *orig=NULL, *bkg=NULL;
- hid_t st=-1, dt=-1;
+ const size_t nelmts = NTESTELEM;
+ const hsize_t four = 4;
+ unsigned char *buf=NULL, *orig=NULL, *bkg=NULL;
+ hid_t st=-1, dt=-1;
hid_t array_dt;
- int64_t nmembs;
- int i;
+ int64_t nmembs;
+ int i;
TESTING("compound subset conversions");
@@ -847,7 +821,7 @@ test_compound_3(void)
bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt));
orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st));
for (i=0; i<(int)nelmts; i++) {
- s_ptr = ((struct st*)orig) + i;
+ s_ptr = ((struct st*)((void *)orig)) + i;
s_ptr->a = i*8+0;
s_ptr->b = i*8+1;
s_ptr->c[0] = i*8+2;
@@ -884,24 +858,24 @@ test_compound_3(void)
/* Compare results */
for (i=0; i<(int)nelmts; i++) {
- s_ptr = ((struct st*)orig) + i;
- d_ptr = ((struct dt*)buf) + i;
- if (s_ptr->a != d_ptr->a ||
- s_ptr->c[0] != d_ptr->c[0] ||
- s_ptr->c[1] != d_ptr->c[1] ||
- s_ptr->c[2] != d_ptr->c[2] ||
- s_ptr->c[3] != d_ptr->c[3] ||
- s_ptr->e != d_ptr->e) {
- H5_FAILED();
- printf(" i=%d\n", i);
- printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n",
- s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2],
- s_ptr->c[3], s_ptr->d, s_ptr->e);
- printf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n",
- d_ptr->a, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2],
- d_ptr->c[3], d_ptr->e);
- goto error;
- }
+ s_ptr = ((struct st*)((void *)orig)) + i;
+ d_ptr = ((struct dt*)((void *)buf)) + i;
+ if (s_ptr->a != d_ptr->a ||
+ s_ptr->c[0] != d_ptr->c[0] ||
+ s_ptr->c[1] != d_ptr->c[1] ||
+ s_ptr->c[2] != d_ptr->c[2] ||
+ s_ptr->c[3] != d_ptr->c[3] ||
+ s_ptr->e != d_ptr->e) {
+ H5_FAILED();
+ HDprintf(" i=%d\n", i);
+ HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n",
+ s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2],
+ s_ptr->c[3], s_ptr->d, s_ptr->e);
+ HDprintf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n",
+ d_ptr->a, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2],
+ d_ptr->c[3], d_ptr->e);
+ goto error;
+ }
}
/* Release resources */
@@ -927,23 +901,19 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_compound_4
+ * Function: test_compound_4
*
- * Purpose: Tests compound conversions when the destination has the same
- * fields as the source but one or more of the fields are
- * smaller.
+ * Purpose: Tests compound conversions when the destination has the same
+ * fields as the source but one or more of the fields are
+ * smaller.
*
- * Return: Success: 0
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Failure: number of errors
- *
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, June 17, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -951,22 +921,22 @@ test_compound_4(void)
{
struct st {
- int a, b, c[4], d, e;
+ int a, b, c[4], d, e;
} *s_ptr;
struct dt {
- short b;
- int a, c[4];
- short d;
- int e;
+ short b;
+ int a, c[4];
+ short d;
+ int e;
} *d_ptr;
- const size_t nelmts = NTESTELEM;
- const hsize_t four = 4;
- unsigned char *buf=NULL, *orig=NULL, *bkg=NULL;
- hid_t st=-1, dt=-1;
+ const size_t nelmts = NTESTELEM;
+ const hsize_t four = 4;
+ unsigned char *buf=NULL, *orig=NULL, *bkg=NULL;
+ hid_t st=-1, dt=-1;
hid_t array_dt;
- int64_t nmembs;
- int i;
+ int64_t nmembs;
+ int i;
TESTING("compound element shrinking & reordering");
@@ -978,7 +948,7 @@ test_compound_4(void)
bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt));
orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st));
for (i=0; i<(int)nelmts; i++) {
- s_ptr = ((struct st*)orig) + i;
+ s_ptr = ((struct st*)((void *)orig)) + i;
s_ptr->a = i*8+0;
s_ptr->b = (i*8+1) & 0x7fff;
s_ptr->c[0] = i*8+2;
@@ -1017,26 +987,26 @@ test_compound_4(void)
/* Compare results */
for (i=0; i<(int)nelmts; i++) {
- s_ptr = ((struct st*)orig) + i;
- d_ptr = ((struct dt*)buf) + i;
- if (s_ptr->a != d_ptr->a ||
- s_ptr->b != d_ptr->b ||
- s_ptr->c[0] != d_ptr->c[0] ||
- s_ptr->c[1] != d_ptr->c[1] ||
- s_ptr->c[2] != d_ptr->c[2] ||
- s_ptr->c[3] != d_ptr->c[3] ||
- s_ptr->d != d_ptr->d ||
- s_ptr->e != d_ptr->e) {
- H5_FAILED();
- printf(" i=%d\n", i);
- printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n",
- s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2],
- s_ptr->c[3], s_ptr->d, s_ptr->e);
- printf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n",
- d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2],
- d_ptr->c[3], d_ptr->d, d_ptr->e);
- goto error;
- }
+ s_ptr = ((struct st*)((void *)orig)) + i;
+ d_ptr = ((struct dt*)((void *)buf)) + i;
+ if (s_ptr->a != d_ptr->a ||
+ s_ptr->b != d_ptr->b ||
+ s_ptr->c[0] != d_ptr->c[0] ||
+ s_ptr->c[1] != d_ptr->c[1] ||
+ s_ptr->c[2] != d_ptr->c[2] ||
+ s_ptr->c[3] != d_ptr->c[3] ||
+ s_ptr->d != d_ptr->d ||
+ s_ptr->e != d_ptr->e) {
+ H5_FAILED();
+ HDprintf(" i=%d\n", i);
+ HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n",
+ s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2],
+ s_ptr->c[3], s_ptr->d, s_ptr->e);
+ HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n",
+ d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2],
+ d_ptr->c[3], d_ptr->d, d_ptr->e);
+ goto error;
+ }
}
/* Release resources */
@@ -1062,24 +1032,20 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_compound_5
+ * Function: test_compound_5
*
- * Purpose: Many versions of HDF5 have a bug in the optimized compound
+ * Purpose: Many versions of HDF5 have a bug in the optimized compound
* datatype conversion function, H5T_conv_struct_opt(), which
* is triggered when the top-level type contains a struct
* which must undergo a conversion.
*
- * Return: Success: 0
- *
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, June 17, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1156,7 +1122,8 @@ test_compound_5(void)
src[1].coll_ids[2]!=dst[1].coll_ids[2] ||
src[1].coll_ids[3]!=dst[1].coll_ids[3]) {
H5_FAILED();
- } else {
+ }
+ else {
PASSED();
retval = 0;
}
@@ -1167,23 +1134,19 @@ test_compound_5(void)
return retval;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_compound_6
+ * Function: test_compound_6
*
- * Purpose: Tests compound conversions when the destination has the same
- * fields as the source but one or more of the fields are
- * larger.
+ * Purpose: Tests compound conversions when the destination has the same
+ * fields as the source but one or more of the fields are
+ * larger.
*
- * Return: Success: 0
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Failure: number of errors
- *
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, December 13, 2000
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1199,11 +1162,11 @@ test_compound_6(void)
long d;
} *d_ptr;
- const size_t nelmts = NTESTELEM;
- unsigned char *buf=NULL, *orig=NULL, *bkg=NULL;
- hid_t st=-1, dt=-1;
- int64_t nmembs;
- int i;
+ const size_t nelmts = NTESTELEM;
+ unsigned char *buf=NULL, *orig=NULL, *bkg=NULL;
+ hid_t st=-1, dt=-1;
+ int64_t nmembs;
+ int i;
TESTING("compound element growing");
@@ -1215,7 +1178,7 @@ test_compound_6(void)
bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt));
orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st));
for (i=0; i<(int)nelmts; i++) {
- s_ptr = ((struct st*)orig) + i;
+ s_ptr = ((struct st*)((void *)orig)) + i;
s_ptr->b = (i*8+1) & 0x7fff;
s_ptr->d = (i*8+6) & 0x7fff;
}
@@ -1244,18 +1207,18 @@ test_compound_6(void)
/* Compare results */
for (i=0; i<(int)nelmts; i++) {
- s_ptr = ((struct st*)orig) + i;
- d_ptr = ((struct dt*)buf) + i;
- if (s_ptr->b != d_ptr->b ||
- s_ptr->d != d_ptr->d) {
- H5_FAILED();
- printf(" i=%d\n", i);
- printf(" src={b=%d, d=%d\n",
- (int)s_ptr->b, (int)s_ptr->d);
- printf(" dst={b=%ld, d=%ld\n",
- d_ptr->b, d_ptr->d);
- goto error;
- }
+ s_ptr = ((struct st*)((void *)orig)) + i;
+ d_ptr = ((struct dt*)((void *)buf)) + i;
+ if (s_ptr->b != d_ptr->b ||
+ s_ptr->d != d_ptr->d) {
+ H5_FAILED();
+ HDprintf(" i=%d\n", i);
+ HDprintf(" src={b=%d, d=%d\n",
+ (int)s_ptr->b, (int)s_ptr->d);
+ HDprintf(" dst={b=%ld, d=%ld\n",
+ d_ptr->b, d_ptr->d);
+ goto error;
+ }
}
/* Release resources */
@@ -1282,17 +1245,16 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: test_compound_7
+ * Function: test_compound_7
*
- * Purpose: Tests inserting fields into compound datatypes when the field
+ * Purpose: Tests inserting fields into compound datatypes when the field
* overlaps the end of the compound datatype. Also, tests
* increasing compound type size.
*
- * Return: Success: 0
- *
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, December 18, 2001
*
* Modifications:
@@ -1325,43 +1287,43 @@ test_compound_7(void)
if((tid1= H5Tcreate( H5T_COMPOUND, sizeof(struct s1))) < 0) {
H5_FAILED();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
if(H5Tinsert(tid1,"a",HOFFSET(struct s1,a),H5T_NATIVE_INT) < 0) {
H5_FAILED();
- printf("Can't insert field 'a'\n");
+ HDprintf("Can't insert field 'a'\n");
goto error;
} /* end if */
if(H5Tinsert(tid1,"b",HOFFSET(struct s1,b),H5T_NATIVE_FLOAT) < 0) {
H5_FAILED();
- printf("Can't insert field 'b'\n");
+ HDprintf("Can't insert field 'b'\n");
goto error;
} /* end if */
if(H5Tinsert(tid1,"c",HOFFSET(struct s1,c),H5T_NATIVE_LONG) < 0) {
H5_FAILED();
- printf("Can't insert field 'c'\n");
+ HDprintf("Can't insert field 'c'\n");
goto error;
} /* end if */
if(H5Tget_size(tid1)!=sizeof(struct s1)) {
H5_FAILED();
- printf("Incorrect size for struct 1\n");
+ HDprintf("Incorrect size for struct 1\n");
goto error;
} /* end if */
if((tid2= H5Tcopy(tid1)) < 0) {
H5_FAILED();
- printf("Can't copy datatype\n");
+ HDprintf("Can't copy datatype\n");
goto error;
} /* end if */
if(H5Tget_size(tid2)==sizeof(struct s2)) {
H5_FAILED();
- printf("Incorrect size for struct 2\n");
+ HDprintf("Incorrect size for struct 2\n");
goto error;
} /* end if */
@@ -1371,7 +1333,7 @@ test_compound_7(void)
} H5E_END_TRY;
if(ret>=0) {
H5_FAILED();
- printf("Inserted field 'd'?\n");
+ HDprintf("Inserted field 'd'?\n");
goto error;
} /* end if */
@@ -1381,33 +1343,33 @@ test_compound_7(void)
} H5E_END_TRY;
if(ret>=0) {
H5_FAILED();
- printf("Shrunk compound type?\n");
+ HDprintf("Shrunk compound type?\n");
goto error;
} /* end if */
/* Increase compound type size and try inserting field again */
if(H5Tset_size(tid2, sizeof(struct s2)) < 0) {
H5_FAILED();
- printf("Can't increase size for compound type\n");
+ HDprintf("Can't increase size for compound type\n");
goto error;
} /* end if */
if( H5Tinsert(tid2,"d",HOFFSET(struct s2,d),H5T_NATIVE_DOUBLE) < 0) {
H5_FAILED();
- printf("Can't expand compound datatype\n");
+ HDprintf("Can't expand compound datatype\n");
goto error;
} /* end if */
if(H5Tget_size(tid2)!=sizeof(struct s2)) {
H5_FAILED();
- printf("Incorrect size for struct 2\n");
+ HDprintf("Incorrect size for struct 2\n");
goto error;
} /* end if */
/* Release resources */
if (H5Tclose(tid1) < 0 || H5Tclose(tid2) < 0) {
H5_FAILED();
- printf("Can't close datatypes\n");
+ HDprintf("Can't close datatypes\n");
goto error;
} /* end if */
@@ -1428,7 +1390,7 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_8
*
@@ -1473,59 +1435,59 @@ test_compound_8(void)
/* Create first compound datatype */
if((tid1 = H5Tcreate( H5T_COMPOUND, sizeof(struct s1))) < 0) {
H5_FAILED(); AT();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
if(H5Tinsert(tid1,"a",HOFFSET(struct s1,a),H5T_NATIVE_CHAR) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'a'\n");
+ HDprintf("Can't insert field 'a'\n");
goto error;
} /* end if */
if(H5Tinsert(tid1,"b",HOFFSET(struct s1,b),H5T_NATIVE_INT) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'b'\n");
+ HDprintf("Can't insert field 'b'\n");
goto error;
} /* end if */
/* Make a copy of the type for later use */
if((tid1_copy = H5Tcopy(tid1)) < 0) {
H5_FAILED(); AT();
- printf("Can't copy type #1\n");
+ HDprintf("Can't copy type #1\n");
goto error;
} /* end if */
/* Test H5Tpack for the first compound type */
if(H5Tpack(tid1) < 0) {
H5_FAILED(); AT();
- printf("Can't pack the compound datatype\n");
+ HDprintf("Can't pack the compound datatype\n");
goto error;
} /* end if */
if(H5Tlock(tid1) < 0) {
H5_FAILED(); AT();
- printf("Can't lock the compound datatype\n");
+ HDprintf("Can't lock the compound datatype\n");
goto error;
} /* end if */
/* If the type is already packed, packing a locked type is OK */
if(H5Tpack(tid1) < 0) {
H5_FAILED(); AT();
- printf("Can't pack the compound datatype for second time\n");
+ HDprintf("Can't pack the compound datatype for second time\n");
goto error;
} /* end if */
/* Verify the size of packed compound type */
if((tsize = H5Tget_size(tid1)) == 0) {
H5_FAILED(); AT();
- printf("Can't get size of the compound datatype\n");
+ HDprintf("Can't get size of the compound datatype\n");
goto error;
} /* end if */
if(tsize != (sizeof(char) + sizeof(int))) {
H5_FAILED(); AT();
- printf("The size of the packed compound datatype is incorrect\n");
+ HDprintf("The size of the packed compound datatype is incorrect\n");
goto error;
} /* end if */
@@ -1535,61 +1497,61 @@ test_compound_8(void)
/* Create second compound datatype */
if((tid2 = H5Tcreate( H5T_COMPOUND, sizeof(struct s2))) < 0) {
H5_FAILED(); AT();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
if(H5Tinsert(tid2,"c",HOFFSET(struct s2,c),H5T_NATIVE_CHAR) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'c'\n");
+ HDprintf("Can't insert field 'c'\n");
goto error;
} /* end if */
/* Insert the member of unpacked compound type */
if(H5Tinsert(tid2,"d",HOFFSET(struct s2,d),tid1_copy) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'd'\n");
+ HDprintf("Can't insert field 'd'\n");
goto error;
} /* end if */
/* Make a copy of the type for later */
if((tid3=H5Tcopy(tid2)) < 0) {
H5_FAILED(); AT();
- printf("Can't copy type #2\n");
+ HDprintf("Can't copy type #2\n");
goto error;
} /* end if */
/* Make a copy of the type for later */
if((tid2_copy = H5Tcopy(tid2)) < 0) {
H5_FAILED(); AT();
- printf("Can't copy type #2\n");
+ HDprintf("Can't copy type #2\n");
goto error;
} /* end if */
/* Test H5Tpack for the second compound type */
if(H5Tpack(tid2) < 0) {
H5_FAILED(); AT();
- printf("Can't pack the compound datatype\n");
+ HDprintf("Can't pack the compound datatype\n");
goto error;
} /* end if */
if(H5Tlock(tid2) < 0) {
H5_FAILED(); AT();
- printf("Can't lock the compound datatype\n");
+ HDprintf("Can't lock the compound datatype\n");
goto error;
} /* end if */
/* If the type is already packed, packing a locked type is OK */
if(H5Tpack(tid2) < 0) {
H5_FAILED(); AT();
- printf("Can't pack the compound datatype for second time\n");
+ HDprintf("Can't pack the compound datatype for second time\n");
goto error;
} /* end if */
/* Lock unpacked type */
if(H5Tlock(tid3) < 0) {
H5_FAILED(); AT();
- printf("Can't lock the compound datatype\n");
+ HDprintf("Can't lock the compound datatype\n");
goto error;
} /* end if */
@@ -1599,20 +1561,20 @@ test_compound_8(void)
} H5E_END_TRY;
if(ret>=0) {
H5_FAILED(); AT();
- printf("Packing locked datatype worked?\n");
+ HDprintf("Packing locked datatype worked?\n");
goto error;
} /* end if */
/* Verify the size of packed compound type */
if((tsize = H5Tget_size(tid2)) == 0) {
H5_FAILED(); AT();
- printf("Can't get size of the compound datatype\n");
+ HDprintf("Can't get size of the compound datatype\n");
goto error;
} /* end if */
if(tsize != (sizeof(char) + sizeof(char) + sizeof(int))) {
H5_FAILED(); AT();
- printf("The size of the packed compound datatype is incorrect: tsize = %zu\n", tsize);
+ HDprintf("The size of the packed compound datatype is incorrect: tsize = %zu\n", tsize);
goto error;
} /* end if */
@@ -1622,46 +1584,46 @@ test_compound_8(void)
/* Create an array type of compound type */
if((arr_tid = H5Tarray_create2(tid2_copy, 1, dims)) < 0) {
H5_FAILED(); AT();
- printf("Can't create an array datatype\n");
+ HDprintf("Can't create an array datatype\n");
goto error;
} /* end if */
/* Test H5Tpack for the array type */
if(H5Tpack(arr_tid) < 0) {
H5_FAILED(); AT();
- printf("Can't pack the array datatype\n");
+ HDprintf("Can't pack the array datatype\n");
goto error;
} /* end if */
/* Verify the size of packed compound type */
if((tsize = H5Tget_size(arr_tid)) == 0) {
H5_FAILED(); AT();
- printf("Can't get size of the array datatype\n");
+ HDprintf("Can't get size of the array datatype\n");
goto error;
} /* end if */
if(tsize != ARRAY_DIM * (sizeof(char) + sizeof(char) + sizeof(int))) {
H5_FAILED(); AT();
- printf("The size of the packed array datatype is incorrect\n");
+ HDprintf("The size of the packed array datatype is incorrect\n");
goto error;
} /* end if */
if(H5Tclose(tid1_copy) < 0) {
H5_FAILED(); AT();
- printf("Can't close the compound datatype\n");
+ HDprintf("Can't close the compound datatype\n");
goto error;
} /* end if */
if(H5Tclose(tid2_copy) < 0) {
H5_FAILED(); AT();
- printf("Can't close the compound datatype\n");
+ HDprintf("Can't close the compound datatype\n");
goto error;
} /* end if */
if(H5Tclose(arr_tid) < 0) {
H5_FAILED(); AT();
- printf("Can't close the array datatype\n");
+ HDprintf("Can't close the array datatype\n");
goto error;
} /* end if */
@@ -1674,7 +1636,7 @@ test_compound_8(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_9
*
@@ -1686,22 +1648,25 @@ test_compound_8(void)
*
* Programmer: Raymond Lu
* Wednesday, June 9, 2004
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_compound_9(void)
{
- typedef struct cmpd_struct {
+ typedef struct cmpd_struct_w {
int i1;
const char* str;
int i2;
- } cmpd_struct;
+ } cmpd_struct_w;
- cmpd_struct wdata = {11, "variable-length string", 22};
- cmpd_struct rdata;
+ typedef struct cmpd_struct_r {
+ int i1;
+ char* str;
+ int i2;
+ } cmpd_struct_r;
+
+ cmpd_struct_w wdata = {11, "variable-length string", 22};
+ cmpd_struct_r rdata;
hid_t file;
hid_t cmpd_tid, str_id, dup_tid;
hid_t space_id;
@@ -1715,51 +1680,51 @@ test_compound_9(void)
h5_fixname(FILENAME[3], H5P_DEFAULT, filename, sizeof filename);
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("Can't create file!\n");
+ HDprintf("Can't create file!\n");
goto error;
} /* end if */
/* Create first compound datatype */
- if((cmpd_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct))) < 0) {
+ if((cmpd_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct_w))) < 0) {
H5_FAILED(); AT();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_tid,"i1",HOFFSET(struct cmpd_struct,i1),H5T_NATIVE_INT) < 0) {
+ if(H5Tinsert(cmpd_tid, "i1", HOFFSET(struct cmpd_struct_w, i1), H5T_NATIVE_INT) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'i1'\n");
+ HDprintf("Can't insert field 'i1'\n");
goto error;
} /* end if */
str_id = H5Tcopy(H5T_C_S1);
if(H5Tset_size(str_id,H5T_VARIABLE) < 0) {
H5_FAILED(); AT();
- printf("Can't set size for VL string\n");
+ HDprintf("Can't set size for VL string\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_tid, "vl_string", HOFFSET(cmpd_struct, str), str_id) < 0) {
+ if(H5Tinsert(cmpd_tid, "vl_string", HOFFSET(cmpd_struct_w, str), str_id) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'i1'\n");
+ HDprintf("Can't insert field 'i1'\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_tid, "i2", HOFFSET(struct cmpd_struct, i2), H5T_NATIVE_INT) < 0) {
+ if(H5Tinsert(cmpd_tid, "i2", HOFFSET(struct cmpd_struct_w, i2), H5T_NATIVE_INT) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'i2'\n");
+ HDprintf("Can't insert field 'i2'\n");
goto error;
} /* end if */
if(H5Tcommit2(file, "compound", cmpd_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) {
H5_FAILED(); AT();
- printf("Can't commit datatype\n");
+ HDprintf("Can't commit datatype\n");
goto error;
} /* end if */
if(H5Tclose(cmpd_tid) < 0) {
H5_FAILED(); AT();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
@@ -1768,44 +1733,44 @@ test_compound_9(void)
if((dup_tid = H5Tcopy(cmpd_tid)) < 0) {
H5_FAILED(); AT();
- printf("Can't copy datatype\n");
+ HDprintf("Can't copy datatype\n");
goto error;
} /* end if */
dim1[0] = 1;
if((space_id = H5Screate_simple(1, dim1, NULL)) < 0) {
H5_FAILED(); AT();
- printf("Can't create space\n");
+ HDprintf("Can't create space\n");
goto error;
} /* end if */
if((dset_id = H5Dcreate2(file, "Dataset", dup_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("Can't create dataset\n");
+ HDprintf("Can't create dataset\n");
goto error;
} /* end if */
if(H5Dwrite(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) {
H5_FAILED(); AT();
- printf("Can't write data\n");
+ HDprintf("Can't write data\n");
goto error;
} /* end if */
if(H5Dread(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) {
H5_FAILED(); AT();
- printf("Can't read data\n");
+ HDprintf("Can't read data\n");
goto error;
} /* end if */
if(rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str)) {
H5_FAILED(); AT();
- printf("incorrect read data\n");
+ HDprintf("incorrect read data\n");
goto error;
} /* end if */
if(H5Dvlen_reclaim(dup_tid, space_id, H5P_DEFAULT, &rdata) < 0) {
H5_FAILED(); AT();
- printf("Can't reclaim read data\n");
+ HDprintf("Can't reclaim read data\n");
goto error;
} /* end if */
rdata.str = NULL;
@@ -1826,31 +1791,31 @@ test_compound_9(void)
if((file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("cannot open file\n");
+ HDprintf("cannot open file\n");
goto error;
} /* end if */
if((dset_id = H5Dopen2(file, "Dataset", H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("cannot open dataset\n");
+ HDprintf("cannot open dataset\n");
goto error;
} /* end if */
if((space_id = H5Dget_space(dset_id)) < 0) {
H5_FAILED(); AT();
- printf("Can't get space\n");
+ HDprintf("Can't get space\n");
goto error;
} /* end if */
if((cmpd_tid = H5Dget_type(dset_id)) < 0) {
H5_FAILED(); AT();
- printf("cannot open dataset\n");
+ HDprintf("cannot open dataset\n");
goto error;
} /* end if */
if((dup_tid = H5Tcopy(cmpd_tid)) < 0) {
H5_FAILED(); AT();
- printf("Can't copy datatype\n");
+ HDprintf("Can't copy datatype\n");
goto error;
} /* end if */
@@ -1859,19 +1824,19 @@ test_compound_9(void)
if(H5Dread(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) {
H5_FAILED(); AT();
- printf("Can't read data\n");
+ HDprintf("Can't read data\n");
goto error;
} /* end if */
if(rdata.i1!=wdata.i1 || rdata.i2!=wdata.i2 || strcmp(rdata.str, wdata.str)) {
H5_FAILED(); AT();
- printf("incorrect read data\n");
+ HDprintf("incorrect read data\n");
goto error;
} /* end if */
if(H5Dvlen_reclaim(dup_tid, space_id, H5P_DEFAULT, &rdata) < 0) {
H5_FAILED(); AT();
- printf("Can't read data\n");
+ HDprintf("Can't read data\n");
goto error;
} /* end if */
rdata.str = NULL;
@@ -1896,7 +1861,7 @@ test_compound_9(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_10
*
@@ -1954,84 +1919,84 @@ test_compound_10(void)
h5_fixname(FILENAME[4], H5P_DEFAULT, filename, sizeof filename);
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("Can't create file!\n");
+ HDprintf("Can't create file!\n");
goto error;
} /* end if */
/* Create first compound datatype */
if((cmpd_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct))) < 0) {
H5_FAILED(); AT();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_tid,"i1",HOFFSET(struct cmpd_struct,i1),H5T_NATIVE_INT) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'i1'\n");
+ HDprintf("Can't insert field 'i1'\n");
goto error;
} /* end if */
cstr_id = H5Tcopy(H5T_C_S1);
if(H5Tset_size(cstr_id,H5T_VARIABLE) < 0) {
H5_FAILED(); AT();
- printf("Can't set size for C string\n");
+ HDprintf("Can't set size for C string\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_tid,"c_string",HOFFSET(cmpd_struct,str),cstr_id) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'str'\n");
+ HDprintf("Can't insert field 'str'\n");
goto error;
} /* end if */
/* Create vl-string datatype */
if((vlstr_id = H5Tvlen_create(H5T_NATIVE_CHAR)) < 0) {
H5_FAILED(); AT();
- printf("Can't create VL string\n");
+ HDprintf("Can't create VL string\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_tid, "vl_string",HOFFSET(cmpd_struct, text), vlstr_id) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'text'\n");
+ HDprintf("Can't insert field 'text'\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_tid,"i2",HOFFSET(struct cmpd_struct,i2),H5T_NATIVE_INT) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'i2'\n");
+ HDprintf("Can't insert field 'i2'\n");
goto error;
} /* end if */
/* Create the array datatype for c_string data */
if((arr_tid = H5Tarray_create2(cmpd_tid, 1, arr_dim)) < 0) {
H5_FAILED(); AT();
- printf("Can't create array type\n");
+ HDprintf("Can't create array type\n");
goto error;
} /* end if */
dim1[0] = 1;
if((space_id = H5Screate_simple(1,dim1,NULL)) < 0) {
H5_FAILED(); AT();
- printf("Can't create space\n");
+ HDprintf("Can't create space\n");
goto error;
} /* end if */
if((dset_id = H5Dcreate2(file, "Dataset", arr_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("Can't create dataset\n");
+ HDprintf("Can't create dataset\n");
goto error;
} /* end if */
if(H5Dwrite(dset_id, arr_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) {
H5_FAILED(); AT();
- printf("Can't write data\n");
+ HDprintf("Can't write data\n");
goto error;
} /* end if */
if(H5Dread(dset_id, arr_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) {
H5_FAILED(); AT();
- printf("Can't read data\n");
+ HDprintf("Can't read data\n");
goto error;
} /* end if */
@@ -2039,13 +2004,13 @@ test_compound_10(void)
if(rdata[i].i1 != wdata[i].i1 || rdata[i].i2 != wdata[i].i2 ||
HDstrcmp(rdata[i].str, wdata[i].str)) {
H5_FAILED(); AT();
- printf("incorrect read data\n");
+ HDprintf("incorrect read data\n");
goto error;
} /* end if */
if(rdata[i].text.len!=wdata[i].text.len) {
H5_FAILED(); AT();
- printf("incorrect VL length\n");
+ HDprintf("incorrect VL length\n");
goto error;
} /* end if */
@@ -2053,18 +2018,18 @@ test_compound_10(void)
t2 = wdata[i].text.p;
if(strcmp((char*)t1, (char*)t2)) {
H5_FAILED(); AT();
- printf("incorrect VL read data\n");
+ HDprintf("incorrect VL read data\n");
goto error;
}
} /* end for */
if(H5Dvlen_reclaim(arr_tid, space_id, H5P_DEFAULT, &rdata) < 0) {
H5_FAILED(); AT();
- printf("Can't reclaim read data\n");
+ HDprintf("Can't reclaim read data\n");
goto error;
} /* end if */
if(H5Dvlen_reclaim(arr_tid, space_id, H5P_DEFAULT, &wdata) < 0) {
H5_FAILED(); AT();
- printf("Can't reclaim read data\n");
+ HDprintf("Can't reclaim read data\n");
goto error;
} /* end if */
@@ -2090,7 +2055,7 @@ test_compound_10(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_11
*
@@ -2175,7 +2140,7 @@ test_compound_11(void)
((big_t *)buf)[u].i1 = (int)(u * 3);
((big_t *)buf)[u].i2 = (int)(u * 5);
((big_t *)buf)[u].s1 = (char *)HDmalloc((size_t)32);
- sprintf(((big_t *)buf)[u].s1, "%u", (unsigned)u);
+ HDsprintf(((big_t *)buf)[u].s1, "%u", (unsigned)u);
} /* end for */
/* Make copy of buffer before conversion */
@@ -2184,7 +2149,7 @@ test_compound_11(void)
dim[0] = NTESTELEM;
if((space_id = H5Screate_simple(1, dim, NULL)) < 0) {
H5_FAILED(); AT();
- printf("Can't create space\n");
+ HDprintf("Can't create space\n");
goto error;
} /* end if */
@@ -2200,29 +2165,29 @@ test_compound_11(void)
/* Verify converted buffer is correct */
for(u=0; u<NTESTELEM; u++) {
if(!H5_DBL_ABS_EQUAL(((big_t *)buf_orig)[u].d1, ((little_t *)buf)[u].d1)) {
- printf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__,
+ HDprintf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].d1,(unsigned)u,((little_t *)buf)[u].d1);
TEST_ERROR
} /* end if */
if(((big_t *)buf_orig)[u].i1!=((little_t *)buf)[u].i1) {
- printf("Error, line #%d: buf_orig[%u].i1=%d, buf[%u].i1=%d\n",__LINE__,
+ HDprintf("Error, line #%d: buf_orig[%u].i1=%d, buf[%u].i1=%d\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].i1,(unsigned)u,((little_t *)buf)[u].i1);
TEST_ERROR
} /* end if */
if(((big_t *)buf_orig)[u].s1==NULL || ((little_t *)buf)[u].s1==NULL) {
- printf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n",__LINE__,
+ HDprintf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].s1,(unsigned)u,((little_t *)buf)[u].s1);
TEST_ERROR
} /* end if */
else if(HDstrcmp(((big_t *)buf_orig)[u].s1,((little_t *)buf)[u].s1)) {
- printf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n",__LINE__,
+ HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].s1,(unsigned)u,((little_t *)buf)[u].s1);
TEST_ERROR
} /* end if */
} /* end for */
if(H5Dvlen_reclaim(little_tid2, space_id, H5P_DEFAULT, buf) < 0) {
H5_FAILED(); AT();
- printf("Can't reclaim data\n");
+ HDprintf("Can't reclaim data\n");
goto error;
} /* end if */
@@ -2244,29 +2209,29 @@ test_compound_11(void)
/* Verify converted buffer is correct */
for(u=0; u<NTESTELEM; u++) {
if(!H5_DBL_ABS_EQUAL(((big_t *)buf_orig)[u].d1, ((little_t *)buf)[u].d1)) {
- printf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__,
+ HDprintf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].d1,(unsigned)u,((little_t *)buf)[u].d1);
TEST_ERROR
} /* end if */
if(((big_t *)buf_orig)[u].i1!=((little_t *)buf)[u].i1) {
- printf("Error, line #%d: buf_orig[%u].i1=%d, buf[%u].i1=%d\n",__LINE__,
+ HDprintf("Error, line #%d: buf_orig[%u].i1=%d, buf[%u].i1=%d\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].i1,(unsigned)u,((little_t *)buf)[u].i1);
TEST_ERROR
} /* end if */
if(((big_t *)buf_orig)[u].s1==NULL || ((little_t *)buf)[u].s1==NULL) {
- printf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n",__LINE__,
+ HDprintf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].s1,(unsigned)u,((little_t *)buf)[u].s1);
TEST_ERROR
} /* end if */
else if(HDstrcmp(((big_t *)buf_orig)[u].s1,((little_t *)buf)[u].s1)) {
- printf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n",__LINE__,
+ HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].s1,(unsigned)u,((little_t *)buf)[u].s1);
TEST_ERROR
} /* end if */
} /* end for */
if(H5Dvlen_reclaim(little_tid, space_id, H5P_DEFAULT, buf) < 0) {
H5_FAILED(); AT();
- printf("Can't reclaim data\n");
+ HDprintf("Can't reclaim data\n");
goto error;
} /* end if */
@@ -2282,29 +2247,29 @@ test_compound_11(void)
/* Verify converted buffer is correct */
for(u=0; u<NTESTELEM; u++) {
if(!H5_DBL_ABS_EQUAL(((big_t *)buf_orig)[u].d1, ((little_t *)buf)[u].d1)) {
- printf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__,
+ HDprintf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].d1,(unsigned)u,((little_t *)buf)[u].d1);
TEST_ERROR
} /* end if */
if(((big_t *)buf_orig)[u].i1!=((little_t *)buf)[u].i1) {
- printf("Error, line #%d: buf_orig[%u].i1=%d, buf[%u].i1=%d\n",__LINE__,
+ HDprintf("Error, line #%d: buf_orig[%u].i1=%d, buf[%u].i1=%d\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].i1,(unsigned)u,((little_t *)buf)[u].i1);
TEST_ERROR
} /* end if */
if(((big_t *)buf_orig)[u].s1==NULL || ((little_t *)buf)[u].s1==NULL) {
- printf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n",__LINE__,
+ HDprintf("Error, line #%d: buf_orig[%u].s1=%p, buf[%u].s1=%p\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].s1,(unsigned)u,((little_t *)buf)[u].s1);
TEST_ERROR
} /* end if */
else if(HDstrcmp(((big_t *)buf_orig)[u].s1,((little_t *)buf)[u].s1)) {
- printf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n",__LINE__,
+ HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].s1,(unsigned)u,((little_t *)buf)[u].s1);
TEST_ERROR
} /* end if */
} /* end for */
if(H5Dvlen_reclaim(little_tid, space_id, H5P_DEFAULT, buf) < 0) {
H5_FAILED(); AT();
- printf("Can't reclaim data\n");
+ HDprintf("Can't reclaim data\n");
goto error;
} /* end if */
@@ -2333,7 +2298,7 @@ error:
return retval;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_12
*
@@ -2375,14 +2340,14 @@ test_compound_12(void)
size+=tmp_size;
if (H5Tset_size(complex_id, size) < 0) goto error;
if (H5Tinsert(complex_id, "real", offset,
- H5T_NATIVE_DOUBLE) < 0) goto error;
+ H5T_NATIVE_DOUBLE) < 0) goto error;
offset = size;
if((tmp_size=H5Tget_size(H5T_NATIVE_DOUBLE))==0) goto error;
size+=tmp_size;
if (H5Tset_size(complex_id, size) < 0) goto error;
if (H5Tinsert(complex_id, "imaginary", offset,
- H5T_NATIVE_DOUBLE) < 0) goto error;
+ H5T_NATIVE_DOUBLE) < 0) goto error;
/* Increase and decrease the size. */
if((tmp_size=H5Tget_size(H5T_NATIVE_DOUBLE))==0) goto error;
@@ -2416,7 +2381,7 @@ test_compound_12(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_13
*
@@ -2518,7 +2483,7 @@ error:
return 1;
} /* end test_compound_13() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_14
*
@@ -2541,27 +2506,42 @@ error:
static int
test_compound_14(void)
{
- typedef struct cmpd_struct_1 {
+ typedef struct cmpd_struct_1_w {
char c1;
char c2;
const char* str;
- } cmpd_struct_1;
+ } cmpd_struct_1_w;
- typedef struct cmpd_struct_2 {
+ typedef struct cmpd_struct_1_r {
char c1;
char c2;
char* str;
+ } cmpd_struct_1_r;
+
+ typedef struct cmpd_struct_2_w {
+ char c1;
+ char c2;
+ const char* str;
long l1;
long l2;
long l3;
long l4;
- } cmpd_struct_2;
+ } cmpd_struct_2_w;
- cmpd_struct_1 wdata1 = {'A', 'B', "variable-length string"};
+ typedef struct cmpd_struct_2_r {
+ char c1;
+ char c2;
+ char* str;
+ long l1;
+ long l2;
+ long l3;
+ long l4;
+ } cmpd_struct_2_r;
- cmpd_struct_1 rdata1;
- cmpd_struct_2 wdata2 = {'C', 'D', "another vlen!", 1, 2, -1, 9001};
- cmpd_struct_2 rdata2;
+ cmpd_struct_1_w wdata1 = {'A', 'B', "variable-length string"};
+ cmpd_struct_1_r rdata1;
+ cmpd_struct_2_w wdata2 = {'C', 'D', "another vlen!", 1, 2, -1, 9001};
+ cmpd_struct_2_r rdata2;
hid_t file;
hid_t cmpd_m1_tid, cmpd_f1_tid, cmpd_m2_tid, cmpd_f2_tid, str_id;
hid_t space_id;
@@ -2575,230 +2555,230 @@ test_compound_14(void)
h5_fixname(FILENAME[3], H5P_DEFAULT, filename, sizeof filename);
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("Can't create file!\n");
+ HDprintf("Can't create file!\n");
goto error;
} /* end if */
/* Create memory compound datatype 1 */
- if((cmpd_m1_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct_1))) < 0) {
+ if((cmpd_m1_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct_1_w))) < 0) {
H5_FAILED(); AT();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_m1_tid,"c1",HOFFSET(struct cmpd_struct_1,c1),H5T_NATIVE_CHAR) < 0) {
+ if(H5Tinsert(cmpd_m1_tid,"c1",HOFFSET(struct cmpd_struct_1_w, c1), H5T_NATIVE_CHAR) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'c1'\n");
+ HDprintf("Can't insert field 'c1'\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_m1_tid,"c2",HOFFSET(struct cmpd_struct_1,c2),H5T_NATIVE_CHAR) < 0) {
+ if(H5Tinsert(cmpd_m1_tid,"c2",HOFFSET(struct cmpd_struct_1_w, c2), H5T_NATIVE_CHAR) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'c2'\n");
+ HDprintf("Can't insert field 'c2'\n");
goto error;
} /* end if */
str_id = H5Tcopy(H5T_C_S1);
if(H5Tset_size(str_id,H5T_VARIABLE) < 0) {
H5_FAILED(); AT();
- printf("Can't set size for VL string\n");
+ HDprintf("Can't set size for VL string\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_m1_tid, "vl_string", HOFFSET(cmpd_struct_1, str), str_id) < 0) {
+ if(H5Tinsert(cmpd_m1_tid, "vl_string", HOFFSET(cmpd_struct_1_w, str), str_id) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'vl_string'\n");
+ HDprintf("Can't insert field 'vl_string'\n");
goto error;
} /* end if */
/* Create file compound datatype 1 */
if((cmpd_f1_tid = H5Tcreate( H5T_COMPOUND, 8 + 1 + sizeof(hvl_t))) < 0) {
H5_FAILED(); AT();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_f1_tid,"c1",(size_t)0,H5T_STD_I64BE) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'c1'\n");
+ HDprintf("Can't insert field 'c1'\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_f1_tid,"c2",(size_t)8,H5T_NATIVE_CHAR) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'c2'\n");
+ HDprintf("Can't insert field 'c2'\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_f1_tid, "vl_string",(size_t)(8 + 1), str_id) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'vl_string'\n");
+ HDprintf("Can't insert field 'vl_string'\n");
goto error;
} /* end if */
/* Create memory compound datatype 2 */
- if((cmpd_m2_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct_2))) < 0) {
+ if((cmpd_m2_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct_2_w))) < 0) {
H5_FAILED(); AT();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_m2_tid,"c1",HOFFSET(struct cmpd_struct_2,c1),H5T_NATIVE_CHAR) < 0) {
+ if(H5Tinsert(cmpd_m2_tid,"c1",HOFFSET(struct cmpd_struct_2_w, c1), H5T_NATIVE_CHAR) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'c1'\n");
+ HDprintf("Can't insert field 'c1'\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_m2_tid,"c2",HOFFSET(struct cmpd_struct_2,c2),H5T_NATIVE_CHAR) < 0) {
+ if(H5Tinsert(cmpd_m2_tid,"c2",HOFFSET(struct cmpd_struct_2_w, c2), H5T_NATIVE_CHAR) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'c2'\n");
+ HDprintf("Can't insert field 'c2'\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_m2_tid, "vl_string", HOFFSET(cmpd_struct_2, str), str_id) < 0) {
+ if(H5Tinsert(cmpd_m2_tid, "vl_string", HOFFSET(cmpd_struct_2_w, str), str_id) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'vl_string'\n");
+ HDprintf("Can't insert field 'vl_string'\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_m2_tid,"l1",HOFFSET(struct cmpd_struct_2,l1),H5T_NATIVE_LONG) < 0) {
+ if(H5Tinsert(cmpd_m2_tid,"l1",HOFFSET(struct cmpd_struct_2_w, l1), H5T_NATIVE_LONG) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'l1'\n");
+ HDprintf("Can't insert field 'l1'\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_m2_tid,"l2",HOFFSET(struct cmpd_struct_2,l2),H5T_NATIVE_LONG) < 0) {
+ if(H5Tinsert(cmpd_m2_tid,"l2",HOFFSET(struct cmpd_struct_2_w, l2), H5T_NATIVE_LONG) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'l2'\n");
+ HDprintf("Can't insert field 'l2'\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_m2_tid,"l3",HOFFSET(struct cmpd_struct_2,l3),H5T_NATIVE_LONG) < 0) {
+ if(H5Tinsert(cmpd_m2_tid,"l3",HOFFSET(struct cmpd_struct_2_w, l3), H5T_NATIVE_LONG) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'l3'\n");
+ HDprintf("Can't insert field 'l3'\n");
goto error;
} /* end if */
- if(H5Tinsert(cmpd_m2_tid,"l4",HOFFSET(struct cmpd_struct_2,l4),H5T_NATIVE_LONG) < 0) {
+ if(H5Tinsert(cmpd_m2_tid,"l4",HOFFSET(struct cmpd_struct_2_w, l4), H5T_NATIVE_LONG) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'l4'\n");
+ HDprintf("Can't insert field 'l4'\n");
goto error;
} /* end if */
/* Create file compound datatype 2 */
if((cmpd_f2_tid = H5Tcreate( H5T_COMPOUND, 8 + 1 + sizeof(hvl_t) + 4*sizeof(long))) < 0) {
H5_FAILED(); AT();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_f2_tid,"c1",(size_t)0,H5T_STD_I64BE) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'c1'\n");
+ HDprintf("Can't insert field 'c1'\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_f2_tid,"c2",(size_t)8,H5T_NATIVE_CHAR) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'c2'\n");
+ HDprintf("Can't insert field 'c2'\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_f2_tid, "vl_string", (size_t)(8 + 1), str_id) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'vl_string'\n");
+ HDprintf("Can't insert field 'vl_string'\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_f2_tid,"l1",8 + 1 + sizeof(hvl_t),H5T_NATIVE_LONG) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'l1'\n");
+ HDprintf("Can't insert field 'l1'\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_f2_tid,"l2",8 + 1 + sizeof(hvl_t) + sizeof(long),H5T_NATIVE_LONG) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'l2'\n");
+ HDprintf("Can't insert field 'l2'\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_f2_tid,"l3",8 + 1 + sizeof(hvl_t) + 2*sizeof(long),H5T_NATIVE_LONG) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'l3'\n");
+ HDprintf("Can't insert field 'l3'\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_f2_tid,"l4",8 + 1 + sizeof(hvl_t) + 3*sizeof(long),H5T_NATIVE_LONG) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'l4'\n");
+ HDprintf("Can't insert field 'l4'\n");
goto error;
} /* end if */
dim1[0] = 1;
if((space_id = H5Screate_simple(1, dim1, NULL)) < 0) {
H5_FAILED(); AT();
- printf("Can't create space\n");
+ HDprintf("Can't create space\n");
goto error;
} /* end if */
if((dset1_id = H5Dcreate2(file, "Dataset1", cmpd_f1_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("Can't create dataset\n");
+ HDprintf("Can't create dataset\n");
goto error;
} /* end if */
if((dset2_id = H5Dcreate2(file, "Dataset2", cmpd_f2_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("Can't create dataset\n");
+ HDprintf("Can't create dataset\n");
goto error;
} /* end if */
if(H5Dwrite(dset1_id, cmpd_m1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata1) < 0) {
H5_FAILED(); AT();
- printf("Can't write data\n");
+ HDprintf("Can't write data\n");
goto error;
} /* end if */
if(H5Dwrite(dset2_id, cmpd_m2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata2) < 0) {
H5_FAILED(); AT();
- printf("Can't write data\n");
+ HDprintf("Can't write data\n");
goto error;
} /* end if */
if(H5Dread(dset1_id, cmpd_m1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata1) < 0) {
H5_FAILED(); AT();
- printf("Can't read data\n");
+ HDprintf("Can't read data\n");
goto error;
} /* end if */
if(H5Dread(dset2_id, cmpd_m2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata2) < 0) {
H5_FAILED(); AT();
- printf("Can't read data\n");
+ HDprintf("Can't read data\n");
goto error;
} /* end if */
if(rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str)) {
H5_FAILED(); AT();
- printf("incorrect read data\n");
+ HDprintf("incorrect read data\n");
goto error;
} /* end if */
if(rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) ||
rdata2.l1 != wdata2.l1 || rdata2.l2 != wdata2.l2 || rdata2.l3 != wdata2.l3 || rdata2.l4 != wdata2.l4) {
H5_FAILED(); AT();
- printf("incorrect read data\n");
+ HDprintf("incorrect read data\n");
goto error;
} /* end if */
if(H5Dvlen_reclaim(cmpd_m1_tid, space_id, H5P_DEFAULT, &rdata1) < 0) {
H5_FAILED(); AT();
- printf("Can't reclaim read data\n");
+ HDprintf("Can't reclaim read data\n");
goto error;
} /* end if */
rdata1.str = NULL;
if(H5Dvlen_reclaim(cmpd_m2_tid, space_id, H5P_DEFAULT, &rdata2) < 0) {
H5_FAILED(); AT();
- printf("Can't reclaim read data\n");
+ HDprintf("Can't reclaim read data\n");
goto error;
} /* end if */
rdata2.str = NULL;
@@ -2820,25 +2800,25 @@ test_compound_14(void)
if((file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("cannot open file\n");
+ HDprintf("cannot open file\n");
goto error;
} /* end if */
if((dset1_id = H5Dopen2(file, "Dataset1", H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("cannot open dataset\n");
+ HDprintf("cannot open dataset\n");
goto error;
} /* end if */
if((dset2_id = H5Dopen2(file, "Dataset2", H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("cannot open dataset\n");
+ HDprintf("cannot open dataset\n");
goto error;
} /* end if */
if((space_id = H5Dget_space(dset2_id)) < 0) {
H5_FAILED(); AT();
- printf("Can't get space\n");
+ HDprintf("Can't get space\n");
goto error;
} /* end if */
@@ -2854,38 +2834,38 @@ test_compound_14(void)
if(H5Dread(dset1_id, cmpd_m1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata1) < 0) {
H5_FAILED(); AT();
- printf("Can't read data\n");
+ HDprintf("Can't read data\n");
goto error;
} /* end if */
if(H5Dread(dset2_id, cmpd_m2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata2) < 0) {
H5_FAILED(); AT();
- printf("Can't read data\n");
+ HDprintf("Can't read data\n");
goto error;
} /* end if */
if(rdata1.c1!=wdata1.c1 || rdata1.c2!=wdata1.c2 || strcmp(rdata1.str, wdata1.str)) {
H5_FAILED(); AT();
- printf("incorrect read data\n");
+ HDprintf("incorrect read data\n");
goto error;
} /* end if */
if(rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) ||
rdata2.l1 != wdata2.l1 || rdata2.l2 != wdata2.l2 || rdata2.l3 != wdata2.l3 || rdata2.l4 != wdata2.l4) {
H5_FAILED(); AT();
- printf("incorrect read data\n");
+ HDprintf("incorrect read data\n");
goto error;
} /* end if */
if(H5Dvlen_reclaim(cmpd_m1_tid, space_id, H5P_DEFAULT, &rdata1) < 0) {
H5_FAILED(); AT();
- printf("Can't reclaim read data\n");
+ HDprintf("Can't reclaim read data\n");
goto error;
} /* end if */
rdata1.str = NULL;
if(H5Dvlen_reclaim(cmpd_m2_tid, space_id, H5P_DEFAULT, &rdata2) < 0) {
H5_FAILED(); AT();
- printf("Can't reclaim read data\n");
+ HDprintf("Can't reclaim read data\n");
goto error;
} /* end if */
rdata2.str = NULL;
@@ -2910,7 +2890,7 @@ test_compound_14(void)
return 1;
} /* end test_compound_14() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_15
*
@@ -2953,39 +2933,39 @@ test_compound_15(void)
h5_fixname(FILENAME[3], H5P_DEFAULT, filename, sizeof filename);
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("Can't create file!\n");
+ HDprintf("Can't create file!\n");
goto error;
} /* end if */
/* Create file compound datatype */
if((cmpd_f_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct))) < 0) {
H5_FAILED(); AT();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_f_tid,"i1",HOFFSET(struct cmpd_struct,i1),H5T_NATIVE_INT) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'i1'\n");
+ HDprintf("Can't insert field 'i1'\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_f_tid,"i2",HOFFSET(struct cmpd_struct,i2),H5T_NATIVE_INT) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'i2'\n");
+ HDprintf("Can't insert field 'i2'\n");
goto error;
} /* end if */
/* Create memory compound datatype */
if((cmpd_m_tid = H5Tcreate( H5T_COMPOUND, sizeof(struct cmpd_struct))) < 0) {
H5_FAILED(); AT();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
if(H5Tinsert(cmpd_m_tid,"i1",(size_t)0,H5T_NATIVE_INT) < 0) {
H5_FAILED(); AT();
- printf("Can't insert field 'i1'\n");
+ HDprintf("Can't insert field 'i1'\n");
goto error;
} /* end if */
@@ -2993,19 +2973,19 @@ test_compound_15(void)
dim1[0] = 1;
if((space_id = H5Screate_simple(1, dim1, NULL)) < 0) {
H5_FAILED(); AT();
- printf("Can't create space\n");
+ HDprintf("Can't create space\n");
goto error;
} /* end if */
if((dset_id = H5Dcreate2(file, "Dataset", cmpd_f_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
- printf("Can't create dataset\n");
+ HDprintf("Can't create dataset\n");
goto error;
} /* end if */
if(H5Dwrite(dset_id, cmpd_f_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata1) < 0) {
H5_FAILED(); AT();
- printf("Can't write data\n");
+ HDprintf("Can't write data\n");
goto error;
} /* end if */
@@ -3013,21 +2993,21 @@ test_compound_15(void)
* element of wdata2 to be written. */
if(H5Dwrite(dset_id, cmpd_m_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata2) < 0) {
H5_FAILED(); AT();
- printf("Can't write data\n");
+ HDprintf("Can't write data\n");
goto error;
} /* end if */
/* Read data */
if(H5Dread(dset_id, cmpd_f_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) {
H5_FAILED(); AT();
- printf("Can't read data\n");
+ HDprintf("Can't read data\n");
goto error;
} /* end if */
/* Check for correctness of read data */
if(rdata.i1 != wdata2[0] || rdata.i2 != wdata1.i2) {
H5_FAILED(); AT();
- printf("incorrect read data\n");
+ HDprintf("incorrect read data\n");
goto error;
} /* end if */
@@ -3039,14 +3019,14 @@ test_compound_15(void)
/* Read data */
if(H5Dread(dset_id, cmpd_m_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) {
H5_FAILED(); AT();
- printf("Can't read data\n");
+ HDprintf("Can't read data\n");
goto error;
} /* end if */
/* Check for correctness of read data */
if(rdata.i1 != wdata2[0] || rdata.i2 != wdata2[1]) {
H5_FAILED(); AT();
- printf("incorrect read data\n");
+ HDprintf("incorrect read data\n");
goto error;
} /* end if */
@@ -3069,7 +3049,7 @@ test_compound_15(void)
return 1;
} /* end test_compound_15() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_16
*
@@ -3134,7 +3114,7 @@ test_compound_16(void)
/* Check behavior of H5Fget_obj_count */
if((obj_count = H5Fget_obj_count(file, H5F_OBJ_DATATYPE)) != 1) {
H5_FAILED(); AT();
- printf(" H5Fget_obj_count returned: %zd; expected: 1\n", obj_count);
+ HDprintf(" H5Fget_obj_count returned: %zd; expected: 1\n", obj_count);
goto error;
}
@@ -3142,7 +3122,7 @@ test_compound_16(void)
if(H5Fget_obj_ids(file, H5F_OBJ_DATATYPE, (size_t)2, open_dtypes) < 0) TEST_ERROR
if(open_dtypes[1]) {
H5_FAILED(); AT();
- printf(" H5Fget_obj_ids returned as second id: %lld; expected: 0\n", (long long)open_dtypes[1]);
+ HDprintf(" H5Fget_obj_ids returned as second id: %lld; expected: 0\n", (long long)open_dtypes[1]);
goto error;
}
@@ -3161,7 +3141,7 @@ error:
return 1;
} /* end test_compound_16() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_17
*
@@ -3213,7 +3193,7 @@ test_compound_17(void)
if(H5Tpack(tmp_dt) < 0) TEST_ERROR
if(2 != H5Tget_size(tmp_dt)) {
H5_FAILED(); AT();
- printf(" Size after packing: %u; expected: 2\n", (unsigned)H5Tget_size(tmp_dt));
+ HDprintf(" Size after packing: %u; expected: 2\n", (unsigned)H5Tget_size(tmp_dt));
goto error;
}
if(H5Tclose(tmp_dt) < 0) TEST_ERROR
@@ -3223,7 +3203,7 @@ test_compound_17(void)
if(H5Tpack(tmp_dt) < 0) TEST_ERROR
if(4 != H5Tget_size(tmp_dt)) {
H5_FAILED(); AT();
- printf(" Size after packing: %u; expected: 4\n", (unsigned)H5Tget_size(tmp_dt));
+ HDprintf(" Size after packing: %u; expected: 4\n", (unsigned)H5Tget_size(tmp_dt));
goto error;
}
if(H5Tclose(tmp_dt) < 0) TEST_ERROR
@@ -3257,7 +3237,7 @@ test_compound_17(void)
if(H5Tpack(tmp_dt) < 0) TEST_ERROR
if(2 != H5Tget_size(tmp_dt)) {
H5_FAILED(); AT();
- printf(" Size after packing: %u; expected: 2\n", (unsigned)H5Tget_size(tmp_dt));
+ HDprintf(" Size after packing: %u; expected: 2\n", (unsigned)H5Tget_size(tmp_dt));
goto error;
}
if(H5Tclose(tmp_dt) < 0) TEST_ERROR
@@ -3267,7 +3247,7 @@ test_compound_17(void)
if(H5Tpack(tmp_dt) < 0) TEST_ERROR
if(4 != H5Tget_size(tmp_dt)) {
H5_FAILED(); AT();
- printf(" Size after packing: %u; expected: 4\n", (unsigned)H5Tget_size(tmp_dt));
+ HDprintf(" Size after packing: %u; expected: 4\n", (unsigned)H5Tget_size(tmp_dt));
goto error;
}
if(H5Tclose(tmp_dt) < 0) TEST_ERROR
@@ -3284,7 +3264,7 @@ error:
return 1;
} /* end test_compound_17() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_18
*
@@ -3350,7 +3330,7 @@ test_compound_18(void)
FAIL_PUTS_ERROR("created attribute with bad compound datatype")
} /* end if */
- /* Commit the datatype */
+ /* Commit the datatype */
H5E_BEGIN_TRY {
ret = H5Tcommit2(file, "cmpnd", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
@@ -3410,7 +3390,7 @@ error:
return 1;
} /* end test_compound_18() */
-
+
/*-------------------------------------------------------------------------
* Function: test_query
*
@@ -3455,107 +3435,107 @@ test_query(void)
/* Create a compound datatype */
if((tid1=H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) {
H5_FAILED();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
if(H5Tinsert(tid1, "a", HOFFSET(struct s1, a), H5T_NATIVE_INT) < 0) {
H5_FAILED();
- printf("Can't insert field 'a'\n");
+ HDprintf("Can't insert field 'a'\n");
goto error;
} /* end if */
if(H5Tinsert(tid1, "b", HOFFSET(struct s1, b), H5T_NATIVE_FLOAT) < 0) {
H5_FAILED();
- printf("Can't insert field 'b'\n");
+ HDprintf("Can't insert field 'b'\n");
goto error;
} /* end if */
if(H5Tinsert(tid1, "c", HOFFSET(struct s1, c), H5T_NATIVE_LONG) < 0) {
H5_FAILED();
- printf("Can't insert field 'c'\n");
+ HDprintf("Can't insert field 'c'\n");
goto error;
} /* end if */
if(H5Tinsert(tid1, "d", HOFFSET(struct s1, d), H5T_NATIVE_DOUBLE) < 0) {
H5_FAILED();
- printf("Can't insert field 'd'\n");
+ HDprintf("Can't insert field 'd'\n");
goto error;
} /* end if */
/* Create a enumerate datatype */
if((tid2=H5Tcreate(H5T_ENUM, sizeof(short))) < 0) {
H5_FAILED();
- printf("Can't create enumerate type\n");
+ HDprintf("Can't create enumerate type\n");
goto error;
} /* end if */
if(H5Tenum_insert(tid2, "RED", (enum_val=10,&enum_val)) < 0) {
H5_FAILED();
- printf("Can't insert field into enumeration type\n");
+ HDprintf("Can't insert field into enumeration type\n");
goto error;
} /* end if */
if(H5Tenum_insert(tid2, "GREEN", (enum_val=11,&enum_val)) < 0) {
H5_FAILED();
- printf("Can't insert field into enumeration type\n");
+ HDprintf("Can't insert field into enumeration type\n");
goto error;
} /* end if */
if(H5Tenum_insert(tid2, "BLUE", (enum_val=12,&enum_val)) < 0) {
H5_FAILED();
- printf("Can't insert field into enumeration type\n");
+ HDprintf("Can't insert field into enumeration type\n");
goto error;
} /* end if */
if(H5Tenum_insert(tid2, "ORANGE", (enum_val=13,&enum_val)) < 0) {
H5_FAILED();
- printf("Can't insert field into enumeration type\n");
+ HDprintf("Can't insert field into enumeration type\n");
goto error;
} /* end if */
if(H5Tenum_insert(tid2, "YELLOW", (enum_val=14,&enum_val)) < 0) {
H5_FAILED();
- printf("Can't insert field into enumeration type\n");
+ HDprintf("Can't insert field into enumeration type\n");
goto error;
} /* end if */
/* Query member number and member index by name, for compound type. */
if(H5Tget_nmembers(tid1)!=4) {
H5_FAILED();
- printf("Can't get member number\n");
+ HDprintf("Can't get member number\n");
goto error;
} /* end if */
if(H5Tget_member_index(tid1, "c")!=2) {
H5_FAILED();
- printf("Can't get correct index number\n");
+ HDprintf("Can't get correct index number\n");
goto error;
} /* end if */
/* Query member number and member index by member name, for enumeration type. */
if(H5Tget_nmembers(tid2) != 5) {
H5_FAILED();
- printf("Can't get member number\n");
+ HDprintf("Can't get member number\n");
goto error;
} /* end if */
if(H5Tget_member_index(tid2, "ORANGE") != 3) {
H5_FAILED();
- printf("Can't get correct index number\n");
+ HDprintf("Can't get correct index number\n");
goto error;
} /* end if */
/* Commit compound datatype and close it */
if(H5Tcommit2(file, compnd_type, tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) {
H5_FAILED();
- printf("Can't commit compound datatype\n");
+ HDprintf("Can't commit compound datatype\n");
goto error;
} /* end if */
if(H5Tclose(tid1) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
/* Commit enumeration datatype and close it */
if(H5Tcommit2(file, enum_type, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) {
H5_FAILED();
- printf("Can't commit compound datatype\n");
+ HDprintf("Can't commit compound datatype\n");
goto error;
} /* end if */
if(H5Tclose(tid2) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
@@ -3568,48 +3548,48 @@ test_query(void)
/* Query member number and member index by name, for compound type */
if(H5Tget_nmembers(tid1) != 4) {
H5_FAILED();
- printf("Can't get member number\n");
+ HDprintf("Can't get member number\n");
goto error;
} /* end if */
if(H5Tget_member_index(tid1, "c") != 2) {
H5_FAILED();
- printf("Can't get correct index number\n");
+ HDprintf("Can't get correct index number\n");
goto error;
} /* end if */
/* Query member number and member index by member name, for enumeration type */
if(H5Tget_nmembers(tid2)!=5) {
H5_FAILED();
- printf("Can't get member number\n");
+ HDprintf("Can't get member number\n");
goto error;
} /* end if */
if(H5Tget_member_index(tid2, "ORANGE")!=3) {
H5_FAILED();
- printf("Can't get correct index number\n");
+ HDprintf("Can't get correct index number\n");
goto error;
} /* end if */
/* Query member value by member name, for enumeration type */
if(H5Tenum_valueof (tid2, "ORANGE", &enum_val) < 0) {
H5_FAILED();
- printf("Can't get value for enumerate member\n");
+ HDprintf("Can't get value for enumerate member\n");
goto error;
} /* end if */
if(enum_val!=13) {
H5_FAILED();
- printf("Incorrect value for enum member\n");
+ HDprintf("Incorrect value for enum member\n");
goto error;
} /* end if */
/* Query member value by member index, for enumeration type */
if(H5Tget_member_value (tid2, 2, &enum_val) < 0) {
H5_FAILED();
- printf("Can't get value for enum member\n");
+ HDprintf("Can't get value for enum member\n");
goto error;
} /* end if */
if(enum_val!=12) {
H5_FAILED();
- printf("Incorrect value for enum member\n");
+ HDprintf("Incorrect value for enum member\n");
goto error;
} /* end if */
@@ -3617,30 +3597,30 @@ test_query(void)
enum_val = 14;
if(H5Tenum_nameof(tid2, &enum_val, enum_name, (size_t)16) < 0) {
H5_FAILED();
- printf("Can't get name for enum member\n");
+ HDprintf("Can't get name for enum member\n");
goto error;
} /* end if */
if(strcmp("YELLOW", enum_name)) {
H5_FAILED();
- printf("Incorrect name for enum member\n");
+ HDprintf("Incorrect name for enum member\n");
goto error;
} /* end if */
/* Close datatype and file */
if(H5Tclose(tid1) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
if(H5Tclose(tid2) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
if(H5Fclose(file) < 0) {
H5_FAILED();
- printf("Can't close file\n");
+ HDprintf("Can't close file\n");
goto error;
} /* end if */
@@ -3656,17 +3636,17 @@ test_query(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_transient
+ * Function: test_transient
*
- * Purpose: Tests transient datatypes.
+ * Purpose: Tests transient datatypes.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, June 4, 1998
*
* Modifications:
@@ -3676,36 +3656,36 @@ test_query(void)
static int
test_transient (hid_t fapl)
{
- static hsize_t ds_size[2] = {10, 20};
- hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1;
- char filename[1024];
- hid_t ret_id; /* Generic hid_t return value */
- herr_t status;
+ static hsize_t ds_size[2] = {10, 20};
+ hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1;
+ char filename[1024];
+ hid_t ret_id; /* Generic hid_t return value */
+ herr_t status;
TESTING("transient datatypes");
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if ((file=H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
- goto error;
+ goto error;
}
if ((space = H5Screate_simple (2, ds_size, ds_size)) < 0) goto error;
/* Predefined types cannot be modified or closed */
H5E_BEGIN_TRY {
- status = H5Tset_precision(H5T_NATIVE_INT, (size_t)256);
+ status = H5Tset_precision(H5T_NATIVE_INT, (size_t)256);
} H5E_END_TRY;
if (status>=0) {
- H5_FAILED();
- HDputs (" Predefined types should not be modifiable!");
- goto error;
+ H5_FAILED();
+ HDputs (" Predefined types should not be modifiable!");
+ goto error;
}
H5E_BEGIN_TRY {
- status = H5Tclose (H5T_NATIVE_INT);
+ status = H5Tclose (H5T_NATIVE_INT);
} H5E_END_TRY;
if (status>=0) {
- H5_FAILED();
- HDputs (" Predefined types should not be closable!");
- goto error;
+ H5_FAILED();
+ HDputs (" Predefined types should not be closable!");
+ goto error;
}
/* Copying a predefined type results in a modifiable copy */
@@ -3714,29 +3694,29 @@ test_transient (hid_t fapl)
/* It should not be possible to create an attribute for a transient type */
H5E_BEGIN_TRY {
- ret_id = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT);
+ ret_id = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
if (ret_id>=0) {
- H5_FAILED();
- HDputs (" Attributes should not be allowed for transient types!");
- goto error;
+ H5_FAILED();
+ HDputs (" Attributes should not be allowed for transient types!");
+ goto error;
}
/* Create a dataset from a transient datatype */
if(H5Tclose(type) < 0) goto error;
if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) goto error;
if((dset = H5Dcreate2(file, "dset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
/* The type returned from a dataset should not be modifiable */
if((t2 = H5Dget_type(dset)) < 0) goto error;
H5E_BEGIN_TRY {
- status = H5Tset_precision(t2, (size_t)256);
+ status = H5Tset_precision(t2, (size_t)256);
} H5E_END_TRY;
if(status >= 0) {
- H5_FAILED();
- HDputs (" Dataset datatypes should not be modifiable!");
- goto error;
+ H5_FAILED();
+ HDputs (" Dataset datatypes should not be modifiable!");
+ goto error;
}
if(H5Tclose(t2) < 0) goto error;
@@ -3748,12 +3728,12 @@ test_transient (hid_t fapl)
if((dset = H5Dopen2(file, "dset1", H5P_DEFAULT)) < 0) goto error;
if((t2 = H5Dget_type(dset)) < 0) goto error;
H5E_BEGIN_TRY {
- status = H5Tset_precision(t2, (size_t)256);
+ status = H5Tset_precision(t2, (size_t)256);
} H5E_END_TRY;
if(status >= 0) {
- H5_FAILED();
- HDputs (" Dataset datatypes should not be modifiable!");
- goto error;
+ H5_FAILED();
+ HDputs (" Dataset datatypes should not be modifiable!");
+ goto error;
}
if(H5Tclose(t2) < 0) goto error;
@@ -3776,26 +3756,26 @@ test_transient (hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Tclose (t2);
- H5Tclose (type);
- H5Sclose (space);
- H5Dclose (dset);
- H5Fclose (file);
+ H5Tclose (t2);
+ H5Tclose (type);
+ H5Sclose (space);
+ H5Dclose (dset);
+ H5Fclose (file);
} H5E_END_TRY;
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_named
+ * Function: test_named
*
- * Purpose: Tests named datatypes.
+ * Purpose: Tests named datatypes.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, June 1, 1998
*
* Modifications:
@@ -3805,29 +3785,29 @@ test_transient (hid_t fapl)
static int
test_named (hid_t fapl)
{
- hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1, t3=-1, attr1=-1;
- herr_t status;
- static hsize_t ds_size[2] = {10, 20};
- size_t i,j;
- unsigned attr_data[10][20];
- char filename[1024];
+ hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1, t3=-1, attr1=-1;
+ herr_t status;
+ static hsize_t ds_size[2] = {10, 20};
+ size_t i,j;
+ unsigned attr_data[10][20];
+ char filename[1024];
TESTING("named datatypes");
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
if ((file=H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
- goto error;
+ goto error;
}
if ((space = H5Screate_simple (2, ds_size, ds_size)) < 0) goto error;
/* Predefined types cannot be committed */
H5E_BEGIN_TRY {
- status = H5Tcommit2(file, "test_named_1 (should not exist)", H5T_NATIVE_INT, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Tcommit2(file, "test_named_1 (should not exist)", H5T_NATIVE_INT, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
if(status >= 0) {
- H5_FAILED();
- HDputs (" Predefined types should not be committable!");
- goto error;
+ H5_FAILED();
+ HDputs (" Predefined types should not be committable!");
+ goto error;
}
/* Copy a predefined datatype and commit the copy */
@@ -3835,34 +3815,34 @@ test_named (hid_t fapl)
if(H5Tcommit2(file, "native-int", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) goto error;
if((status = H5Tcommitted(type)) < 0) goto error;
if(0 == status) {
- H5_FAILED();
- HDputs (" H5Tcommitted() returned false!");
- goto error;
+ H5_FAILED();
+ HDputs (" H5Tcommitted() returned false!");
+ goto error;
}
/* We should not be able to modify a type after it has been committed. */
H5E_BEGIN_TRY {
- status = H5Tset_precision (type, (size_t)256);
+ status = H5Tset_precision (type, (size_t)256);
} H5E_END_TRY;
if (status>=0) {
- H5_FAILED();
- HDputs (" Committed type is not constant!");
- goto error;
+ H5_FAILED();
+ HDputs (" Committed type is not constant!");
+ goto error;
}
/* We should not be able to re-commit a committed type */
H5E_BEGIN_TRY {
- status = H5Tcommit2(file, "test_named_2 (should not exist)", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Tcommit2(file, "test_named_2 (should not exist)", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
if(status >= 0) {
- H5_FAILED();
- HDputs (" Committed types should not be recommitted!");
- goto error;
+ H5_FAILED();
+ HDputs (" Committed types should not be recommitted!");
+ goto error;
}
/* It should be possible to define an attribute for the named type */
if((attr1 = H5Acreate2(type, "attr1", H5T_NATIVE_UCHAR, space,
- H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
+ H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
for(i = 0; i < (size_t)ds_size[0]; i++)
for(j = 0; j < (size_t)ds_size[1]; j++)
attr_data[i][j] = (unsigned)(i * ds_size[1] + j);
@@ -3876,9 +3856,9 @@ test_named (hid_t fapl)
if((t2 = H5Tcopy(type)) < 0) goto error;
if((status = H5Tcommitted(t2)) < 0) goto error;
if(status) {
- H5_FAILED();
- HDputs (" Copying a named type should result in a transient type!");
- goto error;
+ H5_FAILED();
+ HDputs (" Copying a named type should result in a transient type!");
+ goto error;
}
if(H5Tset_precision(t2, (size_t)256) < 0) goto error;
if(H5Tclose(t2) < 0) goto error;
@@ -3891,22 +3871,22 @@ test_named (hid_t fapl)
FAIL_STACK_ERROR
if((status = H5Tcommitted(type)) < 0) goto error;
if(!status) {
- H5_FAILED();
- HDputs (" Opened named types should be named types!");
- goto error;
+ H5_FAILED();
+ HDputs (" Opened named types should be named types!");
+ goto error;
}
/* Create a dataset that uses the named type */
if((dset = H5Dcreate2(file, "dset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
/* Get the dataset's datatype and make sure it's a named type */
if((t2 = H5Dget_type(dset)) < 0) goto error;
if((status = H5Tcommitted(t2)) < 0) goto error;
if(!status) {
- H5_FAILED();
- HDputs (" Dataset type should be a named type!");
- goto error;
+ H5_FAILED();
+ HDputs (" Dataset type should be a named type!");
+ goto error;
}
/* Close the dataset, then close its type, then reopen the dataset */
@@ -3918,9 +3898,9 @@ test_named (hid_t fapl)
if((t2 = H5Dget_type(dset)) < 0) goto error;
if((status = H5Tcommitted(t2)) < 0) goto error;
if(!status) {
- H5_FAILED();
- HDputs (" Dataset type should be a named type!");
- goto error;
+ H5_FAILED();
+ HDputs (" Dataset type should be a named type!");
+ goto error;
}
/*
@@ -3937,9 +3917,9 @@ test_named (hid_t fapl)
if((t2 = H5Dget_type(dset)) < 0) goto error;
if((status = H5Tcommitted(t2)) < 0) goto error;
if(!status) {
- H5_FAILED();
- HDputs (" Dataset type should be a named type!");
- goto error;
+ H5_FAILED();
+ HDputs (" Dataset type should be a named type!");
+ goto error;
}
if(H5Tclose(t2) < 0) goto error;
@@ -3958,17 +3938,17 @@ test_named (hid_t fapl)
if((t2 = H5Tcopy(type)) < 0) goto error;
if((status = H5Tcommitted(t2)) < 0) goto error;
if(status) {
- H5_FAILED();
- HDputs (" Copied type should not be a named type!");
- goto error;
+ H5_FAILED();
+ HDputs (" Copied type should not be a named type!");
+ goto error;
}
if((dset = H5Dcreate2(file, "dset3", t2, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
if((t3 = H5Dget_type(dset)) < 0) goto error;
if((status = H5Tcommitted(t3)) < 0) goto error;
if(status) {
- H5_FAILED();
- HDputs (" Datatype from dataset using copied type should not be a named type!");
- goto error;
+ H5_FAILED();
+ HDputs (" Datatype from dataset using copied type should not be a named type!");
+ goto error;
}
if(H5Tclose(t3) < 0) goto error;
if(H5Dclose(dset) < 0) goto error;
@@ -4013,26 +3993,26 @@ test_named (hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Tclose(t3);
- H5Tclose(t2);
- H5Tclose(type);
- H5Sclose(space);
- H5Dclose(dset);
- H5Fclose(file);
+ H5Tclose(t3);
+ H5Tclose(t2);
+ H5Tclose(type);
+ H5Sclose(space);
+ H5Dclose(dset);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: mkstr
+ * Function: mkstr
*
- * Purpose: Create a new string datatype
+ * Purpose: Create a new string datatype
*
- * Return: Success: New type
- * Failure: -1
+ * Return: Success: New type
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 10, 1998
*
*-------------------------------------------------------------------------
@@ -4040,7 +4020,7 @@ error:
static hid_t
mkstr(size_t len, H5T_str_t strpad)
{
- hid_t t;
+ hid_t t;
if((t = H5Tcopy(H5T_C_S1)) < 0)
return -1;
@@ -4052,16 +4032,16 @@ mkstr(size_t len, H5T_str_t strpad)
return t;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_str_create
+ * Function: test_str_create
*
- * Purpose: Test string type creation using H5Tcreate
+ * Purpose: Test string type creation using H5Tcreate
*
- * Return: Success: 0
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 19 May 2011
*
*-------------------------------------------------------------------------
@@ -4102,10 +4082,10 @@ test_str_create(void)
if(!H5Tequal(vlen_str1, vlen_str2)) goto error;
if((is_vl_str = H5Tis_variable_str(vlen_str1)) < 0) goto error;
- if(!is_vl_str) goto error;
+ if(!is_vl_str) goto error;
if((is_vl_str = H5Tis_variable_str(vlen_str2)) < 0) goto error;
- if(!is_vl_str) goto error;
+ if(!is_vl_str) goto error;
if(H5Tclose(vlen_str1) < 0) goto error;
if(H5Tclose(vlen_str2) < 0) goto error;
@@ -4118,16 +4098,16 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_conv_str_1
+ * Function: test_conv_str_1
*
- * Purpose: Test string conversions
+ * Purpose: Test string conversions
*
- * Return: Success: 0
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 10, 1998
*
*-------------------------------------------------------------------------
@@ -4135,8 +4115,8 @@ error:
static int
test_conv_str_1(void)
{
- char *buf = NULL;
- hid_t src_type = -1;
+ char *buf = NULL;
+ hid_t src_type = -1;
hid_t dst_type = -1;
TESTING("string conversions");
@@ -4151,15 +4131,15 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcd\0abcd\0abcdefghi\0", (size_t)20)) {
- H5_FAILED();
- HDputs(" Truncated C-string test failed");
- goto error;
+ H5_FAILED();
+ HDputs(" Truncated C-string test failed");
+ goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcd\0\0\0\0\0\0abcd\0\0\0\0\0\0", (size_t)20)) {
- H5_FAILED();
- HDputs(" Extended C-string test failed");
- goto error;
+ H5_FAILED();
+ HDputs(" Extended C-string test failed");
+ goto error;
}
HDfree(buf);
buf = NULL;
@@ -4175,15 +4155,15 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20)) {
- H5_FAILED();
- HDputs(" Truncated C buffer test failed");
- goto error;
+ H5_FAILED();
+ HDputs(" Truncated C buffer test failed");
+ goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) {
- H5_FAILED();
- HDputs(" Extended C buffer test failed");
- goto error;
+ H5_FAILED();
+ HDputs(" Extended C buffer test failed");
+ goto error;
}
HDfree(buf);
buf = NULL;
@@ -4199,15 +4179,15 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20)) {
- H5_FAILED();
- HDputs(" Truncated Fortran-string test failed");
- goto error;
+ H5_FAILED();
+ HDputs(" Truncated Fortran-string test failed");
+ goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcde abcde ", (size_t)20)) {
- H5_FAILED();
- HDputs(" Extended Fortran-string test failed");
- goto error;
+ H5_FAILED();
+ HDputs(" Extended Fortran-string test failed");
+ goto error;
}
HDfree(buf);
buf = NULL;
@@ -4226,25 +4206,25 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) {
- H5_FAILED();
- HDputs(" Non-terminated string test 1");
- goto error;
+ H5_FAILED();
+ HDputs(" Non-terminated string test 1");
+ goto error;
}
H5Tclose(dst_type);
if((dst_type = mkstr((size_t)5, H5T_STR_NULLTERM)) < 0) goto error;
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcd\0abcd\0abcdefghij", (size_t)20)) {
- H5_FAILED();
- HDputs(" Non-terminated string test 2");
- goto error;
+ H5_FAILED();
+ HDputs(" Non-terminated string test 2");
+ goto error;
}
HDmemcpy(buf, "abcdeabcdexxxxxxxxxx", (size_t)20);
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) {
- H5_FAILED();
- HDputs(" Non-terminated string test 2");
- goto error;
+ H5_FAILED();
+ HDputs(" Non-terminated string test 2");
+ goto error;
}
HDfree(buf);
buf = NULL;
@@ -4260,30 +4240,30 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcdefghi abcdefghi ", (size_t)20)) {
- H5_FAILED();
- HDputs(" C string to Fortran test 1");
- goto error;
+ H5_FAILED();
+ HDputs(" C string to Fortran test 1");
+ goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcdefghi\0abcdefghi\0", (size_t)20)) {
- H5_FAILED();
- HDputs(" Fortran to C string test 1");
- goto error;
+ H5_FAILED();
+ HDputs(" Fortran to C string test 1");
+ goto error;
}
if (H5Tclose(dst_type) < 0) goto error;
if((dst_type = mkstr((size_t)5, H5T_STR_SPACEPAD)) < 0) goto error;
HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20)) {
- H5_FAILED();
- HDputs(" C string to Fortran test 2");
- goto error;
+ H5_FAILED();
+ HDputs(" C string to Fortran test 2");
+ goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) {
- H5_FAILED();
- HDputs(" Fortran to C string test 2");
- goto error;
+ H5_FAILED();
+ HDputs(" Fortran to C string test 2");
+ goto error;
}
if (H5Tclose(src_type) < 0) goto error;
if (H5Tclose(dst_type) < 0) goto error;
@@ -4292,15 +4272,15 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcd abcd ", (size_t)20)) {
- H5_FAILED();
- HDputs(" C string to Fortran test 3");
- goto error;
+ H5_FAILED();
+ HDputs(" C string to Fortran test 3");
+ goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20)) {
- H5_FAILED();
- HDputs(" Fortran to C string test 3");
- goto error;
+ H5_FAILED();
+ HDputs(" Fortran to C string test 3");
+ goto error;
}
HDfree(buf);
buf = NULL;
@@ -4316,30 +4296,30 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) {
- H5_FAILED();
- HDputs(" C buffer to Fortran test 1");
- goto error;
+ H5_FAILED();
+ HDputs(" C buffer to Fortran test 1");
+ goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) {
- H5_FAILED();
- HDputs(" Fortran to C buffer test 1");
- goto error;
+ H5_FAILED();
+ HDputs(" Fortran to C buffer test 1");
+ goto error;
}
if (H5Tclose(dst_type) < 0) goto error;
if((dst_type = mkstr((size_t)5, H5T_STR_SPACEPAD)) < 0) goto error;
HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20)) {
- H5_FAILED();
- HDputs(" C buffer to Fortran test 2");
- goto error;
+ H5_FAILED();
+ HDputs(" C buffer to Fortran test 2");
+ goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) {
- H5_FAILED();
- HDputs(" Fortran to C buffer test 2");
- goto error;
+ H5_FAILED();
+ HDputs(" Fortran to C buffer test 2");
+ goto error;
}
if (H5Tclose(src_type) < 0) goto error;
if (H5Tclose(dst_type) < 0) goto error;
@@ -4348,15 +4328,15 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcd abcd ", (size_t)20)) {
- H5_FAILED();
- HDputs(" C buffer to Fortran test 3");
- goto error;
+ H5_FAILED();
+ HDputs(" C buffer to Fortran test 3");
+ goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20)) {
- H5_FAILED();
- HDputs(" Fortran to C buffer test 3");
- goto error;
+ H5_FAILED();
+ HDputs(" Fortran to C buffer test 3");
+ goto error;
}
if(H5Tclose(src_type) < 0) goto error;
if(H5Tclose(dst_type) < 0) goto error;
@@ -4372,7 +4352,7 @@ test_conv_str_1(void)
error:
H5E_BEGIN_TRY {
- H5Tclose(src_type);
+ H5Tclose(src_type);
H5Tclose(dst_type);
} H5E_END_TRY;
@@ -4387,16 +4367,16 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_conv_str_2
+ * Function: test_conv_str_2
*
- * Purpose: Tests C-to-Fortran and Fortran-to-C string conversion speed.
+ * Purpose: Tests C-to-Fortran and Fortran-to-C string conversion speed.
*
- * Return: Success: 0
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 10, 1998
*
*-------------------------------------------------------------------------
@@ -4404,12 +4384,12 @@ error:
static int
test_conv_str_2(void)
{
- char *buf = NULL, s[80];
- hid_t c_type = -1;
- hid_t f_type = -1;
- const size_t nelmts = NTESTELEM;
- size_t i, j, nchars;
- int ret_value = 1;
+ char *buf = NULL, s[80];
+ hid_t c_type = -1;
+ hid_t f_type = -1;
+ const size_t nelmts = NTESTELEM;
+ size_t i, j, nchars;
+ int ret_value = 1;
/*
* Initialize types and buffer.
@@ -4418,16 +4398,16 @@ test_conv_str_2(void)
if((f_type = mkstr((size_t)8, H5T_STR_SPACEPAD)) < 0) goto error;
if(NULL == (buf = (char*)HDcalloc(nelmts, (size_t)8))) goto error;
for(i = 0; i < nelmts; i++) {
- nchars = (size_t)(HDrand() % 8);
- for(j = 0; j < nchars; j++)
- buf[i * 8 + j] = (char)('a' + HDrand() % 26);
- while(j < nchars)
+ nchars = (size_t)(HDrand() % 8);
+ for(j = 0; j < nchars; j++)
+ buf[i * 8 + j] = (char)('a' + HDrand() % 26);
+ while(j < nchars)
buf[i * 8 + j++] = '\0';
} /* end for */
/* Do the conversions */
- sprintf(s, "Testing random string conversion speed");
- printf("%-70s", s);
+ HDsprintf(s, "Testing random string conversion speed");
+ HDprintf("%-70s", s);
HDfflush(stdout);
if(H5Tconvert(c_type, f_type, nelmts, buf, NULL, H5P_DEFAULT) < 0)
goto error;
@@ -4454,17 +4434,17 @@ error:
return ret_value;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_conv_str_3
+ * Function: test_conv_str_3
*
- * Purpose: Tests some functions that are or aren't supposed to work
+ * Purpose: Tests some functions that are or aren't supposed to work
* for string type.
*
- * Return: Success: 0
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Tuesday, April 4, 2006
*
*-------------------------------------------------------------------------
@@ -4472,12 +4452,12 @@ error:
static int
test_conv_str_3(void)
{
- char *buf=NULL;
- hid_t type = -1;
- hid_t super = -1;
- const size_t nelmts = NTESTELEM;
- size_t i, j, nchars;
- int ret_value = 1;
+ char *buf=NULL;
+ hid_t type = -1;
+ hid_t super = -1;
+ const size_t nelmts = NTESTELEM;
+ size_t i, j, nchars;
+ int ret_value = 1;
size_t size;
H5T_pad_t inpad;
H5T_sign_t sign;
@@ -4493,10 +4473,10 @@ test_conv_str_3(void)
if(NULL == (buf = (char*)HDcalloc(nelmts, (size_t)8)))
FAIL_PUTS_ERROR("Allocation failed.");
for(i = 0; i < nelmts; i++) {
- nchars = (size_t)(HDrand() % 8);
- for(j = 0; j < nchars; j++)
- buf[i * 8 + j] = (char)('a' + HDrand() % 26);
- while(j < nchars)
+ nchars = (size_t)(HDrand() % 8);
+ for(j = 0; j < nchars; j++)
+ buf[i * 8 + j] = (char)('a' + HDrand() % 26);
+ while(j < nchars)
buf[i * 8 + j++] = '\0';
} /* end for */
@@ -4559,7 +4539,7 @@ error:
H5Tclose(super);
} H5E_END_TRY;
- if(buf)
+ if(buf)
HDfree(buf);
if(tag)
H5free_memory(tag); /* Technically allocated by API call */
@@ -4572,17 +4552,17 @@ error:
return ret_value; /* Number of errors */
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_conv_enum_1
+ * Function: test_conv_enum_1
*
- * Purpose: Test conversion speed for enum datatypes
+ * Purpose: Test conversion speed for enum datatypes
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, January 5, 1999
*
* Modifications:
@@ -4593,11 +4573,11 @@ static int
test_conv_enum_1(void)
{
const size_t nelmts=NTESTELEM;
- int i, val, *buf=NULL;
- hid_t t1 = -1;
- hid_t t2 = -1;
- char s[80];
- int ret_value = 1;
+ int i, val, *buf=NULL;
+ hid_t t1 = -1;
+ hid_t t2 = -1;
+ char s[80];
+ int ret_value = 1;
size_t u;
/* Build the datatypes */
@@ -4605,9 +4585,9 @@ test_conv_enum_1(void)
if((t2 = H5Tenum_create(H5T_NATIVE_INT)) < 0) goto error;
s[1] = '\0';
for(i = 0; i < 26; i++) {
- s[0] = (char)('A' + i);
- H5Tenum_insert(t1, s, &i);
- H5Tenum_insert(t2, s, (val = i * 1000 + i, &val));
+ s[0] = (char)('A' + i);
+ H5Tenum_insert(t1, s, &i);
+ H5Tenum_insert(t2, s, (val = i * 1000 + i, &val));
} /* end for */
/* Initialize the buffer */
@@ -4617,14 +4597,14 @@ test_conv_enum_1(void)
buf[u] = HDrand() % 26;
/* Conversions */
- sprintf(s, "Testing random enum conversion O(N)");
- printf("%-70s", s);
+ HDsprintf(s, "Testing random enum conversion O(N)");
+ HDprintf("%-70s", s);
HDfflush(stdout);
if(H5Tconvert(t1, t2, nelmts, buf, NULL, H5P_DEFAULT) < 0) goto error;
PASSED();
- sprintf(s, "Testing random enum conversion O(N log N)");
- printf("%-70s", s);
+ HDsprintf(s, "Testing random enum conversion O(N log N)");
+ HDprintf("%-70s", s);
HDfflush(stdout);
if(H5Tconvert(t2, t1, nelmts, buf, NULL, H5P_DEFAULT) < 0) goto error;
PASSED();
@@ -4648,7 +4628,7 @@ error:
return ret_value;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_conv_enum_2
*
@@ -4674,7 +4654,7 @@ test_conv_enum_2(void)
"PURPLE",
"ORANGE",
"WHITE" };
-
+
TESTING("non-native enumeration type conversion");
/* Source enum type */
@@ -4710,7 +4690,7 @@ test_conv_enum_2(void)
if (data[i] != i%8) {
if (!nerrors++) {
H5_FAILED();
- printf("element %d is %d but should have been %d\n",
+ HDprintf("element %d is %d but should have been %d\n",
i, data[i], i%8);
}
}
@@ -4724,7 +4704,7 @@ test_conv_enum_2(void)
/* Failure */
if (nerrors) {
- printf("total of %d conversion errors out of %d elements for enums\n",
+ HDprintf("total of %d conversion errors out of %d elements for enums\n",
nerrors, NTESTELEM);
return 1;
}
@@ -4733,28 +4713,24 @@ test_conv_enum_2(void)
return 0;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_conv_bitfield
- *
- * Purpose: Test bitfield conversions.
+ * Function: test_conv_bitfield
*
- * Return: Success: 0
+ * Purpose: Test bitfield conversions.
*
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, May 20, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_conv_bitfield(void)
{
- unsigned char buf[4];
- hid_t st=-1, dt=-1;
+ unsigned char buf[4];
+ hid_t st=-1, dt=-1;
TESTING("bitfield conversions");
@@ -4769,10 +4745,9 @@ test_conv_bitfield(void)
buf[2] = buf[3] = 0x55; /*irrelevant*/
if (H5Tconvert(st, dt, (size_t)1, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (buf[0]!=0xAA || buf[1]!=0xAA || buf[2]!=0 || buf[3]!=0) {
- H5_FAILED();
- printf(" s=0xaaaa, d=0x%02x%02x%02x%02x (test 1)\n",
- buf[3], buf[2], buf[1], buf[0]);
- goto error;
+ H5_FAILED();
+ HDprintf(" s=0xaaaa, d=0x%02x%02x%02x%02x (test 1)\n", buf[3], buf[2], buf[1], buf[0]);
+ goto error;
}
/*
@@ -4788,10 +4763,9 @@ test_conv_bitfield(void)
buf[0] = 0xA8; buf[1] = 0x2A; buf[2] = buf[3] = 0;
if (H5Tconvert(st, dt, (size_t)1, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (buf[0]!=0 || buf[1]!=0xA8 || buf[2]!=0x2A || buf[3]!=0) {
- H5_FAILED();
- printf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 2)\n",
- buf[3], buf[2], buf[1], buf[0]);
- goto error;
+ H5_FAILED();
+ HDprintf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 2)\n", buf[3], buf[2], buf[1], buf[0]);
+ goto error;
}
/*
@@ -4802,10 +4776,9 @@ test_conv_bitfield(void)
buf[0] = 0xA8; buf[1] = 0x2A; buf[2] = buf[3] = 0;
if (H5Tconvert(st, dt, (size_t)1, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (buf[0]!=0xff || buf[1]!=0xAB || buf[2]!=0xEA || buf[3]!=0xff) {
- H5_FAILED();
- printf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 3)\n",
- buf[3], buf[2], buf[1], buf[0]);
- goto error;
+ H5_FAILED();
+ HDprintf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 3)\n", buf[3], buf[2], buf[1], buf[0]);
+ goto error;
}
H5Tclose(st);
@@ -4830,28 +4803,24 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_bitfield_funcs
+ * Function: test_bitfield_funcs
*
- * Purpose: Test some datatype functions that are and aren't supposed
+ * Purpose: Test some datatype functions that are and aren't supposed
* work for bitfield type.
*
- * Return: Success: 0
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Failure: number of errors
- *
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Wednesday, April 5, 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_bitfield_funcs(void)
{
- hid_t type=-1, ntype=-1, super=-1;
+ hid_t type=-1, ntype=-1, super=-1;
size_t size;
char* tag=0;
H5T_pad_t inpad;
@@ -4884,7 +4853,7 @@ test_bitfield_funcs(void)
} H5E_END_TRY;
if (size>0) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
@@ -4893,7 +4862,7 @@ test_bitfield_funcs(void)
} H5E_END_TRY;
if (inpad>-1) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
@@ -4902,7 +4871,7 @@ test_bitfield_funcs(void)
} H5E_END_TRY;
if (cset>-1) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
@@ -4911,7 +4880,7 @@ test_bitfield_funcs(void)
} H5E_END_TRY;
if (strpad>-1) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
@@ -4920,7 +4889,7 @@ test_bitfield_funcs(void)
} H5E_END_TRY;
if(ret>=0) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
@@ -4929,7 +4898,7 @@ test_bitfield_funcs(void)
} H5E_END_TRY;
if (tag) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
@@ -4938,7 +4907,7 @@ test_bitfield_funcs(void)
} H5E_END_TRY;
if (super>=0) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
@@ -4959,48 +4928,41 @@ error:
return retval;
}
-
+
/*-------------------------------------------------------------------------
- * Function: convert_opaque
+ * Function: convert_opaque
*
- * Purpose: A fake opaque conversion functions
+ * Purpose: A fake opaque conversion functions
*
- * Return: Success: 0
+ * Return: Success: 0
+ * Failure: -1
*
- * Failure: -1
- *
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, June 4, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
convert_opaque(hid_t H5_ATTR_UNUSED st, hid_t H5_ATTR_UNUSED dt, H5T_cdata_t *cdata,
- size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride,
+ size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void H5_ATTR_UNUSED *_buf,
- void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dset_xfer_plid)
+ void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dset_xfer_plid)
{
- if (H5T_CONV_CONV==cdata->command) num_opaque_conversions_g++;
+ if (H5T_CONV_CONV==cdata->command)
+ num_opaque_conversions_g++;
return 0;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_opaque
- *
- * Purpose: Driver function to test opaque datatypes
+ * Function: test_opaque
*
- * Return: Success: 0
+ * Purpose: Driver function to test opaque datatypes
*
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* June 2, 2004
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -5029,29 +4991,27 @@ test_opaque(void)
return num_errors;
}
-
+
/*-------------------------------------------------------------------------
- * Function: opaque_check
- *
- * Purpose: Test opaque datatypes
+ * Function: opaque_check
*
- * Return: Success: 0
+ * Purpose: Test opaque datatypes
*
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, May 20, 1999
- *
*-------------------------------------------------------------------------
*/
static int
opaque_check(int tag_it)
{
#define OPAQUE_NELMTS 1000
- hid_t st=-1, dt=-1;
- herr_t status;
- char buf[1]; /*not really used*/
- int saved;
+ hid_t st=-1, dt=-1;
+ herr_t status;
+ char buf[1]; /*not really used*/
+ int saved;
saved = num_opaque_conversions_g = 0;
@@ -5067,29 +5027,29 @@ opaque_check(int tag_it)
/* Make sure that we can't convert between the types yet */
H5E_BEGIN_TRY {
- status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT);
+ status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT);
} H5E_END_TRY;
if (status>=0) {
- H5_FAILED();
- printf(" opaque conversion should have failed but succeeded\n");
- goto error;
+ H5_FAILED();
+ HDprintf(" opaque conversion should have failed but succeeded\n");
+ goto error;
}
/* Register a conversion function */
if (H5Tregister(H5T_PERS_HARD, "o_test", st, dt, convert_opaque) < 0)
- goto error;
+ goto error;
/* Try the conversion again, this time it should work */
if (H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT) < 0) goto error;
if (saved+1 != num_opaque_conversions_g) {
- H5_FAILED();
- printf(" unexpected number of opaque conversions\n");
- goto error;
+ H5_FAILED();
+ HDprintf(" unexpected number of opaque conversions\n");
+ goto error;
}
/* Unregister conversion function */
if (H5Tunregister(H5T_PERS_HARD, "o_test", st, dt, convert_opaque) < 0)
- goto error;
+ goto error;
H5Tclose(st);
H5Tclose(dt);
@@ -5102,16 +5062,16 @@ opaque_check(int tag_it)
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: opaque_long
+ * Function: opaque_long
*
- * Purpose: Test named (committed) opaque datatypes w/very long tags
+ * Purpose: Test named (committed) opaque datatypes w/very long tags
*
- * Return: Success: 0
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, June 14, 2005
*
*-------------------------------------------------------------------------
@@ -5119,9 +5079,9 @@ opaque_check(int tag_it)
static int
opaque_long(void)
{
- char *long_tag = NULL;
- hid_t dt = -1;
- herr_t ret;
+ char *long_tag = NULL;
+ hid_t dt = -1;
+ herr_t ret;
/* Build opaque type */
if((dt=H5Tcreate(H5T_OPAQUE, (size_t)4)) < 0) TEST_ERROR
@@ -5133,7 +5093,7 @@ opaque_long(void)
/* Set opaque type's tag */
H5E_BEGIN_TRY {
- ret = H5Tset_tag(dt, long_tag);
+ ret = H5Tset_tag(dt, long_tag);
} H5E_END_TRY;
if(ret != FAIL) TEST_ERROR
@@ -5154,28 +5114,24 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: opaque_funcs
+ * Function: opaque_funcs
*
- * Purpose: Test some type functions that are and aren't supposed to
+ * Purpose: Test some type functions that are and aren't supposed to
* work with opaque type.
*
- * Return: Success: 0
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Failure: number of errors
- *
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Wednesday, April 5, 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
opaque_funcs(void)
{
- hid_t type = -1, super=-1;
+ hid_t type = -1, super=-1;
size_t size;
H5T_pad_t inpad;
H5T_cset_t cset;
@@ -5193,7 +5149,7 @@ opaque_funcs(void)
ret=H5Tset_precision(type, (size_t)32);
} H5E_END_TRY;
if (ret>=0) {
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
@@ -5201,7 +5157,7 @@ opaque_funcs(void)
ret=H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE);
} H5E_END_TRY;
if (ret>=0) {
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
@@ -5209,7 +5165,7 @@ opaque_funcs(void)
size=H5Tget_ebias(type);
} H5E_END_TRY;
if (size>0) {
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
@@ -5217,7 +5173,7 @@ opaque_funcs(void)
inpad=H5Tget_inpad(type);
} H5E_END_TRY;
if (inpad>-1) {
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
@@ -5225,7 +5181,7 @@ opaque_funcs(void)
cset=H5Tget_cset(type);
} H5E_END_TRY;
if (cset>-1) {
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
@@ -5233,7 +5189,7 @@ opaque_funcs(void)
strpad=H5Tget_strpad(type);
} H5E_END_TRY;
if (strpad>-1) {
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
@@ -5241,7 +5197,7 @@ opaque_funcs(void)
ret=H5Tset_offset(type, (size_t)16);
} H5E_END_TRY;
if (ret>=0) {
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
@@ -5249,7 +5205,7 @@ opaque_funcs(void)
sign = H5Tget_sign(type);
} H5E_END_TRY;
if (sign>-1) {
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
@@ -5257,7 +5213,7 @@ opaque_funcs(void)
super = H5Tget_super(type);
} H5E_END_TRY;
if (super>=0) {
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
@@ -5270,7 +5226,7 @@ opaque_funcs(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_encode
*
@@ -5311,7 +5267,7 @@ test_encode(void)
size_t enum_buf_size = 0;
size_t vlstr_buf_size = 0;
unsigned char *cmpd_buf=NULL, *enum_buf=NULL, *vlstr_buf=NULL;
- hid_t ret_id;
+ hid_t ret_id;
herr_t ret;
TESTING("functions of encoding and decoding datatypes");
@@ -5328,71 +5284,71 @@ test_encode(void)
/* Create a compound datatype */
if((tid1=H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) {
H5_FAILED();
- printf("Can't create datatype!\n");
+ HDprintf("Can't create datatype!\n");
goto error;
} /* end if */
if(H5Tinsert(tid1, "a", HOFFSET(struct s1, a), H5T_NATIVE_INT) < 0) {
H5_FAILED();
- printf("Can't insert field 'a'\n");
+ HDprintf("Can't insert field 'a'\n");
goto error;
} /* end if */
if(H5Tinsert(tid1, "b", HOFFSET(struct s1, b), H5T_NATIVE_FLOAT) < 0) {
H5_FAILED();
- printf("Can't insert field 'b'\n");
+ HDprintf("Can't insert field 'b'\n");
goto error;
} /* end if */
if(H5Tinsert(tid1, "c", HOFFSET(struct s1, c), H5T_NATIVE_LONG) < 0) {
H5_FAILED();
- printf("Can't insert field 'c'\n");
+ HDprintf("Can't insert field 'c'\n");
goto error;
} /* end if */
if(H5Tinsert(tid1, "d", HOFFSET(struct s1, d), H5T_NATIVE_DOUBLE) < 0) {
H5_FAILED();
- printf("Can't insert field 'd'\n");
+ HDprintf("Can't insert field 'd'\n");
goto error;
} /* end if */
/* Create a enumerate datatype */
if((tid2=H5Tcreate(H5T_ENUM, sizeof(short))) < 0) {
H5_FAILED();
- printf("Can't create enumerate type\n");
+ HDprintf("Can't create enumerate type\n");
goto error;
} /* end if */
if(H5Tenum_insert(tid2, "RED", (enum_val=0,&enum_val)) < 0) {
H5_FAILED();
- printf("Can't insert field into enumeration type\n");
+ HDprintf("Can't insert field into enumeration type\n");
goto error;
} /* end if */
if(H5Tenum_insert(tid2, "GREEN", (enum_val=1,&enum_val)) < 0) {
H5_FAILED();
- printf("Can't insert field into enumeration type\n");
+ HDprintf("Can't insert field into enumeration type\n");
goto error;
} /* end if */
if(H5Tenum_insert(tid2, "BLUE", (enum_val=2,&enum_val)) < 0) {
H5_FAILED();
- printf("Can't insert field into enumeration type\n");
+ HDprintf("Can't insert field into enumeration type\n");
goto error;
} /* end if */
if(H5Tenum_insert(tid2, "ORANGE", (enum_val=3,&enum_val)) < 0) {
H5_FAILED();
- printf("Can't insert field into enumeration type\n");
+ HDprintf("Can't insert field into enumeration type\n");
goto error;
} /* end if */
if(H5Tenum_insert(tid2, "YELLOW", (enum_val=4,&enum_val)) < 0) {
H5_FAILED();
- printf("Can't insert field into enumeration type\n");
+ HDprintf("Can't insert field into enumeration type\n");
goto error;
} /* end if */
/* Create a variable-length string type */
if((tid3 = H5Tcopy(H5T_C_S1)) < 0) {
H5_FAILED();
- printf("Can't copy a string type\n");
+ HDprintf("Can't copy a string type\n");
goto error;
} /* end if */
if(H5Tset_size(tid3, H5T_VARIABLE) < 0) {
H5_FAILED();
- printf("Can't the string type to be variable-length\n");
+ HDprintf("Can't the string type to be variable-length\n");
goto error;
} /* end if */
@@ -5403,7 +5359,7 @@ test_encode(void)
/* Encode compound type in a buffer */
if(H5Tencode(tid1, NULL, &cmpd_buf_size) < 0) {
H5_FAILED();
- printf("Can't encode compound type\n");
+ HDprintf("Can't encode compound type\n");
goto error;
} /* end if */
@@ -5412,17 +5368,17 @@ test_encode(void)
/* Try decoding bogus buffer */
H5E_BEGIN_TRY {
- ret_id = H5Tdecode(cmpd_buf);
+ ret_id = H5Tdecode(cmpd_buf);
} H5E_END_TRY;
if(ret_id!=FAIL) {
H5_FAILED();
- printf("Decoded bogus buffer!\n");
+ HDprintf("Decoded bogus buffer!\n");
goto error;
}
if(H5Tencode(tid1, cmpd_buf, &cmpd_buf_size) < 0) {
H5_FAILED();
- printf("Can't encode compound type\n");
+ HDprintf("Can't encode compound type\n");
goto error;
} /* end if */
@@ -5433,19 +5389,19 @@ test_encode(void)
/* Verify that the datatype was copied exactly */
if(H5Tequal(decoded_tid1, tid1)<=0) {
H5_FAILED();
- printf("Datatype wasn't encoded & decoded identically\n");
+ HDprintf("Datatype wasn't encoded & decoded identically\n");
goto error;
} /* end if */
/* Query member number and member index by name, for compound type. */
if(H5Tget_nmembers(decoded_tid1)!=4) {
H5_FAILED();
- printf("Can't get member number\n");
+ HDprintf("Can't get member number\n");
goto error;
} /* end if */
if(H5Tget_member_index(decoded_tid1, "c")!=2) {
H5_FAILED();
- printf("Can't get correct index number\n");
+ HDprintf("Can't get correct index number\n");
goto error;
} /* end if */
@@ -5453,7 +5409,7 @@ test_encode(void)
/* Encode enumerate type in a buffer */
if(H5Tencode(tid2, NULL, &enum_buf_size) < 0) {
H5_FAILED();
- printf("Can't encode enumerate type\n");
+ HDprintf("Can't encode enumerate type\n");
goto error;
} /* end if */
@@ -5462,33 +5418,33 @@ test_encode(void)
if(H5Tencode(tid2, enum_buf, &enum_buf_size) < 0) {
H5_FAILED();
- printf("Can't encode enumerate type\n");
+ HDprintf("Can't encode enumerate type\n");
goto error;
} /* end if */
/* Decode from the enumerate buffer and return an object handle */
if((decoded_tid2=H5Tdecode(enum_buf)) < 0) {
H5_FAILED();
- printf("Can't decode enumerate type\n");
+ HDprintf("Can't decode enumerate type\n");
goto error;
} /* end if */
/* Verify that the datatype was copied exactly */
if(H5Tequal(decoded_tid2, tid2)<=0) {
H5_FAILED();
- printf("Datatype wasn't encoded & decoded identically\n");
+ HDprintf("Datatype wasn't encoded & decoded identically\n");
goto error;
} /* end if */
/* Query member number and member index by name, for enumeration type. */
if(H5Tget_nmembers(decoded_tid2)!=5) {
H5_FAILED();
- printf("Can't get member number\n");
+ HDprintf("Can't get member number\n");
goto error;
} /* end if */
if(H5Tget_member_index(decoded_tid2, "ORANGE") != 3) {
H5_FAILED();
- printf("Can't get correct index number\n");
+ HDprintf("Can't get correct index number\n");
goto error;
} /* end if */
@@ -5496,7 +5452,7 @@ test_encode(void)
/* Encode VL string type in a buffer */
if(H5Tencode(tid3, NULL, &vlstr_buf_size) < 0) {
H5_FAILED();
- printf("Can't encode VL string type\n");
+ HDprintf("Can't encode VL string type\n");
goto error;
} /* end if */
@@ -5505,26 +5461,26 @@ test_encode(void)
if(H5Tencode(tid3, vlstr_buf, &vlstr_buf_size) < 0) {
H5_FAILED();
- printf("Can't encode VL string type\n");
+ HDprintf("Can't encode VL string type\n");
goto error;
} /* end if */
/* Decode from the VL string buffer and return an object handle */
if((decoded_tid3=H5Tdecode(vlstr_buf)) < 0) {
H5_FAILED();
- printf("Can't decode VL string type\n");
+ HDprintf("Can't decode VL string type\n");
goto error;
} /* end if */
/* Verify that the datatype was copied exactly */
if(H5Tequal(decoded_tid3, tid3)<=0) {
H5_FAILED();
- printf("Datatype wasn't encoded & decoded identically\n");
+ HDprintf("Datatype wasn't encoded & decoded identically\n");
goto error;
} /* end if */
if(!H5Tis_variable_str(decoded_tid3)) {
H5_FAILED();
- printf("Datatype wasn't encoded & decoded identically\n");
+ HDprintf("Datatype wasn't encoded & decoded identically\n");
goto error;
} /* end if */
@@ -5535,17 +5491,17 @@ test_encode(void)
/* Commit compound datatype and close it */
if(H5Tcommit2(file, compnd_type, tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) {
H5_FAILED();
- printf("Can't commit compound datatype\n");
+ HDprintf("Can't commit compound datatype\n");
goto error;
} /* end if */
if(H5Tclose(tid1) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
if(H5Tclose(decoded_tid1) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
HDfree(cmpd_buf);
@@ -5554,17 +5510,17 @@ test_encode(void)
/* Commit enumeration datatype and close it */
if(H5Tcommit2(file, enum_type, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) {
H5_FAILED();
- printf("Can't commit compound datatype\n");
+ HDprintf("Can't commit compound datatype\n");
goto error;
} /* end if */
if(H5Tclose(tid2) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
if(H5Tclose(decoded_tid2) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
HDfree(enum_buf);
@@ -5573,17 +5529,17 @@ test_encode(void)
/* Commit enumeration datatype and close it */
if(H5Tcommit2(file, vlstr_type, tid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) {
H5_FAILED();
- printf("Can't commit vl string datatype\n");
+ HDprintf("Can't commit vl string datatype\n");
goto error;
} /* end if */
if(H5Tclose(tid3) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
if(H5Tclose(decoded_tid3) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
HDfree(vlstr_buf);
@@ -5604,7 +5560,7 @@ test_encode(void)
/* Encode compound type in a buffer */
if(H5Tencode(tid1, NULL, &cmpd_buf_size) < 0) {
H5_FAILED();
- printf("Can't encode compound type\n");
+ HDprintf("Can't encode compound type\n");
goto error;
} /* end if */
@@ -5613,7 +5569,7 @@ test_encode(void)
if(H5Tencode(tid1, cmpd_buf, &cmpd_buf_size) < 0) {
H5_FAILED();
- printf("Can't encode compound type\n");
+ HDprintf("Can't encode compound type\n");
goto error;
} /* end if */
@@ -5624,26 +5580,26 @@ test_encode(void)
/* Verify that the datatype was copied exactly */
if(H5Tequal(decoded_tid1, tid1)<=0) {
H5_FAILED();
- printf("Datatype wasn't encoded & decoded identically\n");
+ HDprintf("Datatype wasn't encoded & decoded identically\n");
goto error;
} /* end if */
/* Query member number and member index by name, for compound type. */
if(H5Tget_nmembers(decoded_tid1)!=4) {
H5_FAILED();
- printf("Can't get member number\n");
+ HDprintf("Can't get member number\n");
goto error;
} /* end if */
if(H5Tget_member_index(decoded_tid1, "c")!=2) {
H5_FAILED();
- printf("Can't get correct index number\n");
+ HDprintf("Can't get correct index number\n");
goto error;
} /* end if */
/* Encode enumerate type in a buffer */
if(H5Tencode(tid2, NULL, &enum_buf_size) < 0) {
H5_FAILED();
- printf("Can't encode enumerate type\n");
+ HDprintf("Can't encode enumerate type\n");
goto error;
} /* end if */
@@ -5652,40 +5608,40 @@ test_encode(void)
if(H5Tencode(tid2, enum_buf, &enum_buf_size) < 0) {
H5_FAILED();
- printf("Can't encode enumerate type\n");
+ HDprintf("Can't encode enumerate type\n");
goto error;
} /* end if */
/* Decode from the enumerate buffer and return an object handle */
if((decoded_tid2=H5Tdecode(enum_buf)) < 0) {
H5_FAILED();
- printf("Can't decode enumerate type\n");
+ HDprintf("Can't decode enumerate type\n");
goto error;
} /* end if */
/* Verify that the datatype was copied exactly */
if(H5Tequal(decoded_tid2, tid2)<=0) {
H5_FAILED();
- printf("Datatype wasn't encoded & decoded identically\n");
+ HDprintf("Datatype wasn't encoded & decoded identically\n");
goto error;
} /* end if */
/* Query member number and member index by name, for enumeration type. */
if(H5Tget_nmembers(decoded_tid2)!=5) {
H5_FAILED();
- printf("Can't get member number\n");
+ HDprintf("Can't get member number\n");
goto error;
} /* end if */
if(H5Tget_member_index(decoded_tid2, "ORANGE")!=3) {
H5_FAILED();
- printf("Can't get correct index number\n");
+ HDprintf("Can't get correct index number\n");
goto error;
} /* end if */
/* Encode VL string type in a buffer */
if(H5Tencode(tid3, NULL, &vlstr_buf_size) < 0) {
H5_FAILED();
- printf("Can't encode VL string type\n");
+ HDprintf("Can't encode VL string type\n");
goto error;
} /* end if */
@@ -5694,14 +5650,14 @@ test_encode(void)
if(H5Tencode(tid3, vlstr_buf, &vlstr_buf_size) < 0) {
H5_FAILED();
- printf("Can't encode VL string type\n");
+ HDprintf("Can't encode VL string type\n");
goto error;
} /* end if */
/* Decode from the VL string buffer and return an object handle */
if((decoded_tid3=H5Tdecode(vlstr_buf)) < 0) {
H5_FAILED();
- printf("Can't decode VL string type\n");
+ HDprintf("Can't decode VL string type\n");
goto error;
} /* end if */
HDfree(vlstr_buf);
@@ -5709,12 +5665,12 @@ test_encode(void)
/* Verify that the datatype was copied exactly */
if(H5Tequal(decoded_tid3, tid3)<=0) {
H5_FAILED();
- printf("Datatype wasn't encoded & decoded identically\n");
+ HDprintf("Datatype wasn't encoded & decoded identically\n");
goto error;
} /* end if */
if(!H5Tis_variable_str(decoded_tid3)) {
H5_FAILED();
- printf("Datatype wasn't encoded & decoded identically\n");
+ HDprintf("Datatype wasn't encoded & decoded identically\n");
goto error;
} /* end if */
@@ -5724,69 +5680,69 @@ test_encode(void)
*/
/* Make sure the reference counts for the decoded datatypes are one. */
- if(H5Iget_ref(decoded_tid1) != 1) {
+ if(H5Iget_ref(decoded_tid1) != 1) {
H5_FAILED();
- printf("Decoded datatype has incorrect reference count\n");
+ HDprintf("Decoded datatype has incorrect reference count\n");
goto error;
} /* end if */
- if(H5Iget_ref(decoded_tid2) != 1) {
+ if(H5Iget_ref(decoded_tid2) != 1) {
H5_FAILED();
- printf("Decoded datatype has incorrect reference count\n");
+ HDprintf("Decoded datatype has incorrect reference count\n");
goto error;
} /* end if */
- if(H5Iget_ref(decoded_tid3) != 1) {
+ if(H5Iget_ref(decoded_tid3) != 1) {
H5_FAILED();
- printf("Decoded datatype has incorrect reference count\n");
+ HDprintf("Decoded datatype has incorrect reference count\n");
goto error;
} /* end if */
- /* Make sure the reference counts for the decoded datatypes can be
+ /* Make sure the reference counts for the decoded datatypes can be
* decremented and the datatypes are closed. */
- if(H5Idec_ref(decoded_tid1) != 0) {
+ if(H5Idec_ref(decoded_tid1) != 0) {
H5_FAILED();
- printf("Decoded datatype can't close\n");
+ HDprintf("Decoded datatype can't close\n");
goto error;
} /* end if */
- if(H5Idec_ref(decoded_tid2) != 0) {
+ if(H5Idec_ref(decoded_tid2) != 0) {
H5_FAILED();
- printf("Decoded datatype can't close\n");
+ HDprintf("Decoded datatype can't close\n");
goto error;
} /* end if */
- if(H5Idec_ref(decoded_tid3) != 0) {
+ if(H5Idec_ref(decoded_tid3) != 0) {
H5_FAILED();
- printf("Decoded datatype can't close\n");
+ HDprintf("Decoded datatype can't close\n");
goto error;
} /* end if */
/* Make sure the decoded datatypes are already closed. */
H5E_BEGIN_TRY {
- ret = H5Tclose(decoded_tid1);
+ ret = H5Tclose(decoded_tid1);
} H5E_END_TRY;
if(ret!=FAIL) {
H5_FAILED();
- printf("Decoded datatype should have been closed\n");
+ HDprintf("Decoded datatype should have been closed\n");
goto error;
}
H5E_BEGIN_TRY {
- ret = H5Tclose(decoded_tid2);
+ ret = H5Tclose(decoded_tid2);
} H5E_END_TRY;
if(ret!=FAIL) {
H5_FAILED();
- printf("Decoded datatype should have been closed\n");
+ HDprintf("Decoded datatype should have been closed\n");
goto error;
}
H5E_BEGIN_TRY {
- ret = H5Tclose(decoded_tid3);
+ ret = H5Tclose(decoded_tid3);
} H5E_END_TRY;
if(ret!=FAIL) {
H5_FAILED();
- printf("Decoded datatype should have been closed\n");
+ HDprintf("Decoded datatype should have been closed\n");
goto error;
}
@@ -5797,23 +5753,23 @@ test_encode(void)
/* Close datatype and file */
if(H5Tclose(tid1) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
if(H5Tclose(tid2) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
if(H5Tclose(tid3) < 0) {
H5_FAILED();
- printf("Can't close datatype\n");
+ HDprintf("Can't close datatype\n");
goto error;
} /* end if */
if(H5Fclose(file) < 0) {
H5_FAILED();
- printf("Can't close file\n");
+ HDprintf("Can't close file\n");
goto error;
} /* end if */
@@ -5836,7 +5792,7 @@ test_encode(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_latest
*
@@ -5863,7 +5819,7 @@ test_latest(void)
hid_t file = (-1); /* File ID */
hid_t tid1 = (-1), tid2 = (-1); /* Datatype ID */
hid_t fapl = (-1); /* File access property list */
- H5O_info_t oi; /* Stat buffer for committed datatype */
+ H5O_info_t oi; /* Stat buffer for committed datatype */
hsize_t old_dtype_oh_size; /* Size of object header with "old" format */
hsize_t new_dtype_oh_size; /* Size of object header with "new" format */
char filename[1024]; /* Buffer for filename */
@@ -6054,7 +6010,7 @@ conv_except(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5
return(H5T_CONV_UNHANDLED);
}
-
+
/*-------------------------------------------------------------------------
* Function: test_int_float_except
*
@@ -6081,14 +6037,13 @@ static int
test_int_float_except(void)
{
#if H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4
- float buf[CONVERT_SIZE] = {(float)INT_MIN - 172.0f, (float)INT_MAX - 32.0f,
- (float)INT_MAX - 68.0f, (float)4.5f};
- int buf_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX-127, 4};
+ float buf[CONVERT_SIZE] = {(float)INT_MIN - 172.0f, (float)INT_MAX - 32.0f, (float)INT_MAX - 68.0f, (float)4.5f};
+ int buf_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX-127, 4};
float buf_float[CONVERT_SIZE] = {(float)INT_MIN, (float)INT_MAX + 1.0f, (float)INT_MAX - 127.0f, 4};
- int *intp; /* Pointer to buffer, as integers */
- int buf2[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 72, 0};
+ int *intp; /* Pointer to buffer, as integers */
+ int buf2[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 72, 0};
float buf2_float[CONVERT_SIZE] = {(float)INT_MIN, (float)INT_MAX, (float)INT_MAX - 127.0f, (float)0.0f};
- int buf2_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 127, 0};
+ int buf2_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 127, 0};
float *floatp; /* Pointer to buffer #2, as floats */
hid_t dxpl; /* Dataset transfer property list */
except_info_t e; /* Exception information */
@@ -6144,8 +6099,7 @@ test_int_float_except(void)
/* Convert second buffer */
HDmemset(&e, 0, sizeof(except_info_t));
- if(H5Tconvert(H5T_NATIVE_INT, H5T_NATIVE_FLOAT, (size_t)CONVERT_SIZE,
- buf2, NULL, dxpl) < 0) TEST_ERROR
+ if(H5Tconvert(H5T_NATIVE_INT, H5T_NATIVE_FLOAT, (size_t)CONVERT_SIZE, buf2, NULL, dxpl) < 0) TEST_ERROR
/* Check the buffer after conversion, as floats */
for(u = 0; u < CONVERT_SIZE; u++) {
@@ -6162,8 +6116,7 @@ test_int_float_except(void)
/* Convert buffer */
HDmemset(&e, 0, sizeof(except_info_t));
- if(H5Tconvert(H5T_NATIVE_FLOAT, H5T_NATIVE_INT, (size_t)CONVERT_SIZE,
- buf2, NULL, dxpl) < 0) TEST_ERROR
+ if(H5Tconvert(H5T_NATIVE_FLOAT, H5T_NATIVE_INT, (size_t)CONVERT_SIZE, buf2, NULL, dxpl) < 0) TEST_ERROR
/* Check the buffer after conversion, as integers */
for(u = 0; u < CONVERT_SIZE; u++) {
@@ -6197,7 +6150,7 @@ error:
#endif /* H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 */
} /* end test_int_float_except() */
-
+
/*-------------------------------------------------------------------------
* Function: test_set_order
*
@@ -6358,11 +6311,11 @@ error:
return 1;
} /* end test_set_order() */
-
+
/*-------------------------------------------------------------------------
* Function: test_set_order_compound
*
- * Purpose: Tests H5Tset_order/H5Tget_order for complicated compound
+ * Purpose: Tests H5Tset_order/H5Tget_order for complicated compound
* type.
*
* Return: Success: 0
@@ -6394,13 +6347,13 @@ test_set_order_compound(hid_t fapl)
hid_t cmpd = -1, memb_cmpd = -1, memb_array1 = -1, memb_array2 = -1, cmpd_array = -1;
hid_t vl_id = -1;
hsize_t dims[2] = {3, 4}; /* Array dimenstions */
- char filename[1024];
+ char filename[1024];
herr_t ret; /* Generic return value */
TESTING("H5Tset/get_order for compound type");
if((memb_cmpd = H5Tcreate(H5T_COMPOUND, sizeof(atomic_cmpd))) < 0) FAIL_STACK_ERROR
- if(H5Tinsert(memb_cmpd, "i", HOFFSET(atomic_cmpd, i), H5T_NATIVE_INT) < 0) FAIL_STACK_ERROR
+ if(H5Tinsert(memb_cmpd, "i", HOFFSET(atomic_cmpd, i), H5T_NATIVE_INT) < 0) FAIL_STACK_ERROR
if(H5Tinsert(memb_cmpd, "c", HOFFSET(atomic_cmpd, c), H5T_NATIVE_CHAR) < 0) FAIL_STACK_ERROR
if(H5Tinsert(memb_cmpd, "s", HOFFSET(atomic_cmpd, s), H5T_NATIVE_SHORT) < 0) FAIL_STACK_ERROR
if(H5Tinsert(memb_cmpd, "f", HOFFSET(atomic_cmpd, f), H5T_NATIVE_FLOAT) < 0) FAIL_STACK_ERROR
@@ -6420,19 +6373,19 @@ test_set_order_compound(hid_t fapl)
/* Create a compound type using the types above. */
if((cmpd = H5Tcreate(H5T_COMPOUND, sizeof(complex_cmpd))) < 0) FAIL_STACK_ERROR
- if(H5Tinsert(cmpd, "a", HOFFSET(complex_cmpd, a), memb_cmpd) < 0) FAIL_STACK_ERROR
- if(H5Tinsert(cmpd, "vl_type", HOFFSET(complex_cmpd, vl), vl_id) < 0) FAIL_STACK_ERROR
- if(H5Tinsert(cmpd, "b", HOFFSET(complex_cmpd, b), memb_array1) < 0) FAIL_STACK_ERROR
- if(H5Tinsert(cmpd, "d", HOFFSET(complex_cmpd, d), memb_array2) < 0) FAIL_STACK_ERROR
+ if(H5Tinsert(cmpd, "a", HOFFSET(complex_cmpd, a), memb_cmpd) < 0) FAIL_STACK_ERROR
+ if(H5Tinsert(cmpd, "vl_type", HOFFSET(complex_cmpd, vl), vl_id) < 0) FAIL_STACK_ERROR
+ if(H5Tinsert(cmpd, "b", HOFFSET(complex_cmpd, b), memb_array1) < 0) FAIL_STACK_ERROR
+ if(H5Tinsert(cmpd, "d", HOFFSET(complex_cmpd, d), memb_array2) < 0) FAIL_STACK_ERROR
/* The order should be mixed now. */
- if(H5Tget_order(cmpd) != H5T_ORDER_MIXED) FAIL_STACK_ERROR
+ if(H5Tget_order(cmpd) != H5T_ORDER_MIXED) FAIL_STACK_ERROR
/* Create an array of the compound type above */
cmpd_array = H5Tarray_create2(cmpd, 2, dims);
/* The order of the array type should be the same as the compound type */
- if(H5Tget_order(cmpd_array) != H5T_ORDER_MIXED) FAIL_STACK_ERROR
+ if(H5Tget_order(cmpd_array) != H5T_ORDER_MIXED) FAIL_STACK_ERROR
/* Verify that the order can't be 'none'. */
H5E_BEGIN_TRY
@@ -6450,13 +6403,13 @@ test_set_order_compound(hid_t fapl)
if(H5Tset_order(cmpd, H5T_ORDER_BE) < 0) FAIL_STACK_ERROR
/* Verify that the order of the compound type is big-endian */
- if(H5Tget_order(cmpd) != H5T_ORDER_BE) FAIL_STACK_ERROR
+ if(H5Tget_order(cmpd) != H5T_ORDER_BE) FAIL_STACK_ERROR
/* Change the order of the array type to little-endian*/
if(H5Tset_order(cmpd_array, H5T_ORDER_LE) < 0) FAIL_STACK_ERROR
/* Verify that the order of the array type is little-endian */
- if(H5Tget_order(cmpd_array) != H5T_ORDER_LE) FAIL_STACK_ERROR
+ if(H5Tget_order(cmpd_array) != H5T_ORDER_LE) FAIL_STACK_ERROR
/* Create file */
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
@@ -6491,39 +6444,35 @@ error:
H5Tclose(vl_id);
H5Tclose(cmpd);
H5Tclose(cmpd_array);
- H5Fclose(file);
+ H5Fclose(file);
H5E_END_TRY;
return 1;
} /* end test_set_order_compound() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_named_indirect_reopen
+ * Function: test_named_indirect_reopen
*
- * Purpose: Tests that open named datatypes can be reopened indirectly
+ * Purpose: Tests that open named datatypes can be reopened indirectly
* through H5Dget_type without causing problems.
*
- * Return: Success: 0
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Failure: number of errors
- *
- * Programmer: Neil Fortner
+ * Programmer: Neil Fortner
* Thursday, June 4, 2009
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_named_indirect_reopen(hid_t fapl)
{
- hid_t file=-1, type=-1, reopened_type=-1, strtype=-1, dset=-1, space=-1;
- static hsize_t dims[1] = {3};
- size_t dt_size;
- int enum_value;
- const char *tag = "opaque_tag";
- char *tag_ret = NULL;
- char filename[1024];
+ hid_t file=-1, type=-1, reopened_type=-1, strtype=-1, dset=-1, space=-1;
+ static hsize_t dims[1] = {3};
+ size_t dt_size;
+ int enum_value;
+ const char *tag = "opaque_tag";
+ char *tag_ret = NULL;
+ char filename[1024];
TESTING("indirectly reopening committed datatypes");
@@ -6687,12 +6636,12 @@ test_named_indirect_reopen(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Tclose(type);
- H5Tclose(strtype);
- H5Tclose(reopened_type);
- H5Sclose(space);
- H5Dclose(dset);
- H5Fclose(file);
+ H5Tclose(type);
+ H5Tclose(strtype);
+ H5Tclose(reopened_type);
+ H5Sclose(space);
+ H5Dclose(dset);
+ H5Fclose(file);
} H5E_END_TRY;
if(tag_ret)
H5free_memory(tag_ret);
@@ -6803,17 +6752,17 @@ static void create_del_obj_named_test_file(const char *filename, hid_t fapl,
HDassert(status >= 0);
} /* end create_del_obj_named_test_file() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_delete_obj_named
+ * Function: test_delete_obj_named
*
- * Purpose: Tests that delete objects that use named datatypes through
+ * Purpose: Tests that delete objects that use named datatypes through
* different file IDs
*
- * Return: Success: 0
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, July 18, 2011
*
*-------------------------------------------------------------------------
@@ -6891,27 +6840,27 @@ test_delete_obj_named(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Tclose(attr);
- H5Dclose(dset);
- H5Pclose(fapl2);
- H5Fclose(filea1);
- H5Fclose(filea2);
- H5Fclose(fileb);
+ H5Tclose(attr);
+ H5Dclose(dset);
+ H5Pclose(fapl2);
+ H5Fclose(filea1);
+ H5Fclose(filea2);
+ H5Fclose(fileb);
} H5E_END_TRY;
return 1;
} /* end test_delete_obj_named() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_delete_obj_named_fileid
+ * Function: test_delete_obj_named_fileid
*
- * Purpose: Tests that objects that use named datatypes through
+ * Purpose: Tests that objects that use named datatypes through
* different file IDs get the correct file IDs
*
- * Return: Success: 0
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, July 28, 2011
*
*-------------------------------------------------------------------------
@@ -7054,29 +7003,29 @@ test_delete_obj_named_fileid(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Aclose(attr);
- H5Tclose(type);
- H5Dclose(dset);
- H5Pclose(fapl2);
- H5Fclose(filea1);
- H5Fclose(filea2);
- H5Fclose(fileb);
- H5Fclose(attr_fid);
- H5Fclose(type_fid);
+ H5Aclose(attr);
+ H5Tclose(type);
+ H5Dclose(dset);
+ H5Pclose(fapl2);
+ H5Fclose(filea1);
+ H5Fclose(filea2);
+ H5Fclose(fileb);
+ H5Fclose(attr_fid);
+ H5Fclose(type_fid);
} H5E_END_TRY;
return 1;
} /* end test_delete_obj_named_fileid() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_deprec
+ * Function: test_deprec
*
- * Purpose: Tests deprecated API routines for datatypes.
+ * Purpose: Tests deprecated API routines for datatypes.
*
- * Return: Success: 0
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, September 27, 2007
*
*-------------------------------------------------------------------------
@@ -7085,17 +7034,17 @@ error:
static int
test_deprec(hid_t fapl)
{
- hid_t file = -1; /* File ID */
- hid_t type = -1; /* Datatype ID */
+ hid_t file = -1; /* File ID */
+ hid_t type = -1; /* Datatype ID */
unsigned rank = 2; /* Rank for array datatype */
hsize_t dims[2] = {3, 3}; /* Dimensions for array datatype */
int perm[2] = {0, 1}; /* Dimensions permutations for array datatype */
hsize_t rdims[2]= {0, 0}; /* Dimensions for querying array datatype */
int rperm[2] = {-2, -2}; /* Dimensions permutations for array datatype */
hbool_t dim_mismatch; /* Whether any dimensions didn't match */
- char filename[1024];
+ char filename[1024];
unsigned u; /* Local index variable */
- herr_t status; /* Generic routine value */
+ herr_t status; /* Generic routine value */
TESTING("deprected API routines for datatypes");
@@ -7123,7 +7072,7 @@ test_deprec(hid_t fapl)
dim_mismatch = TRUE;
} /* end if */
if(dim_mismatch)
- FAIL_PUTS_ERROR(" Dimensions didn't match!")
+ FAIL_PUTS_ERROR(" Dimensions didn't match!")
/* Check the array dimension permutations */
dim_mismatch = FALSE;
@@ -7133,7 +7082,7 @@ test_deprec(hid_t fapl)
dim_mismatch = TRUE;
} /* end if */
if(dim_mismatch)
- FAIL_PUTS_ERROR(" Dimension permutations modified!")
+ FAIL_PUTS_ERROR(" Dimension permutations modified!")
/* Close the datatype */
if(H5Tclose(type) < 0)
@@ -7146,31 +7095,31 @@ test_deprec(hid_t fapl)
/* Predefined types cannot be committed */
H5E_BEGIN_TRY {
- status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT);
+ status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT);
} H5E_END_TRY;
if(status >= 0)
- FAIL_PUTS_ERROR(" Predefined types should not be committable!")
+ FAIL_PUTS_ERROR(" Predefined types should not be committable!")
/* Copy a predefined datatype and commit the copy */
if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR
if(H5Tcommit1(file, "native-int", type) < 0) FAIL_STACK_ERROR
if((status = H5Tcommitted(type)) < 0) FAIL_STACK_ERROR
if(0 == status)
- FAIL_PUTS_ERROR(" H5Tcommitted() returned false!")
+ FAIL_PUTS_ERROR(" H5Tcommitted() returned false!")
/* We should not be able to modify a type after it has been committed. */
H5E_BEGIN_TRY {
- status = H5Tset_precision(type, (size_t)256);
+ status = H5Tset_precision(type, (size_t)256);
} H5E_END_TRY;
if(status >= 0)
- FAIL_PUTS_ERROR(" Committed type is not constant!")
+ FAIL_PUTS_ERROR(" Committed type is not constant!")
/* We should not be able to re-commit a committed type */
H5E_BEGIN_TRY {
- status = H5Tcommit1(file, "test_named_2 (should not exist)", type);
+ status = H5Tcommit1(file, "test_named_2 (should not exist)", type);
} H5E_END_TRY;
if(status >= 0)
- FAIL_PUTS_ERROR(" Committed types should not be recommitted!")
+ FAIL_PUTS_ERROR(" Committed types should not be recommitted!")
/*
* Close the committed type and reopen it. It should return a named type.
@@ -7179,7 +7128,7 @@ test_deprec(hid_t fapl)
if((type = H5Topen1(file, "native-int")) < 0) FAIL_STACK_ERROR
if((status = H5Tcommitted(type)) < 0) FAIL_STACK_ERROR
if(!status)
- FAIL_PUTS_ERROR(" Opened named types should be named types!")
+ FAIL_PUTS_ERROR(" Opened named types should be named types!")
/* Close */
if(H5Tclose(type) < 0) FAIL_STACK_ERROR
@@ -7209,24 +7158,24 @@ test_deprec(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Tclose(type);
- H5Fclose(file);
+ H5Tclose(type);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* end test_deprec() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
+
/*-------------------------------------------------------------------------
- * Function: test_utf_ascii_conv
+ * Function: test_utf_ascii_conv
*
- * Purpose: Make sure the library doesn't conversion strings between
+ * Purpose: Make sure the library doesn't conversion strings between
* ASCII and UTF8.
*
- * Return: Success: 0
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 10 November 2011
*-------------------------------------------------------------------------
*/
@@ -7244,12 +7193,12 @@ test_utf_ascii_conv(void)
char *ascii_r = NULL;
const char *ascii_w = "bar!";
char *utf8_r = NULL;
- char filename[1024];
+ char filename[1024];
char ascii2[4], utf8_2[4];
herr_t status;
TESTING("string conversion between ASCII and UTF");
-
+
/************************************************
* Test VL string conversion from UTF8 to ASCII
************************************************/
@@ -7416,13 +7365,13 @@ test_utf_ascii_conv(void)
error:
H5E_BEGIN_TRY {
- H5Tclose(utf8_vtid);
- H5Tclose(ascii_vtid);
- H5Tclose(utf8_tid);
- H5Tclose(ascii_tid);
- H5Dclose(did);
- H5Sclose(sid);
- H5Fclose(fid);
+ H5Tclose(utf8_vtid);
+ H5Tclose(ascii_vtid);
+ H5Tclose(utf8_tid);
+ H5Tclose(ascii_tid);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
}
@@ -7562,7 +7511,7 @@ error:
return ret;
} /* end of verify_version */
-
+
/*-------------------------------------------------------------------------
* Function: test_versionbounds
*
@@ -7582,8 +7531,8 @@ error:
* It then loops through all valid combination of the library version
* bounds to verify each datatype's version.
*
- * Return: Success: 0
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
*-------------------------------------------------------------------------
*/
@@ -7772,26 +7721,26 @@ test_versionbounds(void)
/* Close dataspace and property lists */
if (H5Sclose(space) < 0) TEST_ERROR
- if (H5Pclose(fcpl) < 0) TEST_ERROR
- if (H5Pclose(fapl) < 0) TEST_ERROR
+ if (H5Pclose(fcpl) < 0) TEST_ERROR
+ if (H5Pclose(fapl) < 0) TEST_ERROR
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Dclose(dset);
- H5Sclose(space);
- H5Tclose(dset_dtype);
- H5Pclose(dcpl);
- H5Pclose(fcpl);
- H5Pclose(fapl);
- H5Fclose(file);
+ H5Dclose(dset);
+ H5Sclose(space);
+ H5Tclose(dset_dtype);
+ H5Pclose(dcpl);
+ H5Pclose(fcpl);
+ H5Pclose(fapl);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* end test_versionbounds() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -7803,16 +7752,13 @@ error:
*
* Programmer: Robb Matzke
* Tuesday, December 9, 1997
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
main(void)
{
- long nerrors = 0;
- hid_t fapl = -1;
+ long nerrors = 0;
+ hid_t fapl = -1;
/* Set the random # seed */
HDsrandom((unsigned)HDtime(NULL));
@@ -7821,7 +7767,7 @@ main(void)
fapl = h5_fileaccess();
if(ALIGNMENT)
- printf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT);
+ HDprintf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT);
/* Do the tests */
nerrors += test_classes();
@@ -7876,12 +7822,11 @@ main(void)
nerrors += test_versionbounds();
if(nerrors) {
- printf("***** %lu FAILURE%s! *****\n",
- nerrors, 1==nerrors?"":"S");
+ HDprintf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S");
HDexit(EXIT_FAILURE);
}
- printf("All datatype tests passed.\n");
+ HDprintf("All datatype tests passed.\n");
return 0;
}
diff --git a/test/earray.c b/test/earray.c
index d72b3f5..bace4b7 100644
--- a/test/earray.c
+++ b/test/earray.c
@@ -20,14 +20,14 @@
* This file needs to access private datatypes from the H5EA package.
* This file also needs to access the extensible array testing code.
*/
-#define H5EA_FRIEND /*suppress error about including H5EApkg */
+#define H5EA_FRIEND /*suppress error about including H5EApkg */
#define H5EA_TESTING
-#include "H5EApkg.h" /* Extensible Arrays */
+#include "H5EApkg.h" /* Extensible Arrays */
/* Other private headers that this test requires */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Iprivate.h" /* IDs */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5Iprivate.h" /* IDs */
+#include "H5VMprivate.h" /* Vectors and arrays */
/* Local macros */
@@ -172,16 +172,16 @@ char filename_g[EARRAY_FILENAME_LEN];
/* Empty file size */
h5_stat_size_t empty_size_g;
-
+
/*-------------------------------------------------------------------------
- * Function: init_cparam
+ * Function: init_cparam
*
- * Purpose: Initialize array creation parameter structure
+ * Purpose: Initialize array creation parameter structure
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 21, 2008
*
*-------------------------------------------------------------------------
@@ -204,18 +204,18 @@ init_cparam(H5EA_create_t *cparam)
return(0);
} /* init_cparam() */
-
+
/*-------------------------------------------------------------------------
- * Function: init_tparam
+ * Function: init_tparam
*
- * Purpose: Initialize array testing parameter structure
+ * Purpose: Initialize array testing parameter structure
*
- * Note: This initialization is the same as that in H5EA_hdr_init()
+ * Note: This initialization is the same as that in H5EA_hdr_init()
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, September 25, 2008
*
*-------------------------------------------------------------------------
@@ -254,16 +254,16 @@ init_tparam(earray_test_param_t *tparam, const H5EA_create_t *cparam)
return(0);
} /* init_tparam() */
-
+
/*-------------------------------------------------------------------------
- * Function: finish_tparam
+ * Function: finish_tparam
*
- * Purpose: Close down array testing parameter structure
+ * Purpose: Close down array testing parameter structure
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, September 25, 2008
*
*-------------------------------------------------------------------------
@@ -278,16 +278,16 @@ finish_tparam(earray_test_param_t *tparam)
return(0);
} /* finish_tparam() */
-
+
/*-------------------------------------------------------------------------
- * Function: create_file
+ * Function: create_file
*
- * Purpose: Create file and retrieve pointer to internal file object
+ * Purpose: Create file and retrieve pointer to internal file object
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
@@ -314,16 +314,16 @@ error:
return(-1);
} /* create_file() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_stats
+ * Function: check_stats
*
- * Purpose: Verify stats for an extensible array
+ * Purpose: Verify stats for an extensible array
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 21, 2008
*
*-------------------------------------------------------------------------
@@ -392,22 +392,22 @@ error:
return(-1);
} /* check_stats() */
-
+
/*-------------------------------------------------------------------------
- * Function: reopen_file
+ * Function: reopen_file
*
- * Purpose: Perform common "re-open" operations on file & array for testing
+ * Purpose: Perform common "re-open" operations on file & array for testing
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
*/
static int
-reopen_file(hid_t *file, H5F_t **f, hid_t fapl,
+reopen_file(hid_t *file, H5F_t **f, hid_t fapl,
H5EA_t **ea, haddr_t ea_addr, const earray_test_param_t *tparam)
{
/* Check for closing & re-opening the array */
@@ -453,16 +453,16 @@ error:
return(-1);
} /* reopen_file() */
-
+
/*-------------------------------------------------------------------------
- * Function: create_array
+ * Function: create_array
*
- * Purpose: Create an extensible array and perform initial checks
+ * Purpose: Create an extensible array and perform initial checks
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
@@ -500,16 +500,16 @@ error:
return(-1);
} /* create_array() */
-
+
/*-------------------------------------------------------------------------
- * Function: verify_cparam
+ * Function: verify_cparam
*
- * Purpose: Verify creation parameters are correct
+ * Purpose: Verify creation parameters are correct
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
@@ -529,23 +529,23 @@ 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() */
-
+
/*-------------------------------------------------------------------------
- * Function: finish
+ * Function: finish
*
- * Purpose: Close array, delete array, close file and verify that file
+ * Purpose: Close array, delete array, close file and verify that file
* is empty size
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
@@ -589,16 +589,16 @@ error:
return(-1);
} /* finish() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_create
+ * Function: test_create
*
- * Purpose: Test creating extensible array
+ * Purpose: Test creating extensible array
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 7, 2008
*
*-------------------------------------------------------------------------
@@ -606,8 +606,8 @@ error:
static unsigned
test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSED *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5EA_t *ea = NULL; /* Extensible array wrapper */
haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */
@@ -805,22 +805,22 @@ error:
H5E_BEGIN_TRY {
if(ea)
H5EA_close(ea);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* end test_create() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_reopen
+ * Function: test_reopen
*
- * Purpose: Create & reopen an extensible array
+ * Purpose: Create & reopen an extensible array
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
@@ -828,8 +828,8 @@ error:
static unsigned
test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5EA_t *ea = NULL; /* Extensible array wrapper */
haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */
@@ -875,22 +875,22 @@ error:
H5E_BEGIN_TRY {
if(ea)
H5EA_close(ea);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_reopen() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_open_twice
+ * Function: test_open_twice
*
- * Purpose: Open an extensible array twice
+ * Purpose: Open an extensible array twice
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
@@ -898,10 +898,10 @@ error:
static unsigned
test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- hid_t file2 = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- H5F_t *f2 = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ hid_t file2 = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ H5F_t *f2 = NULL; /* Internal file object pointer */
H5EA_t *ea = NULL; /* Extensible array wrapper */
H5EA_t *ea2 = NULL; /* Extensible array wrapper */
haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */
@@ -981,25 +981,25 @@ error:
H5EA_close(ea);
if(ea2)
H5EA_close(ea2);
- H5Fclose(file);
- H5Fclose(file2);
+ H5Fclose(file);
+ H5Fclose(file2);
} H5E_END_TRY;
return 1;
} /* test_open_twice() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_open_twice_diff
+ * Function: test_open_twice_diff
*
- * Purpose: Open an extensible array twice, through different "top" file
+ * Purpose: Open an extensible array twice, through different "top" file
* handles, with an intermediate file open that takes the "shared"
* file handle from the first extensible array's file pointer.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, December 18, 2015
*
*-------------------------------------------------------------------------
@@ -1008,12 +1008,12 @@ static unsigned
test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
{
char filename_tmp[EARRAY_FILENAME_LEN]; /* Temporary file name */
- hid_t file = -1; /* File ID */
- hid_t file2 = -1; /* File ID */
- hid_t file0 = -1; /* File ID */
- hid_t file00 = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- H5F_t *f2 = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ hid_t file2 = -1; /* File ID */
+ hid_t file0 = -1; /* File ID */
+ hid_t file00 = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ H5F_t *f2 = NULL; /* Internal file object pointer */
H5EA_t *ea = NULL; /* Extensible array wrapper */
H5EA_t *ea2 = NULL; /* Extensible array wrapper */
haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */
@@ -1121,25 +1121,25 @@ error:
H5EA_close(ea);
if(ea2)
H5EA_close(ea2);
- H5Fclose(file);
- H5Fclose(file2);
- H5Fclose(file0);
- H5Fclose(file00);
+ H5Fclose(file);
+ H5Fclose(file2);
+ H5Fclose(file0);
+ H5Fclose(file00);
} H5E_END_TRY;
return 1;
} /* test_open_twice_diff() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_delete_open
+ * Function: test_delete_open
*
- * Purpose: Delete opened extensible array (& open deleted array)
+ * Purpose: Delete opened extensible array (& open deleted array)
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
*-------------------------------------------------------------------------
@@ -1147,8 +1147,8 @@ error:
static unsigned
test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5EA_t *ea = NULL; /* Extensible array wrapper */
H5EA_t *ea2 = NULL; /* Extensible array wrapper */
haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */
@@ -1242,7 +1242,7 @@ error:
H5EA_close(ea);
if(ea2)
H5EA_close(ea2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
@@ -1254,16 +1254,16 @@ typedef struct eiter_fw_t {
unsigned base_sblk_idx; /* Starting index for actual superblocks */
} eiter_fw_t;
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_fw_init
+ * Function: eiter_fw_init
*
- * Purpose: Initialize element interator (forward iteration)
+ * Purpose: Initialize element interator (forward iteration)
*
- * Return: Success: Pointer to iteration status object
- * Failure: NULL
+ * Return: Success: Pointer to iteration status object
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, October 2, 2008
*
*-------------------------------------------------------------------------
@@ -1286,16 +1286,16 @@ eiter_fw_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_para
return(eiter);
} /* end eiter_fw_init() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_fw_next
+ * Function: eiter_fw_next
*
- * Purpose: Get next element index (forward iteration)
+ * Purpose: Get next element index (forward iteration)
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 4, 2008
*
*-------------------------------------------------------------------------
@@ -1315,16 +1315,16 @@ eiter_fw_next(void *_eiter)
return(ret_val);
} /* end eiter_fw_next() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_fw_max
+ * Function: eiter_fw_max
*
- * Purpose: Get max. element index (forward iteration)
+ * Purpose: Get max. element index (forward iteration)
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 4, 2008
*
*-------------------------------------------------------------------------
@@ -1343,14 +1343,14 @@ eiter_fw_max(const void *_eiter)
/*-------------------------------------------------------------------------
- * Function: eiter_fw_state
+ * Function: eiter_fw_state
*
- * Purpose: Get extensible array state (forward iteration)
+ * Purpose: Get extensible array state (forward iteration)
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 4, 2008
*
*-------------------------------------------------------------------------
@@ -1415,16 +1415,16 @@ HDfprintf(stderr, "state->nsuper_blks = %Hu\n", state->nsuper_blks);
return(0);
} /* end eiter_fw_state() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_fw_term
+ * Function: eiter_fw_term
*
- * Purpose: Shut down element interator (forward iteration)
+ * Purpose: Shut down element interator (forward iteration)
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, October 2, 2008
*
*-------------------------------------------------------------------------
@@ -1460,16 +1460,16 @@ typedef struct eiter_rv_t {
hsize_t idx_blk_nsblks; /* Number of superblocks directly pointed to in the index block */
} eiter_rv_t;
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_rv_init
+ * Function: eiter_rv_init
*
- * Purpose: Initialize element interator (reverse iteration)
+ * Purpose: Initialize element interator (reverse iteration)
*
- * Return: Success: Pointer to iteration status object
- * Failure: NULL
+ * Return: Success: Pointer to iteration status object
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 4, 2008
*
*-------------------------------------------------------------------------
@@ -1504,16 +1504,16 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam,
return(eiter);
} /* end eiter_rv_init() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_rv_next
+ * Function: eiter_rv_next
*
- * Purpose: Get next element index (reverse iteration)
+ * Purpose: Get next element index (reverse iteration)
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 4, 2008
*
*-------------------------------------------------------------------------
@@ -1533,16 +1533,16 @@ eiter_rv_next(void *_eiter)
return(ret_val);
} /* end eiter_rv_next() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_rv_max
+ * Function: eiter_rv_max
*
- * Purpose: Get max. element index (reverse iteration)
+ * Purpose: Get max. element index (reverse iteration)
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 4, 2008
*
*-------------------------------------------------------------------------
@@ -1559,16 +1559,16 @@ eiter_rv_max(const void *_eiter)
return((hssize_t)eiter->max);
} /* end eiter_rv_max() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_rv_state
+ * Function: eiter_rv_state
*
- * Purpose: Get extensible array state (reverse iteration)
+ * Purpose: Get extensible array state (reverse iteration)
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 4, 2008
*
*-------------------------------------------------------------------------
@@ -1657,16 +1657,16 @@ HDfprintf(stderr, "eiter->idx_blk_nsblks = %Hu, state->nsuper_blks = %Hu\n", eit
return(0);
} /* end eiter_rv_state() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_rv_term
+ * Function: eiter_rv_term
*
- * Purpose: Shut down element interator (reverse iteration)
+ * Purpose: Shut down element interator (reverse iteration)
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 4, 2008
*
*-------------------------------------------------------------------------
@@ -1699,16 +1699,16 @@ typedef struct eiter_rnd_t {
hsize_t *idx; /* Array of shuffled indices */
} eiter_rnd_t;
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_rnd_init
+ * Function: eiter_rnd_init
*
- * Purpose: Initialize element interator (random iteration)
+ * Purpose: Initialize element interator (random iteration)
*
- * Return: Success: Pointer to iteration status object
- * Failure: NULL
+ * Return: Success: Pointer to iteration status object
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 6, 2008
*
*-------------------------------------------------------------------------
@@ -1751,16 +1751,16 @@ eiter_rnd_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par
return(eiter);
} /* end eiter_rnd_init() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_rnd_next
+ * Function: eiter_rnd_next
*
- * Purpose: Get next element index (random iteration)
+ * Purpose: Get next element index (random iteration)
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 6, 2008
*
*-------------------------------------------------------------------------
@@ -1785,16 +1785,16 @@ eiter_rnd_next(void *_eiter)
return(ret_val);
} /* end eiter_rnd_next() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_rnd_max
+ * Function: eiter_rnd_max
*
- * Purpose: Get max. element index (random iteration)
+ * Purpose: Get max. element index (random iteration)
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 6, 2008
*
*-------------------------------------------------------------------------
@@ -1811,16 +1811,16 @@ eiter_rnd_max(const void *_eiter)
return((hssize_t)eiter->max);
} /* end eiter_rnd_max() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_rnd_term
+ * Function: eiter_rnd_term
*
- * Purpose: Shut down element interator (random iteration)
+ * Purpose: Shut down element interator (random iteration)
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 6, 2008
*
*-------------------------------------------------------------------------
@@ -1852,16 +1852,16 @@ static const earray_iter_t ea_iter_rnd = {
eiter_rnd_term /* Iterator term */
};
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_rnd2_init
+ * Function: eiter_rnd2_init
*
- * Purpose: Initialize element interator (random #2 iteration)
+ * Purpose: Initialize element interator (random #2 iteration)
*
- * Return: Success: Pointer to iteration status object
- * Failure: NULL
+ * Return: Success: Pointer to iteration status object
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 11, 2008
*
*-------------------------------------------------------------------------
@@ -1936,16 +1936,16 @@ typedef struct eiter_cyc_t {
hsize_t cyc; /* Cycle of elements to choose from */
} eiter_cyc_t;
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_cyc_init
+ * Function: eiter_cyc_init
*
- * Purpose: Initialize element interator (cyclic iteration)
+ * Purpose: Initialize element interator (cyclic iteration)
*
- * Return: Success: Pointer to iteration status object
- * Failure: NULL
+ * Return: Success: Pointer to iteration status object
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 11, 2008
*
*-------------------------------------------------------------------------
@@ -1970,16 +1970,16 @@ eiter_cyc_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par
return(eiter);
} /* end eiter_cyc_init() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_cyc_next
+ * Function: eiter_cyc_next
*
- * Purpose: Get next element index (cyclic iteration)
+ * Purpose: Get next element index (cyclic iteration)
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 11, 2008
*
*-------------------------------------------------------------------------
@@ -2006,16 +2006,16 @@ eiter_cyc_next(void *_eiter)
return(ret_val);
} /* end eiter_cyc_next() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_cyc_max
+ * Function: eiter_cyc_max
*
- * Purpose: Get max. element index (cyclic iteration)
+ * Purpose: Get max. element index (cyclic iteration)
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 11, 2008
*
*-------------------------------------------------------------------------
@@ -2032,16 +2032,16 @@ eiter_cyc_max(const void *_eiter)
return((hssize_t)eiter->max);
} /* end eiter_cyc_max() */
-
+
/*-------------------------------------------------------------------------
- * Function: eiter_cyc_term
+ * Function: eiter_cyc_term
*
- * Purpose: Shut down element interator (cyclic iteration)
+ * Purpose: Shut down element interator (cyclic iteration)
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 11, 2008
*
*-------------------------------------------------------------------------
@@ -2069,16 +2069,16 @@ static const earray_iter_t ea_iter_cyc = {
eiter_cyc_term /* Iterator term */
};
-
+
/*-------------------------------------------------------------------------
- * Function: test_set_elmts
+ * Function: test_set_elmts
*
- * Purpose: Set all elements from 0 through 'nelmts' in extensible array
+ * Purpose: Set all elements from 0 through 'nelmts' in extensible array
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, September 22, 2008
*
*-------------------------------------------------------------------------
@@ -2087,8 +2087,8 @@ static unsigned
test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
hsize_t nelmts, const char *test_str)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5EA_t *ea = NULL; /* Extensible array wrapper */
void *eiter_info; /* Extensible array iterator info */
earray_state_t state; /* State of extensible array */
@@ -2241,22 +2241,22 @@ error:
H5E_BEGIN_TRY {
if(ea)
H5EA_close(ea);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_set_elmts() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_skip_elmts
+ * Function: test_skip_elmts
*
- * Purpose: Skip some elements when writing element
+ * Purpose: Skip some elements when writing element
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 11, 2008
*
*-------------------------------------------------------------------------
@@ -2265,8 +2265,8 @@ static unsigned
test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
hsize_t skip_elmts, const char *test_str)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5EA_t *ea = NULL; /* Extensible array wrapper */
earray_state_t state; /* State of extensible array */
uint64_t welmt; /* Element to write */
@@ -2398,22 +2398,22 @@ error:
H5E_BEGIN_TRY {
if(ea)
H5EA_close(ea);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_skip_elmts() */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test the extensible array code
+ * Purpose: Test the extensible array code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, June 17, 2008
*
*-------------------------------------------------------------------------
@@ -2425,10 +2425,10 @@ main(void)
earray_test_param_t tparam; /* Testing parameters */
earray_test_type_t curr_test; /* Current test being worked on */
earray_iter_type_t curr_iter; /* Current iteration type being worked on */
- hid_t fapl = -1; /* File access property list for data files */
- unsigned nerrors = 0; /* Cumulative error count */
+ hid_t fapl = -1; /* File access property list for data files */
+ unsigned nerrors = 0; /* Cumulative error count */
time_t curr_time; /* Current time, for seeding random number generator */
- int ExpressMode; /* Test express value */
+ int ExpressMode; /* Test express value */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Reset library */
@@ -2436,7 +2436,7 @@ main(void)
fapl = h5_fileaccess();
ExpressMode = GetTestExpress();
if(ExpressMode > 1)
- printf("***Express test mode on. Some tests may be skipped\n");
+ HDprintf("***Express test mode on. Some tests may be skipped\n");
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g));
@@ -2451,7 +2451,7 @@ main(void)
/* Create an empty file to retrieve size */
{
- hid_t file; /* File ID */
+ hid_t file; /* File ID */
if((file = H5Fcreate(filename_g, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
@@ -2559,14 +2559,14 @@ main(void)
nelmts = (hsize_t)((hsize_t)1 + cparam.idx_blk_elmts +
tparam.sblk_info[sblk].start_idx +
(tparam.sblk_info[sblk].dblk_nelmts * dblk));
- sprintf(test_str, "setting first element of array's data block #%llu", (unsigned long long)ndblks);
+ HDsprintf(test_str, "setting first element of array's data block #%llu", (unsigned long long)ndblks);
nerrors += test_set_elmts(fapl, &cparam, &tparam, nelmts, test_str);
/* Test all elements in data block */
nelmts = (hsize_t)(cparam.idx_blk_elmts +
tparam.sblk_info[sblk].start_idx +
(tparam.sblk_info[sblk].dblk_nelmts * (dblk + 1)));
- sprintf(test_str, "setting all elements of array's data block #%llu", (unsigned long long)ndblks);
+ HDsprintf(test_str, "setting all elements of array's data block #%llu", (unsigned long long)ndblks);
nerrors += test_set_elmts(fapl, &cparam, &tparam, nelmts, test_str);
/* Increment data block being tested */
diff --git a/test/efc.c b/test/efc.c
index 5a946bb..d63ef34 100644
--- a/test/efc.c
+++ b/test/efc.c
@@ -2885,8 +2885,7 @@ error:
*
* Purpose: Test the external file cache code
*
- * Return: Success: SUCCEED
- * Failure: FAIL
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Neil Fortner
* December 16, 2010
@@ -2900,7 +2899,7 @@ main(void)
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Test Setup */
- puts("Testing the external file cache");
+ HDputs("Testing the external file cache");
/* Create property lists */
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
@@ -2937,14 +2936,14 @@ main(void)
if(nerrors)
goto error;
- puts("All external file cache tests passed.");
+ HDputs("All external file cache tests passed.");
h5_clean_files(FILENAME, fapl_id);
- return 0;
+ return EXIT_SUCCESS;
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
H5Pclose(fapl_id);
@@ -2952,6 +2951,6 @@ error:
if(api_ctx_pushed) H5CX_pop();
- return 1;
+ return EXIT_FAILURE;
} /* end main() */
diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c
index cee38f3..f46a76d 100644
--- a/test/enc_dec_plist.c
+++ b/test/enc_dec_plist.c
@@ -15,14 +15,14 @@
* Serial tests for encoding/decoding plists
*/
-#include "h5test.h"
+#include "testhdf5.h"
#include "H5ACprivate.h"
#include "H5Pprivate.h"
static int
test_encode_decode(hid_t orig_pl)
{
- hid_t pl = (-1); /* Decoded property list */
+ hid_t pl = (-1); /* Decoded property list */
void *temp_buf = NULL; /* Pointer to encoding buffer */
size_t temp_size = 0; /* Size of encoding buffer */
@@ -51,33 +51,35 @@ test_encode_decode(hid_t orig_pl)
return(0);
error:
- if(pl > 0)
- H5Pclose(pl);
if(temp_buf)
HDfree(temp_buf);
+ H5E_BEGIN_TRY {
+ H5Pclose(pl);
+ } H5E_END_TRY;
+
return(-1);
} /* end test_encode_decode() */
int
main(void)
{
- hid_t dcpl; /* dataset create prop. list */
- hid_t dapl; /* dataset access prop. list */
- hid_t dxpl; /* dataset xfer prop. list */
- hid_t gcpl; /* group create prop. list */
- hid_t ocpypl; /* object copy prop. list */
- hid_t ocpl; /* object create prop. list */
- hid_t lcpl; /* link create prop. list */
- hid_t lapl; /* link access prop. list */
- hid_t fapl; /* file access prop. list */
- hid_t fcpl; /* file create prop. list */
- hid_t strcpl; /* string create prop. list */
- hid_t acpl; /* attribute create prop. list */
-
- hsize_t chunk_size[2] = {16384, 4}; /* chunk size */
- double fill = 2.7f; /* Fill value */
- hsize_t max_size[1]; /* data space maximum size */
+ hid_t dcpl; /* dataset create prop. list */
+ hid_t dapl; /* dataset access prop. list */
+ hid_t dxpl; /* dataset xfer prop. list */
+ hid_t gcpl; /* group create prop. list */
+ hid_t ocpypl; /* object copy prop. list */
+ hid_t ocpl; /* object create prop. list */
+ hid_t lcpl; /* link create prop. list */
+ hid_t lapl; /* link access prop. list */
+ hid_t fapl; /* file access prop. list */
+ hid_t fcpl; /* file create prop. list */
+ hid_t strcpl; /* string create prop. list */
+ hid_t acpl; /* attribute create prop. list */
+
+ hsize_t chunk_size[2] = {16384, 4}; /* chunk size */
+ double fill = 2.7f; /* Fill value */
+ hsize_t max_size[1]; /* data space maximum size */
size_t nslots = 521 * 2;
size_t nbytes = 1048576 * 10;
double w0 = 0.5f;
@@ -115,14 +117,15 @@ main(void)
0.2f,
(256 * 2048),
H5AC__DEFAULT_METADATA_WRITE_STRATEGY};
+
H5AC_cache_image_config_t my_cache_image_config = {
- H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION,
- TRUE,
+ H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION,
+ TRUE,
FALSE,
- -1};
+ -1 };
if(VERBOSE_MED)
- printf("Encode/Decode DCPLs\n");
+ HDprintf("Encode/Decode DCPLs\n");
/******* ENCODE/DECODE DCPLS *****/
TESTING("Default DCPL Encoding/Decoding");
@@ -150,23 +153,23 @@ main(void)
FAIL_STACK_ERROR
max_size[0] = 100;
- if((H5Pset_external(dcpl, "ext1.data", (off_t)0,
+ if((H5Pset_external(dcpl, "ext1.data", (off_t)0,
(hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
FAIL_STACK_ERROR
- if((H5Pset_external(dcpl, "ext2.data", (off_t)0,
+ if((H5Pset_external(dcpl, "ext2.data", (off_t)0,
(hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
FAIL_STACK_ERROR
- if((H5Pset_external(dcpl, "ext3.data", (off_t)0,
+ if((H5Pset_external(dcpl, "ext3.data", (off_t)0,
(hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
FAIL_STACK_ERROR
- if((H5Pset_external(dcpl, "ext4.data", (off_t)0,
+ if((H5Pset_external(dcpl, "ext4.data", (off_t)0,
(hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
FAIL_STACK_ERROR
/* Test encoding & decoding property list */
if(test_encode_decode(dcpl) < 0)
FAIL_PUTS_ERROR("DCPL encoding/decoding failed\n")
-
+
/* release resource */
if((H5Pclose(dcpl)) < 0)
FAIL_STACK_ERROR
@@ -193,7 +196,7 @@ main(void)
/* Test encoding & decoding property list */
if(test_encode_decode(dapl) < 0)
FAIL_PUTS_ERROR("DAPL encoding/decoding failed\n")
-
+
/* release resource */
if((H5Pclose(dapl)) < 0)
FAIL_STACK_ERROR
@@ -226,7 +229,7 @@ main(void)
/* Test encoding & decoding property list */
if(test_encode_decode(ocpl) < 0)
FAIL_PUTS_ERROR("OCPL encoding/decoding failed\n")
-
+
/* release resource */
if((H5Pclose(ocpl)) < 0)
FAIL_STACK_ERROR
@@ -271,7 +274,7 @@ main(void)
/* Test encoding & decoding property list */
if(test_encode_decode(dxpl) < 0)
FAIL_PUTS_ERROR("DXPL encoding/decoding failed\n")
-
+
/* release resource */
if((H5Pclose(dxpl)) < 0)
FAIL_STACK_ERROR
@@ -311,7 +314,7 @@ main(void)
/* Test encoding & decoding property list */
if(test_encode_decode(gcpl) < 0)
FAIL_PUTS_ERROR("GCPL encoding/decoding failed\n")
-
+
/* release resource */
if((H5Pclose(gcpl)) < 0)
FAIL_STACK_ERROR
@@ -338,7 +341,7 @@ main(void)
/* Test encoding & decoding property list */
if(test_encode_decode(lcpl) < 0)
FAIL_PUTS_ERROR("LCPL encoding/decoding failed\n")
-
+
/* release resource */
if((H5Pclose(lcpl)) < 0)
FAIL_STACK_ERROR
@@ -384,7 +387,7 @@ main(void)
/* Test encoding & decoding property list */
if(test_encode_decode(lapl) < 0)
FAIL_PUTS_ERROR("LAPL encoding/decoding failed\n")
-
+
/* release resource */
if((H5Pclose(lapl)) < 0)
FAIL_STACK_ERROR
@@ -416,7 +419,7 @@ main(void)
/* Test encoding & decoding property list */
if(test_encode_decode(ocpypl) < 0)
FAIL_PUTS_ERROR("OCPYPL encoding/decoding failed\n")
-
+
/* release resource */
if((H5Pclose(ocpypl)) < 0)
FAIL_STACK_ERROR
@@ -469,7 +472,7 @@ main(void)
/* Test encoding & decoding property list */
if(test_encode_decode(fapl) < 0)
FAIL_PUTS_ERROR("FAPL encoding/decoding failed\n")
-
+
/* release resource */
if((H5Pclose(fapl)) < 0)
FAIL_STACK_ERROR
@@ -515,7 +518,7 @@ main(void)
/* Test encoding & decoding property list */
if(test_encode_decode(fcpl) < 0)
FAIL_PUTS_ERROR("FCPL encoding/decoding failed\n")
-
+
/* release resource */
if((H5Pclose(fcpl)) < 0)
FAIL_STACK_ERROR
@@ -543,7 +546,7 @@ main(void)
/* Test encoding & decoding property list */
if(test_encode_decode(strcpl) < 0)
FAIL_PUTS_ERROR("STRCPL encoding/decoding failed\n")
-
+
/* release resource */
if((H5Pclose(strcpl)) < 0)
FAIL_STACK_ERROR
@@ -571,7 +574,7 @@ main(void)
/* Test encoding & decoding property list */
if(test_encode_decode(acpl) < 0)
FAIL_PUTS_ERROR("ACPL encoding/decoding failed\n")
-
+
/* release resource */
if((H5Pclose(acpl)) < 0)
FAIL_STACK_ERROR
@@ -582,7 +585,7 @@ main(void)
return 0;
error:
- printf("***** Plist Encode/Decode tests FAILED! *****\n");
+ HDprintf("***** Plist Encode/Decode tests FAILED! *****\n");
return 1;
}
diff --git a/test/enc_dec_plist_cross_platform.c b/test/enc_dec_plist_cross_platform.c
index 1fbb41b..15c7391 100644
--- a/test/enc_dec_plist_cross_platform.c
+++ b/test/enc_dec_plist_cross_platform.c
@@ -28,7 +28,7 @@ int
main(void)
{
if(VERBOSE_MED)
- printf("Encode/Decode property list endianess\n");
+ HDprintf("Encode/Decode property list endianess\n");
/******* ENCODE/DECODE DCPLS *****/
TESTING("Default DCPL Encoding/Decoding");
@@ -227,7 +227,7 @@ test_plists(const char *filename_prefix)
return 1;
error:
- printf("***** Plist Encode/Decode tests FAILED! *****\n");
+ HDprintf("***** Plist Encode/Decode tests FAILED! *****\n");
return -1;
}
diff --git a/test/enum.c b/test/enum.c
index 588e9b3..26e64fd 100644
--- a/test/enum.c
+++ b/test/enum.c
@@ -166,7 +166,7 @@ test_conv(hid_t file)
for(i = 0; i < (size_t)ds_size[0]; i++)
if(data1[i] != data2[i]) {
H5_FAILED();
- printf(" 1. data1[%lu]=%d, data2[%lu]=%d (should be same)\n",
+ HDprintf(" 1. data1[%lu]=%d, data2[%lu]=%d (should be same)\n",
(unsigned long)i, (int)(data1[i]),
(unsigned long)i, (int)(data2[i]));
goto error;
@@ -178,7 +178,7 @@ test_conv(hid_t file)
for(i = 0; i < (size_t)ds_size[0]; i++)
if((short)data1[i] != data_short[i]) {
H5_FAILED();
- printf(" 2. data1[%lu]=%d, data_short[%lu]=%d (should be same)\n",
+ HDprintf(" 2. data1[%lu]=%d, data_short[%lu]=%d (should be same)\n",
(unsigned long)i, (int)(data1[i]),
(unsigned long)i, (int)(data_short[i]));
goto error;
@@ -190,7 +190,7 @@ test_conv(hid_t file)
for(i = 0; i < (size_t)ds_size[0]; i++)
if((int)data1[i] != (int)data_double[i]) {
H5_FAILED();
- printf(" 3. data1[%lu]=%d, data_double[%lu]=%d (should be same)\n",
+ HDprintf(" 3. data1[%lu]=%d, data_double[%lu]=%d (should be same)\n",
(unsigned long)i, (int)(data1[i]),
(unsigned long)i, (int)(data_double[i]));
goto error;
@@ -212,7 +212,7 @@ test_conv(hid_t file)
for(i = 0; i < (size_t)ds_size[0]; i++)
if((int)data1[i] != data_int[i]) {
H5_FAILED();
- printf(" 4. data1[%lu]=%d, data_int[%lu]=%d (should be same)\n",
+ HDprintf(" 4. data1[%lu]=%d, data_int[%lu]=%d (should be same)\n",
(unsigned long)i, (int)(data1[i]),
(unsigned long)i, (int)(data_int[i]));
goto error;
@@ -234,7 +234,7 @@ test_conv(hid_t file)
for(i = 0; i < (size_t)ds_size[0]; i++)
if((int)data1[i] != (int)data_double[i]) {
H5_FAILED();
- printf(" 5. data1[%lu]=%d, data_double[%lu]=%d (should be same)\n",
+ HDprintf(" 5. data1[%lu]=%d, data_double[%lu]=%d (should be same)\n",
(unsigned long)i, (int)(data1[i]),
(unsigned long)i, (int)(data_double[i]));
goto error;
@@ -318,7 +318,7 @@ test_tr1(hid_t file)
for(i = 0; i < (size_t)ds_size[0]; i++)
if(data1[i] != data2[i]) {
H5_FAILED();
- printf(" data1[%lu]=%d, data2[%lu]=%d (should be same)\n",
+ HDprintf(" data1[%lu]=%d, data2[%lu]=%d (should be same)\n",
(unsigned long)i, (int)(data1[i]),
(unsigned long)i, (int)(data2[i]));
goto error;
@@ -400,7 +400,7 @@ test_tr2(hid_t file)
for(i = 0; i < (size_t)ds_size[0]; i++)
if(data1[i] != data2[i]) {
H5_FAILED();
- printf(" data1[%lu]=%d, data2[%lu]=%d (should be same)\n",
+ HDprintf(" data1[%lu]=%d, data2[%lu]=%d (should be same)\n",
(unsigned long)i, (int)(data1[i]),
(unsigned long)i, (int)(data2[i]));
goto error;
@@ -559,7 +559,7 @@ test_funcs(void)
} H5E_END_TRY;
if (ret>=0) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
@@ -568,7 +568,7 @@ test_funcs(void)
} H5E_END_TRY;
if (size>0) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
@@ -577,7 +577,7 @@ test_funcs(void)
} H5E_END_TRY;
if (inpad>-1) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
@@ -586,7 +586,7 @@ test_funcs(void)
} H5E_END_TRY;
if (cset>-1) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
@@ -596,7 +596,7 @@ test_funcs(void)
} H5E_END_TRY;
if (ret>=0) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
@@ -605,7 +605,7 @@ test_funcs(void)
} H5E_END_TRY;
if (ret>=0) {
H5_FAILED();
- printf("Operation not allowed for this type.\n");
+ HDprintf("Operation not allowed for this type.\n");
goto error;
} /* end if */
diff --git a/test/err_compat.c b/test/err_compat.c
index eee150b..d2d039a 100644
--- a/test/err_compat.c
+++ b/test/err_compat.c
@@ -12,17 +12,17 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* October 14, 2001
*
- * Purpose: Tests Error API
+ * Purpose: Tests Error API
*/
#include "h5test.h"
#ifdef H5_NO_DEPRECATED_SYMBOLS
int main(void)
{
- printf("Test skipped because backward compatability with v1.6 is NOT configured in\n");
+ HDprintf("Test skipped because backward compatibility with v1.6 is NOT configured in\n");
return 0;
}
#else /* H5_NO_DEPRECATED_SYMBOLS */
@@ -35,7 +35,7 @@ const char *FILENAME[] = {
#define DIM0 100
#define DIM1 200
-int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
+int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
#define DSET_NAME "a_dataset"
#define FAKE_ID (hid_t)-1
@@ -43,17 +43,17 @@ int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
herr_t custom_print_cb1(int n, H5E_error1_t *err_desc, void* client_data);
herr_t custom_print_cb2(int n, H5E_error2_t *err_desc, void* client_data);
-
+
/*-------------------------------------------------------------------------
- * Function: user_print1
+ * Function: user_print1
*
- * Purpose: This function is a user-defined old-style printing function.
- * This is just a convenience function for H5Ewalk1() with a
+ * Purpose: This function is a user-defined old-style printing function.
+ * This is just a convenience function for H5Ewalk1() with a
* function that prints error messages.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 October 2010
*
*-------------------------------------------------------------------------
@@ -62,7 +62,7 @@ static herr_t
user_print1(FILE *stream)
{
/* Customized way to print errors */
- fprintf(stderr, "\n********* Print error stack in customized way *********\n");
+ HDfprintf(stderr, "\n********* Print error stack in customized way *********\n");
if(H5Ewalk1(H5E_WALK_UPWARD, (H5E_walk1_t)custom_print_cb1, stream) < 0)
TEST_ERROR;
@@ -73,17 +73,17 @@ user_print1(FILE *stream)
}
-
+
/*-------------------------------------------------------------------------
- * Function: user_print2
+ * Function: user_print2
*
- * Purpose: This function is a user-defined new-style printing function.
- * This is just a convenience function for H5Ewalk2() with a
+ * Purpose: This function is a user-defined new-style printing function.
+ * This is just a convenience function for H5Ewalk2() with a
* function that prints error messages.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 October 2010
*
*-------------------------------------------------------------------------
@@ -92,7 +92,7 @@ static herr_t
user_print2(hid_t err_stack, FILE *stream)
{
/* Customized way to print errors */
- fprintf(stderr, "\n********* Print error stack in customized way *********\n");
+ HDfprintf(stderr, "\n********* Print error stack in customized way *********\n");
if(H5Ewalk2(err_stack, H5E_WALK_UPWARD, (H5E_walk2_t)custom_print_cb2, stream) < 0)
TEST_ERROR;
@@ -103,18 +103,18 @@ user_print2(hid_t err_stack, FILE *stream)
}
-
+
/*-------------------------------------------------------------------------
* Function: custom_print_cb1
*
- * Purpose: Callback function to print error stack in customized way
+ * Purpose: Callback function to print error stack in customized way
* for H5Ewalk1.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 October 2010
*
* Modifications:
@@ -124,10 +124,10 @@ user_print2(hid_t err_stack, FILE *stream)
herr_t
custom_print_cb1(int n, H5E_error1_t *err_desc, void* client_data)
{
- FILE *stream = (FILE *)client_data;
+ FILE *stream = (FILE *)client_data;
char *maj = NULL;
char *min = NULL;
- const int indent = 4;
+ const int indent = 4;
if(NULL == (min = H5Eget_minor(err_desc->min_num)))
TEST_ERROR;
@@ -135,12 +135,12 @@ custom_print_cb1(int n, H5E_error1_t *err_desc, void* client_data)
if(NULL == (maj = H5Eget_major(err_desc->maj_num)))
TEST_ERROR;
- fprintf(stream, "%*serror #%03d: %s in %s(): line %u\n",
- indent, "", n, err_desc->file_name,
- err_desc->func_name, err_desc->line);
-
- fprintf(stream, "%*smajor: %s\n", indent * 2, "", maj);
- fprintf(stream, "%*sminor: %s\n", indent * 2, "", min);
+ HDfprintf(stream, "%*serror #%03d: %s in %s(): line %u\n",
+ indent, "", n, err_desc->file_name,
+ err_desc->func_name, err_desc->line);
+
+ HDfprintf(stream, "%*smajor: %s\n", indent * 2, "", maj);
+ HDfprintf(stream, "%*sminor: %s\n", indent * 2, "", min);
H5free_memory(maj);
H5free_memory(min);
@@ -152,22 +152,22 @@ error:
H5free_memory(maj);
if(min)
H5free_memory(min);
-
+
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: custom_print_cb2
*
- * Purpose: Callback function to print error stack in customized way
+ * Purpose: Callback function to print error stack in customized way
* for H5Ewalk1.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 October 2010
*
* Modifications:
@@ -177,10 +177,10 @@ error:
herr_t
custom_print_cb2(int n, H5E_error2_t *err_desc, void* client_data)
{
- FILE *stream = (FILE *)client_data;
+ FILE *stream = (FILE *)client_data;
char *maj = NULL;
char *min = NULL;
- const int indent = 4;
+ const int indent = 4;
if(NULL == (min = H5Eget_minor(err_desc->min_num)))
TEST_ERROR;
@@ -188,12 +188,12 @@ custom_print_cb2(int n, H5E_error2_t *err_desc, void* client_data)
if(NULL == (maj = H5Eget_major(err_desc->maj_num)))
TEST_ERROR;
- fprintf(stream, "%*serror #%03d: %s in %s(): line %u\n",
- indent, "", n, err_desc->file_name,
- err_desc->func_name, err_desc->line);
-
- fprintf(stream, "%*smajor: %s\n", indent * 2, "", maj);
- fprintf(stream, "%*sminor: %s\n", indent * 2, "", min);
+ HDfprintf(stream, "%*serror #%03d: %s in %s(): line %u\n",
+ indent, "", n, err_desc->file_name,
+ err_desc->func_name, err_desc->line);
+
+ HDfprintf(stream, "%*smajor: %s\n", indent * 2, "", maj);
+ HDfprintf(stream, "%*sminor: %s\n", indent * 2, "", min);
H5free_memory(maj);
H5free_memory(min);
@@ -205,22 +205,22 @@ error:
H5free_memory(maj);
if(min)
H5free_memory(min);
-
+
return -1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_error1
+ * Function: test_error1
*
- * Purpose: Test the backward compatibility of H5Eset/get_auto.
+ * Purpose: Test the backward compatibility of H5Eset/get_auto.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * 17 September 2010
+ * Programmer: Raymond Lu
+ * 17 September 2010
*
*
* Modifications:
@@ -230,63 +230,63 @@ error:
static herr_t
test_error1(void)
{
- hid_t dataset, space;
- hsize_t dims[2];
+ hid_t dataset, space;
+ hsize_t dims[2];
H5E_auto1_t old_func1;
H5E_auto2_t old_func2;
void *old_data;
herr_t ret;
TESTING("error API H5Eset/get_auto");
- fprintf(stderr, "\n");
+ HDfprintf(stderr, "\n");
/* Create the data space */
dims[0] = DIM0;
dims[1] = DIM1;
if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR;
- /* Use H5Eget_auto2 to query the default printing function. The library
+ /* Use H5Eget_auto2 to query the default printing function. The library
*should indicate H5Eprint2 as the default. */
if (H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data)<0)
- TEST_ERROR;
+ TEST_ERROR;
if (old_data != NULL)
- TEST_ERROR;
+ TEST_ERROR;
if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2)
- TEST_ERROR;
+ TEST_ERROR;
/* This function sets the default printing function to be H5Eprint2. */
if(H5Eset_auto2(H5E_DEFAULT, old_func2, old_data)<0)
TEST_ERROR;
- /* Try the printing function. Dataset creation should fail because the file
+ /* Try the printing function. Dataset creation should fail because the file
* doesn't exist. */
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
+ dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
- if(dataset >= 0)
+ if(dataset >= 0)
TEST_ERROR;
/* This call should work. It simply returns H5Eprint1. */
if((ret = H5Eget_auto1(&old_func1, &old_data))<0)
TEST_ERROR;
if (old_data != NULL)
- TEST_ERROR;
+ TEST_ERROR;
if (!old_func1 || (H5E_auto1_t)H5Eprint1 != old_func1)
- TEST_ERROR;
+ TEST_ERROR;
/* This function changes the old-style printing function to be user_print1. */
if(H5Eset_auto1((H5E_auto1_t)user_print1, stderr)<0)
TEST_ERROR;
- /* Try the printing function. Dataset creation should fail because the file
+ /* Try the printing function. Dataset creation should fail because the file
* doesn't exist. */
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
+ dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
- if(dataset >= 0)
+ if(dataset >= 0)
TEST_ERROR;
- /* This call should fail because the test mixes H5Eget_auto2 with H5Eset_auto1.
- * Once the H5Eset_auto1 is called with a user-defined printing function,
- * a call to H5Eget_auto2 will fail. But keep in mind the printing function is
+ /* This call should fail because the test mixes H5Eget_auto2 with H5Eset_auto1.
+ * Once the H5Eset_auto1 is called with a user-defined printing function,
+ * a call to H5Eget_auto2 will fail. But keep in mind the printing function is
* user_print1. */
if((ret = H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data))>=0)
TEST_ERROR;
@@ -295,44 +295,44 @@ test_error1(void)
if(H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)user_print2, stderr)<0)
TEST_ERROR;
- /* Try the printing function. Dataset creation should fail because the file
+ /* Try the printing function. Dataset creation should fail because the file
* doesn't exist. */
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
+ dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
- if(dataset >= 0)
+ if(dataset >= 0)
TEST_ERROR;
/* This function changes the new-style printing function back to the default H5Eprint2. */
if(H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)H5Eprint2, NULL)<0)
TEST_ERROR;
- /* This call should work because the H5Eset_auto2 above restored the default printing
+ /* This call should work because the H5Eset_auto2 above restored the default printing
* function H5Eprint2. It simply returns user_print1. */
if((ret = H5Eget_auto1(&old_func1, &old_data))<0)
TEST_ERROR;
if (old_data != NULL)
- TEST_ERROR;
+ TEST_ERROR;
if (!old_func1 || (H5E_auto1_t)user_print1 != old_func1)
- TEST_ERROR;
+ TEST_ERROR;
/* This function changes the new-style printing function back to the default H5Eprint1. */
if(H5Eset_auto1((H5E_auto1_t)H5Eprint1, NULL)<0)
TEST_ERROR;
- /* This call should work because the H5Eset_auto1 above restored the default printing
+ /* This call should work because the H5Eset_auto1 above restored the default printing
* function H5Eprint1. It simply returns H5Eprint2. */
if((ret = H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data))<0)
TEST_ERROR;
if (old_data != NULL)
- TEST_ERROR;
+ TEST_ERROR;
if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2)
- TEST_ERROR;
+ TEST_ERROR;
- /* Try the printing function. Dataset creation should fail because the file
+ /* Try the printing function. Dataset creation should fail because the file
* doesn't exist. */
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
+ dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
- if(dataset >= 0)
+ if(dataset >= 0)
TEST_ERROR;
return 0;
@@ -341,18 +341,18 @@ test_error1(void)
return -1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_error2
+ * Function: test_error2
*
- * Purpose: Test error API functions, mainly on H5Epush1.
+ * Purpose: Test error API functions, mainly on H5Epush1.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * July 10, 2003
+ * Programmer: Raymond Lu
+ * July 10, 2003
*
*
* Modifications:
@@ -362,12 +362,12 @@ test_error1(void)
static herr_t
test_error2(hid_t file)
{
- hid_t dataset, space;
- hsize_t dims[2];
+ hid_t dataset, space;
+ hsize_t dims[2];
const char *FUNC_test_error="test_error2";
TESTING("error API based on data I/O");
- fprintf(stderr, "\n");
+ HDfprintf(stderr, "\n");
/* Create the data space */
dims[0] = DIM0;
@@ -381,7 +381,7 @@ test_error2(hid_t file)
/* Create the dataset */
if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5Epush1(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_CANTCREATE,
"H5Dcreate2 failed");
goto error;
@@ -411,18 +411,18 @@ test_error2(hid_t file)
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: dump_error
*
- * Purpose: Prints error stack in default and customized ways.
+ * Purpose: Prints error stack in default and customized ways.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * July 17, 2003
+ * Programmer: Raymond Lu
+ * July 17, 2003
*
*
* Modifications:
@@ -433,12 +433,12 @@ static herr_t
dump_error(void)
{
/* Print errors in library default way */
- fprintf(stderr, "********* Print error stack in HDF5 default way *********\n");
+ HDfprintf(stderr, "********* Print error stack in HDF5 default way *********\n");
if(H5Eprint1(stderr) < 0)
TEST_ERROR;
/* Customized way to print errors */
- fprintf(stderr, "\n********* Print error stack in customized way *********\n");
+ HDfprintf(stderr, "\n********* Print error stack in customized way *********\n");
if(H5Ewalk1(H5E_WALK_UPWARD, custom_print_cb1, stderr) < 0)
TEST_ERROR;
@@ -449,14 +449,14 @@ dump_error(void)
}
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test error API.
+ * Purpose: Test error API.
*
- * Programmer: Raymond Lu
- * July 10, 2003
+ * Programmer: Raymond Lu
+ * July 10, 2003
*
* Modifications:
*
@@ -465,16 +465,16 @@ dump_error(void)
int
main(void)
{
- hid_t file, fapl;
- char filename[1024];
+ hid_t file, fapl;
+ char filename[1024];
const char *FUNC_main="main";
- fprintf(stderr, " This program tests the Error API compatible with HDF5 v1.6. There're supposed to be some error messages\n");
+ HDfprintf(stderr, " This program tests the Error API compatible with HDF5 v1.6. There are supposed to be some error messages\n");
fapl = h5_fileaccess();
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR ;
+ TEST_ERROR ;
/* Test error stack */
@@ -500,11 +500,11 @@ main(void)
if(H5Fclose(file) < 0) TEST_ERROR ;
h5_clean_files(FILENAME, fapl);
- printf("All error API tests passed.\n");
+ HDprintf("All error API tests passed.\n");
return 0;
- error:
- printf("***** ERROR TEST FAILED! *****\n");
+error:
+ HDprintf("***** ERROR TEST FAILED! *****\n");
return 1;
}
#endif /* H5_NO_DEPRECATED_SYMBOLS */
diff --git a/test/error_test.c b/test/error_test.c
index 5356fa7..1de9065 100644
--- a/test/error_test.c
+++ b/test/error_test.c
@@ -12,10 +12,10 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* October 14, 2001
*
- * Purpose: Tests the error API routines.
+ * Purpose: Tests the error API routines.
*/
#include "h5test.h"
#include "H5srcdir.h"
@@ -23,7 +23,7 @@
#ifdef H5_USE_16_API
int main(void)
{
- HDfprintf(stderr, "Test skipped because backward compatbility with v1.6 is configured in\n");
+ HDfprintf(stderr, "Test skipped because backward compatibility with v1.6 is configured in\n");
return 0;
}
#else /* H5_USE_16_API */
@@ -38,7 +38,7 @@ const char *FILENAME[] = {
#define DIM0 100
#define DIM1 200
-int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
+int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
hid_t ERR_CLS;
hid_t ERR_CLS2;
@@ -80,7 +80,7 @@ hid_t ERR_MIN_GETNUM;
static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc,
void *client_data);
-
+
/*-------------------------------------------------------------------------
* Function: test_error
*
@@ -94,10 +94,10 @@ static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc,
static herr_t
test_error(hid_t file)
{
- hid_t dataset = -1;
+ hid_t dataset = -1;
hid_t space = -1;
hid_t estack_id = -1;
- hsize_t dims[2];
+ hsize_t dims[2];
const char *FUNC_test_error = "test_error";
H5E_auto2_t old_func;
void *old_data = NULL;
@@ -169,7 +169,7 @@ test_error(hid_t file)
return -1;
} /* end test_error() */
-
+
/*-------------------------------------------------------------------------
* Function: init_error
*
@@ -245,7 +245,7 @@ error:
return -1;
} /* end init_error() */
-
+
/*-------------------------------------------------------------------------
* Function: error_stack
*
@@ -287,7 +287,7 @@ error:
return -1;
} /* end error_stack() */
-
+
/*-------------------------------------------------------------------------
* Function: long_desc_cb
*
@@ -309,7 +309,7 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie
return -1;
} /* end long_desc_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: test_long_desc
*
@@ -320,6 +320,14 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'full_desc' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static herr_t
test_long_desc(void)
{
@@ -374,8 +382,9 @@ error:
return -1;
} /* end test_long_desc() */
+#pragma GCC diagnostic pop
+
-
/*-------------------------------------------------------------------------
* Function: dump_error
*
@@ -405,7 +414,7 @@ error:
return -1;
} /* end dump_error() */
-
+
/*-------------------------------------------------------------------------
* Function: custom_print_cb
*
@@ -436,8 +445,8 @@ custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void* client_data)
TEST_ERROR;
HDfprintf(stream, "%*serror #%03d: %s in %s(): line %u\n",
- indent, "", n, err_desc->file_name,
- err_desc->func_name, err_desc->line);
+ indent, "", n, err_desc->file_name,
+ err_desc->func_name, err_desc->line);
HDfprintf(stream, "%*sclass: %s\n", indent * 2, "", cls);
HDfprintf(stream, "%*smajor: %s\n", indent * 2, "", maj);
HDfprintf(stream, "%*sminor: %s\n", indent * 2, "", min);
@@ -448,7 +457,7 @@ error:
return -1;
} /* end custom_print_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: test_create
*
@@ -531,11 +540,11 @@ test_copy(void)
err_num = H5Eget_num(H5E_DEFAULT);
if (err_num != 1)
TEST_ERROR
-
+
/* Copy error stack, which clears the original */
if ((estack_id = H5Eget_current_stack()) < 0)
TEST_ERROR
-
+
/* Check the number of errors on stack copy */
err_num = H5Eget_num(estack_id);
if (err_num != 1)
@@ -555,7 +564,7 @@ test_copy(void)
if (err_num != 1)
TEST_ERROR
- /* Try to close error stack copy. Should fail because
+ /* Try to close error stack copy. Should fail because
* the current H5Eset_current_stack closes the stack to be set.
*/
H5E_BEGIN_TRY {
@@ -570,7 +579,7 @@ error:
return -1;
} /* end test_copy() */
-
+
/*-------------------------------------------------------------------------
* Function: close_error
*
@@ -606,17 +615,17 @@ error:
return -1;
} /* end close_error() */
-
+
/*-------------------------------------------------------------------------
* Function: test_filter_error
*
* Purpose: Make sure the error message prints out the filter name
- * when the existent file is opened but the filter isn't
- * registered. The existent file was created with
- * gen_filters.c.
+ * when the existent file is opened but the filter isn't
+ * registered. The existent file was created with
+ * gen_filters.c.
*
* Return: Success: 0
- * Failure: -1
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
@@ -654,7 +663,7 @@ error:
return -1;
} /* end test_filter_error() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -736,7 +745,7 @@ main(void)
if (close_error() < 0)
TEST_ERROR;
- /* Test error message during data reading when filter isn't registered
+ /* Test error message during data reading when filter isn't registered
* Use default FAPL to avoid some VFD drivers by the check-vfd test because
* the test file was pre-generated.
*/
diff --git a/test/evict_on_close.c b/test/evict_on_close.c
index 6536837..9d23f2f 100644
--- a/test/evict_on_close.c
+++ b/test/evict_on_close.c
@@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/*
- * Programmer: Dana Robinson
- * Spring 2016
- *
- * Purpose: Tests the basic operation of the evict-on-close cache
+/* Purpose: Tests the basic operation of the evict-on-close cache
* behavior. Tests that ensure the tagging is handled correctly
* are located in cache.c.
*/
@@ -91,9 +87,6 @@ static herr_t check_group_layout(hid_t fid, const char *group_name);
*
* Return: TRUE/FALSE
*
- * Programmer: Dana Robinson
- * Fall 2016
- *
*-------------------------------------------------------------------------
*/
static hbool_t
@@ -114,8 +107,8 @@ verify_tag_not_in_cache(H5F_t *f, haddr_t tag)
return TRUE;
else
entry_ptr = entry_ptr->ht_next;
- } /* end while */
- } /* end for */
+ }
+ }
return FALSE;
} /* end verify_tag_not_in_cache() */
@@ -129,9 +122,6 @@ verify_tag_not_in_cache(H5F_t *f, haddr_t tag)
* Return: Success: The file ID of the created file
* Failure: -1
*
- * Programmer: Dana Robinson
- * Fall 2016
- *
*-------------------------------------------------------------------------
*/
static hid_t
@@ -207,7 +197,7 @@ generate_eoc_test_file(hid_t fapl_id)
TEST_ERROR;
if(H5Gclose(gid2) < 0)
TEST_ERROR;
- } /* end for */
+ }
if(H5Gclose(gid1) < 0)
TEST_ERROR;
@@ -303,7 +293,7 @@ generate_eoc_test_file(hid_t fapl_id)
TEST_ERROR;
if(H5Gclose(gid2) < 0)
TEST_ERROR;
- } /* end for */
+ }
if(H5Gclose(gid1) < 0)
TEST_ERROR;
@@ -593,9 +583,6 @@ error:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
- * Fall 2016
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -710,9 +697,6 @@ error:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
- * Fall 2016
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -815,9 +799,6 @@ error:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
- * Spring 2016
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -873,7 +854,7 @@ check_evict_on_close_api(void)
/* ensure an invalid plist fails */
H5E_BEGIN_TRY {
- status = H5Pget_evict_on_close((hid_t)-1, &evict_on_close);
+ status = H5Pget_evict_on_close(H5I_INVALID_HID, &evict_on_close);
} H5E_END_TRY;
if(status >= 0)
FAIL_PUTS_ERROR("H5Pget_evict_on_close() accepted invalid hid_t.");
@@ -897,9 +878,6 @@ error:
*
* Return: EXIT_FAILURE/EXIT_SUCCESS
*
- * Programmer: Dana Robinson
- * Spring 2016
- *
*-------------------------------------------------------------------------
*/
int
@@ -979,7 +957,7 @@ main(void)
HDprintf("All evict-on-close tests passed.\n");
- return EXIT_SUCCESS;
+ HDexit(EXIT_SUCCESS);
error:
@@ -992,7 +970,7 @@ error:
H5Pclose(fapl_id);
} H5E_END_TRY;
- return EXIT_FAILURE;
+ HDexit(EXIT_FAILURE);
} /* end main() */
@@ -1007,9 +985,6 @@ error:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
- * Spring 2017
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1052,9 +1027,6 @@ error:
*
* Return: EXIT_FAILURE/EXIT_SUCCESS
*
- * Programmer: Dana Robinson
- * Spring 2016
- *
*-------------------------------------------------------------------------
*/
int
@@ -1076,14 +1048,14 @@ main(void)
HDprintf("All evict-on-close tests passed.\n");
HDprintf("Note that EoC is not supported under parallel so most tests are skipped.\n");
- return EXIT_SUCCESS;
+ HDexit(EXIT_SUCCESS);
error:
HDprintf("***** %u evict-on-close test%s FAILED! *****\n",
nerrors, nerrors > 1 ? "S" : "");
- return EXIT_FAILURE;
+ HDexit(EXIT_FAILURE);
} /* main() - parallel */
diff --git a/test/extend.c b/test/extend.c
index e5c3cb3..a31ac0e 100644
--- a/test/extend.c
+++ b/test/extend.c
@@ -105,9 +105,9 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me
for(k = 0; k < (NX / 2); k++)
for(m = 0; m < (NY / 2); m++)
if(buf2[k][m] != buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]) {
- printf(" i=%d, j=%d, k=%d, m=%d\n", i, j, k, m);
- printf(" buf2[%d][%d]=%d\n", k, m, buf2[k][m]);
- printf(" buf1[%d][%d]=%d\n", (i % 2) * (NX / 2) + k, (j % 2) * (NY / 2) + m, buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]);
+ HDprintf(" i=%d, j=%d, k=%d, m=%d\n", i, j, k, m);
+ HDprintf(" buf2[%d][%d]=%d\n", k, m, buf2[k][m]);
+ HDprintf(" buf1[%d][%d]=%d\n", (i % 2) * (NX / 2) + k, (j % 2) * (NY / 2) + m, buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]);
TEST_ERROR;
} /* end if */
} /* end for */
@@ -195,9 +195,9 @@ write_data_deprec(const char *msg, hid_t file, const char *name, hid_t cparms, h
for(k = 0; k < (NX / 2); k++)
for(m = 0; m < (NY / 2); m++)
if(buf2[k][m] != buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]) {
- printf(" i=%d, j=%d, k=%d, m=%d\n", i, j, k, m);
- printf(" buf2[%d][%d]=%d\n", k, m, buf2[k][m]);
- printf(" buf1[%d][%d]=%d\n", (i % 2) * (NX / 2) + k, (j % 2) * (NY / 2) + m, buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]);
+ HDprintf(" i=%d, j=%d, k=%d, m=%d\n", i, j, k, m);
+ HDprintf(" buf2[%d][%d]=%d\n", k, m, buf2[k][m]);
+ HDprintf(" buf1[%d][%d]=%d\n", (i % 2) * (NX / 2) + k, (j % 2) * (NY / 2) + m, buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]);
TEST_ERROR;
} /* end if */
} /* end for */
@@ -219,23 +219,15 @@ error:
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Tests extendible datasets
+ * Purpose: Tests extendible datasets
*
- * Return: Success: exit(0)
- *
- * Failure: exit(non-zero)
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Robb Matzke
* Friday, January 30, 1998
*
- * Modifications:
- * Took main data code out into write_data() routine, to allow
- * different dataset creation property list settings to be tested.
- * Quincey Koziol
- * Tuesday, June 10, 2003
- *
*-------------------------------------------------------------------------
*/
int
@@ -289,17 +281,17 @@ main (void)
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
if(nerrors) {
- printf("***** %d FAILURE%s! *****\n", nerrors, (1 == nerrors) ? "" : "S");
- exit(EXIT_FAILURE);
+ HDprintf("***** %d FAILURE%s! *****\n", nerrors, (1 == nerrors) ? "" : "S");
+ HDexit(EXIT_FAILURE);
} /* end if */
- printf("All extend tests passed.\n");
+ HDprintf("All extend tests passed.\n");
h5_cleanup(FILENAME, fapl);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
- printf("*** One or more extend tests failed ***\n");
- return 1;
-}
+ HDprintf("*** One or more extend tests failed ***\n");
+ HDexit(EXIT_FAILURE);
+} /* end main() */
diff --git a/test/external.c b/test/external.c
index 20a9ed8..4d9fef0 100644
--- a/test/external.c
+++ b/test/external.c
@@ -15,27 +15,13 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Tuesday, March 3, 1998
*
- * Purpose: Tests datasets stored in external raw files.
+ * Purpose: Tests datasets stored in external raw files.
*/
-#include "h5test.h"
-
-const char *FILENAME[] = {
- "extern_1",
- "extern_2",
- "extern_3",
- "extern_4",
- "extern_dir/file_1",
- "extern_5",
- NULL
-};
-
-/* A similar collection of files is used for the tests that
- * perform file I/O.
- */
-#define N_EXT_FILES 4
-#define PART_SIZE 25
-#define TOTAL_SIZE 100
-#define GARBAGE_PER_FILE 10
+#include "external_common.h"
+#include "external_fname.h"
+
+#define AEF_EXNAME_MAX_LEN 12 /* string buffer size for external file name */
+ /* used in __add_external_files() */
/*-------------------------------------------------------------------------
@@ -44,7 +30,7 @@ const char *FILENAME[] = {
* Purpose: Determines whether two files contain the same data.
*
* Return: Success: nonzero if same, zero if different.
- * Failure: zero
+ * Failure: zero
*
* Programmer: Robb Matzke
* Wednesday, March 4, 1998
@@ -54,14 +40,17 @@ const char *FILENAME[] = {
static hbool_t
files_have_same_contents(const char *name1, const char *name2)
{
- int fd1 = 0, fd2 = 0;
- ssize_t n1, n2;
- char buf1[1024], buf2[1024];
+ int fd1 = 0;
+ int fd2 = 0;
+ ssize_t n1 = 0;
+ ssize_t n2 = 0;
+ char buf1[1024];
+ char buf2[1024];
hbool_t ret = FALSE; /* not equal until proven otherwise */
- if((fd1 = HDopen(name1, O_RDONLY)) < 0)
+ if ((fd1 = HDopen(name1, O_RDONLY)) < 0)
goto out;
- if((fd2 = HDopen(name2, O_RDONLY)) < 0)
+ if ((fd2 = HDopen(name2, O_RDONLY)) < 0)
goto out;
/* Loop until files are empty or we encounter a problem */
@@ -99,106 +88,6 @@ out:
/*-------------------------------------------------------------------------
- * Function: reset_raw_data_files
- *
- * Purpose: Resets the data in the raw data files for tests that
- * perform dataset I/O on a set of files.
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: Dana Robinson
- * February 2016
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-reset_raw_data_files(void)
-{
- int fd = 0; /* external file descriptor */
- size_t i, j; /* iterators */
- hssize_t n; /* bytes of I/O */
- char filename[1024]; /* file name */
- int data[PART_SIZE]; /* raw data buffer */
- uint8_t *garbage = NULL; /* buffer of garbage data */
- size_t garbage_count; /* size of garbage buffer */
- size_t garbage_bytes; /* # of garbage bytes written to file */
-
- /* Set up garbage buffer */
- garbage_count = N_EXT_FILES * GARBAGE_PER_FILE;
- if(NULL == (garbage = (uint8_t *)HDcalloc(garbage_count, sizeof(uint8_t))))
- goto error;
- for(i = 0; i < garbage_count; i++)
- garbage[i] = 0xFF;
-
- /* The *r files are pre-filled with data and are used to
- * verify that read operations work correctly.
- */
- for(i = 0; i < N_EXT_FILES; i++) {
-
- /* Open file */
- HDsprintf(filename, "extern_%lur.raw", (unsigned long)i + 1);
- if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
- goto error;
-
- /* Write garbage data to the file. This allows us to test the
- * the ability to set an offset in the raw data file.
- */
- garbage_bytes = i * 10;
- n = HDwrite(fd, garbage, garbage_bytes);
- if(n < 0 || (size_t)n != garbage_bytes)
- goto error;
-
- /* Fill array with data */
- for(j = 0; j < PART_SIZE; j++) {
- data[j] = (int)(i * 25 + j);
- } /* end for */
-
- /* Write raw data to the file. */
- n = HDwrite(fd, data, sizeof(data));
- if(n != sizeof(data))
- goto error;
-
- /* Close this file */
- HDclose(fd);
-
- } /* end for */
-
- /* The *w files are only pre-filled with the garbage data and are
- * used to verify that write operations work correctly. The individual
- * tests fill in the actual data.
- */
- for(i = 0; i < N_EXT_FILES; i++) {
-
- /* Open file */
- HDsprintf(filename, "extern_%luw.raw", (unsigned long)i + 1);
- if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
- goto error;
-
- /* Write garbage data to the file. This allows us to test the
- * the ability to set an offset in the raw data file.
- */
- garbage_bytes = i * 10;
- n = HDwrite(fd, garbage, garbage_bytes);
- if(n < 0 || (size_t)n != garbage_bytes)
- goto error;
-
- /* Close this file */
- HDclose(fd);
-
- } /* end for */
- HDfree(garbage);
- return SUCCEED;
-
-error:
- if(fd)
- HDclose(fd);
- if(garbage)
- HDfree(garbage);
- return FAIL;
-} /* end reset_raw_data_files() */
-
-
-/*-------------------------------------------------------------------------
* Function: test_non_extendible
*
* Purpose: Tests a non-extendible dataset with a single external file.
@@ -214,23 +103,21 @@ error:
static int
test_non_extendible(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1]; /* data space current size */
- hsize_t max_size[1]; /* data space maximum size */
- int n; /* number of external files */
- char name[256]; /* external file name */
- off_t file_offset; /* external file offset */
- hsize_t file_size; /* sizeof external file segment */
- haddr_t dset_addr; /* address of dataset */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* data space current size */
+ hsize_t max_size[1] = {100}; /* data space maximum size */
+ int n = 0; /* number of external files */
+ off_t file_offset = 0; /* external file offset */
+ hsize_t file_size = 0; /* sizeof external file segment */
+ haddr_t dset_addr = HADDR_UNDEF; /* address of dataset */
TESTING("fixed-size data space, exact storage");
- /* Create the dataset */
+ /* Create the dataset and close */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
- cur_size[0] = max_size[0] = 100;
if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int))) < 0)
FAIL_STACK_ERROR
if((space = H5Screate_simple(1, cur_size, max_size)) < 0)
@@ -263,29 +150,25 @@ test_non_extendible(hid_t file)
if(1 != n) {
H5_FAILED();
HDputs(" Returned external count is wrong.");
- printf(" got: %d\n ans: 1\n", n);
+ HDprintf(" got: %d\n ans: 1\n", n);
goto error;
- } /* end if */
+ }
- HDstrcpy(name + sizeof(name) - 4, "...");
- if(H5Pget_external(dcpl, 0, sizeof(name) - 4, name, &file_offset, &file_size) < 0)
+ /* Verify external file settings */
+ if(H5Pget_external(dcpl, 0, 0, NULL, &file_offset, &file_size) < 0)
FAIL_STACK_ERROR
-
- /* Check file offset */
if(file_offset != 0) {
H5_FAILED();
HDputs(" Wrong file offset.");
- printf(" got: %lu\n ans: 0\n", (unsigned long)file_offset);
+ HDprintf(" got: %lu\n ans: 0\n", (unsigned long)file_offset);
goto error;
- } /* end if */
-
- /* Check file size */
+ }
if(file_size != (max_size[0] * sizeof(int))) {
H5_FAILED();
HDputs(" Wrong file size.");
- printf(" got: %lu\n ans: %lu\n", (unsigned long)file_size, (unsigned long)max_size[0]*sizeof(int));
+ HDprintf(" got: %lu\n ans: %lu\n", (unsigned long)file_size, (unsigned long)max_size[0]*sizeof(int));
goto error;
- } /* end if */
+ }
/* Done (dataspace was previously closed) */
if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
@@ -312,7 +195,7 @@ test_non_extendible(hid_t file)
* Return: Success: 0
* Failure: 1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, November 23, 1998
*
*-------------------------------------------------------------------------
@@ -320,18 +203,17 @@ test_non_extendible(hid_t file)
static int
test_too_small(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1]; /* current data space size */
- hsize_t max_size[1]; /* maximum data space size */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* current data space size */
+ hsize_t max_size[1] = {100}; /* maximum data space size */
TESTING("external storage is too small");
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
- cur_size[0] = max_size[0] = 100;
- if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0)
+ if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0) /* note -1 */
FAIL_STACK_ERROR
if((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR
@@ -366,10 +248,10 @@ test_too_small(hid_t file)
* represent the current data and large enough to represent the
* eventual size of the data.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, November 23, 1998
*
*-------------------------------------------------------------------------
@@ -377,18 +259,16 @@ test_too_small(hid_t file)
static int
test_large_enough_current_eventual(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1]; /* current data space size */
- hsize_t max_size[1]; /* maximum data space size */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* current data space size */
+ hsize_t max_size[1] = {200}; /* maximum data space size */
TESTING("extendible dataspace, exact external size");
if((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
- cur_size[0] = 100;
- max_size[0] = 200;
if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int))) < 0)
FAIL_STACK_ERROR
if((space = H5Screate_simple(1, cur_size, max_size)) < 0)
@@ -430,19 +310,17 @@ error:
static int
test_large_enough_current_not_eventual(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1]; /* current data space size */
- hsize_t max_size[1]; /* maximum data space size */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* current data space size */
+ hsize_t max_size[1] = {200}; /* maximum data space size */
TESTING("extendible dataspace, external storage is too small");
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
- cur_size[0] = 100;
- max_size[0] = 200;
- if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0)
+ if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0) /* note -1 */
FAIL_STACK_ERROR
if((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR
@@ -486,15 +364,14 @@ test_large_enough_current_not_eventual(hid_t file)
static int
test_unlimited(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1]; /* data space current size */
- hsize_t max_size[1]; /* data space maximum size */
- int n; /* number of external files */
- char name[256]; /* external file name */
- off_t file_offset; /* external file offset */
- hsize_t file_size; /* sizeof external file segment */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* data space current size */
+ hsize_t max_size[1] = {H5S_UNLIMITED}; /* data space maximum size */
+ int n; /* number of external files */
+ off_t file_offset; /* external file offset */
+ hsize_t file_size; /* sizeof external file segment */
TESTING("unlimited dataspace, unlimited external storage");
@@ -503,8 +380,6 @@ test_unlimited(hid_t file)
FAIL_STACK_ERROR
if(H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED) < 0)
FAIL_STACK_ERROR
- cur_size[0] = 100;
- max_size[0] = H5S_UNLIMITED;
if((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR
if((dset = H5Dcreate2(file, "dset5", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
@@ -524,26 +399,24 @@ test_unlimited(hid_t file)
if(1 != n) {
H5_FAILED();
HDputs(" Returned external count is wrong.");
- printf(" got: %d\n ans: 1\n", n);
+ HDprintf(" got: %d\n ans: 1\n", n);
goto error;
} /* end if */
- HDstrcpy(name + sizeof(name) - 4, "...");
- if(H5Pget_external(dcpl, 0, sizeof(name) - 4, name, &file_offset, &file_size) < 0)
+ if(H5Pget_external(dcpl, 0, 0, NULL, &file_offset, &file_size) < 0)
FAIL_STACK_ERROR
if(file_offset != 0) {
H5_FAILED();
HDputs(" Wrong file offset.");
- printf(" got: %lu\n ans: 0\n", (unsigned long)file_offset);
+ HDprintf(" got: %lu\n ans: 0\n", (unsigned long)file_offset);
goto error;
- } /* end if */
-
+ }
if(H5F_UNLIMITED != file_size) {
H5_FAILED();
HDputs(" Wrong file size.");
- printf(" got: %lu\n ans: INF\n", (unsigned long)file_size);
+ HDprintf(" got: %lu\n ans: INF\n", (unsigned long)file_size);
goto error;
- } /* end if */
+ }
if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
@@ -562,6 +435,56 @@ test_unlimited(hid_t file)
/*-------------------------------------------------------------------------
+ * Function: __add_external_files
+ *
+ * Purpose: Add external file names to the DCPL with the given properties.
+ * Used in test_multiple_files().
+ * Limit to no more than 999 external files.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 29 Sep 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+__add_external_files(
+ hid_t dcpl_id,
+ unsigned int n_external_files,
+ off_t offset,
+ hsize_t max_ext_size)
+{
+ char exname[AEF_EXNAME_MAX_LEN+1];
+ unsigned int i = 0;
+
+ if (dcpl_id < 0) {
+ return -1;
+ }
+ for (i = 0; i < n_external_files; i++) {
+ if (HDsnprintf(
+ exname,
+ AEF_EXNAME_MAX_LEN,
+ "ext%d.data",
+ i+1)
+ > AEF_EXNAME_MAX_LEN)
+ {
+ HDfprintf(stderr, "External file %d overflows name buffer\n", i+1);
+ fflush(stderr);
+ return -1;
+ }
+ if (H5Pset_external(dcpl_id, exname, offset, max_ext_size) < 0) {
+ HDfprintf(stderr, "Problem adding external file %s\n", exname);
+ fflush(stderr);
+ return -1;
+ }
+ }
+ return 0;
+} /* end __add_external_files() */
+
+
+/*-------------------------------------------------------------------------
* Function: test_multiple_files
*
* Purpose: Test multiple external files for a dataset.
@@ -577,35 +500,55 @@ test_unlimited(hid_t file)
static int
test_multiple_files(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* dataspace */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1]; /* data space current size */
- hsize_t max_size[1]; /* data space maximum size */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* dataspace */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* data space current size */
+ hsize_t max_size[1] = {100}; /* data space maximum size */
+ hsize_t max_ext_size; /* maximum size of external files */
+ unsigned int n_external_files = 4;
TESTING("multiple external files");
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
- cur_size[0] = max_size[0] = 100;
+ max_ext_size = (hsize_t)(sizeof(int) * max_size[0] / n_external_files);
+
+ if (__add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) {
+ FAIL_STACK_ERROR;
+ }
- if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0)
- FAIL_STACK_ERROR
- if(H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0)
- FAIL_STACK_ERROR
- if(H5Pset_external(dcpl, "ext3.data", (off_t)0, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0)
- FAIL_STACK_ERROR
- if(H5Pset_external(dcpl, "ext4.data", (off_t)0, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0)
- FAIL_STACK_ERROR
if((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR
+
if((dset = H5Dcreate2(file, "dset6", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
- if(H5Sclose(space) < 0) FAIL_STACK_ERROR
if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
+ /* Re-use space below */
+
+ /* ----------------------------------------------
+ * Verify that too-small external files will fail
+ */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR
+
+ max_ext_size -= 1;
+
+ if (__add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) {
+ FAIL_STACK_ERROR;
+ }
+
+ H5E_BEGIN_TRY {
+ dset = H5Dcreate2(file, "dset7", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(dset >= 0)
+ FAIL_PUTS_ERROR(" Small external files succeeded instead of failing.");
+
+ if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(space) < 0) FAIL_STACK_ERROR
PASSED();
return 0;
@@ -637,9 +580,9 @@ error:
static int
test_add_to_unlimited(void)
{
- hid_t dcpl = -1; /* dataset creation properties */
- herr_t status; /* function return status */
- int n; /* number of external files */
+ hid_t dcpl = -1; /* dataset creation properties */
+ herr_t status = FAIL; /* function return status */
+ int n = 0; /* number of external files */
TESTING("external file following unlimited file");
@@ -688,12 +631,12 @@ test_add_to_unlimited(void)
static int
test_overflow(void)
{
- hid_t dcpl = -1; /* dataset creation properties */
- herr_t status; /* return status */
+ hid_t dcpl = -1; /* dataset creation properties */
+ herr_t status = FAIL; /* return status */
TESTING("address overflow in external files");
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
if(H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED-1) < 0)
FAIL_STACK_ERROR
@@ -733,19 +676,19 @@ test_overflow(void)
static int
test_read_file_set(hid_t fapl)
{
- hid_t file = -1; /* file to write to */
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hid_t grp = -1; /* group to emit diagnostics */
- size_t i; /* miscellaneous counter */
- char filename[1024]; /* file names */
- int part[PART_SIZE]; /* raw data buffer (partial) */
+ hid_t file = -1; /* file to write to */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ hid_t grp = -1; /* group to emit diagnostics */
+ size_t i = 0; /* miscellaneous counter */
+ char filename[1024]; /* file names */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size; /* current data space size */
- hid_t hs_space = -1; /* hyperslab data space */
- hsize_t hs_start = 30; /* hyperslab starting offset */
- hsize_t hs_count = 25; /* hyperslab size */
+ hsize_t cur_size; /* current data space size */
+ hid_t hs_space = -1; /* hyperslab data space */
+ hsize_t hs_start = 30; /* hyperslab starting offset */
+ hsize_t hs_count = 25; /* hyperslab size */
TESTING("read external dataset");
@@ -753,14 +696,14 @@ test_read_file_set(hid_t fapl)
TEST_ERROR
/* Reset the raw data files */
- if(reset_raw_data_files() < 0)
+ if(reset_raw_data_files(FALSE) < 0)
TEST_ERROR
/* Create the file and an initial group. This causes messages about
* debugging to be emitted before we start playing games with what the
* output looks like.
*/
- h5_fixname(FILENAME[1], fapl, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[1], fapl, filename, sizeof(filename));
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
if((grp = H5Gcreate2(file, "emit-diagnostics", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -774,7 +717,7 @@ test_read_file_set(hid_t fapl)
HDsnprintf(filename, sizeof(filename), "extern_%dr.raw", (int) i + 1);
if(H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
FAIL_STACK_ERROR
- } /* end for */
+ }
/* Create the dataspace */
cur_size = TOTAL_SIZE;
@@ -851,19 +794,19 @@ test_read_file_set(hid_t fapl)
static int
test_write_file_set(hid_t fapl)
{
- hid_t file = -1; /* file to which to write */
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t mem_space = -1; /* memory data space */
- hid_t file_space = -1; /* file data space */
- hid_t dset = -1; /* dataset */
- unsigned i; /* miscellaneous counter */
- int part[PART_SIZE]; /* raw data buffer (partial) */
- int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size = 100; /* current data space size */
- hsize_t max_size = 200; /* maximum data space size */
- hsize_t hs_start = 100; /* hyperslab starting offset */
- hsize_t hs_count = 100; /* hyperslab size */
- char filename[1024]; /* file name */
+ hid_t file = -1; /* file to which to write */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t mem_space = -1; /* memory data space */
+ hid_t file_space = -1; /* file data space */
+ hid_t dset = -1; /* dataset */
+ unsigned i = 0; /* miscellaneous counter */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
+ int whole[TOTAL_SIZE]; /* raw data buffer (total) */
+ hsize_t cur_size = 100; /* current data space size */
+ hsize_t max_size = 200; /* maximum data space size */
+ hsize_t hs_start = 100; /* hyperslab starting offset */
+ hsize_t hs_count = 100; /* hyperslab size */
+ char filename[1024]; /* file name */
TESTING("write external dataset");
@@ -871,7 +814,7 @@ test_write_file_set(hid_t fapl)
TEST_ERROR
/* Create another file */
- h5_fixname(FILENAME[2], fapl, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[2], fapl, filename, sizeof(filename));
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
@@ -893,7 +836,7 @@ test_write_file_set(hid_t fapl)
} /* end for */
/* Reset the raw data files */
- if(reset_raw_data_files() < 0)
+ if(reset_raw_data_files(FALSE) < 0)
TEST_ERROR
/* Create the dataset */
@@ -976,25 +919,25 @@ test_write_file_set(hid_t fapl)
static int
test_path_absolute(hid_t fapl)
{
- hid_t file = -1; /* file to write to */
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- size_t i; /* miscellaneous counter */
- char cwdpath[1024]; /* working directory */
- char filename[1024]; /* file name */
- int part[PART_SIZE]; /* raw data buffer (partial) */
+ hid_t file = -1; /* file to write to */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ size_t i = 0; /* miscellaneous counter */
+ char cwdpath[1024]; /* working directory */
+ char filename[1024]; /* file name */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size; /* current data space size */
+ hsize_t cur_size; /* current data space size */
TESTING("absolute filenames for external file");
- h5_fixname(FILENAME[3], fapl, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[3], fapl, filename, sizeof(filename));
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
/* Reset the raw data files */
- if(reset_raw_data_files() < 0)
+ if(reset_raw_data_files(FALSE) < 0)
TEST_ERROR
/* Create the dcpl */
@@ -1066,16 +1009,16 @@ error:
static int
test_path_relative(hid_t fapl)
{
- hid_t file = -1; /* file to write to */
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- size_t i; /* miscellaneous counters */
- char cwdpath[1024]; /* working directory */
- char filename[1024]; /* file name */
- int part[PART_SIZE]; /* raw data buffer (partial) */
+ hid_t file = -1; /* file to write to */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ size_t i = 0; /* miscellaneous counters */
+ char cwdpath[1024]; /* working directory */
+ char filename[1024]; /* file name */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size; /* current data space size */
+ hsize_t cur_size; /* current data space size */
TESTING("filenames relative to current directory for external file");
@@ -1085,12 +1028,12 @@ test_path_relative(hid_t fapl)
if (HDmkdir("extern_dir", (mode_t)0755) < 0 && errno != EEXIST)
TEST_ERROR;
- h5_fixname(FILENAME[4], fapl, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[4], fapl, filename, sizeof(filename));
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR;
/* Reset the raw data files */
- if(reset_raw_data_files() < 0)
+ if(reset_raw_data_files(FALSE) < 0)
TEST_ERROR
/* Create the dataset */
@@ -1156,21 +1099,21 @@ error:
static int
test_path_relative_cwd(hid_t fapl)
{
- hid_t file = -1; /* file to write to */
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dapl = -1; /* dataset access property list */
- hid_t dapl2 = -1; /* copy of dapl */
- hid_t dset = -1; /* dataset */
- hid_t dset2 = -1; /* dataset, opened a second time */
- hid_t dset3 = -1; /* dataset, opened with different prefix */
- size_t i; /* miscellaneous counters */
- char cwdpath[1024]; /* working directory */
- char filename[1024]; /* file name */
- int part[PART_SIZE]; /* raw data buffer (partial) */
+ hid_t file = -1; /* file to write to */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dapl = -1; /* dataset access property list */
+ hid_t dapl2 = -1; /* copy of dapl */
+ hid_t dset = -1; /* dataset */
+ hid_t dset2 = -1; /* dataset, opened a second time */
+ hid_t dset3 = -1; /* dataset, opened with different prefix */
+ size_t i = 0; /* miscellaneous counters */
+ char cwdpath[1024]; /* working directory */
+ char filename[1024]; /* file name */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size; /* current data space size */
- char buffer[1024]; /* buffer to read efile_prefix */
+ hsize_t cur_size; /* current data space size */
+ char buffer[1024]; /* buffer to read efile_prefix */
TESTING("filenames relative to HDF5 file for external file");
@@ -1180,12 +1123,12 @@ test_path_relative_cwd(hid_t fapl)
if(HDmkdir("extern_dir", (mode_t)0755) < 0 && errno != EEXIST)
TEST_ERROR;
- h5_fixname(FILENAME[4], fapl, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[4], fapl, filename, sizeof(filename));
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR;
/* Reset the raw data files */
- if(reset_raw_data_files() < 0)
+ if(reset_raw_data_files(FALSE) < 0)
TEST_ERROR
/* Create the dataset */
@@ -1297,116 +1240,6 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_path_env
- *
- * Purpose: Test whether the value of HDF5_EXTFILE_PREFIX will overwrite
- * the efile_prefix dataset access property.
- * This will create an HDF5 file in a subdirectory which will
- * refer to ../extern_*a.raw
- * The files are then accessed by setting the HDF5_EXTFILE_PREFIX
- * environment variable to "${ORIGIN}".
- * The efile_prefix dataset access property is set to "someprefix",
- * which will cause an error if the value is not overwritten by
- * the environment variable.
- *
- * Return: Success: 0
- * Failure: 1
- *
- * Programmer: Steffen Kiess
- * March 10, 2015
- *
- *-------------------------------------------------------------------------
- */
-static int
-test_path_env(hid_t fapl)
-{
- hid_t file = -1; /* file to write to */
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dapl = -1; /* dataset access property list */
- hid_t dset = -1; /* dataset */
- size_t i; /* miscellaneous counters */
- char cwdpath[1024]; /* working directory */
- char filename[1024]; /* file name */
- int part[PART_SIZE]; /* raw data buffer (partial) */
- int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size; /* current data space size */
- char buffer[1024]; /* buffer to read efile_prefix */
-
- TESTING("prefix in HDF5_EXTFILE_PREFIX");
-
- if(HDsetenv("HDF5_EXTFILE_PREFIX", "${ORIGIN}", 1))
- TEST_ERROR
-
- if(HDmkdir("extern_dir", (mode_t)0755) < 0 && errno != EEXIST)
- TEST_ERROR;
-
- h5_fixname(FILENAME[4], fapl, filename, sizeof(filename));
- if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- FAIL_STACK_ERROR
-
- /* Reset the raw data files */
- if(reset_raw_data_files() < 0)
- TEST_ERROR
-
- /* Create the dataset */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR
- if(NULL == HDgetcwd(cwdpath, sizeof(cwdpath)))
- TEST_ERROR
- for(i = 0; i < N_EXT_FILES; i++) {
- HDsnprintf(filename, sizeof(filename), "..%sextern_%dr.raw", H5_DIR_SEPS, (int) i + 1);
- if(H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
- FAIL_STACK_ERROR
- } /* end for */
-
- cur_size = TOTAL_SIZE;
- if((space = H5Screate_simple(1, &cur_size, NULL)) < 0)
- FAIL_STACK_ERROR
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
- FAIL_STACK_ERROR
-
- /* Set prefix to a nonexistent directory, will be overwritten by environment variable */
- if(H5Pset_efile_prefix(dapl, "someprefix") < 0)
- FAIL_STACK_ERROR
- if(H5Pget_efile_prefix(dapl, buffer, sizeof(buffer)) < 0)
- FAIL_STACK_ERROR
- if(HDstrcmp(buffer, "someprefix") != 0)
- FAIL_PUTS_ERROR("efile prefix not set correctly");
-
- /* Create dataset */
- if((dset = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, dapl)) < 0)
- FAIL_STACK_ERROR
-
- /* Read the entire dataset and compare with the original */
- HDmemset(whole, 0, sizeof(whole));
- if(H5Dread(dset, H5T_NATIVE_INT, space, space, H5P_DEFAULT, whole) < 0)
- FAIL_STACK_ERROR
- for(i = 0; i < TOTAL_SIZE; i++)
- if(whole[i] != (signed)i)
- FAIL_PUTS_ERROR("Incorrect value(s) read.");
-
- if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
- if(H5Pclose(dapl) < 0) FAIL_STACK_ERROR
- if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
- if(H5Sclose(space) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file) < 0) FAIL_STACK_ERROR
- PASSED();
- return 0;
-
-error:
- H5E_BEGIN_TRY {
- H5Pclose(dapl);
- H5Dclose(dset);
- H5Pclose(dcpl);
- H5Sclose(space);
- H5Fclose(file);
- } H5E_END_TRY;
- return 1;
-} /* end test_path_env() */
-
-
-/*-------------------------------------------------------------------------
* Function: test_h5d_get_access_plist
*
* Purpose: Ensure that H5Dget_access_plist returns correct values.
@@ -1422,14 +1255,14 @@ error:
static int
test_h5d_get_access_plist(hid_t fapl_id)
{
- hid_t fid = -1; /* file to write to */
- hid_t dcpl_id = -1; /* dataset creation properties */
- hid_t dapl_id = -1; /* dataset access properties */
- hid_t sid = -1; /* data space */
- hid_t did = -1; /* dataset */
- hsize_t dims = 0; /* dataset size */
- char *buffer = NULL; /* saved prefix name from dapl */
- char filename[1024]; /* file names */
+ hid_t fid = -1; /* file to write to */
+ hid_t dcpl_id = -1; /* dataset creation properties */
+ hid_t dapl_id = -1; /* dataset access properties */
+ hid_t sid = -1; /* data space */
+ hid_t did = -1; /* dataset */
+ hsize_t dims = 0; /* dataset size */
+ char *buffer = NULL; /* saved prefix name from dapl */
+ char filename[1024]; /* file names */
TESTING("H5Dget_access_plist() returns correct prefix");
@@ -1437,11 +1270,11 @@ test_h5d_get_access_plist(hid_t fapl_id)
TEST_ERROR
/* Reset the raw data files */
- if(reset_raw_data_files() < 0)
+ if(reset_raw_data_files(FALSE) < 0)
TEST_ERROR
/* Create the file */
- h5_fixname(FILENAME[5], fapl_id, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[5], fapl_id, filename, sizeof(filename));
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
FAIL_STACK_ERROR
@@ -1512,7 +1345,7 @@ test_h5d_get_access_plist(hid_t fapl_id)
*
* Return: EXIT_SUCCESS/EXIT_FAILURE
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 3, 1998
*
*-------------------------------------------------------------------------
@@ -1520,19 +1353,19 @@ test_h5d_get_access_plist(hid_t fapl_id)
int
main(void)
{
- hid_t fapl_id_old = -1; /* file access properties (old format) */
- hid_t fapl_id_new = -1; /* file access properties (new format) */
- hid_t fid = -1; /* file for test_1* functions */
- hid_t gid = -1; /* group to emit diagnostics */
- char filename[1024]; /* file name for test_1* funcs */
- unsigned latest_format; /* default or latest file format */
- int nerrors = 0; /* number of errors */
+ hid_t fapl_id_old = -1; /* file access properties (old format) */
+ hid_t fapl_id_new = -1; /* file access properties (new format) */
+ hid_t fid = -1; /* file for test_1* functions */
+ hid_t gid = -1; /* group to emit diagnostics */
+ char filename[1024]; /* file name for test_1* funcs */
+ unsigned latest_format; /* default or latest file format */
+ int nerrors = 0; /* number of errors */
h5_reset();
/* Get a fapl for the old (default) file format */
fapl_id_old = h5_fileaccess();
- h5_fixname(FILENAME[0], fapl_id_old, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[0], fapl_id_old, filename, sizeof(filename));
/* Copy and set up a fapl for the latest file format */
if((fapl_id_new = H5Pcopy(fapl_id_old)) < 0)
@@ -1552,11 +1385,11 @@ main(void)
if(latest_format) {
HDputs("\nTesting with the latest file format:");
current_fapl_id = fapl_id_new;
- } /* end if */
+ }
else {
HDputs("Testing with the default file format:");
current_fapl_id = fapl_id_old;
- } /* end else */
+ }
/* Create the common file used by some of the tests */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, current_fapl_id)) < 0)
@@ -1585,15 +1418,14 @@ main(void)
nerrors += test_path_absolute(current_fapl_id);
nerrors += test_path_relative(current_fapl_id);
nerrors += test_path_relative_cwd(current_fapl_id);
- nerrors += test_path_env(current_fapl_id);
/* Verify symbol table messages are cached */
- nerrors += (h5_verify_cached_stabs(FILENAME, current_fapl_id) < 0 ? 1 : 0);
+ nerrors += (h5_verify_cached_stabs(EXT_FNAME, current_fapl_id) < 0 ? 1 : 0);
/* Close the common file */
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
- } /* end for */
+ } /* end for old and new format */
if(nerrors > 0) goto error;
@@ -1603,7 +1435,7 @@ main(void)
HDputs("All external storage tests passed.");
/* Clean up files used by file set tests */
- if(h5_cleanup(FILENAME, fapl_id_old)) {
+ if(h5_cleanup(EXT_FNAME, fapl_id_old)) {
HDremove("extern_1r.raw");
HDremove("extern_2r.raw");
HDremove("extern_3r.raw");
@@ -1615,7 +1447,7 @@ main(void)
HDremove("extern_4w.raw");
HDrmdir("extern_dir");
- } /* end if */
+ }
return EXIT_SUCCESS;
@@ -1627,7 +1459,7 @@ error:
H5Gclose(gid);
} H5E_END_TRY;
nerrors = MAX(1, nerrors);
- printf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s");
+ HDprintf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s");
return EXIT_FAILURE;
} /* end main() */
diff --git a/test/external_common.c b/test/external_common.c
new file mode 100644
index 0000000..9e759cd
--- /dev/null
+++ b/test/external_common.c
@@ -0,0 +1,127 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Raymond Lu <songyulu@hdfgroup.org>
+ * April, 2019
+ *
+ * Purpose: Private function for external.c and external_env.c
+ */
+
+#include "external_common.h"
+
+
+/*-------------------------------------------------------------------------
+ * Function: reset_raw_data_files
+ *
+ * Purpose: Resets the data in the raw data files for tests that
+ * perform dataset I/O on a set of files.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Dana Robinson
+ * February 2016
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+reset_raw_data_files(hbool_t is_env)
+{
+ int fd = 0; /* external file descriptor */
+ size_t i, j; /* iterators */
+ hssize_t n; /* bytes of I/O */
+ char filename[1024]; /* file name */
+ int data[PART_SIZE]; /* raw data buffer */
+ uint8_t *garbage = NULL; /* buffer of garbage data */
+ size_t garbage_count; /* size of garbage buffer */
+ size_t garbage_bytes; /* # of garbage bytes written to file */
+
+ /* Set up garbage buffer */
+ garbage_count = N_EXT_FILES * GARBAGE_PER_FILE;
+ if(NULL == (garbage = (uint8_t *)HDcalloc(garbage_count, sizeof(uint8_t))))
+ goto error;
+ for(i = 0; i < garbage_count; i++)
+ garbage[i] = 0xFF;
+
+ /* The *r files are pre-filled with data and are used to
+ * verify that read operations work correctly.
+ */
+ for(i = 0; i < N_EXT_FILES; i++) {
+
+ /* Open file */
+ if(is_env)
+ HDsprintf(filename, "extern_env_dir%sextern_env_%lur.raw", H5_DIR_SEPS, (unsigned long)i + 1);
+ else
+ HDsprintf(filename, "extern_%lur.raw", (unsigned long)i + 1);
+ if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
+ goto error;
+
+ /* Write garbage data to the file. This allows us to test the
+ * the ability to set an offset in the raw data file.
+ */
+ garbage_bytes = i * 10;
+ n = HDwrite(fd, garbage, garbage_bytes);
+ if(n < 0 || (size_t)n != garbage_bytes)
+ goto error;
+
+ /* Fill array with data */
+ for(j = 0; j < PART_SIZE; j++) {
+ data[j] = (int)(i * 25 + j);
+ } /* end for */
+
+ /* Write raw data to the file. */
+ n = HDwrite(fd, data, sizeof(data));
+ if(n != sizeof(data))
+ goto error;
+
+ /* Close this file */
+ HDclose(fd);
+
+ } /* end for */
+
+ /* The *w files are only pre-filled with the garbage data and are
+ * used to verify that write operations work correctly. The individual
+ * tests fill in the actual data.
+ */
+ for(i = 0; i < N_EXT_FILES; i++) {
+
+ /* Open file */
+ if(is_env)
+ HDsprintf(filename, "extern_env_dir%sextern_env_%luw.raw", H5_DIR_SEPS, (unsigned long)i + 1);
+ else
+ HDsprintf(filename, "extern_%luw.raw", (unsigned long)i + 1);
+ if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
+ goto error;
+
+ /* Write garbage data to the file. This allows us to test the
+ * the ability to set an offset in the raw data file.
+ */
+ garbage_bytes = i * 10;
+ n = HDwrite(fd, garbage, garbage_bytes);
+ if(n < 0 || (size_t)n != garbage_bytes)
+ goto error;
+
+ /* Close this file */
+ HDclose(fd);
+
+ } /* end for */
+ HDfree(garbage);
+ return SUCCEED;
+
+error:
+ if(fd)
+ HDclose(fd);
+ if(garbage)
+ HDfree(garbage);
+ return FAIL;
+}
diff --git a/test/external_common.h b/test/external_common.h
new file mode 100644
index 0000000..f02652b
--- /dev/null
+++ b/test/external_common.h
@@ -0,0 +1,45 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Raymond Lu <songyulu@hdfgroup.org>
+ * April, 2019
+ *
+ * Purpose: Private function for external.c and external_env.c
+ */
+#ifndef _EXTERNAL_COMMON_H
+#define _EXTERNAL_COMMON_H
+
+/* Include test header files */
+#include "h5test.h"
+
+/* A similar collection of files is used for the tests that
+ * perform file I/O.
+ */
+#define N_EXT_FILES 4
+#define PART_SIZE 25
+#define TOTAL_SIZE 100
+#define GARBAGE_PER_FILE 10
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+H5TEST_DLL herr_t reset_raw_data_files(hbool_t is_env);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _EXTERNAL_COMMON_H */
diff --git a/test/external_env.c b/test/external_env.c
new file mode 100644
index 0000000..18e1f25
--- /dev/null
+++ b/test/external_env.c
@@ -0,0 +1,218 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Tests datasets stored in external raw files.
+ */
+#include "external_common.h"
+
+static const char *EXT_ENV_FNAME[] = {
+ "extern_env_dir/file_2",
+ NULL
+};
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_path_env
+ *
+ * Purpose: Test whether the value of HDF5_EXTFILE_PREFIX will overwrite
+ * the efile_prefix dataset access property.
+ * This will create an HDF5 file in a subdirectory which will
+ * refer to ../extern_*a.raw
+ * The files are then accessed by setting the HDF5_EXTFILE_PREFIX
+ * environment variable to "${ORIGIN}".
+ * The efile_prefix dataset access property is set to "someprefix",
+ * which will cause an error if the value is not overwritten by
+ * the environment variable.
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Steffen Kiess
+ * March 10, 2015
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_path_env(hid_t fapl)
+{
+ hid_t file = -1; /* file to write to */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dapl = -1; /* dataset access property list */
+ hid_t dset = -1; /* dataset */
+ size_t i; /* miscellaneous counters */
+ char cwdpath[1024]; /* working directory */
+ char filename[1024]; /* file name */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
+ int whole[TOTAL_SIZE]; /* raw data buffer (total) */
+ hsize_t cur_size; /* current data space size */
+ char buffer[1024]; /* buffer to read efile_prefix */
+
+ TESTING("prefix in HDF5_EXTFILE_PREFIX");
+
+ h5_fixname(EXT_ENV_FNAME[0], fapl, filename, sizeof(filename));
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Reset the raw data files */
+ if(reset_raw_data_files(TRUE) < 0)
+ TEST_ERROR
+
+ /* Create the dataset */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR
+ if(NULL == HDgetcwd(cwdpath, sizeof(cwdpath)))
+ TEST_ERROR
+ for(i = 0; i < N_EXT_FILES; i++) {
+ HDsnprintf(filename, sizeof(filename), "extern_env_%dr.raw", (int) i + 1);
+ if(H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
+ FAIL_STACK_ERROR
+ } /* end for */
+
+ cur_size = TOTAL_SIZE;
+ if((space = H5Screate_simple(1, &cur_size, NULL)) < 0)
+ FAIL_STACK_ERROR
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Set prefix to a nonexistent directory, will be overwritten by environment variable */
+ if(H5Pset_efile_prefix(dapl, "someprefix") < 0)
+ FAIL_STACK_ERROR
+ if(H5Pget_efile_prefix(dapl, buffer, sizeof(buffer)) < 0)
+ FAIL_STACK_ERROR
+ if(HDstrcmp(buffer, "someprefix") != 0)
+ FAIL_PUTS_ERROR("efile prefix not set correctly");
+
+ /* Create dataset */
+ if((dset = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, dapl)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Read the entire dataset and compare with the original */
+ HDmemset(whole, 0, sizeof(whole));
+ if(H5Dread(dset, H5T_NATIVE_INT, space, space, H5P_DEFAULT, whole) < 0)
+ FAIL_STACK_ERROR
+ for(i = 0; i < TOTAL_SIZE; i++)
+ if(whole[i] != (signed)i)
+ FAIL_PUTS_ERROR("Incorrect value(s) read.");
+
+ if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
+ if(H5Pclose(dapl) < 0) FAIL_STACK_ERROR
+ if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(space) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(file) < 0) FAIL_STACK_ERROR
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(dapl);
+ H5Dclose(dset);
+ H5Pclose(dcpl);
+ H5Sclose(space);
+ H5Fclose(file);
+ } H5E_END_TRY;
+ return 1;
+} /* end test_path_env() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Runs external dataset tests.
+ *
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
+ *
+ * Programmer: Robb Matzke
+ * Tuesday, March 3, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ hid_t fapl_id_old = -1; /* file access properties (old format) */
+ hid_t fapl_id_new = -1; /* file access properties (new format) */
+ hid_t fid = -1; /* file for test_1* functions */
+ hid_t gid = -1; /* group to emit diagnostics */
+ unsigned latest_format; /* default or latest file format */
+ int nerrors = 0; /* number of errors */
+
+ h5_reset();
+
+ /* Get a fapl for the old (default) file format */
+ fapl_id_old = h5_fileaccess();
+
+ /* Copy and set up a fapl for the latest file format */
+ if((fapl_id_new = H5Pcopy(fapl_id_old)) < 0)
+ FAIL_STACK_ERROR
+ if(H5Pset_libver_bounds(fapl_id_new, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ FAIL_STACK_ERROR
+
+ if(HDmkdir("extern_env_dir", (mode_t)0755) < 0 && errno != EEXIST)
+ TEST_ERROR;
+
+ /* Test with old & new format groups */
+ for(latest_format = FALSE; latest_format <= TRUE; latest_format++) {
+ hid_t current_fapl_id = -1;
+
+ /* Set the fapl for different file formats */
+ if(latest_format) {
+ HDputs("\nTesting with the latest file format:");
+ current_fapl_id = fapl_id_new;
+ } /* end if */
+ else {
+ HDputs("Testing with the default file format:");
+ current_fapl_id = fapl_id_old;
+ } /* end else */
+
+ nerrors += test_path_env(current_fapl_id);
+ } /* end for */
+
+ if(nerrors > 0) goto error;
+
+ /* Close the new ff fapl. h5_cleanup will take care of the old ff fapl */
+ if(H5Pclose(fapl_id_new) < 0) FAIL_STACK_ERROR
+
+ HDputs("All external storage tests passed.");
+
+ /* Clean up files used by file set tests */
+ if(h5_cleanup(EXT_ENV_FNAME, fapl_id_old)) {
+ char filename[1024]; /* file name */
+ int i;
+
+ for(i = 0; i < N_EXT_FILES; i++) {
+ HDsnprintf(filename, sizeof(filename), "extern_env_dir%sextern_env_%dr.raw", H5_DIR_SEPS, i + 1);
+ HDremove(filename);
+ HDsnprintf(filename, sizeof(filename), "extern_env_dir%sextern_env_%dw.raw", H5_DIR_SEPS, i + 1);
+ HDremove(filename);
+ }
+
+ HDrmdir("extern_env_dir");
+ } /* end if */
+
+ return EXIT_SUCCESS;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Pclose(fapl_id_old);
+ H5Pclose(fapl_id_new);
+ H5Gclose(gid);
+ } H5E_END_TRY;
+ nerrors = MAX(1, nerrors);
+ HDprintf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s");
+ return EXIT_FAILURE;
+} /* end main() */
+
diff --git a/test/external_fname.h b/test/external_fname.h
new file mode 100644
index 0000000..c5111b6
--- /dev/null
+++ b/test/external_fname.h
@@ -0,0 +1,37 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Quincey Koziol <koziol@lbl.gov>
+ * July, 2019
+ *
+ * Purpose: Private declaration for external.c and external_env.c
+ */
+#ifndef _EXTERNAL_FNAME_H
+#define _EXTERNAL_FNAME_H
+
+/* Include test header files */
+#include "h5test.h"
+
+static const char *EXT_FNAME[] = {
+ "extern_1",
+ "extern_2",
+ "extern_3",
+ "extern_4",
+ "extern_dir/file_1",
+ "extern_5",
+ NULL
+};
+
+#endif /* _EXTERNAL_FNAME_H */
+
diff --git a/test/farray.c b/test/farray.c
index 383cb32..e1bc5bc 100644
--- a/test/farray.c
+++ b/test/farray.c
@@ -25,9 +25,9 @@
#include "H5FApkg.h" /* Fixed Arrays */
/* Other private headers that this test requires */
-#include "H5CXprivate.h" /* API Contexts */
-#include "H5Iprivate.h" /* IDs */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Iprivate.h" /* IDs */
+#include "H5VMprivate.h" /* Vectors and arrays */
/* Local macros */
@@ -113,121 +113,116 @@ h5_stat_size_t empty_size_g;
/*-------------------------------------------------------------------------
- * Function: init_cparam
+ * Function: init_cparam
*
- * Purpose: Initialize array creation parameter structure
+ * Purpose: Initialize array creation parameter structure
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
init_cparam(H5FA_create_t *cparam, farray_test_param_t *tparam)
{
/* Wipe out background */
HDmemset(cparam, 0, sizeof(*cparam));
- cparam->cls = H5FA_CLS_TEST;
- cparam->raw_elmt_size = ELMT_SIZE;
- cparam->max_dblk_page_nelmts_bits = MAX_DBLOCK_PAGE_NELMTS_BITS;
- cparam->nelmts = tparam->nelmts;
+ cparam->cls = H5FA_CLS_TEST;
+ cparam->raw_elmt_size = ELMT_SIZE;
+ cparam->max_dblk_page_nelmts_bits = MAX_DBLOCK_PAGE_NELMTS_BITS;
+ cparam->nelmts = tparam->nelmts;
- return(0);
+ return SUCCEED;
} /* init_cparam() */
/*-------------------------------------------------------------------------
- * Function: create_file
+ * Function: create_file
*
- * Purpose: Create file and retrieve pointer to internal file object
- *
- * Return: Success: 0
- * Failure: -1
+ * Purpose: Create file and retrieve pointer to internal file object
*
+ * Return: SUCCEED/FAIL
+ *
*-------------------------------------------------------------------------
*/
-static int
-create_file(hid_t fapl, hid_t *file, H5F_t **f)
+static herr_t
+create_file(hid_t fapl_id, hid_t *fid, H5F_t **f)
{
/* Create the file to work on */
- if((*file = H5Fcreate(filename_g, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- FAIL_STACK_ERROR
+ if ((*fid = H5Fcreate(filename_g, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
- FAIL_STACK_ERROR
+ if (NULL == (*f = (H5F_t *)H5I_object(*fid)))
+ FAIL_STACK_ERROR;
/* Ignore metadata tags in the file's cache */
- if(H5AC_ignore_tags(*f) < 0)
- FAIL_STACK_ERROR
+ if (H5AC_ignore_tags(*f) < 0)
+ FAIL_STACK_ERROR;
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* create_file() */
/*-------------------------------------------------------------------------
- * Function: check_stats
+ * Function: check_stats
*
- * Purpose: Verify stats for a fixed array
+ * Purpose: Verify stats for a fixed array
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
check_stats(const H5FA_t *fa, const farray_state_t *state)
{
H5FA_stat_t farray_stats; /* Statistics about the array */
/* Get statistics for fixed array and verify they are correct */
- if(H5FA_get_stats(fa, &farray_stats) < 0)
+ if (H5FA_get_stats(fa, &farray_stats) < 0)
FAIL_STACK_ERROR
/* Compare information */
- if(farray_stats.hdr_size != state->hdr_size) {
+ if (farray_stats.hdr_size != state->hdr_size) {
HDfprintf(stdout, "farray_stats.hdr_size = %Hu, state->hdr_size = %Hu\n",
farray_stats.hdr_size, state->hdr_size);
TEST_ERROR
- } /* end if */
+ }
- if(farray_stats.dblk_size != state->dblk_size) {
+ if (farray_stats.dblk_size != state->dblk_size) {
HDfprintf(stdout, "farray_stats.dblk_size = %Hu, state->dblk_size = %Hu\n",
farray_stats.dblk_size, state->dblk_size);
TEST_ERROR
- } /* end if */
+ }
- if(farray_stats.nelmts != state->nelmts) {
+ if (farray_stats.nelmts != state->nelmts) {
HDfprintf(stdout, "farray_stats.nelmts = %Hu, state->nelmts = %Hu\n",
farray_stats.nelmts, state->nelmts);
TEST_ERROR
- } /* end if */
+ }
- /* All tests passed */
- return(0);
+ /* Success */
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* check_stats() */
/*-------------------------------------------------------------------------
- * Function: set_fa_state
- *
- * Purpose: Set the state of the Fixed Array
+ * Function: set_fa_state
*
- * Return: does not fail
+ * Purpose: Set the state of the Fixed Array
*
- * Programmer: Vailin Choi; 5th August, 2009
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
set_fa_state(const H5FA_create_t *cparam, farray_state_t *state)
{
size_t dblk_page_nelmts; /* # of elements per page */
@@ -241,190 +236,190 @@ set_fa_state(const H5FA_create_t *cparam, farray_state_t *state)
state->nelmts = cparam->nelmts;
dblk_page_nelmts = (size_t)1 << cparam->max_dblk_page_nelmts_bits;
- if(state->nelmts > dblk_page_nelmts) {
- size_t npages = (size_t)(((state->nelmts + dblk_page_nelmts) - 1) / dblk_page_nelmts);
- size_t dblk_page_init_size = (npages + 7) / 8;
- hsize_t checksum_size = npages * 4;
+ if (state->nelmts > dblk_page_nelmts) {
+ size_t npages = (size_t)(((state->nelmts + dblk_page_nelmts) - 1) / dblk_page_nelmts);
+ size_t dblk_page_init_size = (npages + 7) / 8;
+ hsize_t checksum_size = npages * 4;
- state->dblk_size = DBLOCK_PREFIX + dblk_page_init_size + checksum_size +
+ state->dblk_size = DBLOCK_PREFIX + dblk_page_init_size + checksum_size +
state->nelmts * cparam->raw_elmt_size;
- } else
- state->dblk_size = DBLOCK_PREFIX + state->nelmts * cparam->raw_elmt_size;
+ }
+ else
+ state->dblk_size = DBLOCK_PREFIX + state->nelmts * cparam->raw_elmt_size;
- return(0);
+ return SUCCEED;
} /* end set_fa_state() */
/*-------------------------------------------------------------------------
- * Function: reopen_file
+ * Function: reopen_file
*
- * Purpose: Perform common "re-open" operations on file & array for testing
+ * Purpose: Perform common "re-open" operations on file & array for testing
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
static int
-reopen_file(hid_t *file, H5F_t **f, hid_t fapl,
+reopen_file(hid_t *fid, H5F_t **f, hid_t fapl_id,
H5FA_t **fa, haddr_t fa_addr, const farray_test_param_t *tparam)
{
/* Check for closing & re-opening the array */
/* (actually will close & re-open the file as well) */
- if(tparam->reopen_array) {
+ if (tparam->reopen_array) {
+
/* Close array, if given */
- if(fa && *fa) {
- if(H5FA_close(*fa) < 0)
+ if (fa && *fa) {
+ if (H5FA_close(*fa) < 0)
FAIL_STACK_ERROR
*fa = NULL;
- } /* end if */
+ }
/* Close file */
- if(*file) {
- if(H5Fclose(*file) < 0)
+ if (*fid) {
+ if (H5Fclose(*fid) < 0)
FAIL_STACK_ERROR
- *file = (-1);
+ *fid = H5I_INVALID_HID;
*f = NULL;
- } /* end if */
+ }
/* Re-open the file */
- if((*file = H5Fopen(filename_g, H5F_ACC_RDWR, fapl)) < 0)
+ if ((*fid = H5Fopen(filename_g, H5F_ACC_RDWR, fapl_id)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
- FAIL_STACK_ERROR
+ if (NULL == (*f = (H5F_t *)H5I_object(*fid)))
+ FAIL_STACK_ERROR;
/* Ignore metadata tags in the file's cache */
- if(H5AC_ignore_tags(*f) < 0)
+ if (H5AC_ignore_tags(*f) < 0)
FAIL_STACK_ERROR
/* Re-open array, if given */
- if(fa)
- if(NULL == (*fa = H5FA_open(*f, fa_addr, NULL)))
+ if (fa)
+ if (NULL == (*fa = H5FA_open(*f, fa_addr, NULL)))
FAIL_STACK_ERROR
- } /* end if */
+ }
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* reopen_file() */
/*-------------------------------------------------------------------------
- * Function: create_array
+ * Function: create_array
*
- * Purpose: Create a fixed array and perform initial checks
+ * Purpose: Create a fixed array and perform initial checks
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
create_array(H5F_t *f, const H5FA_create_t *cparam,
H5FA_t **fa, haddr_t *fa_addr)
{
farray_state_t state; /* State of extensible array */
/* Create array */
- if(NULL == (*fa = H5FA_create(f, cparam, NULL)))
+ if (NULL == (*fa = H5FA_create(f, cparam, NULL)))
FAIL_STACK_ERROR
/* Check status of array */
- if(H5FA_get_addr(*fa, fa_addr) < 0)
+ if (H5FA_get_addr(*fa, fa_addr) < 0)
FAIL_STACK_ERROR
- if(!H5F_addr_defined(*fa_addr))
+ if (!H5F_addr_defined(*fa_addr))
TEST_ERROR
+
+ /* Check array stats */
HDmemset(&state, 0, sizeof(state));
- state.hdr_size = FA_HDR_SIZE;
- state.nelmts = cparam->nelmts;
- if(check_stats(*fa, &state))
+ state.hdr_size = FA_HDR_SIZE;
+ state.nelmts = cparam->nelmts;
+ if (check_stats(*fa, &state))
TEST_ERROR
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* create_array() */
/*-------------------------------------------------------------------------
- * Function: verify_cparam
+ * Function: verify_cparam
*
- * Purpose: Verify creation parameters are correct
+ * Purpose: Verify creation parameters are correct
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
verify_cparam(const H5FA_t *fa, const H5FA_create_t *cparam)
{
H5FA_create_t test_cparam; /* Creation parameters for array */
/* Retrieve creation parameters */
HDmemset(&test_cparam, 0, sizeof(H5FA_create_t));
- if(H5FA_get_cparam_test(fa, &test_cparam) < 0)
+ if (H5FA_get_cparam_test(fa, &test_cparam) < 0)
FAIL_STACK_ERROR
/* Verify creation parameters */
- if(H5FA_cmp_cparam_test(cparam, &test_cparam))
+ if (H5FA_cmp_cparam_test(cparam, &test_cparam))
TEST_ERROR
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* verify_cparam() */
/*-------------------------------------------------------------------------
- * Function: finish
+ * Function: finish
*
- * Purpose: Close array, delete array, close file and verify that file
+ * Purpose: Close array, delete array, close file and verify that file
* is empty size
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
-finish(hid_t file, hid_t fapl, H5F_t *f, H5FA_t *fa, haddr_t fa_addr)
+static herr_t
+finish(hid_t fid, hid_t fapl_id, H5F_t *f, H5FA_t *fa, haddr_t fa_addr)
{
h5_stat_size_t file_size; /* File size, after deleting array */
/* Close the fixed array */
- if(H5FA_close(fa) < 0)
+ if (H5FA_close(fa) < 0)
FAIL_STACK_ERROR
/* Delete array */
- if(H5FA_delete(f, fa_addr, NULL) < 0)
+ if (H5FA_delete(f, fa_addr, NULL) < 0)
FAIL_STACK_ERROR
/* Close the file */
- if(H5Fclose(file) < 0)
+ if (H5Fclose(fid) < 0)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename_g, fapl)) < 0)
+ if ((file_size = h5_get_file_size(filename_g, fapl_id)) < 0)
TEST_ERROR
/* Verify the file is correct size */
- if(file_size != empty_size_g)
+ if (file_size != empty_size_g)
TEST_ERROR
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* finish() */
@@ -627,66 +622,64 @@ error:
*-------------------------------------------------------------------------
*/
static unsigned
-test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
+test_open_twice(hid_t fapl_id, H5FA_create_t *cparam, farray_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- hid_t file2 = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- H5F_t *f2 = NULL; /* Internal file object pointer */
- H5FA_t *fa = NULL; /* Fixed array wrapper */
- H5FA_t *fa2 = NULL; /* Fixed array wrapper */
- haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fid2 = H5I_INVALID_HID; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ H5F_t *f2 = NULL; /* Internal file object pointer */
+ H5FA_t *fa = NULL; /* Fixed array wrapper */
+ H5FA_t *fa2 = NULL; /* Fixed array wrapper */
+ haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */
/* Create file & retrieve pointer to internal file object */
- if(create_file(fapl, &file, &f) < 0)
+ if (create_file(fapl_id, &fid, &f) < 0)
TEST_ERROR
- /*
- * Display testing message
- */
+ /* Display testing message */
TESTING("open fixed array twice");
/* Create array */
- if(create_array(f, cparam, &fa, &fa_addr) < 0)
+ if (create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Open the array again, through the first file handle */
- if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
+ if (NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
- if(verify_cparam(fa, cparam) < 0)
+ if (verify_cparam(fa, cparam) < 0)
TEST_ERROR
- if(verify_cparam(fa2, cparam) < 0)
+ if (verify_cparam(fa2, cparam) < 0)
TEST_ERROR
/* Close the second fixed array wrapper */
- if(H5FA_close(fa2) < 0)
+ if (H5FA_close(fa2) < 0)
FAIL_STACK_ERROR
fa2 = NULL;
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0)
+ if (reopen_file(&fid, &f, fapl_id, &fa, fa_addr, tparam) < 0)
TEST_ERROR
/* Re-open the file */
- if((file2 = H5Freopen(file)) < 0)
+ if ((fid2 = H5Freopen(fid)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
- FAIL_STACK_ERROR
+ if (NULL == (f2 = (H5F_t *)H5I_object(fid2)))
+ FAIL_STACK_ERROR;
/* Open the fixed array through the second file handle */
- if(NULL == (fa2 = H5FA_open(f2, fa_addr, NULL)))
+ if (NULL == (fa2 = H5FA_open(f2, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
- if(verify_cparam(fa, cparam) < 0)
+ if (verify_cparam(fa, cparam) < 0)
TEST_ERROR
/* Close the first extensible array wrapper */
- if(H5FA_close(fa) < 0)
+ if (H5FA_close(fa) < 0)
FAIL_STACK_ERROR
fa = NULL;
@@ -694,11 +687,11 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
/* (close before second file, to detect error on internal array header's
* shared file information)
*/
- if(H5Fclose(file) < 0)
+ if (H5Fclose(fid) < 0)
FAIL_STACK_ERROR
/* Close array, delete array, close file & verify file is empty */
- if(finish(file2, fapl, f2, fa2, fa_addr) < 0)
+ if (finish(fid2, fapl_id, f2, fa2, fa_addr) < 0)
TEST_ERROR
/* All tests passed */
@@ -708,12 +701,12 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
error:
H5E_BEGIN_TRY {
- if(fa)
+ if (fa)
H5FA_close(fa);
- if(fa2)
+ if (fa2)
H5FA_close(fa2);
- H5Fclose(file);
- H5Fclose(file2);
+ H5Fclose(fid);
+ H5Fclose(fid2);
} H5E_END_TRY;
return 1;
@@ -736,44 +729,42 @@ error:
*-------------------------------------------------------------------------
*/
static unsigned
-test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
+test_open_twice_diff(hid_t fapl_id, H5FA_create_t *cparam, farray_test_param_t *tparam)
{
- char filename_tmp[FARRAY_FILENAME_LEN]; /* Temporary file name */
- hid_t file = -1; /* File ID */
- hid_t file2 = -1; /* File ID */
- hid_t file0 = -1; /* File ID */
- hid_t file00 = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- H5F_t *f2 = NULL; /* Internal file object pointer */
- H5FA_t *fa = NULL; /* Fixed array wrapper */
- H5FA_t *fa2 = NULL; /* Fixed array wrapper */
- haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */
-
- /*
- * Display testing message
- */
+ char filename_tmp[FARRAY_FILENAME_LEN]; /* Temporary file name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fid2 = H5I_INVALID_HID; /* File ID */
+ hid_t fid0 = H5I_INVALID_HID; /* File ID */
+ hid_t fid00 = H5I_INVALID_HID; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ H5F_t *f2 = NULL; /* Internal file object pointer */
+ H5FA_t *fa = NULL; /* Fixed array wrapper */
+ H5FA_t *fa2 = NULL; /* Fixed array wrapper */
+ haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */
+
+ /* Display testing message */
TESTING("open fixed array twice, through different file handles");
/* Create file & retrieve pointer to internal file object */
- if(create_file(fapl, &file, &f) < 0)
+ if (create_file(fapl_id, &fid, &f) < 0)
TEST_ERROR
/* Create array */
- if(create_array(f, cparam, &fa, &fa_addr) < 0)
+ if (create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Open the array again, through the first file handle */
- if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
+ if (NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
- if(verify_cparam(fa, cparam) < 0)
+ if (verify_cparam(fa, cparam) < 0)
TEST_ERROR
- if(verify_cparam(fa2, cparam) < 0)
+ if (verify_cparam(fa2, cparam) < 0)
TEST_ERROR
/* Close the second fixed array wrapper */
- if(H5FA_close(fa2) < 0)
+ if (H5FA_close(fa2) < 0)
FAIL_STACK_ERROR
fa2 = NULL;
@@ -781,15 +772,15 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
/* (So that there is something holding the file open when the extensible
* array is closed)
*/
- if((file0 = H5Fopen(filename_g, H5F_ACC_RDWR, fapl)) < 0)
+ if ((fid0 = H5Fopen(filename_g, H5F_ACC_RDWR, fapl_id)) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0)
+ if (reopen_file(&fid, &f, fapl_id, &fa, fa_addr, tparam) < 0)
TEST_ERROR
/* Close the first fixed array wrapper */
- if(H5FA_close(fa) < 0)
+ if (H5FA_close(fa) < 0)
FAIL_STACK_ERROR
fa = NULL;
@@ -797,44 +788,43 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
/* (close before second file, to detect error on internal array header's
* shared file information)
*/
- if(H5Fclose(file) < 0)
+ if (H5Fclose(fid) < 0)
FAIL_STACK_ERROR
- file = -1;
+ fid = H5I_INVALID_HID;
/* Open a different file */
/* (This re-allocates the 'top' file pointer and assigns it a different
* 'shared' file pointer, making the file pointer in the fixed array's
* header stale)
*/
- h5_fixname(FILENAME[1], fapl, filename_tmp, sizeof(filename_tmp));
- if((file00 = H5Fcreate(filename_tmp, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ h5_fixname(FILENAME[1], fapl_id, filename_tmp, sizeof(filename_tmp));
+ if ((fid00 = H5Fcreate(filename_tmp, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
FAIL_STACK_ERROR
-
/* Re-open the file with the fixed array */
- if((file2 = H5Fopen(filename_g, H5F_ACC_RDWR, fapl)) < 0)
+ if ((fid2 = H5Fopen(filename_g, H5F_ACC_RDWR, fapl_id)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
- FAIL_STACK_ERROR
+ if (NULL == (f2 = (H5F_t *)H5I_object(fid2)))
+ FAIL_STACK_ERROR;
/* Open the fixed array through the second file handle */
- if(NULL == (fa2 = H5FA_open(f2, fa_addr, NULL)))
+ if (NULL == (fa2 = H5FA_open(f2, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
- if(verify_cparam(fa2, cparam) < 0)
+ if (verify_cparam(fa2, cparam) < 0)
TEST_ERROR
/* Close the extra file handles */
- if(H5Fclose(file0) < 0)
+ if (H5Fclose(fid0) < 0)
FAIL_STACK_ERROR
- if(H5Fclose(file00) < 0)
+ if (H5Fclose(fid00) < 0)
FAIL_STACK_ERROR
/* Close array, delete array, close file & verify file is empty */
- if(finish(file2, fapl, f2, fa2, fa_addr) < 0)
+ if (finish(fid2, fapl_id, f2, fa2, fa_addr) < 0)
TEST_ERROR
/* All tests passed */
@@ -844,14 +834,14 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
error:
H5E_BEGIN_TRY {
- if(fa)
+ if (fa)
H5FA_close(fa);
- if(fa2)
+ if (fa2)
H5FA_close(fa2);
- H5Fclose(file);
- H5Fclose(file2);
- H5Fclose(file0);
- H5Fclose(file00);
+ H5Fclose(fid);
+ H5Fclose(fid2);
+ H5Fclose(fid0);
+ H5Fclose(fid00);
} H5E_END_TRY;
return 1;
@@ -966,7 +956,7 @@ error:
H5FA_close(fa);
if(fa2)
H5FA_close(fa2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
@@ -1666,7 +1656,7 @@ main(void)
fapl = h5_fileaccess();
ExpressMode = GetTestExpress();
if(ExpressMode > 1)
- printf("***Express test mode on. Some tests may be skipped\n");
+ HDprintf("***Express test mode on. Some tests may be skipped\n");
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g));
@@ -1706,12 +1696,12 @@ main(void)
switch(curr_test) {
/* "Normal" testing parameters */
case FARRAY_TEST_NORMAL:
- puts("Testing with NORMAL PARAMETERS");
+ HDputs("Testing with NORMAL PARAMETERS");
break;
/* "Re-open array" testing parameters */
case FARRAY_TEST_REOPEN:
- puts("Testing with reopen array flag set");
+ HDputs("Testing with reopen array flag set");
tparam.reopen_array = FARRAY_TEST_REOPEN;
break;
@@ -1738,25 +1728,25 @@ main(void)
switch(curr_iter) {
/* "Forward" testing parameters */
case FARRAY_ITER_FW:
- puts("Testing with forward iteration");
+ HDputs("Testing with forward iteration");
tparam.fiter = &fa_iter_fw;
break;
/* "Reverse" testing parameters */
case FARRAY_ITER_RV:
- puts("Testing with reverse iteration");
+ HDputs("Testing with reverse iteration");
tparam.fiter = &fa_iter_rv;
break;
/* "Random" testing parameters */
case FARRAY_ITER_RND:
- puts("Testing with random iteration");
+ HDputs("Testing with random iteration");
tparam.fiter = &fa_iter_rnd;
break;
/* "Cyclic" testing parameters */
case FARRAY_ITER_CYC:
- puts("Testing with cyclic iteration");
+ HDputs("Testing with cyclic iteration");
tparam.fiter = &fa_iter_cyc;
break;
@@ -1772,22 +1762,26 @@ main(void)
nerrors += test_set_elmts(fapl, &cparam, &tparam, (hsize_t)tparam.nelmts, "setting all the array elements");
} /* end for */
- /* Check skipping elements */
+ /* Check skipping elements */
nerrors += test_skip_elmts(fapl, &cparam, &tparam, (hsize_t)1, TRUE, "skipping to first element");
nerrors += test_skip_elmts(fapl, &cparam, &tparam, ((hsize_t)1 << cparam.max_dblk_page_nelmts_bits), TRUE, "skipping to first element in data block page");
nerrors += test_skip_elmts(fapl, &cparam, &tparam, (hsize_t)(tparam.nelmts - 1), TRUE, "skipping to last element");
- /* Create Fixed Array of MAX_NELMTS elements */
- /*
- * MAX_NELMTS succeeds on jam and smirom.
- * The value was adjusted for linew due to the following:
- Linew failed with "H5FD_sec2_truncate(): unable to extend file properly"
- Linew failed with "H5FD_sec2_truncate(): File too large"
- */
+ /* Create Fixed Array */
+ /* MAX_NELMTS succeeds on some platforms buy may fail on others:
+ *
+ * "H5FD_sec2_truncate(): unable to extend file properly"
+ *
+ * and
+ *
+ * "H5FD_sec2_truncate(): File too large"
+ *
+ * have both been seen.
+ */
tparam.nelmts = MAX_NELMTS/17;
- init_cparam(&cparam, &tparam);
+ init_cparam(&cparam, &tparam);
- /* Set the last element in the Fixed Array */
+ /* Set the last element in the Fixed Array */
nerrors += test_skip_elmts(fapl, &cparam, &tparam, (hsize_t)(tparam.nelmts - 1), FALSE, "skipping to last element");
} /* end for */
@@ -1800,22 +1794,22 @@ main(void)
if(nerrors)
goto error;
- puts("All fixed array tests passed.");
+ HDputs("All fixed array tests passed.");
/* Clean up file used */
h5_cleanup(FILENAME, fapl);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
- H5Pclose(fapl);
+ H5Pclose(fapl);
} H5E_END_TRY;
if(api_ctx_pushed) H5CX_pop();
- return 1;
+ HDexit(EXIT_FAILURE);
} /* end main() */
diff --git a/test/fheap.c b/test/fheap.c
index e38d263..3ef6206 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -30,9 +30,9 @@
/* Other private headers that this test requires */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Iprivate.h" /* IDs */
+#include "H5VMprivate.h" /* Vectors and arrays */
/* Max. testfile name length */
#define FHEAP_FILENAME_LEN 1024
@@ -539,6 +539,14 @@ get_fill_size(const fheap_test_param_t *tparam)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * test_desc in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static int
begin_test(fheap_test_param_t *tparam, const char *base_desc,
fheap_heap_ids_t *keep_ids, size_t *fill_size)
@@ -567,6 +575,7 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc,
/* Success */
return(0);
} /* end begin_test() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
@@ -683,6 +692,7 @@ open_heap(char *filename, hid_t fapl, const H5HF_create_t *cparam,
/* Close (empty) heap */
if(H5HF_close(*fh) < 0)
FAIL_STACK_ERROR
+ *fh = NULL;
} /* end if */
/* Close file */
@@ -759,6 +769,7 @@ reopen_heap(H5F_t *f, H5HF_t **fh, haddr_t fh_addr,
/* Close (empty) heap */
if(H5HF_close(*fh) < 0)
FAIL_STACK_ERROR
+ *fh = NULL;
/* Re-open heap */
if(NULL == (*fh = H5HF_open(f, fh_addr)))
@@ -766,10 +777,10 @@ reopen_heap(H5F_t *f, H5HF_t **fh, haddr_t fh_addr,
} /* end if */
/* Success */
- return(0);
+ return 0;
error:
- return(-1);
+ return -1;
} /* end reopen_heap() */
@@ -1906,6 +1917,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Delete heap */
if(H5HF_delete(f, fh_addr) < 0)
@@ -1926,15 +1938,15 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* All tests passed */
PASSED()
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_create() */
@@ -2020,6 +2032,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Check for closing & re-opening the file */
if(tparam->reopen_heap) {
@@ -2083,7 +2096,7 @@ error:
H5E_BEGIN_TRY {
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_reopen() */
@@ -2250,7 +2263,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* All tests passed */
PASSED()
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
@@ -2258,11 +2271,11 @@ error:
H5HF_close(fh);
if(fh2)
H5HF_close(fh2);
- H5Fclose(file);
- H5Fclose(file2);
+ H5Fclose(file);
+ H5Fclose(file2);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_open_twice() */
@@ -2366,6 +2379,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
if(fh2) {
/* Close opened heap */
H5HF_close(fh2);
+ fh2 = NULL;
/* Indicate error */
TEST_ERROR
@@ -2403,6 +2417,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
if(fh) {
/* Close opened heap */
H5HF_close(fh);
+ fh = NULL;
/* Indicate error */
TEST_ERROR
@@ -2423,7 +2438,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* All tests passed */
PASSED()
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
@@ -2431,9 +2446,9 @@ error:
H5HF_close(fh);
if(fh2)
H5HF_close(fh2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_delete_open() */
@@ -2769,15 +2784,15 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* All tests passed */
PASSED()
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_id_limits() */
@@ -2878,6 +2893,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Close the file */
@@ -2891,15 +2907,15 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* All tests passed */
PASSED()
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_filtered_create() */
@@ -3022,7 +3038,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
-
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -3031,15 +3047,15 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* All tests passed */
PASSED()
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_size() */
@@ -6645,6 +6661,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
TEST_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -6836,6 +6853,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
TEST_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -7003,6 +7021,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -7241,6 +7260,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
TEST_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -7543,6 +7563,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
TEST_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -7599,7 +7620,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
unsigned char heap_id[100][MAX_HEAP_ID_LEN]; /* Heap ID for object inserted */
struct a_type_t1 {
char a[10];
- char b[29];
+ char b[40];
} obj1, obj2; /* Objects to insert/remove */
size_t id_len; /* Size of fractal heap IDs */
fheap_heap_state_t state; /* State of fractal heap */
@@ -7640,14 +7661,14 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
*/
TESTING("incremental object insertion and removal")
+ HDmemset(&obj1, 0, sizeof(obj1));
+ HDmemset(&obj2, 0, sizeof(obj2));
for(i = 0; i < 100; i++) {
- HDsprintf(obj1.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i);
-
for(j = 0; j < i; j++) {
- HDsprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j);
-
if(H5HF_remove(fh, heap_id[j]) < 0)
FAIL_STACK_ERROR
+
+ HDsprintf(obj2.b, "%s%2d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j);
if(H5HF_insert(fh, (sizeof(obj2)), &obj2, heap_id[j]) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -7658,6 +7679,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
/* Insert object */
HDmemset(heap_id[i], 0, id_len);
+ HDsprintf(obj1.b, "%s%2d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i);
if(H5HF_insert(fh, (sizeof(obj1)), &obj1, heap_id[i]) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -13685,15 +13707,15 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
H5HF_create_t tmp_cparam; /* Local heap creation parameters */
fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */
size_t id_len; /* Size of fractal heap IDs */
- h5_stat_size_t empty_size; /* Size of a file with an empty heap */
- h5_stat_size_t file_size; /* Size of file currently */
+ h5_stat_size_t empty_size; /* Size of a file with an empty heap */
+ h5_stat_size_t file_size; /* Size of file currently */
unsigned char *heap_id = NULL; /* Heap ID for object */
size_t obj_size; /* Size of object */
size_t robj_size; /* Size of object read */
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
unsigned deflate_level; /* Deflation level */
- size_t old_actual_id_len =0 ; /* Old actual ID length */
+ size_t old_actual_id_len = 0; /* Old actual ID length */
hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */
const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */
@@ -15572,7 +15594,7 @@ error:
H5MM_xfree(keep_ids.offs);
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_random() */
diff --git a/test/file_image.c b/test/file_image.c
index 12f0a18..3249c83 100644
--- a/test/file_image.c
+++ b/test/file_image.c
@@ -671,6 +671,14 @@ error:
*
******************************************************************************
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'member_file_name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static int
test_get_file_image(const char * test_banner,
const int file_name_num,
@@ -937,6 +945,7 @@ test_get_file_image(const char * test_banner,
error:
return 1;
} /* end test_get_file_image() */
+#pragma GCC diagnostic pop
/******************************************************************************
diff --git a/test/filenotclosed.c b/test/filenotclosed.c
index 2c5c8dc..2d050eb 100644
--- a/test/filenotclosed.c
+++ b/test/filenotclosed.c
@@ -35,7 +35,7 @@
*/
static void catch_signal(int H5_ATTR_UNUSED signo)
{
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* catch_signal() */
diff --git a/test/fill18.h5 b/test/fill18.h5
new file mode 100644
index 0000000..c092f59
--- /dev/null
+++ b/test/fill18.h5
Binary files differ
diff --git a/test/fillval.c b/test/fillval.c
index 8c8e902..0454bde 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -15,7 +15,7 @@
* Programmer: Robb Matzke <robb@arborea.spizella.com>
* Thursday, October 1, 1998
*
- * Purpose: Tests dataset fill values.
+ * Purpose: Tests dataset fill values.
*/
#include "h5test.h"
#include "H5srcdir.h"
@@ -59,9 +59,9 @@ typedef struct {
* for version 1.4(after 1.4.3). To get this data file, simply compile
* gen_old_fill.c with HDF5 library (before v1.5) and run it. */
#define FILE_COMPATIBLE "fill_old.h5"
-#define FILE_NAME_RAW "fillval.raw"
+#define FILE_NAME_RAW "fillval.raw"
+
-
/*-------------------------------------------------------------------------
* Function: create_compound_type
*
@@ -91,7 +91,7 @@ static hid_t create_compound_type(void)
if(H5Tinsert(ret_value, "y", HOFFSET(comp_datatype, y), H5T_NATIVE_DOUBLE) < 0)
goto error;
if(H5Tinsert(ret_value, "z", HOFFSET(comp_datatype, z), H5T_NATIVE_CHAR) < 0)
- goto error;
+ goto error;
return ret_value;
@@ -102,7 +102,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_compound_vl_type
*
@@ -146,18 +146,18 @@ error:
return -1;
} /* end create_compound_vl_type() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_getset
+ * Function: test_getset
*
- * Purpose: Tests the H5Pget_fill_value() and H5Pset_fill_value()
- * functions.
+ * Purpose: Tests the H5Pget_fill_value() and H5Pset_fill_value()
+ * functions.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, October 1, 1998
*
* Modifications:
@@ -167,15 +167,15 @@ error:
static int
test_getset(void)
{
- hid_t dcpl=-1;
- int fill_i;
- hid_t type_ss=-1, type_si=-1;
+ hid_t dcpl=-1;
+ int fill_i;
+ hid_t type_ss=-1, type_si=-1;
struct fill_si {
- int v1, v2;
- } fill_si;
+ int v1, v2;
+ } fill_si;
struct fill_ss {
- short v1, v2;
- } fill_ss, fill_ss_rd;
+ short v1, v2;
+ } fill_ss, fill_ss_rd;
TESTING("property lists");
@@ -185,18 +185,18 @@ test_getset(void)
*/
if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if((type_ss=H5Tcreate(H5T_COMPOUND, sizeof fill_ss)) < 0 ||
- H5Tinsert(type_ss, "v1", HOFFSET(struct fill_ss, v1),
- H5T_NATIVE_SHORT) < 0 ||
- H5Tinsert(type_ss, "v2", HOFFSET(struct fill_ss, v2),
- H5T_NATIVE_SHORT) < 0) {
- goto error;
+ H5Tinsert(type_ss, "v1", HOFFSET(struct fill_ss, v1),
+ H5T_NATIVE_SHORT) < 0 ||
+ H5Tinsert(type_ss, "v2", HOFFSET(struct fill_ss, v2),
+ H5T_NATIVE_SHORT) < 0) {
+ goto error;
}
if((type_si=H5Tcreate(H5T_COMPOUND, sizeof fill_si)) < 0 ||
- H5Tinsert(type_si, "v1", HOFFSET(struct fill_si, v1),
- H5T_NATIVE_INT) < 0 ||
- H5Tinsert(type_si, "v2", HOFFSET(struct fill_si, v2),
- H5T_NATIVE_INT) < 0) {
- goto error;
+ H5Tinsert(type_si, "v1", HOFFSET(struct fill_si, v1),
+ H5T_NATIVE_INT) < 0 ||
+ H5Tinsert(type_si, "v2", HOFFSET(struct fill_si, v2),
+ H5T_NATIVE_INT) < 0) {
+ goto error;
}
/*
@@ -204,12 +204,12 @@ test_getset(void)
* no fill value should result in a failure.
*/
H5E_BEGIN_TRY {
- H5Pget_fill_value(dcpl, H5T_NATIVE_INT, &fill_i);
+ H5Pget_fill_value(dcpl, H5T_NATIVE_INT, &fill_i);
} H5E_END_TRY;
if(fill_i != 0) {
- H5_FAILED();
- puts(" H5Pget_fill_value() should return default 0");
- goto error;
+ H5_FAILED();
+ puts(" H5Pget_fill_value() should return default 0");
+ goto error;
}
/*
@@ -224,10 +224,10 @@ test_getset(void)
*/
if(H5Pget_fill_value(dcpl, type_ss, &fill_ss_rd) < 0) goto error;
if(fill_ss.v1!=fill_ss_rd.v1 || fill_ss.v2!=fill_ss_rd.v2) {
- H5_FAILED();
- puts(" Failed to get fill value using same data type that was ");
- puts(" used to set the fill value.");
- goto error;
+ H5_FAILED();
+ puts(" Failed to get fill value using same data type that was ");
+ puts(" used to set the fill value.");
+ goto error;
}
/*
@@ -235,10 +235,10 @@ test_getset(void)
*/
if(H5Pget_fill_value(dcpl, type_si, &fill_si) < 0) goto error;
if(fill_ss.v1!=fill_si.v1 || fill_ss.v2!=fill_si.v2) {
- H5_FAILED();
- puts(" Failed to get fill value using a data type other than what");
- puts(" was used to set the fill value.");
- goto error;
+ H5_FAILED();
+ puts(" Failed to get fill value using a data type other than what");
+ puts(" was used to set the fill value.");
+ goto error;
}
/*
@@ -247,9 +247,9 @@ test_getset(void)
if(H5Pset_fill_value(dcpl, type_si, &fill_si) < 0) goto error;
if(H5Pget_fill_value(dcpl, type_ss, &fill_ss) < 0) goto error;
if(fill_si.v1!=fill_ss.v1 || fill_si.v2!=fill_ss.v2) {
- H5_FAILED();
- puts(" Resetting the fill value was unsuccessful.");
- goto error;
+ H5_FAILED();
+ puts(" Resetting the fill value was unsuccessful.");
+ goto error;
}
/* Success */
@@ -261,24 +261,24 @@ test_getset(void)
error:
H5E_BEGIN_TRY {
- H5Pclose(dcpl);
- H5Tclose(type_si);
- H5Tclose(type_ss);
+ H5Pclose(dcpl);
+ H5Tclose(type_si);
+ H5Tclose(type_ss);
} H5E_END_TRY;
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_getset_vl
+ * Function: test_getset_vl
*
- * Purpose: Tests the H5Pget_fill_value() and H5Pset_fill_value()
- * functions, using variable-length datatype.
+ * Purpose: Tests the H5Pget_fill_value() and H5Pset_fill_value()
+ * functions, using variable-length datatype.
*
- * Return: Success: 0
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, May 31, 2007
*
*-------------------------------------------------------------------------
@@ -362,47 +362,47 @@ test_getset_vl(hid_t fapl)
return 1;
} /* end test_getset_vl() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_create
+ * Function: test_create
*
- * Purpose: Tests creating datasets that have fill values.
+ * Purpose: Tests creating datasets that have fill values.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, October 1, 1998
*
* Modifications:
- * Many new cases have been added to this test since
- * the fill value design has been modified.
+ * Many new cases have been added to this test since
+ * the fill value design has been modified.
*
*-------------------------------------------------------------------------
*/
static int
test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
{
- hid_t file=-1, space=-1, dcpl=-1, comp_type_id=-1;
- hid_t dset1=-1, dset2=-1, dset3=-1, dset4=-1, dset5=-1,
- dset6=-1, /* dset7=-1, */ dset8=-1, dset9=-1;
+ hid_t file=-1, space=-1, dcpl=-1, comp_type_id=-1;
+ hid_t dset1=-1, dset2=-1, dset3=-1, dset4=-1, dset5=-1,
+ dset6=-1, /* dset7=-1, */ dset8=-1, dset9=-1;
hsize_t cur_size[5] = {2, 8, 8, 4, 2};
- hsize_t ch_size[5] = {1, 1, 1, 4, 1};
- short rd_s, fill_s = 0x1234;
- long rd_l, fill_l = 0x4321;
- char filename[1024];
- H5D_space_status_t allocation;
+ hsize_t ch_size[5] = {1, 1, 1, 4, 1};
+ short rd_s, fill_s = 0x1234;
+ long rd_l, fill_l = 0x4321;
+ char filename[1024];
+ H5D_space_status_t allocation;
H5D_alloc_time_t alloc_time;
- H5D_fill_time_t fill_time;
+ H5D_fill_time_t fill_time;
comp_datatype rd_c, fill_ctype;
if(H5D_CHUNKED==layout) {
- TESTING("chunked dataset creation");
+ TESTING("chunked dataset creation");
} else if(H5D_COMPACT==layout) {
TESTING("compact dataset creation");
} else {
- TESTING("contiguous dataset creation");
+ TESTING("contiguous dataset creation");
}
/*
@@ -410,11 +410,11 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
*/
h5_fixname(base_name, fapl, filename, sizeof filename);
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if((space=H5Screate_simple(5, cur_size, cur_size)) < 0) goto error;
if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5D_CHUNKED==layout) {
- if(H5Pset_chunk(dcpl, 5, ch_size) < 0) goto error;
+ if(H5Pset_chunk(dcpl, 5, ch_size) < 0) goto error;
} else if(H5D_COMPACT==layout) {
if(H5Pset_layout(dcpl, H5D_COMPACT) < 0) goto error;
}
@@ -444,21 +444,21 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(H5Pset_fill_value(dcpl, H5T_NATIVE_SHORT, &fill_s) < 0) goto error;
#endif
if((dset1=H5Dcreate2(file, "dset1", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
/* 3. Large to small fill conversion */
#ifndef NO_FILLING
if(H5Pset_fill_value(dcpl, H5T_NATIVE_LONG, &fill_l) < 0) goto error;
#endif
if((dset2=H5Dcreate2(file, "dset2", H5T_NATIVE_SHORT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
/* 4. No conversion */
#ifndef NO_FILLING
if(H5Pset_fill_value(dcpl, H5T_NATIVE_LONG, &fill_l) < 0) goto error;
#endif
if((dset3=H5Dcreate2(file, "dset3", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
/* 5. late space allocation and never write fill value */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error;
@@ -504,7 +504,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
/* 3. Write fill value at space allocation time */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error;
if((dset6 = H5Dcreate2(file, "dset6", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
/* 4. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC.
* Supposed to fail. */
@@ -531,7 +531,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
/* Open the file and get the dataset fill value from each dataset */
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
- goto error;
+ goto error;
/* I. Check cases for late space allocation except compact dataset */
if(H5D_COMPACT != layout) {
@@ -541,10 +541,10 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
#ifndef NO_FILLING
if(H5Pget_fill_value(dcpl, H5T_NATIVE_SHORT, &rd_s) < 0) goto error;
if(rd_s != fill_s) {
- H5_FAILED();
- printf(" %d: Got a different fill value than what was set.",__LINE__);
- printf(" Got %d, set %d\n", rd_s, fill_s);
- goto error;
+ H5_FAILED();
+ HDprintf(" %d: Got a different fill value than what was set.",__LINE__);
+ HDprintf(" Got %d, set %d\n", rd_s, fill_s);
+ goto error;
}
#endif
if(H5Dclose(dset1) < 0) goto error;
@@ -556,10 +556,10 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
#ifndef NO_FILLING
if(H5Pget_fill_value(dcpl, H5T_NATIVE_LONG, &rd_l) < 0) goto error;
if(rd_l!=fill_l) {
- H5_FAILED();
- printf(" %d: Got a different fill value than what was set.",__LINE__);
- printf(" Got %ld, set %ld\n", rd_l, fill_l);
- goto error;
+ H5_FAILED();
+ HDprintf(" %d: Got a different fill value than what was set.",__LINE__);
+ HDprintf(" Got %ld, set %ld\n", rd_l, fill_l);
+ goto error;
}
#endif
if(H5Dclose(dset2) < 0) goto error;
@@ -571,10 +571,10 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
#ifndef NO_FILLING
if(H5Pget_fill_value(dcpl, H5T_NATIVE_LONG, &rd_l) < 0) goto error;
if(rd_l != fill_l) {
- H5_FAILED();
- printf(" %d: Got a different fill value than what was set.",__LINE__);
- printf(" Got %ld, set %ld\n", rd_l, fill_l);
- goto error;
+ H5_FAILED();
+ HDprintf(" %d: Got a different fill value than what was set.",__LINE__);
+ HDprintf(" Got %ld, set %ld\n", rd_l, fill_l);
+ goto error;
}
#endif
if(H5Pget_alloc_time(dcpl, &alloc_time) < 0) goto error;
@@ -582,12 +582,12 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(alloc_time != H5D_ALLOC_TIME_LATE) {
H5_FAILED();
puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time.");
- printf(" Got %d\n", alloc_time);
+ HDprintf(" Got %d\n", alloc_time);
}
if(fill_time != H5D_FILL_TIME_ALLOC) {
H5_FAILED();
puts(" Got non-H5D_FILL_TIME_ALLOC fill value write time.");
- printf(" Got %d\n", fill_time);
+ HDprintf(" Got %d\n", fill_time);
}
if(H5Dclose(dset3) < 0) goto error;
if(H5Pclose(dcpl) < 0) goto error;
@@ -598,21 +598,21 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED) {
H5_FAILED();
puts(" Got allocated space instead of unallocated.");
- printf(" Got %d\n", allocation);
+ HDprintf(" Got %d\n", allocation);
goto error;
}
if((dcpl = H5Dget_create_plist(dset4)) < 0) goto error;
if(H5Pget_alloc_time(dcpl, &alloc_time) < 0) goto error;
if(H5Pget_fill_time(dcpl, &fill_time) < 0) goto error;
if(alloc_time != H5D_ALLOC_TIME_LATE) {
- H5_FAILED();
- puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time.");
- printf(" Got %d\n", alloc_time);
+ H5_FAILED();
+ puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time.");
+ HDprintf(" Got %d\n", alloc_time);
}
if(fill_time != H5D_FILL_TIME_NEVER) {
- H5_FAILED();
- puts(" Got non-H5D_FILL_TIME_NEVER fill value write time.");
- printf(" Got %d\n", fill_time);
+ H5_FAILED();
+ puts(" Got non-H5D_FILL_TIME_NEVER fill value write time.");
+ HDprintf(" Got %d\n", fill_time);
}
if(H5Dclose(dset4) < 0) goto error;
if(H5Pclose(dcpl) < 0) goto error;
@@ -624,7 +624,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(!H5_FLT_ABS_EQUAL(rd_c.a, 0) || !H5_DBL_ABS_EQUAL(rd_c.y, fill_ctype.y) || rd_c.x != 0 || rd_c.z != '\0') {
H5_FAILED();
puts(" Got wrong fill value");
- printf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n",
+ HDprintf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n",
(double)rd_c.a, rd_c.y, rd_c.x, rd_c.z);
}
if(H5Dclose(dset9) < 0) goto error;
@@ -639,21 +639,21 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(H5Dget_space_status(dset5, &allocation) < 0) goto error;
if(layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_ALLOCATED) {
H5_FAILED();
- printf(" %d: Got unallocated space instead of allocated.\n",__LINE__);
- printf(" Got %d\n", allocation);
+ HDprintf(" %d: Got unallocated space instead of allocated.\n",__LINE__);
+ HDprintf(" Got %d\n", allocation);
goto error;
}
if(H5Pget_alloc_time(dcpl, &alloc_time) < 0) goto error;
if(alloc_time != H5D_ALLOC_TIME_EARLY) {
H5_FAILED();
puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time.");
- printf(" Got %d\n", alloc_time);
+ HDprintf(" Got %d\n", alloc_time);
}
if(H5Pget_fill_time(dcpl, &fill_time) < 0) goto error;
if(fill_time != H5D_FILL_TIME_NEVER) {
H5_FAILED();
puts(" Got non-H5D_FILL_TIME_NEVER fill value write time.");
- printf(" Got %d\n", fill_time);
+ HDprintf(" Got %d\n", fill_time);
}
if(H5Dclose(dset5) < 0) goto error;
if(H5Pclose(dcpl) < 0) goto error;
@@ -664,28 +664,28 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(H5Dget_space_status(dset6, &allocation) < 0) goto error;
if(layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_ALLOCATED) {
H5_FAILED();
- printf(" %d: Got unallocated space instead of allocated.\n",__LINE__);
- printf(" Got %d\n", allocation);
+ HDprintf(" %d: Got unallocated space instead of allocated.\n",__LINE__);
+ HDprintf(" Got %d\n", allocation);
goto error;
}
if(H5Pget_fill_value(dcpl, H5T_NATIVE_LONG, &rd_l) < 0) goto error;
if(rd_l != fill_l) {
H5_FAILED();
- printf(" %d: Got a different fill value than what was set.",__LINE__);
- printf(" Got %ld, set %ld\n", rd_l, fill_l);
+ HDprintf(" %d: Got a different fill value than what was set.",__LINE__);
+ HDprintf(" Got %ld, set %ld\n", rd_l, fill_l);
goto error;
}
if(H5Pget_alloc_time(dcpl, &alloc_time) < 0) goto error;
if(alloc_time != H5D_ALLOC_TIME_EARLY) {
H5_FAILED();
puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time.");
- printf(" Got %d\n", alloc_time);
+ HDprintf(" Got %d\n", alloc_time);
}
if(H5Pget_fill_time(dcpl, &fill_time) < 0) goto error;
if(fill_time != H5D_FILL_TIME_ALLOC) {
H5_FAILED();
puts(" Got non-H5D_FILL_TIME_ALLOC fill value write time.");
- printf(" Got %d\n", fill_time);
+ HDprintf(" Got %d\n", fill_time);
}
if(H5Dclose(dset6) < 0) goto error;
if(H5Pclose(dcpl) < 0) goto error;
@@ -697,8 +697,8 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(!H5_FLT_ABS_EQUAL(rd_c.a, 0) || !H5_DBL_ABS_EQUAL(rd_c.y, fill_ctype.y) || rd_c.x != 0 || rd_c.z != '\0') {
H5_FAILED();
puts(" Got wrong fill value");
- printf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n",
- (double)rd_c.a, rd_c.y, rd_c.x, rd_c.z);
+ HDprintf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n",
+ (double)rd_c.a, rd_c.y, rd_c.x, rd_c.z);
}
if(H5Dclose(dset8) < 0) goto error;
if(H5Pclose(dcpl) < 0) goto error;
@@ -710,67 +710,69 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
error:
H5E_BEGIN_TRY {
- H5Pclose(dcpl);
- H5Sclose(space);
+ H5Pclose(dcpl);
+ H5Sclose(space);
if(H5D_COMPACT != layout) {
- H5Dclose(dset1);
- H5Dclose(dset2);
- H5Dclose(dset3);
+ H5Dclose(dset1);
+ H5Dclose(dset2);
+ H5Dclose(dset3);
H5Dclose(dset4);
H5Dclose(dset9);
}
H5Dclose(dset5);
H5Dclose(dset6);
- H5Dclose(dset8);
- H5Fclose(file);
+ H5Dclose(dset8);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
}
/*-------------------------------------------------------------------------
- * Function: test_rdwr_cases
+ * Function: test_rdwr_cases
*
- * Purpose: Tests fill values read and write for datasets.
+ * Purpose: Tests fill values read and write for datasets.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, October 1, 1998
*
* Modifications:
- * This function is called by test_rdwr to write and read
- * dataset for different cases.
+ * This function is called by test_rdwr to write and read
+ * dataset for different cases.
*
*-------------------------------------------------------------------------
*/
static int
test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
- H5D_fill_time_t fill_time, H5D_layout_t layout,
- H5T_class_t datatype, hid_t ctype_id)
+ H5D_fill_time_t fill_time, H5D_layout_t layout,
+ H5T_class_t datatype, hid_t ctype_id)
{
- hid_t fspace=-1, mspace=-1, dset1=-1, dset2=-1;
- hsize_t cur_size[5] = {2, 8, 8, 4, 2};
- hsize_t one[5] = {1, 1, 1, 1, 1};
- hsize_t hs_size[5], hs_stride[5];
- hsize_t hs_offset[5], nelmts;
- int fillval=(-1), val_rd, should_be;
- int i, j, *buf=NULL, odd;
+ hid_t fspace=-1, mspace=-1, dset1=-1, dset2=-1;
+ hsize_t cur_size[5] = {2, 8, 8, 4, 2};
+ hsize_t one[5] = {1, 1, 1, 1, 1};
+ hsize_t hs_size[5], hs_stride[5];
+ hsize_t hs_offset[5], nelmts;
+ int fillval=(-1), val_rd, should_be;
+ int i, j, *buf=NULL, odd;
unsigned u;
comp_datatype rd_c, fill_c, should_be_c;
- comp_datatype *buf_c=NULL;
+ comp_datatype *buf_c=NULL;
H5D_space_status_t allocation;
- if(datatype==H5T_INTEGER)
+ if(datatype == H5T_INTEGER) {
fillval = *(int*)_fillval;
- else if(datatype==H5T_COMPOUND) {
- fill_c.a=((comp_datatype*)_fillval)->a;
+ }
+ else if(datatype == H5T_COMPOUND) {
+ fill_c.a=((comp_datatype*)_fillval)->a;
fill_c.x=((comp_datatype*)_fillval)->x;
fill_c.y=((comp_datatype*)_fillval)->y;
fill_c.z=((comp_datatype*)_fillval)->z;
- } else {
- puts("Invalid type for test");
+ }
+ else {
+ HDputs("Invalid type for test");
goto error;
}
@@ -786,27 +788,28 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
if((mspace = H5Screate_simple(5, one, NULL)) < 0)
goto error;
for (i=0; i<1000; i++) {
- for (j=0; j<5; j++)
- hs_offset[j] = (hsize_t)HDrand() % cur_size[j];
- if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL,
- one, NULL) < 0) goto error;
+ for (j=0; j<5; j++)
+ hs_offset[j] = (hsize_t)HDrand() % cur_size[j];
+ if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL,
+ one, NULL) < 0) goto error;
- /* case for atomic datatype */
- if(datatype==H5T_INTEGER) {
+ /* case for atomic datatype */
+ if(datatype==H5T_INTEGER) {
if(H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT,
- &val_rd) < 0) goto error;
- if(fill_time!=H5D_FILL_TIME_NEVER && val_rd!=fillval) {
- H5_FAILED();
+ &val_rd) < 0) goto error;
+ if(fill_time!=H5D_FILL_TIME_NEVER && val_rd!=fillval) {
+ H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
- HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, "
- "Fill value: %u\n",
- hs_offset[0], hs_offset[1],
- hs_offset[2], hs_offset[3],
- hs_offset[4], val_rd, fillval);
- goto error;
- }
- /* case for compound datatype */
- } else if(datatype==H5T_COMPOUND) {
+ HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, "
+ "Fill value: %u\n",
+ hs_offset[0], hs_offset[1],
+ hs_offset[2], hs_offset[3],
+ hs_offset[4], val_rd, fillval);
+ goto error;
+ }
+ /* case for compound datatype */
+ }
+ else if(datatype==H5T_COMPOUND) {
if(H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT,
&rd_c) < 0) goto error;
if(fill_time != H5D_FILL_TIME_NEVER && (!H5_FLT_ABS_EQUAL(rd_c.a, fill_c.a) ||
@@ -819,7 +822,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
hs_offset[0], hs_offset[1],
hs_offset[2], hs_offset[3],
hs_offset[4], (double)rd_c.a, rd_c.x, rd_c.y, rd_c.z,
- (double)fill_c.a, fill_c.x, fill_c.y, fill_c.z);
+ (double)fill_c.a, fill_c.x, fill_c.y, fill_c.z);
goto error;
}
}
@@ -828,10 +831,10 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
/* Select all odd data locations in the file dataset */
for (i=0, nelmts=1; i<5; i++) {
- hs_size[i] = cur_size[i]/2;
- hs_offset[i] = 0;
- hs_stride[i] = 2;
- nelmts *= hs_size[i];
+ hs_size[i] = cur_size[i]/2;
+ hs_offset[i] = 0;
+ hs_stride[i] = 2;
+ nelmts *= hs_size[i];
}
if((mspace=H5Screate_simple(5, hs_size, hs_size)) < 0) goto error;
if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, hs_stride,
@@ -868,8 +871,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
else if(datatype == H5T_COMPOUND) {
/*check for overflow*/
HDassert((nelmts * sizeof(comp_datatype)) ==
- (hsize_t)((size_t)(nelmts * sizeof(comp_datatype))));
- buf_c = (comp_datatype *)HDmalloc((size_t)nelmts * sizeof(comp_datatype));
+ (hsize_t)((size_t)(nelmts * sizeof(comp_datatype))));
+ buf_c = (comp_datatype *)HDmalloc((size_t)nelmts * sizeof(comp_datatype));
if(H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, buf_c) < 0)
goto error;
@@ -907,24 +910,24 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
else if(datatype == H5T_COMPOUND) {
HDmemset(buf_c, 0, ((size_t)nelmts * sizeof(comp_datatype)));
for(u = 0; u < nelmts; u++) {
- buf_c[u].a = 1111.11F;
- buf_c[u].x = 2222;
- buf_c[u].y = 3333.3333F;
- buf_c[u].z = 'd';
- }
+ buf_c[u].a = 1111.11F;
+ buf_c[u].x = 2222;
+ buf_c[u].y = 3333.3333F;
+ buf_c[u].z = 'd';
+ }
if(H5Dwrite(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, buf_c) < 0)
goto error;
}
/* Check if space is allocated */
if(datatype==H5T_INTEGER && H5Dget_space_status(dset1, &allocation) < 0)
- goto error;
+ goto error;
if(datatype==H5T_COMPOUND && H5Dget_space_status(dset2, &allocation) < 0)
goto error;
if(layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_ALLOCATED) {
H5_FAILED();
- printf(" %d: Got unallocated space instead of allocated.\n",__LINE__);
- printf(" Got %d\n", allocation);
+ HDprintf(" %d: Got unallocated space instead of allocated.\n",__LINE__);
+ HDprintf(" Got %d\n", allocation);
goto error;
}
HDfree(buf);
@@ -935,86 +938,86 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
if((mspace = H5Screate_simple(5, one, NULL)) < 0)
goto error;
for(i = 0; i < 1000; i++) {
- for(j = 0, odd = 0; j < 5; j++) {
- hs_offset[j] = (hsize_t)HDrand() % cur_size[j];
- odd += (int)(hs_offset[j]%2);
- } /* end for */
- if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
+ for(j = 0, odd = 0; j < 5; j++) {
+ hs_offset[j] = (hsize_t)HDrand() % cur_size[j];
+ odd += (int)(hs_offset[j]%2);
+ } /* end for */
+ if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
goto error;
- /* case for atomic datatype */
+ /* case for atomic datatype */
if(datatype==H5T_INTEGER) {
- if(H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, &val_rd) < 0)
+ if(H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, &val_rd) < 0)
goto error;
if(fill_time == H5D_FILL_TIME_ALLOC) {
should_be = odd ? fillval : 9999;
if(val_rd!=should_be) {
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not correct.\n", (unsigned)__LINE__);
- printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, "
+ HDprintf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, "
"should be: %u\n",
(long)hs_offset[0], (long)hs_offset[1],
(long)hs_offset[2], (long)hs_offset[3],
(long)hs_offset[4], val_rd, should_be);
goto error;
}
- }
- else if(fill_time == H5D_FILL_TIME_NEVER && !odd) {
- should_be = 9999;
- if(val_rd!=should_be) {
- H5_FAILED();
+ }
+ else if(fill_time == H5D_FILL_TIME_NEVER && !odd) {
+ should_be = 9999;
+ if(val_rd!=should_be) {
+ H5_FAILED();
HDfprintf(stdout, "%u: Value read was not correct.\n", (unsigned)__LINE__);
- printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, "
- "should be: %u\n",
- (long)hs_offset[0], (long)hs_offset[1],
- (long)hs_offset[2], (long)hs_offset[3],
- (long)hs_offset[4], val_rd, should_be);
- goto error;
- }
- } else if(fill_time == H5D_FILL_TIME_NEVER && odd) {
- /*Trash data. Don't compare*/
- }
- } /* end for datatype==H5T_INTEGER */
- /* case for compound datatype */
- else if(datatype==H5T_COMPOUND) {
+ HDprintf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, "
+ "should be: %u\n",
+ (long)hs_offset[0], (long)hs_offset[1],
+ (long)hs_offset[2], (long)hs_offset[3],
+ (long)hs_offset[4], val_rd, should_be);
+ goto error;
+ }
+ } else if(fill_time == H5D_FILL_TIME_NEVER && odd) {
+ /*Trash data. Don't compare*/
+ }
+ } /* end for datatype==H5T_INTEGER */
+ /* case for compound datatype */
+ else if(datatype==H5T_COMPOUND) {
if(H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, &rd_c) < 0)
goto error;
if(fill_time == H5D_FILL_TIME_ALLOC) {
- if(odd) {
- should_be_c.a=fill_c.a;
- should_be_c.x=fill_c.x;
- should_be_c.y=fill_c.y;
- should_be_c.z=fill_c.z;
- } else {
- should_be_c.a=buf_c[0].a;
- should_be_c.x=buf_c[0].x;
- should_be_c.y=buf_c[0].y;
- should_be_c.z=buf_c[0].z;
- }
- if(!H5_FLT_ABS_EQUAL(rd_c.a, should_be_c.a) || rd_c.x != should_be_c.x ||
- !H5_DBL_ABS_EQUAL(rd_c.y, should_be_c.y) || rd_c.z != should_be_c.z) {
+ if(odd) {
+ should_be_c.a=fill_c.a;
+ should_be_c.x=fill_c.x;
+ should_be_c.y=fill_c.y;
+ should_be_c.z=fill_c.z;
+ } else {
+ should_be_c.a=buf_c[0].a;
+ should_be_c.x=buf_c[0].x;
+ should_be_c.y=buf_c[0].y;
+ should_be_c.z=buf_c[0].z;
+ }
+ if(!H5_FLT_ABS_EQUAL(rd_c.a, should_be_c.a) || rd_c.x != should_be_c.x ||
+ !H5_DBL_ABS_EQUAL(rd_c.y, should_be_c.y) || rd_c.z != should_be_c.z) {
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not correct.\n", (unsigned)__LINE__);
- printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %f,%d,%f,%c "
+ HDprintf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %f,%d,%f,%c "
"should be: %f,%d,%f,%c\n",
(long)hs_offset[0], (long)hs_offset[1],
(long)hs_offset[2], (long)hs_offset[3],
(long)hs_offset[4],
- (double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, (double)should_be_c.a,
- should_be_c.x,should_be_c.y,should_be_c.z);
+ (double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, (double)should_be_c.a,
+ should_be_c.x,should_be_c.y,should_be_c.z);
goto error;
- }
- } /* end for fill_time == H5D_FILL_TIME_ALLOC */
- else if(fill_time == H5D_FILL_TIME_NEVER && !odd) {
+ }
+ } /* end for fill_time == H5D_FILL_TIME_ALLOC */
+ else if(fill_time == H5D_FILL_TIME_NEVER && !odd) {
should_be_c.a=buf_c[0].a;
should_be_c.x=buf_c[0].x;
should_be_c.y=buf_c[0].y;
should_be_c.z=buf_c[0].z;
- if(!H5_FLT_ABS_EQUAL(rd_c.a, should_be_c.a) || rd_c.x != should_be_c.x ||
- !H5_DBL_ABS_EQUAL(rd_c.y, should_be_c.y) || rd_c.z != should_be_c.z) {
+ if(!H5_FLT_ABS_EQUAL(rd_c.a, should_be_c.a) || rd_c.x != should_be_c.x ||
+ !H5_DBL_ABS_EQUAL(rd_c.y, should_be_c.y) || rd_c.z != should_be_c.z) {
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not correct.\n", (unsigned)__LINE__);
- printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %f,%d,%f,%c "
+ HDprintf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %f,%d,%f,%c "
"should be: %f,%d,%f,%c\n",
(long)hs_offset[0], (long)hs_offset[1],
(long)hs_offset[2], (long)hs_offset[3],
@@ -1023,11 +1026,11 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
should_be_c.x,should_be_c.y,should_be_c.z);
goto error;
}
- } /* end for fill_time == H5D_FILL_TIME_NEVER */
+ } /* end for fill_time == H5D_FILL_TIME_NEVER */
else if(fill_time == H5D_FILL_TIME_NEVER && odd) {
/*Trash data. Don't compare*/
}
- } /* end for datatype==H5T_COMPOUND */
+ } /* end for datatype==H5T_COMPOUND */
}
if(datatype == H5T_COMPOUND) {
HDfree(buf_c);
@@ -1042,16 +1045,16 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
error:
H5E_BEGIN_TRY {
- if(datatype==H5T_INTEGER) H5Dclose(dset1);
- if(datatype==H5T_COMPOUND) H5Dclose(dset2);
- H5Sclose(fspace);
- H5Sclose(mspace);
+ if(datatype==H5T_INTEGER) H5Dclose(dset1);
+ if(datatype==H5T_COMPOUND) H5Dclose(dset2);
+ H5Sclose(fspace);
+ H5Sclose(mspace);
} H5E_END_TRY;
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_rdwr
*
@@ -1065,8 +1068,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
* Thursday, October 1, 1998
*
* Modifications:
- * Many new cases have been added to this test since the
- * fill value design is modified.
+ * Many new cases have been added to this test since the
+ * fill value design is modified.
*
*-------------------------------------------------------------------------
*/
@@ -1074,9 +1077,9 @@ static int
test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout)
{
char filename[1024];
- hid_t file=-1, dcpl=-1, ctype_id=-1;
+ hid_t file=-1, dcpl=-1, ctype_id=-1;
hsize_t ch_size[5] = {2, 8, 8, 4, 2};
- int nerrors=0;
+ int nerrors=0;
int fillval = 0x4c70f1cd;
comp_datatype fill_ctype={0,0,0,0};
@@ -1089,17 +1092,23 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout)
}
h5_fixname(base_name, fapl, filename, sizeof filename);
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if(H5D_CHUNKED==layout) {
- if(H5Pset_chunk(dcpl, 5, ch_size) < 0) goto error;
- } else if(H5D_COMPACT==layout) {
- if(H5Pset_layout(dcpl, H5D_COMPACT) < 0) goto error;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+
+ if(H5D_CHUNKED == layout) {
+ if(H5Pset_chunk(dcpl, 5, ch_size) < 0)
+ goto error;
+ }
+ else if(H5D_COMPACT == layout) {
+ if(H5Pset_layout(dcpl, H5D_COMPACT) < 0)
+ goto error;
}
- if((ctype_id=create_compound_type()) < 0) goto error;
+ if((ctype_id = create_compound_type()) < 0)
+ goto error;
/* I. Test H5D_ALLOC_TIME_LATE space allocation cases */
if(H5D_COMPACT != layout) {
@@ -1145,7 +1154,7 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout)
fill_ctype.y = 4444.4444F;
if(H5Pset_fill_value(dcpl, ctype_id, &fill_ctype) < 0) goto error;
nerrors += test_rdwr_cases(file, dcpl, "dset11", &fill_ctype, H5D_FILL_TIME_ALLOC,
- layout, H5T_COMPOUND, ctype_id);
+ layout, H5T_COMPOUND, ctype_id);
if(H5Pclose(dcpl) < 0) goto error;
if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
@@ -1202,7 +1211,7 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(nerrors)
- goto error;
+ goto error;
if(H5Pclose(dcpl) < 0) goto error;
if(H5Tclose(ctype_id) < 0) goto error;
if(H5Fclose(file) < 0) goto error;
@@ -1212,22 +1221,22 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout)
error:
H5E_BEGIN_TRY {
H5Pclose(dcpl);
- H5Tclose(ctype_id);
+ H5Tclose(ctype_id);
H5Fclose(file);
} H5E_END_TRY;
return nerrors;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_extend_init_integer
+ * Function: test_extend_init_integer
*
- * Purpose: Initializes integer values
+ * Purpose: Initializes integer values
*
- * Return: Success: 0
- * Failure: < 0
+ * Return: Success: 0
+ * Failure: < 0
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 3, 2007
*
*-------------------------------------------------------------------------
@@ -1246,16 +1255,16 @@ test_extend_init_integer(void *_buf, size_t nelmts, const void *_val)
return 0;
} /* end test_extend_init_integer() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_extend_verify_integer
+ * Function: test_extend_verify_integer
*
- * Purpose: Verifies integer values
+ * Purpose: Verifies integer values
*
- * Return: Success: 0
- * Failure: < 0
+ * Return: Success: 0
+ * Failure: < 0
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 3, 2007
*
*-------------------------------------------------------------------------
@@ -1284,16 +1293,16 @@ error:
return -1;
} /* end test_extend_verify_integer() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_extend_release_integer
+ * Function: test_extend_release_integer
*
- * Purpose: Release element of integer value
+ * Purpose: Release element of integer value
*
- * Return: Success: 0
- * Failure: < 0
+ * Return: Success: 0
+ * Failure: < 0
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 3, 2007
*
*-------------------------------------------------------------------------
@@ -1304,16 +1313,16 @@ test_extend_release_integer(void H5_ATTR_UNUSED *_elmt)
return 0;
} /* end test_extend_release_integer() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_extend_init_cmpd_vl
+ * Function: test_extend_init_cmpd_vl
*
- * Purpose: Initializes compound+vl values
+ * Purpose: Initializes compound+vl values
*
- * Return: Success: 0
- * Failure: < 0
+ * Return: Success: 0
+ * Failure: < 0
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 3, 2007
*
*-------------------------------------------------------------------------
@@ -1339,16 +1348,16 @@ test_extend_init_cmpd_vl(void *_buf, size_t nelmts, const void *_val)
return 0;
} /* end test_extend_init_cmpd_vl() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_extend_verify_cmpd_vl
+ * Function: test_extend_verify_cmpd_vl
*
- * Purpose: Verifies compound+vl values
+ * Purpose: Verifies compound+vl values
*
- * Return: Success: 0
- * Failure: < 0
+ * Return: Success: 0
+ * Failure: < 0
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 3, 2007
*
*-------------------------------------------------------------------------
@@ -1380,16 +1389,16 @@ error:
return -1;
} /* end test_extend_verify_cmpd_vl() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_extend_release_cmpd_vl
+ * Function: test_extend_release_cmpd_vl
*
- * Purpose: Release element of compound+vl value
+ * Purpose: Release element of compound+vl value
*
- * Return: Success: 0
- * Failure: < 0
+ * Return: Success: 0
+ * Failure: < 0
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 3, 2007
*
*-------------------------------------------------------------------------
@@ -1406,16 +1415,16 @@ test_extend_release_cmpd_vl(void *_elmt)
return 0;
} /* end test_extend_release_integer() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_extend_cases
+ * Function: test_extend_cases
*
- * Purpose: Called to test fill values with various different values
+ * Purpose: Called to test fill values with various different values
*
- * Return: Success: 0
- * Failure: number of errors
+ * Return: Success: 0
+ * Failure: number of errors
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 3, 2007
*
*-------------------------------------------------------------------------
@@ -1424,13 +1433,13 @@ static int
test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
hsize_t *ch_size, hsize_t *start_size, hsize_t *max_size, hid_t dtype, void *fillval)
{
- hid_t fspace = -1, mspace = -1; /* File & memory dataspaces */
- hid_t dset = -1; /* Dataset ID */
+ hid_t fspace = -1, mspace = -1; /* File & memory dataspaces */
+ hid_t dset = -1; /* Dataset ID */
hid_t dcpl = -1; /* Dataset creation property list */
- hsize_t extend_size[5]; /* Dimensions to extend to */
- hsize_t one[5] = {1, 1, 1, 1, 1}; /* Dimensions of single element dataspace */
- hsize_t hs_size[5], hs_stride[5], hs_offset[5];
- size_t nelmts;
+ hsize_t extend_size[5]; /* Dimensions to extend to */
+ hsize_t one[5] = {1, 1, 1, 1, 1}; /* Dimensions of single element dataspace */
+ hsize_t hs_size[5], hs_stride[5], hs_offset[5];
+ size_t nelmts;
H5T_class_t dtype_class; /* Class of datatype */
int (*init_rtn)(void *, size_t, const void *);
int (*verify_rtn)(unsigned, const hsize_t *, const void *, const void *);
@@ -1438,12 +1447,12 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
size_t val_size; /* Size of element */
void *val_rd, *odd_val;
const void *init_val, *should_be, *even_val;
- int val_rd_i, init_val_i = 9999;
+ int val_rd_i, init_val_i = 9999;
comp_vl_datatype init_val_c = {87, "baz", "mumble", 129};
comp_vl_datatype val_rd_c;
- void *buf = NULL;
- unsigned odd; /* Whether an odd or even coord. was read */
- unsigned i, j; /* Local index variables */
+ void *buf = NULL;
+ unsigned odd; /* Whether an odd or even coord. was read */
+ unsigned i, j; /* Local index variables */
/* Make copy of dataset creation property list */
if((dcpl = H5Pcopy(_dcpl)) < 0) TEST_ERROR
@@ -1494,14 +1503,14 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
if((mspace = H5Screate_simple(5, one, NULL)) < 0) TEST_ERROR
for(i = 0; i < 1000; i++) {
/* Set offset for random element */
- for(j = 0; j < 5; j++)
- hs_offset[j] = (hsize_t)HDrand() % start_size[j];
+ for(j = 0; j < 5; j++)
+ hs_offset[j] = (hsize_t)HDrand() % start_size[j];
/* Select the random element */
- if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR
+ if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR
/* Read the random element */
- if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Verify the element read in */
if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, fillval) < 0) TEST_ERROR
@@ -1517,10 +1526,10 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
/* Initialize dataspace & hyperslab info */
for(i = 0, nelmts = 1; i < 5; i++) {
- hs_size[i] = (start_size[i] + 1) / 2;
- hs_offset[i] = 0;
- hs_stride[i] = 2;
- nelmts *= hs_size[i];
+ hs_size[i] = (start_size[i] + 1) / 2;
+ hs_offset[i] = 0;
+ hs_stride[i] = 2;
+ nelmts *= hs_size[i];
} /* end for */
/* Check for overflow */
@@ -1547,19 +1556,19 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
if((mspace = H5Screate_simple(5, one, NULL)) < 0) TEST_ERROR
for(i = 0; i < 1000; i++) {
/* Set offset for random element */
- for(j = 0, odd = 0; j < 5; j++) {
- hs_offset[j] = (hsize_t)HDrand() % start_size[j];
- odd += (unsigned)(hs_offset[j] % 2);
- } /* end for */
+ for(j = 0, odd = 0; j < 5; j++) {
+ hs_offset[j] = (hsize_t)HDrand() % start_size[j];
+ odd += (unsigned)(hs_offset[j] % 2);
+ } /* end for */
/* Select the random element */
- if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR
+ if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR
/* Read the random element */
- if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Verify the element read in */
- should_be = odd ? odd_val : even_val;
+ should_be = odd ? odd_val : even_val;
if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0) TEST_ERROR
/* Release any VL components */
@@ -1585,22 +1594,22 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
if((mspace = H5Screate_simple(5, one, NULL)) < 0) TEST_ERROR
for(i = 0; i < 1000; i++) {
/* Set offset for random element */
- for(j = 0, odd = 0; j < 5; j++) {
- hs_offset[j] = (hsize_t)HDrand() % extend_size[j];
- if(hs_offset[j] >= start_size[j])
- odd = 1;
- else
- odd += (unsigned)(hs_offset[j] % 2);
- } /* end for */
+ for(j = 0, odd = 0; j < 5; j++) {
+ hs_offset[j] = (hsize_t)HDrand() % extend_size[j];
+ if(hs_offset[j] >= start_size[j])
+ odd = 1;
+ else
+ odd += (unsigned)(hs_offset[j] % 2);
+ } /* end for */
/* Select the random element */
- if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR
+ if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR
/* Read the random element */
- if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Verify the element read in */
- should_be = odd ? odd_val : even_val;
+ should_be = odd ? odd_val : even_val;
if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0) TEST_ERROR
/* Release any VL components */
@@ -1624,22 +1633,22 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
if((mspace = H5Screate_simple(5, one, NULL)) < 0) TEST_ERROR
for(i = 0; i < 1000; i++) {
/* Set offset for random element */
- for(j = 0, odd = 0; j < 5; j++) {
- hs_offset[j] = (hsize_t)HDrand() % max_size[j];
- if(hs_offset[j] >= start_size[j])
- odd = 1;
- else
- odd += (unsigned)(hs_offset[j] % 2);
- } /* end for */
+ for(j = 0, odd = 0; j < 5; j++) {
+ hs_offset[j] = (hsize_t)HDrand() % max_size[j];
+ if(hs_offset[j] >= start_size[j])
+ odd = 1;
+ else
+ odd += (unsigned)(hs_offset[j] % 2);
+ } /* end for */
/* Select the random element */
- if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR
+ if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR
/* Read the random element */
- if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Verify the element read in */
- should_be = odd ? odd_val : even_val;
+ should_be = odd ? odd_val : even_val;
if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0) TEST_ERROR
/* Release any VL components */
@@ -1665,22 +1674,22 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
if((mspace = H5Screate_simple(5, one, NULL)) < 0) TEST_ERROR
for(i = 0; i < 1000; i++) {
/* Set offset for random element */
- for(j = 0, odd = 0; j < 5; j++) {
- hs_offset[j] = (hsize_t)HDrand() % extend_size[j];
- if(hs_offset[j] >= start_size[j])
- odd = 1;
- else
- odd += (unsigned)(hs_offset[j] % 2);
- } /* end for */
+ for(j = 0, odd = 0; j < 5; j++) {
+ hs_offset[j] = (hsize_t)HDrand() % extend_size[j];
+ if(hs_offset[j] >= start_size[j])
+ odd = 1;
+ else
+ odd += (unsigned)(hs_offset[j] % 2);
+ } /* end for */
/* Select the random element */
- if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR
+ if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR
/* Read the random element */
- if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Verify the element read in */
- should_be = odd ? odd_val : even_val;
+ should_be = odd ? odd_val : even_val;
if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0) TEST_ERROR
/* Release any VL components */
@@ -1758,22 +1767,22 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
/* Read some data and make sure it's the right value */
for(i = 0; i < 1000; i++) {
/* Set offset for random element */
- for(j = 0, odd = 0; j < 5; j++) {
- hs_offset[j] = (hsize_t)HDrand() % extend_size[j];
- if(hs_offset[j] >= start_size[j])
- odd = 1;
- else
- odd += (unsigned)(hs_offset[j] % 2);
- } /* end for */
+ for(j = 0, odd = 0; j < 5; j++) {
+ hs_offset[j] = (hsize_t)HDrand() % extend_size[j];
+ if(hs_offset[j] >= start_size[j])
+ odd = 1;
+ else
+ odd += (unsigned)(hs_offset[j] % 2);
+ } /* end for */
/* Select the random element */
- if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR
+ if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0) TEST_ERROR
/* Read the random element */
- if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Verify the element read in */
- should_be = odd ? odd_val : even_val;
+ should_be = odd ? odd_val : even_val;
if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0) TEST_ERROR
/* Release any VL components */
@@ -1802,26 +1811,26 @@ error:
if(buf)
HDfree(buf);
H5E_BEGIN_TRY {
- H5Pclose(dcpl);
- H5Dclose(dset);
- H5Sclose(fspace);
- H5Sclose(mspace);
+ H5Pclose(dcpl);
+ H5Dclose(dset);
+ H5Sclose(fspace);
+ H5Sclose(mspace);
} H5E_END_TRY;
return -1;
} /* end test_extend_cases() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_extend
+ * Function: test_extend
*
- * Purpose: Test that filling works okay when a dataset is extended.
+ * Purpose: Test that filling works okay when a dataset is extended.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, October 5, 1998
*
* Modifications:
@@ -1831,30 +1840,30 @@ error:
static int
test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
{
- hid_t file = -1; /* File ID */
- hid_t dcpl = -1; /* Dataset creation property list ID */
- hid_t cmpd_vl_tid = -1; /* Compound+vl datatype ID */
- hsize_t start_size[5] = {8, 8, 8, 4, 2};
- hsize_t max_size[5] = {32, 32, 32, 16, 8};
- hsize_t ch_size[5] = {1, 8, 8, 4, 2};
+ hid_t file = -1; /* File ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t cmpd_vl_tid = -1; /* Compound+vl datatype ID */
+ hsize_t start_size[5] = {8, 8, 8, 4, 2};
+ hsize_t max_size[5] = {32, 32, 32, 16, 8};
+ hsize_t ch_size[5] = {1, 8, 8, 4, 2};
#ifdef NO_FILLING
- int fillval_i = 0;
+ int fillval_i = 0;
#else
- int fillval_i = 0x4c70f1cd;
+ int fillval_i = 0x4c70f1cd;
#endif
comp_vl_datatype fillval_c = {32, "foo", "bar", 64}; /* Fill value for compound+vl datatype tests */
- char filename[1024];
+ char filename[1024];
/* Print testing message */
if(H5D_CHUNKED == layout)
- TESTING("chunked dataset extend")
+ TESTING("chunked dataset extend")
else
- TESTING("contiguous dataset extend")
+ TESTING("contiguous dataset extend")
/* Create dataset creation property list */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
if(H5D_CHUNKED == layout)
- if(H5Pset_chunk(dcpl, 5, ch_size) < 0) TEST_ERROR
+ if(H5Pset_chunk(dcpl, 5, ch_size) < 0) TEST_ERROR
#if 1
/*
@@ -1868,13 +1877,13 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
* below.
*/
if(H5D_CONTIGUOUS==layout) {
- max_size[0] = (max_size[0] * max_size[1] * max_size[2] *
- max_size[3] * max_size[4]) /
- (start_size[1] * start_size[2] * start_size[3] * start_size[4]);
- max_size[1] = start_size[1];
- max_size[2] = start_size[2];
- max_size[3] = start_size[3];
- max_size[4] = start_size[4];
+ max_size[0] = (max_size[0] * max_size[1] * max_size[2] *
+ max_size[3] * max_size[4]) /
+ (start_size[1] * start_size[2] * start_size[3] * start_size[4]);
+ max_size[1] = start_size[1];
+ max_size[2] = start_size[2];
+ max_size[3] = start_size[3];
+ max_size[4] = start_size[4];
}
#endif
@@ -1887,13 +1896,13 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
*/
if(H5D_CONTIGUOUS==layout) {
int fd;
- hsize_t nelmts;
+ hsize_t nelmts;
- nelmts = max_size[0]*max_size[1]*max_size[2]*max_size[3]*max_size[4];
- if((fd = HDopen(FILE_NAME_RAW, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0 ||
- HDclose(fd) < 0) goto error;
- if(H5Pset_external(dcpl, FILE_NAME_RAW, (off_t)0, (hsize_t)nelmts*sizeof(int)) < 0)
- goto error;
+ nelmts = max_size[0]*max_size[1]*max_size[2]*max_size[3]*max_size[4];
+ if((fd = HDopen(FILE_NAME_RAW, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0 ||
+ HDclose(fd) < 0) goto error;
+ if(H5Pset_external(dcpl, FILE_NAME_RAW, (off_t)0, (hsize_t)nelmts*sizeof(int)) < 0)
+ goto error;
}
#endif
@@ -1905,9 +1914,9 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
* errors described above or `unable to select fill value region'.
*/
if(H5D_CONTIGUOUS==layout) {
- SKIPPED();
- puts(" Not implemented yet -- needs H5S_SELECT_DIFF operator");
- goto skip;
+ SKIPPED();
+ puts(" Not implemented yet -- needs H5S_SELECT_DIFF operator");
+ goto skip;
}
#endif
@@ -1938,20 +1947,20 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
error:
H5E_BEGIN_TRY {
H5Tclose(cmpd_vl_tid);
- H5Pclose(dcpl);
- H5Fclose(file);
+ H5Pclose(dcpl);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
skip:
H5E_BEGIN_TRY {
- H5Pclose(dcpl);
- H5Fclose(file);
+ H5Pclose(dcpl);
+ H5Fclose(file);
} H5E_END_TRY;
return 0;
} /* end test_extend() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compatible
*
@@ -1983,7 +1992,7 @@ test_compatible(void)
TESTING("contiguous dataset compatibility with v. 1.4");
if((file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) {
- printf(" Could not open file %s. Try set $srcdir to point at the "
+ HDprintf(" Could not open file %s. Try set $srcdir to point at the "
"source directory of test\n", testfile);
goto error;
}
@@ -1993,8 +2002,8 @@ test_compatible(void)
if(H5Pfill_value_defined(dcpl1, &status) < 0) goto error;
if(status != H5D_FILL_VALUE_UNDEFINED) {
H5_FAILED();
- printf(" %d: Got a different fill value than what was set.",__LINE__);
- printf(" Got status=%ld, suppose to be H5D_FILL_VALUE_UNDEFINED\n",
+ HDprintf(" %d: Got a different fill value than what was set.",__LINE__);
+ HDprintf(" Got status=%ld, suppose to be H5D_FILL_VALUE_UNDEFINED\n",
(long)status);
goto error;
}
@@ -2003,7 +2012,7 @@ test_compatible(void)
if(dims[0] != 8 || dims[1] != 8) {
H5_FAILED();
puts(" Got a different dimension size than what was set.");
- printf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]);
+ HDprintf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]);
goto error;
}
if((mspace = H5Screate_simple(2, one, NULL)) < 0) goto error;
@@ -2014,7 +2023,7 @@ test_compatible(void)
if(val_rd != 0) {
H5_FAILED();
puts(" Got a different value than what was set.");
- printf(" Got %ld, set 0\n", (long)val_rd);
+ HDprintf(" Got %ld, set 0\n", (long)val_rd);
goto error;
}
if(H5Pclose(dcpl1) < 0) goto error;
@@ -2028,16 +2037,16 @@ test_compatible(void)
if(H5Pfill_value_defined(dcpl2, &status) < 0) goto error;
if(status != H5D_FILL_VALUE_USER_DEFINED) {
H5_FAILED();
- printf(" %d: Got a different fill value than what was set.",__LINE__);
- printf(" Got status=%ld, suppose to be H5D_FILL_VALUE_USER_DEFINED\n",
+ HDprintf(" %d: Got a different fill value than what was set.",__LINE__);
+ HDprintf(" Got status=%ld, suppose to be H5D_FILL_VALUE_USER_DEFINED\n",
(long)status);
goto error;
}
if(H5Pget_fill_value(dcpl2, H5T_NATIVE_INT, &rd_fill) < 0) goto error;
if(rd_fill != fill_val) {
H5_FAILED();
- printf(" %d: Got a different fill value than what was set.",__LINE__);
- printf(" Got %ld, set %ld\n", (long)rd_fill, (long)fill_val);
+ HDprintf(" %d: Got a different fill value than what was set.",__LINE__);
+ HDprintf(" Got %ld, set %ld\n", (long)rd_fill, (long)fill_val);
goto error;
}
fspace = -1;
@@ -2047,7 +2056,7 @@ test_compatible(void)
if(dims[0] != 8 || dims[1] != 8) {
H5_FAILED();
puts(" Got a different dimension size than what was set.");
- printf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]);
+ HDprintf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]);
goto error;
}
if((mspace=H5Screate_simple(2, one, NULL)) < 0) goto error;
@@ -2058,7 +2067,7 @@ test_compatible(void)
if(val_rd != fill_val) {
H5_FAILED();
puts(" Got a different value than what was set.");
- printf(" Got %ld, set %ld\n", (long)val_rd, (long)fill_val);
+ HDprintf(" Got %ld, set %ld\n", (long)val_rd, (long)fill_val);
goto error;
}
if(H5Pclose(dcpl2) < 0) goto error;
@@ -2087,20 +2096,20 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: test_partalloc_cases
+ * Function: test_partalloc_cases
*
- * Purpose: Tests fill values read and write for datasets.
+ * Purpose: Tests fill values read and write for datasets.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Joel Plutchak
+ * Programmer: Joel Plutchak
* April 15, 2013
*
* Modifications:
- * This function is called by test_rdwr to write and read
- * dataset for different cases of chunked datasets with
+ * This function is called by test_rdwr to write and read
+ * dataset for different cases of chunked datasets with
* unallocated chunks.
*
*-------------------------------------------------------------------------
@@ -2109,12 +2118,12 @@ error:
static int
test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t fill_time)
{
- hid_t fspace=-1, dset1=-1, rspace = -1;
- herr_t ret;
- hsize_t ds_size[2] = {4, 4};
- hsize_t max_size[2] = {H5S_UNLIMITED,4};
+ hid_t fspace=-1, dset1=-1, rspace = -1;
+ herr_t ret;
+ hsize_t ds_size[2] = {4, 4};
+ hsize_t max_size[2] = {H5S_UNLIMITED,4};
hsize_t chunk_size[2] = {1, 4};
- int fillval=(-1);
+ int fillval=(-1);
int w_values[] = {42}; /* New value to be written */
int f_values[4] = {88,88,88,88}; /* pre-seed read buffer with known values */
int r_values[4] = {88,88,88,88}; /* pre-seed read buffer with known values */
@@ -2132,17 +2141,17 @@ test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t
/*
* Select a point in the file dataspace.
*/
- coord[0][0]=0; coord[0][1]=0;
+ coord[0][0]=0; coord[0][1]=0;
if (H5Sselect_elements( fspace, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord))
goto error;
-
+
/*
* Write single data point to the dataset.
*/
if ((ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, fspace, H5P_DEFAULT, w_values))< 0) {
goto error;
}
-
+
/* Read a line/chunk and make sure values are right */
rspace = H5Screate_simple(2, chunk_size, NULL);
@@ -2154,7 +2163,7 @@ test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t
if ((ret = H5Sselect_hyperslab(fspace, H5S_SELECT_SET, start, NULL, count, NULL)) < 0)
goto error;
if ((ret = H5Sselect_all(rspace)) < 0)
- goto error;
+ goto error;
if(H5Dread(dset1, H5T_NATIVE_INT, rspace, fspace, H5P_DEFAULT, &r_values) < 0)
goto error;
@@ -2176,7 +2185,7 @@ test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t
(r_values[3] != fillval)) {
H5_FAILED();
HDfprintf(stdout, "%u: Allocated chunk value read was not correct.\n", (unsigned)__LINE__);
- printf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n",
+ HDprintf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n",
(long)r_values[0], (long)r_values[1],
(long)r_values[2], (long)r_values[3],
(long)w_values[0], (long)fillval,
@@ -2190,7 +2199,7 @@ test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t
(f_values[3] != fillval)) {
H5_FAILED();
HDfprintf(stdout, "%u: Unallocated chunk value read was not correct.\n", (unsigned)__LINE__);
- printf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n",
+ HDprintf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n",
(long)f_values[0], (long)f_values[1],
(long)f_values[2], (long)f_values[3],
(long)fillval, (long)fillval,
@@ -2209,15 +2218,15 @@ test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t
error:
H5E_BEGIN_TRY {
- H5Dclose(dset1);
- H5Sclose(fspace);
- H5Sclose(rspace);
+ H5Dclose(dset1);
+ H5Sclose(fspace);
+ H5Sclose(rspace);
} H5E_END_TRY;
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_partalloc
*
@@ -2237,9 +2246,9 @@ static int
test_partalloc(hid_t fapl, const char *base_name)
{
char filename[1024];
- hid_t file=-1, dcpl=-1;
+ hid_t file=-1, dcpl=-1;
hsize_t ch_size[2] = {1, 4};
- int nerrors=0;
+ int nerrors=0;
TESTING("chunked dataset partially allocated I/O");
@@ -2253,86 +2262,86 @@ test_partalloc(hid_t fapl, const char *base_name)
/* I. Test H5D_ALLOC_TIME_LATE space allocation cases */
if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto error;
#ifdef DEBUG
- fprintf( stdout, "\nALLOC_TIME_LATE\n" );
+ HDfprintf( stdout, "\nALLOC_TIME_LATE\n" );
#endif
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error;
#ifdef DEBUG
- fprintf( stdout, " FILL_TIME_ALLOC\n" );
+ HDfprintf( stdout, " FILL_TIME_ALLOC\n" );
#endif
nerrors += test_partalloc_cases(file, dcpl, "dset1", H5D_FILL_TIME_ALLOC);
-
+
/* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error;
#ifdef DEBUG
- fprintf( stdout, " FILL_TIME_NEVER\n" );
+ HDfprintf( stdout, " FILL_TIME_NEVER\n" );
#endif
nerrors += test_partalloc_cases(file, dcpl, "dset2", H5D_FILL_TIME_NEVER );
/* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) goto error;
#ifdef DEBUG
- fprintf( stdout, " FILL_TIME_IFSET\n" );
+ HDfprintf( stdout, " FILL_TIME_IFSET\n" );
#endif
nerrors += test_partalloc_cases(file, dcpl, "dset3", H5D_FILL_TIME_IFSET );
/* II. Test H5D_ALLOC_TIME_INCR space allocation cases */
if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR) < 0) goto error;
#ifdef DEBUG
- fprintf( stdout, "\nALLOC_TIME_INCR\n" );
+ HDfprintf( stdout, "\nALLOC_TIME_INCR\n" );
#endif
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error;
#ifdef DEBUG
- fprintf( stdout, " FILL_TIME_ALLOC\n" );
+ HDfprintf( stdout, " FILL_TIME_ALLOC\n" );
#endif
nerrors += test_partalloc_cases(file, dcpl, "dset4", H5D_FILL_TIME_ALLOC );
/* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error;
#ifdef DEBUG
- fprintf( stdout, " FILL_TIME_NEVER\n" );
+ HDfprintf( stdout, " FILL_TIME_NEVER\n" );
#endif
nerrors += test_partalloc_cases(file, dcpl, "dset5", H5D_FILL_TIME_NEVER );
/* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) goto error;
#ifdef DEBUG
- fprintf( stdout, " FILL_TIME_IFSET\n" );
+ HDfprintf( stdout, " FILL_TIME_IFSET\n" );
#endif
nerrors += test_partalloc_cases(file, dcpl, "dset6", H5D_FILL_TIME_IFSET );
/* III. Test H5D_ALLOC_TIME_EARLY space allocation cases */
if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto error;
#ifdef DEBUG
- fprintf( stdout, "\nALLOC_TIME_EARLY\n" );
+ HDfprintf( stdout, "\nALLOC_TIME_EARLY\n" );
#endif
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error;
#ifdef DEBUG
- fprintf( stdout, " FILL_TIME_ALLOC\n" );
+ HDfprintf( stdout, " FILL_TIME_ALLOC\n" );
#endif
nerrors += test_partalloc_cases(file, dcpl, "dset7", H5D_FILL_TIME_ALLOC );
/* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error;
#ifdef DEBUG
- fprintf( stdout, " FILL_TIME_NEVER\n" );
+ HDfprintf( stdout, " FILL_TIME_NEVER\n" );
#endif
nerrors += test_partalloc_cases(file, dcpl, "dset8", H5D_FILL_TIME_NEVER );
/* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) goto error;
#ifdef DEBUG
- fprintf( stdout, " FILL_TIME_IFSET\n" );
+ HDfprintf( stdout, " FILL_TIME_IFSET\n" );
#endif
nerrors += test_partalloc_cases(file, dcpl, "dset9", H5D_FILL_TIME_IFSET );
if(nerrors)
- goto error;
+ goto error;
if(H5Pclose(dcpl) < 0) goto error;
if(H5Fclose(file) < 0) goto error;
PASSED();
@@ -2346,29 +2355,27 @@ test_partalloc(hid_t fapl, const char *base_name)
return nerrors;
}
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Tests fill values
+ * Purpose: Tests fill values
*
- * Return: Success:
+ * Return: Success:
*
- * Failure:
+ * Failure:
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, October 1, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
main(int argc, char *argv[])
{
- int nerrors=0, argno, test_contig=1, test_chunk=1, test_compact=1;
- hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */
- unsigned new_format; /* Whether to use the new format or not */
+ int nerrors=0, argno, test_contig=1, test_chunk=1, test_compact=1;
+ hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */
+ unsigned new_format; /* Whether to use the new format or not */
if(argc >= 2) {
test_contig = test_chunk = test_compact = 0;
@@ -2380,8 +2387,8 @@ main(int argc, char *argv[])
else if(!strcmp(argv[argno], "compact"))
test_compact =1;
else {
- fprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]);
+ HDexit(EXIT_FAILURE);
}
} /* end for */
} /* end if */
@@ -2444,15 +2451,15 @@ main(int argc, char *argv[])
if(nerrors)
goto error;
- puts("All fill value tests passed.");
+ HDputs("All fill value tests passed.");
if(h5_cleanup(FILENAME, fapl))
HDremove(FILE_NAME_RAW);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
- puts("***** FILL VALUE TESTS FAILED *****");
- return 1;
+ HDputs("***** FILL VALUE TESTS FAILED *****");
+ HDexit(EXIT_FAILURE);
}
diff --git a/test/filter_fail.c b/test/filter_fail.c
index 76b3106..4be2547 100644
--- a/test/filter_fail.c
+++ b/test/filter_fail.c
@@ -270,15 +270,15 @@ test_filter_read(char *file_name, hid_t my_fapl)
for(i = 0; i < DIM; i++) {
if(i < DIM-2 && rbuf[i] != i) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d\n", i);
- printf(" rbuf[%d]=%d\n", i, rbuf[i]);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d\n", i);
+ HDprintf(" rbuf[%d]=%d\n", i, rbuf[i]);
TEST_ERROR
} else if(i >= DIM-2 && rbuf[i] != 0) {
H5_FAILED();
- printf(" No value should be read.\n");
- printf(" At index %d\n", i);
- printf(" rbuf[%d]=%d\n", i, rbuf[i]);
+ HDprintf(" No value should be read.\n");
+ HDprintf(" At index %d\n", i);
+ HDprintf(" rbuf[%d]=%d\n", i, rbuf[i]);
TEST_ERROR
}
}
@@ -310,15 +310,15 @@ test_filter_read(char *file_name, hid_t my_fapl)
for(i = 0; i < DIM; i+=2) {
if(i < DIM-2 && rbuf[i] != i) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d\n", i);
- printf(" rbuf[%d]=%d\n", i, rbuf[i]);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d\n", i);
+ HDprintf(" rbuf[%d]=%d\n", i, rbuf[i]);
TEST_ERROR
} else if(i >= DIM-2 && rbuf[i] != 0) {
H5_FAILED();
- printf(" No value should be read.\n");
- printf(" At index %d\n", i);
- printf(" rbuf[%d]=%d\n", i, rbuf[i]);
+ HDprintf(" No value should be read.\n");
+ HDprintf(" At index %d\n", i);
+ HDprintf(" rbuf[%d]=%d\n", i, rbuf[i]);
TEST_ERROR
}
}
@@ -347,17 +347,15 @@ error:
* Purpose: Tests the library's behavior when a mandate filter returns
* failure.
*
- * Return: Success: exit(EXIT_SUCCESS)
- * Failure: exit(EXIT_FAILURE)
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Raymond Lu
* 25 August 2010
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
-int main(void)
+int
+main(void)
{
hid_t fapl;
int mdc_nelmts = 0;
@@ -398,12 +396,12 @@ int main(void)
if (nerrors) TEST_ERROR
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
if (nerrors) {
- printf("***** %u FAILURE%s! *****\n",
+ HDprintf("***** %u FAILURE%s! *****\n",
nerrors, 1==nerrors?"":"S");
HDexit(EXIT_FAILURE);
}
-}
+} /* end main() */
diff --git a/test/flush1.c b/test/flush1.c
index bdbd731..d7d578b 100644
--- a/test/flush1.c
+++ b/test/flush1.c
@@ -73,7 +73,7 @@ create_file(const char *filename, hid_t fapl_id, hbool_t swmr)
hid_t fid = -1; /* file ID */
hid_t top_gid = -1; /* containing group ID */
hid_t gid = -1; /* subgroup ID */
- char group_name[16]; /* group name */
+ char group_name[32]; /* group name */
unsigned flags; /* file open flags */
int i; /* iterator */
diff --git a/test/flush2.c b/test/flush2.c
index 9fdf6c1..519f1b2 100644
--- a/test/flush2.c
+++ b/test/flush2.c
@@ -15,10 +15,10 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Friday, October 23, 1998
*
- * Purpose: This is the second half of a two-part test that makes sure
- * that a file can be read after an application crashes as long
- * as the file was flushed first. This half tries to read the
- * file created by the first half.
+ * Purpose: This is the second half of a two-part test that makes sure
+ * that a file can be read after an application crashes as long
+ * as the file was flushed first. This half tries to read the
+ * file created by the first half.
*/
#include "h5test.h"
@@ -135,7 +135,7 @@ file_ok(const char *filename, hid_t fapl_id, hbool_t check_second_dset)
hid_t fid = -1; /* file ID */
hid_t top_gid = -1; /* containing group ID */
hid_t gid = -1; /* subgroup ID */
- char group_name[16]; /* group name */
+ char group_name[32]; /* group name */
int i; /* iterator */
/* open file */
diff --git a/test/flushrefresh.c b/test/flushrefresh.c
index 4196d85..c933349 100644
--- a/test/flushrefresh.c
+++ b/test/flushrefresh.c
@@ -130,7 +130,7 @@ herr_t end_verification(void);
* it will time out waiting for a signal from the test script
* which will never come.
*
- * Return: 0 on Success, 1 on Failure
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Mike McGreevy
* July 1, 2010
@@ -166,23 +166,26 @@ int main(int argc, const char *argv[])
if(end_verification() < 0) TEST_ERROR;
if(end_verification() < 0) TEST_ERROR;
} /* end else */
- } else if(argc == 3) {
+ }
+ else if(argc == 3) {
/* Two arguments supplied. Pass them to flush verification routine. */
if(flush_verification(argv[1], argv[2]) != 0) PROCESS_ERROR;
- } else if(argc == 2) {
+ }
+ else if(argc == 2) {
/* One argument supplied. Pass it to refresh verification routine. */
if(refresh_verification(argv[1]) != 0) PROCESS_ERROR;
- } else {
+ }
+ else {
/* Illegal number of arguments supplied. Error. */
HDfprintf(stderr, "Error. %d is an Invalid number of arguments to main().\n", argc);
PROCESS_ERROR
} /* end if */
- return SUCCEED;
+ return EXIT_SUCCESS;
error:
/* Return */
- return FAIL;
+ return EXIT_FAILURE;
} /* main */
@@ -695,7 +698,6 @@ herr_t test_refresh(void)
/* ================= */
/* Refresh Datatypes */
/* ================= */
-
TESTING("to ensure that H5Trefresh correctly refreshes single datatypes");
/* Verify First Committed Datatype can be refreshed with H5Trefresh */
@@ -715,7 +717,6 @@ herr_t test_refresh(void)
if(H5Oflush(tid2) < 0) TEST_ERROR;
if(end_refresh_verification_process() != 0) TEST_ERROR;
-
PASSED();
/* =============== */
@@ -995,7 +996,7 @@ herr_t refresh_verification(const char * obj_pathname)
check to ensure we didn't erroneously flush the attribute before
starting the verification. */
if(flushed_oinfo.num_attrs != 0)
- PROCESS_ERROR;
+ PROCESS_ERROR;
/* Send Signal to MAIN PROCESS indicating that it can go ahead and modify the
object. */
@@ -1027,55 +1028,57 @@ herr_t refresh_verification(const char * obj_pathname)
* test cases is easy). */
do {
- if((HDstrcmp(obj_pathname, D1) == 0) || (HDstrcmp(obj_pathname, D2) == 0)) {
- if(H5Drefresh(oid) < 0) PROCESS_ERROR;
- } /* end if */
- else if((HDstrcmp(obj_pathname, G1) == 0) || (HDstrcmp(obj_pathname, G2) == 0)) {
- if(H5Grefresh(oid) < 0) PROCESS_ERROR;
- } /* end if */
- else if((HDstrcmp(obj_pathname, T1) == 0) || (HDstrcmp(obj_pathname, T2) == 0)) {
- if(H5Trefresh(oid) < 0) PROCESS_ERROR;
- } /* end if */
- else if((HDstrcmp(obj_pathname, D3) == 0) || (HDstrcmp(obj_pathname, G3) == 0) ||
+ if((HDstrcmp(obj_pathname, D1) == 0) || (HDstrcmp(obj_pathname, D2) == 0)) {
+ if(H5Drefresh(oid) < 0) PROCESS_ERROR;
+ } /* end if */
+ else if((HDstrcmp(obj_pathname, G1) == 0) || (HDstrcmp(obj_pathname, G2) == 0)) {
+ if(H5Grefresh(oid) < 0) PROCESS_ERROR;
+ } /* end if */
+ else if((HDstrcmp(obj_pathname, T1) == 0) || (HDstrcmp(obj_pathname, T2) == 0)) {
+ if(H5Trefresh(oid) < 0) PROCESS_ERROR;
+ } /* end if */
+ else if((HDstrcmp(obj_pathname, D3) == 0) || (HDstrcmp(obj_pathname, G3) == 0) ||
(HDstrcmp(obj_pathname, T3) == 0)) {
- if(H5Orefresh(oid) < 0) PROCESS_ERROR;
- } /* end if */
- else {
- HDfprintf(stdout, "Error. %s is an unrecognized object.\n", obj_pathname);
- PROCESS_ERROR;
- } /* end else */
-
- /* Get object info. This should now accurately reflect the refreshed object on disk. */
- if((status = H5Oget_info2(oid, &refreshed_oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS|H5O_INFO_HDR)) < 0) PROCESS_ERROR;
-
- /* Confirm following (first 4) attributes are the same: */
- /* Confirm following (last 4) attributes are different */
- if( (flushed_oinfo.addr == refreshed_oinfo.addr) &&
- (flushed_oinfo.type == refreshed_oinfo.type) &&
- (flushed_oinfo.hdr.version == refreshed_oinfo.hdr.version) &&
- (flushed_oinfo.hdr.flags == refreshed_oinfo.hdr.flags) &&
- (flushed_oinfo.num_attrs != refreshed_oinfo.num_attrs) &&
- (flushed_oinfo.hdr.nmesgs != refreshed_oinfo.hdr.nmesgs) &&
- (flushed_oinfo.hdr.nchunks != refreshed_oinfo.hdr.nchunks) &&
- (flushed_oinfo.hdr.space.total != refreshed_oinfo.hdr.space.total) ) {
- ok = TRUE;
- break;
- }
- if(tries == sleep_tries)
- HDsleep(1);
+ if(H5Orefresh(oid) < 0) PROCESS_ERROR;
+ } /* end if */
+ else {
+ HDfprintf(stdout, "Error. %s is an unrecognized object.\n", obj_pathname);
+ PROCESS_ERROR;
+ } /* end else */
+
+ /* Get object info. This should now accurately reflect the refreshed object on disk. */
+ if((status = H5Oget_info2(oid, &refreshed_oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS|H5O_INFO_HDR)) < 0)
+ PROCESS_ERROR;
+
+ /* Confirm following (first 4) attributes are the same: */
+ /* Confirm following (last 4) attributes are different */
+ if( (flushed_oinfo.addr == refreshed_oinfo.addr) &&
+ (flushed_oinfo.type == refreshed_oinfo.type) &&
+ (flushed_oinfo.hdr.version == refreshed_oinfo.hdr.version) &&
+ (flushed_oinfo.hdr.flags == refreshed_oinfo.hdr.flags) &&
+ (flushed_oinfo.num_attrs != refreshed_oinfo.num_attrs) &&
+ (flushed_oinfo.hdr.nmesgs != refreshed_oinfo.hdr.nmesgs) &&
+ (flushed_oinfo.hdr.nchunks != refreshed_oinfo.hdr.nchunks) &&
+ (flushed_oinfo.hdr.space.total != refreshed_oinfo.hdr.space.total) ) {
+ ok = TRUE;
+ break;
+ }
+
+ if(tries == sleep_tries)
+ HDsleep(1);
} while(--tries);
-
+
if(!ok) {
- printf("FLUSHED: num_attrs=%d, nmesgs=%d, nchunks=%d, total=%d\n",
- (int)flushed_oinfo.num_attrs, (int)flushed_oinfo.hdr.nmesgs,
- (int)flushed_oinfo.hdr.nchunks, (int)flushed_oinfo.hdr.space.total);
- printf("REFRESHED: num_attrs=%d, nmesgs=%d, nchunks=%d, total=%d\n",
- (int)refreshed_oinfo.num_attrs, (int)refreshed_oinfo.hdr.nmesgs,
- (int)refreshed_oinfo.hdr.nchunks, (int)refreshed_oinfo.hdr.space.total);
- PROCESS_ERROR;
+ HDprintf("FLUSHED: num_attrs=%d, nmesgs=%d, nchunks=%d, total=%d\n",
+ (int)flushed_oinfo.num_attrs, (int)flushed_oinfo.hdr.nmesgs,
+ (int)flushed_oinfo.hdr.nchunks, (int)flushed_oinfo.hdr.space.total);
+ HDprintf("REFRESHED: num_attrs=%d, nmesgs=%d, nchunks=%d, total=%d\n",
+ (int)refreshed_oinfo.num_attrs, (int)refreshed_oinfo.hdr.nmesgs,
+ (int)refreshed_oinfo.hdr.nchunks, (int)refreshed_oinfo.hdr.space.total);
+ PROCESS_ERROR;
}
-
+
/* Close objects */
if(H5Oclose(oid) < 0) PROCESS_ERROR;
if(H5Fclose(fid) < 0) PROCESS_ERROR;
diff --git a/test/flushrefreshTest.cmake b/test/flushrefreshTest.cmake
index f66ee64..6faf37b 100644
--- a/test/flushrefreshTest.cmake
+++ b/test/flushrefreshTest.cmake
@@ -18,7 +18,7 @@ if (NOT TEST_PROGRAM)
message (FATAL_ERROR "Require TEST_PROGRAM to be defined")
endif ()
if (NOT TEST_FOLDER)
- message ( FATAL_ERROR "Require TEST_FOLDER to be defined")
+ message (FATAL_ERROR "Require TEST_FOLDER to be defined")
endif ()
if (NOT TEST_OUTPUT)
message (FATAL_ERROR "Require TEST_OUTPUT to be defined")
@@ -30,18 +30,18 @@ if (NOT PERL_EXECUTABLE)
message (STATUS "Require PERL_EXECUTABLE to be defined")
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
if (TEST_LIBRARY_DIRECTORY)
- if (WIN32 AND NOT MINGW)
+ if (WIN32 OR MINGW)
set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
else ()
set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
@@ -53,7 +53,7 @@ if (TEST_ENV_VAR)
#message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}")
endif ()
-message(STATUS "Background: ${PERL_EXECUTABLE} ${PERL_SCRIPT} ${TEST_PROGRAM}")
+message (STATUS "Background: ${PERL_EXECUTABLE} ${PERL_SCRIPT} ${TEST_PROGRAM}")
execute_process (
COMMAND ${PERL_EXECUTABLE} ${PERL_SCRIPT} ${TEST_PROGRAM}
RESULT_VARIABLE SCRIPT_RESULT
@@ -61,36 +61,36 @@ execute_process (
OUTPUT_VARIABLE SCRIPT_OUTPUT
WORKING_DIRECTORY ${TEST_FOLDER}
)
-message(STATUS "Background: ${SCRIPT_OUTPUT}")
-if (NOT "${SCRIPT_RESULT}" STREQUAL "0")
+message (STATUS "Background: ${SCRIPT_OUTPUT}")
+if (SCRIPT_RESULT)
message (FATAL_ERROR "Failed: The background script failed ${SCRIPT_RESULT}: ${SCRIPT_ERR}")
endif ()
-set(verification_done "0")
-while(verification_done LESS "1")
- message(STATUS "checking first stage:${TEST_FOLDER}/${TEST_ARGS1}")
- if(EXISTS ${TEST_FOLDER}/${TEST_ERR})
+set (verification_done "0")
+while (verification_done LESS "1")
+ message (STATUS "checking first stage:${TEST_FOLDER}/${TEST_ARGS1}")
+ if (EXISTS "${TEST_FOLDER}/${TEST_ERR}")
# Error exit script
- set(verification_done "3")
- elseif(EXISTS ${TEST_FOLDER}/${TEST_ARGS1})
+ set (verification_done "3")
+ elseif (EXISTS "${TEST_FOLDER}/${TEST_ARGS1}")
file (STRINGS ${TEST_FOLDER}/${TEST_ARGS1} v1)
list (LENGTH v1 len_v1)
- message(STATUS "v1:${v1} len_v1:${len_v1}")
- if (NOT "${len_v1}" STREQUAL "0")
+ message (STATUS "v1:${v1} len_v1:${len_v1}")
+ if (len_v1)
list (GET v1 0 param1)
list (GET v1 -1 param2)
endif ()
- file(REMOVE ${TEST_FOLDER}/${TEST_ARGS1})
- message(STATUS "PARAM1:${param1} PARAM2:${param2}")
+ file (REMOVE ${TEST_FOLDER}/${TEST_ARGS1})
+ message (STATUS "PARAM1:${param1} PARAM2:${param2}")
- if(${param1} MATCHES "VERIFICATION_DONE")
- set(verification_done "1")
- file(WRITE ${TEST_FOLDER}/${TEST_ARGS2} "all flush verification complete")
- message(STATUS "write: ${TEST_FOLDER}/${TEST_ARGS2}")
- else()
- message(STATUS "execute: ${TEST_PROGRAM} ${param1} ${param2}")
+ if (param1 MATCHES "VERIFICATION_DONE")
+ set (verification_done "1")
+ file (WRITE ${TEST_FOLDER}/${TEST_ARGS2} "all flush verification complete")
+ message (STATUS "write: ${TEST_FOLDER}/${TEST_ARGS2}")
+ else ()
+ message (STATUS "execute: ${TEST_PROGRAM} ${param1} ${param2}")
execute_process (
- COMMAND ${TEST_PROGRAM} ${param1} ${param2}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${TEST_PROGRAM} ${param1} ${param2}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}
ERROR_FILE ${TEST_OUTPUT}.err
@@ -98,42 +98,42 @@ while(verification_done LESS "1")
ERROR_VARIABLE TEST_ERROR
WORKING_DIRECTORY ${TEST_FOLDER}
)
- message(STATUS "flush verification: ${TEST_OUT}")
- if (NOT "${TEST_RESULT}" STREQUAL "0")
+ message (STATUS "flush verification: ${TEST_OUT}")
+ if (TEST_RESULT)
message (FATAL_ERROR "Failed: The flush verification failed ${TEST_RESULT}: ${TEST_ERROR}")
endif ()
- file(WRITE ${TEST_FOLDER}/${TEST_ARGS2} "verification flush process done")
- endif()
- else()
- message(STATUS "waiting: ${TEST_FOLDER}/${TEST_ARGS1}")
+ file (WRITE ${TEST_FOLDER}/${TEST_ARGS2} "verification flush process done")
+ endif ()
+ else ()
+ message (STATUS "waiting: ${TEST_FOLDER}/${TEST_ARGS1}")
#execute_process (COMMAND ${CMAKE_COMMAND} -E sleep 2)
- endif()
-endwhile()
+ endif ()
+endwhile ()
-while(verification_done LESS "2")
- message(STATUS "checking second stage:${TEST_FOLDER}/${TEST_ARGS1}")
- if(EXISTS ${TEST_FOLDER}/${TEST_ERR})
+while (verification_done LESS "2")
+ message (STATUS "checking second stage:${TEST_FOLDER}/${TEST_ARGS1}")
+ if (EXISTS "${TEST_FOLDER}/${TEST_ERR}")
# Error exit script
- set(verification_done "3")
- elseif(EXISTS ${TEST_FOLDER}/${TEST_ARGS1})
+ set (verification_done "3")
+ elseif (EXISTS "${TEST_FOLDER}/${TEST_ARGS1}")
file (STRINGS ${TEST_FOLDER}/${TEST_ARGS1} v1)
list (LENGTH v1 len_v1)
- message(STATUS "v1:${v1} len_v1:${len_v1}")
- if (NOT "${len_v1}" STREQUAL "0")
+ message (STATUS "v1:${v1} len_v1:${len_v1}")
+ if (len_v1)
list (GET v1 0 param1)
list (GET v1 -1 param2)
endif ()
- file(REMOVE ${TEST_FOLDER}/${TEST_ARGS1})
- message(STATUS "PARAM1:${param1} PARAM2:${param2}")
+ file (REMOVE ${TEST_FOLDER}/${TEST_ARGS1})
+ message (STATUS "PARAM1:${param1} PARAM2:${param2}")
- if(${param1} MATCHES "VERIFICATION_DONE")
- set(verification_done "2")
- file(WRITE ${TEST_FOLDER}/${TEST_ARGS2} "all refresh verification complete")
- message(STATUS "write: ${TEST_FOLDER}/${TEST_ARGS2}")
- else()
- message(STATUS "execute: ${TEST_PROGRAM} ${param1}")
+ if (param1 MATCHES "VERIFICATION_DONE")
+ set (verification_done "2")
+ file (WRITE ${TEST_FOLDER}/${TEST_ARGS2} "all refresh verification complete")
+ message (STATUS "write: ${TEST_FOLDER}/${TEST_ARGS2}")
+ else ()
+ message (STATUS "execute: ${TEST_PROGRAM} ${param1}")
execute_process (
- COMMAND ${TEST_PROGRAM} ${param1}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${TEST_PROGRAM} ${param1}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}
ERROR_FILE ${TEST_OUTPUT}.err
@@ -141,24 +141,24 @@ while(verification_done LESS "2")
ERROR_VARIABLE TEST_ERROR
WORKING_DIRECTORY ${TEST_FOLDER}
)
- message(STATUS "refresh verification: ${TEST_OUT}")
- if (NOT "${TEST_RESULT}" STREQUAL "0")
+ message (STATUS "refresh verification: ${TEST_OUT}")
+ if (TEST_RESULT)
message (FATAL_ERROR "Failed: The refresh verification failed ${TEST_RESULT}: ${TEST_ERROR}")
endif ()
- file(WRITE ${TEST_FOLDER}/${TEST_ARGS2} "refresh verifiction process done")
- endif()
- else()
- message(STATUS "waiting: ${TEST_FOLDER}/${TEST_ARGS1}")
+ file (WRITE ${TEST_FOLDER}/${TEST_ARGS2} "refresh verifiction process done")
+ endif ()
+ else ()
+ message (STATUS "waiting: ${TEST_FOLDER}/${TEST_ARGS1}")
#execute_process (COMMAND ${CMAKE_COMMAND} -E sleep 2)
- endif()
-endwhile()
+ endif ()
+endwhile ()
message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the return value is !=${TEST_EXPECT} bail out
-if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
+if (NOT TEST_RESULT EQUAL TEST_EXPECT)
if (NOT TEST_NOERRDISPLAY)
- if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+ if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
message (STATUS "Output :\n${TEST_STREAM}")
endif ()
@@ -169,4 +169,4 @@ endif ()
message (STATUS "COMMAND Error: ${TEST_ERROR}")
# everything went fine...
-message ("Passed")
+message (STATUS "Passed")
diff --git a/test/freespace.c b/test/freespace.c
index 33a6f89..c0fbb76 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -24,7 +24,7 @@
#define H5F_FRIEND /*suppress error about including H5Fpkg */
#include "H5Fpkg.h"
-#include "H5CXprivate.h" /* API Contexts */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
#include "H5VMprivate.h"
@@ -496,7 +496,7 @@ test_fs_create(hid_t fapl)
if(!H5F_addr_defined(fs_addr))
TEST_ERROR
- if (frsp->nclasses != nclasses)
+ if(frsp->nclasses != nclasses)
TEST_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -879,7 +879,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -1248,7 +1248,7 @@ test_fs_sect_find(hid_t fapl)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -1857,14 +1857,14 @@ test_fs_sect_shrink(hid_t fapl)
* Re-add section A that allow shrinking and its section class type defines "can_shrink"
*/
if(NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
can_shrink = FALSE;
if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* should have nothing in free-space */
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -1875,18 +1875,18 @@ test_fs_sect_shrink(hid_t fapl)
/* section A should not be there in free-space */
if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* Close the free space manager */
if(H5FS_close(f, frsp) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
if(H5FS_delete(f, fs_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
/* Close the file */
@@ -2082,7 +2082,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -2357,7 +2357,7 @@ test_fs_sect_change_class(hid_t fapl)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -2736,7 +2736,7 @@ test_fs_sect_extend(hid_t fapl)
PASSED()
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -2838,7 +2838,7 @@ test_fs_sect_iterate(hid_t fapl)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
diff --git a/test/gen_cross.c b/test/gen_cross.c
index f7a1938..105895d 100644
--- a/test/gen_cross.c
+++ b/test/gen_cross.c
@@ -1255,13 +1255,11 @@ error:
/*-------------------------------------------------------------------------
* Function: main
*
- * Purpose: Create a file for cross_read.c test.
+ * Purpose: Create a file for cross_read.c test
*
- * Return: Success: exit(EXIT_SUCCESS)
- * Failure: exit(EXIT_FAILURE)
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Raymond Lu
- * Some time ago
*
*-------------------------------------------------------------------------
*/
@@ -1279,9 +1277,8 @@ main (void)
* default file creation properties, and default file
* access properties.
*/
- if((file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))
- < 0)
- {H5_FAILED(); AT(); return 1;}
+ if((file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
/*
* Describe the size of the array and create the data space for fixed
@@ -1291,82 +1288,84 @@ main (void)
dimsf[0] = NX + 1;
dimsf[1] = NY;
if((filespace = H5Screate_simple(RANK, dimsf, NULL)) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
dimsf[0] = NX;
- if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, dimsf, NULL)
- < 0)
- {H5_FAILED(); AT(); return 1;}
+ if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, dimsf, NULL) < 0)
+ TEST_ERROR;
/* Create memory space. This does not include the extra row for fill
* values. */
HDassert(dimsf[0] == NX);
HDassert(dimsf[1] == NY);
if((memspace = H5Screate_simple(RANK, dimsf, NULL)) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
/* Create a regular dataset */
if(create_normal_dset(file, filespace, memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
/* Create a dataset of FLOAT with scale-offset filter */
if(create_scale_offset_dsets_float(file, filespace, memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
/* Create a dataset of DOUBLE with scale-offset filter */
if(create_scale_offset_dsets_double(file, filespace, memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
/* Create a dataset of CHAR with scale-offset filter */
if(create_scale_offset_dsets_char(file, filespace, memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
/* Create a dataset of SHORT with scale-offset filter */
if(create_scale_offset_dsets_short(file, filespace, memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
/* Create a dataset of INT with scale-offset filter */
if(create_scale_offset_dsets_int(file, filespace, memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
/* Create a dataset of LONG LONG with scale-offset filter */
if(create_scale_offset_dsets_long_long(file, filespace, memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
/* Create a dataset of FLOAT with fletcher filter */
if(create_fletcher_dsets_float(file, filespace, memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
/* Create a dataset of FLOAT with deflate filter */
if(create_deflate_dsets_float(file, filespace, memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
#ifdef H5_HAVE_FILTER_SZIP
/* Create a dataset of FLOAT with szip filter */
if(create_szip_dsets_float(file, filespace, memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
#else /* H5_HAVE_FILTER_SZIP */
- puts("Szip filter is not enabled. Can't create the dataset.");
+ HDputs("Szip filter is not enabled. Can't create the dataset.");
#endif /* H5_HAVE_FILTER_SZIP */
/* Create a dataset of FLOAT with shuffle filter */
if(create_shuffle_dsets_float(file, filespace, memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
/* Create a dataset of FLOAT with nbit filter */
if(create_nbit_dsets_float(file, filespace, memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
/*
* Close/release resources.
*/
if(H5Sclose(memspace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
if(H5Sclose(filespace) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
if(H5Fclose(file) < 0)
- {H5_FAILED(); AT(); return 1;}
+ TEST_ERROR;
- return 0;
-}
+ HDexit(EXIT_SUCCESS);
+
+error:
+ HDexit(EXIT_FAILURE);
+} /* end main() */
diff --git a/test/gheap.c b/test/gheap.c
index bf0f18a..32e2785 100644
--- a/test/gheap.c
+++ b/test/gheap.c
@@ -15,9 +15,9 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Tuesday, March 31, 1998
*
- * Purpose: Tests the global heap. The global heap is the set of all
- * collections but the collections are not related to one
- * another by anything that appears in the file format.
+ * Purpose: Tests the global heap. The global heap is the set of all
+ * collections but the collections are not related to one
+ * another by anything that appears in the file format.
*/
#include "h5test.h"
#include "H5ACprivate.h"
@@ -60,33 +60,31 @@ const char *FILENAME[] = {
/*-------------------------------------------------------------------------
* Function: test_1
*
- * Purpose: Writes a sequence of objects to the global heap where each
- * object is larger than the one before.
+ * Purpose: Writes a sequence of objects to the global heap where each
+ * object is larger than the one before.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
* Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_1 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- uint8_t in[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- herr_t status;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ uint8_t in[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("monotonically increasing lengths");
@@ -97,10 +95,10 @@ test_1 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
H5_FAILED();
- puts(" Unable to create file");
+ HDputs(" Unable to create file");
goto error;
}
@@ -116,11 +114,12 @@ test_1 (hid_t fapl)
status = H5HG_insert(f, size, out, obj + u);
if(status < 0) {
H5_FAILED();
- puts(" Unable to insert object into global heap");
+ HDputs(" Unable to insert object into global heap");
nerrors++;
- } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) {
+ }
+ else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) {
H5_FAILED();
- puts(" Collection addresses are not monotonically increasing");
+ HDputs(" Collection addresses are not monotonically increasing");
nerrors++;
}
}
@@ -134,11 +133,12 @@ test_1 (hid_t fapl)
H5Eclear2(H5E_DEFAULT);
if(NULL == H5HG_read(f, obj + u, in, NULL)) {
H5_FAILED();
- puts(" Unable to read object");
+ HDputs(" Unable to read object");
nerrors++;
- } else if(HDmemcmp(in, out, size)) {
+ }
+ else if(HDmemcmp(in, out, size)) {
H5_FAILED();
- puts(" Value read doesn't match value written");
+ HDputs(" Value read doesn't match value written");
nerrors++;
}
}
@@ -147,15 +147,17 @@ test_1 (hid_t fapl)
HDfree(obj);
obj = NULL;
- if(H5Fclose(file) < 0) goto error;
- if(nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
@@ -166,32 +168,30 @@ error:
/*-------------------------------------------------------------------------
* Function: test_2
*
- * Purpose: Writes a sequence of objects to the global heap where each
- * object is smaller than the one before.
+ * Purpose: Writes a sequence of objects to the global heap where each
+ * object is smaller than the one before.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_2 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- uint8_t in[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ uint8_t in[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ int nerrors = 0;
+ char filename[1024];
TESTING("monotonically decreasing lengths");
@@ -202,10 +202,10 @@ test_2 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
H5_FAILED();
- puts(" Unable to create file");
+ HDputs(" Unable to create file");
goto error;
}
@@ -216,9 +216,9 @@ test_2 (hid_t fapl)
size = GHEAP_TEST_NOBJS - u;
HDmemset(out, (int)('A' + u % 26), size);
H5Eclear2(H5E_DEFAULT);
- if (H5HG_insert (f, size, out, obj + u) < 0) {
+ if(H5HG_insert(f, size, out, obj + u) < 0) {
H5_FAILED();
- puts(" Unable to insert object into global heap");
+ HDputs(" Unable to insert object into global heap");
nerrors++;
}
}
@@ -232,11 +232,12 @@ test_2 (hid_t fapl)
H5Eclear2(H5E_DEFAULT);
if(NULL == H5HG_read(f, obj + u, in, NULL)) {
H5_FAILED();
- puts(" Unable to read object");
+ HDputs(" Unable to read object");
nerrors++;
- } else if (memcmp (in, out, size)) {
+ }
+ else if (memcmp (in, out, size)) {
H5_FAILED();
- puts(" Value read doesn't match value written");
+ HDputs(" Value read doesn't match value written");
nerrors++;
}
}
@@ -245,15 +246,17 @@ test_2 (hid_t fapl)
HDfree(obj);
obj = NULL;
- if (H5Fclose(file)<0) goto error;
- if (nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
@@ -264,32 +267,30 @@ test_2 (hid_t fapl)
/*-------------------------------------------------------------------------
* Function: test_3
*
- * Purpose: Creates a few global heap objects and then removes them all.
- * The collection should also be removed.
+ * Purpose: Creates a few global heap objects and then removes them all.
+ * The collection should also be removed.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
* Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_3 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- herr_t status;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("complete object removal");
@@ -300,11 +301,11 @@ test_3 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
- H5_FAILED();
- puts(" Unable to create file");
- goto error;
+ H5_FAILED();
+ HDputs(" Unable to create file");
+ goto error;
}
/* Create some stuff */
@@ -315,7 +316,7 @@ test_3 (hid_t fapl)
status = H5HG_insert(f, size, out, obj + u);
if (status<0) {
H5_FAILED();
- puts(" Unable to insert object into global heap");
+ HDputs(" Unable to insert object into global heap");
nerrors++;
}
}
@@ -325,7 +326,7 @@ test_3 (hid_t fapl)
status = H5HG_remove(f, obj + u);
if (status<0) {
H5_FAILED();
- puts(" Unable to remove object");
+ HDputs(" Unable to remove object");
nerrors++;
}
}
@@ -334,15 +335,17 @@ test_3 (hid_t fapl)
HDfree(obj);
obj = NULL;
- if (H5Fclose(file)<0) goto error;
- if (nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
@@ -353,33 +356,31 @@ test_3 (hid_t fapl)
/*-------------------------------------------------------------------------
* Function: test_4
*
- * Purpose: Tests the H5HG_remove() feature by writing lots of objects
- * and occassionally removing some. When we're done they're all
- * removed.
+ * Purpose: Tests the H5HG_remove() feature by writing lots of objects
+ * and occassionally removing some. When we're done they're all
+ * removed.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
* Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_4 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- herr_t status;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("partial object removal");
@@ -390,10 +391,10 @@ test_4 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[3], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
H5_FAILED();
- puts(" Unable to create file");
+ HDputs(" Unable to create file");
goto error;
}
@@ -405,21 +406,20 @@ test_4 (hid_t fapl)
status = H5HG_insert(f, size, out, obj + u);
if (status<0) {
H5_FAILED();
- puts(" Unable to insert object into global heap");
+ HDputs(" Unable to insert object into global heap");
nerrors++;
}
- /*
- * Remove every third one beginning with the second, but after the
- * next one has already been inserted. That is, insert A, B, C;
- * remove B, insert D, E, F; remove E; etc.
- */
+ /* Remove every third one beginning with the second, but after the
+ * next one has already been inserted. That is, insert A, B, C;
+ * remove B, insert D, E, F; remove E; etc.
+ */
if(1 == (u % 3)) {
H5Eclear2(H5E_DEFAULT);
status = H5HG_remove(f, obj + u - 1);
if (status<0) {
H5_FAILED();
- puts(" Unable to remove object");
+ HDputs(" Unable to remove object");
nerrors++;
}
HDmemset(obj + u - 1, 0, sizeof *obj);
@@ -430,15 +430,17 @@ test_4 (hid_t fapl)
HDfree(obj);
obj = NULL;
- if (H5Fclose(file)<0) goto error;
- if (nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
@@ -449,32 +451,30 @@ test_4 (hid_t fapl)
/*-------------------------------------------------------------------------
* Function: test_ooo_indices
*
- * Purpose: Tests that indices can be stored out of order. This can
+ * Purpose: Tests that indices can be stored out of order. This can
* happen when the indices "wrap around" due to many
* insertions and deletions (for example, from rewriting a
* VL dataset).
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
* Programmer: Neil Fortner
* Monday, October 26, 2009
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_ooo_indices(hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
unsigned i, j;
- H5HG_t *obj = NULL;
- herr_t status;
- int nerrors=0;
- char filename[1024];
+ H5HG_t *obj = NULL;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("out of order indices");
@@ -487,16 +487,18 @@ test_ooo_indices(hid_t fapl)
goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
H5_FAILED();
- puts(" Unable to create file");
+ HDputs(" Unable to create file");
goto error;
- } /* end if */
+ }
/* Alternately insert 1000 entries and remove the previous group of 1000
- * entries, until the indices wrap around */
- for(i=0; i<66; i++) {
+ * entries, until the indices wrap around.
+ */
+ for(i = 0; i < 66; i++) {
/* Insert 1000 entries. The index into the obj array will alternate up
* and down by 1000 so the previous set of insertions is preserved and
- * can be deleted. */
+ * can be deleted.
+ */
for(j=1000*((~i&1)); j<1000*((~i&1)+1); j++) {
H5Eclear2(H5E_DEFAULT);
status = H5HG_insert(f, sizeof(j), &j, &obj[j]);
@@ -506,7 +508,7 @@ test_ooo_indices(hid_t fapl)
/* Check that the index is as expected */
if(obj[j].idx != ((1000 * i) + j - (1000 * ((~i & 1)))) % ((1u << 16) - 1) + 1)
GHEAP_REPEATED_ERR(" Unexpected global heap index");
- } /* end for */
+ }
/* Remove the previous 1000 entries */
if(i>0)
@@ -515,20 +517,21 @@ test_ooo_indices(hid_t fapl)
status = H5HG_remove(f, &obj[j]);
if (status<0)
GHEAP_REPEATED_ERR(" Unable to remove object from global heap");
- } /* end for */
- } /* end for */
+ }
+ }
/* The indices should have "wrapped around" on the last iteration */
HDassert(obj[534].idx == 65535);
HDassert(obj[535].idx == 1);
/* Reopen the file */
- if (H5Fclose(file)<0) goto error;
+ if (H5Fclose(file) < 0)
+ goto error;
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
H5_FAILED();
- puts(" Unable to open file");
+ HDputs(" Unable to open file");
goto error;
} /* end if */
@@ -538,14 +541,15 @@ test_ooo_indices(hid_t fapl)
goto error;
if(i != j) {
H5_FAILED();
- puts(" Incorrect read value");
+ HDputs(" Incorrect read value");
goto error;
- } /* end if */
- } /* end for */
-
- if (H5Fclose(file)<0) goto error;
- if (nerrors) goto error;
+ }
+ }
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
HDfree(obj);
obj = NULL;
@@ -554,7 +558,7 @@ test_ooo_indices(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
@@ -563,60 +567,58 @@ test_ooo_indices(hid_t fapl)
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Tests global heap.
+ * Purpose: Tests global heap.
*
- * Return: Success: zero
- *
- * Failure: non-zero
- *
- * Programmer: Robb Matzke
- * Tuesday, March 31, 1998
- *
- * Modifications:
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
*-------------------------------------------------------------------------
*/
int
main (void)
{
- int nerrors=0;
- hid_t fapl;
+ int nerrors = 0;
+ hid_t fapl_id = H5I_INVALID_HID;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
h5_reset();
- fapl = h5_fileaccess();
+ if ((fapl_id = h5_fileaccess()) < 0)
+ goto error;
/* Push API context */
if(H5CX_push() < 0) FAIL_STACK_ERROR
api_ctx_pushed = TRUE;
- nerrors += test_1(fapl);
- nerrors += test_2(fapl);
- nerrors += test_3(fapl);
- nerrors += test_4(fapl);
- nerrors += test_ooo_indices(fapl);
+ nerrors += test_1(fapl_id);
+ nerrors += test_2(fapl_id);
+ nerrors += test_3(fapl_id);
+ nerrors += test_4(fapl_id);
+ nerrors += test_ooo_indices(fapl_id);
/* Verify symbol table messages are cached */
- nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
+ nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0);
if (nerrors)
goto error;
- puts("All global heap tests passed.");
+
+ HDputs("All global heap tests passed.");
/* Pop API context */
if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
api_ctx_pushed = FALSE;
- h5_cleanup(FILENAME, fapl);
- return 0;
+ h5_cleanup(FILENAME, fapl_id);
+ HDexit(EXIT_SUCCESS);
error:
- puts("*** TESTS FAILED ***");
+ H5E_BEGIN_TRY {
+ H5Pclose(fapl_id);
+ } H5E_END_TRY;
if(api_ctx_pushed) H5CX_pop();
- return 1;
-}
+ HDputs("*** TESTS FAILED ***");
+ HDexit(EXIT_FAILURE);
+} /* end main() */
diff --git a/test/h5test.c b/test/h5test.c
index 62eb6bf..3cc2c35 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -25,7 +25,7 @@
#include "H5srcdir.h"
/* Necessary for h5_verify_cached_stabs() */
-#define H5G_FRIEND /*suppress error about including H5Gpkg */
+#define H5G_FRIEND /*suppress error about including H5Gpkg */
#define H5G_TESTING
#include "H5Gpkg.h"
@@ -42,7 +42,7 @@
* use for HDF5 file access. The first word in the
* value is the name of the driver and subsequent data
* is interpreted according to the driver. See
- * h5_fileaccess() for details.
+ * h5_get_vfd_fapl() for details.
*
* HDF5_PREFIX: A string to add to the beginning of all serial test
* file names. This can be used to run tests in a
@@ -97,14 +97,22 @@ static const char *multi_letters = "msbrglo";
/* The # of seconds to wait for the message file--used by h5_wait_message() */
#define MESSAGE_TIMEOUT 300 /* Timeout in seconds */
+/* The strings that correspond to library version bounds H5F_libver_t in H5Fpublic.h */
+/* This is used by h5_get_version_string() */
+const char *LIBVER_NAMES[] = {
+ "earliest", /* H5F_LIBVER_EARLIEST = 0 */
+ "v18", /* H5F_LIBVER_V18 = 1 */
+ "latest", /* H5F_LIBVER_V110 = 2 */
+ NULL
+};
+
/* Previous error reporting function */
static H5E_auto2_t err_func = NULL;
static herr_t h5_errors(hid_t estack, void *client_data);
-static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix,
+static char *h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix,
char *fullname, size_t size, hbool_t nest_printf);
-
/*-------------------------------------------------------------------------
* Function: h5_errors
*
@@ -129,7 +137,7 @@ h5_errors(hid_t estack, void H5_ATTR_UNUSED *client_data)
return 0;
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_clean_files
*
@@ -149,47 +157,8 @@ h5_clean_files(const char *base_name[], hid_t fapl)
int i;
for(i = 0; base_name[i]; i++) {
- char filename[1024];
- char temp[2048];
- hid_t driver;
-
- if(NULL == h5_fixname(base_name[i], fapl, filename, sizeof(filename)))
- continue;
-
- driver = H5Pget_driver(fapl);
-
- if(driver == H5FD_FAMILY) {
- int j;
-
- for(j = 0; /*void*/; j++) {
- HDsnprintf(temp, sizeof temp, filename, j);
-
- if(HDaccess(temp, F_OK) < 0)
- break;
-
- HDremove(temp);
- } /* end for */
- } else if(driver == H5FD_CORE) {
- hbool_t backing; /* Whether the core file has backing store */
-
- H5Pget_fapl_core(fapl, NULL, &backing);
-
- /* If the file was stored to disk with bacing store, remove it */
- if(backing)
- HDremove(filename);
- } else if (driver == H5FD_MULTI) {
- H5FD_mem_t mt;
-
- HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
-
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
- HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]);
- HDremove(temp); /*don't care if it fails*/
- } /* end for */
- } else {
- HDremove(filename);
- }
- } /* end for */
+ h5_delete_test_file(base_name[i], fapl);
+ }
/* Close the FAPL used to access the file */
H5Pclose(fapl);
@@ -197,7 +166,7 @@ h5_clean_files(const char *base_name[], hid_t fapl)
return;
} /* end h5_clean_files() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_delete_test_file
*
@@ -215,6 +184,14 @@ h5_clean_files(const char *base_name[], hid_t fapl)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * sub_filename in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
void
h5_delete_test_file(const char *base_name, hid_t fapl)
{
@@ -257,15 +234,16 @@ h5_delete_test_file(const char *base_name, hid_t fapl)
for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
HDsnprintf(sub_filename, sizeof(sub_filename), "%s-%c.h5", filename, multi_letters[mt]);
HDremove(sub_filename);
- } /* end for */
+ }
} else {
HDremove(filename);
- } /* end if */
+ } /* end driver selection tree */
return;
} /* end h5_delete_test_file() */
+#pragma GCC diagnostic pop
+
-
/*-------------------------------------------------------------------------
* Function: h5_delete_all_test_files
*
@@ -298,7 +276,7 @@ h5_delete_all_test_files(const char *base_name[], hid_t fapl)
return;
} /* end h5_delete_all_test_files() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_cleanup
*
@@ -331,7 +309,7 @@ h5_cleanup(const char *base_name[], hid_t fapl)
return retval;
} /* end h5_cleanup() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_test_shutdown
*
@@ -360,7 +338,7 @@ h5_test_shutdown(void)
return;
} /* end h5_test_shutdown() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_restore_err
*
@@ -382,7 +360,7 @@ h5_restore_err(void)
err_func = NULL;
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_reset
*
@@ -424,7 +402,7 @@ h5_reset(void)
* Cause the library to emit some diagnostics early so they don't
* interfere with other formatted output.
*/
- sprintf(filename, "/tmp/h5emit-%05d.h5", HDgetpid());
+ HDsprintf(filename, "/tmp/h5emit-%05d.h5", HDgetpid());
H5E_BEGIN_TRY {
hid_t file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT,
H5P_DEFAULT);
@@ -437,7 +415,7 @@ h5_reset(void)
#endif /* OLD_WAY */
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_test_init
*
@@ -470,7 +448,7 @@ h5_test_init(void)
return;
} /* end h5_test_init() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_fixname
*
@@ -499,7 +477,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
return (h5_fixname_real(base_name, fapl, ".h5", fullname, size, FALSE));
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_fixname_no_suffix
*
@@ -519,7 +497,7 @@ h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t s
return (h5_fixname_real(base_name, fapl, NULL, fullname, size, FALSE));
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_fixname_printf
*
@@ -545,7 +523,7 @@ h5_fixname_printf(const char *base_name, hid_t fapl, char *fullname, size_t size
return (h5_fixname_real(base_name, fapl, ".h5", fullname, size, TRUE));
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_fixname_real
*
@@ -569,10 +547,11 @@ h5_fixname_printf(const char *base_name, hid_t fapl, char *fullname, size_t size
*-------------------------------------------------------------------------
*/
static char *
-h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix,
+h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix,
char *fullname, size_t size, hbool_t nest_printf)
{
const char *prefix = NULL;
+ const char *env = NULL; /* HDF5_DRIVER environment variable */
char *ptr, last = '\0';
const char *suffix = _suffix;
size_t i, j;
@@ -590,17 +569,37 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix,
return NULL;
if(suffix) {
- if(H5FD_FAMILY == driver)
+ if(H5FD_FAMILY == driver) {
suffix = nest_printf ? "%%05d.h5" : "%05d.h5";
- else if (H5FD_MULTI == driver)
- suffix = NULL;
+ }
+ else if (H5FD_MULTI == driver) {
+
+ /* Get the environment variable, if it exists, in case
+ * we are using the split driver since both of those
+ * use the multi VFD under the hood.
+ */
+ env = HDgetenv("HDF5_DRIVER");
+#ifdef HDF5_DRIVER
+ /* Use the environment variable, then the compile-time constant */
+ if(!env)
+ env = HDF5_DRIVER;
+#endif
+ if(env && !HDstrcmp(env, "split")) {
+ /* split VFD */
+ suffix = NULL;
+ }
+ else {
+ /* multi VFD */
+ suffix = NULL;
+ }
+ }
}
}
/* Must first check fapl is not H5P_DEFAULT (-1) because H5FD_XXX
* could be of value -1 if it is not defined.
*/
- isppdriver = H5P_DEFAULT != fapl && (H5FD_MPIO==driver);
+ isppdriver = H5P_DEFAULT != fapl && (H5FD_MPIO == driver);
/* Check HDF5_NOCLEANUP environment setting.
* (The #ifdef is needed to prevent compile failure in case MPI is not
@@ -640,7 +639,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix,
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
if (mpi_rank == 0)
- printf("*** Hint ***\n"
+ HDprintf("*** Hint ***\n"
"You can use environment variable HDF5_PARAPREFIX to "
"run parallel test files in a\n"
"different directory or to add file type prefix. e.g.,\n"
@@ -756,7 +755,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix,
return fullname;
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_rmprefix
*
@@ -787,16 +786,16 @@ h5_rmprefix(const char *filename)
return(ret_ptr);
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_fileaccess
*
* Purpose: Returns a file access template which is the default template
- * but with a file driver set according to the constant or
- * environment variable HDF5_DRIVER
+ * but with a file driver set
+ * according to a constant or environment variable HDF5_DRIVER
*
- * Return: Success: A file access property list
- * Failure: -1
+ * Return: Success: A file access property list
+ * Failure: H5I_INVALID_HID
*
* Programmer: Robb Matzke
* Thursday, November 19, 1998
@@ -806,135 +805,67 @@ h5_rmprefix(const char *filename)
hid_t
h5_fileaccess(void)
{
- const char *val = NULL;
- const char *name;
- char s[1024];
- hid_t fapl = -1;
+ hid_t fapl_id = H5I_INVALID_HID;
- /* First use the environment variable, then the constant */
- val = HDgetenv("HDF5_DRIVER");
-#ifdef HDF5_DRIVER
- if(!val)
- val = HDF5_DRIVER;
-#endif
+ if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- return -1;
- if(!val || !*val)
- return fapl; /* use default */
-
- HDstrncpy(s, val, sizeof s);
- s[sizeof(s)-1] = '\0';
- if(NULL == (name = HDstrtok(s, " \t\n\r")))
- return fapl;
-
- if(!HDstrcmp(name, "sec2")) {
- /* Unix read() and write() system calls */
- if (H5Pset_fapl_sec2(fapl) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "stdio")) {
- /* Standard C fread() and fwrite() system calls */
- if (H5Pset_fapl_stdio(fapl) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "core")) {
- /* In-memory driver settings (backing store on, 1 MB increment) */
- if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "core_paged")) {
- /* In-memory driver with write tracking and paging on */
- if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
- if(H5Pset_core_write_tracking(fapl, TRUE, (size_t)4096) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "split")) {
- /* Split meta data and raw data each using default driver */
- if(H5Pset_fapl_split(fapl,
- "-m.h5", H5P_DEFAULT,
- "-r.h5", H5P_DEFAULT) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "multi")) {
- /* Multi-file driver, general case of the split driver */
- H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
- hid_t memb_fapl[H5FD_MEM_NTYPES];
- const char *memb_name[H5FD_MEM_NTYPES];
- char *sv[H5FD_MEM_NTYPES];
- haddr_t memb_addr[H5FD_MEM_NTYPES];
- H5FD_mem_t mt;
+ /* Attempt to set up a file driver first */
+ if(h5_get_vfd_fapl(fapl_id) < 0)
+ goto error;
- HDmemset(memb_map, 0, sizeof memb_map);
- HDmemset(memb_fapl, 0, sizeof memb_fapl);
- HDmemset(memb_name, 0, sizeof memb_name);
- HDmemset(memb_addr, 0, sizeof memb_addr);
+ return fapl_id;
- HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
- memb_fapl[mt] = H5P_DEFAULT;
- if(NULL == (sv[mt] = (char *)HDmalloc(H5TEST_MULTI_FILENAME_LEN)))
- return -1;
- HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
- memb_name[mt] = sv[mt];
- memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10);
- } /* end for */
+error:
+ if(fapl_id != H5I_INVALID_HID)
+ H5Pclose(fapl_id);
+ return H5I_INVALID_HID;
+} /* end h5_fileaccess() */
- if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0)
- return -1;
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
- HDfree(sv[mt]);
- }
- else if(!HDstrcmp(name, "family")) {
- hsize_t fam_size = 100*1024*1024; /*100 MB*/
+/*-------------------------------------------------------------------------
+ * Function: h5_fileaccess_flags
+ *
+ * Purpose: Returns a file access template which is the default template
+ * but with a file driver, VOL connector, or libver bound set
+ * according to a constant or environment variable
+ *
+ * Return: Success: A file access property list
+ * Failure: H5I_INVALID_HID
+ *
+ * Programmer: Robb Matzke
+ * Thursday, November 19, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+h5_fileaccess_flags(unsigned flags)
+{
+ hid_t fapl_id = H5I_INVALID_HID;
- /* Family of files, each 1MB and using the default driver */
- if((val = HDstrtok(NULL, " \t\n\r")))
- fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024);
- if(H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0)
- return -1;
- }
- else if(!HDstrcmp(name, "log")) {
- unsigned log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC;
+ if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
- /* Log file access */
- if((val = HDstrtok(NULL, " \t\n\r")))
- log_flags = (unsigned)HDstrtol(val, NULL, 0);
- if(H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "direct")) {
-#ifdef H5_HAVE_DIRECT
- /* Linux direct read() and write() system calls. Set memory boundary, file block size,
- * and copy buffer size to the default values. */
- if(H5Pset_fapl_direct(fapl, 1024, 4096, 8 * 4096) < 0)
- return -1;
-#endif
- }
- else if(!HDstrcmp(name, "latest")) {
- /* use the latest format */
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- return -1;
- }
- else {
- /* Unknown driver */
- return -1;
- }
+ /* Attempt to set up a file driver first */
+ if((flags & H5_FILEACCESS_VFD) && h5_get_vfd_fapl(fapl_id) < 0)
+ goto error;
+
+ return fapl_id;
+
+error:
+ if(fapl_id != H5I_INVALID_HID)
+ H5Pclose(fapl_id);
+ return H5I_INVALID_HID;
+} /* end h5_fileaccess_flags() */
- return fapl;
-}
-
/*-------------------------------------------------------------------------
* Function: h5_get_vfd_fapl
*
- * Purpose: Returns a file access property list which is the default
- * fapl but with a file driver set according to the constant or
- * environment variable HDF5_DRIVER.
+ * Purpose: Sets the file driver for a FAPL according to the value specified
+ * in the constant or environment variable "HDF5_DRIVER".
*
- * Return: Success: A file access property list ID
+ * Return: Success: 0
* Failure: -1
*
* Programmer: Dana Robinson
@@ -942,60 +873,59 @@ h5_fileaccess(void)
*
*-------------------------------------------------------------------------
*/
-hid_t
-h5_get_vfd_fapl(void)
+herr_t
+h5_get_vfd_fapl(hid_t fapl)
{
const char *env = NULL; /* HDF5_DRIVER environment variable */
const char *tok = NULL; /* strtok pointer */
+ char *lasts = NULL; /* Context pointer for strtok_r() call */
char buf[1024]; /* buffer for tokenizing HDF5_DRIVER */
- hid_t fapl = -1; /* fapl to be returned */
/* Get the environment variable, if it exists */
env = HDgetenv("HDF5_DRIVER");
-
- /* Create a default fapl */
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- return -1;
+#ifdef HDF5_DRIVER
+ /* Use the environment variable, then the compile-time constant */
+ if(!env)
+ env = HDF5_DRIVER;
+#endif
/* If the environment variable was not set, just return
- * the default fapl.
+ * without modifying the FAPL.
*/
if(!env || !*env)
- return fapl;
+ goto done;
/* Get the first 'word' of the environment variable.
* If it's nothing (environment variable was whitespace)
* just return the default fapl.
*/
HDstrncpy(buf, env, sizeof(buf));
- HDmemset(buf, 0, sizeof(buf));
- if(NULL == (tok = HDstrtok(buf, " \t\n\r")))
- return fapl;
+ buf[sizeof(buf) - 1] = '\0';
+ if(NULL == (tok = HDstrtok_r(buf, " \t\n\r", &lasts)))
+ goto done;
if(!HDstrcmp(tok, "sec2")) {
/* POSIX (section 2) read() and write() system calls */
if(H5Pset_fapl_sec2(fapl) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "stdio")) {
/* Standard C fread() and fwrite() system calls */
if(H5Pset_fapl_stdio(fapl) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "core")) {
/* In-memory driver settings (backing store on, 1 MB increment) */
- if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
+ if(H5Pset_fapl_core(fapl, (size_t)H5_MB, TRUE) < 0)
+ goto error;
} else if(!HDstrcmp(tok, "core_paged")) {
/* In-memory driver with write tracking and paging on */
- if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
+ if(H5Pset_fapl_core(fapl, (size_t)H5_MB, TRUE) < 0)
+ goto error;
if(H5Pset_core_write_tracking(fapl, TRUE, (size_t)4096) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "split")) {
/* Split meta data and raw data each using default driver */
- if(H5Pset_fapl_split(fapl,
- "-m.h5", H5P_DEFAULT,
- "-r.h5", H5P_DEFAULT) < 0)
- return -1;
+ if(H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0)
+ goto error;
} else if(!HDstrcmp(tok, "multi")) {
/* Multi-file driver, general case of the split driver */
H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
@@ -1021,46 +951,50 @@ h5_get_vfd_fapl(void)
} /* end for */
if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0)
- return -1;
+ goto error;
for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
HDfree(sv[mt]);
} else if(!HDstrcmp(tok, "family")) {
/* Family of files, each 1MB and using the default driver */
- hsize_t fam_size = 100*1024*1024; /*100 MB*/
+ hsize_t fam_size = 100 * 1024 * 1024; /* 100 MB */
/* Was a family size specified in the environment variable? */
- if((tok = HDstrtok(NULL, " \t\n\r")))
- fam_size = (hsize_t)(HDstrtod(tok, NULL) * 1024*1024);
+ if((tok = HDstrtok_r(NULL, " \t\n\r", &lasts)))
+ fam_size = (hsize_t)(HDstrtod(tok, NULL) * 1024 * 1024);
if(H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "log")) {
/* Log file access */
unsigned log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC;
/* Were special log file flags specified in the environment variable? */
- if((tok = HDstrtok(NULL, " \t\n\r")))
+ if((tok = HDstrtok_r(NULL, " \t\n\r", &lasts)))
log_flags = (unsigned)HDstrtol(tok, NULL, 0);
if(H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0)
- return -1;
+ goto error;
#ifdef H5_HAVE_DIRECT
} else if(!HDstrcmp(tok, "direct")) {
/* Linux direct read() and write() system calls. Set memory boundary,
* file block size, and copy buffer size to the default values.
*/
- if(H5Pset_fapl_direct(fapl, 1024, 4096, 8*4096)<0)
- return -1;
+ if(H5Pset_fapl_direct(fapl, 1024, 4096, 8 * 4096) < 0)
+ goto error;
#endif
} else {
/* Unknown driver */
- return -1;
+ goto error;
} /* end if */
- return fapl;
+done:
+ return 0;
+
+error:
+ return -1;
} /* end h5_get_vfd_fapl() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_no_hwconv
*
@@ -1081,7 +1015,7 @@ h5_no_hwconv(void)
H5Tunregister(H5T_PERS_HARD, NULL, (hid_t)-1, (hid_t)-1, NULL);
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_show_hostname
*
@@ -1115,15 +1049,15 @@ h5_show_hostname(void)
if(mpi_initialized && !mpi_finalized) {
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
- printf("MPI-process %d.", mpi_rank);
+ HDprintf("MPI-process %d.", mpi_rank);
}
else
- printf("thread 0.");
+ HDprintf("thread 0.");
}
#elif defined(H5_HAVE_THREADSAFE)
- printf("thread %lu.", HDpthread_self_ulong());
+ HDprintf("thread %lu.", HDpthread_self_ulong());
#else
- printf("thread 0.");
+ HDprintf("thread 0.");
#endif
#ifdef H5_HAVE_WIN32_API
@@ -1148,19 +1082,19 @@ h5_show_hostname(void)
#endif
#ifdef H5_HAVE_GETHOSTNAME
- if (gethostname(hostname, (size_t)80) < 0)
- printf(" gethostname failed\n");
+ if (HDgethostname(hostname, (size_t)80) < 0)
+ HDprintf(" gethostname failed\n");
else
- printf(" hostname=%s\n", hostname);
+ HDprintf(" hostname=%s\n", hostname);
#else
- printf(" gethostname not supported\n");
+ HDprintf(" gethostname not supported\n");
#endif
#ifdef H5_HAVE_WIN32_API
WSACleanup();
#endif
}
-
+
#ifdef H5_HAVE_PARALLEL
/*
* Function: h5_set_info_object
@@ -1182,7 +1116,7 @@ h5_set_info_object(void)
int ret_value=0;
/* handle any MPI INFO hints via $HDF5_MPI_INFO */
- if ((envp = getenv("HDF5_MPI_INFO")) != NULL){
+ if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL){
char *next, *valp;
valp = envp = next = HDstrdup(envp);
@@ -1244,7 +1178,7 @@ h5_set_info_object(void)
/* actually set the darned thing */
if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
- printf("MPI_Info_set failed\n");
+ HDprintf("MPI_Info_set failed\n");
ret_value = -1;
}
}
@@ -1259,7 +1193,7 @@ h5_set_info_object(void)
return ret_value;
}
-
+
/*
* Function: h5_dump_info_object
* Purpose: Display content of an MPI Info object
@@ -1275,25 +1209,25 @@ h5_dump_info_object(MPI_Info info)
int flag;
int i, nkeys;
- printf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info,
+ HDprintf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info,
MPI_MAX_INFO_VAL);
if (info==MPI_INFO_NULL){
- printf("object is MPI_INFO_NULL\n");
+ HDprintf("object is MPI_INFO_NULL\n");
}
else {
MPI_Info_get_nkeys(info, &nkeys);
- printf("object has %d items\n", nkeys);
+ HDprintf("object has %d items\n", nkeys);
for (i=0; i<nkeys; i++){
MPI_Info_get_nthkey(info, i, key);
MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
- printf("%s=%s\n", key, value);
+ HDprintf("%s=%s\n", key, value);
}
}
}
#endif /* H5_HAVE_PARALLEL */
-
+
/*-------------------------------------------------------------------------
* Function: h5_get_file_size
*
@@ -1307,6 +1241,14 @@ h5_dump_info_object(MPI_Info info)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * temp in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
h5_stat_size_t
h5_get_file_size(const char *filename, hid_t fapl)
{
@@ -1408,6 +1350,7 @@ h5_get_file_size(const char *filename, hid_t fapl)
return(-1);
} /* end get_file_size() */
+#pragma GCC diagnostic pop
/*
* This routine is designed to provide equivalent functionality to 'printf'
@@ -1420,15 +1363,15 @@ print_func(const char *format, ...)
va_list arglist;
int ret_value;
- va_start(arglist, format);
- ret_value = vprintf(format, arglist);
- va_end(arglist);
+ HDva_start(arglist, format);
+ ret_value = HDvprintf(format, arglist);
+ HDva_end(arglist);
return ret_value;
}
#ifdef H5_HAVE_FILTER_SZIP
-
+
/*-------------------------------------------------------------------------
* Function: h5_szip_can_encode
*
@@ -1507,7 +1450,7 @@ getenv_all(MPI_Comm comm, int root, const char* name)
int len;
static char* env = NULL;
- assert(name);
+ HDassert(name);
MPI_Initialized(&mpi_initialized);
MPI_Finalized(&mpi_finalized);
@@ -1515,7 +1458,7 @@ getenv_all(MPI_Comm comm, int root, const char* name)
if(mpi_initialized && !mpi_finalized) {
MPI_Comm_rank(comm, &mpi_rank);
MPI_Comm_size(comm, &mpi_size);
- assert(root < mpi_size);
+ HDassert(root < mpi_size);
/* The root task does the getenv call
* and sends the result to the other tasks */
@@ -1605,7 +1548,7 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name)
while((nread = HDread(fd_old, buf, (size_t)READ_BUF_SIZE)) > 0)
if(HDwrite(fd_new, buf, (size_t)nread) < 0)
goto error;
-
+
/* Close files */
if(HDclose(fd_old) < 0)
goto error;
@@ -1627,21 +1570,17 @@ error:
return -1;
} /* end h5_make_local_copy() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_verify_cached_stabs_cb
*
* Purpose: Callback function for h5_verify_cached_stabs.
*
- * Return: Success: 0
- *
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
* Programmer: Neil Fortner
* Tuesday, April 12, 2011
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1649,12 +1588,12 @@ h5_verify_cached_stabs_cb(hid_t oid, const char H5_ATTR_UNUSED *name,
const H5O_info_t *oinfo, void H5_ATTR_UNUSED *udata)
{
if(oinfo->type == H5O_TYPE_GROUP)
- return(H5G__verify_cached_stabs_test(oid));
+ return H5G__verify_cached_stabs_test(oid);
else
- return(0);
+ return SUCCEED;
} /* end h5_verify_cached_stabs_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_verify_cached_stabs
*
@@ -1717,16 +1656,16 @@ error:
/*-------------------------------------------------------------------------
* Function: h5_send_message
- *
+ *
* Purpose: Sends the specified signal.
- *
+ *
* In terms of this test framework, a signal consists of a file
- * on disk. Since there are multiple processes that need to
+ * on disk. Since there are multiple processes that need to
* communicate with each other, they do so by writing and
- * reading signal files on disk, the names and contents of
+ * reading signal files on disk, the names and contents of
* which are used to inform a process about when it can
* proceed and what it should do next.
- *
+ *
* This function writes a signal file. The first argument is
* the name of the signal file, and the second and third
* arguments are the contents of the first two lines of the
@@ -1736,7 +1675,7 @@ error:
*
* Programmer: Mike McGreevy
* August 18, 2010
- *
+ *
*-------------------------------------------------------------------------
*/
void
@@ -1755,7 +1694,7 @@ h5_send_message(const char *send, const char *arg1, const char *arg2)
else if(arg1 != NULL) {
HDassert(arg2 == NULL);
HDfprintf(signalfile, "%s\n", arg1);
- } /* end if */
+ } /* end if */
else {
HDassert(arg1 == NULL);
HDassert(arg2 == NULL);
@@ -1768,38 +1707,38 @@ h5_send_message(const char *send, const char *arg1, const char *arg2)
/*-------------------------------------------------------------------------
* Function: h5_wait_message
- *
+ *
* Purpose: Waits for the specified signal.
- *
+ *
* In terms of this test framework, a signal consists of a file
- * on disk. Since there are multiple processes that need to
+ * on disk. Since there are multiple processes that need to
* communicate with each other, they do so by writing and
- * reading signal files on disk, the names and contents of
+ * reading signal files on disk, the names and contents of
* which are used to inform a process about when it can
* proceed and what it should do next.
- *
+ *
* This function continuously attempts to read the specified
* signal file from disk, and only continues once it has
* successfully done so (i.e., only after another process has
* called the "h5_send_message" function to write the signal file).
- * This functon will then immediately remove the file (i.e.,
- * to indicate that it has been received and can be reused),
+ * This functon will then immediately remove the file (i.e.,
+ * to indicate that it has been received and can be reused),
* and then exits, allowing the calling function to continue.
*
* Return: void
*
* Programmer: Mike McGreevy
* August 18, 2010
- *
+ *
*-------------------------------------------------------------------------
*/
herr_t
-h5_wait_message(const char *waitfor)
+h5_wait_message(const char *waitfor)
{
FILE *returnfile;
time_t t0,t1;
- /* Start timer. If this function runs for too long (i.e.,
+ /* Start timer. If this function runs for too long (i.e.,
expected signal is never received), it will
return failure */
HDtime(&t0);
@@ -1887,10 +1826,10 @@ static const H5FD_class_t H5FD_dummy_g = {
NULL, /* truncate */
NULL, /* lock */
NULL, /* unlock */
- H5FD_FLMAP_DICHOTOMY /* fl_map */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
};
-
+
/*-------------------------------------------------------------------------
* Function: h5_get_dummy_vfd_class()
*
@@ -1931,3 +1870,17 @@ error:
return NULL;
} /* h5_get_dummy_vfd_class */
+/*-------------------------------------------------------------------------
+ * Function: h5_get_version_string
+ *
+ * Purpose: Get the string that corresponds to the libvery version bound.
+ *
+ * Return: The string
+ *
+ *-------------------------------------------------------------------------
+ */
+char *
+h5_get_version_string(H5F_libver_t libver)
+{
+ return(LIBVER_NAMES[libver]);
+} /* end of h5_get_version_string */
diff --git a/test/h5test.h b/test/h5test.h
index 8e87192..23991ad 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -78,7 +78,7 @@
#define BEGINTEST 3 /* Skip all tests before this test */
/*
- * This contains the filename prefix specificied as command line option for
+ * This contains the filename prefix specified as command line option for
* the parallel test files.
*/
H5TEST_DLLVAR char *paraprefix;
@@ -89,7 +89,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
/*
* Print the current location on the standard output stream.
*/
-#define AT() printf (" at %s:%d in %s()...\n", \
+#define AT() HDprintf (" at %s:%d in %s()...\n", \
__FILE__, __LINE__, FUNC);
/*
@@ -101,18 +101,18 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
* spaces. If the h5_errors() is used for automatic error handling then
* the H5_FAILED() macro is invoked automatically when an API function fails.
*/
-#define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);}
-#define TESTING_2(WHAT) {printf(" Testing %-62s",WHAT); fflush(stdout);}
-#define PASSED() {puts(" PASSED");fflush(stdout);}
-#define H5_FAILED() {puts("*FAILED*");fflush(stdout);}
-#define H5_WARNING() {puts("*WARNING*");fflush(stdout);}
-#define SKIPPED() {puts(" -SKIP-");fflush(stdout);}
-#define PUTS_ERROR(s) {puts(s); AT(); goto error;}
+#define TESTING(WHAT) {HDprintf("Testing %-62s",WHAT); HDfflush(stdout);}
+#define TESTING_2(WHAT) {HDprintf(" Testing %-60s",WHAT); HDfflush(stdout);}
+#define PASSED() {HDputs(" PASSED");HDfflush(stdout);}
+#define H5_FAILED() {HDputs("*FAILED*");HDfflush(stdout);}
+#define H5_WARNING() {HDputs("*WARNING*");HDfflush(stdout);}
+#define SKIPPED() {HDputs(" -SKIP-");HDfflush(stdout);}
+#define PUTS_ERROR(s) {HDputs(s); AT(); goto error;}
#define TEST_ERROR {H5_FAILED(); AT(); goto error;}
#define STACK_ERROR {H5Eprint2(H5E_DEFAULT, stdout); goto error;}
#define FAIL_STACK_ERROR {H5_FAILED(); AT(); H5Eprint2(H5E_DEFAULT, stdout); \
goto error;}
-#define FAIL_PUTS_ERROR(s) {H5_FAILED(); AT(); puts(s); goto error;}
+#define FAIL_PUTS_ERROR(s) {H5_FAILED(); AT(); HDputs(s); goto error;}
/*
* Alarm definitions to wait up (terminate) a test that runs too long.
@@ -121,6 +121,9 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
#define ALARM_ON TestAlarmOn()
#define ALARM_OFF HDalarm(0)
+/* Flags for h5_fileaccess_flags() */
+#define H5_FILEACCESS_VFD 0x01
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -132,6 +135,7 @@ H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, s
H5TEST_DLL char *h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size);
H5TEST_DLL char *h5_fixname_printf(const char *base_name, hid_t fapl, char *fullname, size_t size);
H5TEST_DLL hid_t h5_fileaccess(void);
+H5TEST_DLL hid_t h5_fileaccess_flags(unsigned flags);
H5TEST_DLL void h5_no_hwconv(void);
H5TEST_DLL const char *h5_rmprefix(const char *filename);
H5TEST_DLL void h5_reset(void);
@@ -142,13 +146,10 @@ H5TEST_DLL int print_func(const char *format, ...);
H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_copy_name);
H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl);
H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void);
+H5TEST_DLL char *h5_get_version_string(H5F_libver_t libver);
-/* Functions that will replace VFD-dependent functions that violate
- * the single responsibility principle. Unlike their predecessors,
- * these new functions do not have hidden side effects.
- */
-/* h5_fileaccess() replacement */
-H5TEST_DLL hid_t h5_get_vfd_fapl(void);
+/* Functions that will replace components of a FAPL */
+H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id);
/* h5_clean_files() replacements */
H5TEST_DLL void h5_delete_test_file(const char *base_name, hid_t fapl);
diff --git a/test/hdfs.c b/test/hdfs.c
new file mode 100644
index 0000000..ab39da6
--- /dev/null
+++ b/test/hdfs.c
@@ -0,0 +1,1767 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Read-Only HDFS Virtual File Driver (VFD)
+ *
+ * Purpose:
+ *
+ * Verify behavior for Read-Only HDFS VFD.
+ *
+ * Demonstrates basic use cases and fapl interaction.
+ *
+ * Programmer: Jacob Smith <jake.smith@hdfgroup.org>
+ * 2018-04-23
+ */
+
+#include "h5test.h" /* testing utilities */
+#include "H5FDhdfs.h" /* this file driver's utilities */
+
+
+#ifdef H5_HAVE_LIBHDFS
+#define HDFS_TEST_DEBUG 0
+#define HDFS_TEST_MAX_BUF_SIZE 256
+#endif /* H5_HAVE_LIBHDFS */
+
+/*****************************************************************************
+ *
+ * FILE-LOCAL TESTING MACROS
+ *
+ * Purpose:
+ *
+ * 1) Upon test failure, goto-jump to single-location teardown in test
+ * function. E.g., `error:` (consistency with HDF corpus) or
+ * `failed:` (reflects purpose).
+ * >>> using "error", in part because `H5E_BEGIN_TRY` expects it.
+ * 2) Increase clarity and reduce overhead found with `TEST_ERROR`.
+ * e.g., "if(somefunction(arg, arg2) < 0) TEST_ERROR:"
+ * requires reading of entire line to know whether this if/call is
+ * part of the test setup, test operation, or a test unto itself.
+ * 3) Provide testing macros with optional user-supplied failure message;
+ * if not supplied (NULL), generate comparison output in the spirit of
+ * test-driven development. E.g., "expected 5 but was -3"
+ * User messages clarify test's purpose in code, encouraging description
+ * without relying on comments.
+ * 4) Configurable expected-actual order in generated comparison strings.
+ * Some prefer `VERIFY(expected, actual)`, others
+ * `VERIFY(actual, expected)`. Provide preprocessor ifdef switch
+ * to satifsy both parties, assuming one paradigm per test file.
+ * (One could #undef and redefine the flag through the file as desired,
+ * but _why_.)
+ *
+ * Provided as courtesy, per consideration for inclusion in the library
+ * proper.
+ *
+ * Macros:
+ *
+ * JSVERIFY_EXP_ACT - ifdef flag, configures comparison order
+ * FAIL_IF() - check condition
+ * FAIL_UNLESS() - check _not_ condition
+ * JSVERIFY() - long-int equality check; prints reason/comparison
+ * JSVERIFY_NOT() - long-int inequality check; prints
+ * JSVERIFY_STR() - string equality check; prints
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *****************************************************************************/
+
+
+/*----------------------------------------------------------------------------
+ *
+ * ifdef flag: JSVERIFY_EXP_ACT
+ *
+ * JSVERIFY macros accept arguments as (EXPECTED, ACTUAL[, reason])
+ * default, if this is undefined, is (ACTUAL, EXPECTED[, reason])
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_EXP_ACT 1L
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSFAILED_AT()
+ *
+ * Purpose:
+ *
+ * Preface a test failure by printing "*FAILED*" and location to stdout
+ * Similar to `H5_FAILED(); AT();` from h5test.h
+ *
+ * *FAILED* at somefile.c:12 in function_name()...
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSFAILED_AT() { \
+ HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: FAIL_IF()
+ *
+ * Purpose:
+ *
+ * Make tests more accessible and less cluttered than
+ * `if (thing == otherthing()) TEST_ERROR`
+ * paradigm.
+ *
+ * The following lines are roughly equivalent:
+ *
+ * `if (myfunc() < 0) TEST_ERROR;` (as seen elsewhere in HDF tests)
+ * `FAIL_IF(myfunc() < 0)`
+ *
+ * Prints a generic "FAILED AT" line to stdout and jumps to `error`,
+ * similar to `TEST_ERROR` in h5test.h
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-23
+ *
+ *----------------------------------------------------------------------------
+ */
+#define FAIL_IF(condition) \
+if (condition) { \
+ JSFAILED_AT() \
+ goto error; \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: FAIL_UNLESS()
+ *
+ * Purpose:
+ *
+ * TEST_ERROR wrapper to reduce cognitive overhead from "negative tests",
+ * e.g., "a != b".
+ *
+ * Opposite of FAIL_IF; fails if the given condition is _not_ true.
+ *
+ * `FAIL_IF( 5 != my_op() )`
+ * is equivalent to
+ * `FAIL_UNLESS( 5 == my_op() )`
+ * However, `JSVERIFY(5, my_op(), "bad return")` may be even clearer.
+ * (see JSVERIFY)
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#if 0 /* UNUSED */
+#define FAIL_UNLESS(condition) \
+if (!(condition)) { \
+ JSFAILED_AT() \
+ goto error; \
+}
+#endif /* UNUSED */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSERR_LONG()
+ *
+ * Purpose:
+ *
+ * Print an failure message for long-int arguments.
+ * ERROR-AT printed first.
+ * If `reason` is given, it is printed on own line and newlined after
+ * else, prints "expected/actual" aligned on own lines.
+ *
+ * *FAILED* at myfile.c:488 in somefunc()...
+ * forest must be made of trees.
+ *
+ * or
+ *
+ * *FAILED* at myfile.c:488 in somefunc()...
+ * ! Expected 425
+ * ! Actual 3
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSERR_LONG(expected, actual, reason) { \
+ JSFAILED_AT() \
+ if (reason!= NULL) { \
+ HDprintf("%s\n", (reason)); \
+ } else { \
+ HDprintf(" ! Expected %ld\n ! Actual %ld\n", \
+ (long)(expected), (long)(actual)); \
+ } \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSERR_STR()
+ *
+ * Purpose:
+ *
+ * Print an failure message for string arguments.
+ * ERROR-AT printed first.
+ * If `reason` is given, it is printed on own line and newlined after
+ * else, prints "expected/actual" aligned on own lines.
+ *
+ * *FAILED* at myfile.c:421 in myfunc()...
+ * Blue and Red strings don't match!
+ *
+ * or
+ *
+ * *FAILED* at myfile.c:421 in myfunc()...
+ * !!! Expected:
+ * this is my expected
+ * string
+ * !!! Actual:
+ * not what I expected at all
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSERR_STR(expected, actual, reason) { \
+ JSFAILED_AT() \
+ if ((reason) != NULL) { \
+ HDprintf("%s\n", (reason)); \
+ } else { \
+ HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", \
+ (expected), (actual)); \
+ } \
+}
+
+
+
+#ifdef JSVERIFY_EXP_ACT
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSVERIFY()
+ *
+ * Purpose:
+ *
+ * Verify that two long integers are equal.
+ * If unequal, print failure message
+ * (with `reason`, if not NULL; expected/actual if NULL)
+ * and jump to `error` at end of function
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY(expected, actual, reason) \
+if ((long)(actual) != (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)) \
+ goto error; \
+} /* JSVERIFY */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSVERIFY_NOT()
+ *
+ * Purpose:
+ *
+ * Verify that two long integers are _not_ equal.
+ * If equal, print failure message
+ * (with `reason`, if not NULL; expected/actual if NULL)
+ * and jump to `error` at end of function
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_NOT(expected, actual, reason) \
+if ((long)(actual) == (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)) \
+ goto error; \
+} /* JSVERIFY_NOT */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSVERIFY_STR()
+ *
+ * Purpose:
+ *
+ * Verify that two strings are equal.
+ * If unequal, print failure message
+ * (with `reason`, if not NULL; expected/actual if NULL)
+ * and jump to `error` at end of function
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_STR(expected, actual, reason) \
+if (strcmp((actual), (expected)) != 0) { \
+ JSERR_STR((expected), (actual), (reason)); \
+ goto error; \
+} /* JSVERIFY_STR */
+
+
+#else
+/* JSVERIFY_EXP_ACT not defined
+ *
+ * Repeats macros above, but with actual/expected parameters reversed.
+ */
+
+
+/*----------------------------------------------------------------------------
+ * Macro: JSVERIFY()
+ * See: JSVERIFY documentation above.
+ * Programmer: Jacob Smith
+ * 2017-10-14
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY(actual, expected, reason) \
+if ((long)(actual) != (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)); \
+ goto error; \
+} /* JSVERIFY */
+
+
+/*----------------------------------------------------------------------------
+ * Macro: JSVERIFY_NOT()
+ * See: JSVERIFY_NOT documentation above.
+ * Programmer: Jacob Smith
+ * 2017-10-14
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_NOT(actual, expected, reason) \
+if ((long)(actual) == (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)) \
+ goto error; \
+} /* JSVERIFY_NOT */
+
+
+/*----------------------------------------------------------------------------
+ * Macro: JSVERIFY_STR()
+ * See: JSVERIFY_STR documentation above.
+ * Programmer: Jacob Smith
+ * 2017-10-14
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_STR(actual, expected, reason) \
+if (strcmp((actual), (expected)) != 0) { \
+ JSERR_STR((expected), (actual), (reason)); \
+ goto error; \
+} /* JSVERIFY_STR */
+
+#endif /* ifdef/else JSVERIFY_EXP_ACT */
+
+/********************************
+ * OTHER MACROS AND DEFINITIONS *
+ ********************************/
+
+/* copied from src/hdfs.c
+ */
+#ifdef H5_HAVE_LIBHDFS
+#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1)
+#endif /* H5_HAVE_LIBHDFS */
+
+#define HDFS_NAMENODE_NAME_MAX_SIZE 128
+
+/*******************************
+ * FILE-LOCAL GLOBAL VARIABLES *
+ *******************************/
+
+#ifdef H5_HAVE_LIBHDFS
+static const char filename_missing[] = "/tmp/missing.txt";
+static const char filename_bard[] = "/tmp/t8.shakespeare.txt";
+static const char filename_raven[] = "/tmp/Poe_Raven.txt";
+static const char filename_example_h5[] = "/tmp/t.h5";
+#endif /* H5_HAVE_LIBHDFS */
+
+static H5FD_hdfs_fapl_t default_fa = {
+ 1, /* fa version */
+ "localhost", /* namenode name */
+ 0, /* namenode port */
+ "", /* user name */
+ "", /* kerberos path */
+ 1024, /* buffer size */
+};
+
+/******************
+ * TEST FUNCTIONS *
+ ******************/
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_fapl_config_validation()
+ *
+ * Purpose:
+ *
+ * Test data consistency of fapl configuration.
+ * Tests `H5FD_hdfs_validate_config` indirectly through `H5Pset_fapl_hdfs`.
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2018-04-25
+ *
+ * Changes: None.
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_fapl_config_validation(void)
+{
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct testcase {
+ const char *msg;
+ herr_t expected;
+ H5FD_hdfs_fapl_t config;
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ hid_t fapl_id = -1; /* file access property list ID */
+ H5FD_hdfs_fapl_t config;
+ H5FD_hdfs_fapl_t fa_fetch;
+ herr_t success = SUCCEED;
+ unsigned int i = 0;
+ unsigned int ncases = 6; /* should equal number of cases */
+ struct testcase *case_ptr = NULL; /* dumb work-around for possible */
+ /* dynamic cases creation because */
+ /* of compiler warnings Wlarger-than */
+ struct testcase cases_arr[] = {
+ { "default config fapl",
+ SUCCEED,
+ { 1, /* version */
+ "localhost", /* namenode_name */
+ 0, /* namenode_port number */
+ "some_user", /* user_name */
+ "", /* kerberos_ticket_cache path */
+ -1, /* stream_buffer_size */
+ },
+ },
+ { "invalid version number (2)",
+ FAIL,
+ { 2, /* version */
+ "localhost", /* namenode_name */
+ 0, /* namenode_port number */
+ "some_user", /* user_name */
+ "", /* kerberos_ticket_cache path */
+ -1, /* stream_buffer_size */
+ },
+ },
+ { "invalid version number (0)",
+ FAIL,
+ { 0, /* version */
+ "localhost", /* namenode_name */
+ 0, /* namenode_port number */
+ "some_user", /* user_name */
+ "", /* kerberos_ticket_cache path */
+ -1, /* stream_buffer_size */
+ },
+ },
+ { "nonsense kerberos path still ok?",
+ SUCCEED,
+ { 1, /* version */
+ "localhost", /* namenode_name */
+ 0, /* namenode_port number */
+ "some_user", /* user_name */
+ "pathToSomewhere", /* kerberos_ticket_cache path */
+ -1, /* stream_buffer_size */
+ },
+ },
+ { "namenode port number too high",
+ FAIL,
+ { 1, /* version */
+ "localhost", /* namenode_name */
+ 88000, /* namenode_port number */
+ "some_user", /* user_name */
+ "", /* kerberos_ticket_cache path */
+ -1, /* stream_buffer_size */
+ },
+ },
+ { "negative namenode port number",
+ FAIL,
+ { 1, /* version */
+ "localhost", /* namenode_name */
+ -1, /* namenode_port number */
+ "some_user", /* user_name */
+ "", /* kerberos_ticket_cache path */
+ -1, /* stream_buffer_size */
+ },
+ },
+ };
+
+ TESTING("HDFS fapl configuration validation");
+
+ /*********
+ * TESTS *
+ *********/
+
+ for (i = 0; i < ncases; i++) {
+
+ /*---------------
+ * per-test setup
+ *---------------
+ */
+ case_ptr = &cases_arr[i];
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_id < 0 ) /* sanity-check */
+
+ /*-----------------------------------
+ * Actually test -- set fapl.
+ * Mute stack trace in failure cases.
+ *-----------------------------------
+ */
+ H5E_BEGIN_TRY {
+ /* `H5FD_hdfs_validate_config(...)` is static/private
+ * to src/hdfs.c and cannot (and should not?) be tested directly?
+ * Instead, validate config through public api.
+ */
+ success = H5Pset_fapl_hdfs(fapl_id, &case_ptr->config);
+ } H5E_END_TRY;
+
+ JSVERIFY( case_ptr->expected, success, case_ptr->msg )
+
+ /* Make sure we can get back what we put in.
+ * Only valid if the fapl configuration does not result in error.
+ */
+ if (success == SUCCEED) {
+ config = case_ptr->config;
+ JSVERIFY( SUCCEED,
+ H5Pget_fapl_hdfs(fapl_id, &fa_fetch),
+ "unable to get fapl" )
+ JSVERIFY( H5FD__CURR_HDFS_FAPL_T_VERSION,
+ fa_fetch.version,
+ "invalid version number" )
+ JSVERIFY( config.version,
+ fa_fetch.version,
+ "version number mismatch" )
+ JSVERIFY( config.namenode_port,
+ fa_fetch.namenode_port,
+ "namenode port mismatch" )
+ JSVERIFY( config.stream_buffer_size,
+ fa_fetch.stream_buffer_size,
+ "streambuffer size mismatch" )
+ JSVERIFY_STR( config.namenode_name,
+ fa_fetch.namenode_name,
+ NULL )
+ JSVERIFY_STR( config.user_name,
+ fa_fetch.user_name,
+ NULL )
+ JSVERIFY_STR( config.kerberos_ticket_cache,
+ fa_fetch.kerberos_ticket_cache,
+ NULL )
+ }
+
+ /*-----------------------------
+ * per-test sanitation/teardown
+ *-----------------------------
+ */
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ } /* for each test case */
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (fapl_id < 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+ return 1;
+
+} /* end test_fapl_config_validation() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: test_hdfs_fapl()
+ *
+ * Purpose: Tests the file handle interface for the HDFS driver.
+ *
+ * For now, test only fapl & flags. Extend as the
+ * work on the VFD continues.
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Jacob Smith
+ * 2018-04-25
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_hdfs_fapl(void)
+{
+ /************************
+ * test-local variables *
+ ************************/
+
+ hid_t fapl_id = -1; /* file access property list ID */
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
+ H5FD_hdfs_fapl_t hdfs_fa_0 = {
+ 1, /* version*/
+ "", /* node name */
+ 9000, /* node port */
+ "", /* username */
+ "", /* kerb cache path */
+ 1024, /* stream buffer size */
+ };
+
+ TESTING("HDFS fapl ");
+
+ /* Set property list and file name for HDFS driver.
+ */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_id < 0 )
+
+ FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_id, &hdfs_fa_0) )
+
+ driver_id = H5Pget_driver(fapl_id);
+ FAIL_IF( driver_id < 0 )
+
+ /****************
+ * Check that the VFD feature flags are correct
+ * SPEC MAY CHANGE
+ ******************/
+
+ FAIL_IF( H5FDdriver_query(driver_id, &driver_flags) < 0 )
+
+ JSVERIFY_NOT( 0, (driver_flags & H5FD_FEAT_DATA_SIEVE),
+ "bit(s) in `driver_flags` must align with "
+ "H5FD_FEAT_DATA_SIEVE" )
+
+ JSVERIFY( H5FD_FEAT_DATA_SIEVE, driver_flags,
+ "H5FD_FEAT_DATA_SIEVE should be the only supported flag")
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+
+ return 1;
+
+} /* end test_hdfs_fapl() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_vfd_open()
+ *
+ * Purpose:
+ *
+ * Demonstrate/specify VFD-level "Open" failure cases
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2018-06-07
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_vfd_open(void)
+{
+
+#ifndef H5_HAVE_LIBHDFS
+ TESTING("HDFS VFD-level open");
+ SKIPPED();
+ puts(" HDFS VFD is not enabled");
+ fflush(stdout);
+ return 0;
+
+#else
+
+ /*********************
+ * test-local macros *
+ *********************/
+
+/* selectors for which fapl to use in testcase */
+#define FAPL_H5P_DEFAULT -2
+#define FAPL_UNCONFIGURED -3 /* H5P_FILE_ACCESS */
+#define FAPL_HDFS -4
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct test_condition {
+ const char *message;
+ const char *url;
+ unsigned flags;
+ int which_fapl;
+ haddr_t maxaddr;
+ hbool_t might_use_other_driver;
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ struct test_condition failing_conditions[] = {
+ { "default property list (H5P_DEFAULT) is invalid",
+ filename_bard,
+ H5F_ACC_RDONLY,
+ FAPL_H5P_DEFAULT,
+ MAXADDR,
+ TRUE,
+ },
+ { "generic file access property list is invalid",
+ filename_bard,
+ H5F_ACC_RDONLY,
+ FAPL_UNCONFIGURED,
+ MAXADDR,
+ TRUE,
+ },
+ { "filename cannot be null",
+ NULL,
+ H5F_ACC_RDONLY,
+ FAPL_HDFS,
+ MAXADDR,
+ FALSE,
+ },
+ { "filename cannot be empty",
+ "",
+ H5F_ACC_RDONLY,
+ FAPL_HDFS,
+ MAXADDR,
+ FALSE,
+ },
+ { "file at filename must exist",
+ filename_missing,
+ H5F_ACC_RDONLY,
+ FAPL_HDFS,
+ MAXADDR,
+ FALSE,
+ },
+ { "read-write flag not supported",
+ filename_bard,
+ H5F_ACC_RDWR,
+ FAPL_HDFS,
+ MAXADDR,
+ FALSE,
+ },
+ { "truncate flag not supported",
+ filename_bard,
+ H5F_ACC_TRUNC,
+ FAPL_HDFS,
+ MAXADDR,
+ FALSE,
+ },
+ { "create flag not supported",
+ filename_bard,
+ H5F_ACC_CREAT,
+ FAPL_HDFS,
+ MAXADDR,
+ FALSE,
+ },
+ { "EXCL flag not supported",
+ filename_bard,
+ H5F_ACC_EXCL,
+ FAPL_HDFS,
+ MAXADDR,
+ FALSE,
+ },
+ { "maxaddr cannot be 0 (caught in `H5FD_open()`)",
+ filename_bard,
+ H5F_ACC_RDONLY,
+ FAPL_HDFS,
+ 0,
+ FALSE,
+ },
+ };
+ unsigned i = 0;
+ unsigned failing_conditions_count = 10;
+ H5FD_t *fd = NULL;
+ hid_t fapl_hdfs = -1;
+ hid_t fapl_unconfigured = -1;
+
+ TESTING("HDFS VFD-level open");
+
+ fapl_unconfigured = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_unconfigured < 0 )
+
+ fapl_hdfs = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_hdfs < 0 )
+ FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_hdfs, &default_fa) )
+
+ /*********
+ * TESTS *
+ *********/
+
+ /* all the test cases that will _not_ open
+ */
+ for (i = 0; i < failing_conditions_count; i++) {
+ struct test_condition T = failing_conditions[i];
+ hid_t fapl_id = H5P_DEFAULT;
+
+ fd = NULL;
+
+ if (T.which_fapl == FAPL_UNCONFIGURED) {
+ fapl_id = fapl_unconfigured;
+ }
+ else
+ if (T.which_fapl == FAPL_HDFS) {
+ fapl_id = fapl_hdfs;
+ }
+
+#if HDFS_TEST_DEBUG
+ HDfprintf(stderr, "testing: %s\n", T.message);
+#endif /* HDFS_TEST_DEBUG */
+
+ H5E_BEGIN_TRY {
+ fd = H5FDopen(T.url, T.flags, fapl_id, T.maxaddr);
+ } H5E_END_TRY;
+ if (NULL != fd) {
+ if (TRUE == T.might_use_other_driver &&
+ H5FD_HDFS != fd->driver_id)
+ {
+ HDfprintf(stderr, "\n!!!!! WARNING !!!!!\n" \
+ " Successful open of file on local system " \
+ "with non-HDFS VFD.\n");
+ JSVERIFY(SUCCEED, H5FDclose(fd),
+ "unable to close errant open");
+ fd = NULL;
+ }
+ else {
+ JSVERIFY(1, 0, T.message); /* print message and fail */
+ }
+ }
+ }
+
+ FAIL_IF( NULL != fd ) /* sanity check */
+
+#if HDFS_TEST_DEBUG
+ HDfprintf(stderr, "nominal open\n");
+#endif /* HDFS_TEST_DEBUG */
+
+ /* finally, show that a file can be opened
+ */
+ fd = H5FDopen(
+ filename_bard,
+ H5F_ACC_RDONLY,
+ fapl_hdfs,
+ MAXADDR);
+ FAIL_IF( NULL == fd )
+
+ /************
+ * TEARDOWN *
+ ************/
+
+#if HDFS_TEST_DEBUG
+ HDfprintf(stderr, "teardown...\n");
+#endif /* HDFS_TEST_DEBUG */
+
+ FAIL_IF( FAIL == H5FDclose(fd) )
+ fd = NULL;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_hdfs) )
+ fapl_hdfs = -1;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_unconfigured) )
+ fapl_unconfigured = -1;
+
+ PASSED();
+ return 0;
+
+error:
+
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (fd) {
+ (void)H5FDclose(fd);
+ }
+ H5E_BEGIN_TRY {
+ if (fapl_hdfs >= 0) {
+ (void)H5Pclose(fapl_hdfs);
+ }
+ if (fapl_unconfigured >= 0) {
+ (void)H5Pclose(fapl_unconfigured);
+ }
+ } H5E_END_TRY;
+
+ return 1;
+
+#undef FAPL_H5P_DEFAULT
+#undef FAPL_UNCONFIGURED
+#undef FAPL_HDFS
+
+#endif /* H5_HAVE_LIBHDFS */
+
+} /* end test_vfd_open() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_eof_eoa()
+ *
+ * Purpose:
+ *
+ * Demonstrate behavior of get_eof, get_eoa, and set_eoa.
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2018-06-07
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_eof_eoa(void)
+{
+#ifndef H5_HAVE_LIBHDFS
+ TESTING("HDFS eof/eoa gets and sets");
+ SKIPPED();
+ puts(" HDFS VFD is not enabled");
+ fflush(stdout);
+ return 0;
+
+#else
+
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ H5FD_t *fd_shakespeare = NULL;
+ hid_t fapl_id = -1;
+
+ TESTING("HDFS eof/eoa gets and sets");
+
+ /*********
+ * SETUP *
+ *********/
+
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( 0 > fapl_id )
+ FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_id, &default_fa) )
+
+ fd_shakespeare = H5FDopen(
+ filename_bard,
+ H5F_ACC_RDONLY,
+ fapl_id,
+ HADDR_UNDEF);
+ FAIL_IF( NULL == fd_shakespeare )
+
+ /*********
+ * TESTS *
+ *********/
+
+ /* verify as found
+ */
+ JSVERIFY( 5458199, H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), NULL )
+ JSVERIFY( H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT),
+ H5FDget_eof(fd_shakespeare, H5FD_MEM_DRAW),
+ "mismatch between DEFAULT and RAW memory types" )
+ JSVERIFY( 0,
+ H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT),
+ "EoA should be unset by H5FDopen" )
+
+ /* set EoA below EoF
+ */
+ JSVERIFY( SUCCEED,
+ H5FDset_eoa(fd_shakespeare, H5FD_MEM_DEFAULT, 44442202),
+ "unable to set EoA (lower)" )
+ JSVERIFY( 5458199,
+ H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT),
+ "EoF changed" )
+ JSVERIFY( 44442202,
+ H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT),
+ "EoA unchanged" )
+
+ /* set EoA above EoF
+ */
+ JSVERIFY( SUCCEED,
+ H5FDset_eoa(fd_shakespeare, H5FD_MEM_DEFAULT, 6789012),
+ "unable to set EoA (higher)" )
+ JSVERIFY( 5458199,
+ H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT),
+ "EoF changed" )
+ JSVERIFY( 6789012,
+ H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT),
+ "EoA unchanged" )
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ FAIL_IF( FAIL == H5FDclose(fd_shakespeare) )
+ fd_shakespeare = NULL;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ PASSED();
+ return 0;
+
+error:
+
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (fd_shakespeare != NULL) {
+ (void)H5FDclose(fd_shakespeare);
+ }
+ if (fapl_id >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+
+ return 1;
+
+#endif /* H5_HAVE_LIBHDFS */
+
+} /* end test_eof_eoa() */
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * Function: test_H5FDread_without_eoa_set_fails()
+ *
+ * Purpose:
+ *
+ * Demonstrate a not-obvious constraint by the library, preventing
+ * file read before EoA is set
+ *
+ * Programmer: Jacob Smith
+ * 2018-06-08
+ *
+ *-----------------------------------------------------------------------------
+ */
+static int
+test_H5FDread_without_eoa_set_fails(void)
+{
+#ifndef H5_HAVE_LIBHDFS
+ TESTING("HDFS VFD read-eoa temporal coupling library limitation");
+ SKIPPED();
+ puts(" HDFS VFD is not enabled");
+ fflush(stdout);
+ return 0;
+
+#else
+
+ char buffer[HDFS_TEST_MAX_BUF_SIZE];
+ unsigned int i = 0;
+ H5FD_t *file_shakespeare = NULL;
+ hid_t fapl_id = -1;
+
+ TESTING("HDFS VFD read-eoa temporal coupling library limitation");
+
+ /*********
+ * SETUP *
+ *********/
+
+ /* create HDFS fapl
+ */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_id < 0 )
+ FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_id, &default_fa) )
+
+ file_shakespeare = H5FDopen(
+ filename_bard,
+ H5F_ACC_RDONLY,
+ fapl_id,
+ MAXADDR);
+ FAIL_IF( NULL == file_shakespeare )
+
+ JSVERIFY( 0, H5FDget_eoa(file_shakespeare, H5FD_MEM_DEFAULT),
+ "EoA should remain unset by H5FDopen" )
+
+ /* zero buffer contents */
+ for (i = 0; i < HDFS_TEST_MAX_BUF_SIZE; i++) {
+ buffer[i] = 0;
+ }
+
+ /********
+ * TEST *
+ ********/
+
+ H5E_BEGIN_TRY { /* mute stack trace on expected failure */
+ JSVERIFY( FAIL,
+ H5FDread(file_shakespeare,
+ H5FD_MEM_DRAW,
+ H5P_DEFAULT,
+ 1200699,
+ 102,
+ buffer),
+ "cannot read before eoa is set" )
+ } H5E_END_TRY;
+ for (i = 0; i < HDFS_TEST_MAX_BUF_SIZE; i++) {
+ JSVERIFY( 0, (unsigned)buffer[i], "buffer was modified by write!" )
+ }
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ FAIL_IF( FAIL == H5FDclose(file_shakespeare) )
+ file_shakespeare = NULL;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ PASSED();
+ return 0;
+
+error:
+
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (file_shakespeare) {
+ (void)H5FDclose(file_shakespeare);
+ }
+ if (fapl_id >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+
+ return 1;
+
+#endif /* H5_HAVE_LIBHDFS */
+
+} /* end test_H5FDread_without_eoa_set_fails() */
+
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_read()
+ *
+ * Purpose:
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2018-06-08
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_read(void)
+{
+#ifndef H5_HAVE_LIBHDFS
+ TESTING("HDFS VFD read/range-gets");
+ SKIPPED();
+ puts(" HDFS VFD is not enabled");
+ fflush(stdout);
+ return 0;
+
+#else
+
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+ struct testcase {
+ const char *message; /* purpose of test case */
+ haddr_t eoa_set; /* set file EOA to this prior to read */
+ size_t addr; /* offset of read in file */
+ size_t len; /* length of read in file */
+ herr_t success; /* expected return value of read function */
+ const char *expected; /* expected contents of buffer; failure ignores */
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+ struct testcase cases[] = {
+ { "successful range-get",
+ 6464,
+ 5691,
+ 32, /* fancy quotes are three bytes each(?) */
+ SUCCEED,
+ "Quoth the Raven “Nevermore.â€",
+ },
+ { "read past EOA fails (EOA < EOF < addr)",
+ 3000,
+ 4000,
+ 100,
+ FAIL,
+ NULL,
+ },
+ { "read overlapping EOA fails (EOA < addr < EOF < (addr+len))",
+ 3000,
+ 8000,
+ 100,
+ FAIL,
+ NULL,
+ },
+ { "read past EOA/EOF fails ((EOA==EOF) < addr)",
+ 6464,
+ 7000,
+ 100,
+ FAIL,
+ NULL,
+ },
+ { "read overlapping EOA/EOF fails (addr < (EOA==EOF) < (addr+len))",
+ 6464,
+ 6400,
+ 100,
+ FAIL,
+ NULL,
+ },
+ { "read between EOF and EOA fails (EOF < addr < (addr+len) < EOA)",
+ 8000,
+ 7000,
+ 100,
+ FAIL,
+ NULL,
+ },
+ };
+ unsigned testcase_count = 6;
+ unsigned test_i = 0;
+ struct testcase test;
+ herr_t open_return = FAIL;
+ char buffer[HDFS_TEST_MAX_BUF_SIZE];
+ unsigned int i = 0;
+ H5FD_t *file_raven = NULL;
+ hid_t fapl_id = -1;
+
+ TESTING("HDFS VFD read/range-gets");
+
+ /*********
+ * SETUP *
+ *********/
+
+ /* create HDFS fapl
+ */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_id < 0 )
+ FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_id, &default_fa) )
+
+ /* zero buffer contents */
+ for (i = 0; i < HDFS_TEST_MAX_BUF_SIZE; i++) {
+ buffer[i] = 0;
+ }
+
+ /* open file
+ */
+ file_raven = H5FDopen(
+ filename_raven,
+ H5F_ACC_RDONLY,
+ fapl_id,
+ HADDR_UNDEF); /* Demonstrate success with "automatic" value */
+ FAIL_IF( NULL == file_raven )
+
+ JSVERIFY( 6464, H5FDget_eof(file_raven, H5FD_MEM_DEFAULT), NULL )
+
+ /*********
+ * TESTS *
+ *********/
+
+ for (test_i = 0; test_i < testcase_count; test_i++) {
+
+ /* -------------- *
+ * per-test setup *
+ * -------------- */
+
+ test = cases[test_i];
+ open_return = FAIL;
+
+ FAIL_IF( HDFS_TEST_MAX_BUF_SIZE < test.len ) /* buffer too small! */
+
+ FAIL_IF( FAIL ==
+ H5FDset_eoa( file_raven, H5FD_MEM_DEFAULT, test.eoa_set) )
+
+ /* zero buffer contents */
+ for (i = 0; i < HDFS_TEST_MAX_BUF_SIZE; i++) {
+ buffer[i] = 0;
+ }
+
+ /* ------------ *
+ * conduct test *
+ * ------------ */
+
+ H5E_BEGIN_TRY {
+ open_return = H5FDread(
+ file_raven,
+ H5FD_MEM_DRAW,
+ H5P_DEFAULT,
+ test.addr,
+ test.len,
+ buffer);
+ } H5E_END_TRY;
+
+ JSVERIFY( test.success,
+ open_return,
+ test.message )
+
+ if (open_return == SUCCEED) {
+ JSVERIFY_STR( test.expected, buffer, NULL )
+ }
+
+ } /* for each testcase */
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ FAIL_IF( FAIL == H5FDclose(file_raven) )
+ file_raven = NULL;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ PASSED();
+ return 0;
+
+error:
+
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (file_raven != 0) {
+ (void)H5FDclose(file_raven);
+ }
+ if (fapl_id >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+
+ return 1;
+
+#endif /* H5_HAVE_LIBHDFS */
+
+} /* end test_read() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_noops_and_autofails()
+ *
+ * Purpose:
+ *
+ * Demonstrate the unavailable and do-nothing routines unique to
+ * Read-Only VFD.
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-06
+ *
+ * Changes:
+ * + modify from S3VFD codebase to HDFS; Minor changes, mostly.
+ * + Jacob Smith 2018-06-08
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_noops_and_autofails(void)
+{
+#ifndef H5_HAVE_LIBHDFS
+ TESTING("HDFS VFD always-fail and no-op routines");
+ SKIPPED();
+ puts(" HDFS VFD is not enabled");
+ fflush(stdout);
+ return 0;
+
+#else
+
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ hid_t fapl_id = -1;
+ H5FD_t *file = NULL;
+ const char data[36] = "The Force shall be with you, always";
+
+ TESTING("HDFS VFD always-fail and no-op routines");
+
+ /*********
+ * SETUP *
+ *********/
+
+ /* create HDFS fapl
+ */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_id < 0 )
+ FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_id, &default_fa) )
+
+ /* open file
+ */
+ file = H5FDopen(
+ filename_bard,
+ H5F_ACC_RDONLY,
+ fapl_id,
+ HADDR_UNDEF);
+ FAIL_IF( NULL == file )
+
+ /*********
+ * TESTS *
+ *********/
+
+ /* auto-fail calls to write and truncate
+ */
+ H5E_BEGIN_TRY {
+ JSVERIFY( FAIL,
+ H5FDwrite(file, H5FD_MEM_DRAW, H5P_DEFAULT, 1000, 35, data),
+ "write must fail" )
+ } H5E_END_TRY;
+
+ H5E_BEGIN_TRY {
+ JSVERIFY( FAIL,
+ H5FDtruncate(file, H5P_DEFAULT, FALSE),
+ "truncate must fail" )
+ } H5E_END_TRY;
+
+ H5E_BEGIN_TRY {
+ JSVERIFY( FAIL,
+ H5FDtruncate(file, H5P_DEFAULT, TRUE),
+ "truncate must fail (closing)" )
+ } H5E_END_TRY;
+
+ /* no-op calls to `lock()` and `unlock()`
+ */
+ JSVERIFY( SUCCEED,
+ H5FDlock(file, TRUE),
+ "lock always succeeds; has no effect" )
+ JSVERIFY( SUCCEED,
+ H5FDlock(file, FALSE),
+ NULL )
+ JSVERIFY( SUCCEED,
+ H5FDunlock(file),
+ NULL )
+ /* Lock/unlock with null file or similar error crashes tests.
+ * HDassert in calling heirarchy, `H5FD[un]lock()` and `H5FD_[un]lock()`
+ */
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ FAIL_IF( FAIL == H5FDclose(file) )
+ file = NULL;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ PASSED();
+ return 0;
+
+error:
+
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (fapl_id >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+ if (file != NULL) {
+ (void)H5FDclose(file);
+ }
+
+ return 1;
+
+#endif /* H5_HAVE_LIBHDFS */
+
+} /* end test_noops_and_autofails() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_cmp()
+ *
+ * Purpose:
+ *
+ * Verify "file comparison" behavior.
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-06
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_cmp(void)
+{
+ TESTING("HDFS cmp (comparison)");
+ SKIPPED();
+ HDfprintf(
+ stderr,
+ " TODO: Distinct valid fapls to open the same file.\n");
+
+ return 0;
+
+} /* end test_cmp() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_H5F_integration()
+ *
+ * Purpose:
+ *
+ * Demonstrate H5F (File interface) behavior with files on HDFS.
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-07
+ *
+ * Changes:
+ * + modify from S3VFD codebase to HDFS; Minor changes, mostly.
+ * + Jacob Smith 2018-06-08
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_H5F_integration(void)
+{
+#ifndef H5_HAVE_LIBHDFS
+ TESTING("HDFS file access through HD5F library (H5F API)");
+ SKIPPED();
+ puts(" HDFS VFD is not enabled");
+ fflush(stdout);
+ return 0;
+
+#else
+
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ hid_t file = -1;
+ hid_t fapl_id = -1;
+
+ TESTING("HDFS file access through HD5F library (H5F API)");
+
+ /*********
+ * SETUP *
+ *********/
+
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( 0 > fapl_id )
+ FAIL_IF( FAIL == H5Pset_fapl_hdfs(fapl_id, &default_fa) )
+
+ /*********
+ * TESTS *
+ *********/
+
+ /* Read-Write Open access is not allowed with this file driver.
+ */
+ H5E_BEGIN_TRY {
+ FAIL_IF( 0 <= H5Fopen(
+ filename_example_h5,
+ H5F_ACC_RDWR,
+ fapl_id) )
+ } H5E_END_TRY;
+
+ /* H5Fcreate() is not allowed with this file driver.
+ */
+ H5E_BEGIN_TRY {
+ FAIL_IF( 0 <= H5Fcreate(
+ filename_missing,
+ H5F_ACC_RDONLY,
+ H5P_DEFAULT,
+ fapl_id) )
+ } H5E_END_TRY;
+
+ /* Successful open.
+ */
+ file = H5Fopen(
+ filename_example_h5,
+ H5F_ACC_RDONLY,
+ fapl_id);
+ FAIL_IF( file < 0 )
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ FAIL_IF( FAIL == H5Fclose(file) )
+ file = -1;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * CLEANUP *
+ ***********/
+
+#if HDFS_TEST_DEBUG
+ HDprintf("\nerror!"); fflush(stdout);
+#endif /* HDFS_TEST_DEBUG */
+
+ if (fapl_id >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+ if (file > 0) {
+ (void)H5Fclose(file);
+ }
+
+ return 1;
+
+#endif /* H5_HAVE_LIBHDFS */
+
+} /* test_H5F_integration */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: main
+ *
+ * Purpose: Tests the basic features of Virtual File Drivers
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-23
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ int nerrors = 0;
+
+ /******************
+ * commence tests *
+ ******************/
+
+ static char hdfs_namenode_name[HDFS_NAMENODE_NAME_MAX_SIZE] = "";
+ const char *hdfs_namenode_name_env = NULL;
+
+ hdfs_namenode_name_env = HDgetenv("HDFS_TEST_NAMENODE_NAME");
+ if (hdfs_namenode_name_env == NULL || hdfs_namenode_name_env[0] == '\0') {
+ HDstrncpy(hdfs_namenode_name, "localhost", HDFS_NAMENODE_NAME_MAX_SIZE);
+ }
+ else {
+ HDstrncpy( /* TODO: error-check? */
+ default_fa.namenode_name,
+ hdfs_namenode_name_env,
+ HDFS_NAMENODE_NAME_MAX_SIZE);
+ }
+
+ h5_reset();
+
+ HDprintf("Testing hdfs VFD functionality.\n");
+
+ nerrors += test_fapl_config_validation();
+ nerrors += test_hdfs_fapl();
+ nerrors += test_vfd_open();
+ nerrors += test_eof_eoa();
+ nerrors += test_H5FDread_without_eoa_set_fails();
+ nerrors += test_read();
+ nerrors += test_noops_and_autofails();
+ nerrors += test_cmp();
+ nerrors += test_H5F_integration();
+
+ if (nerrors > 0) {
+ HDprintf("***** %d hdfs TEST%s FAILED! *****\n",
+ nerrors,
+ nerrors > 1 ? "S" : "");
+ nerrors = 1;
+ }
+ else {
+ HDprintf("All hdfs tests passed.\n");
+ }
+ return nerrors; /* 0 if no errors, 1 if any errors */
+
+} /* end main() */
+
+
diff --git a/test/hyperslab.c b/test/hyperslab.c
index feb96bd..d22a689 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -85,19 +85,19 @@ print_array(uint8_t *array, size_t nx, size_t ny, size_t nz)
for(i = 0; i < nx; i++) {
if(nz > 1)
- printf("i=%lu:\n", (unsigned long)i);
+ HDprintf("i=%lu:\n", (unsigned long)i);
else
- printf("%03lu:", (unsigned long)i);
+ HDprintf("%03lu:", (unsigned long)i);
for(j = 0; j < ny; j++) {
if(nz > 1)
- printf("%03lu:", (unsigned long)j);
+ HDprintf("%03lu:", (unsigned long)j);
for(k = 0; k < nz; k++)
- printf(" %3d", *array++);
+ HDprintf(" %3d", *array++);
if(nz > 1)
- printf("\n");
+ HDprintf("\n");
} /* end for */
- printf("\n");
+ HDprintf("\n");
} /* end for */
} /* end print_array() */
@@ -122,7 +122,7 @@ print_ref(size_t nx, size_t ny, size_t nz)
uint8_t *array;
if(NULL != (array = (uint8_t *)HDmalloc(nx * ny * nz))) {
- printf("Reference array:\n");
+ HDprintf("Reference array:\n");
init_full(array, nx, ny, nz);
print_array(array, nx, ny, nz);
HDfree(array);
@@ -168,21 +168,21 @@ test_fill(size_t nx, size_t ny, size_t nz,
if(0 == ny) {
ndims = 1;
ny = nz = 1;
- sprintf(dim, "%lu", (unsigned long) nx);
+ HDsprintf(dim, "%lu", (unsigned long) nx);
} /* end if */
else {
ndims = 2;
nz = 1;
- sprintf(dim, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
+ HDsprintf(dim, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
} /* end else */
} /* end if */
else {
ndims = 3;
- sprintf(dim, "%lux%lux%lu", (unsigned long) nx, (unsigned long) ny,
+ HDsprintf(dim, "%lux%lux%lu", (unsigned long) nx, (unsigned long) ny,
(unsigned long) nz);
} /* end else */
- sprintf(s, "Testing hyperslab fill %-11s variable hyperslab", dim);
- printf("%-70s", s);
+ HDsprintf(s, "Testing hyperslab fill %-11s variable hyperslab", dim);
+ HDprintf("%-70s", s);
fflush(stdout);
/* Allocate array */
@@ -242,8 +242,8 @@ test_fill(size_t nx, size_t ny, size_t nz,
* is going directly to a terminal.
*/
AT();
- printf(" acc != ref_value\n");
- printf(" i=%lu, j=%lu, k=%lu, "
+ HDprintf(" acc != ref_value\n");
+ HDprintf(" i=%lu, j=%lu, k=%lu, "
"dx=%lu, dy=%lu, dz=%lu, "
"fill=%d\n", (unsigned long)i,
(unsigned long)j,
@@ -252,7 +252,7 @@ test_fill(size_t nx, size_t ny, size_t nz,
(unsigned long)dy,
(unsigned long)dz, fill_value);
print_ref(nx, ny, nz);
- printf("\n Result is:\n");
+ HDprintf("\n Result is:\n");
print_array(dst, nx, ny, nz);
} /* end if */
goto error;
@@ -332,17 +332,17 @@ test_copy(int mode,
if(0 == ny) {
ndims = 1;
ny = nz = 1;
- sprintf(dim, "%lu", (unsigned long) nx);
+ HDsprintf(dim, "%lu", (unsigned long) nx);
} /* end if */
else {
ndims = 2;
nz = 1;
- sprintf(dim, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
+ HDsprintf(dim, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
} /* end else */
} /* end if */
else {
ndims = 3;
- sprintf(dim, "%lux%lux%lu", (unsigned long) nx, (unsigned long) ny,
+ HDsprintf(dim, "%lux%lux%lu", (unsigned long) nx, (unsigned long) ny,
(unsigned long) nz);
} /* end else */
@@ -376,8 +376,8 @@ test_copy(int mode,
HDabort();
} /* end switch */
- sprintf(s, "Testing hyperslab copy %-11s %s", dim, sub);
- printf("%-70s", s);
+ HDsprintf(s, "Testing hyperslab copy %-11s %s", dim, sub);
+ HDprintf("%-70s", s);
fflush(stdout);
/*
@@ -481,8 +481,8 @@ test_copy(int mode,
* going directly to a terminal.
*/
AT();
- printf(" acc != ref_value\n");
- printf(" i=%lu, j=%lu, k=%lu, "
+ HDprintf(" acc != ref_value\n");
+ HDprintf(" i=%lu, j=%lu, k=%lu, "
"dx=%lu, dy=%lu, dz=%lu\n",
(unsigned long)i,
(unsigned long)j,
@@ -491,7 +491,7 @@ test_copy(int mode,
(unsigned long)dy,
(unsigned long)dz);
print_ref(nx, ny, nz);
- printf("\n Destination array is:\n");
+ HDprintf("\n Destination array is:\n");
print_array(dst, nx, ny, nz);
} /* end if */
goto error;
@@ -522,9 +522,9 @@ test_copy(int mode,
* going directly to a terminal.
*/
AT();
- printf(" acc != ref_value + nx*ny*nz - "
+ HDprintf(" acc != ref_value + nx*ny*nz - "
"dx*dy*dz\n");
- printf(" i=%lu, j=%lu, k=%lu, "
+ HDprintf(" i=%lu, j=%lu, k=%lu, "
"dx=%lu, dy=%lu, dz=%lu\n",
(unsigned long)i,
(unsigned long)j,
@@ -533,7 +533,7 @@ test_copy(int mode,
(unsigned long)dy,
(unsigned long)dz);
print_ref(nx, ny, nz);
- printf("\n Destination array is:\n");
+ HDprintf("\n Destination array is:\n");
print_array(dst, nx, ny, nz);
} /* end if */
goto error;
@@ -594,7 +594,7 @@ test_multifill(size_t nx)
} fill, *src = NULL, *dst = NULL;
hsize_t i, j;
- printf("%-70s", "Testing multi-byte fill value");
+ HDprintf("%-70s", "Testing multi-byte fill value");
fflush(stdout);
/* Initialize the source and destination */
@@ -639,28 +639,28 @@ test_multifill(size_t nx)
s[0] = '\0';
for(i = 0; i < nx; i++) {
if(dst[i].left != 3333333)
- sprintf(s, "bad dst[%lu].left", (unsigned long)i);
+ HDsprintf(s, "bad dst[%lu].left", (unsigned long)i);
else if(!H5_DBL_ABS_EQUAL(dst[i].mid, fill.mid))
/* Check if two DOUBLE values are equal. If their difference
* is smaller than the EPSILON value for double, they are
* considered equal. See the definition in h5test.h.
*/
- sprintf(s, "bad dst[%lu].mid", (unsigned long)i);
+ HDsprintf(s, "bad dst[%lu].mid", (unsigned long)i);
else if(dst[i].right != 4444444)
- sprintf(s, "bad dst[%lu].right", (unsigned long)i);
+ HDsprintf(s, "bad dst[%lu].right", (unsigned long)i);
if(s[0]) {
H5_FAILED()
if(!HDisatty(1)) {
AT();
- printf(" fill={%d,%g,%d}\n ", fill.left, fill.mid,
+ HDprintf(" fill={%d,%g,%d}\n ", fill.left, fill.mid,
fill.right);
for(j = 0; j < sizeof(fill); j++)
- printf(" %02x", ((uint8_t *)&fill)[j]);
- printf("\n dst[%lu]={%d,%g,%d}\n ", (unsigned long)i,
+ HDprintf(" %02x", ((uint8_t *)&fill)[j]);
+ HDprintf("\n dst[%lu]={%d,%g,%d}\n ", (unsigned long)i,
dst[i].left, dst[i].mid, dst[i].right);
for(j = 0; j < sizeof(dst[i]); j++)
- printf(" %02x", ((uint8_t *)(dst + i))[j]);
- printf("\n");
+ HDprintf(" %02x", ((uint8_t *)(dst + i))[j]);
+ HDprintf("\n");
} /* end if */
goto error;
} /* end if */
@@ -709,7 +709,7 @@ test_endian(size_t nx)
hsize_t size[2]; /*size vector */
hsize_t i, j;
- printf("%-70s", "Testing endian conversion by stride");
+ HDprintf("%-70s", "Testing endian conversion by stride");
fflush(stdout);
/* Initialize arrays */
@@ -742,10 +742,10 @@ test_endian(size_t nx)
* to a terminal.
*/
AT();
- printf(" i=%lu, j=%lu\n", (unsigned long)i, (unsigned long)j);
- printf(" Source array is:\n");
+ HDprintf(" i=%lu, j=%lu\n", (unsigned long)i, (unsigned long)j);
+ HDprintf(" Source array is:\n");
print_array(src, nx, (size_t)4, (size_t)1);
- printf("\n Result is:\n");
+ HDprintf("\n Result is:\n");
print_array(dst, nx, (size_t)4, (size_t)1);
} /* end if */
goto error;
@@ -795,9 +795,9 @@ test_transpose(size_t nx, size_t ny)
char s[256];
hsize_t i, j;
- sprintf(s, "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx,
+ HDsprintf(s, "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx,
(unsigned long)ny);
- printf("%-70s", s);
+ HDprintf("%-70s", s);
fflush(stdout);
/* Initialize */
@@ -833,20 +833,20 @@ test_transpose(size_t nx, size_t ny)
H5_FAILED()
if(!HDisatty(1)) {
AT();
- printf(" diff at i=%lu, j=%lu\n", (unsigned long)i, (unsigned long)j);
- printf(" Source is:\n");
+ HDprintf(" diff at i=%lu, j=%lu\n", (unsigned long)i, (unsigned long)j);
+ HDprintf(" Source is:\n");
for(i = 0; i < nx; i++) {
- printf("%3lu:", (unsigned long)i);
+ HDprintf("%3lu:", (unsigned long)i);
for(j = 0; j < ny; j++)
- printf(" %6d", src[i * ny + j]);
- printf("\n");
+ HDprintf(" %6d", src[i * ny + j]);
+ HDprintf("\n");
} /* end for */
- printf("\n Destination is:\n");
+ HDprintf("\n Destination is:\n");
for (i = 0; i < ny; i++) {
- printf("%3lu:", (unsigned long)i);
+ HDprintf("%3lu:", (unsigned long)i);
for(j = 0; j < nx; j++)
- printf(" %6d", dst[i * nx + j]);
- printf("\n");
+ HDprintf(" %6d", dst[i * nx + j]);
+ HDprintf("\n");
} /* end for */
} /* end if */
goto error;
@@ -900,10 +900,10 @@ test_sub_super(size_t nx, size_t ny)
hsize_t i, j;
char s[256];
- sprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ",
+ HDsprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ",
(unsigned long)(2 * nx), (unsigned long)(2 * ny),
(unsigned long)nx, (unsigned long)ny);
- printf("%-70s", s);
+ HDprintf("%-70s", s);
fflush(stdout);
/* Initialize */
@@ -935,12 +935,12 @@ test_sub_super(size_t nx, size_t ny)
H5_FAILED()
if(!HDisatty(1)) {
AT();
- printf(" full[%lu][%lu] != half[%lu][%lu]\n",
+ HDprintf(" full[%lu][%lu] != half[%lu][%lu]\n",
(unsigned long)i * 2, (unsigned long)j * 2,
(unsigned long)i, (unsigned long)j);
- printf(" full is:\n");
+ HDprintf(" full is:\n");
print_array(full, 2 * nx, 2 * ny, (size_t)1);
- printf("\n half is:\n");
+ HDprintf("\n half is:\n");
print_array(half, nx, ny, (size_t)1);
} /* end if */
goto error;
@@ -953,10 +953,10 @@ test_sub_super(size_t nx, size_t ny)
* Test replicating pixels to produce an image twice as large in each
* dimension.
*/
- sprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ",
+ HDsprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ",
(unsigned long)nx, (unsigned long)ny, (unsigned long)(2 * nx),
(unsigned long)(2 * ny));
- printf("%-70s", s);
+ HDprintf("%-70s", s);
fflush(stdout);
/* Setup stride */
@@ -982,28 +982,28 @@ test_sub_super(size_t nx, size_t ny)
for(i = 0; i < nx; i++) {
for(j = 0; j < ny; j++) {
if(half[i * ny + j] != twice[4 * i * ny + 2 * j])
- sprintf(s, "half[%lu][%lu] != twice[%lu][%lu]",
+ HDsprintf(s, "half[%lu][%lu] != twice[%lu][%lu]",
(unsigned long)i, (unsigned long)j,
(unsigned long)i * 2, (unsigned long)j * 2);
else if(half[i * ny + j] != twice[4 * i * ny + 2 * j + 1])
- sprintf(s, "half[%lu][%lu] != twice[%lu][%lu]",
+ HDsprintf(s, "half[%lu][%lu] != twice[%lu][%lu]",
(unsigned long)i, (unsigned long)j,
(unsigned long)i * 2, (unsigned long)j * 2 + 1);
else if(half[i * ny + j] != twice[(2 * i + 1) * 2 * ny + 2 * j])
- sprintf(s, "half[%lu][%lu] != twice[%lu][%lu]",
+ HDsprintf(s, "half[%lu][%lu] != twice[%lu][%lu]",
(unsigned long)i, (unsigned long)j,
(unsigned long)i * 2 + 1, (unsigned long)j * 2);
else if(half[i * ny + j] != twice[(2 * i + 1) * 2 * ny + 2 * j + 1])
- sprintf(s, "half[%lu][%lu] != twice[%lu][%lu]",
+ HDsprintf(s, "half[%lu][%lu] != twice[%lu][%lu]",
(unsigned long)i, (unsigned long)j,
(unsigned long)i * 2 + 1, (unsigned long)j * 2 + 1);
if(s[0]) {
H5_FAILED()
if(!HDisatty(1)) {
AT();
- printf(" %s\n Half is:\n", s);
+ HDprintf(" %s\n Half is:\n", s);
print_array(half, nx, ny, (size_t)1);
- printf("\n Twice is:\n");
+ HDprintf("\n Twice is:\n");
print_array(twice, 2 * nx, 2 * ny, (size_t)1);
} /* end if */
goto error;
@@ -1055,7 +1055,7 @@ test_array_fill(size_t lo, size_t hi)
size_t u, v, w; /* Local index variables */
char s[256];
- sprintf(s, "array filling %4lu-%-4lu elements", (unsigned long)lo,(unsigned long)hi);
+ HDsprintf(s, "array filling %4lu-%-4lu elements", (unsigned long)lo,(unsigned long)hi);
TESTING(s);
/* Initialize */
@@ -1120,7 +1120,7 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z)
hsize_t new_coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of offset */
char s[256];
- sprintf(s, "array offset %4lux%4lux%4lu elements", (unsigned long)z,(unsigned long)y,(unsigned long)x);
+ HDsprintf(s, "array offset %4lux%4lux%4lu elements", (unsigned long)z,(unsigned long)y,(unsigned long)x);
TESTING(s);
/* Initialize */
@@ -1180,13 +1180,11 @@ error:
/*-------------------------------------------------------------------------
* Function: main
*
- * Purpose: Test various hyperslab operations. Give the words
- * `small' and/or `medium' on the command line or only `small'
- * is assumed.
+ * Purpose: Test various hyperslab operations. Give the words
+ * 'small' and/or 'medium' on the command line or only 'small'
+ * is assumed.
*
- * Return: Success: exit(EXIT_SUCCESS)
- *
- * Failure: exit(EXIT_FAILURE)
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Robb Matzke
* Friday, October 10, 1997
@@ -1212,18 +1210,18 @@ main(int argc, char *argv[])
else if(!HDstrcmp(argv[i], "medium"))
size_of_test |= TEST_MEDIUM;
else {
- printf("unrecognized argument: %s\n", argv[i]);
+ HDprintf("unrecognized argument: %s\n", argv[i]);
HDexit(EXIT_FAILURE);
} /* end else */
} /* end for */
} /* end else */
- printf("Test sizes: ");
+ HDprintf("Test sizes: ");
if(size_of_test & TEST_SMALL)
- printf(" SMALL");
+ HDprintf(" SMALL");
if(size_of_test & TEST_MEDIUM)
- printf(" MEDIUM");
- printf("\n");
+ HDprintf(" MEDIUM");
+ HDprintf("\n");
/* Set the random # seed */
HDsrandom((unsigned)HDtime(NULL));
@@ -1429,19 +1427,19 @@ main(int argc, char *argv[])
/*--- END OF TESTS ---*/
if(nerrors) {
- printf("***** %d HYPERSLAB TEST%s FAILED! *****\n", nerrors, 1
+ HDprintf("***** %d HYPERSLAB TEST%s FAILED! *****\n", nerrors, 1
== nerrors ? "" : "S");
if(HDisatty(1))
- printf("(Redirect output to a pager or a file to see debug output)\n");
+ HDprintf("(Redirect output to a pager or a file to see debug output)\n");
HDexit(EXIT_FAILURE);
} /* end if */
- printf("All hyperslab tests passed.\n");
+ HDprintf("All hyperslab tests passed.\n");
#ifdef H5_HAVE_THREADSAFE
H5close();
#endif /* H5_HAVE_THREADSAFE */
- return 0;
+ HDexit(EXIT_SUCCESS);
}
diff --git a/test/istore.c b/test/istore.c
index b5bac2c..c8fe866 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -106,21 +106,21 @@ print_array(uint8_t *array, size_t nx, size_t ny, size_t nz)
for (i = 0; i < nx; i++) {
if (nz > 1) {
- fprintf(stderr,"i=%lu:\n", (unsigned long)i);
+ HDfprintf(stderr,"i=%lu:\n", (unsigned long)i);
} else {
- fprintf(stderr,"%03lu:", (unsigned long)i);
+ HDfprintf(stderr,"%03lu:", (unsigned long)i);
}
for (j = 0; j < ny; j++) {
if (nz > 1)
- fprintf(stderr,"%03lu:", (unsigned long)j);
+ HDfprintf(stderr,"%03lu:", (unsigned long)j);
for (k = 0; k < nz; k++) {
- fprintf(stderr," %3d", *array++);
+ HDfprintf(stderr," %3d", *array++);
}
if (nz > 1)
- fprintf(stderr,"\n");
+ HDfprintf(stderr,"\n");
}
- fprintf(stderr,"\n");
+ HDfprintf(stderr,"\n");
}
}
@@ -216,7 +216,7 @@ test_create(hid_t f, const char *prefix)
/* Create chunked dataset of this dimensionality */
HDsnprintf(name, sizeof name, "%s_%02u", prefix, u);
- if ((dataset=new_object(f, name, (int)u, dims, my_chunk_dims)) < 0)
+ if((dataset = new_object(f, name, (int)u, dims, my_chunk_dims)) < 0)
return FAIL;
/* Close dataset created */
@@ -268,19 +268,19 @@ test_extend(hid_t f, const char *prefix,
if (!ny) {
ndims = 1;
ny = nz = 1;
- sprintf(dims, "%lu", (unsigned long) nx);
+ HDsprintf(dims, "%lu", (unsigned long) nx);
} else {
ndims = 2;
nz = 1;
- sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
+ HDsprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
}
} else {
ndims = 3;
- sprintf(dims, "%lux%lux%lu",
+ HDsprintf(dims, "%lux%lux%lu",
(unsigned long) nx, (unsigned long) ny, (unsigned long) nz);
}
- sprintf(s, "istore extend: %s", dims);
+ HDsprintf(s, "istore extend: %s", dims);
TESTING(s);
buf = (uint8_t *)HDmalloc(nx * ny * nz);
check = (uint8_t *)HDmalloc(nx * ny * nz);
@@ -294,10 +294,10 @@ test_extend(hid_t f, const char *prefix,
max_corner[2] = 0;
/* Build the new empty object */
- sprintf(name, "%s_%s", prefix, dims);
+ HDsprintf(name, "%s_%s", prefix, dims);
if ((dataset=new_object(f, name, ndims, whole_size, whole_size)) < 0) {
- fprintf(stderr," Cannot create %u-d object `%s'\n", ndims, name);
- goto error;
+ HDfprintf(stderr," Cannot create %u-d object `%s'\n", ndims, name);
+ goto error;
}
/* Get dataset's dataspace */
@@ -327,21 +327,21 @@ test_extend(hid_t f, const char *prefix,
#if 0
if (0 == ctr)
- fprintf(stderr,"\n");
- fprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]);
+ HDfprintf(stderr,"\n");
+ HDfprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]);
if (ndims > 1)
- fprintf(stderr,",%ld", (long)offset[1]);
+ HDfprintf(stderr,",%ld", (long)offset[1]);
if (ndims > 2)
- fprintf(stderr,",%ld", (long)offset[2]);
- fprintf(stderr,"), size=(%lu", (unsigned long)size[0]);
+ HDfprintf(stderr,",%ld", (long)offset[2]);
+ HDfprintf(stderr,"), size=(%lu", (unsigned long)size[0]);
if (ndims > 1)
- fprintf(stderr,",%lu", (unsigned long)size[1]);
+ HDfprintf(stderr,",%lu", (unsigned long)size[1]);
if (ndims > 2)
- fprintf(stderr,",%lu", (unsigned long)size[2]);
- fprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s");
+ HDfprintf(stderr,",%lu", (unsigned long)size[2]);
+ HDfprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s");
if (0 == nelmts)
- fprintf(stderr," *SKIPPED*");
- fprintf(stderr,"\n");
+ HDfprintf(stderr," *SKIPPED*");
+ HDfprintf(stderr,"\n");
#endif
/* Fill the source array */
@@ -357,7 +357,7 @@ test_extend(hid_t f, const char *prefix,
/* Write to disk */
if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) {
H5_FAILED();
- fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr);
+ HDfprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr);
goto error;
}
@@ -365,16 +365,16 @@ test_extend(hid_t f, const char *prefix,
HDmemset(check, 0xff, (size_t)nelmts);
if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) {
H5_FAILED();
- fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr);
+ HDfprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr);
goto error;
}
if (HDmemcmp(buf, check, (size_t)nelmts)) {
H5_FAILED();
- fprintf(stderr," Read check failed: ctr=%lu\n", (unsigned long)ctr);
- fprintf(stderr," Wrote:\n");
+ HDfprintf(stderr," Read check failed: ctr=%lu\n", (unsigned long)ctr);
+ HDfprintf(stderr," Wrote:\n");
print_array(buf, (size_t)size[0], (size_t)size[1],
(size_t)size[2]);
- fprintf(stderr," Read:\n");
+ HDfprintf(stderr," Read:\n");
print_array(check, (size_t)size[0], (size_t)size[1],
(size_t)size[2]);
goto error;
@@ -397,7 +397,7 @@ test_extend(hid_t f, const char *prefix,
HDmemset(buf, 0xff, nx * ny * nz);
if (H5Dread(dataset, TEST_DATATYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) {
H5_FAILED();
- fprintf(stderr," Read failed for whole array.\n");
+ HDfprintf(stderr," Read failed for whole array.\n");
goto error;
}
for (i=0; i<nx; i++) {
@@ -405,16 +405,16 @@ test_extend(hid_t f, const char *prefix,
for (k=0; k<nz; k++) {
if (whole[i*ny*nz + j*nz + k] != buf[i*ny*nz + j*nz + k]) {
H5_FAILED();
- fprintf(stderr," Check failed at i=%lu", (unsigned long)i);
+ HDfprintf(stderr," Check failed at i=%lu", (unsigned long)i);
if (ndims > 1) {
- fprintf(stderr,", j=%lu", (unsigned long)j);
+ HDfprintf(stderr,", j=%lu", (unsigned long)j);
}
if (ndims > 2) {
- fprintf(stderr,", k=%lu", (unsigned long)k);
+ HDfprintf(stderr,", k=%lu", (unsigned long)k);
}
- fprintf(stderr,"\n Check array is:\n");
+ HDfprintf(stderr,"\n Check array is:\n");
print_array(whole, nx, ny, nz);
- fprintf(stderr," Value read is:\n");
+ HDfprintf(stderr," Value read is:\n");
print_array(buf, nx, ny, nz);
goto error;
}
@@ -481,19 +481,19 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
if (!ny) {
ndims = 1;
ny = nz = 1;
- sprintf(dims, "%lu", (unsigned long) nx);
+ HDsprintf(dims, "%lu", (unsigned long) nx);
} else {
ndims = 2;
nz = 1;
- sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
+ HDsprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
}
} else {
ndims = 3;
- sprintf(dims, "%lux%lux%lu",
+ HDsprintf(dims, "%lux%lux%lu",
(unsigned long) nx, (unsigned long) ny, (unsigned long) nz);
}
- sprintf(s, "istore sparse: %s", dims);
+ HDsprintf(s, "istore sparse: %s", dims);
TESTING(s);
if(skip_test){
SKIPPED()
@@ -512,10 +512,10 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
size[2] = nz;
/* Build the new empty object */
- sprintf(name, "%s_%s", prefix, dims);
+ HDsprintf(name, "%s_%s", prefix, dims);
if ((dataset=new_object(f, name, ndims, whole_size, chunk_dims)) < 0) {
- printf(" Cannot create %u-d object `%s'\n", ndims, name);
- goto error;
+ HDprintf(" Cannot create %u-d object `%s'\n", ndims, name);
+ goto error;
}
/* Get dataset's dataspace */
@@ -535,18 +535,18 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
/* write to disk */
if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) {
H5_FAILED();
- printf(" Write failed: ctr=%lu\n", (unsigned long)ctr);
- printf(" offset=(%lu", (unsigned long) (offset[0]));
+ HDprintf(" Write failed: ctr=%lu\n", (unsigned long)ctr);
+ HDprintf(" offset=(%lu", (unsigned long) (offset[0]));
if (ndims > 1)
- printf(",%lu", (unsigned long) (offset[1]));
+ HDprintf(",%lu", (unsigned long) (offset[1]));
if (ndims > 2)
- printf(",%lu", (unsigned long) (offset[2]));
- printf("), size=(%lu", (unsigned long) (size[0]));
+ HDprintf(",%lu", (unsigned long) (offset[2]));
+ HDprintf("), size=(%lu", (unsigned long) (size[0]));
if (ndims > 1)
- printf(",%lu", (unsigned long) (size[1]));
+ HDprintf(",%lu", (unsigned long) (size[1]));
if (ndims > 2)
- printf(",%lu", (unsigned long) (size[2]));
- printf(")\n");
+ HDprintf(",%lu", (unsigned long) (size[2]));
+ HDprintf(")\n");
goto error;
}
total += nx * ny * nz;
@@ -579,17 +579,13 @@ error:
/*-------------------------------------------------------------------------
* Function: main
*
- * Purpose: Tests indexed storage stuff.
- *
- * Return: Success: exit(EXIT_SUCCESS)
+ * Purpose: Tests indexed storage
*
- * Failure: exit(EXIT_FAILURE)
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Robb Matzke
* Wednesday, October 15, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -617,21 +613,18 @@ main(int argc, char *argv[])
} else if (!strcmp(argv[i], "large")) {
size_of_test |= TEST_LARGE;
} else {
- printf("unrecognized argument: %s\n", argv[i]);
-#if 0
- exit(EXIT_FAILURE);
-#endif
+ HDprintf("unrecognized argument: %s\n", argv[i]);
}
}
}
- printf("Test sizes: ");
+ HDprintf("Test sizes: ");
if (size_of_test & TEST_SMALL)
- printf(" SMALL");
+ HDprintf(" SMALL");
if (size_of_test & TEST_MEDIUM)
- printf(" MEDIUM");
+ HDprintf(" MEDIUM");
if (size_of_test & TEST_LARGE)
- printf(" LARGE");
- printf("\n");
+ HDprintf(" LARGE");
+ HDprintf("\n");
/* Set the random # seed */
HDsrandom((unsigned)HDtime(NULL));
@@ -653,8 +646,8 @@ main(int argc, char *argv[])
/* Create the test file */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) {
- printf("Cannot create file %s; test aborted\n", filename);
- exit(EXIT_FAILURE);
+ HDprintf("Cannot create file %s; test aborted\n", filename);
+ HDexit(EXIT_FAILURE);
}
/* Initialize chunk dimensions */
@@ -708,7 +701,7 @@ main(int argc, char *argv[])
*/
status = test_sparse(file, "sparse", (size_t)800, (size_t)50, (size_t)50, (size_t)50, skip_test);
if(skip_test)
- printf(" The current VFD does not support sparse files on this platform.\n");
+ HDprintf(" The current VFD does not support sparse files on this platform.\n");
nerrors += status < 0 ? 1 : 0;
}
@@ -720,15 +713,15 @@ main(int argc, char *argv[])
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
if (nerrors) {
- printf("***** %d I-STORE TEST%s FAILED! *****\n",
+ HDprintf("***** %d I-STORE TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
- printf("All i-store tests passed.\n");
+ HDprintf("All i-store tests passed.\n");
h5_cleanup(FILENAME, fapl);
- return 0;
+ HDexit(EXIT_SUCCESS);
}
diff --git a/test/lheap.c b/test/lheap.c
index 4f09b6e..4b40740 100644
--- a/test/lheap.c
+++ b/test/lheap.c
@@ -15,7 +15,7 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Tuesday, November 24, 1998
*
- * Purpose: Test local heaps used by symbol tables (groups).
+ * Purpose: Test local heaps used by symbol tables (groups).
*/
#include "h5test.h"
#include "H5srcdir.h"
@@ -33,7 +33,7 @@ const char *FILENAME[] = {
#define NOBJS 40
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -41,9 +41,7 @@ const char *FILENAME[] = {
* heap, close the file, open the file, read data out of the
* local heap, close the file.
*
- * Return: Success: zero
- *
- * Failure: non-zero
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Robb Matzke
* Tuesday, November 24, 1998
@@ -95,13 +93,13 @@ main(void)
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
}
- if (NULL == (heap = H5HL_protect(f, heap_addr, H5AC__NO_FLAGS_SET))) {
+ if(NULL == (heap = H5HL_protect(f, heap_addr, H5AC__NO_FLAGS_SET))) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
}
for(i = 0; i < NOBJS; i++) {
- sprintf(buf, "%03d-", i);
+ HDsprintf(buf, "%03d-", i);
for(j = 4; j < i; j++)
buf[j] = (char)('0' + j % 10);
if(j > 4)
@@ -141,13 +139,13 @@ main(void)
goto error;
}
for(i = 0; i < NOBJS; i++) {
- sprintf(buf, "%03d-", i);
+ HDsprintf(buf, "%03d-", i);
for(j = 4; j < i; j++)
buf[j] = (char)('0' + j % 10);
if(j > 4)
buf[j] = '\0';
- if (NULL == (heap = H5HL_protect(f, heap_addr, H5AC__READ_ONLY_FLAG))) {
+ if(NULL == (heap = H5HL_protect(f, heap_addr, H5AC__READ_ONLY_FLAG))) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
@@ -211,7 +209,7 @@ main(void)
HDputs("All local heap tests passed.");
h5_cleanup(FILENAME, fapl);
- return 0;
+ return EXIT_SUCCESS;
error:
HDputs("*** TESTS FAILED ***");
@@ -221,6 +219,6 @@ main(void)
if(api_ctx_pushed) H5CX_pop();
- return 1;
+ return EXIT_FAILURE;
}
diff --git a/test/links.c b/test/links.c
index 63b125f..0bdb3f0 100644
--- a/test/links.c
+++ b/test/links.c
@@ -12,38 +12,35 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
- * Friday, April 10, 1998
- *
- * Purpose: Tests hard, soft (symbolic) & external links.
+ * Purpose: Tests hard, soft (symbolic) & external links.
*/
/*
* This file needs to access private information from the H5FD package.
* This file also needs to access the file driver testing code.
*/
-#define H5FD_FRIEND /*suppress error about including H5FDpkg */
+#define H5FD_FRIEND /*suppress error about including H5FDpkg */
#define H5FD_TESTING
/*
* This file needs to access private information from the H5G package.
* This file also needs to access the group testing code.
*/
-#define H5G_FRIEND /*suppress error about including H5Gpkg */
+#define H5G_FRIEND /*suppress error about including H5Gpkg */
#define H5G_TESTING
#include "h5test.h"
#include "H5srcdir.h"
-#include "H5FDpkg.h" /* File drivers */
-#include "H5Gpkg.h" /* Groups */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Lprivate.h" /* Links */
+#include "H5FDpkg.h" /* File drivers */
+#include "H5Gpkg.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Lprivate.h" /* Links */
/* File for external link test. Created with gen_udlinks.c */
#define LINKED_FILE "be_extlink2.h5"
-#define TMPDIR "tmp/"
-#define TMPDIR2 "tmp2/"
+#define TMPDIR "tmp_links/"
+#define TMPDIR2 "tmp2_links/"
/* Symlinks for external link symlink test */
#define SYMLINK1 TMPDIR "sym1.h5"
@@ -62,55 +59,55 @@ const char *FILENAME[] = {
"links6", /* 9 */
"links7", /* 10 */
"links8", /* 11 */
- "extlinks0", /* 12: main files */
- TMPDIR "extlinks0", /* 13: */
- "extlinks1", /* 14: target files */
- TMPDIR "extlinks1", /* 15: */
- "extlinks2", /* 16: */
- TMPDIR "extlinks2", /* 17: */
- "extlinks3", /* 18: */
- TMPDIR "extlinks3", /* 19: */
- "extlinks4", /* 20: */
- TMPDIR "extlinks4", /* 21: */
- "extlinks5", /* 22: */
- TMPDIR "extlinks6", /* 23: */
- "extlinks7", /* 24: */
- TMPDIR "extlinks7", /* 25: */
- TMPDIR "extlinks8", /* 26: */
- "extlinks9", /* 27: */
- TMPDIR "extlinks9", /* 28: */
- "extlinks10", /* 29: */ /* TESTS for windows */
- TMPDIR "extlinks10",/* 30: */
- TMPDIR "extlinks11",/* 31: */
- TMPDIR "extlinks12",/* 32: */
- "extlinks13", /* 33: */
- TMPDIR "extlinks13",/* 34: */
- TMPDIR "extlinks14",/* 35: */
- TMPDIR "extlinks15",/* 36: */
- "extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */
- "extlinks16B", /* 38: */
- "extlinks17", /* 39: */
- "extlinks18A", /* 40: */
- "extlinks18B", /* 41: */
- "extlinks19A", /* 42: */
- "extlinks19B", /* 43: */
- "extlinks20", /* 44: */
- "extlinks21A", /* 45: Files for symlink() tests*/
- TMPDIR2 "extlinks21B",/* 46: */
- TMPDIR2 "extlinks21C",/* 47: */
- "extlinks21C", /* 48: (same as #47, only without the TMPDIR2 prefix) */
- TMPDIR "extlinks21D",/* 49: */
- TMPDIR "extlinks21E",/* 50: */
- "extlinks21E", /* 51: (same as #50, only without the TMPDIR prefix) */
+ "extlinks0", /* 12: main files */
+ TMPDIR "extlinks0", /* 13: */
+ "extlinks1", /* 14: target files */
+ TMPDIR "extlinks1", /* 15: */
+ "extlinks2", /* 16: */
+ TMPDIR "extlinks2", /* 17: */
+ "extlinks3", /* 18: */
+ TMPDIR "extlinks3", /* 19: */
+ "extlinks4", /* 20: */
+ TMPDIR "extlinks4", /* 21: */
+ "extlinks5", /* 22: */
+ TMPDIR "extlinks6", /* 23: */
+ "extlinks7", /* 24: */
+ TMPDIR "extlinks7", /* 25: */
+ TMPDIR "extlinks8", /* 26: */
+ "extlinks9", /* 27: */
+ TMPDIR "extlinks9", /* 28: */
+ "extlinks10", /* 29: */ /* TESTS for windows */
+ TMPDIR "extlinks10", /* 30: */
+ TMPDIR "extlinks11", /* 31: */
+ TMPDIR "extlinks12", /* 32: */
+ "extlinks13", /* 33: */
+ TMPDIR "extlinks13", /* 34: */
+ TMPDIR "extlinks14", /* 35: */
+ TMPDIR "extlinks15", /* 36: */
+ "extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */
+ "extlinks16B", /* 38: */
+ "extlinks17", /* 39: */
+ "extlinks18A", /* 40: */
+ "extlinks18B", /* 41: */
+ "extlinks19A", /* 42: */
+ "extlinks19B", /* 43: */
+ "extlinks20", /* 44: */
+ "extlinks21A", /* 45: Files for symlink() tests*/
+ TMPDIR2 "extlinks21B", /* 46: */
+ TMPDIR2 "extlinks21C", /* 47: */
+ "extlinks21C", /* 48: (same as #47, only without the TMPDIR2 prefix) */
+ TMPDIR "extlinks21D", /* 49: */
+ TMPDIR "extlinks21E", /* 50: */
+ "extlinks21E", /* 51: (same as #50, only without the TMPDIR prefix) */
NULL
};
-#define FAMILY_SIZE 1024
+#define FAMILY_SIZE 1024
#define CORE_INCREMENT 1024
-#define NUM40 40
+#define NUM40 40
-/* do not do check_all_closed() for "ext*" files and "tmp/ext*" */
-#define EXTSTOP 12
+/* do not do check_all_closed() for "ext*" files and "tmp_links/ext*" */
+#define EXTSTOP 12
#define LINK_BUF_SIZE 1024
#define NAME_BUF_SIZE 1024
@@ -318,7 +315,7 @@ typedef struct {
static hid_t dcpl_g; /* for [un]minimized dataset object headers */
-
+
/*-------------------------------------------------------------------------
* Function: fix_ext_filename
*
@@ -326,43 +323,32 @@ static hid_t dcpl_g; /* for [un]minimized dataset object headers */
* path name of Unix and Windows.
*
* Return: void
- *
- * Programmer: Raymond Lu
- * 14 Jan. 2009
*-------------------------------------------------------------------------
*/
static void
fix_ext_filename(char *path_name, char *cwd, const char *file_name)
{
HDstrcpy(path_name, cwd);
-
HDstrcat(path_name, "/");
HDstrcat(path_name, file_name);
}
-
+
/*-------------------------------------------------------------------------
- * Function: mklinks
- *
- * Purpose: Build a file with assorted links.
+ * Function: mklinks
*
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Friday, August 14, 1998
- *
- * Modifications:
+ * Purpose: Build a file with assorted links.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static int
mklinks(hid_t fapl, hbool_t new_format)
{
- hid_t file, scalar, grp, d1;
- hsize_t size[1] = {1};
- char filename[NAME_BUF_SIZE];
+ hid_t file, scalar, grp, d1;
+ hsize_t size[1] = {1};
+ char filename[NAME_BUF_SIZE];
if(new_format)
TESTING("link creation (w/new group format)")
@@ -399,38 +385,31 @@ mklinks(hid_t fapl, hbool_t new_format)
if(H5Fclose(file) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
}
-
+
/*-------------------------------------------------------------------------
* Function: new_links
*
* Purpose: Build a file with assorted links for different locations.
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Raymond Lu
- * Friday, April 19, 2002
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
new_links(hid_t fapl, hbool_t new_format)
{
- hid_t file_a, file_b=(-1);
- hid_t grp1_a=(-1), grp1_b=(-1), grp2_a=(-1), grp2_b=(-1);
- hid_t scalar=(-1);
- hid_t dset1=(-1), dset2=(-1);
- char filename[NAME_BUF_SIZE];
- hsize_t size[1] = {1};
+ hid_t file_a, file_b=(-1);
+ hid_t grp1_a=(-1), grp1_b=(-1), grp2_a=(-1), grp2_b=(-1);
+ hid_t scalar=(-1);
+ hid_t dset1=(-1), dset2=(-1);
+ char filename[NAME_BUF_SIZE];
+ hsize_t size[1] = {1};
if(new_format)
TESTING("H5Lcreate functions (w/new group format)")
@@ -488,50 +467,43 @@ new_links(hid_t fapl, hbool_t new_format)
if(H5Fclose(file_b) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Sclose(scalar);
- H5Dclose(dset1);
- H5Dclose(dset2);
- H5Gclose(grp1_a);
- H5Gclose(grp2_a);
- H5Gclose(grp1_b);
- H5Gclose(grp2_b);
- H5Fclose(file_a);
- H5Fclose(file_b);
- } H5E_END_TRY;
- return -1;
+ H5Sclose(scalar);
+ H5Dclose(dset1);
+ H5Dclose(dset2);
+ H5Gclose(grp1_a);
+ H5Gclose(grp2_a);
+ H5Gclose(grp1_b);
+ H5Gclose(grp2_b);
+ H5Fclose(file_a);
+ H5Fclose(file_b);
+ } H5E_END_TRY;
+ return FAIL;
}
-
+
/*-------------------------------------------------------------------------
- * Function: cklinks
- *
- * Purpose: Open the file created in the first step and check that the
- * links look correct.
- *
- * Return: Success: 0
+ * Function: cklinks
*
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Friday, August 14, 1998
- *
- * Modifications:
+ * Purpose: Open the file created in the first step and check that the
+ * links look correct.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static int
cklinks(hid_t fapl, hbool_t new_format)
{
- hid_t file;
- H5O_info_t oinfo1, oinfo2;
- H5L_info_t linfo2;
- char linkval[LINK_BUF_SIZE];
- char filename[NAME_BUF_SIZE];
- herr_t status;
+ hid_t file;
+ H5O_info_t oinfo1, oinfo2;
+ H5L_info_t linfo2;
+ char linkval[LINK_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
+ herr_t status;
if(new_format)
TESTING("link queries (w/new group format)")
@@ -546,15 +518,15 @@ cklinks(hid_t fapl, hbool_t new_format)
if(H5Oget_info_by_name2(file, "d1", &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5Oget_info_by_name2(file, "grp1/hard", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5O_TYPE_DATASET != oinfo2.type) {
- H5_FAILED();
- HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
- TEST_ERROR
+ H5_FAILED();
+ HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
+ TEST_ERROR
} /* end if */
if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) {
- H5_FAILED();
- HDputs(" Hard link test failed. Link seems not to point to the ");
- HDputs(" expected file location.");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" Hard link test failed. Link seems not to point to the ");
+ HDputs(" expected file location.");
+ TEST_ERROR
} /* end if */
if(H5Lexists(file, "/", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
if(H5Lexists(file, "d1", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
@@ -565,91 +537,91 @@ cklinks(hid_t fapl, hbool_t new_format)
status = H5Lexists(file, "no_grp1/hard", H5P_DEFAULT);
} H5E_END_TRY;
if(status >= 0) {
- H5_FAILED();
- HDputs(" H5Lexists() should have failed for a path with missing components.");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" H5Lexists() should have failed for a path with missing components.");
+ TEST_ERROR
} /* end if */
H5E_BEGIN_TRY {
status = H5Lexists(file, "/no_grp1/hard", H5P_DEFAULT);
} H5E_END_TRY;
if(status >= 0) {
- H5_FAILED();
- HDputs(" H5Lexists() should have failed for a path with missing components.");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" H5Lexists() should have failed for a path with missing components.");
+ TEST_ERROR
} /* end if */
/* Symbolic link */
if(H5Oget_info_by_name2(file, "grp1/soft", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5O_TYPE_DATASET != oinfo2.type) {
- H5_FAILED();
- HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
- TEST_ERROR
+ H5_FAILED();
+ HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
+ TEST_ERROR
} /* end if */
if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) {
- H5_FAILED();
- HDputs(" Soft link test failed. Link seems not to point to the ");
- HDputs(" expected file location.");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" Soft link test failed. Link seems not to point to the ");
+ HDputs(" expected file location.");
+ TEST_ERROR
} /* end if */
if(H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(HDstrcmp(linkval, "/d1")) {
- H5_FAILED();
- HDputs(" Soft link test failed. Wrong link value");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" Soft link test failed. Wrong link value");
+ TEST_ERROR
} /* end if */
if(H5Lexists(file, "grp1/soft", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
/* Dangling link */
H5E_BEGIN_TRY {
- status = H5Oget_info_by_name2(file, "grp1/dangle", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT);
+ status = H5Oget_info_by_name2(file, "grp1/dangle", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT);
} H5E_END_TRY;
if(status >= 0) {
- H5_FAILED();
- HDputs(" H5Oget_info_by_name() should have failed for a dangling link.");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" H5Oget_info_by_name() should have failed for a dangling link.");
+ TEST_ERROR
} /* end if */
if(H5Lget_info(file, "grp1/dangle", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5L_TYPE_SOFT != linfo2.type) {
- H5_FAILED();
- HDprintf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__);
- TEST_ERROR
+ H5_FAILED();
+ HDprintf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__);
+ TEST_ERROR
} /* end if */
if(H5Lget_val(file, "grp1/dangle", linkval, sizeof linkval, H5P_DEFAULT) < 0) {
- H5_FAILED();
- HDprintf(" %d: Can't retrieve link value\n", __LINE__);
- TEST_ERROR
+ H5_FAILED();
+ HDprintf(" %d: Can't retrieve link value\n", __LINE__);
+ TEST_ERROR
} /* end if */
if(HDstrcmp(linkval, "foobar")) {
- H5_FAILED();
- HDputs(" Dangling link test failed. Wrong link value");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" Dangling link test failed. Wrong link value");
+ TEST_ERROR
} /* end if */
if(H5Lexists(file, "grp1/dangle", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
/* Recursive link */
H5E_BEGIN_TRY {
- status = H5Oget_info_by_name2(file, "grp1/recursive", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT);
+ status = H5Oget_info_by_name2(file, "grp1/recursive", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT);
} H5E_END_TRY;
if(status >= 0) {
- H5_FAILED();
- HDputs(" H5Oget_info_by_name() should have failed for a recursive link.");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" H5Oget_info_by_name() should have failed for a recursive link.");
+ TEST_ERROR
} /* end if */
if(H5Lget_info(file, "grp1/recursive", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5L_TYPE_SOFT != linfo2.type) {
- H5_FAILED();
- printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__);
- TEST_ERROR
+ H5_FAILED();
+ HDprintf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__);
+ TEST_ERROR
} /* end if */
if(H5Lget_val(file, "grp1/recursive", linkval, sizeof linkval, H5P_DEFAULT) < 0) {
- H5_FAILED();
- printf(" %d: Can't retrieve link value\n", __LINE__);
- TEST_ERROR
+ H5_FAILED();
+ HDprintf(" %d: Can't retrieve link value\n", __LINE__);
+ TEST_ERROR
} /* end if */
if(HDstrcmp(linkval, "/grp1/recursive")) {
- H5_FAILED();
- HDputs(" Recursive link test failed. Wrong link value");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" Recursive link test failed. Wrong link value");
+ TEST_ERROR
} /* end if */
/* Non-existent link */
@@ -659,13 +631,13 @@ cklinks(hid_t fapl, hbool_t new_format)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
}
-
+
/*-------------------------------------------------------------------------
* Function: ck_new_links
*
@@ -673,20 +645,15 @@ error:
* links look correct.
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Raymond Lu
- * Thursday, April 25, 2002
- *
*-------------------------------------------------------------------------
*/
static int
ck_new_links(hid_t fapl, hbool_t new_format)
{
- hid_t file;
- H5O_info_t oi_dset, oi_hard1, oi_hard2;
- char filename[NAME_BUF_SIZE];
+ hid_t file;
+ H5O_info_t oi_dset, oi_hard1, oi_hard2;
+ char filename[NAME_BUF_SIZE];
if(new_format)
TESTING("new link queries (w/new group format)")
@@ -698,62 +665,52 @@ ck_new_links(hid_t fapl, hbool_t new_format)
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
/* Get hard link info */
- if(H5Oget_info_by_name2(file, "/grp1/dataset2", &oi_dset, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Oget_info_by_name2(file, "/grp1/hard1", &oi_hard1, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Oget_info_by_name2(file, "/grp2/hard2", &oi_hard2, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Oget_info_by_name2(file, "/grp1/dataset2", &oi_dset, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name2(file, "/grp1/hard1", &oi_hard1, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name2(file, "/grp2/hard2", &oi_hard2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
/* Check hard links */
if(H5O_TYPE_DATASET != oi_hard1.type || H5O_TYPE_DATASET != oi_hard2.type) {
- H5_FAILED();
- printf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
- TEST_ERROR
+ H5_FAILED();
+ HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
+ TEST_ERROR
}
if(H5F_addr_ne(oi_dset.addr, oi_hard1.addr) || H5F_addr_ne(oi_dset.addr, oi_hard2.addr)) {
- H5_FAILED();
- HDputs(" Hard link test failed. Link seems not to point to the ");
- HDputs(" expected file location.");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" Hard link test failed. Link seems not to point to the ");
+ HDputs(" expected file location.");
+ TEST_ERROR
}
/* Cleanup */
if(H5Fclose(file) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
}
-
+
/*-------------------------------------------------------------------------
* Function: long_links
*
* Purpose: Build a file with long names
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Saturday, April 16, 2005
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
long_links(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group ID */
- hid_t gid2 = (-1); /* Datatype ID */
- char *objname = NULL; /* Name of object [Long] */
- size_t u; /* Local index variable */
- char filename[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t gid2 = -1; /* Datatype ID */
+ char *objname = NULL; /* Name of object [Long] */
+ size_t u; /* Local index variable */
+ char filename[NAME_BUF_SIZE];
if(new_format)
TESTING("long names for objects & links (w/new group format)")
@@ -792,42 +749,35 @@ long_links(hid_t fapl, hbool_t new_format)
HDfree(objname);
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Gclose (gid2);
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid2);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
HDfree(objname);
- return -1;
+ return FAIL;
}
-
+
/*-------------------------------------------------------------------------
* Function: toomany
*
* Purpose: Build a file with too many symbolic links
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Tuesday, August 9, 2005
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
toomany(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE];
if(new_format)
TESTING("too many links (w/new group format)")
@@ -917,9 +867,9 @@ toomany(hid_t fapl, hbool_t new_format)
gid = H5Gopen2(fid, "soft17", H5P_DEFAULT);
} H5E_END_TRY;
if(gid >= 0) {
- H5_FAILED();
- HDputs(" Should have failed for sequence of too many nested links.");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" Should have failed for sequence of too many nested links.");
+ TEST_ERROR
} /* end if */
/* Open object through lesser soft link */
@@ -940,18 +890,18 @@ toomany(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end toomany() */
-
+
/*-------------------------------------------------------------------------
* Function: test_lcpl
*
@@ -959,26 +909,20 @@ toomany(hid_t fapl, hbool_t new_format)
*
* Return: Success: 0
* Failure: number of errors
- *
- * Programmer: James Laird
- * Monday, January 30, 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_lcpl(hid_t fapl, hbool_t new_format)
{
- hid_t file_id=-1;
- hid_t group_id=-1;
- hid_t space_id=-1;
- hid_t dset_id=-1;
- hid_t type_id=-1;
- hid_t lcpl_id=-1;
- H5L_info_t linfo;
- char filename[1024];
- hsize_t dims[2];
+ hid_t file_id = -1;
+ hid_t group_id = -1;
+ hid_t space_id = -1;
+ hid_t dset_id = -1;
+ hid_t type_id = -1;
+ hid_t lcpl_id = -1;
+ H5L_info_t linfo;
+ char filename[1024];
+ hsize_t dims[2];
if(new_format)
TESTING("link creation property lists (w/new group format)")
@@ -1097,7 +1041,7 @@ test_lcpl(hid_t fapl, hbool_t new_format)
if(H5Fclose(file_id) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -1111,29 +1055,22 @@ error:
return 1;
} /* end test_lcpl() */
-
+
/*-------------------------------------------------------------------------
* Function: test_move
*
* Purpose: Tests H5Lmove()
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: James Laird
- * Friday, March 30, 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_move(hid_t fapl, hbool_t new_format)
{
- hid_t file_a, file_b=(-1);
- hid_t grp_1=(-1), grp_2=(-1), grp_move=(-1), moved_grp=(-1);
- char filename[1024];
+ hid_t file_a = -1, file_b = -1;
+ hid_t grp_1 = -1, grp_2 = -1, grp_move = -1, moved_grp = -1;
+ char filename[1024];
if(new_format)
TESTING("H5Lmove (w/new group format)")
@@ -1142,11 +1079,9 @@ test_move(hid_t fapl, hbool_t new_format)
/* Create two new files */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if ((file_a=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ if ((file_a=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
- if ((file_b=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ if ((file_b=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create groups in first file */
if((grp_1 = H5Gcreate2(file_a, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -1154,99 +1089,75 @@ test_move(hid_t fapl, hbool_t new_format)
if((grp_move = H5Gcreate2(grp_1, "group_move", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Create hard, soft and external links. */
- if(H5Lcreate_hard(grp_1, "group_move", H5L_SAME_LOC, "hard", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_soft("/group1/group_move", grp_2, "soft", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_external("filename", "pathname", grp_2, "ext", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_hard(grp_1, "group_move", H5L_SAME_LOC, "hard", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_soft("/group1/group_move", grp_2, "soft", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external("filename", "pathname", grp_2, "ext", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Move a group within the file. Both of source and destination use
* H5L_SAME_LOC. Should fail. */
H5E_BEGIN_TRY {
- if(H5Lmove(H5L_SAME_LOC, "group_move", H5L_SAME_LOC, "group_new_name", H5P_DEFAULT, H5P_DEFAULT)
- !=FAIL) TEST_ERROR
+ if(H5Lmove(H5L_SAME_LOC, "group_move", H5L_SAME_LOC, "group_new_name", H5P_DEFAULT, H5P_DEFAULT)!=FAIL) TEST_ERROR
} H5E_END_TRY;
/* Move a group across files. Should fail. */
H5E_BEGIN_TRY {
- if(H5Lmove(grp_1, "group_move", file_b, "group_new_name", H5P_DEFAULT, H5P_DEFAULT)
- !=FAIL) TEST_ERROR
+ if(H5Lmove(grp_1, "group_move", file_b, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) !=FAIL) TEST_ERROR
} H5E_END_TRY;
/* Move a soft link across files. Should succeed. */
- if(H5Lmove(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != TRUE)
- TEST_ERROR
+ if(H5Lmove(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != TRUE) TEST_ERROR
/* Move an external link across files. Should succeed. */
- if(H5Lmove(grp_2, "ext", file_b, "ext_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != TRUE)
- TEST_ERROR
+ if(H5Lmove(grp_2, "ext", file_b, "ext_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != TRUE) TEST_ERROR
/* Move a group across groups in the same file while renaming it. */
- if(H5Lmove(grp_1, "group_move", grp_2, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lmove(grp_1, "group_move", grp_2, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Open the group just moved to the new location. */
if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if( H5Gclose(moved_grp) < 0)
- TEST_ERROR
+ FAIL_STACK_ERROR
+ if( H5Gclose(moved_grp) < 0) TEST_ERROR
/* Verify that the group is no longer in the original location */
H5E_BEGIN_TRY {
moved_grp = H5Gopen2(grp_1, "group_move", H5P_DEFAULT);
} H5E_END_TRY;
if(moved_grp >= 0) {
- H5_FAILED();
- HDputs(" Group still in original location?");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" Group still in original location?");
+ TEST_ERROR
} /* end if */
/* Use H5Lmove to rename a group without moving it. */
- if(H5Lmove(grp_2, "group_new_name", H5L_SAME_LOC, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lmove(grp_2, "group_new_name", H5L_SAME_LOC, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Open the group. */
- if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
/* Use H5Lmove to move a group without renaming it. */
- if(H5Lmove(grp_2, "group_newer_name", grp_1, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lmove(grp_2, "group_newer_name", grp_1, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Open the group . */
- if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
/* Move the group while giving long paths. */
- if(H5Lmove(file_a, "/group1/group_newer_name", grp_2, "/group2/group_newest_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lmove(file_a, "/group1/group_newer_name", grp_2, "/group2/group_newest_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Open the group just moved to the new location. */
- if((moved_grp = H5Gopen2(grp_2, "group_newest_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ if((moved_grp = H5Gopen2(grp_2, "group_newest_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
/* Verify that the group is in no previous locations */
H5E_BEGIN_TRY {
- if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) >= 0)
- FAIL_STACK_ERROR
- if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) >= 0)
- FAIL_STACK_ERROR
- if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) >= 0)
- FAIL_STACK_ERROR
- if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) >= 0)
- FAIL_STACK_ERROR
+ if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) >= 0) FAIL_STACK_ERROR
+ if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) >= 0) FAIL_STACK_ERROR
+ if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) >= 0) FAIL_STACK_ERROR
+ if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) >= 0) FAIL_STACK_ERROR
} H5E_END_TRY;
H5Gclose(grp_1);
@@ -1256,44 +1167,37 @@ test_move(hid_t fapl, hbool_t new_format)
H5Fclose(file_b);
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5_FAILED();
H5E_BEGIN_TRY {
- H5Gclose(grp_1);
- H5Gclose(grp_2);
- H5Gclose(grp_move);
+ H5Gclose(grp_1);
+ H5Gclose(grp_2);
+ H5Gclose(grp_move);
H5Gclose(moved_grp);
- H5Fclose(file_a);
- H5Fclose(file_b);
+ H5Fclose(file_a);
+ H5Fclose(file_b);
} H5E_END_TRY;
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_copy
*
* Purpose: Tests H5Lcopy()
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: James Laird
- * Friday, March 30, 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_copy(hid_t fapl, hbool_t new_format)
{
- hid_t file_a, file_b=(-1);
- hid_t grp_1=(-1), grp_2=(-1), grp_move=(-1), moved_grp=(-1);
- char filename[1024];
+ hid_t file_a = -1, file_b = -1;
+ hid_t grp_1 = -1, grp_2 = -1, grp_move = -1, moved_grp = -1;
+ char filename[1024];
if(new_format)
TESTING("H5Lcopy (w/new group format)")
@@ -1302,11 +1206,9 @@ test_copy(hid_t fapl, hbool_t new_format)
/* Create two new files */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if ((file_a=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ if ((file_a=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
- if ((file_b=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ if ((file_b=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create groups in first file */
if((grp_1 = H5Gcreate2(file_a, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -1314,111 +1216,76 @@ test_copy(hid_t fapl, hbool_t new_format)
if((grp_move = H5Gcreate2(grp_1, "group_copy", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Create hard, soft and external links. */
- if(H5Lcreate_hard(grp_1, "group_copy", H5L_SAME_LOC, "hard", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_soft("/group1/group_copy", grp_2, "soft", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_external("filename", "pathname", grp_2, "ext", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_hard(grp_1, "group_copy", H5L_SAME_LOC, "hard", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_soft("/group1/group_copy", grp_2, "soft", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external("filename", "pathname", grp_2, "ext", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Copy a group within the file. Both of source and destination use
* H5L_SAME_LOC. Should fail. */
H5E_BEGIN_TRY {
- if(H5Lcopy(H5L_SAME_LOC, "group_copy", H5L_SAME_LOC, "group_new_name", H5P_DEFAULT, H5P_DEFAULT)
- !=FAIL) TEST_ERROR
+ if(H5Lcopy(H5L_SAME_LOC, "group_copy", H5L_SAME_LOC, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) !=FAIL) TEST_ERROR
} H5E_END_TRY;
/* Copy a group across files. Should fail. */
H5E_BEGIN_TRY {
- if(H5Lcopy(grp_1, "group_copy", file_b, "group_new_name", H5P_DEFAULT, H5P_DEFAULT)
- !=FAIL) TEST_ERROR
+ if(H5Lcopy(grp_1, "group_copy", file_b, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) !=FAIL) TEST_ERROR
} H5E_END_TRY;
/* Copy a soft link across files. Should succeed. */
- if(H5Lcopy(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != TRUE)
- TEST_ERROR
+ if(H5Lcopy(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != TRUE) TEST_ERROR
/* Copy an external link across files. Should succeed. */
- if(H5Lcopy(grp_2, "ext", file_b, "ext_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != TRUE)
- TEST_ERROR
+ if(H5Lcopy(grp_2, "ext", file_b, "ext_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != TRUE) TEST_ERROR
/* Move a group across groups in the same file while renaming it. */
- if(H5Lcopy(grp_1, "group_copy", grp_2, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcopy(grp_1, "group_copy", grp_2, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Open the group just moved to the new location. */
- if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
/* Verify that the group is also in the original location */
- if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
/* Use H5Lcopy to create a group in the same location with a different name. */
- if(H5Lcopy(grp_2, "group_new_name", H5L_SAME_LOC, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcopy(grp_2, "group_new_name", H5L_SAME_LOC, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Open the group. */
- if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
/* Verify that the group is also in the original location */
- if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
/* Use H5Lcopy to copy to a different location with the same name. */
- if(H5Lcopy(grp_2, "group_newer_name", grp_1, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcopy(grp_2, "group_newer_name", grp_1, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Open the group . */
- if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
/* Verify that the group is still in the previous location */
- if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
/* Copy the group while giving long paths. */
- if(H5Lcopy(file_a, "/group1/group_newer_name", grp_2, "/group2/group_newest_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcopy(file_a, "/group1/group_newer_name", grp_2, "/group2/group_newest_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Open the group just moved to the new location. */
- if((moved_grp = H5Gopen2(grp_2, "group_newest_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_2, "group_newest_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
/* Verify that the group is still in all previous original locations */
- if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
- if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
- if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
- if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(moved_grp) < 0)
- TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
+ if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(moved_grp) < 0) TEST_ERROR
H5Gclose(grp_1);
H5Gclose(grp_2);
@@ -1427,22 +1294,22 @@ test_copy(hid_t fapl, hbool_t new_format)
H5Fclose(file_b);
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5_FAILED();
H5E_BEGIN_TRY {
- H5Gclose(grp_1);
- H5Gclose(grp_2);
- H5Gclose(grp_move);
+ H5Gclose(grp_1);
+ H5Gclose(grp_2);
+ H5Gclose(grp_move);
H5Gclose(moved_grp);
- H5Fclose(file_a);
- H5Fclose(file_b);
+ H5Fclose(file_a);
+ H5Fclose(file_b);
} H5E_END_TRY;
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_move_preserves
*
@@ -1451,12 +1318,6 @@ test_copy(hid_t fapl, hbool_t new_format)
*
* Return: Success: 0
* Failure: number of errors
- *
- * Programmer: James Laird
- * Monday, January 30, 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1604,20 +1465,20 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
if(H5Fclose(file_id) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Pclose(fcpl_id);
- H5Pclose(lcpl_id);
- H5Pclose(lcpl2_id);
+ H5Pclose(fcpl_id);
+ H5Pclose(lcpl_id);
+ H5Pclose(lcpl2_id);
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
return 1;
} /* end test_move_preserves() */
-
+
/*-------------------------------------------------------------------------
* Function: test_deprec
*
@@ -1625,12 +1486,6 @@ error:
*
* Return: Success: 0
* Failure: number of errors
- *
- * Programmer: James Laird
- * Wednesday, April 26 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifndef H5_NO_DEPRECATED_SYMBOLS
@@ -1640,7 +1495,7 @@ test_deprec(hid_t fapl, hbool_t new_format)
hid_t file_id = -1;
hid_t group1_id = -1;
hid_t group2_id = -1;
- H5G_stat_t sb_hard1, sb_hard2, sb_soft1, sb_soft2;
+ H5G_stat_t sb_hard1, sb_hard2, sb_soft1, sb_soft2;
H5G_obj_t obj_type; /* Object type */
hsize_t num_objs; /* Number of objects in a group */
char filename[1024];
@@ -1756,7 +1611,7 @@ test_deprec(hid_t fapl, hbool_t new_format)
if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -1768,34 +1623,27 @@ error:
} /* end test_deprec() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_root
*
* Purpose: Build a file with external link to root group in external file
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Wednesday, May 25, 2005
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_root(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- H5L_info_t linfo; /* Link information */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename1[NAME_BUF_SIZE];
- char filename2[NAME_BUF_SIZE];
- const char *file; /* File from external link */
- const char *path; /* Path from external link */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ H5L_info_t linfo; /* Link information */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename1[NAME_BUF_SIZE];
+ char filename2[NAME_BUF_SIZE];
+ const char *file; /* File from external link */
+ const char *path; /* Path from external link */
if(new_format)
TESTING("external link to root (w/new group format)")
@@ -1824,21 +1672,21 @@ external_link_root(hid_t fapl, hbool_t new_format)
/* Check information for external link */
if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error;
if(H5L_TYPE_EXTERNAL != linfo.type) {
- H5_FAILED();
- HDputs(" Unexpected object type - should have been an external link");
- goto error;
+ H5_FAILED();
+ HDputs(" Unexpected object type - should have been an external link");
+ goto error;
}
if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR
if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR
if(HDstrcmp(file, filename1)) {
- H5_FAILED();
- HDputs(" External link file name incorrect");
- goto error;
+ H5_FAILED();
+ HDputs(" External link file name incorrect");
+ goto error;
}
if(HDstrcmp(path, "/")) {
- H5_FAILED();
- HDputs(" External link path incorrect");
- goto error;
+ H5_FAILED();
+ HDputs(" External link path incorrect");
+ goto error;
}
/* Create external link to object in first file */
@@ -1848,28 +1696,27 @@ external_link_root(hid_t fapl, hbool_t new_format)
/* Check information for external link */
if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error;
if(H5L_TYPE_EXTERNAL != linfo.type) {
- H5_FAILED();
- HDputs(" Unexpected object type - should have been an external link");
- goto error;
+ H5_FAILED();
+ HDputs(" Unexpected object type - should have been an external link");
+ goto error;
}
if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR
if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR
if(HDstrcmp(file, filename1)) {
- H5_FAILED();
- HDputs(" External link file name incorrect");
- goto error;
+ H5_FAILED();
+ HDputs(" External link file name incorrect");
+ goto error;
}
if(HDstrcmp(path, "/")) {
- H5_FAILED();
- HDputs(" External link path incorrect");
- goto error;
+ H5_FAILED();
+ HDputs(" External link path incorrect");
+ goto error;
}
/* Close and re-open file to ensure that data is written to disk */
if(H5Fclose(fid) < 0) TEST_ERROR
if((fid = H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
-
/* Open object through external link */
if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -1941,18 +1788,18 @@ external_link_root(hid_t fapl, hbool_t new_format)
H5F_sfile_assert_num(0);
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid2);
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid2);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_root() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_path
*
@@ -1960,24 +1807,17 @@ external_link_root(hid_t fapl, hbool_t new_format)
* external file
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Tuesday, July 26, 2005
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_path(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename1[NAME_BUF_SIZE];
- char filename2[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename1[NAME_BUF_SIZE];
+ char filename2[NAME_BUF_SIZE];
if(new_format)
TESTING("external link to object on path (w/new group format)")
@@ -2049,18 +1889,18 @@ external_link_path(hid_t fapl, hbool_t new_format)
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid2);
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid2);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_path() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_mult
*
@@ -2068,26 +1908,19 @@ external_link_path(hid_t fapl, hbool_t new_format)
* external file links
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Tuesday, July 26, 2005
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_mult(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1), fid2 = (-1); /* File IDs */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE],
- filename4[NAME_BUF_SIZE]; /* Names of files to externally link across */
+ hid_t fid = -1, fid2 = -1; /* File IDs */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ filename4[NAME_BUF_SIZE]; /* Names of files to externally link across */
if(new_format)
TESTING("external links across multiple files (w/new group format)")
@@ -2213,44 +2046,37 @@ external_link_mult(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid2);
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid2);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_mult() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_self
*
* Purpose: Build a file with external link to itself
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: James Laird
- * Wednesday, July 12, 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_self(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- hid_t lcpl_id = (-1); /* Link Creation Property List ID */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename1[NAME_BUF_SIZE];
- char filename2[NAME_BUF_SIZE];
- char filename3[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ hid_t lcpl_id = -1; /* Link Creation Property List ID */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename1[NAME_BUF_SIZE];
+ char filename2[NAME_BUF_SIZE];
+ char filename3[NAME_BUF_SIZE];
if(new_format)
TESTING("external link to self (w/new group format)")
@@ -2311,8 +2137,8 @@ external_link_self(hid_t fapl, hbool_t new_format)
/* Complicate things. Use this file as an intermediate file in a chain
- * of external links that will go: file2 -> file1 -> file1 -> file3
- */
+ * of external links that will go: file2 -> file1 -> file1 -> file3
+ */
/* Create file2 with an external link to file1 */
if((fid=H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -2336,7 +2162,6 @@ external_link_self(hid_t fapl, hbool_t new_format)
/* Close file1 */
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Re-open file2 and traverse through file1 (with its recursive extlink) to file3 */
if((fid=H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
@@ -2361,19 +2186,19 @@ external_link_self(hid_t fapl, hbool_t new_format)
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Pclose(lcpl_id);
- H5Fclose(fid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Pclose(lcpl_id);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_self() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_pingpong
*
@@ -2401,11 +2226,11 @@ external_link_self(hid_t fapl, hbool_t new_format)
static int
external_link_pingpong(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1), gid2 = (-1); /* Group IDs */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
if(new_format)
TESTING("external links back and forth (w/new group format)")
@@ -2417,7 +2242,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format)
h5_fixname(FILENAME[4], fapl, filename2, sizeof filename2);
/* Create first file */
- if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create external links for chain */
if(H5Lcreate_external(filename2, "/link2", fid, "link1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -2432,7 +2257,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
/* Create second file */
- if((fid=H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create external links for chain */
if(H5Lcreate_external(filename1, "/link3", fid, "link2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -2444,7 +2269,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format)
/* Open first file */
- if((fid=H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
/* Open object through external link */
if((gid = H5Gopen2(fid, "link1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -2465,7 +2290,6 @@ external_link_pingpong(hid_t fapl, hbool_t new_format)
/* Close first file */
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Open first file again and check on object created */
if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
@@ -2484,18 +2308,18 @@ external_link_pingpong(hid_t fapl, hbool_t new_format)
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_pingpong() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_toomany
*
@@ -2523,24 +2347,17 @@ external_link_pingpong(hid_t fapl, hbool_t new_format)
* file1:/link17 -> file2: /final
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, August 8, 2005
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_toomany(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
if(new_format)
TESTING("too many external links (w/new group format)")
@@ -2575,7 +2392,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
/* Create second file */
- if((fid=H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create external links for chain */
if(H5Lcreate_external(filename1, "/link3", fid, "link2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -2596,16 +2413,16 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
/* Open first file */
- if((fid=H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
/* Open object through external link */
H5E_BEGIN_TRY {
gid = H5Gopen2(fid, "link1", H5P_DEFAULT);
} H5E_END_TRY;
if (gid >= 0) {
- H5_FAILED();
- HDprintf("%d: Should have failed for sequence of too many nested links.", __LINE__);
- goto error;
+ H5_FAILED();
+ HDprintf("%d: Should have failed for sequence of too many nested links.", __LINE__);
+ goto error;
}
/* Open object through external link */
@@ -2628,18 +2445,18 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid2);
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid2);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_toomany() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_dangling
*
@@ -2647,25 +2464,18 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
* missing files and missing objects.
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Tuesday, August 9, 2005
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_dangling(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- hid_t rid = (-1); /* Root Group ID */
- hid_t status = (-1); /* Status */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ hid_t rid = -1; /* Root Group ID */
+ hid_t status = -1; /* Status */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
if(new_format)
TESTING("dangling external links (w/new group format)")
@@ -2677,7 +2487,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
h5_fixname(FILENAME[4], fapl, filename2, sizeof filename2);
/* Create first file */
- if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create dangling external links */
if(H5Lcreate_external("missing", "/missing", fid, "no_file", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -2687,26 +2497,26 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
/* Create second file (for dangling object test) */
- if((fid=H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Close file */
if(H5Fclose(fid) < 0) TEST_ERROR
/* Open first file */
- if((fid=H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
/* Get root group ID */
- if((rid=H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((rid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) TEST_ERROR;
/* Open object through dangling file external link */
H5E_BEGIN_TRY {
gid = H5Gopen2(fid, "no_file", H5P_DEFAULT);
} H5E_END_TRY;
if (gid >= 0) {
- H5_FAILED();
- HDputs(" Should have failed for sequence of too many nested links.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have failed for sequence of too many nested links.");
+ goto error;
}
/* Open object through dangling object external link */
@@ -2714,9 +2524,9 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
gid = H5Gopen2(fid, "no_object", H5P_DEFAULT);
} H5E_END_TRY;
if (gid >= 0) {
- H5_FAILED();
- HDputs(" Should have failed for sequence of too many nested links.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have failed for sequence of too many nested links.");
+ goto error;
}
/* Try to get name of object by index through dangling file external link */
@@ -2736,47 +2546,41 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_dangling() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_prefix
*
* Purpose: 1. target link: "extlinks2"
- * 2. main file: "extlinks0"
- * 3. target file: "tmp/extlinks2"
- * 4. Set up external link prefix via H5Pset_elink_prefix() to be "tmp"
- * Should be able to access the target file in tmp directory via the prefix set
- * by H5Pset_elink_prefix()
+ * 2. main file: "extlinks0"
+ * 3. target file: "tmp_links/extlinks2"
+ * 4. Set up external link prefix via H5Pset_elink_prefix() to be "tmp_links"
+ * Should be able to access the target file in tmp_links directory via the prefix set
+ * by H5Pset_elink_prefix()
*
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * Feb 19, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_prefix(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- hid_t gapl_id = (-1);
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ hid_t gapl_id = -1;
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via H5Pset_elink_prefix()(w/new group format)")
@@ -2788,16 +2592,16 @@ external_link_prefix(hid_t fapl, hbool_t new_format)
/* set up name for external linked target file: "extlinks2" */
h5_fixname(FILENAME[16], fapl, filename2, sizeof filename2);
- /* create tmp directory and get current working directory path */
+ /* create tmp_links directory and get current working directory path */
if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
- TEST_ERROR
+ TEST_ERROR
- /* set up name for target file: "tmp/extlinks2" */
+ /* set up name for target file: "tmp_links/extlinks2" */
h5_fixname(FILENAME[17], fapl, filename3, sizeof filename3);
/* Create the target file */
- if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
- if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((gid = H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* closing for target file */
if(H5Gclose(gid) < 0) TEST_ERROR
@@ -2805,7 +2609,7 @@ external_link_prefix(hid_t fapl, hbool_t new_format)
/* Create the main file */
- if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create external link to target file (without the absolute path) */
if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -2821,9 +2625,9 @@ external_link_prefix(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from pathnames set via H5Pset_elink_prefix() */
if (gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in tmp directory.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in tmp_links directory.");
+ goto error;
}
/* closing for main file */
@@ -2831,45 +2635,39 @@ external_link_prefix(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_prefix() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_abs_mainpath: test 3
*
* Purpose: 1. target link: "extlinks3"
- * 2. main file: Linux:"/CWD/tmp/extlinks0"; Windows: "<cur drive>:/CWD/tmp/extlinks0"
- * 3. target file: "tmp/extlinks3"
- * Should be able to access the target file via the main file's absolute path
+ * 2. main file: Linux:"/CWD/tmp_links/extlinks0"; Windows: "<cur drive>:/CWD/tmp_links/extlinks0"
+ * 3. target file: "tmp_links/extlinks3"
+ * Should be able to access the target file via the main file's absolute path
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * Feb 19, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_abs_mainpath(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE],
- cwdpath[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via main file's absolute path (w/new group format)")
@@ -2878,17 +2676,17 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format)
/* set up name for external linked target file: "extlinks3" */
h5_fixname(FILENAME[18], fapl, filename2, sizeof filename2);
- /* set up name for target file: "tmp/extlinks3" */
+ /* set up name for target file: "tmp_links/extlinks3" */
h5_fixname(FILENAME[19], fapl, filename3, sizeof filename3);
- /* create tmp directory and get current working directory path */
+ /* create tmp_links directory and get current working directory path */
if((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || (NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)))
TEST_ERROR
/*
* set up name for main file:
- * Linux: "/CWD/tmp/extlinks0"
- * Window: "<cur drive>:/CWD/tmp/extlinks0"
+ * Linux: "/CWD/tmp_links/extlinks0"
+ * Window: "<cur drive>:/CWD/tmp_links/extlinks0"
*/
fix_ext_filename(tmpname, cwdpath, FILENAME[13]);
h5_fixname(tmpname, fapl, filename1, sizeof filename1);
@@ -2915,9 +2713,9 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from absolute path set for main file */
if(gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in tmp directory.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in tmp_links directory.");
+ goto error;
}
/* closing for main file */
@@ -2925,43 +2723,37 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_abs_mainpath() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_rel_mainpath: test 4
*
- * Purpose: 1. target link: "extlinks4"
- * 2. main file: "tmp/extlinks0"
- * 3. target file: "tmp/extlinks4"
- * Should be able to access the target file via the main file's CWD+relative path
+ * Purpose: 1. target link: "extlinks4"
+ * 2. main file: "tmp_links/extlinks0"
+ * 3. target file: "tmp_links/extlinks4"
+ * Should be able to access the target file via the main file's CWD+relative path
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * Feb 19, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_rel_mainpath(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via main file's CWD + relative path(w/new group format)")
@@ -2974,14 +2766,14 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format)
if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
TEST_ERROR
- /* set up name for main file: "tmp/extlinks0" */
+ /* set up name for main file: "tmp_links/extlinks0" */
h5_fixname(FILENAME[13], fapl, filename1, sizeof filename1);
- /* set up name for target file: "tmp/extlinks4" */
+ /* set up name for target file: "tmp_links/extlinks4" */
h5_fixname(FILENAME[21], fapl, filename3, sizeof filename3);
/* Create the target file */
- if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
- if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((gid = H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* closing for target file */
if(H5Gclose(gid) < 0) TEST_ERROR
@@ -2989,7 +2781,7 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format)
/* Create the main file */
- if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create external link to target file */
if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -3001,9 +2793,9 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from the main file's relative pathname */
if (gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in current working directory");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in current working directory");
+ goto error;
}
/* closing for main file */
@@ -3011,45 +2803,37 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_rel_mainpath() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_cwd: test 5
*
* Purpose: 1. target link: "extlinks5"
- * 2. main file: Linux:"/CWD/tmp/extlinks0"; Window: "<cur drive>:/CWD/tmp/extlinks0"
- * 2. target file: "extlinks5"
- * Should be able to access the target file in the current working directory
- *
+ * 2. main file: Linux:"/CWD/tmp_links/extlinks0"; Window: "<cur drive>:/CWD/tmp_links/extlinks0"
+ * 3. target file: "extlinks5"
+ * Should be able to access the target file in the current working directory
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * Feb 19, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_cwd(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE],
- cwdpath[NAME_BUF_SIZE];
-
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via current working directory(w/new group format)")
@@ -3065,8 +2849,8 @@ external_link_cwd(hid_t fapl, hbool_t new_format)
/*
* set up name for main file:
- * Linux: "/CWD/tmp/extlinks0"
- * Windows: "<cur drive>:/CWD/tmp/extlinks0"
+ * Linux: "/CWD/tmp_links/extlinks0"
+ * Windows: "<cur drive>:/CWD/tmp_links/extlinks0"
*/
fix_ext_filename(tmpname, cwdpath, FILENAME[13]);
h5_fixname(tmpname, fapl, filename1, sizeof filename1);
@@ -3093,9 +2877,9 @@ external_link_cwd(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from the current working directory */
if(gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in current working directory");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in current working directory");
+ goto error;
}
/* closing for main file */
@@ -3103,46 +2887,39 @@ external_link_cwd(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_cwd() */
-
/*-------------------------------------------------------------------------
* Function: external_link_abstar: test 6
*
- * Purpose: 1. target link: Linux:"/CWD/tmp/extlinks6"; Windows:"<cur drive>:/CWD/tmp/extlinks6"
- * 2. main file: "extlinks0"
- * 3. target file: "tmp/extlinks6"
- * Should be able to access the target file's absolute path
+ * Purpose: 1. target link: Linux:"/CWD/tmp_links/extlinks6"; Windows:"<cur drive>:/CWD/tmp_links/extlinks6"
+ * 2. main file: "extlinks0"
+ * 3. target file: "tmp_links/extlinks6"
+ * Should be able to access the target file's absolute path
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * Feb. 20, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_abstar(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE],
- cwdpath[NAME_BUF_SIZE];
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group IDs */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via target's absolute path (w/new group format)")
@@ -3152,19 +2929,19 @@ external_link_abstar(hid_t fapl, hbool_t new_format)
/* set up name for main file: "extlinks0" */
h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1);
- /* create tmp directory and get current working directory path */
+ /* create tmp_links directory and get current working directory path */
if((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || (NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)))
TEST_ERROR
/*
* set up name for external linked target file:
- * Linux: "/CWD/tmp/extlinks6"
- * Windows: "<cur drive>:/CWD/tmp/extlinks6"
+ * Linux: "/CWD/tmp_links/extlinks6"
+ * Windows: "<cur drive>:/CWD/tmp_links/extlinks6"
*/
fix_ext_filename(tmpname, cwdpath, FILENAME[23]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
- /* set up name for target file: "tmp/extlinks6" */
+ /* set up name for target file: "tmp_links/extlinks6" */
h5_fixname(FILENAME[23], fapl, filename3, sizeof filename3);
/* Create the target file */
@@ -3175,7 +2952,6 @@ external_link_abstar(hid_t fapl, hbool_t new_format)
if(H5Gclose(gid) < 0) TEST_ERROR
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Create the main file */
if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -3189,9 +2965,9 @@ external_link_abstar(hid_t fapl, hbool_t new_format)
/* should be able to find the target file with abolute path */
if(gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in tmp directory.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in tmp_links directory.");
+ goto error;
}
/* closing for main file */
@@ -3199,44 +2975,38 @@ external_link_abstar(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_abstar() */
/*-------------------------------------------------------------------------
* Function: external_link_abstar_cur: test 7
*
- * Purpose: 1. target link: Linux: "/CWD/tmp/extlinks7"; Windows: "<cur drive>:/CWD/tmp/extlinks7"
- * 2. main file: "extlinks0"
- * 3. target file: "extlinks7"
- * Should be able to access the target file via the main file's CWD.
+ * Purpose: 1. target link: Linux: "/CWD/tmp_links/extlinks7"; Windows: "<cur drive>:/CWD/tmp_links/extlinks7"
+ * 2. main file: "extlinks0"
+ * 3. target file: "extlinks7"
+ * Should be able to access the target file via the main file's CWD.
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * Feb. 20, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_abstar_cur(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE],
- cwdpath[NAME_BUF_SIZE];
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group IDs */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via main file's CWD (w/new group format)")
@@ -3249,14 +3019,14 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format)
/* set up name for target file name: "extlinks7" */
h5_fixname(FILENAME[24], fapl, filename3, sizeof filename3);
- /* create tmp directory and get current working directory path */
+ /* create tmp_links directory and get current working directory path */
if((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || (NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)))
TEST_ERROR
/*
* set up name for external linked target file:
- * Linux: "/CWD/tmp/extlinks7"
- * Windows: "<cur drive>:/CWD/tmp/extlinks7"
+ * Linux: "/CWD/tmp_links/extlinks7"
+ * Windows: "<cur drive>:/CWD/tmp_links/extlinks7"
*/
fix_ext_filename(tmpname, cwdpath, FILENAME[25]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
@@ -3269,7 +3039,6 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format)
if(H5Gclose(gid) < 0) TEST_ERROR
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Create the main file */
if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -3283,9 +3052,9 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from main file's current working directory */
if (gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in current working directory.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in current working directory.");
+ goto error;
}
/* closing for main file */
@@ -3293,42 +3062,36 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_abstar_cur() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_reltar: test 8
*
- * Purpose: 1. target link: Linux:"tmp/extlinks8"
- * 2. main file: "extlinks0"
- * 3. target file: "tmp/extlinks8"
- * Should be able to access the target file via the main file's CWD+ target's relative path
+ * Purpose: 1. target link: Linux:"tmp_links/extlinks8"
+ * 2. main file: "extlinks0"
+ * 3. target file: "tmp_links/extlinks8"
+ * Should be able to access the target file via the main file's CWD+ target's relative path
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * Feb. 20, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_reltar(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE];
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group IDs */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via main file's CWD + target's relative path(w/new group format)")
@@ -3338,12 +3101,11 @@ external_link_reltar(hid_t fapl, hbool_t new_format)
/* set up name for main file: "extlinks0" */
h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1);
- /* create tmp directory */
- if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
- TEST_ERROR
+ /* create tmp_links directory */
+ if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) TEST_ERROR
- /* set up name for target file name: "tmp/extlinks8" */
- /* set up name for external linked target file: "tmp/extlinks8" */
+ /* set up name for target file name: "tmp_links/extlinks8" */
+ /* set up name for external linked target file: "tmp_links/extlinks8" */
h5_fixname(FILENAME[26], fapl, filename2, sizeof filename2);
/* Create the target file */
@@ -3363,9 +3125,9 @@ external_link_reltar(hid_t fapl, hbool_t new_format)
/* Open object through external link */
if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in tmp directory.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in tmp_links directory.");
+ goto error;
} /* end if */
/* closing for main file */
@@ -3373,45 +3135,39 @@ external_link_reltar(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_reltar() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_chdir: test 9
*
* Purpose:
- * 1. target link: "extlinks9"
- * 2. main file: "extlinks0"
- * 3. target file" "tmp/extlinks9"
- * 3. chdir "tmp"
- * Should be able to access the target file in current working directory
+ * 1. target link: "extlinks9"
+ * 2. main file: "extlinks0"
+ * 3. target file" "tmp_links/extlinks9"
+ * 3. chdir "tmp_links"
+ * Should be able to access the target file in current working directory
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * Feb. 20, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_chdir(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via chdir and found in current working directory (w/new group format)")
@@ -3423,11 +3179,10 @@ external_link_chdir(hid_t fapl, hbool_t new_format)
/* set up name for external linked target file ("extlinks9") */
h5_fixname(FILENAME[27], fapl, filename2, sizeof filename2);
- /* create tmp directory */
- if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
- TEST_ERROR
+ /* create tmp_links directory */
+ if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) TEST_ERROR
- /* set up name for target file name ("tmp/extlinks9") */
+ /* set up name for target file name ("tmp_links/extlinks9") */
h5_fixname(FILENAME[28], fapl, filename3, sizeof filename3);
/* Create the target file */
@@ -3438,9 +3193,8 @@ external_link_chdir(hid_t fapl, hbool_t new_format)
if(H5Gclose(gid) < 0) TEST_ERROR
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Create the main file */
- if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create external link to target file */
if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -3460,9 +3214,9 @@ external_link_chdir(hid_t fapl, hbool_t new_format)
* main file's current working directory + pathname of external linked targetfile
*/
if (gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in tmp directory.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in tmp_links directory.");
+ goto error;
}
/* closing for main file */
@@ -3470,62 +3224,56 @@ external_link_chdir(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_chdir() */
-
+
/*-------------------------------------------------------------------------
* Function: external_set_elink_fapl1: test 10
*
* Purpose: To verify that the external linked target file with physical layout
- * different from the parent can be successfully opened.
- *
- * 1. target link: "extlinks16"
- * 2. target file: "extlinks16"
- * 3. main file: Linux:"/CWD/tmp/extlinks0"; Window: "<cur drive>:/CWD/tmp/extlinks0"
- * 4. Create target file A to be a "family" file: extlinks16A
- * 4. Create target file B to be a "multi" file: extlinks16B
- * 5. Create external link from main file to target file A: ext_linkA->extlinks16A:/A
- * 5. Create external link from main file to target file B: ext_linkB->extlinks16B:/B
- * 6. Should succeed in opening the target object: ext_extA
- * 6. Should succeed in opening the target object: ext_extB
+ * different from the parent can be successfully opened.
+ *
+ * 1. target link: "extlinks16"
+ * 2. target file: "extlinks16"
+ * 3. main file: Linux:"/CWD/tmp_links/extlinks0"; Window: "<cur drive>:/CWD/tmp_links/extlinks0"
+ * 4. Create target file A to be a "family" file: extlinks16A
+ * 4. Create target file B to be a "multi" file: extlinks16B
+ * 5. Create external link from main file to target file A: ext_linkA->extlinks16A:/A
+ * 5. Create external link from main file to target file B: ext_linkB->extlinks16B:/B
+ * 6. Should succeed in opening the target object: ext_extA
+ * 6. Should succeed in opening the target object: ext_extB
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * Sept. 12, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
{
- hid_t fid=(-1);
- hid_t fidA=(-1), fidB=(-1);
- hid_t gidA=(-1), gidB=(-1);
- hid_t oidA=(-1), oidB=(-1);
- char filename1[NAME_BUF_SIZE],
- filename2A[NAME_BUF_SIZE],
- filename2B[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE],
- cwdpath[NAME_BUF_SIZE];
- hid_t fam_fapl=-1, multi_fapl=-1;
- hid_t lapl_idA=-1, lapl_idB=-1;
- H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
- hid_t memb_fapl[H5FD_MEM_NTYPES];
- char sv[H5FD_MEM_NTYPES][64];
- const char *memb_name[H5FD_MEM_NTYPES];
- haddr_t memb_addr[H5FD_MEM_NTYPES];
+ hid_t fid=(-1);
+ hid_t fidA=(-1), fidB=(-1);
+ hid_t gidA=(-1), gidB=(-1);
+ hid_t oidA=(-1), oidB=(-1);
+ char filename1[NAME_BUF_SIZE],
+ filename2A[NAME_BUF_SIZE],
+ filename2B[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
+ hid_t fam_fapl=-1, multi_fapl=-1;
+ hid_t lapl_idA=-1, lapl_idB=-1;
+ hid_t memb_fapl[H5FD_MEM_NTYPES];
+ char sv[H5FD_MEM_NTYPES][64];
+ H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
+ const char *memb_name[H5FD_MEM_NTYPES];
+ haddr_t memb_addr[H5FD_MEM_NTYPES];
if(new_format)
TESTING("H5Pset/get_elink_fapl() with different physical layouts (w/new group format)")
@@ -3533,20 +3281,19 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
TESTING("H5Pset/get_elink_fapl() with different physical layouts")
if((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || (NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)))
- TEST_ERROR
+ TEST_ERROR
/*
* set up name for main file:
- * Linux: "/CWD/tmp/extlinks0"
- * Windows: "<cur drive>:/CWD/tmp/extlinks0"
+ * Linux: "/CWD/tmp_links/extlinks0"
+ * Windows: "<cur drive>:/CWD/tmp_links/extlinks0"
*/
fix_ext_filename(tmpname, cwdpath, FILENAME[13]);
h5_fixname(tmpname, fapl, filename1, sizeof filename1);
/* create "family" fapl */
fam_fapl = h5_fileaccess();
- if(H5Pset_fapl_family(fam_fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0)
- TEST_ERROR;
+ if(H5Pset_fapl_family(fam_fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) TEST_ERROR;
/* set up name for external linked target file A: "extlinks16A" */
/* set up name for target file A: "extlinks16A" */
@@ -3560,8 +3307,8 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
HDmemset(sv, 0, sizeof sv);
for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
- memb_map[mt] = H5FD_MEM_SUPER;
- memb_fapl[mt] = H5P_DEFAULT;
+ memb_map[mt] = H5FD_MEM_SUPER;
+ memb_fapl[mt] = H5P_DEFAULT;
} /* end for */
memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
@@ -3569,34 +3316,33 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
memb_map[H5FD_MEM_GHEAP] = H5FD_MEM_GHEAP;
memb_map[H5FD_MEM_LHEAP] = H5FD_MEM_LHEAP;
- sprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's');
+ HDsnprintf(sv[H5FD_MEM_SUPER], sizeof(sv[H5FD_MEM_SUPER]), "%%s-%c.h5", 's');
memb_name[H5FD_MEM_SUPER] = sv[H5FD_MEM_SUPER];
memb_addr[H5FD_MEM_SUPER] = 0;
- sprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b');
+ HDsnprintf(sv[H5FD_MEM_BTREE], sizeof(sv[H5FD_MEM_BTREE]), "%%s-%c.h5", 'b');
memb_name[H5FD_MEM_BTREE] = sv[H5FD_MEM_BTREE];
memb_addr[H5FD_MEM_BTREE] = HADDR_MAX/6;
- sprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r');
+ HDsnprintf(sv[H5FD_MEM_DRAW], sizeof(sv[H5FD_MEM_DRAW]), "%%s-%c.h5", 'r');
memb_name[H5FD_MEM_DRAW] = sv[H5FD_MEM_DRAW];
memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/3;
- sprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g');
+ HDsnprintf(sv[H5FD_MEM_GHEAP], sizeof(sv[H5FD_MEM_GHEAP]), "%%s-%c.h5", 'g');
memb_name[H5FD_MEM_GHEAP] = sv[H5FD_MEM_GHEAP];
memb_addr[H5FD_MEM_GHEAP] = HADDR_MAX/2;
- sprintf(sv[H5FD_MEM_LHEAP], "%%s-%c.h5", 'l');
+ HDsnprintf(sv[H5FD_MEM_LHEAP], sizeof(sv[H5FD_MEM_LHEAP]), "%%s-%c.h5", 'l');
memb_name[H5FD_MEM_LHEAP] = sv[H5FD_MEM_LHEAP];
memb_addr[H5FD_MEM_LHEAP] = (HADDR_MAX/3)*2;
- sprintf(sv[H5FD_MEM_OHDR], "%%s-%c.h5", 'o');
+ HDsnprintf(sv[H5FD_MEM_OHDR], sizeof(sv[H5FD_MEM_OHDR]), "%%s-%c.h5", 'o');
memb_name[H5FD_MEM_OHDR] = sv[H5FD_MEM_OHDR];
memb_addr[H5FD_MEM_OHDR] = (HADDR_MAX/6)*5;
/* create "multi" fapl */
multi_fapl = h5_fileaccess();
- if(H5Pset_fapl_multi(multi_fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE) < 0)
- TEST_ERROR;
+ if(H5Pset_fapl_multi(multi_fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE) < 0) TEST_ERROR;
/* set up name for external linked target file B: "extlinks16B" */
/* set up name for target file B: "extlinks16B" */
@@ -3620,11 +3366,9 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create external link to target file A:/A */
- if(H5Lcreate_external(filename2A, "/A", fid, "ext_linkA", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2A, "/A", fid, "ext_linkA", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Create external link to target file B:/B */
- if(H5Lcreate_external(filename2B, "/B", fid, "ext_linkB", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2B, "/B", fid, "ext_linkB", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Set file access property list for link access to use the family driver */
if((lapl_idA = H5Pcreate(H5P_LINK_ACCESS)) < 0) TEST_ERROR
@@ -3635,9 +3379,9 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
/* should succeed in opening the target object A in the current working directory */
if (oidA < 0) {
- H5_FAILED();
- HDputs(" Should succeed in opening family target file A in current working directory");
- goto error;
+ H5_FAILED();
+ HDputs(" Should succeed in opening family target file A in current working directory");
+ goto error;
}
/* Set file access property list for link access to use the multi driver */
@@ -3649,9 +3393,9 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
/* should succeed in opening the target object B in the current working directory */
if (oidB < 0) {
- H5_FAILED();
- HDputs(" Should succeed in opening multi target file B in current working directory");
- goto error;
+ H5_FAILED();
+ HDputs(" Should succeed in opening multi target file B in current working directory");
+ goto error;
}
/* closing */
@@ -3664,67 +3408,61 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Pclose (lapl_idA);
- H5Pclose (lapl_idB);
- H5Pclose (fam_fapl);
- H5Pclose (multi_fapl);
- H5Gclose (gidA);
- H5Gclose (gidB);
- H5Oclose (oidA);
- H5Oclose (oidB);
- H5Fclose (fid);
- } H5E_END_TRY;
- return -1;
+ H5Pclose (lapl_idA);
+ H5Pclose (lapl_idB);
+ H5Pclose (fam_fapl);
+ H5Pclose (multi_fapl);
+ H5Gclose (gidA);
+ H5Gclose (gidB);
+ H5Oclose (oidA);
+ H5Oclose (oidB);
+ H5Fclose (fid);
+ } H5E_END_TRY;
+ return FAIL;
} /* end external_set_elink_fapl1() */
-
+
/*-------------------------------------------------------------------------
* Function: external_set_elink_fapl2: test 11
*
* Purpose: To verify that processing done to the external linked target object is
- * correctly handled when the parent and target files have the same
- * physical layout but different access methods.
- *
- * 1. target link: "extlinks17"
- * 2. target file: "extlinks17"
- * 3. main file: Linux:"/CWD/tmp/extlinks0"; Window: "<cur drive>:/CWD/tmp/extlinks0"
- * 4. Create target file to be a "core" file:/A/Dataset
- * 5. Create external link from main file to target file:ext_link->target file:/A/Dataset
- * 6. Set the file access property list of the link access to use "core" file without
- * backing store
- * 6. Should succeed in opening the target dataset: ext_link
- * 7. Write data to the target dataset
- * 8. On closing, the file size of target should be the same as before since
- * it is opened without backing store.
+ * correctly handled when the parent and target files have the same
+ * physical layout but different access methods.
+ *
+ * 1. target link: "extlinks17"
+ * 2. target file: "extlinks17"
+ * 3. main file: Linux:"/CWD/tmp_links/extlinks0"; Window: "<cur drive>:/CWD/tmp_links/extlinks0"
+ * 4. Create target file to be a "core" file:/A/Dataset
+ * 5. Create external link from main file to target file:ext_link->target file:/A/Dataset
+ * 6. Set the file access property list of the link access to use "core" file without
+ * backing store
+ * 7. Should succeed in opening the target dataset: ext_link
+ * 8. Write data to the target dataset
+ * 9. On closing, the file size of target should be the same as before since
+ * it is opened without backing store.
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * Sept. 12, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- hid_t core_fapl = -1, space = -1, dset = -1, did = -1, dapl_id = -1, dcpl = -1;
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE],
- cwdpath[NAME_BUF_SIZE];
- hsize_t dims[2];
- int points[NUM40][NUM40];
- h5_stat_size_t filesize, new_filesize;
- int i, j, n;
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group IDs */
+ hid_t core_fapl = -1, space = -1, dset = -1, did = -1, dapl_id = -1, dcpl = -1;
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
+ hsize_t dims[2];
+ int points[NUM40][NUM40];
+ int i, j, n;
+ h5_stat_size_t filesize, new_filesize;
if(new_format)
TESTING("H5Pset/get_elink_fapl() with same physical layout (w/new group format)")
@@ -3736,16 +3474,15 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
/*
* set up name for main file:
- * Linux: "/CWD/tmp/extlinks0"
- * Windows: "<cur drive>:/CWD/tmp/extlinks0"
+ * Linux: "/CWD/tmp_links/extlinks0"
+ * Windows: "<cur drive>:/CWD/tmp_links/extlinks0"
*/
fix_ext_filename(tmpname, cwdpath, FILENAME[13]);
h5_fixname(tmpname, fapl, filename1, sizeof filename1);
/* create fapl for the target file to be a "core" file */
core_fapl = h5_fileaccess();
- if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, TRUE) < 0)
- TEST_ERROR
+ if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, TRUE) < 0) TEST_ERROR
/* set up name for external linked target file: "extlinks17" */
/* set up name for target file: "extlinks17" */
@@ -3760,12 +3497,15 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
/* Create dataset creation property list */
- if((dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g)) < 0) TEST_ERROR;
+ if (dcpl_g == H5P_DEFAULT)
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ else
+ dcpl = H5Pcopy(dcpl_g);
+ if (0 > dcpl) TEST_ERROR;
if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) TEST_ERROR;
/* create "Dataset" in group "A" of target file */
- if((dset = H5Dcreate2(gid, "Dataset", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ if((dset = H5Dcreate2(gid, "Dataset", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR
/* closing for target file */
if(H5Pclose(dcpl) < 0) TEST_ERROR
@@ -3781,12 +3521,10 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create external link to target file: ext_link->extlinks17:/A/Dataset */
- if(H5Lcreate_external(filename2, "/A/Dataset", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2, "/A/Dataset", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* create fapl to be a "core" file without backing store */
- if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, FALSE) < 0)
- TEST_ERROR
+ if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, FALSE) < 0) TEST_ERROR
/* Set file access property list for link access to use the "core" driver */
if((dapl_id = H5Pcreate(H5P_DATASET_ACCESS)) < 0) TEST_ERROR
@@ -3806,8 +3544,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
points[i][j] = n++;
/* Write the data to the dataset */
- if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
- TEST_ERROR
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) TEST_ERROR
if(H5Pclose(dapl_id) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -3821,59 +3558,53 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
if(H5Pclose(core_fapl) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Pclose(dcpl);
- H5Sclose(space);
- H5Dclose(dset);
- H5Pclose(core_fapl);
- H5Pclose(dapl_id);
- H5Dclose(did);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Pclose(dcpl);
+ H5Sclose(space);
+ H5Dclose(dset);
+ H5Pclose(core_fapl);
+ H5Pclose(dapl_id);
+ H5Dclose(did);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_set_elink_fapl2() */
-
+
/*-------------------------------------------------------------------------
* Function: external_set_elink_fapl3: test 12
*
* Purpose: To verify that the file access property list for link access is
- * set and closed correctly.
- *
- * 1. Create fapl for core driver
- * 2. Create fapl for stdio driver
- * 3. Set link access's fapl to use stdio driver
- * 4. Verify that link access's fapl is the stdio driver
- * 5. Reset the link access' fapl to use core driver
- * 6. H5Pcopy() the link access
- * 7. Get the fapl property value of the original link access
- * 8. Close the original link access
- * 9. H5Pclose() fapl should fail since closing in step #8 should also close its fapl
- * 10. Verify that the copied link access's fapl is the core driver
- * 11. Get the fapl property value of the copied link access
- * 12. H5Premove() the fapl property from the copied link access
- * 13. H5Pclose() fapl set in the copied link access should fail since the
- * removal in #12 should also close its fapl
+ * set and closed correctly.
+ *
+ * 1. Create fapl for core driver
+ * 2. Create fapl for stdio driver
+ * 3. Set link access's fapl to use stdio driver
+ * 4. Verify that link access's fapl is the stdio driver
+ * 5. Reset the link access' fapl to use core driver
+ * 6. H5Pcopy() the link access
+ * 7. Get the fapl property value of the original link access
+ * 8. Close the original link access
+ * 9. H5Pclose() fapl should fail since closing in step #8 should also close its fapl
+ * 10. Verify that the copied link access's fapl is the core driver
+ * 11. Get the fapl property value of the copied link access
+ * 12. H5Premove() the fapl property from the copied link access
+ * 13. H5Pclose() fapl set in the copied link access should fail since the
+ * removal in #12 should also close its fapl
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * Sept. 12, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_set_elink_fapl3(hbool_t new_format)
{
- hid_t core_fapl = -1, stdio_fapl = -1;
- hid_t lapl_id = -1, new_lapl_id = -1, l_fapl = -1, out_fapl;
+ hid_t core_fapl = -1, stdio_fapl = -1;
+ hid_t lapl_id = -1, new_lapl_id = -1, l_fapl = -1, out_fapl;
if(new_format)
TESTING("H5Pset/get_fapl() (w/new group format)")
@@ -3882,12 +3613,10 @@ external_set_elink_fapl3(hbool_t new_format)
/* create fapl for the target file to be a "core" file */
core_fapl = h5_fileaccess();
- if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, TRUE) < 0)
- TEST_ERROR
+ if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, TRUE) < 0) TEST_ERROR
stdio_fapl = h5_fileaccess();
- if(H5Pset_fapl_stdio(stdio_fapl) < 0)
- TEST_ERROR
+ if(H5Pset_fapl_stdio(stdio_fapl) < 0) TEST_ERROR
/* Set file access property list for link access to use the "stdio" driver */
if((lapl_id = H5Pcreate(H5P_LINK_ACCESS)) < 0) TEST_ERROR
@@ -3928,9 +3657,9 @@ external_set_elink_fapl3(hbool_t new_format)
if(H5Pclose(stdio_fapl) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
H5Pclose(l_fapl);
H5Pclose(lapl_id);
@@ -3938,10 +3667,10 @@ external_set_elink_fapl3(hbool_t new_format)
H5Pclose(core_fapl);
H5Pclose(stdio_fapl);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_set_elink_fapl3() */
-
+
/*-------------------------------------------------------------------------
* Function: external_set_elink_acc_flags
*
@@ -3949,12 +3678,6 @@ external_set_elink_fapl3(hbool_t new_format)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Jan. 5, 2009
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -4149,9 +3872,9 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo
if(H5Pclose(gapl) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
H5Gclose(group);
H5Gclose(subgroup);
@@ -4159,10 +3882,10 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo
H5Fclose(file2);
H5Pclose(gapl);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_set_elink_acc_flags() */
-
+
/*-------------------------------------------------------------------------
* Function: external_set_elink_cb
*
@@ -4170,12 +3893,6 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Jan. 5, 2009
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
/* User data structure for callback function */
@@ -4213,7 +3930,7 @@ external_set_elink_cb_cb(const char *parent_file, const char *parent_group,
if (op_data->code == 2)
*flags = H5F_ACC_DEFAULT;
- return 0;
+ return SUCCEED;
}
/* Main test function */
@@ -4222,7 +3939,7 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format)
{
hid_t file1 = -1, file2 = -1, group = -1, gapl = -1, fam_fapl = -1, ret_fapl = -1, base_driver;
set_elink_cb_t op_data,
- *op_data_p;
+ *op_data_p;
H5L_elink_traverse_t cb;
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE];
@@ -4238,7 +3955,7 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format)
op_data.target_file = filename2;
/* Core file driver has issues when used as the member file driver for a family file */
/* Family file driver cannot be used with family or multi drivers for member files */
- /* Also disable parallel member drivers, because H5F_HAS_FEATURE(H5FD_FEAT_HAS_MPI)
+ /* Also disable parallel member drivers, because H5F_HAS_FEATURE(H5FD_FEAT_HAS_MPI)
would report FALSE, causing problems */
base_driver = H5Pget_driver(fapl);
op_data.base_fapl = (base_driver == H5FD_FAMILY || base_driver == H5FD_MULTI
@@ -4315,9 +4032,9 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format)
if(H5Pclose(gapl) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
H5Gclose(group);
H5Fclose(file1);
@@ -4326,10 +4043,10 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format)
H5Pclose(ret_fapl);
H5Pclose(fam_fapl);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_set_elink_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: external_reset_register
*
@@ -4338,12 +4055,6 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Apr. 9, 2009
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -4381,47 +4092,41 @@ external_reset_register(void)
if(HDremove(filename) != 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
H5Fclose(file);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_reset_register() */
-
+
#ifdef H5_HAVE_WINDOW_PATH
/*-------------------------------------------------------------------------
* Function: external_link_win1
*
* Purpose:
- * 1. target link: "/CWD/tmp/extlinks10"
- * 2. main file: "extlinks0"
- * 3. target file: "extlinks10"
- * Should be able to find the target file via main file's current drive/rel path
+ * 1. target link: "/CWD/tmp_links/extlinks10"
+ * 2. main file: "extlinks0"
+ * 3. target file: "extlinks10"
+ * Should be able to find the target file via main file's current drive/rel path
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * April 15, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_win1(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE],
- cwdpath[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via main file's current drive/rel path(windows)(w/new group format)")
@@ -4434,7 +4139,7 @@ external_link_win1(hid_t fapl, hbool_t new_format)
if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))
TEST_ERROR
- /* set up name for target link: "/CWD/tmp/extlinks10" */
+ /* set up name for target link: "/CWD/tmp_links/extlinks10" */
HDstrcpy(tmpname, &cwdpath[2]); /* stripped the drive letter to make it rel drive but absolute path */
HDstrcat(tmpname, "/");
HDstrcat(tmpname, FILENAME[30]);
@@ -4451,7 +4156,6 @@ external_link_win1(hid_t fapl, hbool_t new_format)
if(H5Gclose(gid) < 0) TEST_ERROR
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Create the main file */
if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -4465,9 +4169,9 @@ external_link_win1(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's CWD*/
if(gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in CWD.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in CWD.");
+ goto error;
}
/* closing for main file */
@@ -4475,46 +4179,40 @@ external_link_win1(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_win1() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_win2
*
* Purpose:
- * 1. target link: "/CWD/tmp/extlinks11"
- * 2. main file: "extlinks0"
- * 3. target file: "tmp/extlinks11"
- * Should be able to access the target file directly (rel drive/abs path)
+ * 1. target link: "/CWD/tmp_links/extlinks11"
+ * 2. main file: "extlinks0"
+ * 3. target file: "tmp_links/extlinks11"
+ * Should be able to access the target file directly (rel drive/abs path)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * April 15, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_win2(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE],
- cwdpath[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via target's rel drive/abs path directly(windows)(w/new group format)")
@@ -4524,17 +4222,17 @@ external_link_win2(hid_t fapl, hbool_t new_format)
/* set up name for main file: "extlinks0" */
h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1);
- /* create tmp directory and get current working directory path */
+ /* create tmp_links directory and get current working directory path */
if((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || (NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)))
TEST_ERROR
- /* set up name for target link: "/CWD/tmp/extlinks11" */
+ /* set up name for target link: "/CWD/tmp_links/extlinks11" */
HDstrcpy(tmpname, &cwdpath[2]); /* stripped the drive letter to make it relative drive but absolute path */
HDstrcat(tmpname, "/");
HDstrcat(tmpname, FILENAME[31]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
- /* set up name for target file: "tmp/extlinks11" */
+ /* set up name for target file: "tmp_links/extlinks11" */
h5_fixname(FILENAME[31], fapl, filename3, sizeof filename3);
/* Create the target file */
@@ -4559,9 +4257,9 @@ external_link_win2(hid_t fapl, hbool_t new_format)
/* should be able to find the target file directly */
if(gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in tmp.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in tmp_links.");
+ goto error;
}
/* closing for main file */
@@ -4569,46 +4267,40 @@ external_link_win2(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_win2() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_win3
*
* Purpose:
- * 1. target link: "<cur drive>:tmp/extlinks12"
- * 2. main file: "extlinks0"
- * 3. target file: "tmp/extlinks12"
- * Should be able to access the target file directly (abs drive/rel path)
+ * 1. target link: "<cur drive>:tmp_links/extlinks12"
+ * 2. main file: "extlinks0"
+ * 3. target file: "tmp_links/extlinks12"
+ * Should be able to access the target file directly (abs drive/rel path)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * April i15 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_win3(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- int drive=0;
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ int drive = 0;
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via target's abs drive/rel path directly (windows)(w/new group format)")
@@ -4618,16 +4310,16 @@ external_link_win3(hid_t fapl, hbool_t new_format)
/* set up name for main file: "extlinks0" */
h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1);
- /* create tmp directory */
+ /* create tmp_links directory */
if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
TEST_ERROR
- /* set up name for target link: "<drive-letter>:tmp/extlinks12" */
+ /* set up name for target link: "<drive-letter>:tmp_links/extlinks12" */
drive = HDgetdrive();
- sprintf(tmpname, "%c:%s", (drive+'A'-1), FILENAME[32]);
+ HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[32]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
- /* set up name for target file: "tmp/extlinks12" */
+ /* set up name for target file: "tmp_links/extlinks12" */
h5_fixname(FILENAME[32], fapl, filename3, sizeof filename3);
/* Create the target file */
@@ -4652,9 +4344,9 @@ external_link_win3(hid_t fapl, hbool_t new_format)
/* should be able to find the target file directly */
if (gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in tmp.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in tmp_links.");
+ goto error;
}
/* closing for main file */
@@ -4662,74 +4354,67 @@ external_link_win3(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_win3() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_win4
*
* Purpose:
- * 1. target link: "<cur drive>:extlinks13"
- * 2. main file: "<cur-drive>:tmp/extlinks0"
- * 3. target file: tmp/extlinks13
- * Should be able to access the target file via main file's abs drive/rel path
+ * 1. target link: "<cur drive>:extlinks13"
+ * 2. main file: "<cur-drive>:tmp_links/extlinks0"
+ * 3. target file: tmp_links/extlinks13
+ * Should be able to access the target file via main file's abs drive/rel path
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * April 15, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_win4(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- int drive=0;
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ int drive=0;
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via main file's abs drive/rel path (windows)(w/new group format)")
else
TESTING("external links via main file's abs drive/rel path (windows)")
- /* set up name for main file: "<drive-letter>:tmp/extlinks0" */
+ /* set up name for main file: "<drive-letter>:tmp_links/extlinks0" */
drive = HDgetdrive();
- sprintf(tmpname, "%c:%s", (drive+'A'-1), FILENAME[13]);
+ HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[13]);
h5_fixname(tmpname, fapl, filename1, sizeof filename1);
/* set up name for target link: "<drive-letter>:extlinks13" */
- sprintf(tmpname, "%c:%s", (drive+'A'-1), FILENAME[33]);
+ HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[33]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
- /* set up name for target file: "tmp/extlinks13" */
+ /* set up name for target file: "tmp_links/extlinks13" */
h5_fixname(FILENAME[34], fapl, filename3, sizeof filename3);
/* Create the target file */
- if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
- if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((gid = H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* closing for target file */
if(H5Gclose(gid) < 0) TEST_ERROR
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Create the main file */
- if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create external link to target file */
if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -4741,9 +4426,9 @@ external_link_win4(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's absolute drive/relative path */
if (gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in CWD.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in CWD.");
+ goto error;
}
/* closing for main file */
@@ -4751,47 +4436,41 @@ external_link_win4(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_win4() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_win5
*
* Purpose:
- * 1. target link: "<cur drive+1>:tmp/extlinks14"
- * 2. main file: "/CWD/extlinks0"
- * 3. target file: "tmp/extlinks14"
- * Should be able to access the target file via main file's relative drive/absolute path
+ * 1. target link: "<cur drive+1>:tmp_links/extlinks14"
+ * 2. main file: "/CWD/extlinks0"
+ * 3. target file: "tmp_links/extlinks14"
+ * Should be able to access the target file via main file's relative drive/absolute path
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * April 15, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_win5(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- int drive=0;
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE],
- cwdpath[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ int drive=0;
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via main file's rel drive/abs path (windows)(w/new group format)")
@@ -4801,6 +4480,10 @@ external_link_win5(hid_t fapl, hbool_t new_format)
if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))
TEST_ERROR
drive = HDgetdrive();
+ if (drive >= 26)
+ drive -= 1; /* account for drive Z */
+ else
+ drive += 1;
/* set up name for main file: "/CWD/extlinks0" */
HDstrcpy(tmpname, &cwdpath[2]); /* stripped the drive letter to make it rel drive but absolute path */
@@ -4808,11 +4491,11 @@ external_link_win5(hid_t fapl, hbool_t new_format)
HDstrcat(tmpname, FILENAME[12]);
h5_fixname(tmpname, fapl, filename1, sizeof filename1);
- /* set up name for target link: "<drive-letter+1>:tmp/extlinks14" */
- sprintf(tmpname, "%c:%s", ((drive+1)+'A'-1), FILENAME[35]);
+ /* set up name for target link: "<drive-letter+1>:tmp_links/extlinks14" */
+ HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[35]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
- /* set up name for target file: "tmp/extlinks14" */
+ /* set up name for target file: "tmp_links/extlinks14" */
h5_fixname(FILENAME[35], fapl, filename3, sizeof filename3);
/* Create the target file */
@@ -4823,7 +4506,6 @@ external_link_win5(hid_t fapl, hbool_t new_format)
if(H5Gclose(gid) < 0) TEST_ERROR
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Create the main file */
if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -4837,9 +4519,9 @@ external_link_win5(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's rel drive/abs path */
if(gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in CWD.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in CWD.");
+ goto error;
}
/* closing for main file */
@@ -4847,78 +4529,75 @@ external_link_win5(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_win5() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_win6
*
* Purpose:
- * 1. target link: "<cur drive+1>:tmp/extlinks15"
- * 2. main file: "extlinks0"
- * 3. target file: "tmp/extlinks15"
- * Should be able to access the target file via target's current drive/rel path
+ * 1. target link: "<cur drive+1>:tmp_links/extlinks15"
+ * 2. main file: "extlinks0"
+ * 3. target file: "tmp_links/extlinks15"
+ * Should be able to access the target file via target's current drive/rel path
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi
- * April 15, 2008
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_win6(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- int drive=0;
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ int drive=0;
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via target's current drive/rel path (windows)(w/new group format)")
else
TESTING("external links via target's current drive/rel path (windows)")
- /* create tmp directory */
+ /* create tmp_links directory */
if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
TEST_ERROR
drive = HDgetdrive();
+ if (drive >= 26)
+ drive -= 1; /* account for drive Z */
+ else
+ drive += 1;
/* set up name for main file: "extlinks0" */
h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1);
- /* set up name for target link: "<drive-letter+1>:tmp/extlinks15" */
- sprintf(tmpname, "%c:%s", ((drive+1)+'A'-1), FILENAME[36]);
+ /* set up name for target link: "<drive-letter+1>:tmp_links/extlinks15" */
+ HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[36]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
/* set up name for target file: "tmp/extlinks15" */
h5_fixname(FILENAME[36], fapl, filename3, sizeof filename3);
/* Create the target file */
- if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
- if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((gid = H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* closing for target file */
if(H5Gclose(gid) < 0) TEST_ERROR
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Create the main file */
- if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create external link to target file */
if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -4930,9 +4609,9 @@ external_link_win6(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via target file's rel path in current drive */
if (gid < 0) {
- H5_FAILED();
- HDputs(" Should have found the file in tmp.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have found the file in tmp_links.");
+ goto error;
}
/* closing for main file */
@@ -4940,25 +4619,25 @@ external_link_win6(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_win6() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_win7
*
* Purpose:
- * 1. UNC target link: "\\127.0.01\c$/tmp/extlinks10"
+ * 1. UNC target link: "\\127.0.01\c$/tmp_links/extlinks10"
* 2. main file: "extlinks0"
* 3. target file: "extlinks15"
- * Should be able to find the target file via main file's local host/main drive/rel path
+ * Should be able to find the target file via main file's local host/main drive/rel path
*
* Return: Success: 0
* Failure: -1
@@ -4967,8 +4646,8 @@ external_link_win6(hid_t fapl, hbool_t new_format)
static int
external_link_win7(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE],
filename3[NAME_BUF_SIZE],
@@ -4986,7 +4665,7 @@ external_link_win7(hid_t fapl, hbool_t new_format)
if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))
TEST_ERROR
- /* set up name for target link: "\\127.0.0.1\c$/tmp/extlinks10" */
+ /* set up name for target link: "\\127.0.0.1\c$/tmp_links/extlinks10" */
HDstrcpy(tmpname, "\\\\127.0.0.1\\c$"); /* absolute path */
HDstrcat(tmpname, "/");
HDstrcat(tmpname, FILENAME[30]);
@@ -5003,7 +4682,6 @@ external_link_win7(hid_t fapl, hbool_t new_format)
if(H5Gclose(gid) < 0) TEST_ERROR
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Create the main file */
if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -5027,17 +4705,17 @@ external_link_win7(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_win7() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_win8
*
@@ -5045,7 +4723,7 @@ external_link_win7(hid_t fapl, hbool_t new_format)
* 1. Long UNC target link: "\\?\<cur drive>:\CWD\extlinks10"
* 2. main file: "extlinks0"
* 3. target file: "extlinks10"
- * Should be able to access the target file directly (abs drive/abs path)
+ * Should be able to access the target file directly (abs drive/abs path)
*
* Return: Success: 0
* Failure: -1
@@ -5055,9 +4733,9 @@ external_link_win7(hid_t fapl, hbool_t new_format)
static int
external_link_win8(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- int drive=0;
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ int drive = 0;
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE],
filename3[NAME_BUF_SIZE],
@@ -5072,16 +4750,14 @@ external_link_win8(hid_t fapl, hbool_t new_format)
/* set up name for main file: "extlinks0" */
h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1);
- if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))
- TEST_ERROR
+ if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)) TEST_ERROR
- /* create tmp directory */
- if(HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
- TEST_ERROR
+ /* create tmp_links directory */
+ if(HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) TEST_ERROR
/* set up name for target link: "<drive-letter>:\CWD\extlinks10" */
drive = HDgetdrive();
- sprintf(tmpname, "\\\\?\\%c:%s\\%s", (drive+'A'-1), &cwdpath[2], FILENAME[30]);
+ HDsnprintf(tmpname, sizeof(tmpname), "\\\\?\\%c:%s\\%s", (drive+'A'-1), &cwdpath[2], FILENAME[30]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
/* set up name for target file: "extlinks10" */
@@ -5095,7 +4771,6 @@ external_link_win8(hid_t fapl, hbool_t new_format)
if(H5Gclose(gid) < 0) TEST_ERROR
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Create the main file */
if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -5110,7 +4785,7 @@ external_link_win8(hid_t fapl, hbool_t new_format)
/* should be able to find the target file directly */
if(gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in tmp.");
+ HDputs(" Should have found the file in tmp_links.");
goto error;
}
@@ -5119,25 +4794,25 @@ external_link_win8(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_win8() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_win9
*
* Purpose:
- * 1. Long UNC target link: "\\?\UNC\127.0.01\c$/tmp/extlinks10"
+ * 1. Long UNC target link: "\\?\UNC\127.0.01\c$/tmp_links/extlinks10"
* 2. main file: "extlinks0"
* 3. target file: "extlinks15"
- * Should be able to find the target file via main file's local host/main drive/rel path
+ * Should be able to find the target file via main file's local host/main drive/rel path
*
* Return: Success: 0
* Failure: -1
@@ -5146,13 +4821,13 @@ external_link_win8(hid_t fapl, hbool_t new_format)
static int
external_link_win9(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE],
filename3[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE],
- cwdpath[NAME_BUF_SIZE];
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
if(new_format)
TESTING("external links via main file's Long UNC local host/main drive/rel path(windows)(w/new group format)")
@@ -5162,10 +4837,9 @@ external_link_win9(hid_t fapl, hbool_t new_format)
/* set up name for main file: "extlinks0" */
h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1);
- if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))
- TEST_ERROR
+ if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)) TEST_ERROR
- /* set up name for target link: "\\?\UNC\127.0.0.1\c$/tmp/extlinks10" */
+ /* set up name for target link: "\\?\UNC\127.0.0.1\c$/tmp_links/extlinks10" */
HDstrcpy(tmpname, "\\\\?\\UNC\127.0.0.1\\c$"); /* absolute path */
HDstrcat(tmpname, "/");
HDstrcat(tmpname, FILENAME[30]);
@@ -5182,7 +4856,6 @@ external_link_win9(hid_t fapl, hbool_t new_format)
if(H5Gclose(gid) < 0) TEST_ERROR
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Create the main file */
if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -5206,19 +4879,19 @@ external_link_win9(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_win9() */
#endif /* H5_HAVE_WINDOW_PATH */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_recursive
*
@@ -5226,20 +4899,14 @@ external_link_win9(hid_t fapl, hbool_t new_format)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, August 15, 2005
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_recursive(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- char filename1[NAME_BUF_SIZE]; /* Names of files to externally link across */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ char filename1[NAME_BUF_SIZE]; /* Names of files to externally link across */
if(new_format)
TESTING("recursive external links (w/new group format)")
@@ -5250,7 +4917,7 @@ external_link_recursive(hid_t fapl, hbool_t new_format)
h5_fixname(FILENAME[3], fapl, filename1, sizeof filename1);
/* Create first file */
- if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create recursive external links */
if(H5Lcreate_external(filename1, "/recursive", fid, "recursive", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -5258,36 +4925,34 @@ external_link_recursive(hid_t fapl, hbool_t new_format)
/* Close file */
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Open file */
- if((fid=H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
/* Open object through dangling file external link */
H5E_BEGIN_TRY {
gid = H5Gopen2(fid, "recursive", H5P_DEFAULT);
} H5E_END_TRY;
if (gid >= 0) {
- H5_FAILED();
- HDputs(" Should have failed for recursive external links.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have failed for recursive external links.");
+ goto error;
}
/* Close first file */
if(H5Fclose(fid) < 0) TEST_ERROR
-
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_recursive() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_query
*
@@ -5296,25 +4961,19 @@ external_link_recursive(hid_t fapl, hbool_t new_format)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, August 15, 2005
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
external_link_query(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
const char *file_name; /* Name of the file the external link points to */
const char *object_name; /* Name of the object the external link points to */
- H5O_info_t oi; /* Object information */
+ H5O_info_t oi; /* Object information */
H5L_info_t li; /* Link information */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE], /* Names of files to externally link across */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE], /* Names of files to externally link across */
query_buf[NAME_BUF_SIZE]; /* Buffer to hold query result */
if(new_format)
@@ -5327,7 +4986,7 @@ external_link_query(hid_t fapl, hbool_t new_format)
h5_fixname(FILENAME[4], fapl, filename2, sizeof filename2);
/* Create first file, with external link to object in second file */
- if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create external link */
/* (add a few extra '/'s to make certain library normalizes external link object names) */
@@ -5337,16 +4996,16 @@ external_link_query(hid_t fapl, hbool_t new_format)
if(H5Lget_info(fid, "src", &li, H5P_DEFAULT) < 0) TEST_ERROR
if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR
if (H5L_TYPE_EXTERNAL != li.type) {
- H5_FAILED();
- HDputs(" Unexpected link class - should have been an external link");
- goto error;
+ H5_FAILED();
+ HDputs(" Unexpected link class - should have been an external link");
+ goto error;
}
/* Close file */
if(H5Fclose(fid) < 0) TEST_ERROR
/* Create second file to point to */
- if((fid=H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create object to link to */
if((gid = H5Gcreate2(fid, "dst", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -5355,7 +5014,6 @@ external_link_query(hid_t fapl, hbool_t new_format)
/* Close file */
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Open first file */
if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
@@ -5363,9 +5021,9 @@ external_link_query(hid_t fapl, hbool_t new_format)
if(H5Lget_info(fid, "src", &li, H5P_DEFAULT) < 0) TEST_ERROR
if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR
if(H5L_TYPE_EXTERNAL != li.type) {
- H5_FAILED();
- HDputs(" Unexpected link class - should have been an external link");
- goto error;
+ H5_FAILED();
+ HDputs(" Unexpected link class - should have been an external link");
+ goto error;
}
/* Get information for external link. It should be two strings right after each other */
@@ -5381,9 +5039,9 @@ external_link_query(hid_t fapl, hbool_t new_format)
/* Query information about object that external link points to */
if(H5Oget_info_by_name2(fid, "src", &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5O_TYPE_GROUP != oi.type) {
- H5_FAILED();
- HDputs(" Unexpected object type - should have been a group");
- goto error;
+ H5_FAILED();
+ HDputs(" Unexpected object type - should have been a group");
+ goto error;
}
/* Close first file */
@@ -5394,30 +5052,30 @@ external_link_query(hid_t fapl, hbool_t new_format)
/* Make sure that bogus cases trigger errors in H5Lunpack_elink_val */
H5E_BEGIN_TRY {
- if(H5Lunpack_elink_val(query_buf, li.u.val_size - 1, NULL, NULL, NULL) >= 0) TEST_ERROR
+ if(H5Lunpack_elink_val(query_buf, li.u.val_size - 1, NULL, NULL, NULL) >= 0) TEST_ERROR
} H5E_END_TRY
H5E_BEGIN_TRY {
- if(H5Lunpack_elink_val(query_buf, (size_t)0, NULL, NULL, NULL) >= 0) TEST_ERROR
+ if(H5Lunpack_elink_val(query_buf, (size_t)0, NULL, NULL, NULL) >= 0) TEST_ERROR
} H5E_END_TRY
H5E_BEGIN_TRY {
- if(H5Lunpack_elink_val(NULL, (size_t)0, NULL, NULL, NULL) >= 0) TEST_ERROR
+ if(H5Lunpack_elink_val(NULL, (size_t)0, NULL, NULL, NULL) >= 0) TEST_ERROR
} H5E_END_TRY
H5E_BEGIN_TRY {
- if(H5Lunpack_elink_val(NULL, (size_t)1000, NULL, NULL, NULL) >= 0) TEST_ERROR
+ if(H5Lunpack_elink_val(NULL, (size_t)1000, NULL, NULL, NULL) >= 0) TEST_ERROR
} H5E_END_TRY
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_query() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_unlink_compact
*
@@ -5425,19 +5083,15 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Wednesday, January 18, 2006
- *
*-------------------------------------------------------------------------
*/
static int
external_link_unlink_compact(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
if(new_format)
TESTING("unlinking external link in compact group (w/new group format)")
@@ -5467,9 +5121,6 @@ external_link_unlink_compact(hid_t fapl, hbool_t new_format)
/* Close file */
if(H5Fclose(fid) < 0) TEST_ERROR
-
-/* Unlink external link */
-
/* Open first file */
if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
@@ -5492,18 +5143,18 @@ external_link_unlink_compact(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_unlink_compact() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_unlink_dense
*
@@ -5511,25 +5162,21 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Wednesday, January 18, 2006
- *
*-------------------------------------------------------------------------
*/
static int
external_link_unlink_dense(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gcpl = (-1); /* Group creation property list ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
- unsigned nmsgs; /* Number of messages in group's header */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- unsigned u; /* Local index variable */
+ hid_t fid = -1; /* File ID */
+ hid_t gcpl = -1; /* Group creation property list ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
+ unsigned nmsgs; /* Number of messages in group's header */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ unsigned u; /* Local index variable */
if(new_format)
TESTING("unlinking external link in dense group (w/new group format)")
@@ -5565,7 +5212,7 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format)
/* Create enough objects in the root group to change it into a "dense" group */
for(u = 0; u < max_compact; u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(gid2) < 0) TEST_ERROR
} /* end for */
@@ -5594,9 +5241,6 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format)
/* Close file */
if(H5Fclose(fid) < 0) TEST_ERROR
-
-/* Unlink external link */
-
/* Open first file */
if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
@@ -5608,7 +5252,7 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format)
/* Remove enough objects in the root group to change it into a "compact" group */
for(u = 0; u < ((max_compact - min_dense) + 1); u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -5638,18 +5282,18 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_unlink_dense() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_move
*
@@ -5657,20 +5301,16 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, December 5, 2005
- *
*-------------------------------------------------------------------------
*/
static int
external_link_move(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
if(new_format)
TESTING("move external link (w/new group format)")
@@ -5700,9 +5340,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
/* Close file */
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Move external link to different name within same group */
-
/* Open first file */
if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
@@ -5786,7 +5424,6 @@ external_link_move(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
/* Move external link back to original group */
-
/* Open first file */
if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
@@ -5829,18 +5466,18 @@ external_link_move(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_move() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_ride
*
@@ -5849,25 +5486,21 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Wednesday, January 18, 2006
- *
*-------------------------------------------------------------------------
*/
static int
external_link_ride(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gcpl = (-1); /* Group creation property list ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
- unsigned nmsgs; /* Number of messages in group's header */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- unsigned u; /* Local index variable */
+ hid_t fid = -1; /* File ID */
+ hid_t gcpl = -1; /* Group creation property list ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
+ unsigned nmsgs; /* Number of messages in group's header */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ unsigned u; /* Local index variable */
if(new_format)
TESTING("external link along for the ride (w/new group format)")
@@ -5893,7 +5526,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
/* Create enough objects in the root group to change it into a "dense" group */
for(u = 0; u < (max_compact + 1); u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(gid2) < 0) TEST_ERROR
} /* end for */
@@ -5962,7 +5595,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
/* Remove enough objects in the root group to change it into a "compact" group */
for(u = 0; u < ((max_compact - min_dense) + 3); u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -6014,19 +5647,19 @@ external_link_ride(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Pclose(gcpl);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_ride() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_closing
*
@@ -6035,10 +5668,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Wednesday, August 16, 2006
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6048,11 +5677,11 @@ external_link_closing(hid_t fapl, hbool_t new_format)
hid_t gid=(-1), tid=(-1), tid2=(-1), sid=(-1), did=(-1);
hid_t lcpl_id=(-1);
hsize_t dims[2];
- char filename1[NAME_BUF_SIZE],
+ char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE],
- filename4[NAME_BUF_SIZE], /* Names of files to externally link across */
- buf[NAME_BUF_SIZE]; /* misc. buffer */
+ filename3[NAME_BUF_SIZE],
+ filename4[NAME_BUF_SIZE], /* Names of files to externally link across */
+ buf[NAME_BUF_SIZE]; /* misc. buffer */
H5L_info_t li;
H5O_info_t oi;
hobj_ref_t obj_ref;
@@ -6242,7 +5871,7 @@ external_link_closing(hid_t fapl, hbool_t new_format)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6256,10 +5885,10 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* external_link_closing() */
-
+
/*-------------------------------------------------------------------------
* Function: ext_link_endian
*
@@ -6269,19 +5898,15 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Tuesday, June 6, 2006
- *
*-------------------------------------------------------------------------
*/
static int
external_link_endian(hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- hid_t lapl_id = (-1); /* Prop List ID */
- const char *pathbuf = H5_get_srcdir(); /* Path to the files */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ hid_t lapl_id = -1; /* Prop List ID */
+ const char *pathbuf = H5_get_srcdir(); /* Path to the files */
const char *namebuf;
if(new_format)
@@ -6323,18 +5948,18 @@ external_link_endian(hbool_t new_format)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
}
-
+
/*-------------------------------------------------------------------------
* Function: external_link_strong
*
@@ -6343,10 +5968,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, March 5, 2007
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6356,7 +5977,7 @@ external_link_strong(hid_t fapl, hbool_t new_format)
hid_t fid1 = (-1), fid2 = (-1); /* File ID */
hid_t gid1 = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- char filename1[NAME_BUF_SIZE],
+ char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE];
if(new_format)
@@ -6405,7 +6026,7 @@ external_link_strong(hid_t fapl, hbool_t new_format)
if(H5Pclose(my_fapl) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6416,10 +6037,10 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_strong() */
-
+
/*-------------------------------------------------------------------------
* Function: external_symlink
*
@@ -6428,10 +6049,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Nov. 23, 2009
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6440,17 +6057,17 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
#ifdef H5_HAVE_SYMLINK
hid_t file1 = -1, file2 = -1, file3 = -1, file4 = -1, file5 = -1;
hid_t group2 = -1, group3 = -1, group4 = -1, group5 = -1;
- char filename1[NAME_BUF_SIZE],
- filename2a[NAME_BUF_SIZE],
- filename2b[NAME_BUF_SIZE],
- filename3a[NAME_BUF_SIZE],
- filename3b[NAME_BUF_SIZE],
- filename4a[NAME_BUF_SIZE],
- filename4b[NAME_BUF_SIZE],
- filename5a[NAME_BUF_SIZE],
- filename5b[NAME_BUF_SIZE],
- tmpname[NAME_BUF_SIZE],
- cwdpath[NAME_BUF_SIZE];
+ char filename1[NAME_BUF_SIZE],
+ filename2a[NAME_BUF_SIZE],
+ filename2b[NAME_BUF_SIZE],
+ filename3a[NAME_BUF_SIZE],
+ filename3b[NAME_BUF_SIZE],
+ filename4a[NAME_BUF_SIZE],
+ filename4b[NAME_BUF_SIZE],
+ filename5a[NAME_BUF_SIZE],
+ filename5b[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
hbool_t have_posix_compat_vfd; /* Whether VFD used is compatible w/POSIX I/O calls */
#endif /* H5_HAVE_SYMLINK */
@@ -6470,7 +6087,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* set up name for main file: "extlinks21A" */
h5_fixname(FILENAME[45], fapl, filename1, sizeof(filename1));
- /* create tmp directory and get current working directory path */
+ /* create tmp_links directory and get current working directory path */
if(HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
TEST_ERROR
if(HDmkdir(TMPDIR2, (mode_t)0755) < 0 && errno != EEXIST)
@@ -6480,33 +6097,32 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Set up names for files in the subdirectories */
- /* set up names for file #2 in temporary directory #2: "tmp2/extlinks21B" */
+ /* set up names for file #2 in temporary directory #2: "tmp2_links/extlinks21B" */
h5_fixname(FILENAME[46], fapl, filename2a, sizeof(filename2a));
fix_ext_filename(tmpname, cwdpath, FILENAME[46]);
h5_fixname(tmpname, fapl, filename2b, sizeof(filename2b));
/* Create symbolic link #1 in temporary directory #1 to file #2 in temporary directory #2 */
- /* (i.e. tmp/sym1.h5 -> <full path to>/tmp2/extlinks21B.h5) */
+ /* (i.e. tmp_links/sym1.h5 -> <full path to>/tmp2_links/extlinks21B.h5) */
if(HDsymlink(filename2b, SYMLINK1) < 0 && errno != EEXIST) TEST_ERROR
- /* set up name for file #3 in temporary directory #2: "tmp2/extlinks21C" */
+ /* set up name for file #3 in temporary directory #2: "tmp2_links/extlinks21C" */
h5_fixname(FILENAME[47], fapl, filename3a, sizeof(filename3a));
h5_fixname(FILENAME[48], fapl, filename3b, sizeof(filename3b));
- /* set up name for file #4 in temporary directory #1: "tmp/extlinks21D" */
+ /* set up name for file #4 in temporary directory #1: "tmp_links/extlinks21D" */
h5_fixname(FILENAME[49], fapl, filename4a, sizeof(filename4a));
fix_ext_filename(tmpname, cwdpath, FILENAME[49]);
h5_fixname(tmpname, fapl, filename4b, sizeof(filename4b));
/* Create symbolic link #2 in temporary directory #2 to file #4 in temporary directory #1 */
- /* (i.e. tmp2/sym2.h5 -> <full path to>/tmp/extlinks21D.h5) */
+ /* (i.e. tmp2_links/sym2.h5 -> <full path to>/tmp_links/extlinks21D.h5) */
if(HDsymlink(filename4b, SYMLINK2) < 0 && errno != EEXIST) TEST_ERROR
- /* set up name for file #5 in temporary directory #1: "tmp/extlinks21E" */
+ /* set up name for file #5 in temporary directory #1: "tmp_links/extlinks21E" */
h5_fixname(FILENAME[50], fapl, filename5a, sizeof(filename5a));
h5_fixname(FILENAME[51], fapl, filename5b, sizeof(filename5b));
-
/* Create file #1 in current directory */
if((file1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -6516,12 +6132,11 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Close file #1 */
if(H5Fclose(file1) < 0) TEST_ERROR
-
- /* Create file #2 in tmp directory #2 */
+ /* Create file #2 in tmp_links directory #2 */
if((file2 = H5Fcreate(filename2a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
if(H5Fclose(file2) < 0) TEST_ERROR
- /* Re-open file #2 in tmp directory through symlink */
+ /* Re-open file #2 in tmp_links directory through symlink */
if((file2 = H5Fopen(SYMLINK1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
/* Create group in file #2 in temporary directory */
@@ -6536,7 +6151,6 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Close file #2 */
if(H5Fclose(file2) < 0) TEST_ERROR
-
/* Create file #3 in temp. directory #2 */
if((file3 = H5Fcreate(filename3a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -6552,7 +6166,6 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Close file #3 */
if(H5Fclose(file3) < 0) TEST_ERROR
-
/* Create file #4 in temporary directory #1 */
if((file4 = H5Fcreate(filename4b, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -6568,7 +6181,6 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Close file #4 */
if(H5Fclose(file4) < 0) TEST_ERROR
-
/* Create file #5 in temporary directory #1 */
if((file5 = H5Fcreate(filename5a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -6579,7 +6191,6 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Close file #5 */
if(H5Fclose(file5) < 0) TEST_ERROR
-
/* Actual tests... */
/* Reopen file #1 */
@@ -6604,17 +6215,16 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Close file #1 */
if(H5Fclose(file1) < 0) TEST_ERROR
-
PASSED();
} /* end if */
else {
- SKIPPED();
- HDputs(" Current VFD doesn't support POSIX I/O calls");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support POSIX I/O calls");
} /* end else */
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
H5Gclose(group5);
H5Gclose(group4);
@@ -6626,16 +6236,16 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
H5Fclose(file2);
H5Fclose(file1);
} H5E_END_TRY;
- return -1;
+ return FAIL;
#else /* H5_HAVE_SYMLINK */
SKIPPED();
HDputs(" Current file system or operating system doesn't support symbolic links");
- return 0;
+ return SUCCEED;
#endif /* H5_HAVE_SYMLINK */
} /* end external_symlink() */
-
+
/*-------------------------------------------------------------------------
* Function: external_copy_invalid_object
*
@@ -6646,18 +6256,14 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Wednesday, March 3, 2010
- *
*-------------------------------------------------------------------------
*/
static int
external_copy_invalid_object(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group ID */
- hid_t ocpyplid = (-1); /* Object copy plist ID */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t ocpyplid = -1; /* Object copy plist ID */
char filename[NAME_BUF_SIZE];
if(new_format)
@@ -6696,7 +6302,7 @@ external_copy_invalid_object(hid_t fapl, hbool_t new_format)
if(H5Pclose(ocpyplid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6705,10 +6311,10 @@ error:
H5Pclose(ocpyplid);
} H5E_END_TRY
- return -1;
+ return FAIL;
} /* end external_copy_invalid_object */
-
+
/*-------------------------------------------------------------------------
* Function: external_dont_fail_to_source
*
@@ -6718,18 +6324,14 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Wednesday, March 3, 2010
- *
*-------------------------------------------------------------------------
*/
static int
external_dont_fail_to_source(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group ID */
- hid_t oid = (-1); /* Object ID */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t oid = -1; /* Object ID */
char filename[NAME_BUF_SIZE];
if(new_format)
@@ -6760,7 +6362,7 @@ external_dont_fail_to_source(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6769,10 +6371,10 @@ error:
H5Fclose(fid);
} H5E_END_TRY
- return -1;
+ return FAIL;
} /* end external_dont_fail_to_source */
-
+
/*-------------------------------------------------------------------------
* Function: external_file_cache
*
@@ -6782,21 +6384,17 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Thursday, January 13, 2011
- *
*-------------------------------------------------------------------------
*/
static int
external_file_cache(hid_t fapl, hbool_t new_format)
{
- hid_t my_fapl = (-1); /* Temporary FAPL */
- hid_t fid1 = (-1); /* File ID */
- hid_t fid2 = (-1); /* File ID */
- hid_t fid3 = (-1); /* File ID */
- hid_t fid4 = (-1); /* File ID */
- hid_t oid = (-1); /* Object ID */
+ hid_t my_fapl = -1; /* Temporary FAPL */
+ hid_t fid1 = -1; /* File ID */
+ hid_t fid2 = -1; /* File ID */
+ hid_t fid3 = -1; /* File ID */
+ hid_t fid4 = -1; /* File ID */
+ hid_t oid = -1; /* Object ID */
unsigned efc_size;
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
@@ -6815,333 +6413,229 @@ external_file_cache(hid_t fapl, hbool_t new_format)
h5_fixname(FILENAME[3], fapl, filename4, sizeof filename4);
/* Verify that the default EFC size is 0 */
- if(H5Pget_elink_file_cache_size(fapl, &efc_size) < 0)
- TEST_ERROR
+ if(H5Pget_elink_file_cache_size(fapl, &efc_size) < 0) TEST_ERROR
if(efc_size != 0)
FAIL_PUTS_ERROR("default external file cache size is not 0")
/* Copy FAPL and enable external file caching */
- if((my_fapl = H5Pcopy(fapl)) < 0)
- TEST_ERROR
- if(H5Pset_elink_file_cache_size(my_fapl, 8) < 0)
- TEST_ERROR
+ if((my_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR
+ if(H5Pset_elink_file_cache_size(my_fapl, 8) < 0) TEST_ERROR
/* Verify that the external file cache size has been set */
- if(H5Pget_elink_file_cache_size(my_fapl, &efc_size) < 0)
- TEST_ERROR
+ if(H5Pget_elink_file_cache_size(my_fapl, &efc_size) < 0) TEST_ERROR
if(efc_size != 8)
FAIL_PUTS_ERROR("external file cache size different from expected")
-
- /*
- * Test 1: One file caches another
- */
+ /* Test 1: One file caches another */
/* Create files */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
+ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
/* Create link */
- if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close file 2 */
- if(H5Fclose(fid2) < 0)
- TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
/* Verify that only 1 file is open */
H5F_sfile_assert_num(1);
/* Open and close the target of the external link */
- if((oid = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if(H5Oclose(oid) < 0)
- TEST_ERROR
+ if((oid = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Oclose(oid) < 0) TEST_ERROR
/* Verify that both files are now open */
H5F_sfile_assert_num(2);
/* Close file 1 */
- if(H5Fclose(fid1) < 0)
- TEST_ERROR
+ if(H5Fclose(fid1) < 0) TEST_ERROR
/* Verify that both files are now closed */
H5F_sfile_assert_num(0);
-
- /*
- * Test 2: One file caches another, release parent's EFC
- */
+ /* Test 2: One file caches another, release parent's EFC */
/* Create files */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
+ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
/* Create link */
- if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close file 2 */
- if(H5Fclose(fid2) < 0)
- TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
/* Verify that only 1 file is open */
H5F_sfile_assert_num(1);
/* Open and close the target of the external link */
- if((oid = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if(H5Oclose(oid) < 0)
- TEST_ERROR
+ if((oid = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Oclose(oid) < 0) TEST_ERROR
/* Verify that both files are now open */
H5F_sfile_assert_num(2);
/* Release file 1's EFC */
- if(H5Fclear_elink_file_cache(fid1) < 0)
- TEST_ERROR
+ if(H5Fclear_elink_file_cache(fid1) < 0) TEST_ERROR
/* Verify that only the parent file is now open */
H5F_sfile_assert_num(1);
/* Close file 1 */
- if(H5Fclose(fid1) < 0)
- TEST_ERROR
+ if(H5Fclose(fid1) < 0) TEST_ERROR
/* Verify that both files are now closed */
H5F_sfile_assert_num(0);
-
- /*
- * Test 3: "Y" shaped tree
- */
+ /* Test 3: "Y" shaped tree */
/* Create files */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
- if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
- if((fid4 = H5Fcreate(filename4, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
+ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if((fid4 = H5Fcreate(filename4, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
/* Create links */
- if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_external(filename4, "/", fid2, "link_to_4", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external(filename4, "/", fid2, "link_to_4", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close files 2-4 */
- if(H5Fclose(fid2) < 0)
- TEST_ERROR
- if(H5Fclose(fid3) < 0)
- TEST_ERROR
- if(H5Fclose(fid4) < 0)
- TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
+ if(H5Fclose(fid3) < 0) TEST_ERROR
+ if(H5Fclose(fid4) < 0) TEST_ERROR
/* Verify that only 1 file is open */
H5F_sfile_assert_num(1);
/* Open and close one branch of the tree */
- if((oid = H5Oopen(fid1, "link_to_2/link_to_3", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if(H5Oclose(oid) < 0)
- TEST_ERROR
+ if((oid = H5Oopen(fid1, "link_to_2/link_to_3", H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Oclose(oid) < 0) TEST_ERROR
/* Verify that files 2 and 3 are now open */
H5F_sfile_assert_num(3);
/* Open and close the other branch of the tree */
- if((oid = H5Oopen(fid1, "link_to_2/link_to_4", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if(H5Oclose(oid) < 0)
- TEST_ERROR
+ if((oid = H5Oopen(fid1, "link_to_2/link_to_4", H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Oclose(oid) < 0) TEST_ERROR
/* Verify that all files are now open */
H5F_sfile_assert_num(4);
/* Close file 1 */
- if(H5Fclose(fid1) < 0)
- TEST_ERROR
+ if(H5Fclose(fid1) < 0) TEST_ERROR
/* Verify that all files are now closed */
H5F_sfile_assert_num(0);
-
- /*
- * Test 4: "Y" shaped tree, release parent's EFC
- */
+ /* Test 4: "Y" shaped tree, release parent's EFC */
/* Create files */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
- if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
- if((fid4 = H5Fcreate(filename4, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
+ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if((fid4 = H5Fcreate(filename4, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
/* Create links */
- if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_external(filename4, "/", fid2, "link_to_4", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external(filename4, "/", fid2, "link_to_4", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close files 2-4 */
- if(H5Fclose(fid2) < 0)
- TEST_ERROR
- if(H5Fclose(fid3) < 0)
- TEST_ERROR
- if(H5Fclose(fid4) < 0)
- TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
+ if(H5Fclose(fid3) < 0) TEST_ERROR
+ if(H5Fclose(fid4) < 0) TEST_ERROR
/* Verify that only 1 file is open */
H5F_sfile_assert_num(1);
/* Open and close one branch of the tree */
- if((oid = H5Oopen(fid1, "link_to_2/link_to_3", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if(H5Oclose(oid) < 0)
- TEST_ERROR
+ if((oid = H5Oopen(fid1, "link_to_2/link_to_3", H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Oclose(oid) < 0) TEST_ERROR
/* Verify that files 2 and 3 are now open */
H5F_sfile_assert_num(3);
/* Open and close the other branch of the tree */
- if((oid = H5Oopen(fid1, "link_to_2/link_to_4", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if(H5Oclose(oid) < 0)
- TEST_ERROR
+ if((oid = H5Oopen(fid1, "link_to_2/link_to_4", H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Oclose(oid) < 0) TEST_ERROR
/* Verify that all files are now open */
H5F_sfile_assert_num(4);
/* Release file 1's EFC */
- if(H5Fclear_elink_file_cache(fid1) < 0)
- TEST_ERROR
+ if(H5Fclear_elink_file_cache(fid1) < 0) TEST_ERROR
/* Verify that only file 1 is now open */
H5F_sfile_assert_num(1);
/* Close file 1 */
- if(H5Fclose(fid1) < 0)
- TEST_ERROR
+ if(H5Fclose(fid1) < 0) TEST_ERROR
/* Verify that all files are now closed */
H5F_sfile_assert_num(0);
- /*
- * Test 5: 3 file cycle
- */
+ /* Test 5: 3 file cycle */
/* Create files */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
- if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
+ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
/* Create links */
- if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_external(filename1, "/", fid3, "link_to_1", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external(filename1, "/", fid3, "link_to_1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close files 2-3 */
- if(H5Fclose(fid2) < 0)
- TEST_ERROR
- if(H5Fclose(fid3) < 0)
- TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
+ if(H5Fclose(fid3) < 0) TEST_ERROR
/* Verify that only 1 file is open */
H5F_sfile_assert_num(1);
/* Open and close one complete cycle */
- if((oid = H5Oopen(fid1, "link_to_2/link_to_3/link_to_1", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if(H5Oclose(oid) < 0)
- TEST_ERROR
+ if((oid = H5Oopen(fid1, "link_to_2/link_to_3/link_to_1", H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Oclose(oid) < 0) TEST_ERROR
/* Verify that all files are now open */
H5F_sfile_assert_num(3);
/* Close file 1 */
- if(H5Fclose(fid1) < 0)
- TEST_ERROR
+ if(H5Fclose(fid1) < 0) TEST_ERROR
/* Verify that all files are now closed */
H5F_sfile_assert_num(0);
-
- /*
- * Test 6: 3 file cycle, release parent's EFC
- */
+ /* Test 6: 3 file cycle, release parent's EFC */
/* Create files */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
- if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
+ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
/* Create links */
- if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_external(filename1, "/", fid3, "link_to_1", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external(filename3, "/", fid2, "link_to_3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external(filename1, "/", fid3, "link_to_1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close files 2-3 */
- if(H5Fclose(fid2) < 0)
- TEST_ERROR
- if(H5Fclose(fid3) < 0)
- TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
+ if(H5Fclose(fid3) < 0) TEST_ERROR
/* Verify that only 1 file is open */
H5F_sfile_assert_num(1);
/* Open and close one complete cycle */
- if((oid = H5Oopen(fid1, "link_to_2/link_to_3/link_to_1", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if(H5Oclose(oid) < 0)
- TEST_ERROR
+ if((oid = H5Oopen(fid1, "link_to_2/link_to_3/link_to_1", H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Oclose(oid) < 0) TEST_ERROR
/* Verify that all files are now open */
H5F_sfile_assert_num(3);
/* Release file 1's EFC */
- if(H5Fclear_elink_file_cache(fid1) < 0)
- TEST_ERROR
+ if(H5Fclear_elink_file_cache(fid1) < 0) TEST_ERROR
/* Verify that only file 1 is now open */
H5F_sfile_assert_num(1);
/* Close file 1 */
- if(H5Fclose(fid1) < 0)
- TEST_ERROR
+ if(H5Fclose(fid1) < 0) TEST_ERROR
/* Verify that all files are now closed */
H5F_sfile_assert_num(0);
@@ -7150,7 +6644,7 @@ external_file_cache(hid_t fapl, hbool_t new_format)
H5Pclose(my_fapl);
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -7162,10 +6656,10 @@ error:
H5Pclose(my_fapl);
} H5E_END_TRY
- return -1;
+ return FAIL;
} /* end external_file_cache */
-
+
/*-------------------------------------------------------------------------
* Function: external_open_twice
*
@@ -7174,21 +6668,17 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Saturday, April 30, 2011
- *
*-------------------------------------------------------------------------
*/
static int
external_open_twice(hid_t fapl, hbool_t new_format)
{
- hid_t fid1 = (-1); /* File ID */
- hid_t fid2 = (-1); /* File ID */
- hid_t oid1 = (-1); /* Object ID */
- hid_t oid2 = (-1); /* Object ID */
- hid_t type = (-1); /* Datatype ID */
- hid_t space = (-1); /* Dataspace ID */
+ hid_t fid1 = -1; /* File ID */
+ hid_t fid2 = -1; /* File ID */
+ hid_t oid1 = -1; /* Object ID */
+ hid_t oid2 = -1; /* Object ID */
+ hid_t type = -1; /* Datatype ID */
+ hid_t space = -1; /* Dataspace ID */
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
@@ -7201,192 +6691,123 @@ external_open_twice(hid_t fapl, hbool_t new_format)
h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1);
h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2);
-
- /*
- * Test 1: Open root group twice
- */
+ /* Test 1: Open root group twice */
/* Create files */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create link */
- if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2, "/", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close file 2 */
- if(H5Fclose(fid2) < 0)
- TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
/* Open the target of the external link twice */
- if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0)
- TEST_ERROR
+ if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR
+ if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR
- /* Close both objects, in the reverse opening order (necessary to duplicate
- * bug */
- if(H5Oclose(oid2) < 0)
- TEST_ERROR
- if(H5Oclose(oid1) < 0)
- TEST_ERROR
+ /* Close both objects, in the reverse opening order (necessary to duplicate bug */
+ if(H5Oclose(oid2) < 0) TEST_ERROR
+ if(H5Oclose(oid1) < 0) TEST_ERROR
/* Close file 1 */
- if(H5Fclose(fid1) < 0)
- TEST_ERROR
+ if(H5Fclose(fid1) < 0) TEST_ERROR
/* Verify that both files are now closed */
H5F_sfile_assert_num(0);
-
- /*
- * Test 2: Open group twice
- */
+ /* Test 2: Open group twice */
/* Create files */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create target group */
- if((oid1 = H5Gcreate2(fid2, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))
- < 0)
- TEST_ERROR
- if(H5Gclose(oid1) < 0)
- TEST_ERROR
+ if((oid1 = H5Gcreate2(fid2, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(oid1) < 0) TEST_ERROR
/* Create link */
- if(H5Lcreate_external(filename2, "/group", fid1, "link_to_2", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2, "/group", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close file 2 */
- if(H5Fclose(fid2) < 0)
- TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
/* Open the target of the external link twice */
- if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0)
- TEST_ERROR
+ if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR
+ if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR
- /* Close both objects, in the reverse opening order (necessary to duplicate
- * bug */
- if(H5Oclose(oid2) < 0)
- TEST_ERROR
- if(H5Oclose(oid1) < 0)
- TEST_ERROR
+ /* Close both objects, in the reverse opening order (necessary to duplicate bug */
+ if(H5Oclose(oid2) < 0) TEST_ERROR
+ if(H5Oclose(oid1) < 0) TEST_ERROR
/* Close file 1 */
- if(H5Fclose(fid1) < 0)
- TEST_ERROR
+ if(H5Fclose(fid1) < 0) TEST_ERROR
/* Verify that both files are now closed */
H5F_sfile_assert_num(0);
-
- /*
- * Test 3: Open dataset twice
- */
+ /* Test 3: Open dataset twice */
/* Create files */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create target dataset */
- if((space = H5Screate(H5S_SCALAR)) < 0)
- TEST_ERROR
- if((oid1 = H5Dcreate2(fid2, "dset", H5T_NATIVE_INT, space, H5P_DEFAULT,
- dcpl_g, H5P_DEFAULT)) < 0)
- TEST_ERROR
- if(H5Dclose(oid1) < 0)
- TEST_ERROR
- if(H5Sclose(space) < 0)
- TEST_ERROR
+ if((space = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR
+ if((oid1 = H5Dcreate2(fid2, "dset", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dclose(oid1) < 0) TEST_ERROR
+ if(H5Sclose(space) < 0) TEST_ERROR
/* Create link */
- if(H5Lcreate_external(filename2, "/dset", fid1, "link_to_2", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2, "/dset", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close file 2 */
- if(H5Fclose(fid2) < 0)
- TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
/* Open the target of the external link twice */
- if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0)
- TEST_ERROR
+ if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR
+ if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR
- /* Close both objects, in the reverse opening order (necessary to duplicate
- * bug */
- if(H5Oclose(oid2) < 0)
- TEST_ERROR
- if(H5Oclose(oid1) < 0)
- TEST_ERROR
+ /* Close both objects, in the reverse opening order (necessary to duplicate bug */
+ if(H5Oclose(oid2) < 0) TEST_ERROR
+ if(H5Oclose(oid1) < 0) TEST_ERROR
/* Close file 1 */
- if(H5Fclose(fid1) < 0)
- TEST_ERROR
+ if(H5Fclose(fid1) < 0) TEST_ERROR
/* Verify that both files are now closed */
H5F_sfile_assert_num(0);
-
- /*
- * Test 4: Open datatype twice
- */
+ /* Test 4: Open datatype twice */
/* Create files */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create target datatype */
- if((type = H5Tcopy(H5T_NATIVE_INT)) < 0)
- TEST_ERROR
- if(H5Tcommit2(fid2, "dtype", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)
- < 0)
- TEST_ERROR
- if(H5Tclose(type) < 0)
- TEST_ERROR
+ if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
+ if(H5Tcommit2(fid2, "dtype", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Tclose(type) < 0) TEST_ERROR
/* Create link */
- if(H5Lcreate_external(filename2, "/dtype", fid1, "link_to_2", H5P_DEFAULT,
- H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_external(filename2, "/dtype", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close file 2 */
- if(H5Fclose(fid2) < 0)
- TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
/* Open the target of the external link twice */
- if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0)
- TEST_ERROR
- if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0)
- TEST_ERROR
+ if((oid1 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR
+ if((oid2 = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) TEST_ERROR
- /* Close both objects, in the reverse opening order (necessary to duplicate
- * bug */
- if(H5Oclose(oid2) < 0)
- TEST_ERROR
- if(H5Oclose(oid1) < 0)
- TEST_ERROR
+ /* Close both objects, in the reverse opening order (necessary to duplicate bug */
+ if(H5Oclose(oid2) < 0) TEST_ERROR
+ if(H5Oclose(oid1) < 0) TEST_ERROR
/* Close file 1 */
- if(H5Fclose(fid1) < 0)
- TEST_ERROR
+ if(H5Fclose(fid1) < 0) TEST_ERROR
/* Verify that both files are now closed */
H5F_sfile_assert_num(0);
-
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -7398,10 +6819,10 @@ error:
H5Sclose(space);
} H5E_END_TRY
- return -1;
+ return FAIL;
} /* end external_open_twice() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_with_committed_datatype
*
@@ -7424,24 +6845,24 @@ error:
static int
external_link_with_committed_datatype(hid_t fapl, hbool_t new_format)
{
- hid_t fid1 = -1, fid2 = -1; /* File IDs */
- hid_t gid1 = -1, gid2 = -1; /* Group IDs */
- hid_t tid = -1; /* Datatype ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t sid2 = -1; /* Dataspace ID */
- hid_t aid = -1; /* Attribute ID */
- hid_t atid = -1; /* Attribute's datatype ID */
- hid_t did = -1; /* Dataset ID */
- hid_t dtid = -1; /* Dataset's datatype ID */
- hid_t dcpl = -1; /* Dataset creation property list */
- int wdata = 99; /* Attribute data written */
- int wbuf[60]; /* Data buffer for writing */
- int rbuf[60]; /* Data buffer for reading */
- int i; /* Local index variable */
- char filename1[NAME_BUF_SIZE]; /* File name for main file */
- char filename2[NAME_BUF_SIZE]; /* File name for target file */
- hsize_t dims[2] = {5, 12}; /* Dimension sizes */
- hsize_t chunks[2] = {3, 7}; /* Chunk sizes */
+ hid_t fid1 = -1, fid2 = -1; /* File IDs */
+ hid_t gid1 = -1, gid2 = -1; /* Group IDs */
+ hid_t tid = -1; /* Datatype ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t sid2 = -1; /* Dataspace ID */
+ hid_t aid = -1; /* Attribute ID */
+ hid_t atid = -1; /* Attribute's datatype ID */
+ hid_t did = -1; /* Dataset ID */
+ hid_t dtid = -1; /* Dataset's datatype ID */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ int wdata = 99; /* Attribute data written */
+ int wbuf[60]; /* Data buffer for writing */
+ int rbuf[60]; /* Data buffer for reading */
+ int i; /* Local index variable */
+ char filename1[NAME_BUF_SIZE]; /* File name for main file */
+ char filename2[NAME_BUF_SIZE]; /* File name for target file */
+ hsize_t dims[2] = {5, 12}; /* Dimension sizes */
+ hsize_t chunks[2] = {3, 7}; /* Chunk sizes */
if(new_format)
TESTING("attach committed datatype to external group's attribute/dataset(w/new group format)")
@@ -7452,206 +6873,157 @@ external_link_with_committed_datatype(hid_t fapl, hbool_t new_format)
h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1);
h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2);
-
/* Main file */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- FAIL_STACK_ERROR
+ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Create external link from main file to target file */
- if(H5Lcreate_external(filename2, "target_group", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0)
- FAIL_STACK_ERROR
-
+ if(H5Lcreate_external(filename2, "target_group", fid1, "link_to_2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Create target file */
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- FAIL_STACK_ERROR
+ if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Create group in target file */
- if((gid2 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ if((gid2 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Close the group */
- if(H5Gclose(gid2) < 0)
- FAIL_STACK_ERROR
+ if(H5Gclose(gid2) < 0) FAIL_STACK_ERROR
/* Close the file */
- if(H5Fclose(fid2) < 0)
- FAIL_STACK_ERROR
+ if(H5Fclose(fid2) < 0) FAIL_STACK_ERROR
/* Open the group which is externally linked to target file */
- if((gid1 = H5Gopen2(fid1, "link_to_2", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ if((gid1 = H5Gopen2(fid1, "link_to_2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Create a copy of integer datatype */
- if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)
- FAIL_STACK_ERROR
+ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR
/* Commit the datatype to the main file root group */
- if(H5Tcommit2(fid1, "myDatatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
- FAIL_STACK_ERROR
+ if(H5Tcommit2(fid1, "myDatatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Create dataspace */
- if((sid = H5Screate(H5S_SCALAR)) < 0)
- FAIL_STACK_ERROR
+ if((sid = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR
/* Attach an attribute with the committed datatype to the group */
- if((aid = H5Acreate2(gid1, "myAttribute", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ if((aid = H5Acreate2(gid1, "myAttribute", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Write data to the attribute */
- if(H5Awrite(aid, tid, &wdata) < 0)
- FAIL_STACK_ERROR
+ if(H5Awrite(aid, tid, &wdata) < 0) FAIL_STACK_ERROR
/* Get the attribute's datatype */
- if((atid = H5Aget_type(aid)) < 0)
- FAIL_STACK_ERROR
+ if((atid = H5Aget_type(aid)) < 0) FAIL_STACK_ERROR
/* Verify the datatype is not committed */
- if(H5Tcommitted(atid) == TRUE)
- FAIL_STACK_ERROR
+ if(H5Tcommitted(atid) == TRUE) FAIL_STACK_ERROR
/* Close the attribute */
- if(H5Aclose(aid) < 0)
- FAIL_STACK_ERROR
+ if(H5Aclose(aid) < 0) FAIL_STACK_ERROR
/* Create a chunked dataset */
- if((sid2 = H5Screate_simple(2, dims, NULL)) < 0)
- FAIL_STACK_ERROR
+ if((sid2 = H5Screate_simple(2, dims, NULL)) < 0) FAIL_STACK_ERROR
- if((dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g)) < 0)
- FAIL_STACK_ERROR
- if(H5Pset_chunk(dcpl, 2, chunks) < 0)
- FAIL_STACK_ERROR
+ if (dcpl_g == H5P_DEFAULT)
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ else
+ dcpl = H5Pcopy(dcpl_g);
+ if (0 > dcpl) FAIL_STACK_ERROR
+ if(H5Pset_chunk(dcpl, 2, chunks) < 0) FAIL_STACK_ERROR
/* Initialize data buffers */
for(i = 0; i < 60; i++) {
- wbuf[i] = i;
- rbuf[i] = 0;
+ wbuf[i] = i;
+ rbuf[i] = 0;
}
/* Create a dataset with the committed datatype in the group */
- if((did = H5Dcreate2(gid1, "myDataset", tid, sid2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ if((did = H5Dcreate2(gid1, "myDataset", tid, sid2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Write to the dataset */
- if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
- FAIL_STACK_ERROR
+ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) FAIL_STACK_ERROR
/* Get the dataset's datatype */
- if((dtid = H5Dget_type(did)) < 0)
- FAIL_STACK_ERROR
+ if((dtid = H5Dget_type(did)) < 0) FAIL_STACK_ERROR
/* Verify the datatype is not committed */
- if(H5Tcommitted(dtid) == TRUE)
- FAIL_STACK_ERROR
+ if(H5Tcommitted(dtid) == TRUE) FAIL_STACK_ERROR
/* Close the dataset */
- if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ if(H5Dclose(did) < 0) FAIL_STACK_ERROR
/* Close the dataset creation property list */
- if(H5Pclose(dcpl) < 0)
- FAIL_STACK_ERROR
+ if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
/* Close the dataspaces */
- if(H5Sclose(sid) < 0)
- FAIL_STACK_ERROR
- if(H5Sclose(sid2) < 0)
- FAIL_STACK_ERROR
+ if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(sid2) < 0) FAIL_STACK_ERROR
/* Close the datatypes */
- if(H5Tclose(tid) < 0)
- FAIL_STACK_ERROR
- if(H5Tclose(atid) < 0)
- FAIL_STACK_ERROR
- if(H5Tclose(dtid) < 0)
- FAIL_STACK_ERROR
+ if(H5Tclose(tid) < 0) FAIL_STACK_ERROR
+ if(H5Tclose(atid) < 0) FAIL_STACK_ERROR
+ if(H5Tclose(dtid) < 0) FAIL_STACK_ERROR
/* Close the group */
- if(H5Gclose(gid1) < 0)
- FAIL_STACK_ERROR
+ if(H5Gclose(gid1) < 0) FAIL_STACK_ERROR
/* Close the file */
- if(H5Fclose(fid1) < 0)
- FAIL_STACK_ERROR
-
+ if(H5Fclose(fid1) < 0) FAIL_STACK_ERROR
/* Open the mainfile */
- if((fid1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0)
- FAIL_STACK_ERROR
+ if((fid1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
/* Open the committed datatype in the mainfile */
- if((tid = H5Topen2(fid1, "myDatatype", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ if((tid = H5Topen2(fid1, "myDatatype", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Verify the datatype is committed */
- if(H5Tcommitted(tid) == FALSE)
- FAIL_STACK_ERROR
+ if(H5Tcommitted(tid) == FALSE) FAIL_STACK_ERROR
/* Open the group which is externally linked to target file */
- if((gid1 = H5Gopen2(fid1, "link_to_2", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ if((gid1 = H5Gopen2(fid1, "link_to_2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Open the attribute attached to the group */
- if((aid = H5Aopen(gid1, "myAttribute", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ if((aid = H5Aopen(gid1, "myAttribute", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Get the attribute's datatype */
- if((atid = H5Aget_type(aid)) < 0)
- FAIL_STACK_ERROR
+ if((atid = H5Aget_type(aid)) < 0) FAIL_STACK_ERROR
/* Verify the attribute's datatype is not committed */
- if(H5Tcommitted(atid) == TRUE)
- FAIL_STACK_ERROR
+ if(H5Tcommitted(atid) == TRUE) FAIL_STACK_ERROR
/* Close the attribute */
- if(H5Aclose(aid) < 0)
- FAIL_STACK_ERROR
+ if(H5Aclose(aid) < 0) FAIL_STACK_ERROR
/* Delete the attribute */
- if(H5Adelete(gid1, "myAttribute") < 0)
- FAIL_STACK_ERROR
+ if(H5Adelete(gid1, "myAttribute") < 0) FAIL_STACK_ERROR
/* Open the dataset in the group */
- if((did = H5Dopen2(gid1, "myDataset", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ if((did = H5Dopen2(gid1, "myDataset", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Get the dataset's datatype */
- if((dtid = H5Dget_type(did)) < 0)
- FAIL_STACK_ERROR
+ if((dtid = H5Dget_type(did)) < 0) FAIL_STACK_ERROR
/* Verify the dataset's datatype is not committed */
- if(H5Tcommitted(dtid) == TRUE)
- FAIL_STACK_ERROR
+ if(H5Tcommitted(dtid) == TRUE) FAIL_STACK_ERROR
/* Read the dataset */
- if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- FAIL_STACK_ERROR
+ if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) FAIL_STACK_ERROR
/* Compare the data read should be the same as wbuf */
- if(HDmemcmp(wbuf, rbuf, sizeof(wbuf)) != 0)
- FAIL_STACK_ERROR
+ if(HDmemcmp(wbuf, rbuf, sizeof(wbuf)) != 0) FAIL_STACK_ERROR
/* Close the dataset */
- if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ if(H5Dclose(did) < 0) FAIL_STACK_ERROR
/* Close the group */
- if(H5Gclose(gid1) < 0)
- FAIL_STACK_ERROR
+ if(H5Gclose(gid1) < 0) FAIL_STACK_ERROR
/* Close the datatypes */
- if(H5Tclose(tid) < 0)
- FAIL_STACK_ERROR
- if(H5Tclose(atid) < 0)
- FAIL_STACK_ERROR
- if(H5Tclose(dtid) < 0)
- FAIL_STACK_ERROR
+ if(H5Tclose(tid) < 0) FAIL_STACK_ERROR
+ if(H5Tclose(atid) < 0) FAIL_STACK_ERROR
+ if(H5Tclose(dtid) < 0) FAIL_STACK_ERROR
/* Close the file */
if(H5Fclose(fid1) < 0)
FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -7670,13 +7042,13 @@ error:
H5Aclose(atid);
H5Aclose(dtid);
- H5Pclose(dcpl);
+ H5Pclose(dcpl);
} H5E_END_TRY
- return -1;
+ return FAIL;
} /* end external_link_with_committed_datatype() */
-
+
/*-------------------------------------------------------------------------
* Function: ud_hard_links
*
@@ -7685,10 +7057,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Tuesday, June 6, 2006
- *
*-------------------------------------------------------------------------
*/
/* Callback functions for UD hard links. */
@@ -7754,7 +7122,7 @@ done:
case H5I_ERROR_STACK:
case H5I_NTYPES:
default:
- return -1;
+ return FAIL;
} /* end switch */
} /* end if */
@@ -7771,7 +7139,7 @@ UD_hard_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group,
hid_t ret_value = -1;
if(udata_size != sizeof(haddr_t))
- return -1;
+ return FAIL;
addr = *((const haddr_t *) udata);
@@ -7842,7 +7210,7 @@ done:
case H5I_ERROR_STACK:
case H5I_NTYPES:
default:
- return -1;
+ return FAIL;
} /* end switch */
} /* end if */
@@ -7864,12 +7232,12 @@ const H5L_class_t UD_hard_class[1] = {{
static int
ud_hard_links(hid_t fapl)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- H5L_info_t li; /* Link information */
- char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ H5L_info_t li; /* Link information */
+ char objname[NAME_BUF_SIZE]; /* Object name */
h5_stat_size_t empty_size; /* Size of an empty file */
- char filename[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
TESTING("user-defined hard link (w/new group format)")
@@ -7903,7 +7271,6 @@ ud_hard_links(hid_t fapl)
if(H5Gclose(gid) < 0) TEST_ERROR
-
/* Create a user-defined "hard link" to the group using the address we got
* from H5Lget_info */
if(H5Lcreate_ud(fid, "ud_link", (H5L_type_t)UD_HARD_TYPE, &(li.u.address), (size_t)sizeof(haddr_t), H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -7941,9 +7308,9 @@ ud_hard_links(hid_t fapl)
/* UD hard links have no query function, thus return a "link length" of 0 */
if(li.u.val_size != 0) TEST_ERROR
if(UD_HARD_TYPE != li.type) {
- H5_FAILED();
- HDputs(" Unexpected link class - should have been a UD hard link");
- goto error;
+ H5_FAILED();
+ HDputs(" Unexpected link class - should have been a UD hard link");
+ goto error;
} /* end if */
/* Unlink the group pointed to by the UD link. It shouldn't be
@@ -7970,18 +7337,18 @@ ud_hard_links(hid_t fapl)
if(H5Lunregister((H5L_type_t)UD_HARD_TYPE) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end ud_hard_links() */
-
+
/*-------------------------------------------------------------------------
* Function: UD_rereg_traverse
*
@@ -7990,10 +7357,6 @@ ud_hard_links(hid_t fapl)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Tuesday, June 6, 2006
- *
*-------------------------------------------------------------------------
*/
/* A traversal function that ignores any udata and simply opens an object
@@ -8011,7 +7374,7 @@ UD_rereg_traverse(const char H5_ATTR_UNUSED * link_name, hid_t cur_group,
return ret_value;
error:
- return -1;
+ return FAIL;
} /* end UD_rereg_traverse() */
/* This link class has the same ID number as the UD hard links but
@@ -8031,23 +7394,23 @@ const H5L_class_t UD_rereg_class[1] = {{
static int
ud_link_reregister(hid_t fapl)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- H5L_info_t li; /* Link information */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE];
- h5_stat_size_t empty_size; /* Size of an empty file */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ H5L_info_t li; /* Link information */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE];
+ h5_stat_size_t empty_size; /* Size of an empty file */
TESTING("registering a new class for existing UD links (w/new group format)")
/* Set up filename and create file*/
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Get the size of the empty file for reference */
if(H5Fclose(fid) < 0) TEST_ERROR
- if((empty_size=h5_get_file_size(filename, fapl))<0) TEST_ERROR
+ if((empty_size = h5_get_file_size(filename, fapl))<0) TEST_ERROR
if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -8086,9 +7449,9 @@ ud_link_reregister(hid_t fapl)
/* Verify that we can't create any new links of this type */
H5E_BEGIN_TRY {
- if(H5Lcreate_ud(fid, "ud_link2", (H5L_type_t)UD_HARD_TYPE, &(li.u.address),
+ if(H5Lcreate_ud(fid, "ud_link2", (H5L_type_t)UD_HARD_TYPE, &(li.u.address),
sizeof(li.u.address), H5P_DEFAULT, H5P_DEFAULT) >= 0)
- TEST_ERROR
+ TEST_ERROR
} H5E_END_TRY
/* Register a new kind of link with the same ID number */
@@ -8156,18 +7519,18 @@ ud_link_reregister(hid_t fapl)
if(H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end ud_link_reregister() */
-
+
/*-------------------------------------------------------------------------
* Function: ud_callbacks
*
@@ -8176,10 +7539,6 @@ ud_link_reregister(hid_t fapl)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Tuesday, June 6, 2006
- *
*-------------------------------------------------------------------------
*/
/* Callback functions for UD "callback" links. */
@@ -8197,10 +7556,10 @@ UD_cb_create(const char * link_name, hid_t loc_group, const void *udata,
if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR
if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end UD_cb_create() */
static hid_t
@@ -8224,7 +7583,7 @@ UD_cb_traverse(const char * link_name, hid_t cur_group, const void *udata,
return ret_value;
error:
- return -1;
+ return FAIL;
} /* end UD_cb_traverse() */
/* Callback for when the link is moved or renamed */
@@ -8240,10 +7599,10 @@ UD_cb_move(const char *new_name, hid_t new_loc, const void *udata,
if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR
if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end UD_cb_move() */
/* Callback for when the link is deleted. Also called during move */
@@ -8259,10 +7618,10 @@ UD_cb_delete(const char *link_name, hid_t file, const void *udata,
if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR
if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end UD_cb_delete() */
/* Callback for when the link is queried */
@@ -8286,7 +7645,7 @@ UD_cb_query(const char * link_name, const void *udata, size_t udata_size,
return 16;
error:
- return -1;
+ return FAIL;
} /* end UD_cb_query() */
const H5L_class_t UD_cb_class[1] = {{
@@ -8304,12 +7663,12 @@ const H5L_class_t UD_cb_class[1] = {{
static int
ud_callbacks(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group ID */
- hid_t lcpl = (-1); /* Link Creation PL */
- H5L_info_t li; /* Link information */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t lcpl = -1; /* Link Creation PL */
+ H5L_info_t li; /* Link information */
char ud_target_name[] = UD_CB_TARGET; /* Link target name */
- char filename[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
char query_buf[NAME_BUF_SIZE];
if(new_format)
@@ -8332,8 +7691,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
* no problems. */
if(H5Lregister(UD_hard_class) < 0) TEST_ERROR
- /* Register user-defined link class. This is the one we'll actually
- * be using. */
+ /* Register user-defined link class. This is the one we'll actually be using. */
if(H5Lregister(UD_cb_class) < 0) TEST_ERROR
/* Check that registered link classes are, and unregistered ones aren't */
@@ -8356,9 +7714,9 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
if (H5Lget_info(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) TEST_ERROR
if(li.u.val_size != 16) TEST_ERROR
if (UD_CB_TYPE != li.type) {
- H5_FAILED();
- HDputs(" Unexpected link class - should have been a UD hard link");
- goto error;
+ H5_FAILED();
+ HDputs(" Unexpected link class - should have been a UD hard link");
+ goto error;
}
/* Fill the query buffer */
@@ -8375,7 +7733,6 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
/* Remove UD link */
if(H5Ldelete(fid, NEW_UD_CB_LINK_NAME, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
-
/* Test that the callbacks don't work if the link class is not registered */
/* Create a new link. Just for fun, give it a non-default character
@@ -8413,18 +7770,18 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Pclose (lcpl);
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Pclose (lcpl);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end ud_callbacks() */
-
+
/*-------------------------------------------------------------------------
* Function: lapl_udata
*
@@ -8433,10 +7790,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Tuesday, June 6, 2006
- *
*-------------------------------------------------------------------------
*/
static hid_t
@@ -8452,13 +7805,12 @@ UD_plist_traverse(const char H5_ATTR_UNUSED * link_name, hid_t cur_group,
/* Get the name of the target from the property list. */
if(H5Pget(lapl_id, DEST_PROP_NAME, target) < 0) TEST_ERROR
- if((ret_value = H5Oopen(cur_group, target, lapl_id)) < 0)
- TEST_ERROR
+ if((ret_value = H5Oopen(cur_group, target, lapl_id)) < 0) TEST_ERROR
return ret_value;
error:
- return -1;
+ return FAIL;
} /* end UD_plist_traverse() */
const H5L_class_t UD_plist_class[1] = {{
@@ -8476,12 +7828,12 @@ const H5L_class_t UD_plist_class[1] = {{
static int
lapl_udata(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- hid_t plist_id = (-1); /* Property List ID */
- char group_a_name[NAME_BUF_SIZE];
- char group_b_name[NAME_BUF_SIZE];
- char filename[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ hid_t plist_id = -1; /* Property List ID */
+ char group_a_name[NAME_BUF_SIZE];
+ char group_b_name[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
if(new_format)
TESTING("user data passed through lapl (w/new group format)")
@@ -8552,19 +7904,19 @@ lapl_udata(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Pclose (plist_id);
- H5Gclose (gid);
- H5Gclose (gid2);
- H5Fclose (fid);
+ H5Pclose (plist_id);
+ H5Gclose (gid);
+ H5Gclose (gid2);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end lapl_udata() */
-
+
/*-------------------------------------------------------------------------
* Function: ud_link_errors
*
@@ -8573,10 +7925,6 @@ lapl_udata(hid_t fapl, hbool_t new_format)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Tuesday, June 6, 2006
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -8584,10 +7932,9 @@ UD_cbsucc_create(const char H5_ATTR_UNUSED * link_name, hid_t H5_ATTR_UNUSED loc
const void *udata, size_t udata_size, hid_t H5_ATTR_UNUSED lcpl_id)
{
/* Check to make sure that this "soft link" has a target */
- if(udata_size < 1 || !udata)
- return -1;
+ if(udata_size < 1 || !udata) return FAIL;
- return 0;
+ return SUCCEED;
} /* end UD_cbsucc_create() */
static hid_t
@@ -8605,7 +7952,7 @@ UD_cbsucc_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group,
return ret_value;
error:
- return -1;
+ return FAIL;
} /* end UD_cbsucc_traverse() */
/* Failure callback for when the link is moved or renamed */
@@ -8614,7 +7961,7 @@ UD_cbfail_move(const char H5_ATTR_UNUSED *new_name, hid_t H5_ATTR_UNUSED new_loc
const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size)
{
/* This traversal function will always fail. */
- return -1;
+ return FAIL;
} /* end UD_cbfail_move() */
/* SuccessCallback for when the link is moved or renamed */
@@ -8623,7 +7970,7 @@ UD_cbsucc_move(const char H5_ATTR_UNUSED *new_name, hid_t H5_ATTR_UNUSED new_loc
const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size)
{
/* This traversal function will always succeed. */
- return 0;
+ return SUCCEED;
} /* end UD_cbsucc_move() */
/* Callback for when the link is deleted. Also called during move */
@@ -8632,7 +7979,7 @@ UD_cbsucc_delete(const char H5_ATTR_UNUSED *link_name, hid_t H5_ATTR_UNUSED file
const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size)
{
/* This callback will always succeed */
- return 0;
+ return SUCCEED;
} /* end UD_cbsucc_delete() */
/* Callback for when the link is deleted. Also called during move */
@@ -8642,7 +7989,7 @@ UD_cbfail_delete(const char H5_ATTR_UNUSED *link_name, hid_t H5_ATTR_UNUSED file
{
/* This traversal function will always fail. */
/* Note: un-deletable links are in general a very bad idea! */
- return -1;
+ return FAIL;
} /* end UD_cbfail_delete() */
/* Callback for when the link is queried */
@@ -8651,7 +7998,7 @@ UD_cbfail_query(const char H5_ATTR_UNUSED *link_name, const void H5_ATTR_UNUSED
size_t H5_ATTR_UNUSED udata_size, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNUSED buf_size)
{
/* This traversal function will always fail. */
- return -1;
+ return FAIL;
} /* end UD_cbfail_query() */
/* Callback for when the link is queried */
@@ -8664,10 +8011,9 @@ UD_cbfail_on_write_query(const char H5_ATTR_UNUSED *link_name, const void H5_ATT
* fails
*/
- if(buf != NULL)
- return -1;
+ if(buf != NULL) return FAIL;
- return 0;
+ return SUCCEED;
} /* end UD_cbfail_on_write_query() */
/* Callback for when the link is queried */
@@ -8774,12 +8120,12 @@ const H5L_class_t UD_error4_class[1] = {{
static int
ud_link_errors(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- char group_name[NAME_BUF_SIZE];
- char filename[NAME_BUF_SIZE];
- char query_buf[NAME_BUF_SIZE];
- H5L_info_t li; /* Link information */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group IDs */
+ char group_name[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
+ char query_buf[NAME_BUF_SIZE];
+ H5L_info_t li; /* Link information */
if(new_format)
TESTING("user-defined link error conditions (w/new group format)")
@@ -8792,10 +8138,10 @@ ud_link_errors(hid_t fapl, hbool_t new_format)
/* Try to register some invalid link classes */
H5E_BEGIN_TRY {
- if(H5Lregister(UD_error1_class) >= 0) TEST_ERROR
- if(H5Lregister(UD_error2_class) >= 0) TEST_ERROR
- if(H5Lregister(UD_error3_class) >= 0) TEST_ERROR
- if(H5Lregister(UD_error4_class) >= 0) TEST_ERROR
+ if(H5Lregister(UD_error1_class) >= 0) TEST_ERROR
+ if(H5Lregister(UD_error2_class) >= 0) TEST_ERROR
+ if(H5Lregister(UD_error3_class) >= 0) TEST_ERROR
+ if(H5Lregister(UD_error4_class) >= 0) TEST_ERROR
} H5E_END_TRY
/* Register the UD plist class. */
@@ -8810,10 +8156,8 @@ ud_link_errors(hid_t fapl, hbool_t new_format)
/* Try to create internally defined links with H5Lcreate_ud */
H5E_BEGIN_TRY {
- if(H5Lcreate_ud(fid, "/ud_link", H5L_TYPE_HARD, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) >= 0)
- TEST_ERROR
- if(H5Lcreate_ud(fid, "/ud_link", H5L_TYPE_SOFT, "str", (size_t)4, H5P_DEFAULT, H5P_DEFAULT) >= 0)
- TEST_ERROR
+ if(H5Lcreate_ud(fid, "/ud_link", H5L_TYPE_HARD, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) >= 0) TEST_ERROR
+ if(H5Lcreate_ud(fid, "/ud_link", H5L_TYPE_SOFT, "str", (size_t)4, H5P_DEFAULT, H5P_DEFAULT) >= 0) TEST_ERROR
} H5E_END_TRY
/* Create a user-defined link to the group. */
@@ -8881,17 +8225,17 @@ ud_link_errors(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end ud_link_errors() */
-
+
/*-------------------------------------------------------------------------
* Function: lapl_nlinks
*
@@ -8899,28 +8243,21 @@ error:
* by the user using the Link Access Property List.
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: James Laird
- * Tuesday, June 6, 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
lapl_nlinks(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
- hid_t plist = (-1); /* lapl ID */
- hid_t tid = (-1), sid = (-1), did = (-1); /* Other IDs */
- hid_t gapl = (-1), dapl = (-1), tapl = (-1); /* Other property lists */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE];
- size_t nlinks; /* nlinks for H5Pset_nlinks */
- hsize_t dims[2];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ hid_t plist = -1; /* lapl ID */
+ hid_t tid = -1, sid = -1, did = -1; /* Other IDs */
+ hid_t gapl = -1, dapl = -1, tapl = -1; /* Other property lists */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE];
+ size_t nlinks; /* nlinks for H5Pset_nlinks */
+ hsize_t dims[2];
if(new_format)
TESTING("adjusting nlinks with LAPL (w/new group format)")
@@ -8935,7 +8272,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
/* Create file */
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
- if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create group with short name in file (used as target for links) */
if((gid = H5Gcreate2(fid, "final", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -8964,7 +8301,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
/* Open file */
- if((fid=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
/* Create LAPL with higher-than-usual nlinks value */
/* Create a non-default lapl with udata set to point to the first group */
@@ -9006,9 +8343,9 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
gid = H5Oopen(fid, "soft5", plist);
} H5E_END_TRY;
if (gid >= 0) {
- H5_FAILED();
- HDputs(" Should have failed for sequence of too many nested links.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have failed for sequence of too many nested links.");
+ goto error;
}
/* Open object through lesser soft link */
@@ -9018,7 +8355,6 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/soft4")) TEST_ERROR
-
/* Test other functions that should use a LAPL */
nlinks = 20;
if(H5Pset_nlinks(plist, nlinks) < 0) TEST_ERROR
@@ -9051,7 +8387,6 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
/* Close plist */
if(H5Pclose(plist) < 0) TEST_ERROR
-
/* Create a datatype and dataset as targets inside the group */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
if(H5Tcommit2(gid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -9110,25 +8445,25 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Pclose(gapl);
- H5Pclose(dapl);
- H5Pclose(tapl);
- H5Dclose(did);
- H5Sclose(sid);
- H5Tclose(tid);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Pclose(plist);
- H5Fclose(fid);
- } H5E_END_TRY;
- return -1;
+ H5Pclose(gapl);
+ H5Pclose(dapl);
+ H5Pclose(tapl);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Tclose(tid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Pclose(plist);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ return FAIL;
} /* end lapl_nlinks() */
-
+
/*-------------------------------------------------------------------------
* Function: linkinfo
*
@@ -9136,21 +8471,17 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Tuesday, June 6, 2006
- *
*-------------------------------------------------------------------------
*/
static int
linkinfo(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group ID */
- hid_t tid = (-1); /* Type ID */
- hid_t sid = (-1), did = -(1); /* Dataspace and dataset IDs */
- H5L_info_t li; /* Link information */
- char filename[NAME_BUF_SIZE];
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t tid = -1; /* Type ID */
+ hid_t sid = -1, did = -1; /* Dataspace and dataset IDs */
+ H5L_info_t li; /* Link information */
+ char filename[NAME_BUF_SIZE];
if(new_format)
TESTING("link type field in H5Lget_info (w/new group format)")
@@ -9203,19 +8534,19 @@ linkinfo(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
- H5Tclose (tid);
- H5Dclose (did);
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Tclose (tid);
+ H5Dclose (did);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end linkinfo() */
-
+
/*-------------------------------------------------------------------------
* Function: check_all_closed
*
@@ -9228,10 +8559,6 @@ linkinfo(hid_t fapl, hbool_t new_format)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Thursday, August 17, 2006
- *
*-------------------------------------------------------------------------
*/
static int
@@ -9251,8 +8578,7 @@ check_all_closed(hid_t fapl, hbool_t new_format, int stopat)
* To check this, try to create every file used in this test. If
* a file is already open, creating it will fail.
*/
- for(x=0; FILENAME[x] != NULL && x < stopat; x++)
- {
+ for(x=0; FILENAME[x] != NULL && x < stopat; x++) {
h5_fixname(FILENAME[x], fapl, filename, sizeof filename);
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -9260,17 +8586,15 @@ check_all_closed(hid_t fapl, hbool_t new_format, int stopat)
}
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end check_all_closed() */
-
-
/*-------------------------------------------------------------------------
* Function: build_visit_file
*
@@ -9278,10 +8602,6 @@ error:
*
* Return: Success: >0, File ID for file built
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Saturday, November 24, 2007
- *
*-------------------------------------------------------------------------
*/
static hid_t
@@ -9289,9 +8609,9 @@ build_visit_file(hid_t fapl)
{
hid_t fid = -1; /* File ID */
hid_t gid = -1, gid2 = -1; /* Group IDs */
- hid_t sid = (-1); /* Dataspace ID */
- hid_t did = (-1); /* Dataset ID */
- hid_t tid = (-1); /* Datatype ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t did = -1; /* Dataset ID */
+ hid_t tid = -1; /* Datatype ID */
char filename[NAME_BUF_SIZE];
const char *pathname = H5_get_srcdir_filename(LINKED_FILE); /* Corrected test file name */
@@ -9310,7 +8630,6 @@ build_visit_file(hid_t fapl)
if(H5Gclose(gid2) < 0) TEST_ERROR
if(H5Gclose(gid) < 0) TEST_ERROR
-
/* Create soft links to groups created */
if(H5Lcreate_soft("/Group1", fid, "/soft_one", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
if(H5Lcreate_soft("/Group1/Group2", fid, "/soft_two", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -9318,7 +8637,6 @@ build_visit_file(hid_t fapl)
/* Create dangling soft link */
if(H5Lcreate_soft("nowhere", fid, "/soft_dangle", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
-
/* Create hard links to all groups */
if(H5Lcreate_hard(fid, "/", fid, "hard_zero", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
if(H5Lcreate_hard(fid, "/Group1", fid, "hard_one", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -9367,10 +8685,10 @@ error:
H5E_BEGIN_TRY {
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end build_visit_file() */
-
+
/*-------------------------------------------------------------------------
* Function: visit_link_cb
*
@@ -9378,15 +8696,10 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Saturday, November 24, 2007
- *
*-------------------------------------------------------------------------
*/
static int
-visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info_t *linfo,
- void *_op_data)
+visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info_t *linfo, void *_op_data)
{
lvisit_ud_t *op_data = (lvisit_ud_t *)_op_data;
@@ -9400,7 +8713,7 @@ visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info_t
return(H5_ITER_CONT);
} /* end visit_link_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: link_visit
*
@@ -9408,10 +8721,6 @@ visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info_t
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Saturday, November 24, 2007
- *
*-------------------------------------------------------------------------
*/
static int
@@ -9441,7 +8750,6 @@ link_visit(hid_t fapl, hbool_t new_format)
if(H5Lvisit(gid, H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
-
/* Visit all the links reachable from each internal group */
if((gid = H5Gopen2(fid, "/Group1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
udata.idx = 0;
@@ -9455,22 +8763,21 @@ link_visit(hid_t fapl, hbool_t new_format)
if(H5Lvisit(gid, H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
-
/* Close file created */
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Gclose(gid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end link_visit() */
-
+
/*-------------------------------------------------------------------------
* Function: link_visit_by_name
*
@@ -9478,10 +8785,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Saturday, November 24, 2007
- *
*-------------------------------------------------------------------------
*/
static int
@@ -9511,7 +8814,6 @@ link_visit_by_name(hid_t fapl, hbool_t new_format)
if(H5Lvisit_by_name(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
-
/* Visit all the links reachable from each internal group */
udata.idx = 0;
udata.info = lvisit1;
@@ -9533,22 +8835,21 @@ link_visit_by_name(hid_t fapl, hbool_t new_format)
if(H5Lvisit_by_name(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
-
/* Close file created */
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Gclose(gid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end link_visit_by_name() */
-
+
/*-------------------------------------------------------------------------
* Function: visit_obj_cb
*
@@ -9556,15 +8857,10 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Sunday, November 25, 2007
- *
*-------------------------------------------------------------------------
*/
static int
-visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info_t *oinfo,
- void *_op_data)
+visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info_t *oinfo, void *_op_data)
{
ovisit_ud_t *op_data = (ovisit_ud_t *)_op_data;
@@ -9578,7 +8874,7 @@ visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info_t *
return(H5_ITER_CONT);
} /* end visit_obj_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: obj_visit
*
@@ -9586,10 +8882,6 @@ visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info_t *
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Sunday, November 25, 2007
- *
*-------------------------------------------------------------------------
*/
static int
@@ -9619,7 +8911,6 @@ obj_visit(hid_t fapl, hbool_t new_format)
if(H5Ovisit2(gid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
-
/* Visit all the objects reachable from each internal group */
if((gid = H5Gopen2(fid, "/Group1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
udata.idx = 0;
@@ -9633,22 +8924,21 @@ obj_visit(hid_t fapl, hbool_t new_format)
if(H5Ovisit2(gid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
-
/* Close file created */
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Gclose(gid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end obj_visit() */
-
+
/*-------------------------------------------------------------------------
* Function: obj_visit_by_name
*
@@ -9656,10 +8946,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Sunday, November 25, 2007
- *
*-------------------------------------------------------------------------
*/
static int
@@ -9689,7 +8975,6 @@ obj_visit_by_name(hid_t fapl, hbool_t new_format)
if(H5Ovisit_by_name2(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
-
/* Visit all the objects reachable from each internal group */
udata.idx = 0;
udata.info = new_format ? ovisit1_new : ovisit1_old;
@@ -9701,7 +8986,6 @@ obj_visit_by_name(hid_t fapl, hbool_t new_format)
if(H5Ovisit_by_name2(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
-
udata.idx = 0;
udata.info = new_format ? ovisit2_new : ovisit2_old;
if(H5Ovisit_by_name2(fid, "/Group1/Group2", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
@@ -9712,37 +8996,31 @@ obj_visit_by_name(hid_t fapl, hbool_t new_format)
if(H5Ovisit_by_name2(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
-
/* Close file created */
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Gclose(gid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end obj_visit_by_name() */
-
+
/*-------------------------------------------------------------------------
* Function: visit_obj_stop_cb
*
* Purpose: Callback routine for visiting objects in a file
*
* Return: 1 (H5_ITER_STOP)
- *
- * Programmer: Neil Fortner
- * Sunday, November 2, 2008
- *
*-------------------------------------------------------------------------
*/
static int
-visit_obj_stop_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *name, const H5O_info_t H5_ATTR_UNUSED *oinfo,
- void *_op_data)
+visit_obj_stop_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *name, const H5O_info_t H5_ATTR_UNUSED *oinfo, void *_op_data)
{
unsigned *op_data = (unsigned *)_op_data;
@@ -9752,7 +9030,7 @@ visit_obj_stop_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *name
return(H5_ITER_STOP);
} /* end visit_obj_stop_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: obj_visit_stop
*
@@ -9761,10 +9039,6 @@ visit_obj_stop_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *name
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Sunday, November 2, 2008
- *
*-------------------------------------------------------------------------
*/
static int
@@ -9794,7 +9068,7 @@ obj_visit_stop(hid_t fapl, hbool_t new_format)
/* Same test with H5Ovisit_by_name */
nvisited = 0;
if((ret = H5Ovisit_by_name2(fid, "/", H5_INDEX_NAME, H5_ITER_INC, visit_obj_stop_cb,
- &nvisited, H5O_INFO_BASIC, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ &nvisited, H5O_INFO_BASIC, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(ret != H5_ITER_STOP) TEST_ERROR
if(nvisited != 1) TEST_ERROR
@@ -9802,16 +9076,16 @@ obj_visit_stop(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end obj_visit_stop() */
-
+
/*-------------------------------------------------------------------------
* Function: link_filters
*
@@ -9820,10 +9094,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Tuesday, June 16, 2009
- *
*-------------------------------------------------------------------------
*/
static enum {
@@ -9836,14 +9106,11 @@ static enum {
static htri_t link_filter_can_apply(hid_t dcpl_id, hid_t type_id, hid_t space_id)
{
- if(dcpl_id >= 0 || type_id >= 0 || space_id >= 0)
- return -1;
+ if(dcpl_id >= 0 || type_id >= 0 || space_id >= 0) return -1;
- if(link_filter_state >= LFS_ENCODED)
- return 1;
+ if(link_filter_state >= LFS_ENCODED) return 1;
- if(link_filter_state != LFS_INIT)
- return -1;
+ if(link_filter_state != LFS_INIT) return -1;
link_filter_state = LFS_CAN_APPLY_CALLED;
@@ -9852,14 +9119,11 @@ static htri_t link_filter_can_apply(hid_t dcpl_id, hid_t type_id, hid_t space_id
static herr_t link_filter_set_local(hid_t dcpl_id, hid_t type_id, hid_t space_id)
{
- if(dcpl_id >= 0 || type_id >= 0 || space_id >= 0)
- return -1;
+ if(dcpl_id >= 0 || type_id >= 0 || space_id >= 0) return -1;
- if(link_filter_state >= LFS_ENCODED)
- return 0;
+ if(link_filter_state >= LFS_ENCODED) return 0;
- if(link_filter_state != LFS_CAN_APPLY_CALLED)
- return -1;
+ if(link_filter_state != LFS_CAN_APPLY_CALLED) return -1;
link_filter_state = LFS_SET_LOCAL_CALLED;
@@ -9870,19 +9134,16 @@ static size_t link_filter_filter(unsigned int flags, size_t cd_nelmts,
const unsigned int cd_values[], size_t nbytes, size_t H5_ATTR_UNUSED *buf_size,
void H5_ATTR_UNUSED **buf)
{
- if(flags & H5Z_FLAG_OPTIONAL || cd_nelmts != 1 || cd_values[0] != 2112)
- return 0;
+ if(flags & H5Z_FLAG_OPTIONAL || cd_nelmts != 1 || cd_values[0] != 2112) return 0;
- if(link_filter_state == LFS_DECODED)
- return nbytes;
+ if(link_filter_state == LFS_DECODED) return nbytes;
if(flags & H5Z_FLAG_REVERSE) {
- if(link_filter_state != LFS_ENCODED)
- return 0;
+ if(link_filter_state != LFS_ENCODED) return 0;
link_filter_state = LFS_DECODED;
- } else {
- if(link_filter_state < LFS_SET_LOCAL_CALLED)
- return 0;
+ }
+ else {
+ if(link_filter_state < LFS_SET_LOCAL_CALLED) return 0;
link_filter_state = LFS_ENCODED;
} /* end else */
@@ -9903,7 +9164,7 @@ link_filters(hid_t fapl, hbool_t new_format)
int nfilters = 0;
H5Z_class2_t filter_class;
char name_out[24];
- char filename[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
htri_t tri_ret;
herr_t status;
@@ -9921,8 +9182,7 @@ link_filters(hid_t fapl, hbool_t new_format)
/* Set up filename and create file*/
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Create gcpl, force use of dense storage */
if((gcpl1 = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR
@@ -9950,8 +9210,7 @@ link_filters(hid_t fapl, hbool_t new_format)
filter_class.set_local = link_filter_set_local;
filter_class.filter = link_filter_filter;
if(H5Zregister(&filter_class) < 0) TEST_ERROR
- if(H5Pset_filter(gcpl1, H5Z_FILTER_RESERVED + 42, 0, (size_t)1, &cd_value) < 0)
- TEST_ERROR
+ if(H5Pset_filter(gcpl1, H5Z_FILTER_RESERVED + 42, 0, (size_t)1, &cd_value) < 0) TEST_ERROR
nfilters++;
/* Test various other filter functions for use on gcpl's */
@@ -9959,14 +9218,10 @@ link_filters(hid_t fapl, hbool_t new_format)
if(H5Pall_filters_avail(gcpl1) != TRUE) TEST_ERROR
/* Create a group using this filter, add some soft links to it */
- if((gid1 = H5Gcreate2(fid, "group1", H5P_DEFAULT, gcpl1, H5P_DEFAULT)) < 0)
- TEST_ERROR
- if(H5Lcreate_soft("/", gid1, "link1", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_soft("/", gid1, "link2", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_soft("/", gid1, "link3", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if((gid1 = H5Gcreate2(fid, "group1", H5P_DEFAULT, gcpl1, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Lcreate_soft("/", gid1, "link1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_soft("/", gid1, "link2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_soft("/", gid1, "link3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close file and group */
if(H5Gclose(gid1) < 0) TEST_ERROR
@@ -9990,12 +9245,10 @@ link_filters(hid_t fapl, hbool_t new_format)
if(H5Pclose(gcpl2) < 0) TEST_ERROR
/* Add another soft link */
- if(H5Lcreate_soft("/", gid1, "link4", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_soft("/", gid1, "link4", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Copy the group */
- if(H5Ocopy(fid, "group1", fid, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Ocopy(fid, "group1", fid, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
if((gid2 = H5Gopen2(fid, "group2", H5P_DEFAULT)) <0) TEST_ERROR
/* Verify that all links have been copied */
@@ -10024,10 +9277,8 @@ link_filters(hid_t fapl, hbool_t new_format)
/* Reopen file and group, add 2 links */
if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
if((gid1 = H5Gopen2(fid, "group1", H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Lcreate_soft("/", gid1, "link2", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Lcreate_soft("/", gid1, "link3", H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Lcreate_soft("/", gid1, "link2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_soft("/", gid1, "link3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close file and group */
if(H5Gclose(gid1) < 0) TEST_ERROR
@@ -10038,34 +9289,27 @@ link_filters(hid_t fapl, hbool_t new_format)
/* Test H5Pget_filter_by_id2 and H5Pget_filter2 */
if(H5Pget_filter_by_id2(gcpl2, H5Z_FILTER_RESERVED + 42, &flags_out,
- &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0)
- TEST_ERROR
+ &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) TEST_ERROR
if(flags_out != 0 || cd_value_out != cd_value
|| HDstrcmp(filter_class.name, name_out)
|| filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED
- | H5Z_FILTER_CONFIG_DECODE_ENABLED))
- TEST_ERROR
+ | H5Z_FILTER_CONFIG_DECODE_ENABLED)) TEST_ERROR
if(H5Pget_filter2(gcpl2, (unsigned)(nfilters - 1), &flags_out, &cd_nelmts,
- &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0)
- TEST_ERROR
+ &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) TEST_ERROR
if(flags_out != 0 || cd_value_out != cd_value
|| HDstrcmp(filter_class.name, name_out)
|| filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED
- | H5Z_FILTER_CONFIG_DECODE_ENABLED))
- TEST_ERROR
+ | H5Z_FILTER_CONFIG_DECODE_ENABLED)) TEST_ERROR
/* Test H5Pmodify_filter */
cd_value++;
- if(H5Pmodify_filter(gcpl2, H5Z_FILTER_RESERVED + 42, 0, (size_t)1, &cd_value) < 0)
- TEST_ERROR
+ if(H5Pmodify_filter(gcpl2, H5Z_FILTER_RESERVED + 42, 0, (size_t)1, &cd_value) < 0) TEST_ERROR
if(H5Pget_filter_by_id2(gcpl2, H5Z_FILTER_RESERVED + 42, &flags_out,
- &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0)
- TEST_ERROR
+ &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) TEST_ERROR
if(flags_out != 0 || cd_value_out != cd_value
|| HDstrcmp(filter_class.name, name_out)
|| filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED
- | H5Z_FILTER_CONFIG_DECODE_ENABLED))
- TEST_ERROR
+ | H5Z_FILTER_CONFIG_DECODE_ENABLED)) TEST_ERROR
/* Test H5Premove_filter */
if(H5Premove_filter(gcpl2, H5Z_FILTER_RESERVED + 42) < 0) TEST_ERROR
@@ -10091,8 +9335,7 @@ link_filters(hid_t fapl, hbool_t new_format)
if(H5Pset_create_intermediate_group(lcpl, (unsigned)TRUE) < 0) TEST_ERROR
/* Create new group, with missing intermediate groups, in compressed group */
- if((gid1 = H5Gcreate2(fid, "group1/group2/group3/group4", lcpl, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ if((gid1 = H5Gcreate2(fid, "group1/group2/group3/group4", lcpl, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Close LCPL ID */
if(H5Pclose(lcpl) < 0) TEST_ERROR
@@ -10120,7 +9363,6 @@ link_filters(hid_t fapl, hbool_t new_format)
/* Close file */
if(H5Fclose(fid) < 0) TEST_ERROR
-
/* Now create the same file with and without deflate, and verify that the
* file size is smaller with deflate */
/* But only if the deflate filter is available */
@@ -10134,8 +9376,7 @@ link_filters(hid_t fapl, hbool_t new_format)
if(H5Pset_link_phase_change(fcpl, 2, 2) < 0) TEST_ERROR
/* Create file */
- if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
- TEST_ERROR
+ if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) TEST_ERROR
/* Create links in file */
if(H5Lcreate_soft("/", fid, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", H5P_DEFAULT, H5P_DEFAULT) < 0)
@@ -10153,8 +9394,7 @@ link_filters(hid_t fapl, hbool_t new_format)
if(H5Pset_deflate(fcpl, 6) < 0) TEST_ERROR
/* Recreate the same file with the deflate filter */
- if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
- TEST_ERROR
+ if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) TEST_ERROR
if(H5Lcreate_soft("/", fid, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
if(H5Lcreate_soft("/", fid, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", H5P_DEFAULT, H5P_DEFAULT) < 0)
@@ -10167,16 +9407,14 @@ link_filters(hid_t fapl, hbool_t new_format)
filesize_filtered = h5_get_file_size(filename, fapl);
/* Check that the file size is smaller with the filter */
- if((double)filesize_filtered
- > ((double)filesize_unfiltered * FILTER_FILESIZE_MAX_FRACTION))
- TEST_ERROR
+ if((double)filesize_filtered > ((double)filesize_unfiltered * FILTER_FILESIZE_MAX_FRACTION)) TEST_ERROR
/* Close */
if(H5Pclose(fcpl) < 0) TEST_ERROR
} /* end if */
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10188,10 +9426,10 @@ error:
H5Pclose(gcpl2);
H5Pclose(fcpl);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end link_filters() */
-
+
/*-------------------------------------------------------------------------
* Function: obj_exists
*
@@ -10199,19 +9437,15 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Tuesday, February 2, 2010
- *
*-------------------------------------------------------------------------
*/
static int
obj_exists(hid_t fapl, hbool_t new_format)
{
- char filename[NAME_BUF_SIZE]; /* Buffer for file name */
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group ID */
- herr_t status; /* Generic return value */
+ char filename[NAME_BUF_SIZE]; /* Buffer for file name */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group ID */
+ herr_t status; /* Generic return value */
if(new_format)
TESTING("object exists (w/new group format)")
@@ -10221,8 +9455,7 @@ obj_exists(hid_t fapl, hbool_t new_format)
/* Set up filename and create file*/
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- FAIL_STACK_ERROR
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Hard links */
/* Verify that H5Oexists_by_name() fails for non-existent link in root group */
@@ -10232,13 +9465,11 @@ obj_exists(hid_t fapl, hbool_t new_format)
if(status >= 0) TEST_ERROR
/* Create a group, as a destination for testing */
- if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() succeeds for hard linked object */
- if(TRUE != H5Oexists_by_name(fid, "group", H5P_DEFAULT))
- TEST_ERROR
+ if(TRUE != H5Oexists_by_name(fid, "group", H5P_DEFAULT)) TEST_ERROR
/* Verify that H5Oexists_by_name() fails for non-existent link in non-root group */
H5E_BEGIN_TRY {
@@ -10246,240 +9477,205 @@ obj_exists(hid_t fapl, hbool_t new_format)
} H5E_END_TRY
if(status >= 0) TEST_ERROR
-
/* Soft links */
/* Create dangling soft-link in root group */
if(H5Lcreate_soft("dangle", fid, "soft1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns FALSE for dangling soft-link in root group */
- if(FALSE != H5Oexists_by_name(fid, "soft1", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "soft1", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in root group that points to object */
if(H5Lcreate_soft("/group", fid, "soft2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns TRUE for soft-link in root group that points to object */
- if(TRUE != H5Oexists_by_name(fid, "soft2", H5P_DEFAULT))
- TEST_ERROR
+ if(TRUE != H5Oexists_by_name(fid, "soft2", H5P_DEFAULT)) TEST_ERROR
/* Create dangling soft-link in non-root group */
if(H5Lcreate_soft("dangle", fid, "group/soft1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns FALSE for dangling soft-link in non-root group */
- if(FALSE != H5Oexists_by_name(fid, "group/soft1", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "group/soft1", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in non-root group that points to object */
if(H5Lcreate_soft("/group", fid, "group/soft2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns TRUE for soft-link in non-root group that points to object */
- if(TRUE != H5Oexists_by_name(fid, "group/soft2", H5P_DEFAULT))
- TEST_ERROR
-
+ if(TRUE != H5Oexists_by_name(fid, "group/soft2", H5P_DEFAULT)) TEST_ERROR
/* External links */
/* Create dangling (file doesn't exist) external link in root group */
if(H5Lcreate_external("nofile", "dangle", fid, "external1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns FALSE for dangling (file doesn't exist) external link in root group */
- if(FALSE != H5Oexists_by_name(fid, "external1", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "external1", H5P_DEFAULT)) TEST_ERROR
/* Create dangling (object doesn't exist) external link in root group */
if(H5Lcreate_external(filename, "dangle", fid, "external2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns FALSE for dangling (object doesn't exist) external link in root group */
- if(FALSE != H5Oexists_by_name(fid, "external2", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "external2", H5P_DEFAULT)) TEST_ERROR
/* Create external link in root group that points to object */
if(H5Lcreate_external(filename, "group", fid, "external3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns TRUE for external link in root group that points to object */
- if(TRUE != H5Oexists_by_name(fid, "external3", H5P_DEFAULT))
- TEST_ERROR
+ if(TRUE != H5Oexists_by_name(fid, "external3", H5P_DEFAULT)) TEST_ERROR
/* Create dangling (file doesn't exist) external link in non-root group */
if(H5Lcreate_external("nofile", "dangle", fid, "group/external1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns FALSE for dangling (file doesn't exist) external link in non-root group */
- if(FALSE != H5Oexists_by_name(fid, "group/external1", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "group/external1", H5P_DEFAULT)) TEST_ERROR
/* Create dangling (object doesn't exist) external link in non-root group */
if(H5Lcreate_external(filename, "dangle", fid, "group/external2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns FALSE for dangling (object doesn't exist) external link in non-root group */
- if(FALSE != H5Oexists_by_name(fid, "group/external2", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "group/external2", H5P_DEFAULT)) TEST_ERROR
/* Create external link in non-root group that points to object */
if(H5Lcreate_external(filename, "group", fid, "group/external3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns TRUE for external link in non-root group that points to object */
- if(TRUE != H5Oexists_by_name(fid, "group/external3", H5P_DEFAULT))
- TEST_ERROR
-
+ if(TRUE != H5Oexists_by_name(fid, "group/external3", H5P_DEFAULT)) TEST_ERROR
/* Soft->External links */
/* Create soft-link in root group that points to dangling (file doesn't exist) external link */
if(H5Lcreate_soft("external1", fid, "soft-elink1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns FALSE */
- if(FALSE != H5Oexists_by_name(fid, "soft-elink1", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "soft-elink1", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in root group that points to dangling (object doesn't exist) external link */
if(H5Lcreate_soft("external2", fid, "soft-elink2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns FALSE */
- if(FALSE != H5Oexists_by_name(fid, "soft-elink2", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "soft-elink2", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in root group that points to external link that points to object */
if(H5Lcreate_soft("external3", fid, "soft-elink3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns TRUE */
- if(TRUE != H5Oexists_by_name(fid, "soft-elink3", H5P_DEFAULT))
- TEST_ERROR
+ if(TRUE != H5Oexists_by_name(fid, "soft-elink3", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in root group that points to dangling (file doesn't exist) external link in non-root group */
if(H5Lcreate_soft("group/external1", fid, "soft-elink4", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns FALSE */
- if(FALSE != H5Oexists_by_name(fid, "soft-elink4", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "soft-elink4", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in root group that points to dangling (object doesn't exist) external link in non-root group */
if(H5Lcreate_soft("group/external2", fid, "soft-elink5", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns FALSE */
- if(FALSE != H5Oexists_by_name(fid, "soft-elink5", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "soft-elink5", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in root group that points to external link in non-root group that points to object */
if(H5Lcreate_soft("group/external3", fid, "soft-elink6", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns TRUE */
- if(TRUE != H5Oexists_by_name(fid, "soft-elink6", H5P_DEFAULT))
- TEST_ERROR
+ if(TRUE != H5Oexists_by_name(fid, "soft-elink6", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in non-root group that points to dangling (file doesn't exist) external link */
if(H5Lcreate_soft("/external1", fid, "group/soft-elink1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns FALSE */
- if(FALSE != H5Oexists_by_name(fid, "group/soft-elink1", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "group/soft-elink1", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in non-root group that points to dangling (object doesn't exist) external link */
if(H5Lcreate_soft("/external2", fid, "group/soft-elink2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns FALSE */
- if(FALSE != H5Oexists_by_name(fid, "group/soft-elink2", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "group/soft-elink2", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in non-root group that points to external link that points to object */
if(H5Lcreate_soft("/external3", fid, "group/soft-elink3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns TRUE */
- if(TRUE != H5Oexists_by_name(fid, "group/soft-elink3", H5P_DEFAULT))
- TEST_ERROR
+ if(TRUE != H5Oexists_by_name(fid, "group/soft-elink3", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in non-root group that points to dangling (file doesn't exist) external link in non-root group */
if(H5Lcreate_soft("/group/external1", fid, "group/soft-elink4", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns FALSE */
- if(FALSE != H5Oexists_by_name(fid, "group/soft-elink4", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "group/soft-elink4", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in non-root group that points to dangling (object doesn't exist) external link in non-root group */
if(H5Lcreate_soft("/group/external2", fid, "group/soft-elink5", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns FALSE */
- if(FALSE != H5Oexists_by_name(fid, "group/soft-elink5", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "group/soft-elink5", H5P_DEFAULT)) TEST_ERROR
/* Create soft-link in non-root group that points to external link in non-root group that points to object */
if(H5Lcreate_soft("/group/external3", fid, "group/soft-elink6", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Verify that H5Oexists_by_name() returns TRUE */
- if(TRUE != H5Oexists_by_name(fid, "group/soft-elink6", H5P_DEFAULT))
- TEST_ERROR
-
+ if(TRUE != H5Oexists_by_name(fid, "group/soft-elink6", H5P_DEFAULT)) TEST_ERROR
/* External->Soft links */
/* Create external link in root group that points to dangling soft link in root group */
if(H5Lcreate_external(filename, "soft1", fid, "elink-soft1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns FALSE */
- if(FALSE != H5Oexists_by_name(fid, "elink-soft1", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "elink-soft1", H5P_DEFAULT)) TEST_ERROR
/* Create external link in root group that points to soft link in root group that points to object */
if(H5Lcreate_external(filename, "soft2", fid, "elink-soft2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns TRUE */
- if(TRUE != H5Oexists_by_name(fid, "elink-soft2", H5P_DEFAULT))
- TEST_ERROR
+ if(TRUE != H5Oexists_by_name(fid, "elink-soft2", H5P_DEFAULT)) TEST_ERROR
/* Create external link in root group that points to dangling soft link in non-root group */
if(H5Lcreate_external(filename, "group/soft1", fid, "elink-soft3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns FALSE */
- if(FALSE != H5Oexists_by_name(fid, "elink-soft3", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "elink-soft3", H5P_DEFAULT)) TEST_ERROR
/* Create external link in root group that points to soft link in root group that points to object */
if(H5Lcreate_external(filename, "group/soft2", fid, "elink-soft4", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns TRUE */
- if(TRUE != H5Oexists_by_name(fid, "elink-soft4", H5P_DEFAULT))
- TEST_ERROR
+ if(TRUE != H5Oexists_by_name(fid, "elink-soft4", H5P_DEFAULT)) TEST_ERROR
/* Create external link in non-root group that points to dangling soft link in root group */
if(H5Lcreate_external(filename, "soft1", fid, "group/elink-soft1", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns FALSE */
- if(FALSE != H5Oexists_by_name(fid, "group/elink-soft1", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "group/elink-soft1", H5P_DEFAULT)) TEST_ERROR
/* Create external link in non-root group that points to soft link in root group that points to object */
if(H5Lcreate_external(filename, "soft2", fid, "group/elink-soft2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns TRUE */
- if(TRUE != H5Oexists_by_name(fid, "group/elink-soft2", H5P_DEFAULT))
- TEST_ERROR
+ if(TRUE != H5Oexists_by_name(fid, "group/elink-soft2", H5P_DEFAULT)) TEST_ERROR
/* Create external link in non-root group that points to dangling soft link in non-root group */
if(H5Lcreate_external(filename, "group/soft1", fid, "group/elink-soft3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns FALSE */
- if(FALSE != H5Oexists_by_name(fid, "group/elink-soft3", H5P_DEFAULT))
- TEST_ERROR
+ if(FALSE != H5Oexists_by_name(fid, "group/elink-soft3", H5P_DEFAULT)) TEST_ERROR
/* Create external link in non-root group that points to soft link in non-root group that points to object */
if(H5Lcreate_external(filename, "group/soft2", fid, "group/elink-soft4", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify that H5Oexists_by_name() returns TRUE */
- if(TRUE != H5Oexists_by_name(fid, "group/elink-soft4", H5P_DEFAULT))
- TEST_ERROR
-
+ if(TRUE != H5Oexists_by_name(fid, "group/elink-soft4", H5P_DEFAULT)) TEST_ERROR
/* Close file created */
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Gclose(gid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end obj_exists() */
-
+
/*-------------------------------------------------------------------------
* Function: corder_create_empty
*
@@ -10487,19 +9683,15 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, October 30, 2006
- *
*-------------------------------------------------------------------------
*/
static int
corder_create_empty(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1); /* Group ID */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
- unsigned crt_order_flags; /* Status of creation order info for GCPL */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1; /* Group ID */
+ hid_t gcpl_id = -1; /* Group creation property list ID */
+ unsigned crt_order_flags; /* Status of creation order info for GCPL */
herr_t ret; /* Generic return value */
char filename[NAME_BUF_SIZE];/* File name */
@@ -10521,9 +9713,9 @@ corder_create_empty(hid_t fapl)
ret = H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_INDEXED);
} H5E_END_TRY;
if(ret > 0) {
- H5_FAILED();
- HDputs(" H5Pset_link_create_order() should have failed for a creation order index with no tracking.");
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" H5Pset_link_create_order() should have failed for a creation order index with no tracking.");
+ TEST_ERROR
} /* end if */
/* Set creation order tracking & indexing on group */
@@ -10548,7 +9740,6 @@ corder_create_empty(hid_t fapl)
/* Close the file */
if(H5Fclose(file_id) < 0) TEST_ERROR
-
/* Re-open the file */
if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
@@ -10575,7 +9766,7 @@ corder_create_empty(hid_t fapl)
if(H5Fclose(file_id) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10583,10 +9774,10 @@ error:
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end corder_create_empty() */
-
+
/*-------------------------------------------------------------------------
* Function: corder_create_compact
*
@@ -10595,21 +9786,17 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, October 30, 2006
- *
*-------------------------------------------------------------------------
*/
static int
corder_create_compact(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1, group_id2 = -1; /* Group IDs */
+ hid_t gcpl_id = -1; /* Group creation property list ID */
unsigned max_compact; /* Maximum # of links to store in group compactly */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
- unsigned nlinks; /* Number of link messages in group's header */
+ unsigned nlinks; /* Number of link messages in group's header */
char objname[NAME_BUF_SIZE]; /* Object name */
char filename[NAME_BUF_SIZE];/* File name */
unsigned u; /* Local index variable */
@@ -10639,7 +9826,7 @@ corder_create_compact(hid_t fapl)
/* Create several links, but keep group in compact form */
for(u = 0; u < max_compact; u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
@@ -10659,7 +9846,6 @@ corder_create_compact(hid_t fapl)
/* Close the file */
if(H5Fclose(file_id) < 0) TEST_ERROR
-
/* Re-open the file */
if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
@@ -10678,7 +9864,7 @@ corder_create_compact(hid_t fapl)
H5L_info_t linfo; /* Link information */
/* Retrieve information for link */
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if(H5Lget_info(group_id, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify creation order of link */
@@ -10693,7 +9879,7 @@ corder_create_compact(hid_t fapl)
if(H5Fclose(file_id) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10701,10 +9887,10 @@ error:
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end corder_create_compact() */
-
+
/*-------------------------------------------------------------------------
* Function: corder_create_dense
*
@@ -10713,21 +9899,17 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, October 30, 2006
- *
*-------------------------------------------------------------------------
*/
static int
corder_create_dense(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1, group_id2 = -1; /* Group IDs */
+ hid_t gcpl_id = -1; /* Group creation property list ID */
unsigned max_compact; /* Maximum # of links to store in group compactly */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
- unsigned nlinks; /* Number of link messages in group's header */
+ unsigned nlinks; /* Number of link messages in group's header */
hsize_t name_count; /* # of records in name index */
hsize_t corder_count; /* # of records in creation order index */
char objname[NAME_BUF_SIZE]; /* Object name */
@@ -10759,7 +9941,7 @@ corder_create_dense(hid_t fapl)
/* Create several links, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
@@ -10771,7 +9953,7 @@ corder_create_dense(hid_t fapl)
} /* end for */
/* Create another link, to push group into dense form */
- sprintf(objname, "filler %u", max_compact);
+ HDsnprintf(objname, sizeof(objname), "filler %u", max_compact);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
@@ -10793,7 +9975,6 @@ corder_create_dense(hid_t fapl)
/* Close the file */
if(H5Fclose(file_id) < 0) TEST_ERROR
-
/* Re-open the file */
if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
@@ -10811,7 +9992,7 @@ corder_create_dense(hid_t fapl)
H5L_info_t linfo; /* Link information */
/* Retrieve information for link */
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if(H5Lget_info(group_id, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify creation order of link */
@@ -10826,7 +10007,7 @@ corder_create_dense(hid_t fapl)
if(H5Fclose(file_id) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10834,10 +10015,10 @@ error:
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end corder_create_dense() */
-
+
/*-------------------------------------------------------------------------
* Function: corder_transition
*
@@ -10846,25 +10027,21 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, October 30, 2006
- *
*-------------------------------------------------------------------------
*/
static int
corder_transition(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1, group_id2 = -1; /* Group IDs */
+ hid_t gcpl_id = -1; /* Group creation property list ID */
unsigned max_compact; /* Maximum # of links to store in group compactly */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
- unsigned nlinks; /* Number of link messages in group's header */
+ unsigned nlinks; /* Number of link messages in group's header */
hsize_t name_count; /* # of records in name index */
hsize_t corder_count; /* # of records in creation order index */
- h5_stat_size_t empty_size; /* Size of empty file */
- h5_stat_size_t file_size; /* Size of file after operating on it */
+ h5_stat_size_t empty_size; /* Size of empty file */
+ h5_stat_size_t file_size; /* Size of file after operating on it */
char objname[NAME_BUF_SIZE]; /* Object name */
char filename[NAME_BUF_SIZE];/* File name */
unsigned u; /* Local index variable */
@@ -10904,7 +10081,6 @@ corder_transition(hid_t fapl)
/* Get the size of the file with an empty group */
if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
-
/* Re-open the file */
if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
@@ -10913,13 +10089,13 @@ corder_transition(hid_t fapl)
/* Create several links, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
} /* end for */
/* Create another link, to push group into dense form */
- sprintf(objname, "filler %u", max_compact);
+ HDsnprintf(objname, sizeof(objname), "filler %u", max_compact);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
@@ -10934,7 +10110,7 @@ corder_transition(hid_t fapl)
/* Delete several links from group, until it resumes compact form */
for(u = max_compact; u >= min_dense; u--) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify state of group */
@@ -10948,7 +10124,7 @@ corder_transition(hid_t fapl)
} /* end for */
/* Delete another link, to push group into compact form */
- sprintf(objname, "filler %u", (min_dense - 1));
+ HDsnprintf(objname, sizeof(objname), "filler %u", (min_dense - 1));
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify state of group */
@@ -10959,7 +10135,7 @@ corder_transition(hid_t fapl)
/* Re-add links to get back into dense form */
for(u = (min_dense - 1); u < (max_compact + 1); u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
} /* end for */
@@ -10979,7 +10155,6 @@ corder_transition(hid_t fapl)
/* Close the file */
if(H5Fclose(file_id) < 0) TEST_ERROR
-
/* Re-open the file */
if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
@@ -10997,7 +10172,7 @@ corder_transition(hid_t fapl)
/* Delete several links from group, until it resumes compact form */
for(u = max_compact; u >= min_dense; u--) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify state of group */
@@ -11011,7 +10186,7 @@ corder_transition(hid_t fapl)
} /* end for */
/* Delete another link, to push group into compact form */
- sprintf(objname, "filler %u", (min_dense - 1));
+ HDsnprintf(objname, sizeof(objname), "filler %u", (min_dense - 1));
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify state of group */
@@ -11022,7 +10197,7 @@ corder_transition(hid_t fapl)
/* Re-add links to get back into dense form */
for(u = (min_dense - 1); u < (max_compact + 1); u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
} /* end for */
@@ -11038,10 +10213,10 @@ corder_transition(hid_t fapl)
/* Delete all the links */
for(u = max_compact; u > 0; u--) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
} /* end for */
- sprintf(objname, "filler %u", (unsigned)0);
+ HDsnprintf(objname, sizeof(objname), "filler %u", (unsigned)0);
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
/* Close the group */
@@ -11055,7 +10230,7 @@ corder_transition(hid_t fapl)
if(file_size != empty_size) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -11063,10 +10238,10 @@ error:
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end corder_transition() */
-
+
/*-------------------------------------------------------------------------
* Function: corder_delete
*
@@ -11076,25 +10251,21 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, October 30, 2006
- *
*-------------------------------------------------------------------------
*/
static int
corder_delete(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1, group_id2 = -1; /* Group IDs */
+ hid_t gcpl_id = -1; /* Group creation property list ID */
unsigned max_compact; /* Maximum # of links to store in group compactly */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
hsize_t name_count; /* # of records in name index */
hsize_t corder_count; /* # of records in creation order index */
unsigned reopen_file; /* Whether to re-open the file before deleting group */
- h5_stat_size_t empty_size; /* Size of empty file */
- h5_stat_size_t file_size; /* Size of file after operating on it */
+ h5_stat_size_t empty_size; /* Size of empty file */
+ h5_stat_size_t file_size; /* Size of file after operating on it */
char objname[NAME_BUF_SIZE]; /* Object name */
char filename[NAME_BUF_SIZE];/* File name */
unsigned u; /* Local index variable */
@@ -11107,7 +10278,7 @@ corder_delete(hid_t fapl)
/* Create file */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- /* Creating file with latest format will enable paged aggregation with persistent fs */
+ /* Creating file with latest format will enable paged aggregation with persistent fs */
if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Close file */
@@ -11141,7 +10312,7 @@ corder_delete(hid_t fapl)
/* Create links until the group is in dense form */
for(u = 0; u < max_compact * 2; u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Gclose(group_id2) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -11184,7 +10355,7 @@ corder_delete(hid_t fapl)
} /* end for */
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -11192,25 +10363,21 @@ error:
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end corder_delete() */
-
+
/*-------------------------------------------------------------------------
* Function: link_info_by_idx_check
*
* Purpose: Support routine for link_info_by_idx, to verify the link
* info is correct for a link
*
- * Note: This routine assumes that the links have been inserted in the
+ * Note: This routine assumes that the links have been inserted in the
* group in alphabetical order.
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Tuesday, November 7, 2006
- *
*-------------------------------------------------------------------------
*/
static int
@@ -11223,7 +10390,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n,
H5L_info_t linfo; /* Link info struct */
/* Make link value for increasing/native order queries */
- sprintf(valname, "value %02u", (unsigned)n);
+ HDsnprintf(valname, sizeof(valname), "value %02u", (unsigned)n);
/* Verify the link information for first link, in increasing creation order */
HDmemset(&linfo, 0, sizeof(linfo));
@@ -11354,7 +10521,7 @@ error:
return(-1);
} /* end link_info_by_idx_check() */
-
+
/*-------------------------------------------------------------------------
* Function: link_info_by_idx
*
@@ -11363,18 +10530,14 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, November 6, 2006
- *
*-------------------------------------------------------------------------
*/
static int
link_info_by_idx(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1); /* Group ID */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1; /* Group ID */
+ hid_t gcpl_id = -1; /* Group creation property list ID */
unsigned hard_link; /* Create hard or soft link? */
unsigned use_index; /* Use index on creation order values */
unsigned max_compact; /* Maximum # of links to store in group compactly */
@@ -11434,11 +10597,11 @@ link_info_by_idx(hid_t fapl)
/* Create several links, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Check for creating hard or soft link */
if(hard_link) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -11446,7 +10609,7 @@ link_info_by_idx(hid_t fapl)
} /* end if */
else {
/* Make value for link */
- sprintf(valname, "value %02u", u);
+ HDsnprintf(valname, sizeof(valname), "value %02u", u);
/* Create soft link */
if(H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -11476,11 +10639,11 @@ link_info_by_idx(hid_t fapl)
/* Create more links, to push group into dense form */
for(; u < (max_compact * 2); u++) {
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Check for creating hard or soft link */
if(hard_link) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -11488,7 +10651,7 @@ link_info_by_idx(hid_t fapl)
} /* end if */
else {
/* Make value for link */
- sprintf(valname, "value %02u", u);
+ HDsnprintf(valname, sizeof(valname), "value %02u", u);
/* Create soft link */
if(H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -11528,7 +10691,7 @@ link_info_by_idx(hid_t fapl)
} /* end for */
} /* end for */
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -11536,10 +10699,10 @@ error:
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end link_info_by_idx() */
-
+
/*-------------------------------------------------------------------------
* Function: link_info_by_idx_old
*
@@ -11548,17 +10711,13 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Tuesday, November 7, 2006
- *
*-------------------------------------------------------------------------
*/
static int
link_info_by_idx_old(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1, group_id2 = -1; /* Group IDs */
unsigned hard_link; /* Create hard or soft link? */
H5L_info_t linfo; /* Link info struct */
char objname[NAME_BUF_SIZE]; /* Object name */
@@ -11588,7 +10747,7 @@ link_info_by_idx_old(hid_t fapl)
/* Create several links */
for(u = 0; u < CORDER_NLINKS; u++) {
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Check for creating hard or soft link */
if(hard_link) {
@@ -11606,7 +10765,7 @@ link_info_by_idx_old(hid_t fapl)
} /* end if */
else {
/* Make value for link */
- sprintf(valname, "value %02u", u);
+ HDsnprintf(valname, sizeof(valname), "value %02u", u);
/* Create soft link */
if(H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -11618,10 +10777,10 @@ link_info_by_idx_old(hid_t fapl)
unsigned dec_u = CORDER_NLINKS - (u + 1); /* Decreasing mapped index */
/* Make link name for increasing/native order queries */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Make link value for increasing/native order queries */
- sprintf(valname, "value %02u", u);
+ HDsnprintf(valname, sizeof(valname), "value %02u", u);
/* Verify link information (in increasing order) */
if(hard_link) {
@@ -11654,10 +10813,10 @@ link_info_by_idx_old(hid_t fapl)
/* Make link name for decreasing order queries */
- sprintf(objname, "filler %02u", dec_u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
/* Make link value for decreasing order queries */
- sprintf(valname, "value %02u", dec_u);
+ HDsnprintf(valname, sizeof(valname), "value %02u", dec_u);
/* Verify link information (in decreasing order) */
if(hard_link) {
@@ -11696,17 +10855,17 @@ link_info_by_idx_old(hid_t fapl)
PASSED();
} /* end for */
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end link_info_by_idx_old() */
-
+
/*-------------------------------------------------------------------------
* Function: delete_by_idx
*
@@ -11715,19 +10874,15 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Tuesday, November 14, 2006
- *
*-------------------------------------------------------------------------
*/
static int
delete_by_idx(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1); /* Group ID */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
- H5_index_t idx_type; /* Type of index to operate on */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1; /* Group ID */
+ hid_t gcpl_id = -1; /* Group creation property list ID */
+ H5_index_t idx_type; /* Type of index to operate on */
H5_iter_order_t order; /* Order within in the index */
unsigned use_index; /* Use index on creation order values */
unsigned max_compact; /* Maximum # of links to store in group compactly */
@@ -11791,10 +10946,8 @@ delete_by_idx(hid_t fapl)
/* Query the group creation properties */
if(H5Pget_link_phase_change(gcpl_id, &max_compact, &min_dense) < 0) TEST_ERROR
-
/* Delete links from one end */
-
/* Check for deletion on empty group */
H5E_BEGIN_TRY {
ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT);
@@ -11809,10 +10962,10 @@ delete_by_idx(hid_t fapl)
/* Create several links, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -11850,9 +11003,9 @@ delete_by_idx(hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", (u + 1));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
- sprintf(objname, "filler %02u", (max_compact - (u + 2)));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2)));
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -11864,10 +11017,10 @@ delete_by_idx(hid_t fapl)
/* Create more links, to push group into dense form */
for(u = 0; u < (max_compact * 2); u++) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -11906,9 +11059,9 @@ delete_by_idx(hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", (u + 1));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
- sprintf(objname, "filler %02u", ((max_compact * 2) - (u + 2)));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2)));
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -11925,16 +11078,14 @@ delete_by_idx(hid_t fapl)
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
-
/* Delete links in middle */
-
/* Create more links, to push group into dense form */
for(u = 0; u < (max_compact * 2); u++) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -11967,9 +11118,9 @@ delete_by_idx(hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", ((u * 2) + 1));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
else
- sprintf(objname, "filler %02u", ((max_compact * 2) - ((u * 2) + 2)));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 2)));
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -11992,9 +11143,9 @@ delete_by_idx(hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", ((u * 2) + 3));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
else
- sprintf(objname, "filler %02u", ((max_compact * 2) - ((u * 2) + 4)));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 4)));
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -12005,8 +11156,6 @@ delete_by_idx(hid_t fapl)
if(H5G__has_links_test(group_id, NULL) == TRUE) TEST_ERROR
if(H5G__is_new_dense_test(group_id) == TRUE) TEST_ERROR
-
-
/* Close the group */
if(H5Gclose(group_id) < 0) TEST_ERROR
@@ -12021,7 +11170,7 @@ delete_by_idx(hid_t fapl)
} /* end for */
} /* end for */
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -12029,10 +11178,10 @@ error:
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end delete_by_idx() */
-
+
/*-------------------------------------------------------------------------
* Function: delete_by_idx_old
*
@@ -12041,17 +11190,13 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Wednesday, November 15, 2006
- *
*-------------------------------------------------------------------------
*/
static int
delete_by_idx_old(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1, group_id2 = -1; /* Group IDs */
H5L_info_t linfo; /* Link info struct */
H5_iter_order_t order; /* Order within in the index */
char objname[NAME_BUF_SIZE]; /* Object name */
@@ -12076,10 +11221,8 @@ delete_by_idx_old(hid_t fapl)
/* Create group to operate on */
if((group_id = H5Gcreate2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
-
/* Delete links from one end */
-
/* Check for deletion in empty group */
H5E_BEGIN_TRY {
ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT);
@@ -12091,7 +11234,7 @@ delete_by_idx_old(hid_t fapl)
H5O_info_t oi; /* Buffer for querying object's info */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create group */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -12137,9 +11280,9 @@ delete_by_idx_old(hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", (u + 1));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
- sprintf(objname, "filler %02u", dec_u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -12155,16 +11298,14 @@ delete_by_idx_old(hid_t fapl)
/* Verify state of group */
if(H5G__has_stab_test(group_id) != TRUE) TEST_ERROR
-
/* Delete links in middle */
-
/* Create several links */
for(u = 0; u < CORDER_NLINKS; u++) {
H5O_info_t oi; /* Buffer for querying object's info */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create group */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -12198,9 +11339,9 @@ delete_by_idx_old(hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", ((u * 2) + 1));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
else
- sprintf(objname, "filler %02u", dec_u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -12225,9 +11366,9 @@ delete_by_idx_old(hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", ((u * 2) + 3));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
else
- sprintf(objname, "filler %02u", dec_u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -12246,7 +11387,7 @@ delete_by_idx_old(hid_t fapl)
PASSED();
} /* end for */
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -12254,10 +11395,10 @@ error:
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end delete_by_idx_old() */
-
+
/*-------------------------------------------------------------------------
* Function: link_iterate_cb
*
@@ -12265,10 +11406,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, November 20, 2006
- *
*-------------------------------------------------------------------------
*/
static int
@@ -12277,14 +11414,14 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info_t *info,
{
link_iter_info_t *op_data = (link_iter_info_t *)_op_data; /* User data */
char objname[NAME_BUF_SIZE]; /* Object name */
- H5L_info_t my_info; /* Local link info */
+ H5L_info_t my_info; /* Local link info */
/* Increment # of times the callback was called */
op_data->ncalled++;
/* Get the link information directly to compare */
if(H5Lget_info(group_id, link_name, &my_info, H5P_DEFAULT) < 0)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
/* Check more things for link iteration (vs. group iteration) */
if(info) {
@@ -12292,31 +11429,31 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info_t *info,
/* (if we are operating in increasing or decreasing order) */
if(op_data->order != H5_ITER_NATIVE)
if(info->corder != op_data->curr)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
/* Compare link info structs */
if(info->type != my_info.type)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
if(info->corder_valid != my_info.corder_valid)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
if(info->corder != my_info.corder)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
if(info->cset != my_info.cset)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
if(H5F_addr_ne(info->u.address, my_info.u.address))
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
} /* end if */
/* Verify name of link */
- sprintf(objname, "filler %02u", (unsigned)my_info.corder);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (unsigned)my_info.corder);
if(HDstrcmp(link_name, objname))
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
/* Check if we've visited this link before */
if((size_t)op_data->curr >= op_data->max_visit)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
if(op_data->visited[op_data->curr])
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
op_data->visited[op_data->curr] = TRUE;
/* Advance to next value, in correct direction */
@@ -12328,13 +11465,13 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info_t *info,
/* Check for stopping in the middle of iterating */
if(op_data->stop > 0)
if(--op_data->stop == 0)
- return(CORDER_ITER_STOP);
+ return CORDER_ITER_STOP;
- return(H5_ITER_CONT);
+ return H5_ITER_CONT;
} /* end link_iterate_cb() */
#ifndef H5_NO_DEPRECATED_SYMBOLS
-
+
/*-------------------------------------------------------------------------
* Function: group_iterate_cb
*
@@ -12343,20 +11480,16 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info_t *info,
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, November 20, 2006
- *
*-------------------------------------------------------------------------
*/
static int
group_iterate_cb(hid_t group_id, const char *link_name, void *_op_data)
{
- return(link_iterate_cb(group_id, link_name, NULL, _op_data));
+ return link_iterate_cb(group_id, link_name, NULL, _op_data);
} /* end group_iterate_cb() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
+
/*-------------------------------------------------------------------------
* Function: link_iterate_fail_cb
*
@@ -12365,20 +11498,16 @@ group_iterate_cb(hid_t group_id, const char *link_name, void *_op_data)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, November 20, 2006
- *
*-------------------------------------------------------------------------
*/
static int
link_iterate_fail_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *link_name,
const H5L_info_t H5_ATTR_UNUSED *info, void H5_ATTR_UNUSED *_op_data)
{
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
} /* end link_iterate_fail_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: link_iterate_check
*
@@ -12386,10 +11515,6 @@ link_iterate_fail_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *l
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, November 20, 2006
- *
*-------------------------------------------------------------------------
*/
static int
@@ -12417,7 +11542,6 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
for(v = 0; v < max_links; v++)
if(iter_info->visited[v] == FALSE) TEST_ERROR
-
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Iterate over links in group, with H5Giterate */
iter_info->nskipped = (unsigned)(gskip = 0);
@@ -12434,7 +11558,6 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
if(iter_info->visited[v] == FALSE) TEST_ERROR
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
/* Skip over some links in group */
iter_info->nskipped = (unsigned)(skip = max_links / 2);
iter_info->order = order;
@@ -12465,7 +11588,6 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
if(nvisit != (max_links / 2)) TEST_ERROR
} /* end else */
-
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Skip over some links in group, with H5Giterate */
iter_info->nskipped = (unsigned)(gskip = (int)(max_links / 2));
@@ -12498,7 +11620,6 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
} /* end else */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
/* Iterate over links in group, stopping in the middle */
iter_info->nskipped = (unsigned)(skip = 0);
iter_info->order = order;
@@ -12510,7 +11631,6 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
if(ret != CORDER_ITER_STOP) TEST_ERROR
if(iter_info->ncalled != 3) TEST_ERROR
-
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Iterate over links in group, stopping in the middle, with H5Giterate() */
iter_info->nskipped = (unsigned)(gskip = 0);
@@ -12524,7 +11644,6 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
if(iter_info->ncalled != 3) TEST_ERROR
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
/* Check for iteration routine indicating failure */
skip = 0;
H5E_BEGIN_TRY {
@@ -12533,13 +11652,13 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
if(ret >= 0) TEST_ERROR
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* end link_iterate_check() */
-
+
/*-------------------------------------------------------------------------
* Function: link_iterate
*
@@ -12557,9 +11676,9 @@ error:
static int
link_iterate(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1); /* Group ID */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
+ hid_t file_id = (-1); /* File ID */
+ hid_t group_id = (-1); /* Group ID */
+ hid_t gcpl_id = (-1); /* Group creation property list ID */
H5_index_t idx_type; /* Type of index to operate on */
H5_iter_order_t order; /* Order within in the index */
unsigned use_index; /* Use index on creation order values */
@@ -12644,17 +11763,16 @@ link_iterate(hid_t fapl)
/* Create group with creation order tracking on */
if((group_id = H5Gcreate2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR
-
/* Check for iteration on empty group */
/* (should be OK) */
if(H5Literate(group_id, idx_type, order, NULL, link_iterate_cb, NULL) < 0) TEST_ERROR
/* Create several links, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -12674,13 +11792,12 @@ link_iterate(hid_t fapl)
/* Test iteration over links in compact group */
if(link_iterate_check(group_id, idx_type, order, u, &iter_info) < 0) TEST_ERROR
-
/* Create more links, to push group into dense form */
for(; u < (max_compact * 2); u++) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -12719,7 +11836,7 @@ link_iterate(hid_t fapl)
if(visited)
HDfree(visited);
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -12732,10 +11849,10 @@ error:
if(visited)
HDfree(visited);
- return -1;
+ return FAIL;
} /* end link_iterate() */
-
+
/*-------------------------------------------------------------------------
* Function: link_iterate_old_cb
*
@@ -12743,52 +11860,47 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, November 20, 2006
- *
*-------------------------------------------------------------------------
*/
static int
-link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info_t *info,
- void *_op_data)
+link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info_t *info, void *_op_data)
{
link_iter_info_t *op_data = (link_iter_info_t *)_op_data; /* User data */
char objname[NAME_BUF_SIZE]; /* Object name */
- H5L_info_t my_info; /* Local link info */
+ H5L_info_t my_info; /* Local link info */
/* Increment # of times the callback was called */
op_data->ncalled++;
/* Get the link information directly to compare */
if(H5Lget_info(group_id, link_name, &my_info, H5P_DEFAULT) < 0)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
/* Check more things for link iteration (vs. group iteration) */
if(info) {
/* Compare link info structs */
if(info->type != my_info.type)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
if(info->corder_valid != my_info.corder_valid)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
if(info->corder != my_info.corder)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
if(info->cset != my_info.cset)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
if(H5F_addr_ne(info->u.address, my_info.u.address))
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
} /* end if */
/* Verify name of link */
- sprintf(objname, "filler %02u", (info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped)));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped)));
if(HDstrcmp(link_name, objname))
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
/* Check if we've visited this link before */
if((size_t)op_data->curr >= op_data->max_visit)
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
if(op_data->visited[op_data->curr])
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
op_data->visited[op_data->curr] = TRUE;
/* Advance to next value, in correct direction */
@@ -12800,13 +11912,13 @@ link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info_t *inf
/* Check for stopping in the middle of iterating */
if(op_data->stop > 0)
if(--op_data->stop == 0)
- return(CORDER_ITER_STOP);
+ return CORDER_ITER_STOP;
- return(H5_ITER_CONT);
+ return H5_ITER_CONT;
} /* end link_iterate_old_cb() */
#ifndef H5_NO_DEPRECATED_SYMBOLS
-
+
/*-------------------------------------------------------------------------
* Function: group_iterate_old_cb
*
@@ -12815,20 +11927,16 @@ link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info_t *inf
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, November 20, 2006
- *
*-------------------------------------------------------------------------
*/
static int
group_iterate_old_cb(hid_t group_id, const char *link_name, void *_op_data)
{
- return(link_iterate_old_cb(group_id, link_name, NULL, _op_data));
+ return link_iterate_old_cb(group_id, link_name, NULL, _op_data);
} /* end group_iterate_old_cb() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
+
/*-------------------------------------------------------------------------
* Function: link_iterate_old_check
*
@@ -12836,15 +11944,10 @@ group_iterate_old_cb(hid_t group_id, const char *link_name, void *_op_data)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, November 20, 2006
- *
*-------------------------------------------------------------------------
*/
static int
-link_iterate_old_check(hid_t group_id, H5_iter_order_t order,
- unsigned max_links, link_iter_info_t *iter_info)
+link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links, link_iter_info_t *iter_info)
{
unsigned v; /* Local index variable */
hsize_t skip; /* # of links to skip in group */
@@ -12867,7 +11970,6 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order,
for(v = 0; v < max_links; v++)
if(iter_info->visited[v] == FALSE) TEST_ERROR
-
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Iterate over links in group, with H5Giterate */
iter_info->nskipped = (unsigned)(gskip = 0);
@@ -12884,7 +11986,6 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order,
if(iter_info->visited[v] == FALSE) TEST_ERROR
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
/* Skip over some links in group */
iter_info->nskipped = (unsigned)(skip = max_links / 2);
iter_info->order = order;
@@ -12915,7 +12016,6 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order,
if(nvisit != (max_links / 2)) TEST_ERROR
} /* end else */
-
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Skip over some links in group, with H5Giterate */
iter_info->nskipped = (unsigned)(gskip = (int)(max_links / 2));
@@ -12948,7 +12048,6 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order,
} /* end else */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
/* Iterate over links in group, stopping in the middle */
iter_info->nskipped = (unsigned)(skip = 0);
iter_info->order = order;
@@ -12960,7 +12059,6 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order,
if(ret != CORDER_ITER_STOP) TEST_ERROR
if(iter_info->ncalled != 3) TEST_ERROR
-
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Iterate over links in group, stopping in the middle, with H5Giterate() */
iter_info->nskipped = (unsigned)(gskip = 0);
@@ -12974,7 +12072,6 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order,
if(iter_info->ncalled != 3) TEST_ERROR
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
/* Check for iteration routine indicating failure */
skip = 0;
H5E_BEGIN_TRY {
@@ -12997,13 +12094,13 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order,
#endif /* H5_NO_DEPRECATED_SYMBOLS */
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* end link_iterate_old_check() */
-
+
/*-------------------------------------------------------------------------
* Function: link_iterate_old
*
@@ -13011,17 +12108,13 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Tuesday, November 14, 2006
- *
*-------------------------------------------------------------------------
*/
static int
link_iterate_old(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1); /* Group ID */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1; /* Group ID */
H5_iter_order_t order; /* Order within in the index */
char objname[NAME_BUF_SIZE]; /* Object name */
char filename[NAME_BUF_SIZE];/* File name */
@@ -13057,17 +12150,16 @@ link_iterate_old(hid_t fapl)
/* Create group with creation order tracking on */
if((group_id = H5Gcreate2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
-
/* Check for iteration on empty group */
/* (should be OK) */
if(H5Literate(group_id, H5_INDEX_NAME, order, NULL, link_iterate_old_cb, NULL) < 0) TEST_ERROR
/* Create several links */
for(u = 0; u < CORDER_NLINKS; u++) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13095,7 +12187,6 @@ link_iterate_old(hid_t fapl)
/* Test iteration over links in group */
if(link_iterate_old_check(group_id, order, u, &iter_info) < 0) TEST_ERROR
-
/* Close the group */
if(H5Gclose(group_id) < 0) TEST_ERROR
@@ -13109,7 +12200,7 @@ link_iterate_old(hid_t fapl)
if(visited)
HDfree(visited);
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -13121,10 +12212,10 @@ error:
if(visited)
HDfree(visited);
- return -1;
+ return FAIL;
} /* end link_iterate_old() */
-
+
/*-------------------------------------------------------------------------
* Function: open_by_idx_check
*
@@ -13132,19 +12223,14 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Tuesday, November 21, 2006
- *
*-------------------------------------------------------------------------
*/
static int
open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
- H5_index_t idx_type, H5_iter_order_t order, unsigned max_links,
- haddr_t *objno)
+ H5_index_t idx_type, H5_iter_order_t order, unsigned max_links, haddr_t *objno)
{
char mntname[NAME_BUF_SIZE]; /* Link value */
- hid_t group_id = (-1); /* ID of group to test */
+ hid_t group_id = -1; /* ID of group to test */
H5O_info_t oi; /* Buffer for querying object's info */
haddr_t mnt_root_addr; /* Address of root group in file to mount */
hid_t obj_id; /* ID of object opened */
@@ -13185,10 +12271,7 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
} /* end for */
} /* end for */
-
- /*
- * Verify opening correct object by index when file mounting is present
- */
+ /* Verify opening correct object by index when file mounting is present */
/* Get the address of the root group in the file to mount */
if(H5Oget_info2(mount_file_id, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
@@ -13196,7 +12279,7 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
/* Mount a file over a group in main group */
mnt_idx = 2;
- sprintf(mntname, "/%s/filler %02u", CORDER_GROUP_NAME, mnt_idx);
+ HDsnprintf(mntname, sizeof(mntname), "/%s/filler %02u", CORDER_GROUP_NAME, mnt_idx);
if(H5Fmount(main_group_id, mntname, mount_file_id, H5P_DEFAULT) < 0) TEST_ERROR
/* Open the object that the file is mounted on */
@@ -13215,15 +12298,14 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
/* Unmount the file */
if(H5Funmount(main_group_id, mntname) < 0) TEST_ERROR
-
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* end open_by_idx_check() */
-
+
/*-------------------------------------------------------------------------
* Function: open_by_idx
*
@@ -13232,21 +12314,17 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Tuesday, November 21, 2006
- *
*-------------------------------------------------------------------------
*/
static int
open_by_idx(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t mount_file_id = (-1); /* File ID for file to mount */
- hid_t group_id = (-1); /* Group ID */
- hid_t soft_group_id = (-1); /* Group ID for soft links */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
- H5_index_t idx_type; /* Type of index to operate on */
+ hid_t file_id = -1; /* File ID */
+ hid_t mount_file_id = -1; /* File ID for file to mount */
+ hid_t group_id = -1; /* Group ID */
+ hid_t soft_group_id = -1; /* Group ID for soft links */
+ hid_t gcpl_id = -1; /* Group creation property list ID */
+ H5_index_t idx_type; /* Type of index to operate on */
H5_iter_order_t order; /* Order within in the index */
unsigned use_index; /* Use index on creation order values */
unsigned max_compact; /* Maximum # of links to store in group compactly */
@@ -13254,7 +12332,7 @@ open_by_idx(hid_t fapl)
H5O_info_t oi; /* Buffer for querying object's info */
char filename[NAME_BUF_SIZE];/* File name */
char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
haddr_t *objno = NULL; /* Addresses of the objects created */
unsigned u; /* Local index variable */
hid_t ret; /* Generic return value */
@@ -13335,20 +12413,18 @@ open_by_idx(hid_t fapl)
/* Create group with creation order tracking on for soft links */
if((soft_group_id = H5Gcreate2(file_id, CORDER_SOFT_GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR
-
/* Try to open on object in an empty group */
H5E_BEGIN_TRY {
ret = H5Oopen_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
-
/* Create several links, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13361,7 +12437,7 @@ open_by_idx(hid_t fapl)
if(H5Gclose(group_id2) < 0) TEST_ERROR
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
} /* end for */
@@ -13377,13 +12453,12 @@ open_by_idx(hid_t fapl)
/* Verify opening objects by index */
if(open_by_idx_check(group_id, soft_group_id, mount_file_id, idx_type, order, u, objno) < 0) TEST_ERROR
-
/* Create more links, to push group into dense form */
for(; u < (max_compact * 2); u++) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13396,7 +12471,7 @@ open_by_idx(hid_t fapl)
if(H5Gclose(group_id2) < 0) TEST_ERROR
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
} /* end for */
@@ -13412,7 +12487,6 @@ open_by_idx(hid_t fapl)
/* Verify opening objects by index */
if(open_by_idx_check(group_id, soft_group_id, mount_file_id, idx_type, order, u, objno) < 0) TEST_ERROR
-
/* Close the groups */
if(H5Gclose(group_id) < 0) TEST_ERROR
if(H5Gclose(soft_group_id) < 0) TEST_ERROR
@@ -13435,7 +12509,7 @@ open_by_idx(hid_t fapl)
if(objno)
HDfree(objno);
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -13450,10 +12524,10 @@ error:
if(objno)
HDfree(objno);
- return -1;
+ return FAIL;
} /* end open_by_idx() */
-
+
/*-------------------------------------------------------------------------
* Function: open_by_idx_old
*
@@ -13462,24 +12536,20 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Tuesday, November 21, 2006
- *
*-------------------------------------------------------------------------
*/
static int
open_by_idx_old(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t mount_file_id = (-1); /* File ID for file to mount */
- hid_t group_id = (-1); /* Group ID */
- hid_t soft_group_id = (-1); /* Group ID for soft links */
+ hid_t file_id = -1; /* File ID */
+ hid_t mount_file_id = -1; /* File ID for file to mount */
+ hid_t group_id = -1; /* Group ID */
+ hid_t soft_group_id = -1; /* Group ID for soft links */
H5_iter_order_t order; /* Order within in the index */
H5O_info_t oi; /* Buffer for querying object's info */
char filename[NAME_BUF_SIZE];/* File name */
char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */
unsigned u; /* Local index variable */
hid_t ret; /* Generic return value */
@@ -13519,13 +12589,12 @@ open_by_idx_old(hid_t fapl)
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
-
/* Create several links */
for(u = 0; u < CORDER_NLINKS; u++) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13538,7 +12607,7 @@ open_by_idx_old(hid_t fapl)
if(H5Gclose(group_id2) < 0) TEST_ERROR
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
} /* end for */
@@ -13560,7 +12629,6 @@ open_by_idx_old(hid_t fapl)
/* Verify opening objects by index */
if(open_by_idx_check(group_id, soft_group_id, mount_file_id, H5_INDEX_NAME, order, u, objno) < 0) TEST_ERROR
-
/* Close the groups */
if(H5Gclose(group_id) < 0) TEST_ERROR
if(H5Gclose(soft_group_id) < 0) TEST_ERROR
@@ -13574,7 +12642,7 @@ open_by_idx_old(hid_t fapl)
/* Close the file for mounting */
if(H5Fclose(mount_file_id) < 0) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -13585,10 +12653,10 @@ error:
H5Fclose(mount_file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end open_by_idx_old() */
-
+
/*-------------------------------------------------------------------------
* Function: object_info_check
*
@@ -13596,10 +12664,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Sunday, November 26, 2006
- *
*-------------------------------------------------------------------------
*/
static int
@@ -13607,7 +12671,7 @@ object_info_check(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type,
H5_iter_order_t order, unsigned max_links, haddr_t *objno)
{
char objname[NAME_BUF_SIZE]; /* Object name */
- hid_t group_id = (-1); /* ID of group to test */
+ hid_t group_id = -1; /* ID of group to test */
H5O_info_t oinfo; /* Buffer for querying object's info */
unsigned u, v; /* Local index variables */
@@ -13622,7 +12686,7 @@ object_info_check(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type,
/* Open each object in group by name and check that it's the correct one */
for(u = 0; u < max_links; u++) {
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Query the object's information, by name */
if(H5Oget_info_by_name2(group_id, objname, &oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS, H5P_DEFAULT) < 0) TEST_ERROR
@@ -13653,13 +12717,13 @@ object_info_check(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type,
} /* end for */
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* end object_info_check() */
-
+
/*-------------------------------------------------------------------------
* Function: object_info
*
@@ -13668,21 +12732,17 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Sunday, November 26, 2006
- *
*-------------------------------------------------------------------------
*/
static int
object_info(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1); /* Group ID */
- hid_t soft_group_id = (-1); /* Group ID for soft links */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
- hid_t space_id = (-1); /* Dataspace ID (for attributes) */
- H5_index_t idx_type; /* Type of index to operate on */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1; /* Group ID */
+ hid_t soft_group_id = -1; /* Group ID for soft links */
+ hid_t gcpl_id = -1; /* Group creation property list ID */
+ hid_t space_id = -1; /* Dataspace ID (for attributes) */
+ H5_index_t idx_type; /* Type of index to operate on */
H5_iter_order_t order; /* Order within in the index */
unsigned use_index; /* Use index on creation order values */
unsigned max_compact; /* Maximum # of links to store in group compactly */
@@ -13690,7 +12750,7 @@ object_info(hid_t fapl)
H5O_info_t oinfo; /* Buffer for querying object's info */
char filename[NAME_BUF_SIZE];/* File name */
char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
char attrname[NAME_BUF_SIZE]; /* Attribute name */
haddr_t *objno = NULL; /* Addresses of the objects created */
herr_t ret; /* Generic return value */
@@ -13780,11 +12840,11 @@ object_info(hid_t fapl)
/* Create several links, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
hid_t attr_id; /* Attribute ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13796,7 +12856,7 @@ object_info(hid_t fapl)
/* Create attributes on new object */
for(v = 0; v < u; v++) {
/* Make name for attribute */
- sprintf(attrname, "attr %02u", v);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", v);
/* Create attribute */
if((attr_id = H5Acreate2(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13809,7 +12869,7 @@ object_info(hid_t fapl)
if(H5Gclose(group_id2) < 0) TEST_ERROR
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
} /* end for */
@@ -13828,11 +12888,11 @@ object_info(hid_t fapl)
/* Create more links, to push group into dense form */
for(; u < (max_compact * 2); u++) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
hid_t attr_id; /* Attribute ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13844,7 +12904,7 @@ object_info(hid_t fapl)
/* Create attributes on new object */
for(v = 0; v < u; v++) {
/* Make name for attribute */
- sprintf(attrname, "attr %02u", v);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", v);
/* Create attribute */
if((attr_id = H5Acreate2(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13857,7 +12917,7 @@ object_info(hid_t fapl)
if(H5Gclose(group_id2) < 0) TEST_ERROR
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
} /* end for */
@@ -13892,7 +12952,7 @@ object_info(hid_t fapl)
if(objno)
HDfree(objno);
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -13907,10 +12967,10 @@ error:
if(objno)
HDfree(objno);
- return -1;
+ return FAIL;
} /* end object_info() */
-
+
/*-------------------------------------------------------------------------
* Function: object_info_old
*
@@ -13918,24 +12978,20 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Sunday, November 26, 2006
- *
*-------------------------------------------------------------------------
*/
static int
object_info_old(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1); /* Group ID */
- hid_t soft_group_id = (-1); /* Group ID for soft links */
- hid_t space_id = (-1); /* Dataspace ID (for attributes) */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1; /* Group ID */
+ hid_t soft_group_id = -1; /* Group ID for soft links */
+ hid_t space_id = -1; /* Dataspace ID (for attributes) */
H5_iter_order_t order; /* Order within in the index */
H5O_info_t oinfo; /* Buffer for querying object's info */
char filename[NAME_BUF_SIZE];/* File name */
char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
char attrname[NAME_BUF_SIZE]; /* Attribute name */
haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */
herr_t ret; /* Generic return value */
@@ -13968,7 +13024,6 @@ object_info_old(hid_t fapl)
/* Create old-style group for soft links */
if((soft_group_id = H5Gcreate2(file_id, CORDER_SOFT_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
-
/* Check for out of bound query by index on empty group */
H5E_BEGIN_TRY {
ret = H5Oget_info_by_idx2(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
@@ -13977,11 +13032,11 @@ object_info_old(hid_t fapl)
/* Create several links */
for(u = 0; u < CORDER_NLINKS; u++) {
- hid_t group_id2; /* Group ID */
+ hid_t group_id2; /* Group ID */
hid_t attr_id; /* Attribute ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13993,7 +13048,7 @@ object_info_old(hid_t fapl)
/* Create attributes on new object */
for(v = 0; v < u; v++) {
/* Make name for attribute */
- sprintf(attrname, "attr %02u", v);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", v);
/* Create attribute */
if((attr_id = H5Acreate2(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -14006,7 +13061,7 @@ object_info_old(hid_t fapl)
if(H5Gclose(group_id2) < 0) TEST_ERROR
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
} /* end for */
@@ -14028,7 +13083,6 @@ object_info_old(hid_t fapl)
/* Verify querying objects by name */
if(object_info_check(group_id, soft_group_id, H5_INDEX_NAME, order, u, objno) < 0) TEST_ERROR
-
/* Close the groups */
if(H5Gclose(group_id) < 0) TEST_ERROR
if(H5Gclose(soft_group_id) < 0) TEST_ERROR
@@ -14042,7 +13096,7 @@ object_info_old(hid_t fapl)
/* Free resources */
if(H5Sclose(space_id) < 0) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -14053,10 +13107,10 @@ error:
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end object_info_old() */
-
+
/*-------------------------------------------------------------------------
* Function: group_info
*
@@ -14065,20 +13119,16 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, November 27, 2006
- *
*-------------------------------------------------------------------------
*/
static int
group_info(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1); /* Group ID */
- hid_t soft_group_id = (-1); /* Group ID for soft links */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
- H5_index_t idx_type; /* Type of index to operate on */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1; /* Group ID */
+ hid_t soft_group_id = -1; /* Group ID for soft links */
+ hid_t gcpl_id = -1; /* Group creation property list ID */
+ H5_index_t idx_type; /* Type of index to operate on */
H5_iter_order_t order; /* Order within in the index */
unsigned use_index; /* Use index on creation order values */
unsigned max_compact; /* Maximum # of links to store in group compactly */
@@ -14087,7 +13137,7 @@ group_info(hid_t fapl)
char filename[NAME_BUF_SIZE];/* File name */
char objname[NAME_BUF_SIZE]; /* Object name */
char objname2[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
herr_t ret; /* Generic return value */
unsigned u, v; /* Local index variables */
@@ -14160,7 +13210,6 @@ group_info(hid_t fapl)
/* Create group with creation order tracking on for soft links */
if((soft_group_id = H5Gcreate2(file_id, CORDER_SOFT_GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR
-
/* Check for out of bound query by index on empty group */
H5E_BEGIN_TRY {
ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &grp_info, H5P_DEFAULT);
@@ -14169,15 +13218,14 @@ group_info(hid_t fapl)
/* Create several links, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
- hid_t group_id2, group_id3; /* Group IDs */
+ hid_t group_id2, group_id3; /* Group IDs */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR
-
/* Retrieve group's information */
if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR
@@ -14202,11 +13250,10 @@ group_info(hid_t fapl)
if(grp_info.max_corder != 0) TEST_ERROR
if(grp_info.nlinks != 0) TEST_ERROR
-
/* Create objects in new group created */
for(v = 0; v <= u; v++) {
/* Make name for link */
- sprintf(objname2, "filler %02u", v);
+ HDsnprintf(objname2, sizeof(objname2), "filler %02u", v);
/* Create hard link, with group object */
if((group_id3 = H5Gcreate2(group_id2, objname2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -14215,7 +13262,6 @@ group_info(hid_t fapl)
if(H5Gclose(group_id3) < 0) TEST_ERROR
} /* end for */
-
/* Retrieve group's information */
if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR
@@ -14240,7 +13286,6 @@ group_info(hid_t fapl)
if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
-
/* Retrieve group's information */
if(order != H5_ITER_NATIVE) {
if(order == H5_ITER_INC) {
@@ -14259,7 +13304,6 @@ group_info(hid_t fapl)
/* Close group created */
if(H5Gclose(group_id2) < 0) TEST_ERROR
-
/* Retrieve main group's information */
if(H5Gget_info(group_id, &grp_info) < 0) TEST_ERROR
@@ -14284,9 +13328,8 @@ group_info(hid_t fapl)
if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
-
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Retrieve soft link group's information, by name */
@@ -14307,18 +13350,16 @@ group_info(hid_t fapl)
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
-
/* Create more links, to push group into dense form */
for(; u < (max_compact * 2); u++) {
- hid_t group_id2, group_id3; /* Group IDs */
+ hid_t group_id2, group_id3; /* Group IDs */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR
-
/* Retrieve group's information */
if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR
@@ -14343,11 +13384,10 @@ group_info(hid_t fapl)
if(grp_info.max_corder != 0) TEST_ERROR
if(grp_info.nlinks != 0) TEST_ERROR
-
/* Create objects in new group created */
for(v = 0; v <= u; v++) {
/* Make name for link */
- sprintf(objname2, "filler %02u", v);
+ HDsnprintf(objname2, sizeof(objname2), "filler %02u", v);
/* Create hard link, with group object */
if((group_id3 = H5Gcreate2(group_id2, objname2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -14356,7 +13396,6 @@ group_info(hid_t fapl)
if(H5Gclose(group_id3) < 0) TEST_ERROR
} /* end for */
-
/* Retrieve group's information */
if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR
@@ -14381,7 +13420,6 @@ group_info(hid_t fapl)
if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
-
/* Retrieve group's information */
if(order != H5_ITER_NATIVE) {
if(order == H5_ITER_INC) {
@@ -14400,7 +13438,6 @@ group_info(hid_t fapl)
/* Close group created */
if(H5Gclose(group_id2) < 0) TEST_ERROR
-
/* Retrieve main group's information */
if(H5Gget_info(group_id, &grp_info) < 0) TEST_ERROR
@@ -14425,9 +13462,8 @@ group_info(hid_t fapl)
if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
-
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Retrieve soft link group's information, by name */
@@ -14448,7 +13484,6 @@ group_info(hid_t fapl)
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
-
/* Close the groups */
if(H5Gclose(group_id) < 0) TEST_ERROR
if(H5Gclose(soft_group_id) < 0) TEST_ERROR
@@ -14464,7 +13499,7 @@ group_info(hid_t fapl)
/* Free resources */
if(H5Pclose(gcpl_id) < 0) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -14475,10 +13510,10 @@ error:
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end group_info() */
-
+
/*-------------------------------------------------------------------------
* Function: group_info_old
*
@@ -14487,24 +13522,20 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, November 27, 2006
- *
*-------------------------------------------------------------------------
*/
static int
group_info_old(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1); /* Group ID */
- hid_t soft_group_id = (-1); /* Group ID for soft links */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1; /* Group ID */
+ hid_t soft_group_id = -1; /* Group ID for soft links */
H5_iter_order_t order; /* Order within in the index */
H5G_info_t grp_info; /* Buffer for querying object's info */
char filename[NAME_BUF_SIZE];/* File name */
char objname[NAME_BUF_SIZE]; /* Object name */
char objname2[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
herr_t ret; /* Generic return value */
unsigned u, v; /* Local index variables */
@@ -14531,7 +13562,6 @@ group_info_old(hid_t fapl)
/* Create old-style group for soft links */
if((soft_group_id = H5Gcreate2(file_id, CORDER_SOFT_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
-
/* Check for out of bound query by index on empty group */
H5E_BEGIN_TRY {
ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &grp_info, H5P_DEFAULT);
@@ -14540,15 +13570,14 @@ group_info_old(hid_t fapl)
/* Create several links */
for(u = 0; u < CORDER_NLINKS; u++) {
- hid_t group_id2, group_id3; /* Group IDs */
+ hid_t group_id2, group_id3; /* Group IDs */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
-
/* Retrieve group's information */
if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR
@@ -14573,11 +13602,10 @@ group_info_old(hid_t fapl)
if(grp_info.max_corder != 0) TEST_ERROR
if(grp_info.nlinks != 0) TEST_ERROR
-
/* Create objects in new group created */
for(v = 0; v <= u; v++) {
/* Make name for link */
- sprintf(objname2, "filler %02u", v);
+ HDsnprintf(objname2, sizeof(objname2), "filler %02u", v);
/* Create hard link, with group object */
if((group_id3 = H5Gcreate2(group_id2, objname2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -14586,7 +13614,6 @@ group_info_old(hid_t fapl)
if(H5Gclose(group_id3) < 0) TEST_ERROR
} /* end for */
-
/* Retrieve group's information */
if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR
@@ -14611,7 +13638,6 @@ group_info_old(hid_t fapl)
if(grp_info.max_corder != 0) TEST_ERROR
if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
-
/* Retrieve group's information */
if(order != H5_ITER_NATIVE) {
if(order == H5_ITER_INC) {
@@ -14630,7 +13656,6 @@ group_info_old(hid_t fapl)
/* Close group created */
if(H5Gclose(group_id2) < 0) TEST_ERROR
-
/* Retrieve main group's information */
if(H5Gget_info(group_id, &grp_info) < 0) TEST_ERROR
@@ -14655,9 +13680,8 @@ group_info_old(hid_t fapl)
if(grp_info.max_corder != 0) TEST_ERROR
if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
-
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Retrieve soft link group's information, by name */
@@ -14684,7 +13708,6 @@ group_info_old(hid_t fapl)
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
-
/* Close the groups */
if(H5Gclose(group_id) < 0) TEST_ERROR
if(H5Gclose(soft_group_id) < 0) TEST_ERROR
@@ -14695,7 +13718,7 @@ group_info_old(hid_t fapl)
PASSED();
} /* end for */
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -14705,10 +13728,10 @@ error:
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end group_info_old() */
-
+
/*-------------------------------------------------------------------------
* Function: timestamps
*
@@ -14717,20 +13740,16 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Saturday, March 3, 2007
- *
*-------------------------------------------------------------------------
*/
static int
timestamps(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1); /* Group ID */
- hid_t group_id2 = (-1); /* Group ID */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
- hid_t gcpl_id2 = (-1); /* Group creation property list ID */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1; /* Group ID */
+ hid_t group_id2 = -1; /* Group ID */
+ hid_t gcpl_id = -1; /* Group creation property list ID */
+ hid_t gcpl_id2 = -1; /* Group creation property list ID */
H5O_info_t oinfo, oinfo2; /* Object info for groups created */
char filename[NAME_BUF_SIZE];/* File name */
hbool_t track_times; /* The object timestamp setting */
@@ -14756,7 +13775,6 @@ timestamps(hid_t fapl)
/* Check default timestamp information */
if(track_times != FALSE) TEST_ERROR
-
/* Create file */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -14809,7 +13827,6 @@ timestamps(hid_t fapl)
/* Close the file */
if(H5Fclose(file_id) < 0) TEST_ERROR
-
/* Re-open the file */
if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
@@ -14858,7 +13875,7 @@ timestamps(hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -14868,32 +13885,26 @@ error:
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end timestamps() */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test links
- *
- * Return: Success: exit(EXIT_SUCCESS)
- *
- * Failure: exit(EXIT_FAILURE)
- *
- * Programmer: Robb Matzke
- * Friday, August 14, 1998
+ * Purpose: Test links
*
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*-------------------------------------------------------------------------
*/
int
main(void)
{
- hid_t fapl, fapl2; /* File access property lists */
- int nerrors = 0;
- unsigned new_format; /* Whether to use the new format or not */
- unsigned minimize_dset_oh; /* Whether to minimize dataset object headers */
- unsigned efc; /* Whether to use the external file cache */
+ hid_t fapl = -1, fapl2 = -1; /* File access property lists */
+ int nerrors = 0;
+ unsigned new_format; /* Whether to use the new format or not */
+ unsigned minimize_dset_oh;
+ unsigned efc; /* Whether to use the external file cache */
const char *env_h5_drvr; /* File Driver value from environment */
env_h5_drvr = HDgetenv("HDF5_DRIVER");
@@ -14912,7 +13923,8 @@ main(void)
HDprintf("\n-Testing with minimzed dataset object headers-\n");
dcpl_g = H5Pcreate(H5P_DATASET_CREATE);
if (0 > dcpl_g) TEST_ERROR
- } else {
+ }
+ else {
HDprintf("\n-Testing with unminimzed dataset object headers-\n");
dcpl_g = H5P_DEFAULT;
}
@@ -14924,14 +13936,14 @@ main(void)
if(new_format) {
my_fapl = fapl2;
HDprintf("\n--Testing with 'new format'--\n");
- } else {
+ }
+ else {
my_fapl = fapl;
HDprintf("\n--Testing with 'old format'--\n");
}
/* always enter tests without external cache */
- if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0)
- TEST_ERROR
+ if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0) TEST_ERROR
/* General tests... (on both old & new format groups */
nerrors += mklinks(my_fapl, new_format) < 0 ? 1 : 0;
@@ -14951,29 +13963,28 @@ main(void)
#endif /* H5_NO_DEPRECATED_SYMBOLS */
/* tests for external link */
- /* Test external file cache first, so it sees the default efc setting on
- * the fapl */
+ /* Test external file cache first, so it sees the default efc setting on the fapl
+ */
nerrors += external_file_cache(my_fapl, new_format) < 0 ? 1 : 0;
/* This test cannot run with the EFC because it assumes that an
- * intermediate file is not held open */
+ * intermediate file is not held open
+ */
nerrors += external_link_mult(my_fapl, new_format) < 0 ? 1 : 0;
/* This test cannot run with the EFC because the EFC cannot currently
- * reopen a cached file with a different intent */
+ * reopen a cached file with a different intent
+ */
nerrors += external_set_elink_acc_flags(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
- /* Try external link tests both with and without the external file cache
- */
+ /* Try external link tests both with and without the external file cache */
for(efc = FALSE; efc <= TRUE; efc++) {
if(efc) {
- if(H5Pset_elink_file_cache_size(my_fapl, 8) < 0)
- TEST_ERROR
+ if(H5Pset_elink_file_cache_size(my_fapl, 8) < 0) TEST_ERROR
HDprintf("\n---Testing with external file cache---\n");
} /* end if */
else {
- if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0)
- TEST_ERROR
+ if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0) TEST_ERROR
HDprintf("\n---Testing without external file cache---\n");
} /* end else */
@@ -15020,8 +14031,8 @@ main(void)
nerrors += external_copy_invalid_object(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_dont_fail_to_source(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_open_twice(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_with_committed_datatype(my_fapl, new_format) < 0 ? 1 : 0;
- } /* for with/without external file cache (efc) */
+ nerrors += external_link_with_committed_datatype(my_fapl, new_format) < 0 ? 1 : 0;
+ } /* with/without external file cache */
/* These tests assume that external links are a form of UD links,
* so assume that everything that passed for external links
@@ -15049,14 +14060,15 @@ main(void)
/* Keep this test last, it's testing files that are used above */
/* do not do this for files used by external link tests */
nerrors += check_all_closed(my_fapl, new_format, EXTSTOP) < 0 ? 1 : 0;
- } /* for new/old format */
+ } /* new/old format */
/* New group revision feature tests */
nerrors += corder_create_empty(fapl2) < 0 ? 1 : 0;
+
/* XXX: when creation order indexing is fully working, go back and add checks
-* to these tests to make certain that the creation order values are
-* correct.
-*/
+ * to these tests to make certain that the creation order values are
+ * correct.
+ */
nerrors += corder_create_compact(fapl2) < 0 ? 1 : 0;
nerrors += corder_create_dense(fapl2) < 0 ? 1 : 0;
nerrors += corder_transition(fapl2) < 0 ? 1 : 0;
@@ -15078,10 +14090,11 @@ main(void)
nerrors += group_info_old(fapl) < 0 ? 1 : 0;
if (minimize_dset_oh) {
- if (H5Pclose(dcpl_g) < 0) TEST_ERROR;
+ if (H5Pclose(dcpl_g) < 0) TEST_ERROR;
dcpl_g = -1;
}
- } /* for [un]minimized dataset object headers */
+ } /* [un]minimized dataset object headers */
+
/* Close 2nd FAPL */
H5Pclose(fapl2);
@@ -15097,8 +14110,7 @@ main(void)
/* Results */
if(nerrors) {
- HDprintf("***** %d LINK TEST%s FAILED! *****\n",
- nerrors, 1 == nerrors ? "" : "S");
+ HDprintf("***** %d LINK TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
HDexit(EXIT_FAILURE);
}
HDprintf("All link tests passed.\n");
@@ -15107,14 +14119,14 @@ main(void)
HDremove(SYMLINK1);
HDremove(SYMLINK2);
- /* clean up tmp directory created by external link tests */
+ /* clean up tmp_links and tmp2_links directory created by external link tests */
HDrmdir(TMPDIR);
HDrmdir(TMPDIR2);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
HDputs("*** TESTS FAILED ***");
- return 1;
+ HDexit(EXIT_FAILURE);
}
diff --git a/test/links_env.c b/test/links_env.c
index b32fb32..efb8cfd 100644
--- a/test/links_env.c
+++ b/test/links_env.c
@@ -12,39 +12,39 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Purpose: Tests hard, soft (symbolic) & external links.
+ * Purpose: Tests hard, soft (symbolic) & external links.
*/
-#define H5G_FRIEND /*suppress error about including H5Gpkg */
+#define H5G_FRIEND /*suppress error about including H5Gpkg */
#define H5G_TESTING
#include "h5test.h"
-#include "H5Gpkg.h" /* Groups */
-#include "H5Iprivate.h" /* IDs */
+#include "H5Gpkg.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
#include "H5Lprivate.h" /* Links */
-#define TMPDIR "tmp/"
+#define TMPDIR "tmp_links_env/"
#define NAME_BUF_SIZE 1024
const char *FILENAME[] = {
- "extlinks_env0", /* 0: main file */
- "extlinks_env1", /* 1: target file */
+ "extlinks_env0", /* 0: main file */
+ "extlinks_env1", /* 1: target file */
TMPDIR "extlinks_env1", /* 2 */
NULL
};
static int external_link_env(hid_t fapl, hbool_t new_format);
-
+
/*-------------------------------------------------------------------------
* Function: external_link_env (moved from links.c)
*
- * Purpose: Verify that the target file is found successfully in "tmp" directory
- * via searching the pathnames set in the environment variable HDF5_EXT_PREFIX.
- * 1. Target link: "extlinks_env1"
- * 2. Main file: "extlinks_env0"
- * 3. Target file is created in: "tmp/extlinks_env1"
- * 4. The environment variable "HDF5_EXT_PREFIX" is set to ".:tmp"
+ * Purpose: Verify that the target file is found successfully in "tmp_links_env" directory
+ * via searching the pathnames set in the environment variable HDF5_EXT_PREFIX.
+ * 1. Target link: "extlinks_env1"
+ * 2. Main file: "extlinks_env0"
+ * 3. Target file is created in: "tmp_links_env/extlinks_env1"
+ * 4. The environment variable "HDF5_EXT_PREFIX" is set to ".:tmp_links_env"
*
* Return: Success: 0
* Failure: -1
@@ -59,12 +59,12 @@ static int external_link_env(hid_t fapl, hbool_t new_format);
static int
external_link_env(hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
- const char *envval = NULL; /* Pointer to environment variable */
- char filename1[NAME_BUF_SIZE],
- filename2[NAME_BUF_SIZE],
- filename3[NAME_BUF_SIZE]; /* Holders for filename */
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group IDs */
+ const char *envval = NULL; /* Pointer to environment variable */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE]; /* Holders for filename */
if(new_format)
TESTING("external links via environment variable (w/new group format)")
@@ -73,7 +73,7 @@ external_link_env(hid_t fapl, hbool_t new_format)
if ((envval = HDgetenv("HDF5_EXT_PREFIX")) == NULL)
envval = "nomatch";
- if (HDstrcmp(envval, ".:tmp")) TEST_ERROR
+ if (HDstrcmp(envval, ".:tmp_links_env")) TEST_ERROR
/* Set up name for main file:"extlinks_env0" */
h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1);
@@ -81,14 +81,14 @@ external_link_env(hid_t fapl, hbool_t new_format)
/* Set up name for external linked target file: "extlinks_env1" */
h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2);
- /* Create "tmp" directory */
+ /* Create "tmp_links_env" directory */
if(HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
- TEST_ERROR
+ TEST_ERROR
- /* Set up name (location) for the target file: "tmp/extlinks1" */
+ /* Set up name (location) for the target file: "tmp_links_env/extlinks1" */
h5_fixname(FILENAME[2], fapl, filename3, sizeof filename3);
- /* Create the target file in "tmp" directory */
+ /* Create the target file in "tmp_links_env" directory */
if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -110,9 +110,9 @@ external_link_env(hid_t fapl, hbool_t new_format)
/* Should be able to find the target file from pathnames set via HDF5_EXT_PREFIX */
if (gid < 0) {
- H5_FAILED();
- puts(" Should have found the file in tmp directory.");
- goto error;
+ H5_FAILED();
+ puts(" Should have found the file in tmp_links_env directory.");
+ goto error;
}
/* closing for main file */
@@ -124,35 +124,29 @@ external_link_env(hid_t fapl, hbool_t new_format)
error:
H5E_BEGIN_TRY {
- H5Gclose (gid);
- H5Fclose (fid);
+ H5Gclose (gid);
+ H5Fclose (fid);
} H5E_END_TRY;
return -1;
} /* end external_link_env() */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test external link with environment variable HDF5_EXT_PREFIX
+ * Purpose: Test external link with environment variable HDF5_EXT_PREFIX
*
- * Return: Success: exit(EXIT_SUCCESS)
- * Failure: exit(EXIT_FAILURE)
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
- * Programmer: Vailin Choi; Nov 2010
+ * Programmer: Vailin Choi; Nov 2010
*
*-------------------------------------------------------------------------
*/
int
main(void)
{
- hid_t fapl; /* File access property lists */
- int nerrors = 0; /* Error from tests */
- const char *env_h5_drvr; /* File Driver value from environment */
-
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
- if(env_h5_drvr == NULL)
- env_h5_drvr = "nomatch";
+ hid_t fapl; /* File access property lists */
+ int nerrors = 0; /* Error from tests */
h5_reset();
fapl = h5_fileaccess();
@@ -177,12 +171,13 @@ main(void)
}
HDprintf("All external Link (HDF5_EXT_PREFIX) tests passed.\n");
- /* clean up tmp directory created by external link tests */
+ /* clean up tmp_links_env directory created by external link tests */
HDrmdir(TMPDIR);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
HDputs("*** TESTS FAILED ***");
- return 1;
-}
+ HDexit(EXIT_FAILURE);
+} /* end main() */
+
diff --git a/test/mf.c b/test/mf.c
index 04b7c0b..99975c0 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -13,23 +13,23 @@
/*
* Tests for file memory management consist of 3 parts:
- * test_mf_eoa_*() tests for file meomory that interact with file allocation
- * test_mf_fs_*() tests for file memory that interact with the free-space manager
- * test_mf_aggr_*() tests for file memory that interact with the aggregators
- * test_mf_align_*() tests for file memory with alignment setting
- * test_filespace_*() tests for file space management
- * test_page_*() tests for file space paging
+ * test_mf_eoa_*() tests for file meomory that interact with file allocation
+ * test_mf_fs_*() tests for file memory that interact with the free-space manager
+ * test_mf_aggr_*() tests for file memory that interact with the aggregators
+ * test_mf_align_*() tests for file memory with alignment setting
+ * test_filespace_*() tests for file space management
+ * test_page_*() tests for file space paging
*/
#include "h5test.h"
-#define H5MF_FRIEND /*suppress error about including H5MFpkg */
+#define H5MF_FRIEND /*suppress error about including H5MFpkg */
#include "H5MFpkg.h"
-#define H5FS_FRIEND /*suppress error about including H5FSpkg */
+#define H5FS_FRIEND /*suppress error about including H5FSpkg */
#include "H5FSpkg.h"
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_TESTING
#include "H5Fpkg.h"
@@ -137,7 +137,7 @@ static unsigned test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t
static unsigned test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl);
static unsigned test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl);
static unsigned test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format);
-static unsigned test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format);
+static unsigned test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format);
static unsigned test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format);
static unsigned test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format);
static unsigned test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format);
@@ -211,15 +211,15 @@ error:
static unsigned
test_mf_eoa(const char *env_h5_drvr, hid_t fapl)
{
- hid_t file = -1; /* File ID */
- hid_t fapl_new = -1; /* copy of fapl */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ hid_t fapl_new = -1; /* copy of fapl */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* file size */
- H5FD_mem_t type;
- haddr_t addr1, addr2;
- haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
- hsize_t ma_size=0;
+ H5FD_mem_t type;
+ haddr_t addr1, addr2;
+ haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
+ hsize_t ma_size=0;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MM_alloc() of file allocation");
@@ -320,8 +320,8 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support continuous address space");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support continuous address space");
} /* end else */
return(0);
@@ -329,7 +329,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl)
error:
H5E_BEGIN_TRY {
H5Pclose(fapl_new);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_eoa() */
@@ -339,32 +339,32 @@ error:
* To verify that an allocated block from file allocation is shrunk.
*
* Set up:
- * Turn off using meta/small data aggregator
- * There is nothing in free-space manager
- *
- * Test 1: Allocate a block of 30 from file allocation
- * H5MF_try_shrink() the block by 30 : succeed
- * Test 2: Allocate a block of 30 from file allocation
- * H5MF_try_shrink() the block by 20 : fail
- * Test 3: Allocate a block of 30 from file allocation
- * H5MF_try_shrink() the block by 40 : fail
- * Test 4: Allocate a block of 30 from file allocation
- * H5MF_try_shrink() the block by 20 from the end: succeed
+ * Turn off using meta/small data aggregator
+ * There is nothing in free-space manager
+ *
+ * Test 1: Allocate a block of 30 from file allocation
+ * H5MF_try_shrink() the block by 30 : succeed
+ * Test 2: Allocate a block of 30 from file allocation
+ * H5MF_try_shrink() the block by 20 : fail
+ * Test 3: Allocate a block of 30 from file allocation
+ * H5MF_try_shrink() the block by 40 : fail
+ * Test 4: Allocate a block of 30 from file allocation
+ * H5MF_try_shrink() the block by 20 from the end: succeed
*
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
{
- hid_t file = -1; /* File ID */
- hid_t fapl_new = -1; /* copy of fapl */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ hid_t fapl_new = -1; /* copy of fapl */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size = 0, new_file_size; /* file size */
- H5FD_mem_t type;
- haddr_t addr = 0;
- haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
- hsize_t ma_size=0, new_ma_size=0;
+ H5FD_mem_t type;
+ haddr_t addr = 0;
+ haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, new_ma_size=0;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_try_shrink() of file allocation: test 1");
@@ -462,8 +462,8 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
TESTING("H5MF_try_shrink() of file allocation: test 2");
@@ -510,8 +510,8 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
@@ -554,8 +554,8 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
TESTING("H5MF_try_shrink() of file allocation: test 4");
@@ -602,8 +602,8 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
return(0);
@@ -611,7 +611,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
error:
H5E_BEGIN_TRY {
H5Pclose(fapl_new);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_eoa_shrink() */
@@ -621,29 +621,29 @@ error:
* To verify that an allocated block from file allocation is extended.
*
* Set up:
- * Turn off using meta/small data aggregator
- * There is nothing in free-space manager
+ * Turn off using meta/small data aggregator
+ * There is nothing in free-space manager
*
* Test 1: Allocate a block of 30
- * H5MF_try_extend() the block of size 30 by 50: succeed
+ * H5MF_try_extend() the block of size 30 by 50: succeed
*
* Test 2: Allocate a block of 30
- * H5MF_try_extend() the block of size 20 by 50: fail
+ * H5MF_try_extend() the block of size 20 by 50: fail
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
{
- hid_t file = -1; /* File ID */
- hid_t fapl_new = -1; /* copy of fapl */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
- h5_stat_size_t file_size, new_file_size; /* File size */
+ hid_t file = -1; /* File ID */
+ hid_t fapl_new = -1; /* copy of fapl */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ h5_stat_size_t file_size, new_file_size; /* File size */
H5FD_mem_t type;
- haddr_t addr;
+ haddr_t addr;
htri_t was_extended;
- haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
- hsize_t ma_size=0, new_ma_size=0;
+ haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, new_ma_size=0;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_try_extend() of file allocation: test 1");
@@ -740,8 +740,8 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
TESTING("H5MF_try_extend() of file allocation: test 2");
@@ -803,8 +803,8 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
return(0);
@@ -812,7 +812,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
error:
H5E_BEGIN_TRY {
H5Pclose(fapl_new);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_eoa_extend() */
@@ -822,7 +822,7 @@ error:
* To verify that temporary blocks are allocated correctly
*
* Set up:
- * There is nothing in free-space manager
+ * There is nothing in free-space manager
*
* Tests:
* Allocate a reasonable-sized temporary block
@@ -854,13 +854,13 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Can't run this test with multi-file VFDs */
if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* file size */
haddr_t maxaddr; /* File's max. address */
- haddr_t tmp_addr; /* Temporary space file address */
- haddr_t norm_addr; /* Normal space file address */
- haddr_t check_addr; /* File address for checking for errors */
+ haddr_t tmp_addr; /* Temporary space file address */
+ haddr_t norm_addr; /* Normal space file address */
+ haddr_t check_addr; /* File address for checking for errors */
unsigned char buf = 0; /* Buffer to read/write with */
herr_t status; /* Generic status value */
@@ -1001,15 +1001,15 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support continuous address space");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support continuous address space");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_tmp() */
@@ -1019,16 +1019,16 @@ error:
* To verify that the free-space manager is created or opened
*
* Set up:
- * Turn off using meta/small data aggregator
+ * Turn off using meta/small data aggregator
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_fs_start(hid_t fapl)
{
- hid_t file = -1; /* File ID */
- hid_t fapl_new = -1; /* copy of fapl */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ hid_t fapl_new = -1; /* copy of fapl */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* file size */
H5FS_stat_t state;
@@ -1087,7 +1087,7 @@ test_mf_fs_start(hid_t fapl)
/* Verify the file is the correct size */
if(new_file_size != file_size)
- TEST_ERROR
+ TEST_ERROR
if(H5Pclose(fapl_new) < 0)
FAIL_STACK_ERROR
@@ -1099,7 +1099,7 @@ test_mf_fs_start(hid_t fapl)
error:
H5E_BEGIN_TRY {
H5Pclose(fapl_new);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_fs_start() */
@@ -1110,36 +1110,36 @@ error:
* To verify that a block is allocated/freed from/to the free-space manager
*
* Set up:
- * Turn off using meta/small data aggregator
+ * Turn off using meta/small data aggregator
*
* Test 1:
- * Add section A to free-space manager (addr=70, size=30)
- * Allocate a block of size=30
- * The returned space's address should be same as section A's address
- * Deallocate the block which will be returned to the free-space manager
+ * Add section A to free-space manager (addr=70, size=30)
+ * Allocate a block of size=30
+ * The returned space's address should be same as section A's address
+ * Deallocate the block which will be returned to the free-space manager
* Test 2:
- * Add section A to free-space manager (addr=70, size=30)
- * Allocate a block of size=20
- * The returned space's address should be same as section A's address
- * There should still be space of 10 left in the free-space manager
- * Deallocate the block which will be returned to free-space manager
+ * Add section A to free-space manager (addr=70, size=30)
+ * Allocate a block of size=20
+ * The returned space's address should be same as section A's address
+ * There should still be space of 10 left in the free-space manager
+ * Deallocate the block which will be returned to free-space manager
* Test 3:
- * Add section A to free-space manager (addr=70, size=30)
- * Allocate a block of size=40
- * The free-space manager is unable to fulfill the request
- * The block is allocated from file allocation
- * Deallocate the block which will be returned to free-space manager
- * (the space is shrunk and freed since it is at end of file)
+ * Add section A to free-space manager (addr=70, size=30)
+ * Allocate a block of size=40
+ * The free-space manager is unable to fulfill the request
+ * The block is allocated from file allocation
+ * Deallocate the block which will be returned to free-space manager
+ * (the space is shrunk and freed since it is at end of file)
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_fs_alloc_free(hid_t fapl)
{
- hid_t file = -1; /* File ID */
- hid_t fapl_new = -1; /* copy of fapl */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
- h5_stat_size_t file_size, new_file_size; /* file size */
+ hid_t file = -1; /* File ID */
+ hid_t fapl_new = -1; /* copy of fapl */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ h5_stat_size_t file_size, new_file_size; /* file size */
H5MF_free_section_t *sect_node = NULL;
haddr_t addr;
haddr_t tmp;
@@ -1205,7 +1205,7 @@ test_mf_fs_alloc_free(hid_t fapl)
/* Verify that the allocated block is section A in free-space */
if(addr != TBLOCK_ADDR70)
- TEST_ERROR
+ TEST_ERROR
state.tot_space -= TBLOCK_SIZE30;
state.tot_sect_count -= 1;
@@ -1239,7 +1239,7 @@ test_mf_fs_alloc_free(hid_t fapl)
/* Verify the file is the correct size */
if (new_file_size != file_size)
- TEST_ERROR
+ TEST_ERROR
PASSED()
@@ -1282,7 +1282,7 @@ test_mf_fs_alloc_free(hid_t fapl)
/* Verify that the allocated block is section A in free-space manager */
if(addr != TBLOCK_ADDR70)
- TEST_ERROR
+ TEST_ERROR
/* should still have 1 section of size 10 left in free-space manager */
state.tot_space -= (TBLOCK_SIZE20);
@@ -1314,7 +1314,7 @@ test_mf_fs_alloc_free(hid_t fapl)
/* Verify the file is the correct size */
if (new_file_size != file_size)
- TEST_ERROR
+ TEST_ERROR
PASSED()
@@ -1399,7 +1399,7 @@ test_mf_fs_alloc_free(hid_t fapl)
/* Verify the file is the correct size */
if(new_file_size != file_size)
- TEST_ERROR
+ TEST_ERROR
if(H5Pclose(fapl_new) < 0)
FAIL_STACK_ERROR
@@ -1411,7 +1411,7 @@ test_mf_fs_alloc_free(hid_t fapl)
error:
H5E_BEGIN_TRY {
H5Pclose(fapl_new);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_fs_alloc_free() */
@@ -1422,47 +1422,47 @@ error:
* To verify that a block allocated from the free-space manager can be extended
*
* Set up:
- * Turn off using meta/small data aggregator
+ * Turn off using meta/small data aggregator
*
* Test 1:
- * Add section A to free-space manager: addr=70, size=30
- * Allocate a block of size 30 from free-space manager
- * Add section B to free-space manager: addr=100, size=50
- * Try to extend the allocated block by requested-size=50
- * Succeed: section A adjoins section B (70+30=100 which is section B's address) and
- * requested-size (50) is equal to the size of section B
+ * Add section A to free-space manager: addr=70, size=30
+ * Allocate a block of size 30 from free-space manager
+ * Add section B to free-space manager: addr=100, size=50
+ * Try to extend the allocated block by requested-size=50
+ * Succeed: section A adjoins section B (70+30=100 which is section B's address) and
+ * requested-size (50) is equal to the size of section B
* Test 2:
- * Add section A to free-space manager: addr=70, size=30
- * Allocate a block of size 30 from free-space manager
- * Add section B to free-space manager: addr=100, size=50
- * Try to extend the allocated block by requested-size=60
- * Fail: section A adjoins section B (70+30=100 which is section B's address) but
- * requested-size (60) > size of section B (50)
+ * Add section A to free-space manager: addr=70, size=30
+ * Allocate a block of size 30 from free-space manager
+ * Add section B to free-space manager: addr=100, size=50
+ * Try to extend the allocated block by requested-size=60
+ * Fail: section A adjoins section B (70+30=100 which is section B's address) but
+ * requested-size (60) > size of section B (50)
*
* Test 3:
- * Add section A to free-space manager: addr=70, size=30
- * Allocate a block of size 30 from free-space manager
- * Add section B to free-space manager: addr=100, size=50
- * Try to extend the allocated block by requested-size=40
- * Succeed: section A adjoins section B (70+30=100 which is section B's address) and
- * requested-size (40) < size of section B (50), therefore,
- * a section of 10 is left in the free-space manager
+ * Add section A to free-space manager: addr=70, size=30
+ * Allocate a block of size 30 from free-space manager
+ * Add section B to free-space manager: addr=100, size=50
+ * Try to extend the allocated block by requested-size=40
+ * Succeed: section A adjoins section B (70+30=100 which is section B's address) and
+ * requested-size (40) < size of section B (50), therefore,
+ * a section of 10 is left in the free-space manager
* Test 4:
- * Add section A to free-space manager: addr=70, size=20
- * Allocate a block of size 20 from free-space manager
- * Add section B to free-space manager: addr=100, size=50
- * Try to extend the allocated block by 50 from the free-space_manager:
- * Fail: section A does not adjoin section B (70+20 != address of section B) even though
- * the requested-size (50) equal to size of section B (50)
+ * Add section A to free-space manager: addr=70, size=20
+ * Allocate a block of size 20 from free-space manager
+ * Add section B to free-space manager: addr=100, size=50
+ * Try to extend the allocated block by 50 from the free-space_manager:
+ * Fail: section A does not adjoin section B (70+20 != address of section B) even though
+ * the requested-size (50) equal to size of section B (50)
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_fs_extend(hid_t fapl)
{
- hid_t file = -1; /* File ID */
- hid_t fapl_new = -1; /* copy of fapl */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ hid_t fapl_new = -1; /* copy of fapl */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* file size */
H5MF_free_section_t *sect_node1 = NULL, *sect_node2=NULL;
haddr_t addr;
@@ -1558,7 +1558,7 @@ test_mf_fs_extend(hid_t fapl)
/* should succeed */
if(was_extended <= 0)
- TEST_ERROR
+ TEST_ERROR
/* Section B is removed from free-space manager */
state.tot_space -= TBLOCK_SIZE50;
@@ -1585,7 +1585,7 @@ test_mf_fs_extend(hid_t fapl)
if(tmp != TBLOCK_ADDR70)
TEST_ERROR
-
+
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -1595,7 +1595,7 @@ test_mf_fs_extend(hid_t fapl)
/* Verify the file is the correct size */
if (new_file_size != file_size)
- TEST_ERROR
+ TEST_ERROR
PASSED()
@@ -1666,7 +1666,7 @@ test_mf_fs_extend(hid_t fapl)
/* Should not be able to extend the allocated block */
if(was_extended)
- TEST_ERROR
+ TEST_ERROR
/* free-space info should remain the same */
if(check_stats(f, f->shared->fs_man[H5FD_MEM_SUPER], &state))
@@ -1697,7 +1697,7 @@ test_mf_fs_extend(hid_t fapl)
/* Verify the file is the correct size */
if (new_file_size != file_size)
- TEST_ERROR
+ TEST_ERROR
PASSED()
@@ -1768,7 +1768,7 @@ test_mf_fs_extend(hid_t fapl)
/* Should succeed in extending the allocated block */
if(was_extended <=0)
- TEST_ERROR
+ TEST_ERROR
/* Should have 1 section of size=10 left in free-space manager */
state.tot_space -= (TBLOCK_SIZE40);
@@ -1787,7 +1787,7 @@ test_mf_fs_extend(hid_t fapl)
/* Remove the merged sections A & B from free-space */
if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
TEST_ERROR
-
+
if(tmp != addr) TEST_ERROR
if(H5Fclose(file) < 0)
@@ -1799,7 +1799,7 @@ test_mf_fs_extend(hid_t fapl)
/* Verify the file is the correct size */
if (new_file_size != file_size)
- TEST_ERROR
+ TEST_ERROR
PASSED()
@@ -1870,7 +1870,7 @@ test_mf_fs_extend(hid_t fapl)
/* Should not succeed in extending the allocated block */
if(was_extended)
- TEST_ERROR
+ TEST_ERROR
/* Free-space info should be the same */
if(check_stats(f, f->shared->fs_man[H5FD_MEM_SUPER], &state))
@@ -1905,7 +1905,7 @@ test_mf_fs_extend(hid_t fapl)
/* Verify the file is the correct size */
if(new_file_size != file_size)
- TEST_ERROR
+ TEST_ERROR
if(H5Pclose(fapl_new) < 0)
FAIL_STACK_ERROR
@@ -1917,7 +1917,7 @@ test_mf_fs_extend(hid_t fapl)
error:
H5E_BEGIN_TRY {
H5Pclose(fapl_new);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_fs_extend() */
@@ -1926,26 +1926,26 @@ error:
*-------------------------------------------------------------------------
* To verify that an aggregator is absorbed into a section.
*
- * Test 1: To aborb the aggregator onto the beginning of the section
- * Allocate block A from meta_aggr
- * Create a free-space section node with an address that adjoins
- * the end of meta_aggr and a size to make the aggregator
- * get absorbed into the section.
- * The adding of the section to free-space will call H5MF_aggr_absorb(),
- * which will absorb meta_aggr to the section:
- * section size + remaining size of aggregator is > aggr->alloc_size,
- * section is allowed to absorb an aggregator (allow_sect_absorb is true)
- *
- * Test 2: To absorb the aggregator onto the end of the section
- * Allocate block A from meta_aggr
- * Allocate block B from sdata_aggr
- * Create a free-space section node with an address that adjoins
- * the beginning of meta_aggr and a size to make the
- * aggregator get absorbed into the section.
- * The adding of the section to free-space will call H5MF_aggr_absorb(),
- * which will absorb meta_aggr to the section:
- * section size + remaining size of aggregator is > aggr->alloc_size,
- * section is allowed to absorb an aggregator (allow_sect_absorb is true)
+ * Test 1: To aborb the aggregator onto the beginning of the section
+ * Allocate block A from meta_aggr
+ * Create a free-space section node with an address that adjoins
+ * the end of meta_aggr and a size to make the aggregator
+ * get absorbed into the section.
+ * The adding of the section to free-space will call H5MF_aggr_absorb(),
+ * which will absorb meta_aggr to the section:
+ * section size + remaining size of aggregator is > aggr->alloc_size,
+ * section is allowed to absorb an aggregator (allow_sect_absorb is true)
+ *
+ * Test 2: To absorb the aggregator onto the end of the section
+ * Allocate block A from meta_aggr
+ * Allocate block B from sdata_aggr
+ * Create a free-space section node with an address that adjoins
+ * the beginning of meta_aggr and a size to make the
+ * aggregator get absorbed into the section.
+ * The adding of the section to free-space will call H5MF_aggr_absorb(),
+ * which will absorb meta_aggr to the section:
+ * section size + remaining size of aggregator is > aggr->alloc_size,
+ * section is allowed to absorb an aggregator (allow_sect_absorb is true)
*-------------------------------------------------------------------------
*/
static unsigned
@@ -1959,7 +1959,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
haddr_t ma_addr=HADDR_UNDEF;
hsize_t ma_size=0;
H5MF_free_section_t *sect_node=NULL;
- hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("A free-space section absorbs an aggregator: test 1");
@@ -2025,8 +2025,8 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
TESTING("A free-space section absorbs an aggregator: test 2");
@@ -2068,7 +2068,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(ma_size+TBLOCK_SIZE30), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
TEST_ERROR
- if((tmp + TBLOCK_SIZE30) != ma_addr)
+ if((tmp + TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
/* restore info to meta_aggr */
@@ -2086,15 +2086,15 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_fs_absorb() */
@@ -2103,32 +2103,32 @@ error:
*-------------------------------------------------------------------------
* To verify that blocks are allocated from the aggregator
*
- * Allocate first block (30) from meta_aggr: (nothing in the aggregator)
- * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is allocated from file allocation
- * The first block of 30 is allocated from meta_aggr
- * There is space of 2018 left in meta_aggr
- *
- * Allocate second block (50) from meta_aggr:
- * request-size is <= what is left in meta_aggr
- * Result:
- * The second block of 50 is allocated from meta_aggr
- * There is space of 1968 left in meta_aggr
+ * Allocate first block (30) from meta_aggr: (nothing in the aggregator)
+ * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is allocated from file allocation
+ * The first block of 30 is allocated from meta_aggr
+ * There is space of 2018 left in meta_aggr
+ *
+ * Allocate second block (50) from meta_aggr:
+ * request-size is <= what is left in meta_aggr
+ * Result:
+ * The second block of 50 is allocated from meta_aggr
+ * There is space of 1968 left in meta_aggr
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
hid_t fcpl; /* File creation property list */
h5_stat_size_t file_size, new_file_size; /* file size */
- H5FD_mem_t type;
- haddr_t addr1, addr2;
- haddr_t ma_addr=HADDR_UNDEF;
- hsize_t ma_size=0;
+ H5FD_mem_t type;
+ haddr_t addr1, addr2;
+ haddr_t ma_addr=HADDR_UNDEF;
+ hsize_t ma_size=0;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_alloc() of meta/sdata aggregator:test 1");
@@ -2228,15 +2228,15 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
H5Pclose(fcpl);
} H5E_END_TRY;
return(1);
@@ -2246,38 +2246,38 @@ error:
*-------------------------------------------------------------------------
* To verify that blocks are allocated from the aggregator
*
- * Allocate first block (30) from meta_aggr: (nothing in the aggregator)
- * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is obtained via file allocation
- * There is space of 2018 left in meta_aggr
- *
- * Allocate second block (50) from meta_aggr:
- * request-size is <= what is left in meta_aggr
- * Result:
- * The second block of 50 is allocated from what is left in meta_aggr
- * There is space of 1968 left in meta_aggr
- *
- * Allocate third block (2058) from meta_aggr:
- * request-size is > what is left in meta_aggr and is >= meta_aggr->alloc_size
- * meta_aggr is at EOA
- * Result:
- * A block of request-size is extended via file allocation and is merged with meta_aggr
- * The block of 2058 is allocated out of meta_aggr
- * There is space of 1968 left in meta_aggr
+ * Allocate first block (30) from meta_aggr: (nothing in the aggregator)
+ * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is obtained via file allocation
+ * There is space of 2018 left in meta_aggr
+ *
+ * Allocate second block (50) from meta_aggr:
+ * request-size is <= what is left in meta_aggr
+ * Result:
+ * The second block of 50 is allocated from what is left in meta_aggr
+ * There is space of 1968 left in meta_aggr
+ *
+ * Allocate third block (2058) from meta_aggr:
+ * request-size is > what is left in meta_aggr and is >= meta_aggr->alloc_size
+ * meta_aggr is at EOA
+ * Result:
+ * A block of request-size is extended via file allocation and is merged with meta_aggr
+ * The block of 2058 is allocated out of meta_aggr
+ * There is space of 1968 left in meta_aggr
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* file size */
- H5FD_mem_t type;
- haddr_t addr1, addr2, addr3;
- haddr_t ma_addr=HADDR_UNDEF;
- hsize_t ma_size=0;
+ H5FD_mem_t type;
+ haddr_t addr1, addr2, addr3;
+ haddr_t ma_addr=HADDR_UNDEF;
+ hsize_t ma_size=0;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_alloc() of meta/sdata aggregator:test 2");
@@ -2370,15 +2370,15 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_aggr_alloc2() */
@@ -2387,53 +2387,53 @@ error:
*-------------------------------------------------------------------------
* To verify that blocks are allocated from the aggregator
*
- * Allocate first block (30) from meta_aggr : (nothing in the aggregator)
- * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is obtained via file allocation
- * The first block of 30 is allocated from there
- * There is space of 2018 left in meta_aggr
- *
- * Allocate second block (50) from meta_aggr:
- * request-size is <= what is left in meta_aggr
- * Result:
- * The second block of 50 is allocated from what is left in meta_aggr
- * There is space of 1968 left in meta_aggr
- *
- * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr)
- * request-size is > what is left in other_aggr and is < sdata_aggr->alloc_size
- * Result:
- * A block of sdata_aggr->alloc_size is obtained via file allocation
- * The first block of 30 is allocated from there
- * There is space of 2018 left in sdata_aggr
- *
- * Allocate the third block (2058) from meta_aggr:
- * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size
- * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size
- * Result: A block of request-size is obtained via file allocation
- * The new block's address is returned
- * Nothing is changed in meta_aggr and sdata_aggr
- *
- * Allocate fourth block (50) from meta_aggr:
- * request-size is <= what is left in meta_aggr and < meta_aggr->alloc_size
- * Result:
- * The fourth block of 50 is allocated from what is left in meta_aggr
- * There is space of 1968 left in meta_aggr
+ * Allocate first block (30) from meta_aggr : (nothing in the aggregator)
+ * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is obtained via file allocation
+ * The first block of 30 is allocated from there
+ * There is space of 2018 left in meta_aggr
+ *
+ * Allocate second block (50) from meta_aggr:
+ * request-size is <= what is left in meta_aggr
+ * Result:
+ * The second block of 50 is allocated from what is left in meta_aggr
+ * There is space of 1968 left in meta_aggr
+ *
+ * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr)
+ * request-size is > what is left in other_aggr and is < sdata_aggr->alloc_size
+ * Result:
+ * A block of sdata_aggr->alloc_size is obtained via file allocation
+ * The first block of 30 is allocated from there
+ * There is space of 2018 left in sdata_aggr
+ *
+ * Allocate the third block (2058) from meta_aggr:
+ * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size
+ * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size
+ * Result: A block of request-size is obtained via file allocation
+ * The new block's address is returned
+ * Nothing is changed in meta_aggr and sdata_aggr
+ *
+ * Allocate fourth block (50) from meta_aggr:
+ * request-size is <= what is left in meta_aggr and < meta_aggr->alloc_size
+ * Result:
+ * The fourth block of 50 is allocated from what is left in meta_aggr
+ * There is space of 1968 left in meta_aggr
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* file size */
- H5FD_mem_t type, stype;
- haddr_t addr1, addr2, addr3, addr4, saddr1;
- haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
- hsize_t ma_size=0, new_ma_size=0;
- haddr_t sdata_addr=HADDR_UNDEF;
- hsize_t sdata_size=0;
+ H5FD_mem_t type, stype;
+ haddr_t addr1, addr2, addr3, addr4, saddr1;
+ haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, new_ma_size=0;
+ haddr_t sdata_addr=HADDR_UNDEF;
+ hsize_t sdata_size=0;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_alloc() of meta/sdata aggregator: test 3");
@@ -2530,15 +2530,15 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_aggr_alloc3() */
@@ -2548,55 +2548,55 @@ error:
*-------------------------------------------------------------------------
* To verify that blocks are allocated from the aggregator
*
- * Allocate first block (30) from meta_aggr: (nothing in the aggregator)
- * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is obtained via file allocation
- * There is space of 2018 left in meta_aggr
- * The first block of 30 is allocated from there
- *
- * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr)
- * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size
- * Result:
- * A block of sdata_aggr->alloc_size is obtained via file allocation
- * The first block of 30 is allocated from there
- *
- * Allocate the second block (2018) from sdata_aggr:
- * request-size is <= what is left in sdata_aggr and < sdata_aggr->alloc_size
- * request-size is < sdata_aggr->alloc_size
- * Result:
- * The block is allocated from what is left in sdata_aggr (all used up)
- *
- * Allocate third block (50) from sdata_aggr :
- * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size
- * Result:
- * A block of sdata_aggr->alloc_size is extended via file allocation
- * The third block of 50 is allocated from there
- * There is space of 1998 left in the sdata_aggr
- *
- * Allocate second block (2058) from meta_aggr:
- * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size
- * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size
- * Result:
- * unused spaced in sdata_aggr is freed to free-space and is shrunk
- * sdata_aggr is reset to 0
- * A block of request-size is obtained via file allocation
- * The new block's address is returned
- * The block does not adjoin meta_aggr
- * meta_aggr's info is unchanged
+ * Allocate first block (30) from meta_aggr: (nothing in the aggregator)
+ * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is obtained via file allocation
+ * There is space of 2018 left in meta_aggr
+ * The first block of 30 is allocated from there
+ *
+ * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr)
+ * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size
+ * Result:
+ * A block of sdata_aggr->alloc_size is obtained via file allocation
+ * The first block of 30 is allocated from there
+ *
+ * Allocate the second block (2018) from sdata_aggr:
+ * request-size is <= what is left in sdata_aggr and < sdata_aggr->alloc_size
+ * request-size is < sdata_aggr->alloc_size
+ * Result:
+ * The block is allocated from what is left in sdata_aggr (all used up)
+ *
+ * Allocate third block (50) from sdata_aggr :
+ * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size
+ * Result:
+ * A block of sdata_aggr->alloc_size is extended via file allocation
+ * The third block of 50 is allocated from there
+ * There is space of 1998 left in the sdata_aggr
+ *
+ * Allocate second block (2058) from meta_aggr:
+ * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size
+ * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size
+ * Result:
+ * unused spaced in sdata_aggr is freed to free-space and is shrunk
+ * sdata_aggr is reset to 0
+ * A block of request-size is obtained via file allocation
+ * The new block's address is returned
+ * The block does not adjoin meta_aggr
+ * meta_aggr's info is unchanged
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* File size */
- H5FD_mem_t type, stype;
- haddr_t addr1, addr2, saddr1, saddr2, saddr3;
- haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
- hsize_t ma_size=0, new_ma_size=0, sdata_size=0;
+ H5FD_mem_t type, stype;
+ haddr_t addr1, addr2, saddr1, saddr2, saddr3;
+ haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, new_ma_size=0, sdata_size=0;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_alloc() of meta/sdata aggregator:test 4");
@@ -2697,15 +2697,15 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_aggr_alloc4() */
@@ -2714,37 +2714,37 @@ error:
*-------------------------------------------------------------------------
* To verify that blocks are allocated from the aggregator
*
- * Allocate first block (30) from meta_aggr: (nothing in the aggregator)
- * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is obtained via file allocation
- * The first block of 30 is allocate from there
+ * Allocate first block (30) from meta_aggr: (nothing in the aggregator)
+ * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is obtained via file allocation
+ * The first block of 30 is allocate from there
*
- * Allocate second block (50) from meta_aggr:
- * request-size is < what is left in meta_aggr
- * Result:
- * The second block of 50 is allocated from what is left there
- * There is space of 1968 left in the meta_aggr
+ * Allocate second block (50) from meta_aggr:
+ * request-size is < what is left in meta_aggr
+ * Result:
+ * The second block of 50 is allocated from what is left there
+ * There is space of 1968 left in the meta_aggr
*
- * Allocate third block (1970) from meta_aggr:
- * request-size is > what is left in meta_aggr and is < meta_aggr->alloc_size
- * Result: A block of meta_aggr->alloc_size is extended via file allocation and is absorbed into the meta_aggr
- * The block of 1970 is allocated from there
- * There is space of 2046 left in meta_aggr
+ * Allocate third block (1970) from meta_aggr:
+ * request-size is > what is left in meta_aggr and is < meta_aggr->alloc_size
+ * Result: A block of meta_aggr->alloc_size is extended via file allocation and is absorbed into the meta_aggr
+ * The block of 1970 is allocated from there
+ * There is space of 2046 left in meta_aggr
*
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* File size */
- H5FD_mem_t type;
- haddr_t addr1, addr2, addr3;
- haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
- hsize_t ma_size=0, new_ma_size=0;
+ H5FD_mem_t type;
+ haddr_t addr1, addr2, addr3;
+ haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, new_ma_size=0;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_alloc() of meta/sdata aggregator:test 5");
@@ -2820,15 +2820,15 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_aggr_alloc5() */
@@ -2837,47 +2837,47 @@ error:
*-------------------------------------------------------------------------
* To verify that blocks are allocated from the aggregator
*
- * Allocate first block (30) from meta_aggr: (nothing in the aggregator)
- * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is obtained via file allocation
- * The first block of 30 is allocated from there
- *
- * Allocate second block (50) from meta_aggr:
- * request-size is <= what is left in meta_aggr
- * Result:
- * The second block of 50 is allocated from what is left in meta_aggr
- * There is space of 1968 left in meta_aggr
- *
- * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr)
- * request-size is > what is left in sdata_aggr and is < sdata_aggr->alloc_size
- * Result:
- * A block of sdata_aggr->alloc_size is obtained via file allocation
- * The first block of 30 is allocated from there
- * There is space of 2018 left in sdata_aggr
- *
- * Allocate third block (1970) from meta_aggr:
- * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
- * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is obtained via file allocation.
- * The block does not adjoin meta_aggr
- * sdata_aggr is untouched
- * meta_aggr's unused space of [880, 1968] is freed to free-space
- * meta_aggr is updated to point to the new block
+ * Allocate first block (30) from meta_aggr: (nothing in the aggregator)
+ * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is obtained via file allocation
+ * The first block of 30 is allocated from there
+ *
+ * Allocate second block (50) from meta_aggr:
+ * request-size is <= what is left in meta_aggr
+ * Result:
+ * The second block of 50 is allocated from what is left in meta_aggr
+ * There is space of 1968 left in meta_aggr
+ *
+ * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr)
+ * request-size is > what is left in sdata_aggr and is < sdata_aggr->alloc_size
+ * Result:
+ * A block of sdata_aggr->alloc_size is obtained via file allocation
+ * The first block of 30 is allocated from there
+ * There is space of 2018 left in sdata_aggr
+ *
+ * Allocate third block (1970) from meta_aggr:
+ * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size
+ * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is obtained via file allocation.
+ * The block does not adjoin meta_aggr
+ * sdata_aggr is untouched
+ * meta_aggr's unused space of [880, 1968] is freed to free-space
+ * meta_aggr is updated to point to the new block
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* file size */
- H5FD_mem_t type, stype;
- haddr_t addr1, addr2, addr3, saddr1;
- haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
- hsize_t ma_size=0, new_ma_size=0, sdata_size=0;
+ H5FD_mem_t type, stype;
+ haddr_t addr1, addr2, addr3, saddr1;
+ haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, new_ma_size=0, sdata_size=0;
H5FS_stat_t state;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
@@ -2976,15 +2976,15 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_aggr_alloc6() */
@@ -2999,52 +2999,52 @@ error:
* A block of meta_aggr->alloc_size is obtained via file allocation
* The first block of 30 is allocated from there
*
- * Allocate second block (50) from meta_aggr:
- * request-size is <= what is left in meta_aggr
- * Result:
- * The second block of 50 is allocated from what is left in the aggregator
- * There is space of 1968 left in the meta_aggr
- *
- * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr)
- * request-size is > what is left in sdata_aggr->size and < sdata_aggr->alloc_size
- * Result:
- * A block of sdata_aggr->alloc_size is obtained via file allocation
- * The first block of 30 is allocate from there
- *
- * Allocate second block (2018) from sdata_aggr:
- * request-size is <= what is left in sdata_aggr and is < sdata_aggr->alloc_size
- * Result:
- * The second block of 2018 is allocated from what is left in sdata_aggr (all used up)
- *
- * Allocate third block (50) from sdata_aggr:
- * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size
- * Result:
- * A block of sdata_aggr->alloc_size is extended via file allocation
- * The third block of 50 is allocated from there
- *
- * Allocate third block (1970) from meta_aggr:
- * request-size is > what is left in meta_aggr and is < meta_aggr->alloc_size
- * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size
- * Result:
- * unused space in sdata_aggr is freed to free-space and is shrunk
- * sdata_aggr is reset to 0
- * A block of meta_aggr->alloc_size is obtained via file allocation
- * The block does not adjoin meta_aggr
- * meta_aggr's unused space of [880, 1968] is freed to free-space
- * meta_aggr is updated to point to the new block
+ * Allocate second block (50) from meta_aggr:
+ * request-size is <= what is left in meta_aggr
+ * Result:
+ * The second block of 50 is allocated from what is left in the aggregator
+ * There is space of 1968 left in the meta_aggr
+ *
+ * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr)
+ * request-size is > what is left in sdata_aggr->size and < sdata_aggr->alloc_size
+ * Result:
+ * A block of sdata_aggr->alloc_size is obtained via file allocation
+ * The first block of 30 is allocate from there
+ *
+ * Allocate second block (2018) from sdata_aggr:
+ * request-size is <= what is left in sdata_aggr and is < sdata_aggr->alloc_size
+ * Result:
+ * The second block of 2018 is allocated from what is left in sdata_aggr (all used up)
+ *
+ * Allocate third block (50) from sdata_aggr:
+ * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size
+ * Result:
+ * A block of sdata_aggr->alloc_size is extended via file allocation
+ * The third block of 50 is allocated from there
+ *
+ * Allocate third block (1970) from meta_aggr:
+ * request-size is > what is left in meta_aggr and is < meta_aggr->alloc_size
+ * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size
+ * Result:
+ * unused space in sdata_aggr is freed to free-space and is shrunk
+ * sdata_aggr is reset to 0
+ * A block of meta_aggr->alloc_size is obtained via file allocation
+ * The block does not adjoin meta_aggr
+ * meta_aggr's unused space of [880, 1968] is freed to free-space
+ * meta_aggr is updated to point to the new block
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t empty_size, file_size;
- H5FD_mem_t type, stype;
- haddr_t addr1, addr2, addr3, saddr1, saddr2, saddr3;
- haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
- hsize_t ma_size=0, sdata_size=0;
+ H5FD_mem_t type, stype;
+ haddr_t addr1, addr2, addr3, saddr1, saddr2, saddr3;
+ haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, sdata_size=0;
H5FS_stat_t state;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
@@ -3160,15 +3160,15 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_aggr_alloc7() */
@@ -3177,38 +3177,38 @@ error:
*-------------------------------------------------------------------------
* To verify that a block can be extended from the aggregator
*
- * Test 1: Allocate block A from meta_aggr which is at end of file
- * Try to extend the block which adjoins the aggregator that is at end of file
- * a. block size < (% * aggr->alloc_size)
- * The block is allocated from the aggregator
- * b. block size > (% * aggr->alloc_size) but block size < aggr->alloc_size
- * The block is extended by aggr->alloc_size and the block is allocated from the aggregator
- * c. block size > (% * aggr->alloc_size) but block size > aggr->alloc_size
- * The block is extended by extended-request and the block is allocated from the aggregator
- *
- * Test 2: Allocate block A from meta_aggr
- * Allocate block B from sdata_aggr so that meta_aggr is not at end of file
- * Try to extend a block which adjoins meta_aggr and meta_aggr can fulfill the extended-request
- * H5MF_try_extend() succeeds: the block is extended into the aggregator
- *
- * Test 3: Allocate block A from meta_aggr
- * Allocate block B from sdata_aggr so that meta_aggr is not at end of file
- * Try to extend a block which adjoins meta_aggr but meta_aggr cannot fulfill the extended-request
- * H5MF_try_extend() fails
+ * Test 1: Allocate block A from meta_aggr which is at end of file
+ * Try to extend the block which adjoins the aggregator that is at end of file
+ * a. block size < (% * aggr->alloc_size)
+ * The block is allocated from the aggregator
+ * b. block size > (% * aggr->alloc_size) but block size < aggr->alloc_size
+ * The block is extended by aggr->alloc_size and the block is allocated from the aggregator
+ * c. block size > (% * aggr->alloc_size) but block size > aggr->alloc_size
+ * The block is extended by extended-request and the block is allocated from the aggregator
+ *
+ * Test 2: Allocate block A from meta_aggr
+ * Allocate block B from sdata_aggr so that meta_aggr is not at end of file
+ * Try to extend a block which adjoins meta_aggr and meta_aggr can fulfill the extended-request
+ * H5MF_try_extend() succeeds: the block is extended into the aggregator
+ *
+ * Test 3: Allocate block A from meta_aggr
+ * Allocate block B from sdata_aggr so that meta_aggr is not at end of file
+ * Try to extend a block which adjoins meta_aggr but meta_aggr cannot fulfill the extended-request
+ * H5MF_try_extend() fails
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t empty_size = 0, file_size;
- H5FD_mem_t type, stype;
- haddr_t new_addr, addr, saddr;
- haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
- hsize_t ma_size=0, new_ma_size=0, sdata_size=0;
- htri_t was_extended;
+ H5FD_mem_t type, stype;
+ haddr_t new_addr, addr, saddr;
+ haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, new_ma_size=0, sdata_size=0;
+ htri_t was_extended;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_try_extend() of meta/sdata aggregator: test 1");
@@ -3314,8 +3314,8 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
TESTING("H5MF_try_extend() of meta/sdata aggregator: test 2");
@@ -3384,8 +3384,8 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
TESTING("H5MF_try_extend() of meta/sdata aggregator: test 3");
@@ -3452,15 +3452,15 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_aggr_extend() */
@@ -3471,35 +3471,35 @@ error:
*
* MF_try_shrink() only allows blocks to be absorbed into an aggregator
*
- * Test 1: H5MF_alloc() block A from meta_aggr
- * H5MF_try_shrink() block A should merge it back into meta_aggr
- * since block A adjoins the beginning of meta_aggr
+ * Test 1: H5MF_alloc() block A from meta_aggr
+ * H5MF_try_shrink() block A should merge it back into meta_aggr
+ * since block A adjoins the beginning of meta_aggr
*
- * Test 2: H5MF_alloc() block A from meta_aggr
- * H5MF_alloc() block B from sdata_aggr
- * H5MF_try_shrink() block B should merge it back to the end of sdata_aggr
- * because sec2 driver is FLMAP_DICHOTOMY by default
+ * Test 2: H5MF_alloc() block A from meta_aggr
+ * H5MF_alloc() block B from sdata_aggr
+ * H5MF_try_shrink() block B should merge it back to the end of sdata_aggr
+ * because sec2 driver is FLMAP_DICHOTOMY by default
*
- * Test 3: H5MF_alloc() block A from meta_aggr
- * H5MF_alloc() block B from meta_aggr
- * H5MF_alloc() block C from meta_aggr
- * H5MF_try_shrink() block B should fail since it does not adjoin the
- * beginning nor the end of meta_aggr
+ * Test 3: H5MF_alloc() block A from meta_aggr
+ * H5MF_alloc() block B from meta_aggr
+ * H5MF_alloc() block C from meta_aggr
+ * H5MF_try_shrink() block B should fail since it does not adjoin the
+ * beginning nor the end of meta_aggr
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t empty_size = 0, file_size;
- H5FD_mem_t type, stype;
- haddr_t addr1, addr2, addr3, saddr1;
- haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
- haddr_t new_sdata_addr=HADDR_UNDEF;
- hsize_t ma_size=0, new_ma_size=0;
- hsize_t sdata_size=0, new_sdata_size=0;
+ H5FD_mem_t type, stype;
+ haddr_t addr1, addr2, addr3, saddr1;
+ haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
+ haddr_t new_sdata_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, new_ma_size=0;
+ hsize_t sdata_size=0, new_sdata_size=0;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 1");
@@ -3561,8 +3561,8 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 2");
@@ -3620,8 +3620,8 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 3");
@@ -3682,15 +3682,15 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_aggr_absorb() */
@@ -3702,46 +3702,46 @@ error:
* Alignment = 1024 or 4096
*
* Test 1:
- * Turn off using meta data aggregator
- * Allocate a block of 30 which should be from file allocation
- * Result:
- * The return address should be aligned
- * A fragment [800, 224] or [800, 3296] is freed to free-space
- * EOA is 1054 or 4126
- *
- * Allocate a block of 50 which should be from file allocation
- * Result:
- * The return address should be aligned
- * A fragment [1054, 994] or [4126, 4066] is freed to free-space
- * EOA is 2098 or 8242
+ * Turn off using metadata aggregator
+ * Allocate a block of 30 which should be from file allocation
+ * Result:
+ * The return address should be aligned
+ * A fragment [800, 224] or [800, 3296] is freed to free-space
+ * EOA is 1054 or 4126
+ *
+ * Allocate a block of 50 which should be from file allocation
+ * Result:
+ * The return address should be aligned
+ * A fragment [1054, 994] or [4126, 4066] is freed to free-space
+ * EOA is 2098 or 8242
* Test 2:
- * Turn off using meta data aggregator
- * Allocate a block which should be from file allocation
- * The return address should be aligned
- * H5MF_try_shrink() the block with aligned address should succeed
+ * Turn off using metadata aggregator
+ * Allocate a block which should be from file allocation
+ * The return address should be aligned
+ * H5MF_try_shrink() the block with aligned address should succeed
*
* Test 3:
- * Turn off using meta data aggregator
- * Allocate a block which should be from file allocation
- * The return address should be aligned
- * H5MF_try_extend() the block with aligned address should succeed
+ * Turn off using metadata aggregator
+ * Allocate a block which should be from file allocation
+ * The return address should be aligned
+ * H5MF_try_extend() the block with aligned address should succeed
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
- hid_t file = -1; /* File ID */
- hid_t fapl1 = -1;
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ hid_t fapl1 = -1;
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size;
- H5FD_mem_t type;
- haddr_t addr1, addr2;
- haddr_t ma_addr=HADDR_UNDEF;
- hsize_t ma_size=0;
- htri_t was_extended;
+ H5FD_mem_t type;
+ haddr_t addr1, addr2;
+ haddr_t ma_addr=HADDR_UNDEF;
+ hsize_t ma_size=0;
+ htri_t was_extended;
H5FS_stat_t state;
- hsize_t alignment=0, mis_align=0, tmp=0, accum=0;
+ hsize_t alignment=0, mis_align=0, tmp=0, accum=0;
hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
TESTING("H5MM_alloc() of file allocation with alignment: test 1");
@@ -3849,8 +3849,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support mis-aligned fragments");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
TESTING("H5MF_try_shrink() of file allocation with alignment: test 2");
@@ -3904,8 +3904,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support mis-aligned fragments");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
TESTING("H5MF_try_extend() of file allocation with alignment: test 3");
@@ -3960,15 +3960,15 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support mis-aligned fragments");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_align_eoa() */
@@ -3980,43 +3980,43 @@ error:
* Alignment = 1024 or 4096
*
* Test 1:
- * Add section A with an aligned address to free-space manager (addr=alignment, size=50)
- * Allocate a block of size=50
- * The returned space's address should be same as section A's address
+ * Add section A with an aligned address to free-space manager (addr=alignment, size=50)
+ * Allocate a block of size=50
+ * The returned space's address should be same as section A's address
*
* Test 2:
- * Add section A to free-space manager (addr=70, size=8000):
- * section A is mis-aligned but the size is big enough for allocation with alignment
- * Allocate a block of size=600
- * The returned space should be allocated from section A with an aligned address:
- * address=alignment size=600
- * There will be 2 sections in free-space: (alignment = 1024 or alignment = 4096)
- * the fragment left from aligning section A: [70, 954] or [70, 4026]
- * the section left after allocating block A: [1624, 416] or [4696, 3374]
- * H5MF_try_extend() the block of size 600 by 200 should succeed:
- * the existing fragment left from aligning section A: [70, 954] or [70, 4026]
- * the section left after extending block A: [1824, 216] or [4896, 3174]
+ * Add section A to free-space manager (addr=70, size=8000):
+ * section A is mis-aligned but the size is big enough for allocation with alignment
+ * Allocate a block of size=600
+ * The returned space should be allocated from section A with an aligned address:
+ * address=alignment size=600
+ * There will be 2 sections in free-space: (alignment = 1024 or alignment = 4096)
+ * the fragment left from aligning section A: [70, 954] or [70, 4026]
+ * the section left after allocating block A: [1624, 416] or [4696, 3374]
+ * H5MF_try_extend() the block of size 600 by 200 should succeed:
+ * the existing fragment left from aligning section A: [70, 954] or [70, 4026]
+ * the section left after extending block A: [1824, 216] or [4896, 3174]
*
* Test 3:
- * Add section A to free-space manager (addr=70, size=700):
- * section A is mis-aligned but the size is not big enough for allocation with alignment
- * Allocate a block of size=40
- * The free-space manager is unable to fulfill the request
- * The block is allocated from file allocation and should be aligned
+ * Add section A to free-space manager (addr=70, size=700):
+ * section A is mis-aligned but the size is not big enough for allocation with alignment
+ * Allocate a block of size=40
+ * The free-space manager is unable to fulfill the request
+ * The block is allocated from file allocation and should be aligned
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
h5_stat_size_t file_size;
- H5F_t *f = NULL; /* Internal file object pointer */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5MF_free_section_t *sect_node = NULL;
- haddr_t addr;
+ haddr_t addr;
H5FS_stat_t state;
htri_t was_extended;
- hsize_t alignment=0, tmp=0, mis_align=0;
+ hsize_t alignment=0, tmp=0, mis_align=0;
hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
TESTING("H5MF_alloc() of free-space manager with alignment: test 1");
@@ -4247,15 +4247,15 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support mis-aligned fragments");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_align_fs() */
@@ -4264,114 +4264,114 @@ error:
*-------------------------------------------------------------------------
* To verify that blocks allocated from the aggregator are aligned
*
- * Alignment = 1024 aggr->alloc_size = 2048
- *
- * Allocate first block (30) from meta_aggr: (nothing in the aggregator)
- * request-size > aggr->size and < aggr->alloc_size
- * Result:
- * An "aggr->alloc_size" block is allocated from file allocation for the aggregator
- * EOA is 3072
- * The first block of 30 is allocated from the aggregator and should be aligned
- * Fragment from alignment of file allocation is freed to free-space:[800, 224]
- * There is space of 2018 left in meta_aggr
- *
- * Allocate second block (50) from meta_aggr:
- * (request-size + fragment size) <= aggr->size
- * Result:
- * The second block of 50 is allocated from the aggregator and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994]
- * There is space of 974 left in meta_aggr
- *
- * Allocate third block (80) from meta_aggr:
- * (request-size + fragment size) > aggr->size
- * request-size < meta_aggr->alloc_size
- * fragment size < (meta_aggr->alloc_size - request-size)
- * meta_aggr is at EOA
- * Result:
- * A block of "meta_aggr->alloc_size" is extended from file allocation for meta_aggr
- * EOA is 5120
- * The third block of 80 is allocated from the aggregator and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[2098, 974]
- * There is space of 1968 left in meta_aggr
- *
- * Allocate fourth block (1970) from meta_aggr:
- * (request-size + fragment size) is <= aggr->size
- * fragment size > (aggr->alloc_size - request-size)
- * meta_aggr is at EOA
- * Result:
- * A block of aggr->alloc_size + fragment size - (aggr->alloc_size - request-size))
- * is extended from file allocation for meta_aggr
- * The third block of 1970 is allocated from the aggregator and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[3152, 944]
- * There is space of 1968 left in meta_aggr
- * EOA is at 8034
- *
- *
- * Alignment = 4096 aggr->alloc_size = 2048
- *
- * Allocate first block (30) from meta_aggr: (aggregator is empty)
- * request-size is > meta_aggr->size and < meta_aggr->alloc_size
- * Result:
- * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator
- * The first block of 30 is allocated from the aggregator and should be aligned
- * Fragment from alignment of file allocation is freed to free-space:[800, 3296]
- * There is space of 2018 left in meta_aggr
- * EOA is at 6144
- *
- * Allocate second block (50) from meta_aggr:
- * (request-size + fragment size) is > meta_aggr->size
- * request-size < meta_aggr->alloc_size
- * fragment size > (meta_aggr->alloc_size - request-size)
- * meta_aggr is at EOA
- * Result:
- * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size))
- * is extended from file allocation for the aggregator
- * The second block of 50 is allocated from the aggregator and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066]
- * There is space of 2018 left in meta_aggr
- * EOA is at 10260
- *
- * Allocate third block (80) from meta_aggr:
- * (request-size + fragment size) is > meta_aggr->size
- * request-size < meta_aggr->alloc_size
- * fragment size > (meta_aggr->alloc_size - request-size)
- * meta_aggr is at EOA
- * Result:
- * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size))
- * is extended from file allocation for the aggregator
- * The third block of 80 is allocated from the aggregator and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[8242, 4046]
- * There is space of 2018 left in meta_aggr
- * EOA is at 14386
- *
- * Allocate fourth block (1970) from meta_aggr:
- * (request-size + fragment size) > meta_aggr->size
- * request-size < meta_aggr->alloc_size
- * fragment size > (meta_aggr->alloc_size - request-size)
- * meta_aggr is at EOA
- * Result:
- * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size))
- * is extended from file allocation for the aggregator
- * The fourth block of 1970 is allocated from the aggregator and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[12368, 4016]
- * There is space of 2018 left in meta_aggr
- * EOA is at 20372
+ * Alignment = 1024 aggr->alloc_size = 2048
+ *
+ * Allocate first block (30) from meta_aggr: (nothing in the aggregator)
+ * request-size > aggr->size and < aggr->alloc_size
+ * Result:
+ * An "aggr->alloc_size" block is allocated from file allocation for the aggregator
+ * EOA is 3072
+ * The first block of 30 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of file allocation is freed to free-space:[800, 224]
+ * There is space of 2018 left in meta_aggr
+ *
+ * Allocate second block (50) from meta_aggr:
+ * (request-size + fragment size) <= aggr->size
+ * Result:
+ * The second block of 50 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994]
+ * There is space of 974 left in meta_aggr
+ *
+ * Allocate third block (80) from meta_aggr:
+ * (request-size + fragment size) > aggr->size
+ * request-size < meta_aggr->alloc_size
+ * fragment size < (meta_aggr->alloc_size - request-size)
+ * meta_aggr is at EOA
+ * Result:
+ * A block of "meta_aggr->alloc_size" is extended from file allocation for meta_aggr
+ * EOA is 5120
+ * The third block of 80 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[2098, 974]
+ * There is space of 1968 left in meta_aggr
+ *
+ * Allocate fourth block (1970) from meta_aggr:
+ * (request-size + fragment size) is <= aggr->size
+ * fragment size > (aggr->alloc_size - request-size)
+ * meta_aggr is at EOA
+ * Result:
+ * A block of aggr->alloc_size + fragment size - (aggr->alloc_size - request-size))
+ * is extended from file allocation for meta_aggr
+ * The third block of 1970 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[3152, 944]
+ * There is space of 1968 left in meta_aggr
+ * EOA is at 8034
+ *
+ *
+ * Alignment = 4096 aggr->alloc_size = 2048
+ *
+ * Allocate first block (30) from meta_aggr: (aggregator is empty)
+ * request-size is > meta_aggr->size and < meta_aggr->alloc_size
+ * Result:
+ * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator
+ * The first block of 30 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of file allocation is freed to free-space:[800, 3296]
+ * There is space of 2018 left in meta_aggr
+ * EOA is at 6144
+ *
+ * Allocate second block (50) from meta_aggr:
+ * (request-size + fragment size) is > meta_aggr->size
+ * request-size < meta_aggr->alloc_size
+ * fragment size > (meta_aggr->alloc_size - request-size)
+ * meta_aggr is at EOA
+ * Result:
+ * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size))
+ * is extended from file allocation for the aggregator
+ * The second block of 50 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066]
+ * There is space of 2018 left in meta_aggr
+ * EOA is at 10260
+ *
+ * Allocate third block (80) from meta_aggr:
+ * (request-size + fragment size) is > meta_aggr->size
+ * request-size < meta_aggr->alloc_size
+ * fragment size > (meta_aggr->alloc_size - request-size)
+ * meta_aggr is at EOA
+ * Result:
+ * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size))
+ * is extended from file allocation for the aggregator
+ * The third block of 80 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[8242, 4046]
+ * There is space of 2018 left in meta_aggr
+ * EOA is at 14386
+ *
+ * Allocate fourth block (1970) from meta_aggr:
+ * (request-size + fragment size) > meta_aggr->size
+ * request-size < meta_aggr->alloc_size
+ * fragment size > (meta_aggr->alloc_size - request-size)
+ * meta_aggr is at EOA
+ * Result:
+ * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size))
+ * is extended from file allocation for the aggregator
+ * The fourth block of 1970 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[12368, 4016]
+ * There is space of 2018 left in meta_aggr
+ * EOA is at 20372
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size; /* File size */
- H5FD_mem_t type;
- haddr_t addr1, addr2, addr3, addr4;
+ H5FD_mem_t type;
+ haddr_t addr1, addr2, addr3, addr4;
H5FS_stat_t state;
- haddr_t ma_addr=HADDR_UNDEF;
- hsize_t ma_size=0, mis_align=0;
- hsize_t alignment=0, tmp=0;
+ haddr_t ma_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, mis_align=0;
+ hsize_t alignment=0, tmp=0;
hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
@@ -4517,15 +4517,15 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support mis-aligned fragments");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_align_alloc1() */
@@ -4534,101 +4534,101 @@ error:
*-------------------------------------------------------------------------
* To verify that blocks allocated from the aggregator are aligned
*
- * Alignment = 1024 aggr->alloc_size = 2048
- *
- * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
- * request-size is > meta_aggr->size and < meta_aggr->alloc_size
- * Result:
- * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator
- * The first block of 30 is allocated from the aggregator and should be aligned
- * Fragment from alignment of file allocation is freed to free-space:[800, 224]
- * There is space of 2018 left in meta_aggr
- * EOA is 3072
- *
- * Allocate second block (50) from meta_aggr:
- * (request-size+fragment size) <= aggr->size
- * Result:
- * The second block of 50 is allocated from the aggregator and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994]
- * There is space of 974 left in meta_aggr
- *
- * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty)
- * request-size is > sdata_aggr->size and < sdata_aggr->alloc_size
- * Result:
- * A block of sdata_aggr->alloc_size is obtained via file allocation
- * The first block of 30 is allocated from sdata_aggr and should be aligned
- * EOA is 5120
- *
- * Allocate third block (80) from meta_aggr:
- * request-size+fragment size is > meta_aggr->size
- * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is allocated from file allocation
- * The unused space in meta_aggr is freed to free-space [2098, 974]
- * meta_aggr is updated to point to the new block
- * The third block of 80 is allocated from meta_aggr and should be aligned
- * EOA is 7168
- *
- * Alignment = 4096 aggr->alloc_size = 2048
- *
- * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
- * request-size is > aggr->size and < aggr->alloc_size
- * Result:
- * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator
- * The first block of 30 is allocated from the aggregator and should be aligned
- * Fragment from alignment of file allocation is freed to free-space:[800, 3296]
- * There is space of 2018 left meta_aggr
- * EOA is at 6144
- *
- * Allocate second block (50) from meta_aggr:
- * (request-size + fragment size) > aggr->size
- * request-size < aggr->alloc_size
- * fragment size > (aggr->alloc_size - request-size)
- * Result:
- * A block of (fragment size + request-size) is extended from file allocation for the aggregator
- * The second block of 50 is allocated from the aggregator and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066]
- * There is space of 2018 left in meta_aggr
- * EOA is at 10260
- *
- * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty)
- * request-size is > sdata_aggr->size and < sdata_aggr->alloc_size
- * meta_aggr is at EOA and has used up more than meta_aggr->alloc_size
- * Result:
- * The remaining space in meta_aggr is freed to free-space [8242, 2018] and shrunk since at EOF
- * meta_aggr is reset to 0
- * A block of sdata_aggr->alloc_size is obtained via file allocation
- * Fragment from alignment of file allocation is freed to free-space: [8242, 4046]
- * The first block of 30 is allocated from sdata_aggr and should be aligned
- * There is space of 2018 left in sdata_aggr
- * EOA is 14336
- *
- * Allocate third block (80) from meta_aggr:
- * (request-size + fragment size) is > meta_aggr->size
- * request-size < meta_aggr->alloc_size
- * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator
- * Fragment from alignment of file allocation is freed to free-space:[14336, 2048]
- * other_aggr is [12318, 2018]
- * The third block of 80 is allocated from the aggregator and should be aligned
- * There is space of 1968 left in meta_aggr
- * EOA is at 18432
+ * Alignment = 1024 aggr->alloc_size = 2048
+ *
+ * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
+ * request-size is > meta_aggr->size and < meta_aggr->alloc_size
+ * Result:
+ * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator
+ * The first block of 30 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of file allocation is freed to free-space:[800, 224]
+ * There is space of 2018 left in meta_aggr
+ * EOA is 3072
+ *
+ * Allocate second block (50) from meta_aggr:
+ * (request-size+fragment size) <= aggr->size
+ * Result:
+ * The second block of 50 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994]
+ * There is space of 974 left in meta_aggr
+ *
+ * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty)
+ * request-size is > sdata_aggr->size and < sdata_aggr->alloc_size
+ * Result:
+ * A block of sdata_aggr->alloc_size is obtained via file allocation
+ * The first block of 30 is allocated from sdata_aggr and should be aligned
+ * EOA is 5120
+ *
+ * Allocate third block (80) from meta_aggr:
+ * request-size+fragment size is > meta_aggr->size
+ * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is allocated from file allocation
+ * The unused space in meta_aggr is freed to free-space [2098, 974]
+ * meta_aggr is updated to point to the new block
+ * The third block of 80 is allocated from meta_aggr and should be aligned
+ * EOA is 7168
+ *
+ * Alignment = 4096 aggr->alloc_size = 2048
+ *
+ * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
+ * request-size is > aggr->size and < aggr->alloc_size
+ * Result:
+ * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator
+ * The first block of 30 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of file allocation is freed to free-space:[800, 3296]
+ * There is space of 2018 left meta_aggr
+ * EOA is at 6144
+ *
+ * Allocate second block (50) from meta_aggr:
+ * (request-size + fragment size) > aggr->size
+ * request-size < aggr->alloc_size
+ * fragment size > (aggr->alloc_size - request-size)
+ * Result:
+ * A block of (fragment size + request-size) is extended from file allocation for the aggregator
+ * The second block of 50 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066]
+ * There is space of 2018 left in meta_aggr
+ * EOA is at 10260
+ *
+ * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty)
+ * request-size is > sdata_aggr->size and < sdata_aggr->alloc_size
+ * meta_aggr is at EOA and has used up more than meta_aggr->alloc_size
+ * Result:
+ * The remaining space in meta_aggr is freed to free-space [8242, 2018] and shrunk since at EOF
+ * meta_aggr is reset to 0
+ * A block of sdata_aggr->alloc_size is obtained via file allocation
+ * Fragment from alignment of file allocation is freed to free-space: [8242, 4046]
+ * The first block of 30 is allocated from sdata_aggr and should be aligned
+ * There is space of 2018 left in sdata_aggr
+ * EOA is 14336
+ *
+ * Allocate third block (80) from meta_aggr:
+ * (request-size + fragment size) is > meta_aggr->size
+ * request-size < meta_aggr->alloc_size
+ * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator
+ * Fragment from alignment of file allocation is freed to free-space:[14336, 2048]
+ * other_aggr is [12318, 2018]
+ * The third block of 80 is allocated from the aggregator and should be aligned
+ * There is space of 1968 left in meta_aggr
+ * EOA is at 18432
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size; /* File size */
- H5FD_mem_t type, stype;
- haddr_t addr1, addr2, addr3, saddr1;
+ H5FD_mem_t type, stype;
+ haddr_t addr1, addr2, addr3, saddr1;
H5FS_stat_t state[H5FD_MEM_NTYPES];
- haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
- hsize_t ma_size=0, sdata_size=0, mis_align=0;
- hsize_t alignment=0, tmp=0;
+ haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, sdata_size=0, mis_align=0;
+ hsize_t alignment=0, tmp=0;
hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 2");
@@ -4717,11 +4717,11 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
*
* For alignment = 1024, alloc_size = 2048:
* block 30 is allocated from (ma_addr + ma_size),
- * which is already aligned
+ * which is already aligned
*
* For alignment = 4096, alloc_size = 2048:
- * since remaining space in meta_aggr is freed and shrunk,
- * block 30 is allocated from ma_addr
+ * since remaining space in meta_aggr is freed and shrunk,
+ * block 30 is allocated from ma_addr
*/
mis_align = 0;
if((alignment == TEST_ALIGN1024) && (tmp = ((ma_addr + ma_size) % alignment)))
@@ -4752,10 +4752,10 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
* Calculate fragment for the allocation of block 80 from meta_aggr:
*
* For alignment = 1024, alloc_size = 2048:
- * fragment for unused space in meta_aggr is freed to free-space
+ * fragment for unused space in meta_aggr is freed to free-space
* For alignment = 4096, alloc_size = 2048:
- * fragment from alignment of ma_addr is freed
- * block 30 is allocated from ma_addr
+ * fragment from alignment of ma_addr is freed
+ * block 30 is allocated from ma_addr
*/
mis_align = 0;
if((alignment == TEST_ALIGN1024) && (tmp = (ma_addr % alignment)))
@@ -4782,15 +4782,15 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Verify total size of free space after all the allocations */
- if(f->shared->fs_man[type]) {
- if(check_stats(f, f->shared->fs_man[type], &(state[type])))
- TEST_ERROR
- }
+ if(f->shared->fs_man[type]) {
+ if(check_stats(f, f->shared->fs_man[type], &(state[type])))
+ TEST_ERROR
+ }
- if(f->shared->fs_man[stype]) {
- if(check_stats(f, f->shared->fs_man[stype], &(state[stype])))
- TEST_ERROR
- }
+ if(f->shared->fs_man[stype]) {
+ if(check_stats(f, f->shared->fs_man[stype], &(state[stype])))
+ TEST_ERROR
+ }
H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50);
@@ -4803,15 +4803,15 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support mis-aligned fragments");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_align_alloc2() */
@@ -4820,153 +4820,153 @@ error:
*-------------------------------------------------------------------------
* To verify that blocks allocated from the aggregator are aligned
*
- * Alignment = 1024 aggr->alloc_size = 2048
- *
- * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
- * request-size is > meta_aggr->size and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator
- * Fragment from alignment of file allocation is freed to free-space:[800, 224]
- * The first block of 30 is allocated from the aggregator and should be aligned
- * There is space of 2018 left in meta_aggr
- * EOA is 3072
- *
- * Allocate second block (50) from meta_aggr:
- * (request-size+fragment size) is <= aggr->size
- * Result:
- * The second block of 50 is allocated from the aggregator and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994]
- * There is space of 974 left in the aggregator
- *
- * Allocate first block (30) from other_aggr: (nothing in other_aggr)
- * request-size is > what is left in other_aggr->size and < other_aggr->alloc_size
- * Result:
- * A "other_aggr->alloc_size" block is allocated from file allocation for other_aggr
- * The first block of 30 is allocated from other_aggr and should be aligned
- * There is space of 2018 left in other_aggr->size
- * EOA is 5120
- *
- * Allocate second block (50) from sdata_aggr:
- * (request-size+fragment size) < sdata_aggr->size
- * Result:
- * The second block of 50 is allocated from sdata_aggr and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[3102, 994]
- * There is space of 974 left in sdata_aggr
- *
- * Allocate third block (80) from sdata_aggr:
- * (request-size+fragment size) is >= sdata_aggr->size
- * request-size < sdata_aggr->alloc_size
- * sdata_aggr is at EOA
- * Result:
- * Another block of sdata_aggr->alloc_size is extended from file allocation for sdata_aggr
- * The third block of 80 is allocated from sdata_aggr and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[4146, 974]
- * There is space of 1968 left in sdata_aggr
- * EOA is 7168
- *
- * Allocate third block (1034) from meta_aggregator:
- * (request-size + alignment) > meta_aggr->size but < meta_aggr->alloc_size
- * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size
- * Result:
- * The unused space in sdata_aggr is freed to free-space [5200, 1968] then shrunk
- * sdata_aggr is reset to 0
- * A block of meta_aggr->alloc_size is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space [5200, 944]
- * The unused space in meta_aggr is freed to free-space [2098, 974]
- * The meta_aggr is updated to point to the new space
- * The block of 1034 is allocated from the new block and should be aligned
- * There is space of 1014 left in meta_aggr
- * EOA is 8192
- *
- * Alignment = 4096 aggr->alloc_size = 2048
- *
- * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
- * request-size is > what is left in aggr->size and < aggr->alloc_size
- * Result:
- * A meta_aggr->alloc block is allocated from file allocation for the aggregator
- * The first block of 30 is allocated from the aggregator and should be aligned
- * Fragment from alignment of file allocation is freed to free-space:[800, 3296]
- * There is space of 2018 left in meta_aggr
- * EOA is at 6144
- *
- * Allocate second block (50) from meta_aggr:
- * (request-size + fragment size) is > what is left in aggr->size
- * request-size < aggr->alloc_size
- * fragment size > (aggr->alloc_size - request-size)
- * Result:
- * A block of aggr->alloc_size + (fragment size - (aggr->alloc_size - request-size))
- * is extended from file allocation for the aggregator
- * The second block of 50 is allocated from the aggregator and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066]
- * There is space of 2018 left in meta_aggr
- * EOA is at 10260
- *
- * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty)
- * request-size > sdata_aggr->size and < sdata_aggr->alloc_size
- * meta_aggr is at EOA and has used up more than meta_aggr->alloc_size
- * Result:
- * The remaining space in meta_aggr is freed to free-space [8242, 2018] and shrunk
- * since at EOF
- * meta_aggr is reset to 0
- * A block of sdata_aggr->alloc_size is obtained via file allocation
- * Fragment from alignment of file allocation is freed to free-space: [8242, 4046]
- * The first block of 30 is allocated from sdata_aggr and should be aligned
- * There is space of 2018 left in sdata_aggr
- * EOA is 14336
- *
- * Allocate second block (50) from sdata_aggr:
- * request-size is > sdata_aggr->size
- * request-size < sdata_aggr->alloc_size
- * fragment size > (sdata_aggr->alloc_size - request-size)
- * Result:
- * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size))
- * is extended from file allocation for the aggregator
- * Fragment from alignment of aggregator allocation is freed to free-space:[12318, 4066]
- * The second block of 50 is allocated from the aggregator and should be aligned
- * There is space of 2018 left in the sdata_aggr
- * EOA is at 18452
- *
- * Allocate third block (80) from sdata_aggr:
- * request-size + fragment size is > sdata_aggr->size
- * request-size < sdata_aggr->alloc_size
- * fragment size > (sdata_aggr->alloc_size - request-size)
- * Result:
- * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size)
- * is allocated from file allocation for the aggregator
- * Fragment from alignment of aggregator allocation is freed to free-space:[16434, 4046]
- * The third block of 80 is allocated from the aggregator and should be aligned
- * There is space of 2018 left in the sdata_aggr
- * EOA is at 22578
- *
- * Allocate third block (1034) from meta_aggregator:
- * (request-size + fragment size) is > meta_aggr->size but request-size < meta_aggr->alloc_size
- * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size
- * Result:
- * The remaining space in sdata_aggr is freed to free-space [20560, 2018] then shrunk
- * sdata_aggr is reset to 0
- * There is nothing in meta_aggr
- * A block of meta_aggr->alloc_size is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space [20560, 4016]
- * EOA is 26624
- * The meta_aggr is updated to point to the new space
- * The block of 1034 is allocated from the new block and should be aligned
- * There is space of 1014 left in meta_aggr
+ * Alignment = 1024 aggr->alloc_size = 2048
+ *
+ * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
+ * request-size is > meta_aggr->size and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator
+ * Fragment from alignment of file allocation is freed to free-space:[800, 224]
+ * The first block of 30 is allocated from the aggregator and should be aligned
+ * There is space of 2018 left in meta_aggr
+ * EOA is 3072
+ *
+ * Allocate second block (50) from meta_aggr:
+ * (request-size+fragment size) is <= aggr->size
+ * Result:
+ * The second block of 50 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994]
+ * There is space of 974 left in the aggregator
+ *
+ * Allocate first block (30) from other_aggr: (nothing in other_aggr)
+ * request-size is > what is left in other_aggr->size and < other_aggr->alloc_size
+ * Result:
+ * A "other_aggr->alloc_size" block is allocated from file allocation for other_aggr
+ * The first block of 30 is allocated from other_aggr and should be aligned
+ * There is space of 2018 left in other_aggr->size
+ * EOA is 5120
+ *
+ * Allocate second block (50) from sdata_aggr:
+ * (request-size+fragment size) < sdata_aggr->size
+ * Result:
+ * The second block of 50 is allocated from sdata_aggr and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[3102, 994]
+ * There is space of 974 left in sdata_aggr
+ *
+ * Allocate third block (80) from sdata_aggr:
+ * (request-size+fragment size) is >= sdata_aggr->size
+ * request-size < sdata_aggr->alloc_size
+ * sdata_aggr is at EOA
+ * Result:
+ * Another block of sdata_aggr->alloc_size is extended from file allocation for sdata_aggr
+ * The third block of 80 is allocated from sdata_aggr and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[4146, 974]
+ * There is space of 1968 left in sdata_aggr
+ * EOA is 7168
+ *
+ * Allocate third block (1034) from meta_aggregator:
+ * (request-size + alignment) > meta_aggr->size but < meta_aggr->alloc_size
+ * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size
+ * Result:
+ * The unused space in sdata_aggr is freed to free-space [5200, 1968] then shrunk
+ * sdata_aggr is reset to 0
+ * A block of meta_aggr->alloc_size is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space [5200, 944]
+ * The unused space in meta_aggr is freed to free-space [2098, 974]
+ * The meta_aggr is updated to point to the new space
+ * The block of 1034 is allocated from the new block and should be aligned
+ * There is space of 1014 left in meta_aggr
+ * EOA is 8192
+ *
+ * Alignment = 4096 aggr->alloc_size = 2048
+ *
+ * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
+ * request-size is > what is left in aggr->size and < aggr->alloc_size
+ * Result:
+ * A meta_aggr->alloc block is allocated from file allocation for the aggregator
+ * The first block of 30 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of file allocation is freed to free-space:[800, 3296]
+ * There is space of 2018 left in meta_aggr
+ * EOA is at 6144
+ *
+ * Allocate second block (50) from meta_aggr:
+ * (request-size + fragment size) is > what is left in aggr->size
+ * request-size < aggr->alloc_size
+ * fragment size > (aggr->alloc_size - request-size)
+ * Result:
+ * A block of aggr->alloc_size + (fragment size - (aggr->alloc_size - request-size))
+ * is extended from file allocation for the aggregator
+ * The second block of 50 is allocated from the aggregator and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066]
+ * There is space of 2018 left in meta_aggr
+ * EOA is at 10260
+ *
+ * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty)
+ * request-size > sdata_aggr->size and < sdata_aggr->alloc_size
+ * meta_aggr is at EOA and has used up more than meta_aggr->alloc_size
+ * Result:
+ * The remaining space in meta_aggr is freed to free-space [8242, 2018] and shrunk
+ * since at EOF
+ * meta_aggr is reset to 0
+ * A block of sdata_aggr->alloc_size is obtained via file allocation
+ * Fragment from alignment of file allocation is freed to free-space: [8242, 4046]
+ * The first block of 30 is allocated from sdata_aggr and should be aligned
+ * There is space of 2018 left in sdata_aggr
+ * EOA is 14336
+ *
+ * Allocate second block (50) from sdata_aggr:
+ * request-size is > sdata_aggr->size
+ * request-size < sdata_aggr->alloc_size
+ * fragment size > (sdata_aggr->alloc_size - request-size)
+ * Result:
+ * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size))
+ * is extended from file allocation for the aggregator
+ * Fragment from alignment of aggregator allocation is freed to free-space:[12318, 4066]
+ * The second block of 50 is allocated from the aggregator and should be aligned
+ * There is space of 2018 left in the sdata_aggr
+ * EOA is at 18452
+ *
+ * Allocate third block (80) from sdata_aggr:
+ * request-size + fragment size is > sdata_aggr->size
+ * request-size < sdata_aggr->alloc_size
+ * fragment size > (sdata_aggr->alloc_size - request-size)
+ * Result:
+ * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size)
+ * is allocated from file allocation for the aggregator
+ * Fragment from alignment of aggregator allocation is freed to free-space:[16434, 4046]
+ * The third block of 80 is allocated from the aggregator and should be aligned
+ * There is space of 2018 left in the sdata_aggr
+ * EOA is at 22578
+ *
+ * Allocate third block (1034) from meta_aggregator:
+ * (request-size + fragment size) is > meta_aggr->size but request-size < meta_aggr->alloc_size
+ * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size
+ * Result:
+ * The remaining space in sdata_aggr is freed to free-space [20560, 2018] then shrunk
+ * sdata_aggr is reset to 0
+ * There is nothing in meta_aggr
+ * A block of meta_aggr->alloc_size is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space [20560, 4016]
+ * EOA is 26624
+ * The meta_aggr is updated to point to the new space
+ * The block of 1034 is allocated from the new block and should be aligned
+ * There is space of 1014 left in meta_aggr
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size;
- H5FD_mem_t type, stype;
- haddr_t addr1, addr2, addr3;
- haddr_t saddr1, saddr2, saddr3;
+ H5FD_mem_t type, stype;
+ haddr_t addr1, addr2, addr3;
+ haddr_t saddr1, saddr2, saddr3;
H5FS_stat_t state[H5FD_MEM_NTYPES];
- haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
- hsize_t ma_size=0, sdata_size=0, mis_align=0;
- hsize_t alignment=0, tmp=0;
+ haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, sdata_size=0, mis_align=0;
+ hsize_t alignment=0, tmp=0;
hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
@@ -5163,15 +5163,15 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Verify total size of free space after all allocations */
- if(f->shared->fs_man[type]) {
- if(check_stats(f, f->shared->fs_man[type], &(state[type])))
- TEST_ERROR
- }
+ if(f->shared->fs_man[type]) {
+ if(check_stats(f, f->shared->fs_man[type], &(state[type])))
+ TEST_ERROR
+ }
- if(f->shared->fs_man[stype]) {
- if(check_stats(f, f->shared->fs_man[stype], &(state[stype])))
- TEST_ERROR
- }
+ if(f->shared->fs_man[stype]) {
+ if(check_stats(f, f->shared->fs_man[stype], &(state[stype])))
+ TEST_ERROR
+ }
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -5179,15 +5179,15 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support mis-aligned fragments");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_align_alloc3() */
@@ -5197,81 +5197,81 @@ error:
*-------------------------------------------------------------------------
* To verify that blocks allocated from the aggregator are aligned
*
- * Alignment = 4096 aggr->alloc_size = 2048
- *
- * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
- * request-size > meta_aggr->size and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space:[800, 224]
- * The first block of 30 is allocated from meta_aggr and should be aligned
- * There is space of 2018 left in meta_aggr
- * EOA is 3072
- *
- * Allocate second block (2058) from meta_aggr:
- * (request-size+fragment) is > meta_aggr->size and request-size is > meta_aggr->alloc_size
- * meta_aggr is at EOA
- * Result:
- * The second block of 2058 + fragment is extended and merged together with meta_aggr
- * The block of 2058 is allocated out of the aggregator
- * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994]
- * There is space of 2018 (same as before) left in meta_aggr
- * EOA is 6124
- *
- * Allocate third block (5) from meta_aggr:
- * request-size+fragment < meta_aggr->size
- * Result:
- * A block of 5 is allocated from the aggregator
- * Fragment from alignment of aggregator allocation is freed to free-space:[4106, 1014]
- * There is space of 999 left in meta_aggr
- *
- * Alignment = 4096 aggr->alloc_size = 2048
- *
- * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
- * request-size is > meta_aggr->size and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space:[800, 3296]
- * The first block of 30 is allocated from meta_aggr and should be aligned
- * There is space of 2018 left in meta_aggr
- * EOA is 6144
- *
- * Allocate second block (2058) from meta_aggr:
- * (request-size+fragment) is > meta_aggr->size and request-size is > meta_aggr->alloc_size
- * meta_aggr is at EOA
- * Result:
- * The second block of 2058 + fragment is extended and merged together with meta_aggr
- * The block of 2058 is allocated out of the aggregator
- * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066]
- * There is space of 2018 (same as before) left in meta_aggr
- * EOA is 12268
- *
- * Allocate third block (5) from meta_aggr:
- * request-size+fragment is > meta_aggr->size
- * request-size < meta_aggr->alloc_size
- * fragment < (meta_aggr->alloc_size - request-size)
- * meta_aggr is at EOA
- * Result:
- * A block of meta_aggr->alloc_size is extended from file allocation for the aggregator
- * A block of 5 is allocated from the aggregator
- * Fragment from alignment of aggregator allocation is freed to free-space:[10250, 2038]
- * There is space of 2023 left in meta_aggr
+ * Alignment = 4096 aggr->alloc_size = 2048
+ *
+ * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
+ * request-size > meta_aggr->size and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space:[800, 224]
+ * The first block of 30 is allocated from meta_aggr and should be aligned
+ * There is space of 2018 left in meta_aggr
+ * EOA is 3072
+ *
+ * Allocate second block (2058) from meta_aggr:
+ * (request-size+fragment) is > meta_aggr->size and request-size is > meta_aggr->alloc_size
+ * meta_aggr is at EOA
+ * Result:
+ * The second block of 2058 + fragment is extended and merged together with meta_aggr
+ * The block of 2058 is allocated out of the aggregator
+ * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994]
+ * There is space of 2018 (same as before) left in meta_aggr
+ * EOA is 6124
+ *
+ * Allocate third block (5) from meta_aggr:
+ * request-size+fragment < meta_aggr->size
+ * Result:
+ * A block of 5 is allocated from the aggregator
+ * Fragment from alignment of aggregator allocation is freed to free-space:[4106, 1014]
+ * There is space of 999 left in meta_aggr
+ *
+ * Alignment = 4096 aggr->alloc_size = 2048
+ *
+ * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
+ * request-size is > meta_aggr->size and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space:[800, 3296]
+ * The first block of 30 is allocated from meta_aggr and should be aligned
+ * There is space of 2018 left in meta_aggr
+ * EOA is 6144
+ *
+ * Allocate second block (2058) from meta_aggr:
+ * (request-size+fragment) is > meta_aggr->size and request-size is > meta_aggr->alloc_size
+ * meta_aggr is at EOA
+ * Result:
+ * The second block of 2058 + fragment is extended and merged together with meta_aggr
+ * The block of 2058 is allocated out of the aggregator
+ * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066]
+ * There is space of 2018 (same as before) left in meta_aggr
+ * EOA is 12268
+ *
+ * Allocate third block (5) from meta_aggr:
+ * request-size+fragment is > meta_aggr->size
+ * request-size < meta_aggr->alloc_size
+ * fragment < (meta_aggr->alloc_size - request-size)
+ * meta_aggr is at EOA
+ * Result:
+ * A block of meta_aggr->alloc_size is extended from file allocation for the aggregator
+ * A block of 5 is allocated from the aggregator
+ * Fragment from alignment of aggregator allocation is freed to free-space:[10250, 2038]
+ * There is space of 2023 left in meta_aggr
*
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size;
- H5FD_mem_t type;
- haddr_t addr1, addr2, addr3;
+ H5FD_mem_t type;
+ haddr_t addr1, addr2, addr3;
H5FS_stat_t state;
- haddr_t ma_addr=HADDR_UNDEF;
- hsize_t ma_size=0, saved_ma_size=0;
- hsize_t alignment=0, mis_align=0, tmp=0;
+ haddr_t ma_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, saved_ma_size=0;
+ hsize_t alignment=0, mis_align=0, tmp=0;
hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
@@ -5377,10 +5377,10 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if(addr3 % alignment) TEST_ERROR
/* Verify total size of free space after all allocations */
- if(f->shared->fs_man[type]) {
- if(check_stats(f, f->shared->fs_man[type], &state))
- TEST_ERROR
- }
+ if(f->shared->fs_man[type]) {
+ if(check_stats(f, f->shared->fs_man[type], &state))
+ TEST_ERROR
+ }
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -5388,15 +5388,15 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support mis-aligned fragments");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_align_alloc4() */
@@ -5405,84 +5405,84 @@ error:
*-------------------------------------------------------------------------
* To verify that blocks allocated from the aggregator are aligned
*
- * Alignment = 1024 aggr->alloc_size = 2048
- *
- * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
- * request-size > meta_aggr->size and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space:[800, 224]
- * The first block of 30 is allocated from meta_aggr and should be aligned
- * There is space of 2018 left in meta_aggr
- * EOA is 3072
- *
- * Allocate first block (30) from sdata_aggr: (nothing in the aggregator)
- * A block of sdata_aggr->alloc_size is allocated from file allocation
- * The first block of 30 is allocated from the aggregator and should be aligned
- * There is space of 2018 left in sdata_aggr
- * EOA is 5120
- *
- * Allocate second block (2058) from meta_aggr:
- * (request-size + fragment size) > meta_aggr->size and > meta_aggr->alloc_size
- * sdata_aggr is at EOA but has not used up sdata_aggr->alloc_size
- * Result:
- * A block of 2058 is allocated from file allocation
- * EOA is 7178
- * Nothing is changed in meta_aggr and sdata_aggr
- *
- * Alignment = 4096 aggr->alloc_size = 2048
- *
- * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
- * request-size is > meta_aggr->size and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space:[800, 3296]
- * The first block of 30 is allocated from meta_aggr and should be aligned
- * There is space of 2018 left in meta_aggr
- * EOA is 6144
- *
- * Allocate first block (30) from sdata_aggr: (meta_aggr is empty)
- * meta_aggr is at EOA but has not used up more than meta_aggr->alloc_size
- * Result:
- * A block of sdata_aggr->alloc_size is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space:[6144, 2048]
- * This fragment adjoins meta_aggr and fulfills "absorb" condition,
- * the remaining space left in meta_aggr is absorbed into the fragment and
- * freed to free-space: [4126, 2018]
- * meta_aggr is reset to 0
- * The first block of 30 is allocated from the aggregator and should be aligned
- * There is space of 2018 left in sdata_aggr
- * EOA is 10240
- *
- * Allocate second block (2058) from meta_aggr:
- * request-size + fragment size is > meta_aggr->size
- * request_size is > meta_aggr->alloc_size
- * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size
- * Result:
- * A block of 2058 is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space:[10240, 2048]
- * This fragment adjoins sdata_aggr and fulfills "absorb" condition,
- * the remaining space left in sdata_aggr is absorbed into the fragment and
- * freed to free-space: [8222, 2018]
- * sdata_aggr is reset to 0
- * EOA is 14346
- * meta_aggr and sdata_aggr are all 0
+ * Alignment = 1024 aggr->alloc_size = 2048
+ *
+ * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
+ * request-size > meta_aggr->size and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space:[800, 224]
+ * The first block of 30 is allocated from meta_aggr and should be aligned
+ * There is space of 2018 left in meta_aggr
+ * EOA is 3072
+ *
+ * Allocate first block (30) from sdata_aggr: (nothing in the aggregator)
+ * A block of sdata_aggr->alloc_size is allocated from file allocation
+ * The first block of 30 is allocated from the aggregator and should be aligned
+ * There is space of 2018 left in sdata_aggr
+ * EOA is 5120
+ *
+ * Allocate second block (2058) from meta_aggr:
+ * (request-size + fragment size) > meta_aggr->size and > meta_aggr->alloc_size
+ * sdata_aggr is at EOA but has not used up sdata_aggr->alloc_size
+ * Result:
+ * A block of 2058 is allocated from file allocation
+ * EOA is 7178
+ * Nothing is changed in meta_aggr and sdata_aggr
+ *
+ * Alignment = 4096 aggr->alloc_size = 2048
+ *
+ * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
+ * request-size is > meta_aggr->size and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space:[800, 3296]
+ * The first block of 30 is allocated from meta_aggr and should be aligned
+ * There is space of 2018 left in meta_aggr
+ * EOA is 6144
+ *
+ * Allocate first block (30) from sdata_aggr: (meta_aggr is empty)
+ * meta_aggr is at EOA but has not used up more than meta_aggr->alloc_size
+ * Result:
+ * A block of sdata_aggr->alloc_size is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space:[6144, 2048]
+ * This fragment adjoins meta_aggr and fulfills "absorb" condition,
+ * the remaining space left in meta_aggr is absorbed into the fragment and
+ * freed to free-space: [4126, 2018]
+ * meta_aggr is reset to 0
+ * The first block of 30 is allocated from the aggregator and should be aligned
+ * There is space of 2018 left in sdata_aggr
+ * EOA is 10240
+ *
+ * Allocate second block (2058) from meta_aggr:
+ * request-size + fragment size is > meta_aggr->size
+ * request_size is > meta_aggr->alloc_size
+ * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size
+ * Result:
+ * A block of 2058 is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space:[10240, 2048]
+ * This fragment adjoins sdata_aggr and fulfills "absorb" condition,
+ * the remaining space left in sdata_aggr is absorbed into the fragment and
+ * freed to free-space: [8222, 2018]
+ * sdata_aggr is reset to 0
+ * EOA is 14346
+ * meta_aggr and sdata_aggr are all 0
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size;
- H5FD_mem_t type, stype;
- haddr_t addr1, addr2, saddr1;
+ H5FD_mem_t type, stype;
+ haddr_t addr1, addr2, saddr1;
H5FS_stat_t state[H5FD_MEM_NTYPES];
- haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
- haddr_t sdata_addr=HADDR_UNDEF, new_sdata_addr=HADDR_UNDEF;
- hsize_t ma_size=0, new_ma_size=0, sdata_size=0, new_sdata_size=0;
- hsize_t alignment=0, mis_align=0, tmp=0;
+ haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
+ haddr_t sdata_addr=HADDR_UNDEF, new_sdata_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, new_ma_size=0, sdata_size=0, new_sdata_size=0;
+ hsize_t alignment=0, mis_align=0, tmp=0;
hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
@@ -5585,15 +5585,15 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
}
/* Verify total size of free space after all allocations */
- if(f->shared->fs_man[type]) {
- if(check_stats(f, f->shared->fs_man[type], &(state[type])))
- TEST_ERROR
- }
+ if(f->shared->fs_man[type]) {
+ if(check_stats(f, f->shared->fs_man[type], &(state[type])))
+ TEST_ERROR
+ }
- if(f->shared->fs_man[stype]) {
- if(check_stats(f, f->shared->fs_man[stype], &(state[stype])))
- TEST_ERROR
- }
+ if(f->shared->fs_man[stype]) {
+ if(check_stats(f, f->shared->fs_man[stype], &(state[stype])))
+ TEST_ERROR
+ }
/* nothing is changed in meta_aggr */
H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
@@ -5611,15 +5611,15 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support mis-aligned fragments");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_align_alloc5() */
@@ -5629,125 +5629,125 @@ error:
*-------------------------------------------------------------------------
* To verify that blocks allocated from the aggregator are aligned
*
- * Alignment = 1024 aggr->alloc_size = 2048
- *
- * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
- * request-size is > meta_aggr->size and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space:[800, 224]
- * The first block of 30 is allocated from the aggregator and should be aligned
- * There is space of 2018 left in meta_aggr->size
- * EOA is 3072
- *
- * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty)
- * request_size > sdata_aggr->size and < sdata_aggr->alloc_size
- * Result:
- * A block of sdata_aggr->alloc_size is allocated from file allocation
- * The first block of 30 is allocated from the aggregator and should be aligned
- * There is space of 2018 left in sdata_aggr
- * EOA is 5120
- *
- * Allocate second block (50) from sdata_aggr:
- * (request-size+fragment size) <= sdata_aggr->size
- * Result:
- * The second block of 50 is allocated from sdata_aggr and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[3102, 994]
- * There is space of 974 left in sdata_aggr
- *
- * Allocate third block (80) from sdata_aggr:
- * (request-size+fragment size) > sdata_aggr->size
- * request-size < sdata_aggr->alloc_size
- * fragment size < (sdata_aggr->alloc_size - request-size)
- * Result:
- * Another block of sdata_aggr->alloc_size block is extended from file allocation
- * for sdata_aggr
- * The third block of 80 is allocated from sdata_aggr and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[4146, 974]
- * There is space of 1968 left in sdata_aggr
- * EOA is 7168
- *
- * Allocate second block (2058) from meta_aggr:
- * request-size + fragment size is > meta_aggr->size
- * request-size is > meta_aggr->alloc_size
- * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size
- * Result:
- * The remaining space in sdata_aggr is freed to free-space and shrunk
- * sdata_aggr is reset to 0
- * A block of 2058 is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space:[5200, 944]
- * EOA is at 8202
- * meta_aggr is unchanged
- *
- * Alignment = 4096 aggr->alloc_size = 2048
- *
- * Allocate first block (30) from meta_aggr: (meta_aggr is emtpy)
- * request-size is > meta_aggr->size and < meta_aggr->alloc_size
- * Result:
- * A block of meta_aggr->alloc_size is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space:[800, 3296]
- * The first block of 30 is allocated from the aggregator and should be aligned
- * There is space of 2018 left in meta_aggr
- * EOA is 6144
- *
- * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty)
- * request_size > sdata_aggr->size and < sdata_aggr->alloc_size
- * Result:
- * A block of sdata_aggr->alloc_size is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space: [6144, 2048]
- * The first block of 30 is allocated from the aggregator and should be aligned
- * There is space of 2018 left in sdata_aggr
- * EOA is 10240
- *
- * Allocate second block (50) from sdata_aggr:
- * (request-size+fragment size) is > sdata_aggr->size
- * request-size < sdata_aggr->alloc_size
- * fragment size > (sdata_aggr->alloc_size - request-size)
- * Result:
- * A block of (fragment size + request-size) is extended from file allocation for the aggregator
- * The second block of 50 is allocated from sdata_aggr and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[8222, 4066]
- * There is space of 2018 left in sdata_aggr
- * EOA is at 14356
- *
- * Allocate third block (80) from sdata_aggr:
- * (request-size+fragment size) is > sdata_aggr->size
- * request-size < sdata_aggr->alloc_size
- * fragment size > (sdata_aggr->alloc_size - request-size)
- * Result:
- * A block of (fragment size + request-size) is extended from file allocation for sdata_aggr
- * The third block of 80 is allocated from sdata_aggr and should be aligned
- * Fragment from alignment of aggregator allocation is freed to free-space:[12338, 4046]
- * There is space of 2018 left in sdata_aggr
- * EOA is 18482
- *
- * Allocate second block (2058) from meta_aggr:
- * request-size + fragment size is > meta_aggr->size
- * request-size is > meta_aggr->alloc_size
- * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size
- * Result:
- * The remaining space in sdata_aggr is freed to free-space and shrunk: [16464, 2018]
- * sdata_aggr is reset to 0
- * A block of 2058 is allocated from file allocation
- * Fragment from alignment of file allocation is freed to free-space:[16464, 4016]
- * EOA is at 22538
- * meta_aggr is unchanged
+ * Alignment = 1024 aggr->alloc_size = 2048
+ *
+ * Allocate first block (30) from meta_aggr: (meta_aggr is empty)
+ * request-size is > meta_aggr->size and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space:[800, 224]
+ * The first block of 30 is allocated from the aggregator and should be aligned
+ * There is space of 2018 left in meta_aggr->size
+ * EOA is 3072
+ *
+ * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty)
+ * request_size > sdata_aggr->size and < sdata_aggr->alloc_size
+ * Result:
+ * A block of sdata_aggr->alloc_size is allocated from file allocation
+ * The first block of 30 is allocated from the aggregator and should be aligned
+ * There is space of 2018 left in sdata_aggr
+ * EOA is 5120
+ *
+ * Allocate second block (50) from sdata_aggr:
+ * (request-size+fragment size) <= sdata_aggr->size
+ * Result:
+ * The second block of 50 is allocated from sdata_aggr and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[3102, 994]
+ * There is space of 974 left in sdata_aggr
+ *
+ * Allocate third block (80) from sdata_aggr:
+ * (request-size+fragment size) > sdata_aggr->size
+ * request-size < sdata_aggr->alloc_size
+ * fragment size < (sdata_aggr->alloc_size - request-size)
+ * Result:
+ * Another block of sdata_aggr->alloc_size block is extended from file allocation
+ * for sdata_aggr
+ * The third block of 80 is allocated from sdata_aggr and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[4146, 974]
+ * There is space of 1968 left in sdata_aggr
+ * EOA is 7168
+ *
+ * Allocate second block (2058) from meta_aggr:
+ * request-size + fragment size is > meta_aggr->size
+ * request-size is > meta_aggr->alloc_size
+ * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size
+ * Result:
+ * The remaining space in sdata_aggr is freed to free-space and shrunk
+ * sdata_aggr is reset to 0
+ * A block of 2058 is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space:[5200, 944]
+ * EOA is at 8202
+ * meta_aggr is unchanged
+ *
+ * Alignment = 4096 aggr->alloc_size = 2048
+ *
+ * Allocate first block (30) from meta_aggr: (meta_aggr is emtpy)
+ * request-size is > meta_aggr->size and < meta_aggr->alloc_size
+ * Result:
+ * A block of meta_aggr->alloc_size is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space:[800, 3296]
+ * The first block of 30 is allocated from the aggregator and should be aligned
+ * There is space of 2018 left in meta_aggr
+ * EOA is 6144
+ *
+ * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty)
+ * request_size > sdata_aggr->size and < sdata_aggr->alloc_size
+ * Result:
+ * A block of sdata_aggr->alloc_size is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space: [6144, 2048]
+ * The first block of 30 is allocated from the aggregator and should be aligned
+ * There is space of 2018 left in sdata_aggr
+ * EOA is 10240
+ *
+ * Allocate second block (50) from sdata_aggr:
+ * (request-size+fragment size) is > sdata_aggr->size
+ * request-size < sdata_aggr->alloc_size
+ * fragment size > (sdata_aggr->alloc_size - request-size)
+ * Result:
+ * A block of (fragment size + request-size) is extended from file allocation for the aggregator
+ * The second block of 50 is allocated from sdata_aggr and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[8222, 4066]
+ * There is space of 2018 left in sdata_aggr
+ * EOA is at 14356
+ *
+ * Allocate third block (80) from sdata_aggr:
+ * (request-size+fragment size) is > sdata_aggr->size
+ * request-size < sdata_aggr->alloc_size
+ * fragment size > (sdata_aggr->alloc_size - request-size)
+ * Result:
+ * A block of (fragment size + request-size) is extended from file allocation for sdata_aggr
+ * The third block of 80 is allocated from sdata_aggr and should be aligned
+ * Fragment from alignment of aggregator allocation is freed to free-space:[12338, 4046]
+ * There is space of 2018 left in sdata_aggr
+ * EOA is 18482
+ *
+ * Allocate second block (2058) from meta_aggr:
+ * request-size + fragment size is > meta_aggr->size
+ * request-size is > meta_aggr->alloc_size
+ * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size
+ * Result:
+ * The remaining space in sdata_aggr is freed to free-space and shrunk: [16464, 2018]
+ * sdata_aggr is reset to 0
+ * A block of 2058 is allocated from file allocation
+ * Fragment from alignment of file allocation is freed to free-space:[16464, 4016]
+ * EOA is at 22538
+ * meta_aggr is unchanged
*-------------------------------------------------------------------------
*/
static unsigned
test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size;
- H5FD_mem_t type, stype;
- haddr_t addr1, addr2;
- haddr_t saddr1, saddr2, saddr3;
+ H5FD_mem_t type, stype;
+ haddr_t addr1, addr2;
+ haddr_t saddr1, saddr2, saddr3;
H5FS_stat_t state[H5FD_MEM_NTYPES];
- haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
- hsize_t ma_size=0, new_ma_size=0, sdata_size=0;
- hsize_t alignment=0, mis_align=0, tmp=0;
+ haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, new_ma_size=0, sdata_size=0;
+ hsize_t alignment=0, mis_align=0, tmp=0;
hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 6");
@@ -5900,16 +5900,16 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if (sdata_addr != HADDR_UNDEF || sdata_size != 0)
TEST_ERROR
- if(f->shared->fs_man[type]) {
- if(check_stats(f, f->shared->fs_man[type], &(state[type])))
- TEST_ERROR
- }
-
+ if(f->shared->fs_man[type]) {
+ if(check_stats(f, f->shared->fs_man[type], &(state[type])))
+ TEST_ERROR
+ }
- if(f->shared->fs_man[stype]) {
- if(check_stats(f, f->shared->fs_man[stype], &(state[stype])))
- TEST_ERROR
- }
+
+ if(f->shared->fs_man[stype]) {
+ if(check_stats(f, f->shared->fs_man[stype], &(state[stype])))
+ TEST_ERROR
+ }
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -5917,17 +5917,17 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support mis-aligned fragments");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_mf_align_alloc6() */
/*
@@ -6114,7 +6114,7 @@ test_mf_fs_persist_split(void)
TESTING("File's free-space managers are persistent for split-file");
- /* for now, we don't support persistent free space managers
+ /* for now, we don't support persistent free space managers
* with the split file driver.
*/
SKIPPED();
@@ -6124,7 +6124,7 @@ test_mf_fs_persist_split(void)
/* File creation property list template */
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- /* for now, we don't support persistent free space managers
+ /* for now, we don't support persistent free space managers
* with the split file driver.
*/
SKIPPED();
@@ -6135,18 +6135,18 @@ test_mf_fs_persist_split(void)
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Set up split driver */
if(H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT)<0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* File creation property list template */
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -6311,7 +6311,7 @@ test_mf_fs_persist_split(void)
/* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */
if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(tmp_addr != addr3)
TEST_ERROR
@@ -6385,22 +6385,22 @@ error:
memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW; \
memb_map[H5FD_MEM_GHEAP] = H5FD_MEM_GHEAP; \
memb_map[H5FD_MEM_LHEAP] = H5FD_MEM_LHEAP; \
- sprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's'); \
+ HDsprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's'); \
memb_name[H5FD_MEM_SUPER] = sv[H5FD_MEM_SUPER]; \
memb_addr[H5FD_MEM_SUPER] = 0; \
- sprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b'); \
+ HDsprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b'); \
memb_name[H5FD_MEM_BTREE] = sv[H5FD_MEM_BTREE]; \
memb_addr[H5FD_MEM_BTREE] = HADDR_MAX/6; \
- sprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r'); \
+ HDsprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r'); \
memb_name[H5FD_MEM_DRAW] = sv[H5FD_MEM_DRAW]; \
memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/3; \
- sprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g'); \
+ HDsprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g'); \
memb_name[H5FD_MEM_GHEAP] = sv[H5FD_MEM_GHEAP]; \
memb_addr[H5FD_MEM_GHEAP] = HADDR_MAX/2; \
- sprintf(sv[H5FD_MEM_LHEAP], "%%s-%c.h5", 'l'); \
+ HDsprintf(sv[H5FD_MEM_LHEAP], "%%s-%c.h5", 'l'); \
memb_name[H5FD_MEM_LHEAP] = sv[H5FD_MEM_LHEAP]; \
memb_addr[H5FD_MEM_LHEAP] = HADDR_MAX*2/3; \
- sprintf(sv[H5FD_MEM_OHDR], "%%s-%c.h5", 'o'); \
+ HDsprintf(sv[H5FD_MEM_OHDR], "%%s-%c.h5", 'o'); \
memb_name[H5FD_MEM_OHDR] = sv[H5FD_MEM_OHDR]; \
memb_addr[H5FD_MEM_OHDR] = HADDR_MAX*5/6; \
}
@@ -6436,14 +6436,14 @@ test_mf_fs_persist_multi(void)
TESTING("File's free-space managers are persistent for multi-file");
- /* for now, we don't support persistent free space managers
+ /* for now, we don't support persistent free space managers
* with the multi file driver.
*/
SKIPPED();
HDfprintf(stdout, " Persistent FSMs disabled in multi file driver.\n");
return 0; /* <========== note return */
- /* for now, we don't support persistent free space managers
+ /* for now, we don't support persistent free space managers
* with the multi file driver.
*/
SKIPPED();
@@ -6747,7 +6747,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
TESTING("File's free-space is persistent with new library format")
else
TESTING("File's free-space is persistent with old library format")
-
+
if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")) {
/* File creation property list template */
@@ -6891,14 +6891,14 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
} else {
SKIPPED();
- puts(" Current VFD doesn't support persisting free-space or paged aggregation strategy");
+ HDputs(" Current VFD doesn't support persisting free-space or paged aggregation strategy");
}
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
H5Pclose(fcpl);
H5Pclose(fapl2);
} H5E_END_TRY;
@@ -6907,7 +6907,7 @@ error:
/*
*-------------------------------------------------------------------------
- * Verify free-space are merged/shrunk away
+ * Verify free-space are merged/shrunk away
*-------------------------------------------------------------------------
*/
static unsigned
@@ -6922,7 +6922,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
H5FS_stat_t fs_stat; /* Information for free-space manager */
haddr_t addr1, addr2, addr3, addr4; /* File address for H5FD_MEM_SUPER */
haddr_t addrx;
- H5FD_mem_t fs_type;
+ H5FD_mem_t fs_type;
hbool_t contig_addr_vfd;
hbool_t ran_H5MF_tidy_self_referential_fsm_hack = FALSE;
@@ -6972,7 +6972,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4)))
FAIL_STACK_ERROR
-
+
/* Put block #1, #3 to H5FD_MEM_SUPER free-space manager */
if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
FAIL_STACK_ERROR
@@ -7089,14 +7089,14 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
} else {
SKIPPED();
- puts(" Current VFD doesn't support persistent free-space manager");
+ HDputs(" Current VFD doesn't support persistent free-space manager");
}
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
H5Pclose(fcpl);
H5Pclose(fapl2);
} H5E_END_TRY;
@@ -7159,11 +7159,11 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for
/* Create file-creation template */
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
FAIL_STACK_ERROR
-
+
/* Set default file space information */
if(H5Pset_file_space_strategy(fcpl, fs_type, (hbool_t)fs_persist, fs_threshold) < 0)
FAIL_STACK_ERROR
-
+
/* Create the file to work on */
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl2)) < 0)
FAIL_STACK_ERROR
@@ -7186,7 +7186,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for
FAIL_STACK_ERROR
if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6)))
FAIL_STACK_ERROR
-
+
/* Put block #1, #3, #5 to H5FD_MEM_SUPER free-space manager */
if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
FAIL_STACK_ERROR
@@ -7218,7 +7218,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for
hssize_t nsects; /* # of free-space sections */
int i; /* local index variable */
H5F_sect_info_t *sect_info; /* array to hold the free-space information */
-
+
/* Get the # of free-space sections in the file */
if((nsects = H5Fget_free_sections(file, H5FD_MEM_DEFAULT, (size_t)0, NULL)) < 0)
FAIL_STACK_ERROR
@@ -7233,7 +7233,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for
sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t));
H5Fget_free_sections(file, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info);
-
+
/* Verify the size of free-space sections */
for(i = 0; i < nsects; i++)
if(sect_info[i].size < fs_threshold)
@@ -7266,7 +7266,7 @@ error:
H5E_BEGIN_TRY {
H5Pclose(fcpl);
H5Pclose(fapl2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_strat_thres_persist() */
@@ -7309,7 +7309,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
HDmemset(&fs_state_zero, 0, sizeof(H5FS_stat_t));
/* Copy the file access property list */
- if((fapl2 = H5Pcopy(fapl)) < 0)
+ if((fapl2 = H5Pcopy(fapl)) < 0)
FAIL_STACK_ERROR
if(new_format)
@@ -7365,7 +7365,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
if(fs_type == H5F_FSPACE_STRATEGY_PAGE) {
if(H5FS_stat_info(f, f->shared->fs_man[tt], &fs_state) < 0)
FAIL_STACK_ERROR
- }
+ }
/* Put block #3, #5 to H5FD_MEM_SUPER free-space manager */
if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
@@ -7398,7 +7398,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
if(fs_type == H5F_FSPACE_STRATEGY_PAGE) {
fs_state.tot_sect_count = fs_state.serial_sect_count = 1;
fs_state.tot_space += (TBLOCK_SIZE4 + TBLOCK_SIZE6);
- }
+ }
/* For old format: the sections at EOF are shrunk away */
if(check_stats(f, f->shared->fs_man[tt], (fs_type == H5F_FSPACE_STRATEGY_PAGE) ? &fs_state:&fs_state_zero))
@@ -7422,7 +7422,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
/* Re-open the file */
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl2)) < 0)
FAIL_STACK_ERROR
-
+
/* Get a pointer to the internal file object */
if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
@@ -7452,7 +7452,7 @@ error:
H5E_BEGIN_TRY {
H5Pclose(fcpl);
H5Pclose(fapl2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_strat_thres_gone() */
@@ -7482,11 +7482,11 @@ error:
static unsigned
test_dichotomy(hid_t fapl)
{
- hid_t file = -1; /* File ID */
- char filename[FILENAME_LEN]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
- H5FD_mem_t type, stype;
- haddr_t addr1, addr3, saddr1, saddr2;
+ hid_t file = -1; /* File ID */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ H5FD_mem_t type, stype;
+ haddr_t addr1, addr3, saddr1, saddr2;
TESTING("Allocation from raw or metadata free-space manager");
@@ -7539,7 +7539,7 @@ test_dichotomy(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_dichotomy() */
@@ -7614,7 +7614,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl = -1; /* File creation property list */
hid_t fapl_new = -1; /* File access property list ID */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr2, addr3; /* Addresses for small meta data blocks */
+ haddr_t addr2, addr3; /* Addresses for small metadata blocks */
haddr_t saddr1; /* Addresses for small raw data blocks */
haddr_t gaddr1; /* Addresses for large data blocks */
hbool_t split = FALSE, multi = FALSE;
@@ -7660,8 +7660,8 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
/* Get a pointer to the internal file object */
if(NULL == (f = (H5F_t *)H5I_object(fid)))
TEST_ERROR
-
- /* Allocate 3 small meta data blocks: addr1, addr2, addr3 */
+
+ /* Allocate 3 small metadata blocks: addr1, addr2, addr3 */
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30);
addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034);
addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
@@ -7673,7 +7673,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
H5MF__alloc_to_fs_type(f, H5FD_MEM_OHDR, TBLOCK_SIZE1034, (H5F_mem_page_t *)&fs_type);
- /* Verify that the freed block with addr2 is found from the small meta data manager */
+ /* Verify that the freed block with addr2 is found from the small metadata manager */
if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034, f->shared->fs_man[fs_type], &found_addr) < 0)
TEST_ERROR
if(found_addr != addr2)
@@ -7725,7 +7725,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
/* Re-open the file */
if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_new)) < 0)
TEST_ERROR
-
+
/* Get a pointer to the internal file object */
if(NULL == (f = (H5F_t *)H5I_object(fid)))
TEST_ERROR
@@ -7735,7 +7735,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
if(!H5F_addr_defined(f->shared->fs_addr[fs_type]))
TEST_ERROR
- /* Verify that the small meta data manager is there */
+ /* Verify that the small metadata manager is there */
H5MF__alloc_to_fs_type(f, H5FD_MEM_OHDR, f->shared->fs_page_size - 1, (H5F_mem_page_t *)&fs_type);
if(!H5F_addr_defined(f->shared->fs_addr[fs_type]))
TEST_ERROR
@@ -7755,7 +7755,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
if(H5MF__open_fstype(f, fs_type) < 0)
TEST_ERROR
- /* Verify that the freed block with addr2 is found from the small meta data manager */
+ /* Verify that the freed block with addr2 is found from the small metadata manager */
if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)(f->shared->fs_page_size-(addr3+TBLOCK_SIZE50)), f->shared->fs_man[fs_type], &found_addr) < 0)
TEST_ERROR
@@ -7765,7 +7765,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
/* Verify that the small raw data manager is there */
if(!H5F_addr_defined(f->shared->fs_addr[H5F_MEM_PAGE_DRAW]))
TEST_ERROR
-
+
/* Set up to use the small raw data manager */
if(!(f->shared->fs_man[H5F_MEM_PAGE_DRAW]))
if(H5MF__open_fstype(f, H5F_MEM_PAGE_DRAW) < 0)
@@ -7789,7 +7789,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
if(found_addr != gaddr1)
TEST_ERROR
-
+
/* Close file */
if(H5Fclose(fid) < 0)
TEST_ERROR
@@ -7803,7 +7803,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
} else {
SKIPPED();
- puts(" Current VFD doesn't support persisting free-space or paged aggregation strategy");
+ HDputs(" Current VFD doesn't support persisting free-space or paged aggregation strategy");
}
return(0);
@@ -7838,7 +7838,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
hid_t fid = -1; /* File ID */
hid_t fcpl = -1; /* File creation property list */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr1; /* Address for small meta data block */
+ haddr_t addr1; /* Address for small metadata block */
haddr_t saddr1; /* Address for small raw data block */
haddr_t gaddr1; /* Address for large data block */
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
@@ -7872,14 +7872,14 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
if(NULL == (f = (H5F_t *)H5I_object(fid)))
FAIL_STACK_ERROR
- /* Allocate a small meta data block with addr1 */
+ /* Allocate a small metadata block with addr1 */
addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
/* Try to shrink the block with addr1 */
if((status = H5MF_try_shrink(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE50)) < 0)
FAIL_STACK_ERROR
- /* Couldn't shrink due to the section (remaining space in the page) is in the small meta data free-space manager */
+ /* Couldn't shrink due to the section (remaining space in the page) is in the small metadata free-space manager */
if(status == TRUE) TEST_ERROR
/* Allocate a small raw data block with saddr1 */
@@ -7927,7 +7927,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
} else {
SKIPPED();
- puts(" Current VFD doesn't support paged aggregation");
+ HDputs(" Current VFD doesn't support paged aggregation");
}
return(0);
@@ -7961,7 +7961,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
hid_t fid = -1; /* File ID */
hid_t fcpl = -1; /* File creation property list */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr1, addr2, addr3; /* Addresses for small meta data blocks */
+ haddr_t addr1, addr2, addr3; /* Addresses for small metadata blocks */
haddr_t saddr1; /* Address for small raw data block */
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
htri_t was_extended; /* Whether the block can be extended or not */
@@ -7993,7 +7993,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
if(NULL == (f = (H5F_t *)H5I_object(fid)))
FAIL_STACK_ERROR
- /* Allocate a small meta data block with addr1 */
+ /* Allocate a small metadata block with addr1 */
addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE98);
/* Try extending the block with addr1 at EOF not crossing page boundary */
@@ -8001,7 +8001,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
/* Should succeed */
if(was_extended != TRUE) TEST_ERROR
- /* Allocate 2 small meta data blocks with addr2 and addr3--will be on another meta data page */
+ /* Allocate 2 small metadata blocks with addr2 and addr3--will be on another metadata page */
addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE100);
addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE150);
@@ -8024,13 +8024,13 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE50);
/* Should succeed */
if(was_extended != TRUE) TEST_ERROR
-
+
/* Free the block with addr1 */
H5MF_xfree(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE3248);
- /* Allocate a new meta data block with addr1 */
+ /* Allocate a new metadata block with addr1 */
/* There is a page end threshold of size H5F_FILE_SPACE_PGEND_META_THRES at the end of the block */
- /* The block is right next to the threshold */
+ /* The block is right next to the threshold */
addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3286);
/* Try extending the block into the threshold with size > H5F_FILE_SPACE_PGEND_META_THRES */
@@ -8082,7 +8082,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
} else {
SKIPPED();
- puts(" Current VFD doesn't support paged aggregation");
+ HDputs(" Current VFD doesn't support paged aggregation");
}
return(0);
@@ -8192,7 +8192,7 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl)
if(was_extended == FALSE) TEST_ERROR
/* Try extending the block with gaddr2 */
- /* There is no free-space section big enough to fulfill the request (request is < H5F_FILE_SPACE_PGEND_META_THRES) */
+ /* There is no free-space section big enough to fulfill the request (request is < H5F_FILE_SPACE_PGEND_META_THRES) */
was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5);
/* Should not succeed */
if(was_extended == TRUE) TEST_ERROR
@@ -8223,7 +8223,7 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl)
} else {
SKIPPED();
- puts(" Current VFD doesn't support paged aggregation strategy");
+ HDputs(" Current VFD doesn't support paged aggregation strategy");
}
return(0);
@@ -8280,7 +8280,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl)
/* Set the strategy to paged aggregation */
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0)
FAIL_STACK_ERROR
-
+
/* Create the file to work on */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
FAIL_STACK_ERROR
@@ -8355,7 +8355,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
if(fs_stat.tot_space != (16384+288))
TEST_ERROR
-
+
/* Close file */
if(H5Fclose(fid) < 0)
FAIL_STACK_ERROR
@@ -8376,7 +8376,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl)
} else {
SKIPPED();
- puts(" Current VFD doesn't support paged aggregation strategy");
+ HDputs(" Current VFD doesn't support paged aggregation strategy");
}
return(0);
@@ -8409,7 +8409,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl = -1; /* File creation property list */
H5F_t *f = NULL; /* Internal file object pointer */
haddr_t addr2, addr3, addr4, addr5; /* Addresses for blocks */
- haddr_t addr9, addr10, addr11; /* Address for small meta data blocks */
+ haddr_t addr9, addr10, addr11; /* Address for small metadata blocks */
haddr_t saddr1, saddr2; /* Addresses for small raw data blocks */
H5FS_stat_t fs_stat; /* Information for free-space manager */
char filename[FILENAME_LEN]; /* Filename to use */
@@ -8423,7 +8423,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
multi = TRUE;
else if(!HDstrcmp(env_h5_drvr, "family"))
family = TRUE;
-
+
if(!multi && !split) {
/* Set the filename to use for this test (dependent on fapl) */
@@ -8445,7 +8445,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(NULL == (f = (H5F_t *)H5I_object(fid)))
FAIL_STACK_ERROR
- /* Allocate 2 small meta data blocks: addr1, addr2 */
+ /* Allocate 2 small metadata blocks: addr1, addr2 */
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30);
addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
@@ -8464,13 +8464,13 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(saddr2 != (saddr1 + TBLOCK_SIZE30))
TEST_ERROR
- /* Allocate a small meta data block with addr3--there is no free-space section big enough to fulfill the request */
+ /* Allocate a small metadata block with addr3--there is no free-space section big enough to fulfill the request */
addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE4020);
/* Should be on the third page and page aligned */
if(addr3 % TBLOCK_SIZE4096)
TEST_ERROR
- /* Allocate a small meta data block with addr4--there is a free-space section big enough to fulfill the request */
+ /* Allocate a small metadata block with addr4--there is a free-space section big enough to fulfill the request */
addr4 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80);
/* Should not be page aligned */
if(!(addr4 % TBLOCK_SIZE4096))
@@ -8479,7 +8479,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(addr4 != (addr2 + TBLOCK_SIZE50))
TEST_ERROR
- /* Allocate a small meta data block with addr5--there is a free-space section big enough to fulfill the request */
+ /* Allocate a small metadata block with addr5--there is a free-space section big enough to fulfill the request */
addr5 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE40);
/* Should not be page aligned */
if(!(addr5 % TBLOCK_SIZE4096))
@@ -8489,16 +8489,16 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(addr5 != (addr3 + TBLOCK_SIZE4020))
TEST_ERROR
- /* Allocate a small meta data block with addr6--taking up the remaining space in the first page */
+ /* Allocate a small metadata block with addr6--taking up the remaining space in the first page */
if(family)
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3080);
else
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3088);
- /* Allocate a small meta data block with addr7--taking up the remaining space in the third page */
+ /* Allocate a small metadata block with addr7--taking up the remaining space in the third page */
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE36);
- /* Allocate 2 small meta data blocks: addr8, addr9--there is no free-space to fulfill the request */
+ /* Allocate 2 small metadata blocks: addr8, addr9--there is no free-space to fulfill the request */
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
addr9 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80);
@@ -8514,13 +8514,13 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(fs_stat.tot_space != TBLOCK_SIZE4096)
TEST_ERROR
- /* Allocate a small meta data block with addr10--there is a free-space section big enough to fulfill the request */
+ /* Allocate a small metadata block with addr10--there is a free-space section big enough to fulfill the request */
addr10 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3900);
/* The block should be next to the block with addr9 */
if(addr10 != (addr9 + TBLOCK_SIZE80))
TEST_ERROR
- /* Allocate a small meta data block with addr11 */
+ /* Allocate a small metadata block with addr11 */
/* The current free-space section is unable to fulfill the request; obtain a page from the large manager */
addr11 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80);
/* The address of the block should be the same the freed block with saddr1 */
@@ -8539,7 +8539,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
} else {
SKIPPED();
- puts(" Current VFD doesn't support paged aggregation strategy");
+ HDputs(" Current VFD doesn't support paged aggregation strategy");
}
return(0);
@@ -8557,7 +8557,7 @@ error:
* Function: test_page_alignment
*
* Purpose: To verify the proper alignment is used when H5Pset_alignment()
- * is set and paged aggregation is enabled.
+ * is set and paged aggregation is enabled.
*
* Return: Success: 0
* Failure: number of errors
@@ -8575,7 +8575,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl2 = -1; /* File creation property list ID */
hid_t fapl_new = -1; /* File access property list ID */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr1, addr2; /* Addresses for small meta data blocks */
+ haddr_t addr1, addr2; /* Addresses for small metadata blocks */
haddr_t saddr1, saddr2; /* Addresses for small raw data blocks */
haddr_t gaddr1, gaddr2; /* Addresses for blocks */
char filename[FILENAME_LEN]; /* Filename to use */
@@ -8588,7 +8588,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
split = TRUE;
else if(!HDstrcmp(env_h5_drvr, "multi"))
multi = TRUE;
-
+
if(!multi && !split) {
/* Set the filename to use for this test (dependent on fapl) */
@@ -8680,7 +8680,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
/* The alignment to use will be the library's default file space page size */
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0)
TEST_ERROR
-
+
/* Create the file to work on */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl_new)) < 0)
TEST_ERROR
@@ -8721,7 +8721,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(fid) < 0)
TEST_ERROR
- /*
+ /*
* Case 2: Verify that the alignment in use is the alignment set
* via H5Pset_alignment when paged aggregation not enabled.
*/
@@ -8729,7 +8729,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
/* Disable small data block mechanism */
if(H5Pset_small_data_block_size(fapl_new, (hsize_t)0) < 0)
TEST_ERROR
- /* Disable meta data block mechanism */
+ /* Disable metadata block mechanism */
if(H5Pset_meta_block_size(fapl_new, (hsize_t)0) < 0)
TEST_ERROR
@@ -8741,7 +8741,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
if(NULL == (f = (H5F_t *)H5I_object(fid)))
TEST_ERROR
- /* Allocate 2 small meta data blocks */
+ /* Allocate 2 small metadata blocks */
addr1 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30);
addr2 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50);
@@ -8778,7 +8778,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(fid) < 0)
TEST_ERROR
- /*
+ /*
* Case 3: Verify that the alignment in use is the alignment set
* via H5Pset_alignment when paged aggregation not enabled.
*/
@@ -8801,7 +8801,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
/* Get a pointer to the internal file object */
if(NULL == (f = (H5F_t *)H5I_object(fid)))
TEST_ERROR
-
+
/* Allocate 2 small raw data blocks */
saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30);
saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50);
@@ -8845,7 +8845,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
} else {
SKIPPED();
- puts(" Current VFD doesn't support persisting free-space or paged aggregation strategy");
+ HDputs(" Current VFD doesn't support persisting free-space or paged aggregation strategy");
}
return(0);
@@ -8863,10 +8863,10 @@ error:
int
main(void)
{
- hid_t fapl = -1; /* File access property list for data files */
- hid_t new_fapl = -1; /* File access property list for alignment & aggr setting */
+ hid_t fapl = -1; /* File access property list for data files */
+ hid_t new_fapl = -1; /* File access property list for alignment & aggr setting */
unsigned nerrors = 0; /* Cumulative error count */
- test_type_t curr_test; /* Current test being worked on */
+ test_type_t curr_test; /* Current test being worked on */
const char *env_h5_drvr; /* File Driver value from environment */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
@@ -8968,7 +8968,7 @@ main(void)
nerrors += test_mf_strat_thres_persist(env_h5_drvr, fapl, FALSE);
nerrors += test_mf_strat_thres_persist(env_h5_drvr, fapl, TRUE);
- /* Temporary skipped for multi/split drivers:
+ /* Temporary skipped for multi/split drivers:
fail file create when persisting free-space or using paged aggregation strategy */
#ifdef PB_OUT
/* Tests specific for multi and split files--persisting free-space */
@@ -8976,7 +8976,7 @@ main(void)
nerrors += test_mf_fs_persist_multi();
#endif
- /*
+ /*
* Tests specific for file space paging
*/
/* Temporary: The following 7 tests are modified to skip testing for multi/split driver:
@@ -9002,12 +9002,12 @@ main(void)
if(nerrors)
goto error;
- puts("All free-space manager tests for file memory passed.");
+ HDputs("All free-space manager tests for file memory passed.");
return(0);
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
H5Pclose(fapl);
H5Pclose(new_fapl);
diff --git a/test/mount.c b/test/mount.c
index c6230ee..b7d2858 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -192,7 +192,7 @@ test_illegal(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Mounting a file on itself should have failed.");
+ HDputs(" Mounting a file on itself should have failed.");
TEST_ERROR
} /* end if */
@@ -208,7 +208,7 @@ test_illegal(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Mounting two files at one mount point should have failed.");
+ HDputs(" Mounting two files at one mount point should have failed.");
TEST_ERROR
} /* end if */
if(H5Funmount(mnt, ".") < 0) FAIL_STACK_ERROR
@@ -227,7 +227,7 @@ test_illegal(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Mounting same file opened twice at one mount point should have failed.");
+ HDputs(" Mounting same file opened twice at one mount point should have failed.");
TEST_ERROR
} /* end if */
if(H5Funmount(mnt, ".") < 0) FAIL_STACK_ERROR
@@ -240,7 +240,7 @@ test_illegal(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Creating a cycle with mount points should have failed.");
+ HDputs(" Creating a cycle with mount points should have failed.");
TEST_ERROR
} /* end if */
if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR
@@ -423,7 +423,7 @@ test_hide(hid_t fapl)
} H5E_END_TRY;
if(grp >= 0) {
H5_FAILED();
- puts(" Name is still accessible under mount point.");
+ HDputs(" Name is still accessible under mount point.");
TEST_ERROR
} /* end if */
@@ -434,7 +434,7 @@ test_hide(hid_t fapl)
if(H5Oget_info_by_name2(file1, "/file1", &oi2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(oi1.fileno != oi2.fileno || H5F_addr_ne(oi1.addr, oi2.addr)) {
H5_FAILED();
- puts(" Hard link failed for hidden object.");
+ HDputs(" Hard link failed for hidden object.");
TEST_ERROR
} /* end if */
@@ -503,7 +503,7 @@ test_assoc(hid_t fapl)
if(oi1.fileno != oi2.fileno || H5F_addr_ne(oi1.addr, oi2.addr)) {
H5_FAILED();
- puts(" Association failed.");
+ HDputs(" Association failed.");
TEST_ERROR
} /* end if */
@@ -628,7 +628,7 @@ test_move(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Moving an object across files should't have been possible");
+ HDputs(" Moving an object across files should't have been possible");
TEST_ERROR
} /* end if */
@@ -834,7 +834,7 @@ test_unlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Incorrect traversal from mount point!");
+ HDputs(" Incorrect traversal from mount point!");
TEST_ERROR
} /* end if */
@@ -851,7 +851,7 @@ test_unlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Traversal through mount point should not have worked!");
+ HDputs(" Traversal through mount point should not have worked!");
TEST_ERROR
} /* end if */
H5E_BEGIN_TRY {
@@ -859,7 +859,7 @@ test_unlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Traversal through mount point should not have worked!");
+ HDputs(" Traversal through mount point should not have worked!");
TEST_ERROR
} /* end if */
@@ -873,7 +873,7 @@ test_unlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- printf(" %d: Unmount by name should not have been allowed!\n",__LINE__);
+ HDprintf(" %d: Unmount by name should not have been allowed!\n",__LINE__);
TEST_ERROR
} /* end if */
H5E_BEGIN_TRY {
@@ -881,7 +881,7 @@ test_unlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- printf(" %d: Unmount by name should not have been allowed!\n",__LINE__);
+ HDprintf(" %d: Unmount by name should not have been allowed!\n",__LINE__);
TEST_ERROR
} /* end if */
if(H5Funmount(mnt, ".") < 0) FAIL_STACK_ERROR
@@ -1005,7 +1005,7 @@ test_interlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Interfile hard link should not have been allowed!");
+ HDputs(" Interfile hard link should not have been allowed!");
TEST_ERROR
} /* end if */
@@ -1015,7 +1015,7 @@ test_interlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Interfile renaming should not have been allowed!");
+ HDputs(" Interfile renaming should not have been allowed!");
TEST_ERROR
} /* end if */
@@ -1033,7 +1033,7 @@ test_interlink(hid_t fapl)
} H5E_END_TRY;
if(dset >= 0) {
H5_FAILED();
- puts(" Dataset and shared type must be in the same file!");
+ HDputs(" Dataset and shared type must be in the same file!");
TEST_ERROR
} /* end if */
@@ -1172,7 +1172,7 @@ test_close(hid_t fapl)
if(H5Fclose(file1) < 0) FAIL_STACK_ERROR
if(H5Oget_info_by_name2(file2, "/mnt1", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) {
H5_FAILED();
- puts(" File1 contents are not accessible!");
+ HDputs(" File1 contents are not accessible!");
TEST_ERROR
} /* end if */
if(H5Fclose(file2) < 0) FAIL_STACK_ERROR
@@ -4379,13 +4379,13 @@ main(void)
if (nerrors) goto error;
- puts("All mount tests passed.");
+ HDputs("All mount tests passed.");
h5_cleanup(FILENAME, fapl);
return 0;
error:
- puts("***** MOUNT ERRORS *****");
+ HDputs("***** MOUNT ERRORS *****");
return 1;
}
diff --git a/test/mtime.c b/test/mtime.c
index 80730eb..f7a441d 100644
--- a/test/mtime.c
+++ b/test/mtime.c
@@ -15,10 +15,10 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Thursday, July 30, 1998
*
- * Purpose: Determines if the modification time message is working
- * properly. Specifically, the code in H5O_mtime_decode() is
- * very OS-dependent and this test tries to figure out if it's
- * working properly.
+ * Purpose: Determines if the modification time message is working
+ * properly. Specifically, the code in H5O_mtime_decode() is
+ * very OS-dependent and this test tries to figure out if it's
+ * working properly.
*/
#include "h5test.h"
#include "H5srcdir.h"
@@ -33,17 +33,17 @@ const char *FILENAME[] = {
#define TESTFILE2 "tmtimen.h5"
#define MTIME2 1041606478
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: H5O_mtime_decode() test.
+ * Purpose: H5O_mtime_decode() test.
*
- * Return: Success:
+ * Return: Success:
*
- * Failure:
+ * Failure:
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, July 30, 1998
*
* Modifications:
@@ -58,13 +58,13 @@ const char *FILENAME[] = {
int
main(void)
{
- hid_t fapl, file, space, dset;
- hsize_t size[1] = {2};
- time_t now;
- struct tm *tm;
- H5O_info_t oi1, oi2;
- signed char buf1[32], buf2[32];
- char filename[1024];
+ hid_t fapl, file, space, dset;
+ hsize_t size[1] = {2};
+ time_t now;
+ struct tm *tm;
+ H5O_info_t oi1, oi2;
+ signed char buf1[32], buf2[32];
+ char filename[1024];
h5_reset();
fapl = h5_fileaccess();
@@ -99,18 +99,18 @@ main(void)
/* Compare addresses & times from the two ways of calling H5Oget_info() */
if(oi1.addr != oi2.addr || oi1.ctime != oi2.ctime) {
H5_FAILED();
- puts(" Calling H5Oget_info() with the dataset ID returned");
- puts(" different values than calling it with a file and dataset");
- puts(" name.");
+ HDputs(" Calling H5Oget_info() with the dataset ID returned");
+ HDputs(" different values than calling it with a file and dataset");
+ HDputs(" name.");
goto error;
}
/* Compare times -- they must be within 60 seconds of one another */
if(0 == oi1.ctime) {
SKIPPED();
- puts(" The modification time could not be decoded on this OS.");
- puts(" Modification times will be mantained in the file but");
- puts(" cannot be queried on this system. See H5O_mtime_decode().");
+ HDputs(" The modification time could not be decoded on this OS.");
+ HDputs(" Modification times will be mantained in the file but");
+ HDputs(" cannot be queried on this system. See H5O_mtime_decode().");
return 0;
} else if(HDfabs(HDdifftime(now, oi1.ctime)) > (double)60.0F) {
H5_FAILED();
@@ -118,7 +118,7 @@ main(void)
HDstrftime((char*)buf1, sizeof buf1, "%Y-%m-%d %H:%M:%S", tm);
tm = HDlocaltime(&now);
HDstrftime((char*)buf2, sizeof buf2, "%Y-%m-%d %H:%M:%S", tm);
- printf(" got: %s\n ans: %s\n", buf1, buf2);
+ HDprintf(" got: %s\n ans: %s\n", buf1, buf2);
goto error;
}
PASSED();
@@ -147,7 +147,7 @@ main(void)
}
else {
H5_FAILED();
- printf("***cannot open the pre-created old modification test file (%s)\n",
+ HDprintf("***cannot open the pre-created old modification test file (%s)\n",
testfile);
goto error;
} /* end else */
@@ -168,14 +168,14 @@ main(void)
TEST_ERROR;
if(oi2.ctime != MTIME2) {
H5_FAILED();
- puts(" Modification time incorrect.");
+ HDputs(" Modification time incorrect.");
goto error;
}
if(H5Fclose(file) < 0) TEST_ERROR;
}
else {
H5_FAILED();
- printf("***cannot open the pre-created old modification test file (%s)\n",
+ HDprintf("***cannot open the pre-created old modification test file (%s)\n",
testfile);
goto error;
} /* end else */
@@ -186,7 +186,7 @@ main(void)
if(h5_verify_cached_stabs(FILENAME, fapl) < 0) TEST_ERROR
/* All looks good */
- puts("All modification time tests passed.");
+ HDputs("All modification time tests passed.");
h5_cleanup(FILENAME, fapl);
return 0;
diff --git a/test/ntypes.c b/test/ntypes.c
index b6f4de7..83cdfd2 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -149,8 +149,8 @@ test_atomic_dtype(hid_t file)
for(j = 0; j < DIM1; j++)
if(ipoints2[i][j] != icheck2[i][j]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
goto error;
} /* end if */
@@ -521,8 +521,8 @@ test_compound_dtype2(hid_t file)
temp_point->st.ll2 != temp_check->st.ll2 ||
temp_point->l != temp_check->l ) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
goto error;
} /* end if */
} /* end for */
@@ -728,8 +728,8 @@ test_compound_dtype(hid_t file)
temp_point->i != temp_check->i ||
temp_point->l != temp_check->l ) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
goto error;
} /* end if */
@@ -942,16 +942,16 @@ test_compound_dtype3(hid_t file)
if(temp_point->c != temp_check->c ||
temp_point->l != temp_check->l ) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
goto error;
} /* end if */
for(k = 0; k < 5; k++) {
if(temp_point->a[k] != temp_check->a[k]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d,%d\n", i, j, k);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d,%d\n", i, j, k);
goto error;
} /* end if */
} /* end for */
@@ -1157,16 +1157,16 @@ test_compound_opaque(hid_t file)
if(temp_point->c != temp_check->c ||
temp_point->l != temp_check->l ) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
goto error;
} /* end if */
for(k = 0; k < 5; k++) {
if(temp_point->o[k] != temp_check->o[k]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d,%d\n", i, j, k);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d,%d\n", i, j, k);
goto error;
} /* end if */
} /* end for */
@@ -1320,9 +1320,9 @@ test_enum_dtype(hid_t file)
for(j = 0; j < DIM1; j++)
if(spoints2[i][j] != scheck2[i][j]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
- printf(" spoints2[i][j]=%hd, scheck2[i][j]=%hd\n", spoints2[i][j],
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
+ HDprintf(" spoints2[i][j]=%hd, scheck2[i][j]=%hd\n", spoints2[i][j],
scheck2[i][j]);
goto error;
} /* end if */
@@ -1476,8 +1476,8 @@ test_array_dtype(hid_t file)
temp_point->i != temp_check->i ||
temp_point->l != temp_check->l ) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
goto error;
} /* end if */
@@ -1610,8 +1610,8 @@ test_array_dtype2(hid_t file)
for(k = 0; k < 5; k++)
if(icheck3[i][j][k] != ipoints3[i][j][k]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d,%d\n", i, j);
goto error;
} /* end if */
@@ -1677,7 +1677,7 @@ test_vl_dtype(hid_t file)
wdata[i].p = HDmalloc((i + 1) * sizeof(hvl_t));
if(NULL == wdata[i].p) {
H5_FAILED();
- printf(" Cannot allocate memory for VL data! i=%u\n",(unsigned)i);
+ HDprintf(" Cannot allocate memory for VL data! i=%u\n",(unsigned)i);
goto error;
} /* end if */
wdata[i].len = i + 1;
@@ -1685,7 +1685,7 @@ test_vl_dtype(hid_t file)
t1->p = HDmalloc((j + 1) * sizeof(unsigned int));
if(NULL == t1->p) {
H5_FAILED();
- printf(" Cannot allocate memory for VL data! i=%u, j=%u\n",(unsigned)i,(unsigned)j);
+ HDprintf(" Cannot allocate memory for VL data! i=%u, j=%u\n",(unsigned)i,(unsigned)j);
goto error;
} /* end if */
t1->len = j + 1;
@@ -1745,13 +1745,13 @@ test_vl_dtype(hid_t file)
for(i = 0; i < SPACE1_DIM1; i++) {
if(wdata[i].len != rdata[i].len) {
H5_FAILED();
- printf(" VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len);
+ HDprintf(" VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len);
goto error;
} /* end if */
for(t1 = (hvl_t *)wdata[i].p, t2 = (hvl_t *)rdata[i].p, j = 0; j < rdata[i].len; j++, t1++, t2++) {
if(t1->len != t2->len) {
H5_FAILED();
- printf(" VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len);
+ HDprintf(" VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len);
goto error;
} /* end if */
@@ -1767,7 +1767,7 @@ test_vl_dtype(hid_t file)
for(k = 0; k < t2->len; k++) {
if(((unsigned int *)t1->p)[k] != ((unsigned int *)tmp)[k]) {
H5_FAILED();
- printf(" VL data don't match!, wdata[%u].p=%d, rdata[%u].p=%u\n",
+ HDprintf(" VL data don't match!, wdata[%u].p=%d, rdata[%u].p=%u\n",
(unsigned)i, ((unsigned int*)t1->p)[k], (unsigned)i, ((unsigned int*)tmp)[k]);
goto error;
} /* end if */
@@ -1903,13 +1903,13 @@ test_vlstr_dtype(hid_t file)
for(i = 0; i < SPACE1_DIM1; i++) {
if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
H5_FAILED();
- printf(" VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",
+ HDprintf(" VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",
(int)i, (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
goto error;
} /* end if */
if(HDstrcmp(wdata[i], rdata[i]) != 0 ) {
H5_FAILED();
- printf(" VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",
+ HDprintf(" VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",
(int)i, wdata[i], (int)i, rdata[i]);
goto error;
} /* end if */
@@ -2026,13 +2026,13 @@ test_str_dtype(hid_t file)
for(i = 0; i < SPACE1_DIM1; i++) {
if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
H5_FAILED();
- printf(" data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",
+ HDprintf(" data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",
(int)i, (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
goto error;
} /* end if */
if(HDstrcmp(wdata[i], rdata[i]) != 0 ) {
H5_FAILED();
- printf(" data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",
+ HDprintf(" data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",
(int)i, wdata[i], (int)i, rdata[i]);
goto error;
} /* end if */
@@ -2507,8 +2507,8 @@ test_opaque_dtype(hid_t file)
for(i = 0; i < sizeof(rbuf); i++)
if(rbuf[i] != wbuf[i]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %u\n", (unsigned)i);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %u\n", (unsigned)i);
goto error;
} /* end if */
@@ -2612,8 +2612,8 @@ test_bitfield_dtype(hid_t file)
for(i = 0; i < BITFIELD_ENUMB*4; i++) {
if(*p != wbuf[i]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %zu\n", i);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %zu\n", i);
TEST_ERROR;
}
p++;
@@ -2637,8 +2637,8 @@ test_bitfield_dtype(hid_t file)
for(i = 0; i < BITFIELD_ENUMB; i++) {
if(intr[i] != intw[i]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %zu\n", i);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %zu\n", i);
TEST_ERROR;
}
}
@@ -2792,13 +2792,13 @@ test_ninteger(void)
/* check */
if(H5Tget_precision(nid1) != H5Tget_precision(nid2)) {
- printf(" Precision differ.\n");
+ HDprintf(" Precision differ.\n");
TEST_ERROR
} /* end if */
/* compare dataset creation property lists */
if(H5Pequal(dcpl1, dcpl2) <= 0) {
- printf(" Property lists differ.\n");
+ HDprintf(" Property lists differ.\n");
TEST_ERROR
} /* end if */
@@ -2806,8 +2806,8 @@ test_ninteger(void)
for(i = 0; i < DIM3; i++)
if(buf[i] != chk[i]) {
H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d\n", i);
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %d\n", i);
TEST_ERROR
} /* end if */
@@ -2898,7 +2898,7 @@ main(void)
if(nerrors)
goto error;
- printf("All native datatype tests passed.\n");
+ HDprintf("All native datatype tests passed.\n");
h5_cleanup(FILENAME, fapl);
return 0;
@@ -2910,7 +2910,7 @@ error:
} H5E_END_TRY;
nerrors = MAX(1, nerrors);
- printf("***** %d DATASET TEST%s FAILED! *****\n",
+ HDprintf("***** %d DATASET TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
return 1;
diff --git a/test/objcopy.c b/test/objcopy.c
index 18de027..3c5981c 100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -284,8 +284,6 @@ addr_reset(void)
* Programmer: Peter Cao
* Friday, August 4, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -345,8 +343,6 @@ error:
* Programmer: Peter Cao
* Monday, March 5, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -422,8 +418,6 @@ error:
* Programmer: Peter Cao
* Friday, August 4, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -517,8 +511,6 @@ error:
* Programmer: Peter Cao
* Saturday, December 17, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -579,8 +571,6 @@ done:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -602,7 +592,7 @@ test_copy_attach_attributes(hid_t loc_id, hid_t type_id)
goto done;
for(u = 0; u < num_attributes_g; u++) {
- sprintf(attr_name, "%u attr", u);
+ HDsprintf(attr_name, "%u attr", u);
/* Set attribute data */
attr_data[0] = (int)(100 * u);
@@ -671,7 +661,7 @@ test_copy_attach_paired_attributes(hid_t loc_id, hid_t loc_id2, hid_t type_id)
if((acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE)) < 0) goto done;
for(u = 0; u < num_attributes_g; u++) {
- sprintf(attr_name, "%u attr", u);
+ HDsprintf(attr_name, "%u attr", u);
/* Set attribute data */
attr_data[0] = (int)(100 * u);
@@ -856,10 +846,6 @@ error:
* Note: This isn't very general, the attributes are assumed to be
* those written in test_copy_attach_attributes().
*
- * Modifier: Peter Cao
- * Wednesday, March 21, 2007
- * Change to compare any attributes of two objects
- *
*-------------------------------------------------------------------------
*/
static int
@@ -986,15 +972,15 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
* for each */
for(elmt=0; elmt<nelmts; elmt++) {
/* Check vlen lengths */
- if(((const hvl_t *)memb1)->len
- != ((const hvl_t *)memb2)->len)
+ if(((const hvl_t *)((const void *)memb1))->len
+ != ((const hvl_t *)((const void *)memb2))->len)
TEST_ERROR
/* Check vlen data */
if(!compare_data(parent1, parent2, pid, base_id,
- ((const hvl_t *)memb1)->len,
- ((const hvl_t *)memb1)->p,
- ((const hvl_t *)memb2)->p, obj_owner))
+ ((const hvl_t *)((const void *)memb1))->len,
+ ((const hvl_t *)((const void *)memb1))->p,
+ ((const hvl_t *)((const void *)memb2))->p, obj_owner))
TEST_ERROR
/* Update member pointers */
@@ -1213,8 +1199,8 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
hssize_t nelmts; /* # of elements in dataspace */
void *rbuf = NULL; /* Buffer for reading raw data */
void *rbuf2 = NULL; /* Buffer for reading raw data */
- H5D_space_status_t space_status; /* Dataset's raw data space status */
- H5D_space_status_t space_status2; /* Dataset's raw data space status */
+ H5D_space_status_t space_status; /* Dataset's raw dataspace status */
+ H5D_space_status_t space_status2; /* Dataset's raw dataspace status */
/* Check the datatypes are equal */
@@ -1471,7 +1457,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
case H5O_TYPE_UNKNOWN:
case H5O_TYPE_NTYPES:
default:
-HDassert(0 && "Unknown type of object");
+ HDassert(0 && "Unknown type of object");
break;
} /* end switch */
@@ -1569,8 +1555,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1858,8 +1842,6 @@ error:
* Programmer: Neil
* Friday, March 11, 2011
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1999,8 +1981,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -2136,9 +2116,7 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src)
char src_fname[NAME_BUF_SIZE]; /* Name of source file */
char dst_fname[NAME_BUF_SIZE]; /* Name of destination file */
H5F_libver_t low, high; /* File format bounds */
- H5F_libver_t low_src, high_src; /* Source file format bounds */
- unsigned srcdset_fillversion; /* Fill version of source dataset */
- hbool_t valid_high = FALSE; /* TRUE if high bound is valid */
+ unsigned srcdset_layoutversion; /* Layout version of source dataset */
int i, j; /* Local index variables */
H5D_t *dsetp = NULL; /* Pointer to internal dset structure */
herr_t ret; /* Generic return value */
@@ -2151,7 +2129,7 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src)
buf[i][j] = 10000 + 100*i+j;
/* Create a file access property list for destination file */
- if ((fapl_dst = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR
+ if ((fapl_dst = h5_fileaccess()) < 0) TEST_ERROR
/* Initialize the filenames */
h5_fixname(FILENAME[4], fapl_src, src_fname, sizeof src_fname);
@@ -2181,7 +2159,7 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src)
/* Get the internal dset ptr to get the fill version for verifying later */
if ((dsetp = (H5D_t *)H5I_object(did_src)) == NULL) TEST_ERROR
- srcdset_fillversion = dsetp->shared->dcpl_cache.fill.version;
+ srcdset_layoutversion = dsetp->shared->layout.version;
/* Close dataspace */
if(H5Sclose(sid) < 0) TEST_ERROR
@@ -2226,9 +2204,9 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src)
/* If copy failed, check if the failure is expected */
if (ret < 0)
{
- /* Failure is valid if fill version of source dataset is
+ /* Failure is valid if layout version of source dataset is
greater than destination */
- if (srcdset_fillversion <= H5O_fill_ver_bounds[high])
+ if (srcdset_layoutversion <= H5O_layout_ver_bounds[high])
TEST_ERROR
/* Close the DST file before continue */
@@ -2295,8 +2273,6 @@ error:
* Programmer: Neil Fortner
* Thursday, January 15, 2009
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -2520,8 +2496,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -2652,8 +2626,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -4397,8 +4369,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -5872,12 +5842,14 @@ compare_attribute_compound_vlstr(hid_t loc, hid_t loc2)
{
hid_t aid = -1, aid2 = -1; /* Attribute IDs */
hid_t tid = -1, tid2 = -1; /* Datatype IDs */
+ hid_t sid = -1, sid2 = -1; /* Dataspace IDs */
+ hid_t dxpl_id = -1;
typedef struct { /* Compound structure for the attribute */
int i;
char *v;
} s1;
s1 rbuf; /* Buffer for data read */
- s1 rbuf2; /* Buffer for data read */
+ s1 rbuf2; /* Buffer for data read */
/* Open the attributes attached to the objects */
if((aid = H5Aopen_by_idx(loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -5891,6 +5863,12 @@ compare_attribute_compound_vlstr(hid_t loc, hid_t loc2)
if((tid2 = H5Aget_type(aid2)) < 0)
FAIL_STACK_ERROR
+ /* Get the attributes' dataspaces */
+ if((sid = H5Aget_space(aid)) < 0)
+ FAIL_STACK_ERROR
+ if((sid2 = H5Aget_space(aid2)) < 0)
+ FAIL_STACK_ERROR
+
/* Read the attributes */
if(H5Aread(aid, tid, &rbuf) < 0)
FAIL_STACK_ERROR
@@ -5905,6 +5883,19 @@ compare_attribute_compound_vlstr(hid_t loc, hid_t loc2)
if(HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v)))
FAIL_STACK_ERROR
+ /* Reclaim vlen buffer */
+ if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
+ if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
+ if(H5Dvlen_reclaim(tid, sid, dxpl_id, &rbuf) < 0) TEST_ERROR
+ if(H5Dvlen_reclaim(tid, sid, dxpl_id, &rbuf2) < 0) TEST_ERROR
+ if(H5Pclose(dxpl_id) < 0) TEST_ERROR
+
+ /* Close the dataspaces */
+ if(H5Sclose(sid) < 0)
+ FAIL_STACK_ERROR
+ if(H5Sclose(sid2) < 0)
+ FAIL_STACK_ERROR
+
/* Close the attributes */
if(H5Aclose(aid) < 0)
FAIL_STACK_ERROR
@@ -5916,8 +5907,13 @@ error:
H5E_BEGIN_TRY {
H5Aclose(aid);
H5Aclose(aid2);
+ H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, &rbuf);
+ H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, &rbuf2);
+ H5Sclose(sid);
+ H5Sclose(sid2);
H5Tclose(tid);
H5Tclose(tid2);
+ H5Pclose(dxpl_id);
} H5E_END_TRY;
return FALSE;
@@ -6256,8 +6252,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6351,8 +6345,6 @@ error:
* Programmer: Peter Cao
* August 8, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6484,8 +6476,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6667,15 +6657,15 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f
/* create nested sub-groups & datasets */
for(i = 0; i < NUM_SUB_GROUPS; i++) {
- sprintf(objname, "Group #%d", i);
+ HDsprintf(objname, "Group #%d", i);
if((gid_sub = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
for(j = 0; j < NUM_SUB_GROUPS; j++) {
- sprintf(objname, "Group #%d", j);
+ HDsprintf(objname, "Group #%d", j);
if((gid_sub2 = H5Gcreate2(gid_sub, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
for(k = 0; k < NUM_DATASETS; k++) {
- sprintf(objname, "Dataset #%d", k);
+ HDsprintf(objname, "Dataset #%d", k);
/* add a dataset to the group */
if((did = H5Dcreate2(gid_sub2, objname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -6908,11 +6898,11 @@ test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* create wide sub-group hierarchy, with multiple links to higher groups */
for(u = 0; u < NUM_WIDE_LOOP_GROUPS; u++) {
- sprintf(objname, "%s-%u", NAME_GROUP_SUB, u);
+ HDsprintf(objname, "%s-%u", NAME_GROUP_SUB, u);
if((gid_sub = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
for(v = 0; v < NUM_WIDE_LOOP_GROUPS; v++) {
- sprintf(objname, "%s-%u", NAME_GROUP_SUB_SUB2, v);
+ HDsprintf(objname, "%s-%u", NAME_GROUP_SUB_SUB2, v);
if((gid_sub2 = H5Gcreate2(gid_sub, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Create link to top group */
@@ -6999,12 +6989,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- * Neil Fortner
- * Tuesday, February 16, 2010
- * Modified test to test flags for expanding soft and external
- * links.
- *
*-------------------------------------------------------------------------
*/
static int
@@ -7854,6 +7838,7 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t did = -1, did2 = -1; /* Dataset IDs */
+ hid_t src_fapl = -1; /* Source file FAPL ID */
const char *src_filename = H5_get_srcdir_filename(FILE_OLD_LAYOUT); /* Corrected test file name */
char dst_filename[NAME_BUF_SIZE];
@@ -7914,6 +7899,7 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
error:
H5E_BEGIN_TRY {
+ H5Pclose(src_fapl);
H5Dclose(did2);
H5Dclose(did);
H5Fclose(fid_dst);
@@ -7984,7 +7970,7 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* make a copy of the datatype for later use */
if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR
- /* named data type */
+ /* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create and set compact plist */
@@ -8138,7 +8124,7 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* make a copy of the datatype for later use */
if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR
- /* named data type */
+ /* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -8293,7 +8279,7 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* make a copy of the datatype for later use */
if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR
- /* named data type */
+ /* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create and set chunk plist */
@@ -8454,7 +8440,7 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_
/* make a copy of the datatype for later use */
if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR
- /* named data type */
+ /* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create and set chunk plist */
@@ -10256,7 +10242,7 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid_src1, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -10280,7 +10266,7 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid_src2, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -10491,7 +10477,7 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid, NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset */
@@ -10518,7 +10504,7 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid, NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset */
@@ -10763,7 +10749,7 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -10790,7 +10776,7 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type "a" */
+ /* committed datatype "a" */
if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@@ -10799,7 +10785,7 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type "b" */
+ /* committed datatype "b" */
if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@@ -10994,7 +10980,7 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -11024,7 +11010,7 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* create anonymous committed data type */
+ /* create anonymous committed datatype */
if((H5Tcommit_anon(fid_dst, tid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create attribute at SRC file */
@@ -12784,7 +12770,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* named data type */
+ /* named datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -12814,7 +12800,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type "a" */
+ /* committed datatype "a" */
if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@@ -12823,7 +12809,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type "b" */
+ /* committed datatype "b" */
if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@@ -13143,7 +13129,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type */
+ /* committed datatype */
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
@@ -13173,7 +13159,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type "a" */
+ /* committed datatype "a" */
if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@@ -13182,7 +13168,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create datatype */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR
- /* committed data type "b" */
+ /* committed datatype "b" */
if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
@@ -13392,7 +13378,7 @@ test_copy_iterate(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl
hid_t fid1 = -1, fid2 = -1; /* File IDs */
hid_t gid = -1; /* Group ID */
int i;
- char grp_name[8];
+ char grp_name[16];
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
@@ -13466,8 +13452,6 @@ error:
* Programmer: Peter Cao
* March 11, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -13784,8 +13768,6 @@ error:
* Programmer: Vailin Choi
* Feb 7, 2012
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -14092,7 +14074,7 @@ error:
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
* Purpose: Test H5Ocopy()
*
@@ -14100,13 +14082,11 @@ error:
* new or old format, messages can be shared in either,
* both, or neither of the source and destination files.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -14126,7 +14106,7 @@ main(void)
ExpressMode = GetTestExpress();
if (ExpressMode > 1)
- printf("***Express test mode on. Some tests may be skipped\n");
+ HDprintf("***Express test mode on. Some tests may be skipped\n");
/* Copy the file access property list */
if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR
@@ -14162,52 +14142,52 @@ main(void)
/* Test with and without shared messages */
if(configuration & CONFIG_SHARE_SRC) {
- puts("\nTesting with shared src messages:");
+ HDputs("\nTesting with shared src messages:");
fcpl_src = fcpl_shared;
}
else {
- puts("\nTesting without shared src messages:");
+ HDputs("\nTesting without shared src messages:");
fcpl_src = H5P_DEFAULT;
}
if(configuration & CONFIG_SHARE_DST) {
- puts("Testing with shared dst messages:");
+ HDputs("Testing with shared dst messages:");
fcpl_dst = fcpl_shared;
same_file = FALSE;
}
else {
- puts("Testing without shared dst messages:");
+ HDputs("Testing without shared dst messages:");
fcpl_dst = H5P_DEFAULT;
}
/* Set the FAPL for the source file's type of format */
if(configuration & CONFIG_SRC_NEW_FORMAT) {
- puts("Testing with latest format for source file:");
+ HDputs("Testing with latest format for source file:");
src_fapl = fapl2;
/* Test with and without dense attributes */
if(configuration & CONFIG_DENSE) {
- puts("Testing with dense attributes:");
+ HDputs("Testing with dense attributes:");
num_attributes_g = max_compact + 1;
}
else {
- puts("Testing without dense attributes:");
+ HDputs("Testing without dense attributes:");
num_attributes_g = MAX(min_dense, 2) - 2;
}
} /* end if */
else {
- puts("Testing with oldest file format for source file:");
+ HDputs("Testing with oldest file format for source file:");
src_fapl = fapl;
num_attributes_g = 4;
} /* end else */
/* Set the FAPL for the destination file's type of format */
if(configuration & CONFIG_DST_NEW_FORMAT) {
- puts("Testing with latest format for destination file:");
+ HDputs("Testing with latest format for destination file:");
dst_fapl = fapl2;
same_file = FALSE;
} /* end if */
else {
- puts("Testing with oldest file format for destination file:");
+ HDputs("Testing with oldest file format for destination file:");
dst_fapl = fapl;
} /* end else */
@@ -14378,12 +14358,12 @@ main(void)
/* Results */
if(nerrors) {
- printf("***** %d OBJECT COPY TEST%s FAILED! *****\n",
+ HDprintf("***** %d OBJECT COPY TEST%s FAILED! *****\n",
nerrors, (1 == nerrors ? "" : "S"));
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
} /* end if */
- puts ("All object copying tests passed.");
+ HDputs ("All object copying tests passed.");
/* close property list.
* NOTE: if this property list is not closed and the test is
@@ -14410,9 +14390,9 @@ main(void)
h5_cleanup(FILENAME, fapl);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
- return 1;
+ HDexit(EXIT_FAILURE);
} /* main */
diff --git a/test/ohdr.c b/test/ohdr.c
index 3f61660..f97254e 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -21,14 +21,14 @@
* This file needs to access private datatypes from the H5O package.
* This file also needs to access the object header testing code.
*/
-#define H5O_FRIEND /*suppress error about including H5Opkg */
+#define H5O_FRIEND /* suppress error about including H5Opkg */
#define H5O_TESTING
#include "H5Opkg.h"
/*
* This file needs to access private datatypes from the H5G package.
*/
-#define H5G_FRIEND /*suppress error about including H5Gpkg */
+#define H5G_FRIEND /* suppress error about including H5Gpkg */
#include "H5Gpkg.h"
#include "H5CXprivate.h" /* API Contexts */
@@ -1189,17 +1189,17 @@ error:
static herr_t
test_ohdr_swmr(hbool_t new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t plist = -1; /* Dataset creation property list */
- size_t compact_size = 1024; /* The size of compact dataset */
- int *wbuf = NULL; /* Buffer for writing */
- hsize_t dims[1]; /* Dimension sizes */
- size_t u; /* Iterator */
- int n; /* Data variable */
- H5O_info_t obj_info; /* Information for the object */
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list */
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t plist = -1; /* Dataset creation property list */
+ size_t compact_size = 1024; /* The size of compact dataset */
+ int *wbuf = NULL; /* Buffer for writing */
+ hsize_t dims[1]; /* Dimension sizes */
+ size_t u; /* Iterator */
+ int n; /* Data variable */
+ H5O_info_t obj_info; /* Information for the object */
if(new_format) {
TESTING("exercise the coding for the re-read of the object header for SWMR access: latest-format");
@@ -1628,46 +1628,6 @@ error:
return FAIL;
} /* test_unknown() */
-#define STR_EARLIEST "earliest"
-#define STR_V18 "v18"
-#define STR_LATEST "latest"
-static char *
-version_string(H5F_libver_t libver)
-{
- char *str = NULL;
-
- str = (char *) HDmalloc(20);
- if (str == NULL) {
- HDfprintf(stderr, "Allocation failed\n");
- HDexit(1);
- }
-
- switch(libver) {
- case H5F_LIBVER_EARLIEST:
- HDstrcpy(str, STR_EARLIEST);
- break;
-
- case H5F_LIBVER_V18:
- HDstrcpy(str, STR_V18);
- break;
-
- case H5F_LIBVER_V110:
- HDassert(H5F_LIBVER_LATEST == H5F_LIBVER_V110);
- HDstrcpy(str, STR_LATEST);
- break;
-
- case H5F_LIBVER_ERROR:
- case H5F_LIBVER_NBOUNDS:
- default:
- HDsprintf(str, "%ld", (long)libver);
- break;
- } /* end switch */
-
- /* Return the formed version bound string */
- return str;
-} /* end of version_string */
-
-
/*-------------------------------------------------------------------------
* Function: main
*
@@ -1676,13 +1636,9 @@ version_string(H5F_libver_t libver)
* Return: Success: 0
* Failure: 1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, November 24, 1998
*
- * Modification:
- * - Added loop of combinations of low/high library format bounds
- * (BMR, Feb 2018)
- *
*-------------------------------------------------------------------------
*/
int
@@ -1696,7 +1652,6 @@ main(void)
H5O_loc_t oh_loc; /* Object header locations */
H5F_libver_t low, high; /* File format bounds */
time_t time_new, ro;
- char msg[80]; /* Message for file format version */
int i; /* Local index variable */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
herr_t ret; /* Generic return value */
@@ -1713,8 +1668,9 @@ main(void)
/* Loop through all the combinations of low/high library format bounds */
for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
- char *low_string = NULL;
- char *high_string = NULL;
+ char *low_string = NULL; /* Message for library version low bound */
+ char *high_string = NULL; /* Message for library version high bound */
+ char msg[80]; /* Message for file format version */
/* Set version bounds before opening the file */
H5E_BEGIN_TRY {
@@ -1725,13 +1681,11 @@ main(void)
continue;
/* Display info about testing */
- low_string = version_string(low);
- high_string = version_string(high);
- sprintf(msg, "Using file format version: (%s, %s)", low_string,
+ low_string = h5_get_version_string(low);
+ high_string = h5_get_version_string(high);
+ HDsprintf(msg, "Using file format version: (%s, %s)", low_string,
high_string);
HDputs(msg);
- HDfree(high_string);
- HDfree(low_string);
/* test on object continuation block */
if(test_cont(filename, fapl) < 0)
@@ -1963,7 +1917,7 @@ main(void)
return 0;
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
H5Fclose(file);
} H5E_END_TRY;
diff --git a/test/page_buffer.c b/test/page_buffer.c
index 3c61ab0..93749a2 100644
--- a/test/page_buffer.c
+++ b/test/page_buffer.c
@@ -21,6 +21,10 @@
#include "h5test.h"
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Iprivate.h"
+#include "H5PBprivate.h"
+
/*
* This file needs to access private information from the H5F package.
*/
@@ -31,12 +35,8 @@
#define H5F_TESTING
#include "H5Fpkg.h"
-#include "H5CXprivate.h" /* API Contexts */
-#include "H5Iprivate.h"
-#include "H5PBprivate.h"
-
-#define FILENAME_LEN 1024
+#define FILENAME_LEN 1024
#define NUM_DSETS 5
#define NX 100
#define NY 50
@@ -97,7 +97,7 @@ create_file(char *filename, hid_t fcpl, hid_t fapl)
int i;
int num_elements;
int j;
- char dset_name[10];
+ char dset_name[32];
if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
FAIL_STACK_ERROR;
@@ -234,7 +234,7 @@ open_file(char *filename, hid_t fapl, hsize_t page_size,
int i;
int j;
int num_elements;
- char dset_name[10];
+ char dset_name[32];
H5F_t *f = NULL;
if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
diff --git a/test/reserved.c b/test/reserved.c
index d8d0c59..7e53d9c 100644
--- a/test/reserved.c
+++ b/test/reserved.c
@@ -22,17 +22,17 @@ const char *FILENAME[] = {
};
/*-------------------------------------------------------------------------
- * Function: rsrv_heap
+ * Function: rsrv_heap
*
- * Purpose: Ensure that heaps reserve file address space.
- * This function does this by creating datasets up to and past
- * the limit of the file, then ensuring that an error (not an
- * assert) was generated and that the file is readable.
+ * Purpose: Ensure that heaps reserve file address space.
+ * This function does this by creating datasets up to and past
+ * the limit of the file, then ensuring that an error (not an
+ * assert) was generated and that the file is readable.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Nat Furrer
* Friday, May 28, 2004
*
@@ -71,7 +71,7 @@ rsrv_heap(void)
dataspace_id = H5Screate_simple(1, dims, dims);
} H5E_END_TRY
- sprintf(dset_name, "Dset %d", i);
+ HDsprintf(dset_name, "Dset %d", i);
H5E_BEGIN_TRY {
dataset_id = H5Dcreate2(file_id, dset_name, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -103,7 +103,7 @@ rsrv_heap(void)
/* Re-open the library and try to read a dataset from the file we created */
if(H5open() < 0) TEST_ERROR;
- sprintf(dset_name, "Dset %d", i - 2);
+ HDsprintf(dset_name, "Dset %d", i - 2);
file_id = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
if(file_id < 0) TEST_ERROR;
@@ -135,17 +135,17 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: rsrv_ohdr
+ * Function: rsrv_ohdr
*
- * Purpose: Ensure that object headers reserve file address space.
- * This function does this by creating attributes of a dataset
- * past the limit of the file, then ensuring that an error (not
- * an assert) was generated and that the file is readable.
+ * Purpose: Ensure that object headers reserve file address space.
+ * This function does this by creating attributes of a dataset
+ * past the limit of the file, then ensuring that an error (not
+ * an assert) was generated and that the file is readable.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Nat Furrer
* Friday, May 28, 2004
*
@@ -195,7 +195,7 @@ rsrv_ohdr(void)
} /* end for */
for(i = 0; i < 2000; i++) {
- sprintf(attrname, "attr %d", i);
+ HDsprintf(attrname, "attr %d", i);
H5E_BEGIN_TRY{
aid = H5Screate_simple(2, dims, NULL);
attr_id = H5Acreate2(dataset_id, attrname, H5T_STD_I32BE, aid, H5P_DEFAULT, H5P_DEFAULT);
@@ -257,20 +257,20 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: rsrv_vlen
+ * Function: rsrv_vlen
*
- * Purpose: Ensure that variable length datatypes properly ensure that
+ * Purpose: Ensure that variable length datatypes properly ensure that
* enough file address space exists before writing.
- * This function does this by creating a dataset containing
+ * This function does this by creating a dataset containing
* variable length data past the limit of the file, then
* ensuring that an error (not an assert) was generated and
* that the file is readable.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: James Laird
- * Nat Furrer
+ * Programmer: James Laird
+ * Nat Furrer
* Thursday, July 1, 2004
*
* Modifications:
@@ -401,15 +401,15 @@ error:
#endif /* BROKEN */
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
* Purpose:
*
- * Return: Success:
+ * Return: Success:
*
- * Failure:
+ * Failure:
*
- * Programmer: Nat Furrer and James Laird
+ * Programmer: Nat Furrer and James Laird
* Thursday, July 1, 2004
*
* Modifications:
@@ -434,22 +434,22 @@ main(void)
envval = "nomatch";
/* QAK: should be able to use the core driver? */
if (HDstrcmp(envval, "core") && HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) {
- num_errs+=rsrv_ohdr();
- num_errs+=rsrv_heap();
- num_errs+=rsrv_vlen();
-
- if(num_errs > 0)
- printf("**** %d FAILURE%s! ****\n", num_errs, num_errs==1?"":"S");
- else
- puts("All address space reservation tests passed.");
-
- fapl = h5_fileaccess();
- h5_cleanup(FILENAME, fapl);
- return num_errs;
+ num_errs+=rsrv_ohdr();
+ num_errs+=rsrv_heap();
+ num_errs+=rsrv_vlen();
+
+ if(num_errs > 0)
+ HDprintf("**** %d FAILURE%s! ****\n", num_errs, num_errs==1?"":"S");
+ else
+ HDputs("All address space reservation tests passed.");
+
+ fapl = h5_fileaccess();
+ h5_cleanup(FILENAME, fapl);
+ return num_errs;
}
else
{
- puts("All address space reservation tests skippped - Incompatible with current Virtual File Driver");
+ HDputs("All address space reservation tests skippped - Incompatible with current Virtual File Driver");
}
#endif /* BROKEN */
diff --git a/test/ros3.c b/test/ros3.c
new file mode 100644
index 0000000..73b6ac2
--- /dev/null
+++ b/test/ros3.c
@@ -0,0 +1,1937 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Read-Only S3 Virtual File Driver (VFD)
+ *
+ * Purpose:
+ *
+ * Verify behavior for Read-Only S3 VFD
+ * at the VFL (virtual file layer) level.
+ *
+ * Demonstrates basic use cases and fapl/dxpl interaction.
+ *
+ * Programmer: Jacob Smith <jake.smith@hdfgroup.org>
+ * 2017-10-11
+ */
+
+#include "h5test.h"
+
+#include "H5FDprivate.h" /* Virtual File Driver utilities */
+#include "H5FDros3.h" /* this file driver's utilities */
+#include "H5FDs3comms.h" /* for loading of credentials */
+
+#ifdef H5_HAVE_ROS3_VFD
+
+/* only include the testing macros if needed */
+
+/*****************************************************************************
+ *
+ * FILE-LOCAL TESTING MACROS
+ *
+ * Purpose:
+ *
+ * 1) Upon test failure, goto-jump to single-location teardown in test
+ * function. E.g., `error:` (consistency with HDF corpus) or
+ * `failed:` (reflects purpose).
+ * >>> using "error", in part because `H5E_BEGIN_TRY` expects it.
+ * 2) Increase clarity and reduce overhead found with `TEST_ERROR`.
+ * e.g., "if(somefunction(arg, arg2) < 0) TEST_ERROR:"
+ * requires reading of entire line to know whether this if/call is
+ * part of the test setup, test operation, or a test unto itself.
+ * 3) Provide testing macros with optional user-supplied failure message;
+ * if not supplied (NULL), generate comparison output in the spirit of
+ * test-driven development. E.g., "expected 5 but was -3"
+ * User messages clarify test's purpose in code, encouraging description
+ * without relying on comments.
+ * 4) Configurable expected-actual order in generated comparison strings.
+ * Some prefer `VERIFY(expected, actual)`, others
+ * `VERIFY(actual, expected)`. Provide preprocessor ifdef switch
+ * to satifsy both parties, assuming one paradigm per test file.
+ * (One could #undef and redefine the flag through the file as desired,
+ * but _why_.)
+ *
+ * Provided as courtesy, per consideration for inclusion in the library
+ * proper.
+ *
+ * Macros:
+ *
+ * JSVERIFY_EXP_ACT - ifdef flag, configures comparison order
+ * FAIL_IF() - check condition
+ * FAIL_UNLESS() - check _not_ condition
+ * JSVERIFY() - long-int equality check; prints reason/comparison
+ * JSVERIFY_NOT() - long-int inequality check; prints
+ * JSVERIFY_STR() - string equality check; prints
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *****************************************************************************/
+
+
+/*----------------------------------------------------------------------------
+ *
+ * ifdef flag: JSVERIFY_EXP_ACT
+ *
+ * JSVERIFY macros accept arguments as (EXPECTED, ACTUAL[, reason])
+ * default, if this is undefined, is (ACTUAL, EXPECTED[, reason])
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_EXP_ACT 1L
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSFAILED_AT()
+ *
+ * Purpose:
+ *
+ * Preface a test failure by printing "*FAILED*" and location to stdout
+ * Similar to `H5_FAILED(); AT();` from h5test.h
+ *
+ * *FAILED* at somefile.c:12 in function_name()...
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSFAILED_AT() { \
+ HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: FAIL_IF()
+ *
+ * Purpose:
+ *
+ * Make tests more accessible and less cluttered than
+ * `if (thing == otherthing()) TEST_ERROR`
+ * paradigm.
+ *
+ * The following lines are roughly equivalent:
+ *
+ * `if (myfunc() < 0) TEST_ERROR;` (as seen elsewhere in HDF tests)
+ * `FAIL_IF(myfunc() < 0)`
+ *
+ * Prints a generic "FAILED AT" line to stdout and jumps to `error`,
+ * similar to `TEST_ERROR` in h5test.h
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-23
+ *
+ *----------------------------------------------------------------------------
+ */
+#define FAIL_IF(condition) \
+if (condition) { \
+ JSFAILED_AT() \
+ goto error; \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: FAIL_UNLESS()
+ *
+ * Purpose:
+ *
+ * TEST_ERROR wrapper to reduce cognitive overhead from "negative tests",
+ * e.g., "a != b".
+ *
+ * Opposite of FAIL_IF; fails if the given condition is _not_ true.
+ *
+ * `FAIL_IF( 5 != my_op() )`
+ * is equivalent to
+ * `FAIL_UNLESS( 5 == my_op() )`
+ * However, `JSVERIFY(5, my_op(), "bad return")` may be even clearer.
+ * (see JSVERIFY)
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#if 0 /* UNUSED */
+#define FAIL_UNLESS(condition) \
+if (!(condition)) { \
+ JSFAILED_AT() \
+ goto error; \
+}
+#endif
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSERR_LONG()
+ *
+ * Purpose:
+ *
+ * Print an failure message for long-int arguments.
+ * ERROR-AT printed first.
+ * If `reason` is given, it is printed on own line and newlined after
+ * else, prints "expected/actual" aligned on own lines.
+ *
+ * *FAILED* at myfile.c:488 in somefunc()...
+ * forest must be made of trees.
+ *
+ * or
+ *
+ * *FAILED* at myfile.c:488 in somefunc()...
+ * ! Expected 425
+ * ! Actual 3
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSERR_LONG(expected, actual, reason) { \
+ JSFAILED_AT() \
+ if (reason!= NULL) { \
+ HDprintf("%s\n", (reason)); \
+ } else { \
+ HDprintf(" ! Expected %ld\n ! Actual %ld\n", \
+ (long)(expected), (long)(actual)); \
+ } \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSERR_STR()
+ *
+ * Purpose:
+ *
+ * Print an failure message for string arguments.
+ * ERROR-AT printed first.
+ * If `reason` is given, it is printed on own line and newlined after
+ * else, prints "expected/actual" aligned on own lines.
+ *
+ * *FAILED* at myfile.c:421 in myfunc()...
+ * Blue and Red strings don't match!
+ *
+ * or
+ *
+ * *FAILED* at myfile.c:421 in myfunc()...
+ * !!! Expected:
+ * this is my expected
+ * string
+ * !!! Actual:
+ * not what I expected at all
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSERR_STR(expected, actual, reason) { \
+ JSFAILED_AT() \
+ if ((reason) != NULL) { \
+ HDprintf("%s\n", (reason)); \
+ } else { \
+ HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", \
+ (expected), (actual)); \
+ } \
+}
+
+
+
+#ifdef JSVERIFY_EXP_ACT
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSVERIFY()
+ *
+ * Purpose:
+ *
+ * Verify that two long integers are equal.
+ * If unequal, print failure message
+ * (with `reason`, if not NULL; expected/actual if NULL)
+ * and jump to `error` at end of function
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY(expected, actual, reason) \
+if ((long)(actual) != (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)) \
+ goto error; \
+} /* JSVERIFY */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSVERIFY_NOT()
+ *
+ * Purpose:
+ *
+ * Verify that two long integers are _not_ equal.
+ * If equal, print failure message
+ * (with `reason`, if not NULL; expected/actual if NULL)
+ * and jump to `error` at end of function
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_NOT(expected, actual, reason) \
+if ((long)(actual) == (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)) \
+ goto error; \
+} /* JSVERIFY_NOT */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSVERIFY_STR()
+ *
+ * Purpose:
+ *
+ * Verify that two strings are equal.
+ * If unequal, print failure message
+ * (with `reason`, if not NULL; expected/actual if NULL)
+ * and jump to `error` at end of function
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_STR(expected, actual, reason) \
+if (strcmp((actual), (expected)) != 0) { \
+ JSERR_STR((expected), (actual), (reason)); \
+ goto error; \
+} /* JSVERIFY_STR */
+
+
+#else
+/* JSVERIFY_EXP_ACT not defined
+ *
+ * Repeats macros above, but with actual/expected parameters reversed.
+ */
+
+
+/*----------------------------------------------------------------------------
+ * Macro: JSVERIFY()
+ * See: JSVERIFY documentation above.
+ * Programmer: Jacob Smith
+ * 2017-10-14
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY(actual, expected, reason) \
+if ((long)(actual) != (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)); \
+ goto error; \
+} /* JSVERIFY */
+
+
+/*----------------------------------------------------------------------------
+ * Macro: JSVERIFY_NOT()
+ * See: JSVERIFY_NOT documentation above.
+ * Programmer: Jacob Smith
+ * 2017-10-14
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_NOT(actual, expected, reason) \
+if ((long)(actual) == (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)) \
+ goto error; \
+} /* JSVERIFY_NOT */
+
+
+/*----------------------------------------------------------------------------
+ * Macro: JSVERIFY_STR()
+ * See: JSVERIFY_STR documentation above.
+ * Programmer: Jacob Smith
+ * 2017-10-14
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_STR(actual, expected, reason) \
+if (strcmp((actual), (expected)) != 0) { \
+ JSERR_STR((expected), (actual), (reason)); \
+ goto error; \
+} /* JSVERIFY_STR */
+
+#endif /* ifdef/else JSVERIFY_EXP_ACT */
+
+/********************************
+ * OTHER MACROS AND DEFINITIONS *
+ ********************************/
+
+#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1)
+
+#define S3_TEST_PROFILE_NAME "ros3_vfd_test"
+
+#define S3_TEST_MAX_URL_SIZE 256
+
+#define S3_TEST_RESOURCE_TEXT_RESTRICTED "t8.shakespeare.txt"
+#define S3_TEST_RESOURCE_TEXT_PUBLIC "Poe_Raven.txt"
+#define S3_TEST_RESOURCE_H5_PUBLIC "GMODO-SVM01.h5"
+#define S3_TEST_RESOURCE_MISSING "missing.csv"
+
+static char url_text_restricted[S3_TEST_MAX_URL_SIZE] = "";
+static char url_text_public[S3_TEST_MAX_URL_SIZE] = "";
+static char url_h5_public[S3_TEST_MAX_URL_SIZE] = "";
+static char url_missing[S3_TEST_MAX_URL_SIZE] = "";
+static char s3_test_bucket_url[S3_TEST_MAX_URL_SIZE] = "";
+static hbool_t s3_test_bucket_defined = FALSE;
+
+/* Global variables for aws test profile.
+ * An attempt is made to read ~/.aws/credentials and ~/.aws/config upon test
+ * startup -- if unable to open either file or cannot load region, id, and key,
+ * tests connecting with S3 will not be run
+ */
+static int s3_test_credentials_loaded = 0;
+static char s3_test_aws_region[16];
+static char s3_test_aws_access_key_id[64];
+static char s3_test_aws_secret_access_key[128];
+
+H5FD_ros3_fapl_t restricted_access_fa = {
+ H5FD_CURR_ROS3_FAPL_T_VERSION, /* fapl version */
+ TRUE, /* authenticate */
+ "", /* aws region */
+ "", /* access key id */
+ ""}; /* secret access key */
+
+H5FD_ros3_fapl_t anonymous_fa = {
+ H5FD_CURR_ROS3_FAPL_T_VERSION,
+ FALSE, "", "", "" };
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_fapl_config_validation()
+ *
+ * Purpose:
+ *
+ * Test data consistency of fapl configuration.
+ * Tests `H5FD_ros3_validate_config` indirectly through `H5Pset_fapl_ros3`.
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-23
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_fapl_config_validation(void)
+{
+
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct testcase {
+ const char *msg;
+ herr_t expected;
+ H5FD_ros3_fapl_t config;
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ hid_t fapl_id = -1; /* file access property list ID */
+ H5FD_ros3_fapl_t config;
+ H5FD_ros3_fapl_t fa_fetch;
+ herr_t success = SUCCEED;
+ unsigned int i = 0;
+ unsigned int ncases = 8; /* should equal number of cases */
+ struct testcase *case_ptr = NULL; /* dumb work-around for possible */
+ /* dynamic cases creation because */
+ /* of compiler warnings Wlarger-than */
+ struct testcase cases_arr[] = {
+ { "non-authenticating config allows empties.\n",
+ SUCCEED,
+ { H5FD_CURR_ROS3_FAPL_T_VERSION, /* version */
+ FALSE, /* authenticate */
+ "", /* aws_region */
+ "", /* secret_id */
+ "", /* secret_key */
+ },
+ },
+ { "authenticating config asks for populated strings.\n",
+ FAIL,
+ { H5FD_CURR_ROS3_FAPL_T_VERSION,
+ TRUE,
+ "",
+ "",
+ "",
+ },
+ },
+ { "populated strings; key is the empty string?\n",
+ SUCCEED,
+ { H5FD_CURR_ROS3_FAPL_T_VERSION,
+ TRUE,
+ "region",
+ "me",
+ "",
+ },
+ },
+ { "id cannot be empty.\n",
+ FAIL,
+ { H5FD_CURR_ROS3_FAPL_T_VERSION,
+ TRUE,
+ "",
+ "me",
+ "",
+ },
+ },
+ { "region cannot be empty.\n",
+ FAIL,
+ { H5FD_CURR_ROS3_FAPL_T_VERSION,
+ TRUE,
+ "where",
+ "",
+ "",
+ },
+ },
+ { "all strings populated.\n",
+ SUCCEED,
+ { H5FD_CURR_ROS3_FAPL_T_VERSION,
+ TRUE,
+ "where",
+ "who",
+ "thisIsA GREAT seeeecrit",
+ },
+ },
+ { "incorrect version should fail\n",
+ FAIL,
+ { 12345,
+ FALSE,
+ "",
+ "",
+ "",
+ },
+ },
+ { "non-authenticating config cares not for (de)population"
+ "of strings.\n",
+ SUCCEED,
+ { H5FD_CURR_ROS3_FAPL_T_VERSION,
+ FALSE,
+ "someregion",
+ "someid",
+ "somekey",
+ },
+ },
+ };
+
+ TESTING("ROS3 fapl configuration validation");
+
+ /*********
+ * TESTS *
+ *********/
+
+ if (FALSE == s3_test_bucket_defined) {
+ SKIPPED();
+ puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ fflush(stdout);
+ return 0;
+ }
+
+ for (i = 0; i < ncases; i++) {
+
+ /*---------------
+ * per-test setup
+ *---------------
+ */
+ case_ptr = &cases_arr[i];
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_id < 0 ) /* sanity-check */
+
+ /*-----------------------------------
+ * Actually test.
+ * Mute stack trace in failure cases.
+ *-----------------------------------
+ */
+ H5E_BEGIN_TRY {
+ /* `H5FD_ros3_validate_config(...)` is static/private
+ * to src/ros3.c and cannot (and should not?) be tested directly?
+ * Instead, validate config through public api.
+ */
+ success = H5Pset_fapl_ros3(fapl_id, &case_ptr->config);
+ } H5E_END_TRY;
+
+ JSVERIFY( case_ptr->expected, success, case_ptr->msg )
+
+ /* Make sure we can get back what we put in.
+ * Only valid if the fapl configuration does not result in error.
+ */
+ if (success == SUCCEED) {
+ config = case_ptr->config;
+ JSVERIFY( SUCCEED,
+ H5Pget_fapl_ros3(fapl_id, &fa_fetch),
+ "unable to get fapl" )
+
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION,
+ fa_fetch.version,
+ "invalid version number" )
+ JSVERIFY( config.version,
+ fa_fetch.version,
+ "version number mismatch" )
+ JSVERIFY( config.authenticate,
+ fa_fetch.authenticate,
+ "authentication flag mismatch" )
+ JSVERIFY_STR( config.aws_region,
+ fa_fetch.aws_region,
+ NULL )
+ JSVERIFY_STR( config.secret_id,
+ fa_fetch.secret_id,
+ NULL )
+ JSVERIFY_STR( config.secret_key,
+ fa_fetch.secret_key,
+ NULL )
+ }
+
+ /*-----------------------------
+ * per-test sanitation/teardown
+ *-----------------------------
+ */
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ } /* for each test case */
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (fapl_id < 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+ return 1;
+} /* test_fapl_config_validation */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: test_ros3_fapl()
+ *
+ * Purpose: Tests the file handle interface for the ROS3 driver
+ *
+ * As the ROS3 driver is 1) read only, 2) requires access
+ * to an S3 server, this test is quite
+ * different from the other tests.
+ *
+ * For now, test only fapl & flags. Extend as the
+ * work on the VFD continues.
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: John Mainzer
+ * 7/12/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_ros3_fapl(void)
+{
+ /************************
+ * test-local variables *
+ ************************/
+
+ hid_t fapl_id = -1; /* file access property list ID */
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
+ H5FD_ros3_fapl_t ros3_fa_0 = {
+ H5FD_CURR_ROS3_FAPL_T_VERSION, /* version */
+ FALSE, /* authenticate */
+ "", /* aws_region */
+ "", /* secret_id */
+ "plugh", /* secret_key */
+ };
+
+ TESTING("ROS3 fapl ");
+
+ /* Set property list and file name for ROS3 driver.
+ */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_id < 0 )
+
+ FAIL_IF( FAIL == H5Pset_fapl_ros3(fapl_id, &ros3_fa_0) )
+
+ driver_id = H5Pget_driver(fapl_id);
+ FAIL_IF( driver_id < 0 )
+
+ /****************
+ * Check that the VFD feature flags are correct
+ * SPEC MAY CHANGE
+ ******************/
+
+ FAIL_IF( H5FDdriver_query(driver_id, &driver_flags) < 0 )
+
+ JSVERIFY_NOT( 0, (driver_flags & H5FD_FEAT_DATA_SIEVE),
+ "bit(s) in `driver_flags` must align with "
+ "H5FD_FEAT_DATA_SIEVE" )
+
+ JSVERIFY( H5FD_FEAT_DATA_SIEVE, driver_flags,
+ "H5FD_FEAT_DATA_SIEVE should be the only supported flag")
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+
+ return 1;
+
+} /* test_ros3_fapl() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_vfd_open()
+ *
+ * Purpose:
+ *
+ * Demonstrate/specify VFD-level "Open" failure cases
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 1027-11-03
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_vfd_open(void)
+{
+
+ /*********************
+ * test-local macros *
+ *********************/
+
+
+#define FAPL_H5P_DEFAULT -2
+#define FAPL_FILE_ACCESS -3
+#define FAPL_ROS3_ANON -4
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct test_condition {
+ const char *message;
+ const char *url;
+ unsigned flags;
+ int which_fapl;
+ haddr_t maxaddr;
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ struct test_condition tests[] = {
+ { "default property list (H5P_DEFAULT) is invalid",
+ url_text_public,
+ H5F_ACC_RDONLY,
+ FAPL_H5P_DEFAULT,
+ MAXADDR,
+ },
+ { "generic file access property list is invalid",
+ url_text_public,
+ H5F_ACC_RDONLY,
+ FAPL_FILE_ACCESS,
+ MAXADDR,
+ },
+ { "filename cannot be null",
+ NULL,
+ H5F_ACC_RDONLY,
+ FAPL_ROS3_ANON,
+ MAXADDR,
+ },
+ { "filename cannot be empty",
+ "",
+ H5F_ACC_RDONLY,
+ FAPL_ROS3_ANON,
+ MAXADDR,
+ },
+ { "filename must exist",
+ url_missing,
+ H5F_ACC_RDONLY,
+ FAPL_ROS3_ANON,
+ MAXADDR,
+ },
+ { "read-write flag not supported",
+ url_text_public,
+ H5F_ACC_RDWR,
+ FAPL_ROS3_ANON,
+ MAXADDR,
+ },
+ { "truncate flag not supported",
+ url_text_public,
+ H5F_ACC_TRUNC,
+ FAPL_ROS3_ANON,
+ MAXADDR,
+ },
+ { "create flag not supported",
+ url_text_public,
+ H5F_ACC_CREAT,
+ FAPL_ROS3_ANON,
+ MAXADDR,
+ },
+ { "EXCL flag not supported",
+ url_text_public,
+ H5F_ACC_EXCL,
+ FAPL_ROS3_ANON,
+ MAXADDR,
+ },
+ { "maxaddr cannot be 0 (caught in `H5FD_open()`)",
+ url_text_public,
+ H5F_ACC_RDONLY,
+ FAPL_ROS3_ANON,
+ 0,
+ },
+ };
+ H5FD_t *fd = NULL;
+ hbool_t curl_ready = FALSE;
+ hid_t fapl_id = -1;
+ hid_t fapl_file_access = -1;
+ unsigned i = 0;
+ unsigned tests_count = 10;
+
+ TESTING("ROS3 VFD-level open");
+
+ if (FALSE == s3_test_bucket_defined) {
+ SKIPPED();
+ puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ fflush(stdout);
+ return 0;
+ }
+
+ FAIL_IF( CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT) )
+ curl_ready = TRUE;
+
+ fapl_file_access = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_file_access < 0 )
+
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_id < 0 )
+ FAIL_IF( FAIL == H5Pset_fapl_ros3(fapl_id, &anonymous_fa) )
+
+ /*********
+ * TESTS *
+ *********/
+
+ /* all the test cases that will _not_ open
+ */
+ for (i = 0; i < tests_count; i++) {
+ struct test_condition T = tests[i];
+ hid_t _fapl_id = H5P_DEFAULT;
+
+ fd = NULL;
+
+ if (T.which_fapl == FAPL_FILE_ACCESS)
+ _fapl_id = fapl_file_access;
+ else if (T.which_fapl == FAPL_ROS3_ANON)
+ _fapl_id = fapl_id;
+
+ H5E_BEGIN_TRY {
+ fd = H5FDopen(T.url, T.flags, _fapl_id, T.maxaddr);
+ } H5E_END_TRY;
+ if (NULL != fd)
+ JSVERIFY(1, 0, T.message); /* wrapper to print message and fail */
+ }
+
+ FAIL_IF( NULL != fd )
+
+ /* finally, show that a file can be opened
+ */
+ fd = H5FDopen(
+ url_text_public,
+ H5F_ACC_RDONLY,
+ fapl_id,
+ MAXADDR);
+ FAIL_IF( NULL == fd )
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ FAIL_IF( FAIL == H5FDclose(fd) )
+ fd = NULL;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_file_access) )
+ fapl_file_access = -1;
+
+ curl_global_cleanup();
+ curl_ready = FALSE;
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (fd) {
+ (void)H5FDclose(fd);
+ }
+ if (fapl_id >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+ if (fapl_file_access >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_file_access);
+ } H5E_END_TRY;
+ }
+ if (curl_ready == TRUE) {
+ curl_global_cleanup();
+ }
+
+ return 1;
+
+#undef FAPL_FILE_ACCESS
+#undef FAPL_H5P_DEFAULT
+#undef FAPL_ROS3_ANON
+
+} /* test_vfd_open */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_eof_eoa()
+ *
+ * Purpose:
+ *
+ * Demonstrate behavior of get_eof, get_eoa, and set_eoa.
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-08
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_eof_eoa(void)
+{
+
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ H5FD_t *fd_shakespeare = NULL;
+ hbool_t curl_ready = FALSE;
+ hid_t fapl_id = -1;
+
+ TESTING("ROS3 eof/eoa gets and sets");
+
+ if (s3_test_credentials_loaded == 0) {
+ SKIPPED();
+ puts(" s3 credentials are not loaded");
+ fflush(stdout);
+ return 0;
+ }
+
+ if (FALSE == s3_test_bucket_defined) {
+ SKIPPED();
+ puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ fflush(stdout);
+ return 0;
+ }
+
+ /*********
+ * SETUP *
+ *********/
+
+ FAIL_IF( CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT) )
+ curl_ready = TRUE;
+
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( 0 > fapl_id )
+ FAIL_IF( FAIL == H5Pset_fapl_ros3(fapl_id, &restricted_access_fa) )
+
+ fd_shakespeare = H5FDopen(
+ url_text_restricted,
+ H5F_ACC_RDONLY,
+ fapl_id,
+ HADDR_UNDEF);
+ FAIL_IF( NULL == fd_shakespeare )
+
+ /*********
+ * TESTS *
+ *********/
+
+ /* verify as found
+ */
+ JSVERIFY( 5458199, H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), NULL )
+ JSVERIFY( H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT),
+ H5FDget_eof(fd_shakespeare, H5FD_MEM_DRAW),
+ "mismatch between DEFAULT and RAW memory types" )
+ JSVERIFY( 0,
+ H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT),
+ "EoA should be unset by H5FDopen" )
+
+ /* set EoA below EoF
+ */
+ JSVERIFY( SUCCEED,
+ H5FDset_eoa(fd_shakespeare, H5FD_MEM_DEFAULT, 44442202),
+ "unable to set EoA (lower)" )
+ JSVERIFY( 5458199,
+ H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT),
+ "EoF changed" )
+ JSVERIFY( 44442202,
+ H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT),
+ "EoA unchanged" )
+
+ /* set EoA above EoF
+ */
+ JSVERIFY( SUCCEED,
+ H5FDset_eoa(fd_shakespeare, H5FD_MEM_DEFAULT, 6789012),
+ "unable to set EoA (higher)" )
+ JSVERIFY( 5458199,
+ H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT),
+ "EoF changed" )
+ JSVERIFY( 6789012,
+ H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT),
+ "EoA unchanged" )
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ FAIL_IF( FAIL == H5FDclose(fd_shakespeare) )
+
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ curl_global_cleanup();
+ curl_ready = FALSE;
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (fd_shakespeare) (void)H5FDclose(fd_shakespeare);
+ if (TRUE == curl_ready) curl_global_cleanup();
+ if (fapl_id >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+
+ return 1;
+
+} /* test_eof_eoa */
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * Function: test_H5FDread_without_eoa_set_fails()
+ *
+ * Purpose:
+ *
+ * Demonstrate a not-obvious constraint by the library, preventing
+ * file read before EoA is set
+ *
+ * Programmer: Jacob Smith
+ * 2018-01-26
+ *
+ *-----------------------------------------------------------------------------
+ */
+static int
+test_H5FDread_without_eoa_set_fails(void)
+{
+ char buffer[256];
+ unsigned int i = 0;
+ H5FD_t *file_shakespeare = NULL;
+ hid_t fapl_id = -1;
+
+ TESTING("ROS3 VFD read-eoa temporal coupling library limitation ");
+
+ if (s3_test_credentials_loaded == 0) {
+ SKIPPED();
+ puts(" s3 credentials are not loaded");
+ fflush(stdout);
+ return 0;
+ }
+
+ if (FALSE == s3_test_bucket_defined) {
+ SKIPPED();
+ puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ fflush(stdout);
+ return 0;
+ }
+
+ /*********
+ * SETUP *
+ *********/
+
+ /* create ROS3 fapl
+ */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_id < 0 )
+ FAIL_IF( FAIL == H5Pset_fapl_ros3(fapl_id, &restricted_access_fa) )
+
+ file_shakespeare = H5FDopen(
+ url_text_restricted,
+ H5F_ACC_RDONLY,
+ fapl_id,
+ MAXADDR);
+ FAIL_IF( NULL == file_shakespeare )
+
+ JSVERIFY( 0, H5FDget_eoa(file_shakespeare, H5FD_MEM_DEFAULT),
+ "EoA should remain unset by H5FDopen" )
+
+ for (i = 0; i < 256; i++)
+ buffer[i] = 0; /* zero buffer contents */
+
+ /********
+ * TEST *
+ ********/
+
+ H5E_BEGIN_TRY { /* mute stack trace on expected failure */
+ JSVERIFY( FAIL,
+ H5FDread(file_shakespeare,
+ H5FD_MEM_DRAW,
+ H5P_DEFAULT,
+ 1200699,
+ 102,
+ buffer),
+ "cannot read before eoa is set" )
+ } H5E_END_TRY;
+ JSVERIFY_STR( "", buffer, "buffer should remain untouched" )
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ FAIL_IF( FAIL == H5FDclose(file_shakespeare) )
+ file_shakespeare = NULL;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (file_shakespeare) { (void)H5FDclose(file_shakespeare); }
+ if (fapl_id >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+
+ return 1;
+
+} /* test_H5FDread_without_eoa_set_fails */
+
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_read()
+ *
+ * Purpose:
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-06
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_read(void)
+{
+
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+ struct testcase {
+ const char *message; /* purpose of test case */
+ haddr_t eoa_set; /* set file EOA to this prior to read */
+ size_t addr; /* offset of read in file */
+ size_t len; /* length of read in file */
+ herr_t success; /* expected return value of read function */
+ const char *expected; /* expected contents of buffer; failure ignores */
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+ struct testcase cases[] = {
+ { "successful range-get",
+ 6464,
+ 5691,
+ 32, /* fancy quotes are three bytes each(?) */
+ SUCCEED,
+ "Quoth the Raven “Nevermore.â€",
+ },
+ { "read past EOA fails (EOA < EOF < addr)",
+ 3000,
+ 4000,
+ 100,
+ FAIL,
+ NULL,
+ },
+ { "read overlapping EOA fails (EOA < addr < EOF < (addr+len))",
+ 3000,
+ 8000,
+ 100,
+ FAIL,
+ NULL,
+ },
+ { "read past EOA/EOF fails ((EOA==EOF) < addr)",
+ 6464,
+ 7000,
+ 100,
+ FAIL,
+ NULL,
+ },
+ { "read overlapping EOA/EOF fails (addr < (EOA==EOF) < (addr+len))",
+ 6464,
+ 6400,
+ 100,
+ FAIL,
+ NULL,
+ },
+ { "read between EOF and EOA fails (EOF < addr < (addr+len) < EOA)",
+ 8000,
+ 7000,
+ 100,
+ FAIL,
+ NULL,
+ },
+ };
+ unsigned testcase_count = 6;
+ unsigned test_i = 0;
+ struct testcase test;
+ herr_t open_return = FAIL;
+ char buffer[S3_TEST_MAX_URL_SIZE];
+ unsigned int i = 0;
+ H5FD_t *file_raven = NULL;
+ hid_t fapl_id = -1;
+
+ TESTING("ROS3 VFD read/range-gets");
+
+ if (s3_test_credentials_loaded == 0) {
+ SKIPPED();
+ puts(" s3 credentials are not loaded");
+ fflush(stdout);
+ return 0;
+ }
+
+ if (FALSE == s3_test_bucket_defined) {
+ SKIPPED();
+ puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ fflush(stdout);
+ return 0;
+ }
+
+ /*********
+ * SETUP *
+ *********/
+
+ /* create ROS3 fapl
+ */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_id < 0 )
+ FAIL_IF( FAIL == H5Pset_fapl_ros3(fapl_id, &restricted_access_fa) )
+
+ /* open file
+ */
+ file_raven = H5FDopen( /* will open with "authenticating" fapl */
+ url_text_public, /* TODO: check return state: anon access of restricted says OK? (not NULL) */
+ H5F_ACC_RDONLY,
+ fapl_id,
+ HADDR_UNDEF); /* Demonstrate success with "automatic" value */
+ FAIL_IF( NULL == file_raven )
+
+ JSVERIFY( 6464, H5FDget_eof(file_raven, H5FD_MEM_DEFAULT), NULL )
+
+ /*********
+ * TESTS *
+ *********/
+
+ for (test_i = 0; test_i < testcase_count; test_i++) {
+
+ /* -------------- *
+ * per-test setup *
+ * -------------- */
+
+ test = cases[test_i];
+ open_return = FAIL;
+
+ FAIL_IF( S3_TEST_MAX_URL_SIZE < test.len ) /* buffer too small! */
+
+ FAIL_IF( FAIL ==
+ H5FD_set_eoa( file_raven, H5FD_MEM_DEFAULT, test.eoa_set) )
+
+ for (i = 0; i < S3_TEST_MAX_URL_SIZE; i++) /* zero buffer contents */
+ buffer[i] = 0;
+
+ /* ------------ *
+ * conduct test *
+ * ------------ */
+
+ H5E_BEGIN_TRY {
+ open_return = H5FDread(
+ file_raven,
+ H5FD_MEM_DRAW,
+ H5P_DEFAULT,
+ test.addr,
+ test.len,
+ buffer);
+ } H5E_END_TRY;
+
+ JSVERIFY( test.success,
+ open_return,
+ test.message )
+ if (open_return == SUCCEED)
+ JSVERIFY_STR( test.expected, buffer, NULL )
+
+ } /* for each testcase */
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ FAIL_IF( FAIL == H5FDclose(file_raven) )
+ file_raven = NULL;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (file_raven)
+ (void)H5FDclose(file_raven);
+ if (fapl_id >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+
+ return 1;
+
+} /* test_read */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_noops_and_autofails()
+ *
+ * Purpose:
+ *
+ * Demonstrate the unavailable and do-nothing routines unique to
+ * Read-Only VFD.
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-06
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_noops_and_autofails(void)
+{
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ hbool_t curl_ready = FALSE;
+ hid_t fapl_id = -1;
+ H5FD_t *file = NULL;
+ const char data[36] = "The Force shall be with you, always";
+
+ TESTING("ROS3 VFD always-fail and no-op routines");
+
+
+ if (FALSE == s3_test_bucket_defined) {
+ SKIPPED();
+ puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ fflush(stdout);
+ return 0;
+ }
+
+ /*********
+ * SETUP *
+ *********/
+
+ FAIL_IF( CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT) )
+ curl_ready = TRUE;
+
+ /* create ROS3 fapl
+ */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_id < 0 )
+ JSVERIFY( SUCCEED, H5Pset_fapl_ros3(fapl_id, &anonymous_fa), NULL )
+
+ /* open file
+ */
+ file = H5FDopen(
+ url_text_public,
+ H5F_ACC_RDONLY,
+ fapl_id,
+ HADDR_UNDEF);
+ FAIL_IF( NULL == file )
+
+ /*********
+ * TESTS *
+ *********/
+
+ /* auto-fail calls to write and truncate
+ */
+ H5E_BEGIN_TRY {
+ JSVERIFY( FAIL,
+ H5FDwrite(file, H5FD_MEM_DRAW, H5P_DEFAULT, 1000, 35, data),
+ "write must fail" )
+ } H5E_END_TRY;
+
+ H5E_BEGIN_TRY {
+ JSVERIFY( FAIL,
+ H5FDtruncate(file, H5P_DEFAULT, FALSE),
+ "truncate must fail" )
+ } H5E_END_TRY;
+
+ H5E_BEGIN_TRY {
+ JSVERIFY( FAIL,
+ H5FDtruncate(file, H5P_DEFAULT, TRUE),
+ "truncate must fail (closing)" )
+ } H5E_END_TRY;
+
+ /* no-op calls to `lock()` and `unlock()`
+ */
+ JSVERIFY( SUCCEED,
+ H5FDlock(file, TRUE),
+ "lock always succeeds; has no effect" )
+ JSVERIFY( SUCCEED,
+ H5FDlock(file, FALSE),
+ NULL )
+ JSVERIFY( SUCCEED,
+ H5FDunlock(file),
+ NULL )
+ /* Lock/unlock with null file or similar error crashes tests.
+ * HDassert in calling heirarchy, `H5FD[un]lock()` and `H5FD_[un]lock()`
+ */
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ FAIL_IF( FAIL == H5FDclose(file) )
+ file = NULL;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ curl_global_cleanup();
+ curl_ready = FALSE;
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (fapl_id >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+ if (file) { (void)H5FDclose(file); }
+ if (curl_ready == TRUE) { curl_global_cleanup(); }
+
+ return 1;
+
+} /* test_noops_and_autofails*/
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_cmp()
+ *
+ * Purpose:
+ *
+ * Verify "file comparison" behavior.
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-06
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_cmp(void)
+{
+
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ H5FD_t *fd_raven = NULL;
+ H5FD_t *fd_shakes = NULL;
+ H5FD_t *fd_raven_2 = NULL;
+ hbool_t curl_ready = FALSE;
+ hid_t fapl_id = -1;
+
+ TESTING("ROS3 cmp (comparison)");
+
+ if (s3_test_credentials_loaded == 0) {
+ SKIPPED();
+ puts(" s3 credentials are not loaded");
+ fflush(stdout);
+ return 0;
+ }
+
+ if (FALSE == s3_test_bucket_defined) {
+ SKIPPED();
+ puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ fflush(stdout);
+ return 0;
+ }
+
+ /*********
+ * SETUP *
+ *********/
+
+ FAIL_IF( CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT) )
+ curl_ready = TRUE;
+
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( 0 > fapl_id )
+ JSVERIFY( SUCCEED, H5Pset_fapl_ros3(fapl_id, &restricted_access_fa), NULL )
+
+ fd_raven = H5FDopen(
+ url_text_public,
+ H5F_ACC_RDONLY,
+ fapl_id,
+ HADDR_UNDEF);
+ FAIL_IF( NULL == fd_raven )
+
+ fd_shakes = H5FDopen(
+ url_text_restricted,
+ H5F_ACC_RDONLY,
+ fapl_id,
+ HADDR_UNDEF);
+ FAIL_IF( NULL == fd_shakes )
+
+ fd_raven_2 = H5FDopen(
+ url_text_public,
+ H5F_ACC_RDONLY,
+ fapl_id,
+ HADDR_UNDEF);
+ FAIL_IF( NULL == fd_raven_2 )
+
+ /*********
+ * TESTS *
+ *********/
+
+ JSVERIFY( 0, H5FDcmp(fd_raven, fd_raven_2), NULL )
+ JSVERIFY( -1, H5FDcmp(fd_raven, fd_shakes), NULL )
+ JSVERIFY( -1, H5FDcmp(fd_shakes, fd_raven_2), NULL )
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ FAIL_IF( FAIL == H5FDclose(fd_raven) )
+ fd_raven = NULL;
+ FAIL_IF( FAIL == H5FDclose(fd_shakes) )
+ fd_shakes = NULL;
+ FAIL_IF( FAIL == H5FDclose(fd_raven_2) )
+ fd_raven_2 = NULL;
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ curl_global_cleanup();
+ curl_ready = FALSE;
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (fd_raven != NULL) (void)H5FDclose(fd_raven);
+ if (fd_raven_2 != NULL) (void)H5FDclose(fd_raven_2);
+ if (fd_shakes != NULL) (void)H5FDclose(fd_shakes);
+ if (TRUE == curl_ready) curl_global_cleanup();
+ if (fapl_id >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+
+ return 1;
+
+} /* test_cmp */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_H5F_integration()
+ *
+ * Purpose:
+ *
+ * Demonstrate S3 file-open through H5F API.
+ *
+ * Return:
+ *
+ * PASSED : 0
+ * FAILED : 1
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-07
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+test_H5F_integration(void)
+{
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ hid_t file = -1;
+ hid_t fapl_id = -1;
+
+ TESTING("S3 file access through HD5F library (H5F API)");
+
+ if (s3_test_credentials_loaded == 0) {
+ SKIPPED();
+ puts(" s3 credentials are not loaded");
+ fflush(stdout);
+ return 0;
+ }
+
+ if (FALSE == s3_test_bucket_defined) {
+ SKIPPED();
+ puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ fflush(stdout);
+ return 0;
+ }
+
+ /*********
+ * SETUP *
+ *********/
+
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( 0 > fapl_id )
+ FAIL_IF( FAIL == H5Pset_fapl_ros3(fapl_id, &restricted_access_fa) )
+
+ /*********
+ * TESTS *
+ *********/
+
+ /* Read-Write Open access is not allowed with this file driver.
+ */
+ H5E_BEGIN_TRY {
+ FAIL_IF( 0 <= H5Fopen(
+ url_h5_public,
+ H5F_ACC_RDWR,
+ fapl_id) )
+ } H5E_END_TRY;
+
+ /* H5Fcreate() is not allowed with this file driver.
+ */
+ H5E_BEGIN_TRY {
+ FAIL_IF( 0 <= H5Fcreate(
+ url_missing,
+ H5F_ACC_RDONLY,
+ H5P_DEFAULT,
+ fapl_id) )
+ } H5E_END_TRY;
+
+ /* Successful open.
+ */
+ file = H5Fopen(
+ url_h5_public,
+ H5F_ACC_RDONLY,
+ fapl_id);
+ FAIL_IF( file < 0 )
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ FAIL_IF( FAIL == H5Fclose(file) )
+ file = -1;
+
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ fapl_id = -1;
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * CLEANUP *
+ ***********/
+HDprintf("\nerror!"); fflush(stdout);
+
+ if (fapl_id >= 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ }
+ if (file > 0)
+ (void)H5Fclose(file);
+
+ return 1;
+
+} /* test_H5F_integration */
+
+#endif /* H5_HAVE_ROS3_VFD */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: main
+ *
+ * Purpose: Tests the basic features of Virtual File Drivers
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-23
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+#ifdef H5_HAVE_ROS3_VFD
+ int nerrors = 0;
+ const char *bucket_url_env = NULL;
+
+#endif /* H5_HAVE_ROS3_VFD */
+
+ HDprintf("Testing ros3 VFD functionality.\n");
+
+#ifdef H5_HAVE_ROS3_VFD
+
+ /************************
+ * initialize test urls *
+ ************************/
+
+ bucket_url_env = HDgetenv("HDF5_ROS3_TEST_BUCKET_URL");
+ if (bucket_url_env == NULL || bucket_url_env[0] == '\0') {
+ HDprintf("WARNING: S3 bucket url is not defined in enviornment " \
+ "variable 'HDF5_ROS3_TEST_BUCKET_URL'!\n");
+ } else {
+ HDstrncpy(s3_test_bucket_url, bucket_url_env, S3_TEST_MAX_URL_SIZE);
+ s3_test_bucket_defined = TRUE;
+ }
+
+ if (S3_TEST_MAX_URL_SIZE < HDsnprintf(
+ url_text_restricted,
+ (size_t)S3_TEST_MAX_URL_SIZE,
+ "%s/%s",
+ (const char *)s3_test_bucket_url,
+ (const char *)S3_TEST_RESOURCE_TEXT_RESTRICTED))
+ {
+ HDprintf("* ros3 setup failed (text_restricted) ! *\n");
+ return 1;
+ }
+ if (S3_TEST_MAX_URL_SIZE < HDsnprintf(
+ url_text_public,
+ (size_t)S3_TEST_MAX_URL_SIZE,
+ "%s/%s",
+ (const char *)s3_test_bucket_url,
+ (const char *)S3_TEST_RESOURCE_TEXT_PUBLIC))
+ {
+ HDprintf("* ros3 setup failed (text_public) ! *\n");
+ return 1;
+ }
+ if (S3_TEST_MAX_URL_SIZE < HDsnprintf(
+ url_h5_public,
+ (size_t)S3_TEST_MAX_URL_SIZE,
+ "%s/%s",
+ (const char *)s3_test_bucket_url,
+ (const char *)S3_TEST_RESOURCE_H5_PUBLIC))
+ {
+ HDprintf("* ros3 setup failed (h5_public) ! *\n");
+ return 1;
+ }
+ if (S3_TEST_MAX_URL_SIZE < HDsnprintf(
+ url_missing,
+ S3_TEST_MAX_URL_SIZE,
+ "%s/%s",
+ (const char *)s3_test_bucket_url,
+ (const char *)S3_TEST_RESOURCE_MISSING))
+ {
+ HDprintf("* ros3 setup failed (missing) ! *\n");
+ return 1;
+ }
+
+ /**************************************
+ * load credentials and prepare fapls *
+ **************************************/
+
+ /* "clear" profile data strings */
+ s3_test_aws_access_key_id[0] = '\0';
+ s3_test_aws_secret_access_key[0] = '\0';
+ s3_test_aws_region[0] = '\0';
+
+ /* attempt to load test credentials
+ * if unable, certain tests will be skipped
+ */
+ if (SUCCEED == H5FD_s3comms_load_aws_profile(
+ S3_TEST_PROFILE_NAME,
+ s3_test_aws_access_key_id,
+ s3_test_aws_secret_access_key,
+ s3_test_aws_region))
+ {
+ s3_test_credentials_loaded = 1;
+ HDstrncpy(restricted_access_fa.aws_region,
+ (const char *)s3_test_aws_region,
+ H5FD_ROS3_MAX_REGION_LEN);
+ HDstrncpy(restricted_access_fa.secret_id,
+ (const char *)s3_test_aws_access_key_id,
+ H5FD_ROS3_MAX_SECRET_ID_LEN);
+ HDstrncpy(restricted_access_fa.secret_key,
+ (const char *)s3_test_aws_secret_access_key,
+ H5FD_ROS3_MAX_SECRET_KEY_LEN);
+ }
+
+ /******************
+ * commence tests *
+ ******************/
+
+ h5_reset();
+
+ nerrors += test_fapl_config_validation();
+ nerrors += test_ros3_fapl();
+ nerrors += test_vfd_open();
+ nerrors += test_eof_eoa();
+ nerrors += test_H5FDread_without_eoa_set_fails();
+ nerrors += test_read();
+ nerrors += test_noops_and_autofails();
+ nerrors += test_cmp();
+ nerrors += test_H5F_integration();
+
+ if (nerrors > 0) {
+ HDprintf("***** %d ros3 TEST%s FAILED! *****\n",
+ nerrors,
+ nerrors > 1 ? "S" : "");
+ nerrors = 1;
+ } else {
+ HDprintf("All ros3 tests passed.\n");
+ }
+ return nerrors; /* 0 if no errors, 1 if any errors */
+
+#else
+
+ HDprintf("SKIPPED - read-only S3 VFD not built\n");
+ return EXIT_SUCCESS;
+
+#endif /* H5_HAVE_ROS3_VFD */
+
+} /* main() */
+
diff --git a/test/s3comms.c b/test/s3comms.c
new file mode 100644
index 0000000..9453b75
--- /dev/null
+++ b/test/s3comms.c
@@ -0,0 +1,2730 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Read-Only S3 Virtual File Driver (VFD)
+ *
+ * Purpose: Unit tests for the S3 Communications (s3comms) module.
+ *
+ * Programmer: Jacob Smith <jake.smith@hdfgroup.org>
+ * 2017-10-11
+ */
+
+#include "h5test.h"
+#include "H5FDs3comms.h"
+#include "H5MMprivate.h" /* memory management */
+
+#ifdef H5_HAVE_ROS3_VFD
+
+/*****************************************************************************
+ *
+ * FILE-LOCAL TESTING MACROS
+ *
+ * Purpose:
+ *
+ * 1) Upon test failure, goto-jump to single-location teardown in test
+ * function. E.g., `error:` (consistency with HDF corpus) or
+ * `failed:` (reflects purpose).
+ * >>> using "error", in part because `H5E_BEGIN_TRY` expects it.
+ * 2) Increase clarity and reduce overhead found with `TEST_ERROR`.
+ * e.g., "if(somefunction(arg, arg2) < 0) TEST_ERROR:"
+ * requires reading of entire line to know whether this if/call is
+ * part of the test setup, test operation, or a test unto itself.
+ * 3) Provide testing macros with optional user-supplied failure message;
+ * if not supplied (NULL), generate comparison output in the spirit of
+ * test-driven development. E.g., "expected 5 but was -3"
+ * User messages clarify test's purpose in code, encouraging description
+ * without relying on comments.
+ * 4) Configurable expected-actual order in generated comparison strings.
+ * Some prefer `VERIFY(expected, actual)`, others
+ * `VERIFY(actual, expected)`. Provide preprocessor ifdef switch
+ * to satifsy both parties, assuming one paradigm per test file.
+ * (One could #undef and redefine the flag through the file as desired,
+ * but _why_.)
+ * Provided as courtesy, per consideration for inclusion in the library
+ * proper.
+ *
+ * Macros:
+ *
+ * JSVERIFY_EXP_ACT - ifdef flag, configures comparison order
+ * FAIL_IF() - check condition
+ * FAIL_UNLESS() - check _not_ condition
+ * JSVERIFY() - long-int equality check; prints reason/comparison
+ * JSVERIFY_NOT() - long-int inequality check; prints
+ * JSVERIFY_STR() - string equality check; prints
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *****************************************************************************/
+
+
+/*----------------------------------------------------------------------------
+ *
+ * ifdef flag: JSVERIFY_EXP_ACT
+ *
+ * JSVERIFY macros accept arguments as (EXPECTED, ACTUAL[, reason])
+ * default, if this is undefined, is (ACTUAL, EXPECTED[, reason])
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_EXP_ACT 1L
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSFAILED_AT()
+ *
+ * Purpose:
+ *
+ * Preface a test failure by printing "*FAILED*" and location to stdout
+ * Similar to `H5_FAILED(); AT();` from h5test.h
+ *
+ * *FAILED* at somefile.c:12 in function_name()...
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSFAILED_AT() { \
+ HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: FAIL_IF()
+ *
+ * Purpose:
+ *
+ * Make tests more accessible and less cluttered than
+ * `if (thing == otherthing()) TEST_ERROR`
+ * paradigm.
+ *
+ * The following lines are roughly equivalent:
+ *
+ * `if (myfunc() < 0) TEST_ERROR;` (as seen elsewhere in HDF tests)
+ * `FAIL_IF(myfunc() < 0)`
+ *
+ * Prints a generic "FAILED AT" line to stdout and jumps to `error`,
+ * similar to `TEST_ERROR` in h5test.h
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-23
+ *
+ *----------------------------------------------------------------------------
+ */
+#define FAIL_IF(condition) \
+if (condition) { \
+ JSFAILED_AT() \
+ goto error; \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: FAIL_UNLESS()
+ *
+ * Purpose:
+ *
+ * TEST_ERROR wrapper to reduce cognitive overhead from "negative tests",
+ * e.g., "a != b".
+ *
+ * Opposite of FAIL_IF; fails if the given condition is _not_ true.
+ *
+ * `FAIL_IF( 5 != my_op() )`
+ * is equivalent to
+ * `FAIL_UNLESS( 5 == my_op() )`
+ * However, `JSVERIFY(5, my_op(), "bad return")` may be even clearer.
+ * (see JSVERIFY)
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define FAIL_UNLESS(condition) \
+if (!(condition)) { \
+ JSFAILED_AT() \
+ goto error; \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSERR_LONG()
+ *
+ * Purpose:
+ *
+ * Print an failure message for long-int arguments.
+ * ERROR-AT printed first.
+ * If `reason` is given, it is printed on own line and newlined after
+ * else, prints "expected/actual" aligned on own lines.
+ *
+ * *FAILED* at myfile.c:488 in somefunc()...
+ * forest must be made of trees.
+ *
+ * or
+ *
+ * *FAILED* at myfile.c:488 in somefunc()...
+ * ! Expected 425
+ * ! Actual 3
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSERR_LONG(expected, actual, reason) { \
+ JSFAILED_AT() \
+ if (reason!= NULL) { \
+ HDprintf("%s\n", (reason)); \
+ } else { \
+ HDprintf(" ! Expected %ld\n ! Actual %ld\n", \
+ (long)(expected), (long)(actual)); \
+ } \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSERR_STR()
+ *
+ * Purpose:
+ *
+ * Print an failure message for string arguments.
+ * ERROR-AT printed first.
+ * If `reason` is given, it is printed on own line and newlined after
+ * else, prints "expected/actual" aligned on own lines.
+ *
+ * *FAILED* at myfile.c:421 in myfunc()...
+ * Blue and Red strings don't match!
+ *
+ * or
+ *
+ * *FAILED* at myfile.c:421 in myfunc()...
+ * !!! Expected:
+ * this is my expected
+ * string
+ * !!! Actual:
+ * not what I expected at all
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSERR_STR(expected, actual, reason) { \
+ JSFAILED_AT() \
+ if ((reason) != NULL) { \
+ HDprintf("%s\n", (reason)); \
+ } else { \
+ HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", \
+ (expected), (actual)); \
+ } \
+}
+
+#ifdef JSVERIFY_EXP_ACT
+/* VERIFY rountines with paramter order (<expected>, <actual> [, <msg> ])
+ */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSVERIFY()
+ *
+ * Purpose:
+ *
+ * Verify that two long integers are equal.
+ * If unequal, print failure message
+ * (with `reason`, if not NULL; expected/actual if NULL)
+ * and jump to `error` at end of function
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY(expected, actual, reason) \
+if ((long)(actual) != (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)) \
+ goto error; \
+} /* JSVERIFY */
+
+#if 0 /* UNUSED */
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSVERIFY_NOT()
+ *
+ * Purpose:
+ *
+ * Verify that two long integers are _not_ equal.
+ * If equal, print failure message
+ * (with `reason`, if not NULL; expected/actual if NULL)
+ * and jump to `error` at end of function
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_NOT(expected, actual, reason) \
+if ((long)(actual) == (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)) \
+ goto error; \
+} /* JSVERIFY_NOT */
+#endif /* JSVERIFY_NOT unused */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSVERIFY_STR()
+ *
+ * Purpose:
+ *
+ * Verify that two strings are equal.
+ * If unequal, print failure message
+ * (with `reason`, if not NULL; expected/actual if NULL)
+ * and jump to `error` at end of function
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_STR(expected, actual, reason) \
+if (strcmp((actual), (expected)) != 0) { \
+ JSERR_STR((expected), (actual), (reason)); \
+ goto error; \
+} /* JSVERIFY_STR */
+
+
+#else
+/* JSVERIFY_EXP_ACT not defined
+ *
+ * Repeats macros above, but with actual/expected parameters reversed.
+ */
+
+
+/*----------------------------------------------------------------------------
+ * Macro: JSVERIFY()
+ * See: JSVERIFY documentation above.
+ * Programmer: Jacob Smith
+ * 2017-10-14
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY(actual, expected, reason) \
+if ((long)(actual) != (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)); \
+ goto error; \
+} /* JSVERIFY */
+
+#if 0 /* UNUSED */
+
+/*----------------------------------------------------------------------------
+ * Macro: JSVERIFY_NOT()
+ * See: JSVERIFY_NOT documentation above.
+ * Programmer: Jacob Smith
+ * 2017-10-14
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_NOT(actual, expected, reason) \
+if ((long)(actual) == (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)) \
+ goto error; \
+} /* JSVERIFY_NOT */
+#endif /* JSVERIFY_NOT unused */
+
+
+/*----------------------------------------------------------------------------
+ * Macro: JSVERIFY_STR()
+ * See: JSVERIFY_STR documentation above.
+ * Programmer: Jacob Smith
+ * 2017-10-14
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_STR(actual, expected, reason) \
+if (strcmp((actual), (expected)) != 0) { \
+ JSERR_STR((expected), (actual), (reason)); \
+ goto error; \
+} /* JSVERIFY_STR */
+
+#endif /* ifdef/else JSVERIFY_EXP_ACT */
+
+
+#define S3_TEST_PROFILE_NAME "ros3_vfd_test"
+
+#define S3_TEST_RESOURCE_TEXT_RESTRICTED "t8.shakespeare.txt"
+#define S3_TEST_RESOURCE_TEXT_PUBLIC "Poe_Raven.txt"
+#define S3_TEST_RESOURCE_MISSING "missing.csv"
+
+#define S3_TEST_RUN_TIMEOUT 0 /* run tests that might hang */
+#define S3_TEST_MAX_URL_SIZE 256 /* char array size */
+
+/* Global variables for aws test profile.
+ * An attempt is made to read ~/.aws/credentials and ~/.aws/config upon test
+ * startup -- if unable to open either file or cannot load region, id, and key,
+ * tests connecting with S3 will not be run
+ */
+static int s3_test_credentials_loaded = 0;
+static char s3_test_aws_region[16] = "";
+static char s3_test_aws_access_key_id[64] = "";
+static char s3_test_aws_secret_access_key[128] = "";
+static char s3_test_bucket_url[S3_TEST_MAX_URL_SIZE] = "";
+static hbool_t s3_test_bucket_defined = FALSE;
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_macro_format_credential()
+ *
+ * Purpose:
+ *
+ * Demonstrate that the macro `S3COMMS_FORMAT_CREDENTIAL`
+ * performs as expected.
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-19
+ *
+ *----------------------------------------------------------------------------
+ */
+static herr_t
+test_macro_format_credential(void)
+{
+ /************************
+ * test-local variables *
+ ************************/
+
+ char dest[256];
+ const char access[] = "AKIAIOSFODNN7EXAMPLE";
+ const char date[] = "20130524";
+ const char region[] = "us-east-1";
+ const char service[] = "s3";
+ const char expected[] =
+ "AKIAIOSFODNN7EXAMPLE/20130524/us-east-1/s3/aws4_request";
+
+ TESTING("test_macro_format_credential");
+
+ FAIL_IF( S3COMMS_MAX_CREDENTIAL_SIZE <
+ S3COMMS_FORMAT_CREDENTIAL(dest, access, date, region, service) )
+
+ JSVERIFY_STR( expected, dest, NULL )
+
+ PASSED();
+ return 0;
+
+error:
+ return -1;
+
+} /* end test_macro_format_credential() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_aws_canonical_request()
+ *
+ * Purpose:
+ *
+ * Demonstrate the construction of a Canoncial Request (and Signed Headers)
+ *
+ * Elided / not yet implemented:
+ * Query strings
+ * request "body"
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-04
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+test_aws_canonical_request(void)
+{
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct header {
+ const char *name;
+ const char *value;
+ };
+
+ struct testcase {
+ const char *exp_request;
+ const char *exp_headers;
+ const char *verb;
+ const char *resource;
+ unsigned int listsize;
+ struct header list[5];
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ struct testcase cases[] = {
+ { "GET\n/some/path.file\n\nhost:somebucket.someserver.somedomain\nrange:bytes=150-244\n\nhost;range\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "host;range",
+ "GET",
+ "/some/path.file",
+ 2,
+ { {"Range", "bytes=150-244"},
+ {"Host", "somebucket.someserver.somedomain"},
+ },
+ },
+ { "HEAD\n/bucketpath/myfile.dat\n\nhost:place.domain\nx-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nx-amz-date:19411207T150803Z\n\nhost;x-amz-content-sha256;x-amz-date\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "host;x-amz-content-sha256;x-amz-date",
+ "HEAD",
+ "/bucketpath/myfile.dat",
+ 3,
+ { {"x-amz-content-sha256", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},
+ {"host", "place.domain"},
+ {"x-amz-date", "19411207T150803Z"},
+ }
+ },
+ { "PUT\n/\n\n\n\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+ "",
+ "PUT",
+ "/",
+ 0,
+ {{"",""},}, /* unused; satisfies compiler */
+ },
+ }; /* struct testcase cases[] */
+ struct testcase *C = NULL;
+ char cr_dest[512]; /* canonical request */
+ hrb_t *hrb = NULL; /* http request buffer object */
+ unsigned int i = 0; /* looping/indexing */
+ unsigned int j = 0; /* looping/indexing */
+ hrb_node_t *node = NULL; /* http headers list pointer */
+ unsigned int n_cases = 3;
+ char sh_dest[64]; /* signed headers */
+
+ TESTING("test_aws_canonical_request");
+
+ for (i = 0; i < n_cases; i++) {
+ /* pre-test bookkeeping
+ */
+ C = &cases[i];
+ for (j = 0; j < 256; j++) { cr_dest[j] = 0; } /* zero request buffer */
+ for (j = 0; j < 64; j++) { sh_dest[j] = 0; } /* zero headers buffer */
+
+ /* create HTTP request object with given verb, resource/path
+ */
+ hrb = H5FD_s3comms_hrb_init_request(C->verb,
+ C->resource,
+ "HTTP/1.1");
+ HDassert(hrb->body == NULL);
+
+ /* Create headers list from test case input
+ */
+ for (j = 0; j < C->listsize; j++) {
+ FAIL_IF( FAIL ==
+ H5FD_s3comms_hrb_node_set(
+ &node,
+ C->list[j].name,
+ C->list[j].value));
+ }
+
+ hrb->first_header = node;
+
+ /* test
+ */
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_aws_canonical_request(
+ cr_dest,
+ 512,
+ sh_dest,
+ 64,
+ hrb),
+ " unable to compose canonical request" )
+ JSVERIFY_STR( C->exp_headers, sh_dest, NULL )
+ JSVERIFY_STR( C->exp_request, cr_dest, NULL )
+
+ /* tear-down
+ */
+ while (node != NULL) {
+ FAIL_IF( FAIL ==
+ H5FD_s3comms_hrb_node_set(&node, node->name, NULL));
+ }
+ HDassert(NULL == node);
+ FAIL_IF( FAIL == H5FD_s3comms_hrb_destroy(&hrb));
+ HDassert(NULL == hrb);
+
+ } /* for each test case */
+
+ /***************
+ * ERROR CASES *
+ ***************/
+
+ /* malformed hrb and/or node-list
+ */
+ JSVERIFY( FAIL, H5FD_s3comms_aws_canonical_request(
+ cr_dest,
+ 20,
+ sh_dest,
+ 20,
+ NULL),
+ "http request object cannot be null" )
+
+ hrb = H5FD_s3comms_hrb_init_request("GET", "/", "HTTP/1.1");
+ JSVERIFY( FAIL, H5FD_s3comms_aws_canonical_request(
+ NULL,
+ 20,
+ sh_dest,
+ 20,
+ hrb),
+ "canonical request destination cannot be NULL" )
+
+ JSVERIFY( FAIL, H5FD_s3comms_aws_canonical_request(
+ cr_dest,
+ 20,
+ NULL,
+ 20,
+ hrb),
+ "signed headers destination cannot be null" )
+
+ FAIL_IF( FAIL == H5FD_s3comms_hrb_destroy(&hrb) )
+ HDassert( NULL == hrb );
+
+ PASSED();
+ return 0;
+
+error:
+
+ if (node != NULL) {
+ while (node != NULL)
+ (void)H5FD_s3comms_hrb_node_set(&node, node->name, NULL);
+ HDassert( node == NULL );
+ }
+ if (hrb != NULL) {
+ (void)H5FD_s3comms_hrb_destroy(&hrb);
+ }
+
+ return -1;
+
+} /* end test_aws_canonical_request() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_bytes_to_hex
+ *
+ * Purpose:
+ *
+ * Define and verify behavior of `H5FD_s3comms_bytes_to_hex()`.
+ *
+ * Return:
+ *
+ * Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-14
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+test_bytes_to_hex(void)
+{
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct testcase {
+ const char exp[17]; /* in size * 2 + 1 for null terminator */
+ const unsigned char in[8];
+ size_t size;
+ hbool_t lower;
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ struct testcase cases[] = {
+ { "52F3000C9A",
+ {82,243,0,12,154},
+ 5,
+ FALSE,
+ },
+ { "009a0cf3005200", /* lowercase alphas */
+ {0,154,12,243,0,82,0},
+ 7,
+ TRUE,
+ },
+ { "",
+ {17,63,26,56},
+ 0,
+ FALSE, /* irrelevant */
+ },
+ };
+ int i = 0;
+ int n_cases = 3;
+ char out[17];
+ int out_off = 0;
+
+
+
+ TESTING("bytes-to-hex");
+
+ for (i = 0; i < n_cases; i++) {
+ for (out_off = 0; out_off < 17; out_off++) {
+ out[out_off] = 0;
+ }
+
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_bytes_to_hex(out,
+ cases[i].in,
+ cases[i].size,
+ cases[i].lower),
+ NULL )
+
+ JSVERIFY_STR(cases[i].exp, out, NULL)
+ }
+
+ /* dest cannot be null
+ */
+ JSVERIFY( FAIL,
+ H5FD_s3comms_bytes_to_hex(
+ NULL,
+ (const unsigned char *)"nada",
+ 5,
+ FALSE),
+ "destination cannot be null" )
+
+ PASSED();
+ return 0;
+
+error:
+ return -1;
+
+} /* end test_bytes_to_hex() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_hrb_init_request()
+ *
+ * Purpose:
+ *
+ * Define and verify behavior of `H5FD_s3comms_hrb_init_request()`
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-20
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+test_hrb_init_request(void)
+{
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct testcase {
+ const char msg[64];
+ const char *verb;
+ const char *resource;
+ const char *exp_res;
+ const char *version;
+ hbool_t ret_null;
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ struct testcase cases[] = {
+ { "get HTTP request just as we provided",
+ "GET",
+ "/path/to/some/file",
+ "/path/to/some/file",
+ "HTTP/1.1",
+ FALSE,
+ },
+ { "null verb substitues to GET",
+ NULL,
+ "/MYPATH/MYFILE.tiff",
+ "/MYPATH/MYFILE.tiff",
+ "HTTP/1.1",
+ FALSE,
+ },
+ { "demonstrate non-GET verb",
+ "HEAD",
+ "/MYPATH/MYFILE.tiff",
+ "/MYPATH/MYFILE.tiff",
+ "HTTP/1.1",
+ FALSE,
+ },
+ { "slash prepended to resource path, if necessary",
+ NULL,
+ "MYPATH/MYFILE.tiff",
+ "/MYPATH/MYFILE.tiff",
+ NULL,
+ FALSE,
+ },
+ { "null resource path causes problem",
+ "GET",
+ NULL,
+ NULL,
+ NULL,
+ TRUE,
+ },
+ };
+ struct testcase *C = NULL;
+ unsigned int i = 0;
+ unsigned int ncases = 5;
+ hrb_t *req = NULL;
+
+ TESTING("hrb_init_request");
+
+ for (i = 0; i < ncases; i++) {
+ C = &cases[i];
+ req = H5FD_s3comms_hrb_init_request(
+ C->verb,
+ C->resource,
+ C->version);
+ if (cases[i].ret_null == TRUE) {
+ FAIL_IF( req != NULL );
+ }
+ else {
+ FAIL_IF( req == NULL );
+ JSVERIFY( S3COMMS_HRB_MAGIC, req->magic, NULL )
+ if (C->verb == NULL) {
+ JSVERIFY_STR( "GET", req->verb, NULL )
+ }
+ else {
+ JSVERIFY_STR( req->verb, C->verb, NULL )
+ }
+ JSVERIFY_STR( "HTTP/1.1", req->version, NULL )
+ JSVERIFY_STR( C->exp_res, req->resource, NULL )
+ FAIL_IF( req->first_header != NULL );
+ FAIL_IF( req->body != NULL );
+ JSVERIFY( 0, req->body_len, NULL )
+ JSVERIFY( SUCCEED, H5FD_s3comms_hrb_destroy(&req),
+ "unable to destroy hrb_t" )
+ FAIL_IF( NULL != req ); /* should annull pointer as well as free */
+ }
+
+ } /* end for each testcase */
+
+ PASSED();
+ return 0;
+
+error:
+ (void)H5FD_s3comms_hrb_destroy(&req);
+
+ return -1;
+
+} /* end test_hrb_init_request() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_hrb_node_set()
+ *
+ * Purpose:
+ *
+ * Test operations on hrb_node_t structure
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-22
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+test_hrb_node_set(void)
+{
+ /*************************
+ * test-local structures *
+ *************************/
+
+ /* bundle of name/value representing an hrb_node_t
+ */
+ typedef struct node_mock_t {
+ const char *name;
+ const char *value;
+ } node_mock_t;
+
+ /* bundle for a testcase
+ *
+ * `message`
+ * purpose of the testcase
+ *
+ * `delta`
+ * container for name and value strings to pass into node-set function
+ * to to modify the list.
+ *
+ * `returned`
+ * expected return value of node-set function
+ *
+ * `given`
+ * `expected`
+ * string arrays representing the state of the list before and after
+ * modification. The number of strings must be even, with each name
+ * paired to a value. `NULL` terminates the list, with `{NULL}`
+ * representing the empty list.
+ */
+ typedef struct testcase {
+ const char *message;
+ node_mock_t delta;
+ herr_t returned;
+ const char *given[11]; /* name/value pairs in array; NULL sentinel */
+ const char *expected[11];
+ } testcase;
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ testcase cases[] = {
+ { "cannot remove node from null list",
+ { "Host", NULL },
+ FAIL,
+ {NULL},
+ {NULL},
+ },
+ { "cannot create list with NULL field name",
+ { NULL, "somevalue" },
+ FAIL,
+ {NULL},
+ {NULL},
+ },
+ { "create a new list",
+ { "Host", "somevalue" },
+ SUCCEED,
+ {NULL},
+ { "Host", "somevalue",
+ NULL,
+ },
+ },
+ { "insert new node at head list",
+ { "Host", "somevalue" },
+ SUCCEED,
+ { "Range", "bytes=20-40",
+ NULL,
+ },
+ { "Host", "somevalue",
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ },
+ { "append new node at list end",
+ { "x-amz-date", "somevalue" },
+ SUCCEED,
+ { "Range", "bytes=20-40",
+ NULL,
+ },
+ { "Range", "bytes=20-40",
+ "x-amz-date", "somevalue",
+ NULL,
+ },
+ },
+ { "insert new node inside list",
+ { "Intermediary", "somevalue" },
+ SUCCEED,
+ { "Host", "somehost" ,
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ { "Host", "somehost",
+ "Intermediary", "somevalue",
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ },
+ { "modify node",
+ { "Range", "bytes=40-80" },
+ SUCCEED,
+ { "Host", "somehost",
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ { "Host", "somehost",
+ "Range", "bytes=40-80",
+ NULL,
+ },
+ },
+ { "modify node with new case",
+ { "RANGE", "bytes=40-80" },
+ SUCCEED,
+ { "Host", "somehost",
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ { "Host", "somehost",
+ "RANGE", "bytes=40-80",
+ NULL,
+ },
+ },
+ { "cannot add node with no name",
+ { NULL, "bytes=40-80" },
+ FAIL,
+ { "Host", "somehost",
+ NULL,
+ },
+ { "Host", "somehost",
+ NULL,
+ },
+ },
+ { "add node with 'empty' name",
+ { "", "bytes=40-80" },
+ SUCCEED,
+ { "Host", "somehost",
+ NULL,
+ },
+ { "", "bytes=40-80",
+ "Host", "somehost",
+ NULL,
+ },
+ },
+ { "remove node from end of list",
+ { "Host", NULL },
+ SUCCEED,
+ { "Date", "Thr, 25 Jan 2018",
+ "Host", "somehost",
+ NULL,
+ },
+ { "Date", "Thr, 25 Jan 2018",
+ NULL,
+ },
+ },
+ { "remove node from middle of list",
+ { "Host", NULL },
+ SUCCEED,
+ { "Date", "Thr, 25 Jan 2018",
+ "Host", "somehost",
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ { "Date", "Thr, 25 Jan 2018",
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ },
+ { "remove node from start of list",
+ { "Date", NULL },
+ SUCCEED,
+ { "Date", "Thr, 25 Jan 2018",
+ "Host", "somehost",
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ { "Host", "somehost",
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ },
+ { "remove only node in list",
+ { "Date", NULL },
+ SUCCEED,
+ { "Date", "Thr, 25 Jan 2018",
+ NULL,
+ },
+ { NULL,
+ },
+ },
+ { "attempt to remove absent node fails",
+ { "Host", NULL },
+ FAIL,
+ { "Date", "Thr, 25 Jan 2018",
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ { "Date", "Thr, 25 Jan 2018",
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ },
+ { "removal is case-insensitive",
+ { "hOsT", NULL },
+ SUCCEED,
+ { "Date", "Thr, 25 Jan 2018",
+ "Host", "somehost",
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ { "Date", "Thr, 25 Jan 2018",
+ "Range", "bytes=20-40",
+ NULL,
+ },
+ },
+ };
+ unsigned testcases_count = 16;
+ unsigned test_i = 0;
+ hrb_node_t *list = NULL;
+
+ TESTING("hrb_node_t (test_hrb_node_set)");
+
+ for (test_i = 0; test_i < testcases_count; test_i++) {
+ const hrb_node_t *node = NULL;
+ const testcase *test = &(cases[test_i]);
+ unsigned mock_i = 0;
+
+ /*********
+ * SETUP *
+ *********/
+
+ for (mock_i = 0; test->given[mock_i] != NULL; mock_i += 2) {
+ const char *name = test->given[mock_i];
+ const char *valu = test->given[mock_i+1];
+
+ FAIL_IF( SUCCEED !=
+ H5FD_s3comms_hrb_node_set(&list, name, valu) )
+ }
+ /********
+ * TEST *
+ ********/
+
+ /* perform modification on list
+ */
+ JSVERIFY( test->returned,
+ H5FD_s3comms_hrb_node_set(&list,
+ test->delta.name,
+ test->delta.value),
+ test->message )
+
+
+ /* verify resulting list
+ */
+ node = list;
+ mock_i = 0;
+ while (test->expected[mock_i] != NULL && node != NULL) {
+ const char *name = test->expected[mock_i];
+ const char *valu = test->expected[mock_i+1];
+
+ JSVERIFY_STR( name, node->name, NULL )
+ JSVERIFY_STR( valu, node->value, NULL )
+
+ mock_i += 2;
+ node = node->next;
+ }
+ FAIL_IF( test->expected[mock_i] != NULL )
+ FAIL_IF( node != NULL )
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ while (list != NULL) {
+ FAIL_IF( SUCCEED !=
+ H5FD_s3comms_hrb_node_set(&list, list->name, NULL) )
+ }
+ } /* end for each testcase */
+
+ PASSED();
+ return 0;
+
+error:
+ while (list != NULL) {
+ (void)H5FD_s3comms_hrb_node_set(&list, list->name, NULL);
+ }
+
+ return -1;
+
+} /* end test_hrb_node_t() */
+
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_HMAC_SHA256()
+ *
+ * Purpose:
+ *
+ * Define and verify behavior of `H5FD_s3comms_HMAC_SHA256()`
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-19
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+test_HMAC_SHA256(void)
+{
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct testcase {
+ herr_t ret; /* SUCCEED/FAIL expected from call */
+ const unsigned char key[SHA256_DIGEST_LENGTH];
+ size_t key_len;
+ const char *msg;
+ size_t msg_len;
+ const char *exp; /* not used if ret == FAIL */
+ size_t dest_size; /* if 0, `dest` is not malloc'd */
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ struct testcase cases[] = {
+ { SUCCEED,
+ { 0xdb, 0xb8, 0x93, 0xac, 0xc0, 0x10, 0x96, 0x49,
+ 0x18, 0xf1, 0xfd, 0x43, 0x3a, 0xdd, 0x87, 0xc7,
+ 0x0e, 0x8b, 0x0d, 0xb6, 0xbe, 0x30, 0xc1, 0xfb,
+ 0xea, 0xfe, 0xfa, 0x5e, 0xc6, 0xba, 0x83, 0x78,
+ },
+ SHA256_DIGEST_LENGTH,
+ "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\n7344ae5b7ee6c3e7e6b0fe0640412a37625d1fbfff95c48bbb2dc43964946972",
+ HDstrlen("AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\n7344ae5b7ee6c3e7e6b0fe0640412a37625d1fbfff95c48bbb2dc43964946972"),
+ "f0e8bdb87c964420e857bd35b5d6ed310bd44f0170aba48dd91039c6036bdb41",
+ SHA256_DIGEST_LENGTH * 2 + 1, /* +1 for null terminator */
+ },
+ { SUCCEED,
+ {'J','e','f','e'},
+ 4,
+ "what do ya want for nothing?",
+ 28,
+ "5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843",
+ SHA256_DIGEST_LENGTH * 2 + 1,
+ },
+ { FAIL,
+ "DOESN'T MATTER",
+ 14,
+ "ALSO IRRELEVANT",
+ 15,
+ NULL,
+ 0, /* dest -> null, resulting in immediate error */
+ },
+ };
+ char *dest = NULL;
+ int i = 0;
+ int n_cases = 3;
+
+ TESTING("HMAC_SHA256");
+
+ for (i = 0; i < n_cases; i++) {
+ if (cases[i].dest_size == 0) {
+ dest = NULL;
+ } else {
+ dest = (char *)HDmalloc(sizeof(char) * cases[i].dest_size);
+ HDassert(dest != NULL);
+ }
+
+ JSVERIFY( cases[i].ret,
+ H5FD_s3comms_HMAC_SHA256(
+ cases[i].key,
+ cases[i].key_len,
+ cases[i].msg,
+ cases[i].msg_len,
+ dest),
+ cases[i].msg );
+ if (cases[i].ret == SUCCEED) {
+#ifdef VERBOSE
+ if (0 !=
+ strncmp(cases[i].exp,
+ dest,
+ HDstrlen(cases[i].exp)))
+ {
+ /* print out how wrong things are, and then fail
+ */
+ dest = (char *)realloc(dest, cases[i].dest_size + 1);
+ HDassert(dest != NULL);
+ dest[cases[i].dest_size] = 0;
+ HDfprintf(stdout,
+ "ERROR:\n!!! \"%s\"\n != \"%s\"\n",
+ cases[i].exp,
+ dest);
+ TEST_ERROR;
+ }
+#else /* VERBOSE not defined */
+ /* simple pass/fail test
+ */
+ JSVERIFY( 0,
+ strncmp(cases[i].exp, dest, HDstrlen(cases[i].exp)),
+ NULL);
+#endif /* VERBOSE */
+ }
+ free(dest);
+ }
+
+ PASSED();
+ return 0;
+
+error:
+ free(dest);
+ return -1;
+
+} /* end test_HMAC_SHA256() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: test_nlowercase()
+ *
+ * Purpose:
+ *
+ * Define and verify behavior of `H5FD_s3comms_nlowercase()`
+ *
+ * Programmer: Jacob Smith
+ * 2017-19-18
+ *
+ *----------------------------------------------------------------------------
+ */
+static herr_t
+test_nlowercase(void)
+{
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct testcase {
+ const char *in;
+ size_t len;
+ const char *exp;
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ /* any character after in exp on or after exp[len] is undefined.
+ * in this test, kept as the null character for simplicity.
+ */
+ struct testcase cases[] = {
+ { "HALlEluJAh",
+ 6,
+ "hallel",
+ },
+ { "all\0 lower",
+ 10,
+ "all\0 lower",
+ },
+ { "to meeeeeee",
+ 0,
+ "",
+ },
+ };
+ char *dest = NULL;
+ int i = 0;
+ int n_cases = 3;
+
+ TESTING("nlowercase");
+
+ for (i = 0; i < n_cases; i++) {
+ dest = (char *)HDmalloc(sizeof(char) * 16);
+
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_nlowercase(dest,
+ cases[i].in,
+ cases[i].len),
+ cases[i].in )
+ if (cases[i].len > 0) {
+ JSVERIFY( 0, strncmp(dest, cases[i].exp, cases[i].len), NULL )
+ }
+ free(dest);
+ } /* end for each testcase */
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_nlowercase(NULL,
+ cases[0].in,
+ cases[0].len),
+ "null distination should fail" )
+
+ PASSED();
+ return 0;
+
+error:
+ free(dest);
+ return -1;
+
+} /* end test_nlowercase() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_parse_url()
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-??
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+test_parse_url(void)
+{
+ /*********************
+ * test-local macros *
+ *********************/
+
+ /*************************
+ * test-local structures *
+ *************************/
+
+ typedef struct {
+ const char *scheme;
+ const char *host;
+ const char *port;
+ const char *path;
+ const char *query;
+ } const_purl_t;
+
+ struct testcase {
+ const char *url;
+ herr_t exp_ret; /* expected return; */
+ /* if FAIL, `expected` is unused */
+ const_purl_t expected;
+ const char *msg;
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ parsed_url_t *purl = NULL;
+ unsigned int i = 0;
+ unsigned int ncases = 15;
+ struct testcase cases[] = {
+ { NULL,
+ FAIL,
+ { NULL, NULL, NULL, NULL, NULL },
+ "null url",
+ },
+ { "",
+ FAIL,
+ { NULL, NULL, NULL, NULL, NULL },
+ "empty url",
+ },
+ { "ftp://[1000:4000:0002:2010]",
+ SUCCEED,
+ { "ftp",
+ "[1000:4000:0002:2010]",
+ NULL,
+ NULL,
+ NULL,
+ },
+ "IPv6 ftp and empty path (root)",
+ },
+ { "ftp://[1000:4000:0002:2010]:2040",
+ SUCCEED,
+ { "ftp",
+ "[1000:4000:0002:2010]",
+ "2040",
+ NULL,
+ NULL,
+ },
+ "root IPv6 ftp with port",
+ },
+ { "http://some.domain.org:9000/path/to/resource.txt",
+ SUCCEED,
+ { "http",
+ "some.domain.org",
+ "9000",
+ "path/to/resource.txt",
+ NULL,
+ },
+ "without query",
+ },
+ { "https://domain.me:00/file.txt?some_params unchecked",
+ SUCCEED,
+ { "https",
+ "domain.me",
+ "00",
+ "file.txt",
+ "some_params unchecked",
+ },
+ "with query",
+ },
+ { "ftp://domain.com/",
+ SUCCEED,
+ { "ftp",
+ "domain.com",
+ NULL,
+ NULL,
+ NULL,
+ },
+ "explicit root w/out port",
+ },
+ { "ftp://domain.com:1234/",
+ SUCCEED,
+ { "ftp",
+ "domain.com",
+ "1234",
+ NULL,
+ NULL,
+ },
+ "explicit root with port",
+ },
+ { "ftp://domain.com:1234/file?",
+ FAIL,
+ { NULL, NULL, NULL, NULL, NULL, },
+ "empty query is invalid",
+ },
+ { "ftp://:1234/file",
+ FAIL,
+ { NULL, NULL, NULL, NULL, NULL, },
+ "no host",
+ },
+ { "h&r block",
+ FAIL,
+ { NULL, NULL, NULL, NULL, NULL, },
+ "no scheme (bad URL)",
+ },
+ { "http://domain.com?a=b&d=b",
+ SUCCEED,
+ { "http",
+ "domain.com",
+ NULL,
+ NULL,
+ "a=b&d=b",
+ },
+ "QUERY with implict PATH",
+ },
+ { "http://[5]/path?a=b&d=b",
+ SUCCEED,
+ { "http",
+ "[5]",
+ NULL,
+ "path",
+ "a=b&d=b",
+ },
+ "IPv6 extraction is really dumb",
+ },
+ { "http://[1234:5678:0910:1112]:port/path",
+ FAIL,
+ { NULL, NULL, NULL, NULL, NULL, },
+ "non-decimal PORT (port)",
+ },
+ { "http://mydomain.com:01a3/path",
+ FAIL,
+ { NULL, NULL, NULL, NULL, NULL, },
+ "non-decimal PORT (01a3)",
+ },
+ };
+
+ TESTING("url-parsing functionality");
+
+ /*********
+ * TESTS *
+ *********/
+
+ for (i = 0; i < ncases; i++) {
+ HDassert( purl == NULL );
+
+ JSVERIFY( cases[i].exp_ret,
+ H5FD_s3comms_parse_url(cases[i].url, &purl),
+ cases[i].msg )
+
+ if (cases[i].exp_ret == FAIL) {
+ /* on FAIL, `purl` should be untouched--remains NULL */
+ FAIL_UNLESS( purl == NULL )
+ }
+ else {
+ /* on SUCCEED, `purl` should be set */
+ FAIL_IF( purl == NULL )
+
+ if (cases[i].expected.scheme != NULL) {
+ FAIL_IF( NULL == purl->scheme )
+ JSVERIFY_STR( cases[i].expected.scheme,
+ purl->scheme,
+ cases[i].msg )
+ } else {
+ FAIL_UNLESS( NULL == purl->scheme )
+ }
+
+ if (cases[i].expected.host != NULL) {
+ FAIL_IF( NULL == purl->host )
+ JSVERIFY_STR( cases[i].expected.host,
+ purl->host,
+ cases[i].msg )
+ } else {
+ FAIL_UNLESS( NULL == purl->host )
+ }
+
+ if (cases[i].expected.port != NULL) {
+ FAIL_IF( NULL == purl->port )
+ JSVERIFY_STR( cases[i].expected.port,
+ purl->port,
+ cases[i].msg )
+ } else {
+ FAIL_UNLESS( NULL == purl->port )
+ }
+
+ if (cases[i].expected.path != NULL) {
+ FAIL_IF( NULL == purl->path )
+ JSVERIFY_STR( cases[i].expected.path,
+ purl->path,
+ cases[i].msg )
+ } else {
+ FAIL_UNLESS( NULL == purl->path )
+ }
+
+ if (cases[i].expected.query != NULL) {
+ FAIL_IF( NULL == purl->query )
+ JSVERIFY_STR( cases[i].expected.query,
+ purl->query,
+ cases[i].msg )
+ } else {
+ FAIL_UNLESS( NULL == purl->query )
+ }
+ } /* end if parse-url return SUCCEED/FAIL */
+
+ /* per-test cleanup
+ * well-behaved, even if `purl` is NULL
+ */
+ FAIL_IF( FAIL == H5FD_s3comms_free_purl(purl) )
+ purl = NULL;
+
+ } /* end for each testcase */
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * cleanup *
+ ***********/
+ (void)H5FD_s3comms_free_purl(purl);
+
+ return -1;
+
+} /* end test_parse_url() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_percent_encode_char()
+ *
+ * Purpose:
+ *
+ * Define and verify behavior of `H5FD_s3comms_percent_encode_char()`
+ *
+ * Return:
+ *
+ * Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-14
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+test_percent_encode_char(void)
+{
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct testcase {
+ const char c;
+ const char *exp;
+ size_t exp_len;
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ struct testcase cases[] = {
+ {'$', "%24", 3}, /* u+0024 dollar sign */
+ {' ', "%20", 3}, /* u+0020 space */
+ {'^', "%5E", 3}, /* u+0094 carat */
+ {'/', "%2F", 3}, /* u+002f solidus (forward slash) */
+ /* {??, "%C5%8C", 6},*/ /* u+014c Latin Capital Letter O with Macron */
+ /* Not included because it is multibyte "wide" character that poses */
+ /* issues both in the underlying function and in being written in */
+ /* this file. */
+ /* {'¢', "%C2%A2", 6}, */ /* u+00a2 cent sign */
+ /* above works, but complains about wide character overflow */
+ /* Elide for now, until it is determined (a) unnecessary or */
+ /* (b) requiring signature change to accommodate wide characters */
+ {'\0', "%00", 3}, /* u+0000 null */
+ };
+ char dest[13];
+ size_t dest_len = 0;
+ int i = 0;
+ int n_cases = 5;
+
+ TESTING("percent encode characters");
+
+ for (i = 0; i < n_cases; i++) {
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_percent_encode_char(
+ dest,
+ (const unsigned char)cases[i].c,
+ &dest_len),
+ NULL )
+ JSVERIFY(cases[i].exp_len, dest_len, NULL )
+ JSVERIFY(0, strncmp(dest, cases[i].exp, dest_len), NULL )
+ JSVERIFY_STR( cases[i].exp, dest, NULL )
+ }
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_percent_encode_char(
+ NULL,
+ (const unsigned char)'^',
+ &dest_len),
+ NULL )
+
+ PASSED();
+ return 0;
+
+error:
+ return -1;
+} /* end test_percent_encode_char() */
+
+
+/*---------------------------------------------------------------------------
+ * Function: test_s3r_open()
+ *
+ * Programmer: Jacob Smith 2018-01-24
+ *
+ * Changes: None
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+test_s3r_get_filesize(void)
+{
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ char url_raven[S3_TEST_MAX_URL_SIZE];
+ s3r_t *handle = NULL;
+
+ TESTING("s3r_get_filesize");
+
+ /* setup -- compose url to target resource
+ */
+ if (FALSE == s3_test_bucket_defined) {
+ SKIPPED();
+ puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ fflush(stdout);
+ return 0;
+ }
+
+ FAIL_IF( S3_TEST_MAX_URL_SIZE <
+ HDsnprintf(url_raven,
+ S3_TEST_MAX_URL_SIZE,
+ "%s/%s",
+ s3_test_bucket_url,
+ S3_TEST_RESOURCE_TEXT_PUBLIC) );
+
+ JSVERIFY( 0, H5FD_s3comms_s3r_get_filesize(NULL),
+ "filesize of the null handle should be 0" )
+
+ handle = H5FD_s3comms_s3r_open(url_raven, NULL, NULL, NULL);
+ FAIL_IF( handle == NULL )
+
+ JSVERIFY( 6464, H5FD_s3comms_s3r_get_filesize(handle), NULL )
+
+
+ FAIL_IF( SUCCEED != H5FD_s3comms_s3r_close(handle) )
+
+ PASSED();
+ return 0;
+
+error:
+ if (handle != NULL)
+ (void)H5FD_s3comms_s3r_close(handle);
+
+ return -1;
+
+} /* end test_s3r_get_filesize() */
+
+
+/*---------------------------------------------------------------------------
+ * Function: test_s3r_open()
+ *
+ * Programmer: Jacob Smith 2018-01-??
+ *
+ * Changes: None
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+test_s3r_open(void)
+{
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ char url_missing[S3_TEST_MAX_URL_SIZE];
+ char url_raven[S3_TEST_MAX_URL_SIZE];
+ char url_raven_badport[S3_TEST_MAX_URL_SIZE];
+ char url_shakespeare[S3_TEST_MAX_URL_SIZE];
+ unsigned char signing_key[SHA256_DIGEST_LENGTH];
+ struct tm *now = NULL;
+ char iso8601now[ISO8601_SIZE];
+ s3r_t *handle = NULL;
+ hbool_t curl_ready = FALSE;
+ parsed_url_t *purl = NULL;
+
+ TESTING("s3r_open");
+
+ if (s3_test_credentials_loaded == 0) {
+ SKIPPED();
+ puts(" s3 credentials are not loaded");
+ fflush(stdout);
+ return 0;
+ }
+ if (FALSE == s3_test_bucket_defined) {
+ SKIPPED();
+ puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ fflush(stdout);
+ return 0;
+ }
+
+ /******************
+ * PRE-TEST SETUP *
+ ******************/
+
+ FAIL_IF( S3_TEST_MAX_URL_SIZE <
+ HDsnprintf(url_shakespeare,
+ S3_TEST_MAX_URL_SIZE,
+ "%s/%s",
+ s3_test_bucket_url,
+ S3_TEST_RESOURCE_TEXT_RESTRICTED) );
+
+ FAIL_IF( S3_TEST_MAX_URL_SIZE <
+ HDsnprintf(url_missing,
+ S3_TEST_MAX_URL_SIZE,
+ "%s/%s",
+ s3_test_bucket_url,
+ S3_TEST_RESOURCE_MISSING) );
+
+ FAIL_IF( S3_TEST_MAX_URL_SIZE <
+ HDsnprintf(url_raven,
+ S3_TEST_MAX_URL_SIZE,
+ "%s/%s",
+ s3_test_bucket_url,
+ S3_TEST_RESOURCE_TEXT_PUBLIC) );
+
+ /* Set given bucket url with invalid/inactive port number for badport.
+ * Note, this sort of micro-management of parsed_url_t is not advised
+ */
+ FAIL_IF( FAIL == H5FD_s3comms_parse_url(s3_test_bucket_url, &purl) )
+ if (purl->port == NULL) {
+ purl->port = (char *)H5MM_malloc(sizeof(char) * 5);
+ FAIL_IF( purl->port == NULL );
+ FAIL_IF( 5 < HDsnprintf(purl->port, 5, "9000") )
+ } else if (strcmp(purl->port, "9000") != 0) {
+ FAIL_IF( 5 < HDsnprintf(purl->port, 5, "9000") )
+ } else {
+ FAIL_IF( 5 < HDsnprintf(purl->port, 5, "1234") )
+ }
+ FAIL_IF( S3_TEST_MAX_URL_SIZE <
+ HDsnprintf(url_raven_badport,
+ S3_TEST_MAX_URL_SIZE,
+ "%s://%s:%s/%s",
+ purl->scheme,
+ purl->host,
+ purl->port,
+ S3_TEST_RESOURCE_TEXT_PUBLIC) );
+
+ curl_global_init(CURL_GLOBAL_DEFAULT);
+ curl_ready = TRUE;
+
+ now = gmnow();
+ FAIL_IF( now == NULL )
+ FAIL_IF( ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1) );
+
+ /* It is desired to have means available to verify that signing_key
+ * was set successfully and to an expected value.
+ */
+ FAIL_IF( FAIL ==
+ H5FD_s3comms_signing_key(
+ signing_key,
+ (const char *)s3_test_aws_secret_access_key,
+ (const char *)s3_test_aws_region,
+ (const char *)iso8601now) );
+
+ /*************************
+ * OPEN NONEXISTENT FILE *
+ *************************/
+
+ /* attempt anonymously
+ */
+ handle = H5FD_s3comms_s3r_open(url_missing, NULL, NULL, NULL);
+ FAIL_IF( handle != NULL );
+
+ /* attempt with authentication
+ */
+ handle = H5FD_s3comms_s3r_open(
+ url_missing,
+ (const char *)s3_test_aws_region,
+ (const char *)s3_test_aws_access_key_id,
+ (const unsigned char *)signing_key);
+ FAIL_IF( handle != NULL );
+
+ /*************************
+ * INACTIVE PORT ON HOST *
+ *************************/
+
+#if S3_TEST_RUN_TIMEOUT
+ HDprintf("Opening on inactive port may hang for a minute; waiting for timeout\n");
+ handle = H5FD_s3comms_s3r_open(url_raven_badport, NULL, NULL, NULL);
+ FAIL_IF( handle != NULL );
+#endif
+
+ /*******************************
+ * INVALID AUTHENTICATION INFO *
+ *******************************/
+
+ /* anonymous access on restricted file
+ */
+ handle = H5FD_s3comms_s3r_open(url_shakespeare, NULL, NULL, NULL);
+ FAIL_IF( handle != NULL );
+
+ /* passed in a bad ID
+ */
+ handle = H5FD_s3comms_s3r_open(
+ url_shakespeare,
+ (const char *)s3_test_aws_region,
+ "I_MADE_UP_MY_ID",
+ (const unsigned char *)signing_key);
+ FAIL_IF( handle != NULL );
+
+ /* using an invalid signing key
+ */
+ handle = H5FD_s3comms_s3r_open(
+ url_shakespeare,
+ (const char *)s3_test_aws_region,
+ (const char *)s3_test_aws_access_key_id,
+ (const unsigned char *)EMPTY_SHA256);
+ FAIL_IF( handle != NULL );
+
+ /*******************************
+ * SUCCESSFUL OPEN (AND CLOSE) *
+ *******************************/
+
+ /* anonymous
+ */
+ handle = H5FD_s3comms_s3r_open(url_raven, NULL, NULL, NULL);
+ FAIL_IF( handle == NULL );
+ JSVERIFY( 6464, H5FD_s3comms_s3r_get_filesize(handle),
+ "did not get expected filesize" )
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_s3r_close(handle),
+ "unable to close file" )
+ handle = NULL;
+
+ /* using authentication on anonymously-accessible file?
+ */
+ handle = H5FD_s3comms_s3r_open(
+ url_raven,
+ (const char *)s3_test_aws_region,
+ (const char *)s3_test_aws_access_key_id,
+ (const unsigned char *)signing_key);
+ FAIL_IF( handle == NULL );
+ JSVERIFY( 6464, H5FD_s3comms_s3r_get_filesize(handle), NULL )
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_s3r_close(handle),
+ "unable to close file" )
+ handle = NULL;
+
+ /* authenticating
+ */
+ handle = H5FD_s3comms_s3r_open(
+ url_shakespeare,
+ (const char *)s3_test_aws_region,
+ (const char *)s3_test_aws_access_key_id,
+ (const unsigned char *)signing_key);
+ FAIL_IF( handle == NULL );
+ JSVERIFY( 5458199, H5FD_s3comms_s3r_get_filesize(handle), NULL )
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_s3r_close(handle),
+ "unable to close file" )
+ handle = NULL;
+
+
+
+ curl_global_cleanup();
+ curl_ready = FALSE;
+
+ FAIL_IF( FAIL == H5FD_s3comms_free_purl(purl) )
+ purl = NULL;
+
+ PASSED();
+ return 0;
+error:
+ /***********
+ * cleanup *
+ ***********/
+
+ if (handle != NULL)
+ H5FD_s3comms_s3r_close(handle);
+ if (purl != NULL)
+ H5FD_s3comms_free_purl(purl);
+ if (curl_ready == TRUE)
+ curl_global_cleanup();
+
+ return -1;
+
+} /* end test_s3r_open() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_s3r_read()
+ *
+ * Purpose:
+ *
+ * Specify and demonstrate the use and life cycle of an S3 Request handle
+ * `s3r_t`, through its related functions.
+ *
+ * H5FD_s3comms_s3r_open
+ * H5FD_s3comms_s3r_getsize << called by open() _only_
+ * H5FD_s3comms_s3r_read << called by getsize(), multiple times working
+ * H5FD_s3comms_s3r_close
+ *
+ * Shows most basic curl interation.
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-06
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+test_s3r_read(void)
+{
+
+#define S3COMMS_TEST_BUFFER_SIZE 256
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ char url_raven[S3_TEST_MAX_URL_SIZE];
+ char buffer[S3COMMS_TEST_BUFFER_SIZE];
+ s3r_t *handle = NULL;
+ hbool_t curl_ready = FALSE;
+ unsigned int i = 0;
+
+ TESTING("test_s3r_read");
+
+ /*
+ * initial setup
+ */
+ if (FALSE == s3_test_bucket_defined) {
+ SKIPPED();
+ puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ fflush(stdout);
+ return 0;
+ }
+
+ curl_global_init(CURL_GLOBAL_DEFAULT);
+ curl_ready = TRUE;
+ FAIL_IF( S3_TEST_MAX_URL_SIZE <
+ HDsnprintf(url_raven,
+ S3_TEST_MAX_URL_SIZE,
+ "%s/%s",
+ s3_test_bucket_url,
+ S3_TEST_RESOURCE_TEXT_PUBLIC) );
+
+ for (i = 0; i < S3COMMS_TEST_BUFFER_SIZE; i++)
+ buffer[i] = '\0';
+
+ /* open file
+ */
+ handle = H5FD_s3comms_s3r_open(url_raven, NULL, NULL, NULL);
+ FAIL_IF( handle == NULL )
+ JSVERIFY( 6464, H5FD_s3comms_s3r_get_filesize(handle), NULL )
+
+ for (i = 0; i < S3COMMS_TEST_BUFFER_SIZE; i++)
+ buffer[i] = '\0';
+
+ /**********************
+ * read start of file *
+ **********************/
+
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_s3r_read(
+ handle,
+ (haddr_t)0,
+ (size_t)118,
+ buffer),
+ NULL )
+ JSVERIFY_STR (
+ "Once upon a midnight dreary, while I pondered, weak and weary,\n" \
+ "Over many a quaint and curious volume of forgotten lore",
+ buffer,
+ NULL )
+
+ for (i = 0; i < S3COMMS_TEST_BUFFER_SIZE; i++)
+ buffer[i] = '\0';
+
+ /************************
+ * read arbitrary range *
+ ************************/
+
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_s3r_read(
+ handle,
+ (haddr_t)2540,
+ (size_t)54,
+ buffer),
+ NULL )
+ JSVERIFY_STR( "the grave and stern decorum of the countenance it wore",
+ buffer,
+ NULL )
+
+ for (i = 0; i < S3COMMS_TEST_BUFFER_SIZE; i++)
+ buffer[i] = '\0';
+
+ /**********************
+ * read one character *
+ **********************/
+
+ JSVERIFY(SUCCEED,
+ H5FD_s3comms_s3r_read(
+ handle,
+ (haddr_t)2540,
+ (size_t)1,
+ buffer),
+ NULL )
+ JSVERIFY_STR( "t", buffer, NULL )
+
+
+ for (i = 0; i < S3COMMS_TEST_BUFFER_SIZE; i++)
+ buffer[i] = '\0';
+
+ /***************
+ * read to EoF *
+ ***************/
+
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_s3r_read(
+ handle,
+ (haddr_t)6370,
+ (size_t)0,
+ buffer),
+ NULL )
+ JSVERIFY( 0,
+ strncmp(buffer,
+ "And my soul from out that shadow that lies floating on the floor\nShall be lifted—nevermore!\n",
+ 94),
+ buffer )
+
+ for (i = 0; i < S3COMMS_TEST_BUFFER_SIZE; i++)
+ buffer[i] = '\0';
+
+ /*****************
+ * read past eof *
+ *****************/
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_s3r_read(
+ handle,
+ (haddr_t)6400,
+ (size_t)100, /* 6400+100 > 6464 */
+ buffer),
+ NULL )
+ JSVERIFY( 0, strcmp("", buffer), NULL )
+
+ /************************
+ * read starts past eof *
+ ************************/
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_s3r_read(
+ handle,
+ (haddr_t)1200699, /* 1200699 > 6464 */
+ (size_t)100,
+ buffer),
+ NULL )
+ JSVERIFY( 0, strcmp("", buffer), NULL )
+
+ /**********************
+ * read starts on eof *
+ **********************/
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_s3r_read(
+ handle,
+ (haddr_t)6464,
+ (size_t)0,
+ buffer),
+ NULL )
+ JSVERIFY( 0, strcmp("", buffer), NULL )
+
+ /*************
+ * TEAR DOWN *
+ *************/
+
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_s3r_close(handle),
+ "unable to close file" )
+ handle = NULL;
+
+ curl_global_cleanup();
+ curl_ready = FALSE;
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * cleanup *
+ ***********/
+
+ if (handle != NULL)
+ H5FD_s3comms_s3r_close(handle);
+
+ if (curl_ready == TRUE)
+ curl_global_cleanup();
+
+ return -1;
+
+#undef S3COMMS_TEST_BUFFER_SIZE
+
+} /* end test_s3r_read() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_signing_key()
+ *
+ * Purpose:
+ *
+ * Define and verify behavior of `H5FD_s3comms_signing_key()`
+ *
+ * More test cases would be a very good idea.
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-18
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+test_signing_key(void)
+{
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct testcase {
+ const char *region;
+ const char *secret_key;
+ const char *when;
+ unsigned char exp[SHA256_DIGEST_LENGTH];
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ struct testcase cases[] = {
+ { "us-east-1",
+ "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
+ "20130524T000000Z",
+ { 0xdb, 0xb8, 0x93, 0xac, 0xc0, 0x10, 0x96, 0x49,
+ 0x18, 0xf1, 0xfd, 0x43, 0x3a, 0xdd, 0x87, 0xc7,
+ 0x0e, 0x8b, 0x0d, 0xb6, 0xbe, 0x30, 0xc1, 0xfb,
+ 0xea, 0xfe, 0xfa, 0x5e, 0xc6, 0xba, 0x83, 0x78,
+ },
+ },
+ };
+ int i = 0;
+ unsigned char *key = NULL;
+ int ncases = 1;
+
+ TESTING("signing_key");
+
+ for (i = 0; i < ncases; i++) {
+ key = (unsigned char *)HDmalloc(sizeof(unsigned char) * \
+ SHA256_DIGEST_LENGTH);
+ HDassert(key != NULL);
+
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_signing_key(
+ key,
+ cases[i].secret_key,
+ cases[i].region,
+ cases[i].when),
+ NULL )
+
+ JSVERIFY( 0,
+ strncmp((const char *)cases[i].exp,
+ (const char *)key,
+ SHA256_DIGEST_LENGTH),
+ cases[i].exp )
+
+ free(key);
+ key = NULL;
+ }
+
+
+ /***************
+ * ERROR CASES *
+ ***************/
+
+ key = (unsigned char *)HDmalloc(sizeof(unsigned char) * \
+ SHA256_DIGEST_LENGTH);
+ HDassert(key != NULL);
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_signing_key(
+ NULL,
+ cases[0].secret_key,
+ cases[0].region,
+ cases[0].when),
+ "destination cannot be NULL" )
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_signing_key(
+ key,
+ NULL,
+ cases[0].region,
+ cases[0].when),
+ "secret key cannot be NULL" )
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_signing_key(
+ key,
+ cases[0].secret_key,
+ NULL,
+ cases[0].when),
+ "aws region cannot be NULL" )
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_signing_key(
+ key,
+ cases[0].secret_key,
+ cases[0].region,
+ NULL),
+ "time string cannot be NULL" )
+
+ free(key);
+ key = NULL;
+
+ PASSED();
+ return 0;
+
+error:
+ if (key != NULL) {
+ free(key);
+ }
+
+ return -1;
+
+} /* end test_signing_key() */
+
+
+/*---------------------------------------------------------------------------
+ *
+ * Function: test_tostringtosign()
+ *
+ * Purpose:
+ *
+ * Verify that we can get the "string to sign" from a Canonical Request and
+ * related information.
+ *
+ * Demonstrate failure cases.
+ *
+ * Return:
+ *
+ * Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-13
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+test_tostringtosign(void)
+{
+ /************************
+ * test-local variables *
+ ************************/
+
+ const char canonreq[] = "GET\n/test.txt\n\nhost:examplebucket.s3.amazonaws.com\nrange:bytes=0-9\nx-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nx-amz-date:20130524T000000Z\n\nhost;range;x-amz-content-sha256;x-amz-date\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
+ const char iso8601now[] = "20130524T000000Z";
+ const char region[] = "us-east-1";
+ char s2s[512];
+
+ TESTING("s3comms tostringtosign");
+
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_tostringtosign(s2s, canonreq, iso8601now, region),
+ "unable to create string to sign" )
+
+ JSVERIFY_STR( "AWS4-HMAC-SHA256\n20130524T000000Z\n20130524/us-east-1/s3/aws4_request\n7344ae5b7ee6c3e7e6b0fe0640412a37625d1fbfff95c48bbb2dc43964946972",
+ s2s, NULL )
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_tostringtosign(s2s, NULL, iso8601now, region),
+ "canonical request string cannot be NULL" )
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_tostringtosign(s2s, canonreq, NULL, region),
+ "time string cannot be NULL" )
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_tostringtosign(s2s, canonreq, iso8601now, NULL),
+ "aws region cannot be NULL" )
+
+ PASSED();
+ return 0;
+
+error :
+ return -1;
+
+} /* end test_tostringtosign() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: test_trim()
+ *
+ * Purpose:
+ *
+ * Define and verify behavior of `H5FD_s3comms_trim()`.
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-14
+ *
+ *----------------------------------------------------------------------------
+ */
+static herr_t
+test_trim(void)
+{
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct testcase {
+ const char *in;
+ size_t in_len;
+ const char *exp;
+ size_t exp_len;
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ struct testcase cases[] = {
+ { "block string",
+ 12,
+ "block string",
+ 12,
+ },
+ { " \n\r \t",
+ 6,
+ "",
+ 0,
+ },
+ { " \twhite b4",
+ 10,
+ "white b4",
+ 8,
+ },
+ { "white after\r\n ",
+ 15,
+ "white after",
+ 11,
+ },
+ { " on\nends\t",
+ 9,
+ "on\nends",
+ 7,
+ },
+ };
+ char dest[32];
+ size_t dest_len = 0;
+ int i = 0;
+ int n_cases = 5;
+ char *str = NULL;
+
+
+
+ TESTING("s3comms trim");
+
+ for (i = 0; i < n_cases; i++) {
+ HDassert(str == NULL);
+ str = (char *)HDmalloc(sizeof(char) * cases[i].in_len);
+ HDassert(str != NULL);
+ HDstrncpy(str, cases[i].in, cases[i].in_len);
+
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_trim(dest, str, cases[i].in_len, &dest_len),
+ NULL )
+ JSVERIFY( cases[i].exp_len, dest_len, cases[i].in )
+ if (dest_len > 0) {
+ JSVERIFY( 0, strncmp(cases[i].exp, dest, dest_len),
+ cases[i].exp )
+ }
+ free(str);
+ str = NULL;
+ } /* end for each testcase */
+
+ JSVERIFY( SUCCEED, H5FD_s3comms_trim(dest, NULL, 3, &dest_len),
+ "should not fail when trimming a null string" );
+ JSVERIFY( 0, dest_len, "trimming NULL string writes 0 characters" )
+
+ HDassert(str == NULL);
+ str = (char *)HDmalloc(sizeof(char *) * 11);
+ HDassert(str != NULL);
+ memcpy(str, "some text ", 11); /* string with null terminator */
+ JSVERIFY( FAIL, H5FD_s3comms_trim(NULL, str, 10, &dest_len),
+ "destination for trim cannot be NULL" );
+ free(str);
+ str = NULL;
+
+ PASSED();
+ return 0;
+
+error:
+ if (str != NULL) {
+ free(str);
+ }
+ return -1;
+
+} /* end test_trim() */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: test_uriencode()
+ *
+ * Purpose:
+ *
+ * Define and verify behavior of `H5FD_s3comms_uriencode()`.
+ *
+ * Programmer: Jacob Smith
+ * 2017-09-14
+ *
+ *----------------------------------------------------------------------------
+ */
+static herr_t
+test_uriencode(void)
+{
+ /*************************
+ * test-local structures *
+ *************************/
+
+ struct testcase {
+ const char *str;
+ size_t s_len;
+ hbool_t encode_slash;
+ const char *expected;
+ };
+
+ /************************
+ * test-local variables *
+ ************************/
+
+ struct testcase cases[] = {
+ { "/path/to/resource.jpg",
+ 21,
+ FALSE,
+ "/path/to/resource.jpg",
+ },
+ { "/path/to/resource.jpg",
+ 21,
+ TRUE,
+ "%2Fpath%2Fto%2Fresource.jpg",
+ },
+ { "string got_spaa ces",
+ 20,
+ TRUE,
+ "string%20got_spaa%20%20ces",
+ },
+ { "sp ac~es/and-sl ash.encoded",
+ 27,
+ TRUE,
+ "sp%20ac~es%2Fand-sl%20ash.encoded",
+ },
+ { "sp ac~es/and-sl ash.unencoded",
+ 29,
+ FALSE,
+ "sp%20ac~es/and-sl%20ash.unencoded",
+ },
+ { "/path/to/resource.txt",
+ 0,
+ FALSE,
+ "",
+
+ }
+ };
+ char *dest = NULL;
+ size_t dest_written = 0;
+ int i = 0;
+ int ncases = 6;
+ size_t str_len = 0;
+
+
+
+ TESTING("s3comms uriencode")
+
+ for (i = 0; i < ncases; i++) {
+ str_len = cases[i].s_len;
+ dest = (char *)HDmalloc(sizeof(char) * str_len * 3 + 1);
+ FAIL_IF( dest == NULL )
+
+ JSVERIFY( SUCCEED,
+ H5FD_s3comms_uriencode(
+ dest,
+ cases[i].str,
+ str_len,
+ cases[i].encode_slash,
+ &dest_written),
+ NULL );
+ JSVERIFY( HDstrlen(cases[i].expected),
+ dest_written,
+ NULL )
+ JSVERIFY( 0,
+ strncmp(dest, cases[i].expected, dest_written),
+ cases[i].expected );
+
+ free(dest);
+ dest = NULL;
+ } /* end for each testcase */
+
+ /***************
+ * ERROR CASES *
+ ***************/
+
+ dest = (char *)HDmalloc(sizeof(char) * 15);
+ HDassert(dest != NULL);
+
+ JSVERIFY( FAIL,
+ H5FD_s3comms_uriencode(NULL, "word$", 5, false, &dest_written),
+ "destination cannot be NULL" );
+ JSVERIFY( FAIL,
+ H5FD_s3comms_uriencode(dest, NULL, 5, false, &dest_written),
+ "source string cannot be NULL" );
+
+ free(dest);
+ dest = NULL;
+
+ PASSED();
+ return 0;
+
+error:
+ if (dest != NULL) {
+ free(dest);
+ }
+ return -1;
+
+} /* end test_uriencode() */
+
+#endif /* H5_HAVE_ROS3_VFD */
+
+
+
+/*-------------------------------------------------------------------------
+ * Function: main()
+ *
+ * Purpose:
+ *
+ * Run unit tests for S3 Communications (s3comms).
+ *
+ * Return:
+ *
+ * Success: 0
+ * Failure: 1
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-12
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+#ifdef H5_HAVE_ROS3_VFD
+ int nerrors = 0;
+ const char *bucket_url_env = NULL;
+
+ h5_reset();
+
+#endif /* H5_HAVE_ROS3_VFD */
+
+ HDprintf("Testing S3Communications functionality.\n");
+
+#ifdef H5_HAVE_ROS3_VFD
+
+ /* "clear" profile data strings */
+ s3_test_aws_access_key_id[0] = '\0';
+ s3_test_aws_secret_access_key[0] = '\0';
+ s3_test_aws_region[0] = '\0';
+ s3_test_bucket_url[0] = '\0';
+
+/* TODO: unit/regression test for H5FD_s3comms_load_aws_profile()
+ * requires a few test files and/or manipulation of default path
+ */
+ /* attempt to load test credentials
+ * if unable, certain tests will be skipped
+ */
+ if (SUCCEED == H5FD_s3comms_load_aws_profile(
+ S3_TEST_PROFILE_NAME,
+ s3_test_aws_access_key_id,
+ s3_test_aws_secret_access_key,
+ s3_test_aws_region))
+ {
+ s3_test_credentials_loaded = 1;
+ }
+
+ bucket_url_env = HDgetenv("HDF5_ROS3_TEST_BUCKET_URL");
+ if (bucket_url_env == NULL || bucket_url_env[0] == '\0') {
+ HDprintf("WARNING: S3 bucket url is not defined in enviornment " \
+ "variable 'HDF5_ROS3_TEST_BUCKET_URL'!\n");
+ }
+ else {
+ HDstrncpy(s3_test_bucket_url, bucket_url_env, S3_TEST_MAX_URL_SIZE);
+ s3_test_bucket_defined = TRUE;
+ }
+
+ /* tests ordered rougly by dependence */
+ nerrors += test_macro_format_credential() < 0 ? 1 : 0;
+ nerrors += test_trim() < 0 ? 1 : 0;
+ nerrors += test_nlowercase() < 0 ? 1 : 0;
+ nerrors += test_uriencode() < 0 ? 1 : 0;
+ nerrors += test_percent_encode_char() < 0 ? 1 : 0;
+ nerrors += test_bytes_to_hex() < 0 ? 1 : 0;
+ nerrors += test_HMAC_SHA256() < 0 ? 1 : 0;
+ nerrors += test_signing_key() < 0 ? 1 : 0;
+ nerrors += test_hrb_node_set() < 0 ? 1 : 0;
+ nerrors += test_hrb_init_request() < 0 ? 1 : 0;
+ nerrors += test_parse_url() < 0 ? 1 : 0;
+ nerrors += test_aws_canonical_request() < 0 ? 1 : 0;
+ nerrors += test_tostringtosign() < 0 ? 1 : 0;
+ nerrors += test_s3r_open() < 0 ? 1 : 0;
+ nerrors += test_s3r_get_filesize() < 0 ? 1 : 0;
+ nerrors += test_s3r_read() < 0 ? 1 : 0;
+
+ if (nerrors) {
+ HDprintf("***** %d S3comms TEST%s FAILED! *****\n",
+ nerrors,
+ nerrors > 1 ? "S" : "");
+ return 1;
+ }
+
+ HDprintf("All S3comms tests passed.\n");
+
+ return 0;
+
+#else
+
+ HDprintf("SKIPPED - read-only S3 VFD not built\n");
+ return EXIT_SUCCESS;
+
+#endif /* H5_HAVE_ROS3_VFD */
+
+} /* end main() */
+
diff --git a/test/set_extent.c b/test/set_extent.c
index 5d11819..b8ce3df 100644
--- a/test/set_extent.c
+++ b/test/set_extent.c
@@ -49,13 +49,13 @@ const char *FILENAME[] = {
+ CONFIG_EARLY_ALLOC + CONFIG_UNFILT_EDGE)
#define FILL_VALUE -1
#define DO_RANKS_PRINT_CONFIG(TEST) { \
- printf(" Config:\n"); \
- printf(" Test: %s\n", TEST); \
- printf(" Compression: %s\n", (config & CONFIG_COMPRESS ? "yes" : "no")); \
- printf(" Fill value: %s\n", (do_fillvalue ? "yes" : "no")); \
- printf(" Early allocation: %s\n", (config & CONFIG_EARLY_ALLOC ? "yes" \
+ HDprintf(" Config:\n"); \
+ HDprintf(" Test: %s\n", TEST); \
+ HDprintf(" Compression: %s\n", (config & CONFIG_COMPRESS ? "yes" : "no")); \
+ HDprintf(" Fill value: %s\n", (do_fillvalue ? "yes" : "no")); \
+ HDprintf(" Early allocation: %s\n", (config & CONFIG_EARLY_ALLOC ? "yes" \
: "no")); \
- printf(" Edge chunk filters: %s\n", (config & CONFIG_UNFILT_EDGE \
+ HDprintf(" Edge chunk filters: %s\n", (config & CONFIG_UNFILT_EDGE \
? "disabled" : "enabled")); \
} /* end DO_RANKS_PRINT_CONFIG */
@@ -136,8 +136,8 @@ int main( void )
hid_t fapl2; /* file access property list w/latest format set */
unsigned new_format; /* Whether to use the latest file format */
unsigned chunk_cache; /* Whether to enable chunk caching */
- int nerrors = 0;
- const char *env_h5_drvr; /* File Driver value from environment */
+ int nerrors = 0;
+ const char *env_h5_drvr; /* File Driver value from environment */
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
@@ -173,17 +173,17 @@ int main( void )
for(chunk_cache = FALSE; chunk_cache <= TRUE; chunk_cache++) {
/* Output message about the type of format */
if(new_format)
- printf("Testing with new file format");
+ HDprintf("Testing with new file format");
else
- printf("Testing with old file format");
+ HDprintf("Testing with old file format");
/* Set the FAPL for the chunk cache settings */
if(chunk_cache) {
- puts(" and chunk cache enabled:");
+ HDputs(" and chunk cache enabled:");
my_fapl = fapl;
} /* end if */
else {
- puts(" and chunk cache disabled:");
+ HDputs(" and chunk cache disabled:");
my_fapl = fapl2;
} /* end else */
@@ -201,15 +201,15 @@ int main( void )
H5F_LIBVER_LATEST) < 0) TEST_ERROR
/* Tests which use chunked datasets */
- if(!new_format || (new_format && contig_addr_vfd))
- nerrors += do_ranks( my_fapl, new_format ) < 0 ? 1 : 0;
+ if(!new_format || (new_format && contig_addr_vfd))
+ nerrors += do_ranks( my_fapl, new_format ) < 0 ? 1 : 0;
} /* end for */
/* Tests which do not use chunked datasets */
- if(!new_format || (new_format && contig_addr_vfd)) {
- nerrors += test_external( fapl ) < 0 ? 1 : 0;
- nerrors += do_layouts( fapl ) < 0 ? 1 : 0;
- }
+ if(!new_format || (new_format && contig_addr_vfd)) {
+ nerrors += test_external( fapl ) < 0 ? 1 : 0;
+ nerrors += do_layouts( fapl ) < 0 ? 1 : 0;
+ }
} /* end for */
/* Close 2nd FAPL */
@@ -225,13 +225,13 @@ int main( void )
if(nerrors)
goto error;
- puts("All H5Dset_extent tests passed.");
+ HDputs("All H5Dset_extent tests passed.");
return 0;
error:
nerrors = MAX(1, nerrors);
- printf("***** %d H5Dset_extent TEST%s FAILED! *****\n",
+ HDprintf("***** %d H5Dset_extent TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
return 1;
}
@@ -303,25 +303,25 @@ static int do_ranks( hid_t fapl, hbool_t new_format )
if(test_rank1(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) < 0) {
DO_RANKS_PRINT_CONFIG("Rank 1")
- printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET"
+ HDprintf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET"
: "H5D_FILL_TIME_ALLOC"));
goto error;
} /* end if */
if(test_rank2(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) < 0) {
DO_RANKS_PRINT_CONFIG("Rank 2")
- printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET"
+ HDprintf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET"
: "H5D_FILL_TIME_ALLOC"));
goto error;
} /* end if */
if(test_rank3(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) < 0) {
DO_RANKS_PRINT_CONFIG("Rank 3")
- printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET"
+ HDprintf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET"
: "H5D_FILL_TIME_ALLOC"));
goto error;
} /* end if */
if(test_rank2(fapl, dcpl, do_fillvalue, disable_edge_filters, TRUE) < 0) {
DO_RANKS_PRINT_CONFIG("Rank 2 with non-default indexed storage B-tree")
- printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET"
+ HDprintf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET"
: "H5D_FILL_TIME_ALLOC"));
goto error;
} /* end if */
@@ -362,7 +362,7 @@ static int do_ranks( hid_t fapl, hbool_t new_format )
/* Standard test */
if(test_random_rank4(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE, index_type) < 0) {
DO_RANKS_PRINT_CONFIG("Randomized rank 4")
- printf(" Index: %s\n", index_type == RANK4_INDEX_BTREE
+ HDprintf(" Index: %s\n", index_type == RANK4_INDEX_BTREE
? "btree" : (index_type == RANK4_INDEX_FARRAY ? "farray"
: "earray"));
goto error;
@@ -372,7 +372,7 @@ static int do_ranks( hid_t fapl, hbool_t new_format )
if(test_random_rank4_vl(fapl, dcpl, do_fillvalue,
disable_edge_filters, FALSE, index_type) < 0) {
DO_RANKS_PRINT_CONFIG("Randomized rank 4 variable length")
- printf(" Index: %s\n", index_type == RANK4_INDEX_BTREE
+ HDprintf(" Index: %s\n", index_type == RANK4_INDEX_BTREE
? "btree" : (index_type == RANK4_INDEX_FARRAY ? "farray"
: "earray"));
goto error;
@@ -383,7 +383,7 @@ static int do_ranks( hid_t fapl, hbool_t new_format )
if(test_random_rank4(fapl, dcpl, do_fillvalue,
disable_edge_filters, TRUE, index_type) < 0) {
DO_RANKS_PRINT_CONFIG("Randomized rank 4 with sparse allocation")
- printf(" Index: %s\n", index_type == RANK4_INDEX_BTREE
+ HDprintf(" Index: %s\n", index_type == RANK4_INDEX_BTREE
? "btree" : (index_type == RANK4_INDEX_FARRAY
? "farray" : "earray"));
goto error;
@@ -391,7 +391,7 @@ static int do_ranks( hid_t fapl, hbool_t new_format )
if(test_random_rank4_vl(fapl, dcpl, do_fillvalue,
disable_edge_filters, TRUE, index_type) < 0) {
DO_RANKS_PRINT_CONFIG("Randomized rank 4 variable length with sparse allocation")
- printf(" Index: %s\n", index_type == RANK4_INDEX_BTREE
+ HDprintf(" Index: %s\n", index_type == RANK4_INDEX_BTREE
? "btree" : (index_type == RANK4_INDEX_FARRAY
? "farray" : "earray"));
goto error;
@@ -558,10 +558,10 @@ static int test_rank1( hid_t fapl,
TEST_ERROR
#if defined (H5_SET_EXTENT_DEBUG)
- printf("\n buf_o: ");
+ HDprintf("\n buf_o: ");
for (i = 0; i < (int)dims_o[0]; i++ )
- printf("%d ", buf_o[i]);
- printf("\n");
+ HDprintf("%d ", buf_o[i]);
+ HDprintf("\n");
#endif
if(H5Sclose(sid) < 0)
@@ -598,18 +598,18 @@ static int test_rank1( hid_t fapl,
#if defined (H5_SET_EXTENT_DEBUG)
- printf("\n buf_e: ");
+ HDprintf("\n buf_e: ");
for (i = 0; i < (int)dims_r[0]; i++ )
- printf("%d ", buf_e[i]);
- printf("\n");
+ HDprintf("%d ", buf_e[i]);
+ HDprintf("\n");
#endif
/* compare the read array with the expanded array */
for (i = 0; i < (int)dims_r[0]; i++ )
if(i >= DIM0) {
if(buf_e[i] != comp_value) {
- printf("buf_e[%d] = %d\n", i, buf_e[i]);
- printf("expected = %d\n", comp_value);
+ HDprintf("buf_e[%d] = %d\n", i, buf_e[i]);
+ HDprintf("expected = %d\n", comp_value);
TEST_ERROR
} /* end if */
} /* end if */
@@ -670,17 +670,17 @@ static int test_rank1( hid_t fapl,
TEST_ERROR
#if defined (H5_SET_EXTENT_DEBUG)
- printf("\n dims_r: ");
+ HDprintf("\n dims_r: ");
for (i = 0; i < (int)dims_r[0]; i++ )
- printf("%d ", buf_s[i]);
- printf("\n");
+ HDprintf("%d ", buf_s[i]);
+ HDprintf("\n");
#endif
/* compare the read array with the shrinked array */
for( i = 0; i < (int)dims_r[0]; i++ )
if(buf_s[i] != buf_o[i]) {
- printf("buf_s[%d] = %d\n", i, buf_s[i]);
- printf("buf_o[%d] = %d\n", i, buf_o[i]);
+ HDprintf("buf_s[%d] = %d\n", i, buf_s[i]);
+ HDprintf("buf_o[%d] = %d\n", i, buf_o[i]);
TEST_ERROR
} /* end if */
@@ -714,18 +714,18 @@ static int test_rank1( hid_t fapl,
TEST_ERROR
#if defined (H5_SET_EXTENT_DEBUG)
- printf("\n dims_r: ");
+ HDprintf("\n dims_r: ");
for (i = 0; i < (int)dims_r[0]; i++ )
- printf("%d ", buf_r[i]);
- printf("\n");
+ HDprintf("%d ", buf_r[i]);
+ HDprintf("\n");
#endif
/* compare the read array with the original array */
for(i = 0; i < (int)dims_r[0]; i++ )
if(i >= DIMS0 ) {
if(buf_r[i] != comp_value) {
- printf("buf_r[%d] = %d\n", i, buf_r[i] );
- printf("expected = %d\n", comp_value);
+ HDprintf("buf_r[%d] = %d\n", i, buf_r[i] );
+ HDprintf("expected = %d\n", comp_value);
TEST_ERROR
} /* end if */
} /* end if */
@@ -820,61 +820,47 @@ error:
*-------------------------------------------------------------------------
*/
-static int test_rank2( hid_t fapl,
- hid_t dcpl,
- hbool_t do_fill_value,
- hbool_t disable_edge_filters,
- hbool_t set_istore_k)
-{
-
- hid_t fid=-1;
- hid_t did=-1;
- hid_t sid=-1;
- hid_t my_dcpl=-1;
- hid_t fcpl;
- hsize_t dims_o[RANK2] = {DIM0,DIM1}; /* original dimensions */
- hsize_t dims_s[RANK2] = {DIMS0,DIMS1}; /* shrinking dimensions */
- hsize_t dims_e[RANK2] = {DIME0,DIME1}; /* extended dimensions */
- hsize_t dims_c[RANK2] = {2,2}; /* chunk dimensions */
- hsize_t dims_r[RANK2]; /* read dimensions */
- hsize_t maxdims[RANK2] = {H5S_UNLIMITED,H5S_UNLIMITED};
- int buf_o[DIM0][DIM1];
- int buf_s[DIMS0][DIMS1];
- int buf_e[DIME0][DIME1];
- int buf_r[DIM0][DIM1];
- int i, j;
- int comp_value;
- char filename[NAME_BUF_SIZE];
-
- if ( do_fill_value )
- {
+static int test_rank2(hid_t fapl, hid_t dcpl, hbool_t do_fill_value, hbool_t disable_edge_filters, hbool_t set_istore_k) {
+
+ hid_t fid = -1;
+ hid_t did = -1;
+ hid_t sid = -1;
+ hid_t my_dcpl = -1;
+ hid_t fcpl;
+ hsize_t dims_o[RANK2] = { DIM0, DIM1 }; /* original dimensions */
+ hsize_t dims_s[RANK2] = { DIMS0, DIMS1 }; /* shrinking dimensions */
+ hsize_t dims_e[RANK2] = { DIME0, DIME1 }; /* extended dimensions */
+ hsize_t dims_c[RANK2] = { 2, 2 }; /* chunk dimensions */
+ hsize_t dims_r[RANK2]; /* read dimensions */
+ hsize_t maxdims[RANK2] = { H5S_UNLIMITED, H5S_UNLIMITED };
+ int buf_o[DIM0][DIM1];
+ int buf_s[DIMS0][DIMS1];
+ int buf_e[DIME0][DIME1];
+ int buf_r[DIM0][DIM1];
+ int i, j;
+ int comp_value;
+ char filename[NAME_BUF_SIZE];
+
+ if (do_fill_value) {
comp_value = FILL_VALUE;
- }
- else
- {
+ } else {
comp_value = 0;
}
-
- for( i = 0; i < DIM0; i++ )
- {
- for( j = 0; j < DIM1; j++ )
- {
+ for (i = 0; i < DIM0; i++) {
+ for (j = 0; j < DIM1; j++) {
buf_o[i][j] = 2;
}
}
/* create a file creation property list */
- if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- {
+ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) {
TEST_ERROR
}
- if ( set_istore_k )
- {
+ if (set_istore_k) {
/* set non-default indexed storage B-tree internal 'K' value */
- if (H5Pset_istore_k(fcpl,ISTORE_IK) < 0)
- {
+ if (H5Pset_istore_k(fcpl, ISTORE_IK) < 0) {
TEST_ERROR
}
@@ -882,79 +868,65 @@ static int test_rank2( hid_t fapl,
/* create a new file */
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
- if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
- {
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) {
TEST_ERROR
}
-
-
/* create the data space with unlimited dimensions. */
- if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0)
- {
+ if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0) {
TEST_ERROR
}
/* modify dataset creation properties, i.e. enable chunking. */
- if ((my_dcpl = H5Pcopy (dcpl)) < 0)
- {
+ if ((my_dcpl = H5Pcopy(dcpl)) < 0) {
TEST_ERROR
}
- if (H5Pset_chunk(my_dcpl, RANK2, dims_c) < 0)
- {
+ if (H5Pset_chunk(my_dcpl, RANK2, dims_c) < 0) {
TEST_ERROR
}
- if(disable_edge_filters)
- if(H5Pset_chunk_opts(my_dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0)
+ if (disable_edge_filters)
+ if (H5Pset_chunk_opts(my_dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0)
TEST_ERROR
- /*-------------------------------------------------------------------------
- * Procedure 1
- * a. Write an array AxB. These are the dimensions for creating the dataset
- * b. Define a greater array CxD where C > A and D > B
- * c. Read data back
- * d. Verify if new dimensions are C and D
- * e. Verify if data from A to C and B to D is what it is to be expected
- *
- * original data is
- *
- * 2 2 2 2
- * 2 2 2 2
- * 2 2 2 2
- * 2 2 2 2
- *
- *-------------------------------------------------------------------------
- */
-
- /* create a dataset */
- if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0)
- {
+ /*-------------------------------------------------------------------------
+ * Procedure 1
+ * a. Write an array AxB. These are the dimensions for creating the dataset
+ * b. Define a greater array CxD where C > A and D > B
+ * c. Read data back
+ * d. Verify if new dimensions are C and D
+ * e. Verify if data from A to C and B to D is what it is to be expected
+ *
+ * original data is
+ *
+ * 2 2 2 2
+ * 2 2 2 2
+ * 2 2 2 2
+ * 2 2 2 2
+ *
+ *-------------------------------------------------------------------------
+ */
+
+ /* create a dataset */
+ if ((did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) {
TEST_ERROR
}
/* write */
- if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0)
- {
+ if (H5Dwrite(did, H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) {
TEST_ERROR
}
-
#if defined (H5_SET_EXTENT_DEBUG2)
- printf("\n");
- for (i = 0; i < (int)dims_o[0]; i++ )
- {
- for (j = 0; j < (int)dims_o[1]; j++ )
- {
- printf("%d ", buf_o[i][j]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_o[0]; i++ ) {
+ for (j = 0; j < (int)dims_o[1]; j++ ) {
+ HDprintf("%d ", buf_o[i][j]);
}
- printf("\n");
+ HDprintf("\n");
}
#endif
-
-
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
@@ -974,32 +946,26 @@ static int test_rank2( hid_t fapl,
*/
/* set new dimensions for the array. */
- if (H5Dset_extent(did , dims_e) < 0)
- {
+ if (H5Dset_extent(did, dims_e) < 0) {
TEST_ERROR
}
/* get the space */
- if ((sid = H5Dget_space(did)) < 0)
- {
+ if ((sid = H5Dget_space(did)) < 0) {
TEST_ERROR
}
/* get dimensions */
- if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
- {
+ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
-
/* check dimensions */
- for( i = 0; i < RANK2; i++ )
- {
+ for (i = 0; i < RANK2; i++) {
if (dims_r[i] != dims_e[i])
TEST_ERROR
}
@@ -1008,55 +974,39 @@ static int test_rank2( hid_t fapl,
if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_e) < 0)
TEST_ERROR
-
-
#if defined (H5_SET_EXTENT_DEBUG2)
- printf("\n");
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- printf("%d ", buf_e[i][j]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_r[0]; i++ ) {
+ for (j = 0; j < (int)dims_r[1]; j++ ) {
+ HDprintf("%d ", buf_e[i][j]);
}
- printf("\n");
+ HDprintf("\n");
}
#endif
-
-
-
- /* compare the read array with the expanded array */
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- if ( i >= DIM0 || j >= DIM1 )
- {
- if(buf_e[i][j] != comp_value)
- {
- printf("buf_e[%d][%d] = %d\n", i, j, buf_e[i][j]);
- printf("value = %d\n", comp_value);
+ /* compare the read array with the expanded array */
+ for (i = 0; i < (int) dims_r[0]; i++) {
+ for (j = 0; j < (int) dims_r[1]; j++) {
+ if (i >= DIM0 || j >= DIM1) {
+ if (buf_e[i][j] != comp_value) {
+ HDprintf("buf_e[%d][%d] = %d\n", i, j, buf_e[i][j]);
+ HDprintf("value = %d\n", comp_value);
TEST_ERROR
}
- }
- else
- {
- if(buf_e[i][j] != buf_o[i][j])
+ } else {
+ if (buf_e[i][j] != buf_o[i][j])
TEST_ERROR
}
}
}
-
-
-
/*-------------------------------------------------------------------------
*
* Procedure 2
- * a. Define a smaller array ExF where E < A and F < B
- * b. Read data back
- * c. Verify if new dimensions are E and F
- * d. Verify if data up until E and F is what to be expected
+ * a. Define a smaller array ExF where E < A and F < B
+ * b. Read data back
+ * c. Verify if new dimensions are E and F
+ * d. Verify if data up until E and F is what to be expected
*
* data is now
*
@@ -1067,106 +1017,81 @@ static int test_rank2( hid_t fapl,
*/
/* set new dimensions for the array. */
- if (H5Dset_extent(did , dims_s) < 0)
- {
+ if (H5Dset_extent(did, dims_s) < 0) {
TEST_ERROR
}
/* get the space */
- if ((sid = H5Dget_space(did)) < 0)
- {
+ if ((sid = H5Dget_space(did)) < 0) {
TEST_ERROR
}
/* get dimensions */
- if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
- {
+ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
/* check dimensions */
- for( i = 0; i < RANK2; i++ )
- {
+ for (i = 0; i < RANK2; i++) {
if (dims_r[i] != dims_s[i])
TEST_ERROR
}
-
-
/* for this case we close and reopen file */
- if ( set_istore_k )
- {
+ if (set_istore_k) {
- if (H5Dclose(did) < 0)
- {
+ if (H5Dclose(did) < 0) {
TEST_ERROR
}
- if (H5Fclose(fid) < 0)
- {
+ if (H5Fclose(fid) < 0) {
TEST_ERROR
}
- if ((fid = H5Fopen( filename, H5F_ACC_RDWR, fapl ))<0)
- {
+ if ((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) {
TEST_ERROR
}
- if ((did = H5Dopen2( fid , "dset1", H5P_DEFAULT ))<0)
- {
+ if ((did = H5Dopen2(fid, "dset1", H5P_DEFAULT)) < 0) {
TEST_ERROR
}
-
-
}
-
/*-------------------------------------------------------------------------
* read
*-------------------------------------------------------------------------
*/
/* read */
- if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s ) < 0)
- {
+ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s) < 0) {
TEST_ERROR
}
#if defined (H5_SET_EXTENT_DEBUG2)
- printf("\n");
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- printf("%d ", buf_s[i][j]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_r[0]; i++ ) {
+ for (j = 0; j < (int)dims_r[1]; j++ ) {
+ HDprintf("%d ", buf_s[i][j]);
}
- printf("\n");
+ HDprintf("\n");
}
#endif
-
-
-
/* compare the read array with the shrinked array */
- for( i = 0; i < (int)dims_r[0]; i++ )
- {
- for( j = 0; j < (int)dims_r[1]; j++ )
- {
- if ( buf_s[i][j] != buf_o[i][j] )
- {
- printf("buf_s[%d][%d] = %d\n", i, j, buf_s[i][j]);
- printf("buf_o[%d][%d] = %d\n", i, j, buf_o[i][j]);
+ for (i = 0; i < (int) dims_r[0]; i++) {
+ for (j = 0; j < (int) dims_r[1]; j++) {
+ if (buf_s[i][j] != buf_o[i][j]) {
+ HDprintf("buf_s[%d][%d] = %d\n", i, j, buf_s[i][j]);
+ HDprintf("buf_o[%d][%d] = %d\n", i, j, buf_o[i][j]);
TEST_ERROR
}
}
}
-
/*-------------------------------------------------------------------------
* set new dimensions for the array; expand it back to original size
* data is now, extended space was initialized with fill value or default value
@@ -1180,36 +1105,30 @@ static int test_rank2( hid_t fapl,
*/
/* set new dimensions for the array */
- if (H5Dset_extent(did, dims_o) < 0)
- {
+ if (H5Dset_extent(did, dims_o) < 0) {
TEST_ERROR
}
/* get the space */
- if ((sid = H5Dget_space(did)) < 0)
- {
+ if ((sid = H5Dget_space(did)) < 0) {
TEST_ERROR
}
/* get dimensions. */
- if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
- {
+ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
/* check dimensions */
- for( i = 0; i < RANK2; i++ )
- {
+ for (i = 0; i < RANK2; i++) {
if (dims_r[i] != dims_o[i])
TEST_ERROR
}
-
/*-------------------------------------------------------------------------
* read
*-------------------------------------------------------------------------
@@ -1220,36 +1139,26 @@ static int test_rank2( hid_t fapl,
TEST_ERROR
#if defined (H5_SET_EXTENT_DEBUG2)
- printf("\n");
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- printf("%d ", buf_r[i][j]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_r[0]; i++ ) {
+ for (j = 0; j < (int)dims_r[1]; j++ ) {
+ HDprintf("%d ", buf_r[i][j]);
}
- printf("\n");
+ HDprintf("\n");
}
#endif
-
-
- /* compare the read array with the original array */
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- if (i >= DIMS0 || j >= DIMS1)
- {
- if(buf_r[i][j] != comp_value)
- {
- printf("buf_r[%d][%d] = %d\n", i, j, buf_r[i][j]);
- printf("value = %d\n", comp_value);
+ /* compare the read array with the original array */
+ for (i = 0; i < (int) dims_r[0]; i++) {
+ for (j = 0; j < (int) dims_r[1]; j++) {
+ if (i >= DIMS0 || j >= DIMS1) {
+ if (buf_r[i][j] != comp_value) {
+ HDprintf("buf_r[%d][%d] = %d\n", i, j, buf_r[i][j]);
+ HDprintf("value = %d\n", comp_value);
TEST_ERROR
}
- }
- else
- {
- if(buf_r[i][j] != buf_o[i][j])
+ } else {
+ if (buf_r[i][j] != buf_o[i][j])
TEST_ERROR
}
}
@@ -1265,36 +1174,30 @@ static int test_rank2( hid_t fapl,
dims_s[1] = 0;
/* set new dimensions for the array. */
- if (H5Dset_extent(did , dims_s) < 0)
- {
+ if (H5Dset_extent(did, dims_s) < 0) {
TEST_ERROR
}
/* get the space */
- if ((sid = H5Dget_space(did)) < 0)
- {
+ if ((sid = H5Dget_space(did)) < 0) {
TEST_ERROR
}
/* get dimensions */
- if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
- {
+ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
/* check dimensions */
- for( i = 0; i < RANK2; i++ )
- {
+ for (i = 0; i < RANK2; i++) {
if (dims_r[i] != dims_s[i])
TEST_ERROR
}
-
/*-------------------------------------------------------------------------
* expand then shrink to 0 in dimension 1 while expanding again in
* dimension 0
@@ -1302,10 +1205,8 @@ static int test_rank2( hid_t fapl,
*-------------------------------------------------------------------------
*/
-
/* expand to original dimensions for the array. */
- if (H5Dset_extent(did , dims_o) < 0)
- {
+ if (H5Dset_extent(did, dims_o) < 0) {
TEST_ERROR
}
@@ -1313,266 +1214,208 @@ static int test_rank2( hid_t fapl,
dims_s[1] = 0;
/* set new dimensions for the array. */
- if (H5Dset_extent(did , dims_s) < 0)
- {
+ if (H5Dset_extent(did, dims_s) < 0) {
TEST_ERROR
}
/* get the space */
- if ((sid = H5Dget_space(did)) < 0)
- {
+ if ((sid = H5Dget_space(did)) < 0) {
TEST_ERROR
}
/* get dimensions */
- if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
- {
+ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
/* check dimensions */
- for( i = 0; i < RANK2; i++ )
- {
+ for (i = 0; i < RANK2; i++) {
if (dims_r[i] != dims_s[i])
TEST_ERROR
}
-
/*-------------------------------------------------------------------------
* close dataset
*-------------------------------------------------------------------------
*/
- if (H5Dclose(did) < 0)
- {
+ if (H5Dclose(did) < 0) {
TEST_ERROR
}
-
- /*-------------------------------------------------------------------------
+ /*-------------------------------------------------------------------------
* test a dataset with non initialized chunks
*-------------------------------------------------------------------------
*/
-
- if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0)
- {
+ if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0) {
TEST_ERROR
}
- if ((did = H5Dcreate2(fid , "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0)
- {
+ if ((did = H5Dcreate2(fid, "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) {
TEST_ERROR
}
/* set new dimensions for the array */
- dims_o[ 0 ] = 0;
- dims_o[ 1 ] = 0;
- if (H5Dset_extent( did , dims_o ) < 0)
- {
+ dims_o[0] = 0;
+ dims_o[1] = 0;
+ if (H5Dset_extent(did, dims_o) < 0) {
TEST_ERROR
}
-
-
- if (H5Dclose(did) < 0)
- {
+ if (H5Dclose(did) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
-
-
-
/*-------------------------------------------------------------------------
* close property list
*-------------------------------------------------------------------------
*/
-
- if (H5Pclose(my_dcpl) < 0)
- {
+ if (H5Pclose(my_dcpl) < 0) {
TEST_ERROR
}
/* close file creation property list */
- if(H5Pclose(fcpl) < 0)
- {
+ if (H5Pclose(fcpl) < 0) {
TEST_ERROR
}
- if (H5Fclose( fid ) < 0)
- {
+ if (H5Fclose(fid) < 0) {
TEST_ERROR
}
-
return 0;
-
-
-error:
+ error:
H5E_BEGIN_TRY
- {
- H5Dclose( did );
- H5Sclose( sid );
- H5Pclose( my_dcpl );
- H5Pclose( fcpl );
- H5Fclose( fid );
- } H5E_END_TRY;
+ {
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Pclose(my_dcpl);
+ H5Pclose(fcpl);
+ H5Fclose(fid);
+ }H5E_END_TRY;
return -1;
}
-
-
-
/*-------------------------------------------------------------------------
* test usage with a 3D rank
*-------------------------------------------------------------------------
*/
-static int test_rank3( hid_t fapl,
- hid_t dcpl,
- hbool_t do_fill_value,
- hbool_t disable_edge_filters,
- hbool_t set_istore_k)
-{
-
- hid_t fid=-1;
- hid_t did=-1;
- hid_t sid=-1;
- hid_t my_dcpl=-1;
- hid_t fcpl;
- hsize_t dims_o[RANK3] = {DIM0,DIM1,DIM2}; /* original dimensions */
- hsize_t dims_s[RANK3] = {DIMS0,DIMS1,DIMS2}; /* shrinking dimensions */
- hsize_t dims_e[RANK3] = {DIME0,DIME1,DIME2}; /* extended dimensions */
- hsize_t dims_c[RANK3] = {2,2,2}; /* chunk dimensions */
- hsize_t dims_r[RANK3]; /* read dimensions */
- hsize_t maxdims[RANK3] = {H5S_UNLIMITED,H5S_UNLIMITED,H5S_UNLIMITED};
- int buf_o[DIM0][DIM1][DIM2];
- int buf_s[DIMS0][DIMS1][DIMS2];
- int buf_e[DIME0][DIME1][DIME2];
- int buf_r[DIM0][DIM1][DIM2];
- int i, j, k;
- int comp_value;
- char filename[NAME_BUF_SIZE];
-
- if ( do_fill_value )
- {
+static int test_rank3(hid_t fapl, hid_t dcpl, hbool_t do_fill_value, hbool_t disable_edge_filters, hbool_t set_istore_k) {
+
+ hid_t fid = -1;
+ hid_t did = -1;
+ hid_t sid = -1;
+ hid_t my_dcpl = -1;
+ hid_t fcpl;
+ hsize_t dims_o[RANK3] = { DIM0, DIM1, DIM2 }; /* original dimensions */
+ hsize_t dims_s[RANK3] = { DIMS0, DIMS1, DIMS2 }; /* shrinking dimensions */
+ hsize_t dims_e[RANK3] = { DIME0, DIME1, DIME2 }; /* extended dimensions */
+ hsize_t dims_c[RANK3] = { 2, 2, 2 }; /* chunk dimensions */
+ hsize_t dims_r[RANK3]; /* read dimensions */
+ hsize_t maxdims[RANK3] = { H5S_UNLIMITED, H5S_UNLIMITED, H5S_UNLIMITED };
+ int buf_o[DIM0][DIM1][DIM2];
+ int buf_s[DIMS0][DIMS1][DIMS2];
+ int buf_e[DIME0][DIME1][DIME2];
+ int buf_r[DIM0][DIM1][DIM2];
+ int i, j, k;
+ int comp_value;
+ char filename[NAME_BUF_SIZE];
+
+ if (do_fill_value) {
comp_value = FILL_VALUE;
- }
- else
- {
+ } else {
comp_value = 0;
}
-
- for( i = 0; i < DIM0; i++ )
- {
- for( j = 0; j < DIM1; j++ )
- {
- for( k = 0; k < DIM2; k++ )
- {
+ for (i = 0; i < DIM0; i++) {
+ for (j = 0; j < DIM1; j++) {
+ for (k = 0; k < DIM2; k++) {
buf_o[i][j][k] = 2;
}
}
}
/* create a file creation property list */
- if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- {
+ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) {
TEST_ERROR
}
- if ( set_istore_k )
- {
+ if (set_istore_k) {
/* set non-default indexed storage B-tree internal 'K' value */
- if (H5Pset_istore_k(fcpl,ISTORE_IK) < 0)
- {
+ if (H5Pset_istore_k(fcpl, ISTORE_IK) < 0) {
TEST_ERROR
}
}
/* create a new file */
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
- if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
- {
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) {
TEST_ERROR
}
/* close property list */
- if(H5Pclose(fcpl) < 0)
- {
+ if (H5Pclose(fcpl) < 0) {
TEST_ERROR
}
/* create the data space with unlimited dimensions. */
- if ((sid = H5Screate_simple(RANK3, dims_o, maxdims)) < 0)
- {
+ if ((sid = H5Screate_simple(RANK3, dims_o, maxdims)) < 0) {
TEST_ERROR
}
/* modify dataset creation properties, i.e. enable chunking. */
- if ((my_dcpl = H5Pcopy (dcpl)) < 0)
- {
+ if ((my_dcpl = H5Pcopy(dcpl)) < 0) {
TEST_ERROR
}
- if (H5Pset_chunk(my_dcpl, RANK3, dims_c) < 0)
- {
+ if (H5Pset_chunk(my_dcpl, RANK3, dims_c) < 0) {
TEST_ERROR
}
- if(disable_edge_filters)
- if(H5Pset_chunk_opts(my_dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0)
+ if (disable_edge_filters)
+ if (H5Pset_chunk_opts(my_dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0)
TEST_ERROR
- /*-------------------------------------------------------------------------
- * create, write array
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * create, write array
+ *-------------------------------------------------------------------------
+ */
- /* create a dataset */
- if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0)
- {
+ /* create a dataset */
+ if ((did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) {
TEST_ERROR
}
/* write */
- if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0)
- {
+ if (H5Dwrite(did, H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) {
TEST_ERROR
}
-
#if defined (H5_SET_EXTENT_DEBUG3)
- printf("\n");
- for (i = 0; i < (int)dims_o[0]; i++ )
- {
- for (j = 0; j < (int)dims_o[1]; j++ )
- {
- for( k = 0; k < (int)dims_o[2]; k++ )
- {
- printf("%d ", buf_o[i][j][k]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_o[0]; i++ ) {
+ for (j = 0; j < (int)dims_o[1]; j++ ) {
+ for( k = 0; k < (int)dims_o[2]; k++ ) {
+ HDprintf("%d ", buf_o[i][j][k]);
}
- printf("[%d] ", j);
+ HDprintf("[%d] ", j);
}
- printf("\n");
+ HDprintf("\n");
}
- printf("\n");
+ HDprintf("\n");
#endif
-
-
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
@@ -1583,32 +1426,26 @@ static int test_rank3( hid_t fapl,
*/
/* set new dimensions for the array. */
- if (H5Dset_extent(did , dims_e) < 0)
- {
+ if (H5Dset_extent(did, dims_e) < 0) {
TEST_ERROR
}
/* get the space */
- if ((sid = H5Dget_space(did)) < 0)
- {
+ if ((sid = H5Dget_space(did)) < 0) {
TEST_ERROR
}
/* get dimensions */
- if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
- {
+ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
-
/* check dimensions */
- for( i = 0; i < RANK3; i++ )
- {
+ for (i = 0; i < RANK3; i++) {
if (dims_r[i] != dims_e[i])
TEST_ERROR
}
@@ -1617,203 +1454,153 @@ static int test_rank3( hid_t fapl,
if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_e) < 0)
TEST_ERROR
-
-
#if defined (H5_SET_EXTENT_DEBUG3)
- printf("\n");
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- for( k = 0; k < (int)dims_r[2]; k++ )
- {
- printf("%d ", buf_e[i][j][k]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_r[0]; i++ ) {
+ for (j = 0; j < (int)dims_r[1]; j++ ) {
+ for( k = 0; k < (int)dims_r[2]; k++ ) {
+ HDprintf("%d ", buf_e[i][j][k]);
}
- printf("[%d] ", j);
+ HDprintf("[%d] ", j);
}
- printf("\n");
+ HDprintf("\n");
}
- printf("\n");
+ HDprintf("\n");
#endif
-
-
-
- /* compare the read array with the expanded array */
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- for( k = 0; k < (int)dims_r[2]; k++ )
- {
- if ( i >= DIM0 || j >= DIM1 || k >= DIM2 )
- {
- if(buf_e[i][j][k] != comp_value)
- {
- printf("buf_e[%d][%d][%d] = %d\n", i, j, k, buf_e[i][j][k] );
- printf("value = %d\n", comp_value);
+ /* compare the read array with the expanded array */
+ for (i = 0; i < (int) dims_r[0]; i++) {
+ for (j = 0; j < (int) dims_r[1]; j++) {
+ for (k = 0; k < (int) dims_r[2]; k++) {
+ if (i >= DIM0 || j >= DIM1 || k >= DIM2) {
+ if (buf_e[i][j][k] != comp_value) {
+ HDprintf("buf_e[%d][%d][%d] = %d\n", i, j, k, buf_e[i][j][k]);
+ HDprintf("value = %d\n", comp_value);
TEST_ERROR
}
- }
- else
- {
- if(buf_e[i][j][k] != buf_o[i][j][k] )
+ } else {
+ if (buf_e[i][j][k] != buf_o[i][j][k])
TEST_ERROR
}
}
}
}
-
-
-
/*-------------------------------------------------------------------------
* shrink
*-------------------------------------------------------------------------
*/
/* set new dimensions for the array. */
- if (H5Dset_extent(did , dims_s) < 0)
- {
+ if (H5Dset_extent(did, dims_s) < 0) {
TEST_ERROR
}
/* get the space */
- if ((sid = H5Dget_space(did)) < 0)
- {
+ if ((sid = H5Dget_space(did)) < 0) {
TEST_ERROR
}
/* get dimensions */
- if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
- {
+ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
/* check dimensions */
- for( i = 0; i < RANK3; i++ )
- {
+ for (i = 0; i < RANK3; i++) {
if (dims_r[i] != dims_s[i])
TEST_ERROR
}
-
-
/* for this case we close and reopen file */
- if ( set_istore_k )
- {
+ if (set_istore_k) {
- if (H5Dclose(did) < 0)
- {
+ if (H5Dclose(did) < 0) {
TEST_ERROR
}
- if (H5Fclose(fid) < 0)
- {
+ if (H5Fclose(fid) < 0) {
TEST_ERROR
}
- if ((fid = H5Fopen( filename, H5F_ACC_RDWR, fapl ))<0)
- {
+ if ((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) {
TEST_ERROR
}
- if ((did = H5Dopen2( fid , "dset1", H5P_DEFAULT ))<0)
- {
+ if ((did = H5Dopen2(fid, "dset1", H5P_DEFAULT)) < 0) {
TEST_ERROR
}
-
-
}
-
/*-------------------------------------------------------------------------
* read
*-------------------------------------------------------------------------
*/
/* read */
- if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s ) < 0)
- {
+ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s) < 0) {
TEST_ERROR
}
#if defined (H5_SET_EXTENT_DEBUG3)
- printf("\n");
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- for( k = 0; k < (int)dims_r[2]; k++ )
- {
- printf("%d ", buf_s[i][j][k]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_r[0]; i++ ) {
+ for (j = 0; j < (int)dims_r[1]; j++ ) {
+ for( k = 0; k < (int)dims_r[2]; k++ ) {
+ HDprintf("%d ", buf_s[i][j][k]);
}
- printf("[%d] ", j);
+ HDprintf("[%d] ", j);
}
- printf("\n");
+ HDprintf("\n");
}
- printf("\n");
+ HDprintf("\n");
#endif
-
-
-
/* compare the read array with the shrinked array */
- for( i = 0; i < (int)dims_r[0]; i++ )
- {
- for( j = 0; j < (int)dims_r[1]; j++ )
- {
- for( k = 0; k < (int)dims_r[2]; k++ )
- {
- if ( buf_s[i][j][k] != buf_o[i][j][k] )
- {
- printf("buf_s[%d][%d][%d] = %d\n", i, j, k, buf_s[i][j][k] );
- printf("buf_o[%d][%d][%d] = %d\n", i, j, k, buf_o[i][j][k] );
+ for (i = 0; i < (int) dims_r[0]; i++) {
+ for (j = 0; j < (int) dims_r[1]; j++) {
+ for (k = 0; k < (int) dims_r[2]; k++) {
+ if (buf_s[i][j][k] != buf_o[i][j][k]) {
+ HDprintf("buf_s[%d][%d][%d] = %d\n", i, j, k, buf_s[i][j][k]);
+ HDprintf("buf_o[%d][%d][%d] = %d\n", i, j, k, buf_o[i][j][k]);
TEST_ERROR
}
}
}
}
-
/*-------------------------------------------------------------------------
* set new dimensions for the array; expand it back to original size
*-------------------------------------------------------------------------
*/
/* set new dimensions for the array */
- if (H5Dset_extent(did, dims_o) < 0)
- {
+ if (H5Dset_extent(did, dims_o) < 0) {
TEST_ERROR
}
/* get the space */
- if ((sid = H5Dget_space(did)) < 0)
- {
+ if ((sid = H5Dget_space(did)) < 0) {
TEST_ERROR
}
/* get dimensions. */
- if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
- {
+ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
/* check dimensions */
- for( i = 0; i < RANK3; i++ )
- {
+ for (i = 0; i < RANK3; i++) {
if (dims_r[i] != dims_o[i])
TEST_ERROR
}
@@ -1823,52 +1610,39 @@ static int test_rank3( hid_t fapl,
TEST_ERROR
#if defined (H5_SET_EXTENT_DEBUG3)
- printf("\n");
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- for( k = 0; k < (int)dims_r[2]; k++ )
- {
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_r[0]; i++ ) {
+ for (j = 0; j < (int)dims_r[1]; j++ ) {
+ for( k = 0; k < (int)dims_r[2]; k++ ) {
- printf("%d ", buf_r[i][j][k]);
+ HDprintf("%d ", buf_r[i][j][k]);
}
- printf("[%d] ", j);
+ HDprintf("[%d] ", j);
}
- printf("\n");
+ HDprintf("\n");
}
- printf("\n");
+ HDprintf("\n");
#endif
-
-
- /* compare the read array with the original array */
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- for( k = 0; k < (int)dims_r[2]; k++ )
- {
- if (i >= DIMS0 || j >= DIMS1 || k >= DIMS2 )
- {
- if( buf_r[i][j][k] != comp_value )
- {
- printf("buf_r[%d][%d][%d] = %d\n", i, j, k, buf_r[i][j][k] );
- printf("value = %d\n", comp_value);
+ /* compare the read array with the original array */
+ for (i = 0; i < (int) dims_r[0]; i++) {
+ for (j = 0; j < (int) dims_r[1]; j++) {
+ for (k = 0; k < (int) dims_r[2]; k++) {
+ if (i >= DIMS0 || j >= DIMS1 || k >= DIMS2) {
+ if (buf_r[i][j][k] != comp_value) {
+ HDprintf("buf_r[%d][%d][%d] = %d\n", i, j, k, buf_r[i][j][k]);
+ HDprintf("value = %d\n", comp_value);
TEST_ERROR
}
- }
- else
- {
- if(buf_r[i][j][k] != buf_o[i][j][k])
+ } else {
+ if (buf_r[i][j][k] != buf_o[i][j][k])
TEST_ERROR
}
}
}
}
-
/*-------------------------------------------------------------------------
* shrink to 0
*
@@ -1880,158 +1654,126 @@ static int test_rank3( hid_t fapl,
dims_s[2] = 0;
/* set new dimensions for the array. */
- if (H5Dset_extent(did , dims_s) < 0)
- {
+ if (H5Dset_extent(did, dims_s) < 0) {
TEST_ERROR
}
/* get the space */
- if ((sid = H5Dget_space(did)) < 0)
- {
+ if ((sid = H5Dget_space(did)) < 0) {
TEST_ERROR
}
/* get dimensions */
- if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
- {
+ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
/* check dimensions */
- for( i = 0; i < RANK3; i++ )
- {
+ for (i = 0; i < RANK3; i++) {
if (dims_r[i] != dims_s[i])
TEST_ERROR
}
-
-
/*-------------------------------------------------------------------------
* close dataset
*-------------------------------------------------------------------------
*/
- if (H5Dclose(did) < 0)
- {
+ if (H5Dclose(did) < 0) {
TEST_ERROR
}
-
/*-------------------------------------------------------------------------
* test a dataset with non initialized chunks
*-------------------------------------------------------------------------
*/
-
- if ((sid = H5Screate_simple(RANK3, dims_o, maxdims)) < 0)
- {
+ if ((sid = H5Screate_simple(RANK3, dims_o, maxdims)) < 0) {
TEST_ERROR
}
- if ((did = H5Dcreate2(fid , "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0)
- {
+ if ((did = H5Dcreate2(fid, "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) {
TEST_ERROR
}
/* set new dimensions for the array */
- dims_o[ 0 ] = 0;
- dims_o[ 1 ] = 0;
- dims_o[ 2 ] = 0;
- if (H5Dset_extent( did , dims_o ) < 0)
- {
+ dims_o[0] = 0;
+ dims_o[1] = 0;
+ dims_o[2] = 0;
+ if (H5Dset_extent(did, dims_o) < 0) {
TEST_ERROR
}
-
-
- if (H5Dclose(did) < 0)
- {
+ if (H5Dclose(did) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
-
-
-
/*-------------------------------------------------------------------------
* close property list
*-------------------------------------------------------------------------
*/
-
- if (H5Pclose(my_dcpl) < 0)
- {
+ if (H5Pclose(my_dcpl) < 0) {
TEST_ERROR
}
- if (H5Fclose( fid ) < 0)
- {
+ if (H5Fclose(fid) < 0) {
TEST_ERROR
}
-
return 0;
-
-
-error:
+ error:
H5E_BEGIN_TRY
- {
- H5Dclose( did );
- H5Sclose( sid );
- H5Pclose( my_dcpl );
- H5Pclose( fcpl );
- H5Fclose( fid );
- } H5E_END_TRY;
+ {
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Pclose(my_dcpl);
+ H5Pclose(fcpl);
+ H5Fclose(fid);
+ }H5E_END_TRY;
return -1;
}
-
/*-------------------------------------------------------------------------
* test usage with external storage
*-------------------------------------------------------------------------
*/
-static int test_external( hid_t fapl )
-{
-
- hid_t fid=-1;
- hid_t did=-1;
- hid_t sid=-1;
- hid_t dcpl=-1;
- hsize_t dims_o[RANK2] = {DIM0,DIM1}; /* original dimensions */
- hsize_t dims_s[RANK2] = {DIMS0,DIMS1}; /* shrinking dimensions */
- hsize_t dims_e[RANK2] = {DIME0,DIM1}; /* extended dimensions, dimension 1 is the original */
- hsize_t dims_r[RANK2]; /* read dimensions */
- hsize_t maxdims[RANK2] = {DIME0,DIM1}; /* only the first dimension can be extendible */
- int buf_o[DIM0][DIM1]; /* original buffer, for writing */
- int buf_s[DIMS0][DIMS1]; /* shrinked buffer, for reading */
- int buf_e[DIME0][DIM1]; /* extended buffer, for writing, dimension 1 is the original */
- int buf_ro[DIM0][DIM1]; /* original buffer for reading */
- int i, j;
- int comp_value = 0;
- char filename[NAME_BUF_SIZE];
-
-
- hsize_t size; /* number of bytes reserved in the file for the data */
+static int test_external(hid_t fapl) {
+
+ hid_t fid = -1;
+ hid_t did = -1;
+ hid_t sid = -1;
+ hid_t dcpl = -1;
+ hsize_t dims_o[RANK2] = { DIM0, DIM1 }; /* original dimensions */
+ hsize_t dims_s[RANK2] = { DIMS0, DIMS1 }; /* shrinking dimensions */
+ hsize_t dims_e[RANK2] = { DIME0, DIM1 }; /* extended dimensions, dimension 1 is the original */
+ hsize_t dims_r[RANK2]; /* read dimensions */
+ hsize_t maxdims[RANK2] = { DIME0, DIM1 }; /* only the first dimension can be extendible */
+ int buf_o[DIM0][DIM1]; /* original buffer, for writing */
+ int buf_s[DIMS0][DIMS1]; /* shrinked buffer, for reading */
+ int buf_e[DIME0][DIM1]; /* extended buffer, for writing, dimension 1 is the original */
+ int buf_ro[DIM0][DIM1]; /* original buffer for reading */
+ int i, j;
+ int comp_value = 0;
+ char filename[NAME_BUF_SIZE];
+
+ hsize_t size; /* number of bytes reserved in the file for the data */
hsize_t max_size[2];
max_size[0] = dims_e[0];
max_size[1] = dims_e[1];
size = max_size[0] * max_size[1] * sizeof(int) / 2;
-
- for( i = 0; i < DIM0; i++ )
- {
- for( j = 0; j < DIM1; j++ )
- {
+ for (i = 0; i < DIM0; i++) {
+ for (j = 0; j < DIM1; j++) {
buf_o[i][j] = 2;
}
}
@@ -2043,30 +1785,27 @@ static int test_external( hid_t fapl )
if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
- /* modify dataset creation properties */
- if ((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0)
+ /* modify dataset creation properties */
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
- if(H5Pset_external(dcpl, EXT_FILE_NAME1, (off_t)0, size) < 0)
+ if (H5Pset_external(dcpl, EXT_FILE_NAME1, (off_t) 0, size) < 0)
FAIL_STACK_ERROR
- if(H5Pset_external(dcpl, EXT_FILE_NAME2, (off_t)0, size) < 0)
+ if (H5Pset_external(dcpl, EXT_FILE_NAME2, (off_t) 0, size) < 0)
FAIL_STACK_ERROR
{
- char name[256]; /*external file name */
- off_t file_offset; /*external file offset */
- hsize_t file_size; /*sizeof external file segment */
+ char name[256]; /*external file name */
+ off_t file_offset; /*external file offset */
+ hsize_t file_size; /*sizeof external file segment */
- if(H5Pget_external(dcpl, 0, sizeof(name), name, &file_offset,
- &file_size) < 0)
+ if (H5Pget_external(dcpl, 0, sizeof(name), name, &file_offset, &file_size) < 0)
FAIL_STACK_ERROR
}
-
-
/*-------------------------------------------------------------------------
* Write an array AxB. These are the dimensions for creating the dataset
*
@@ -2080,80 +1819,72 @@ static int test_external( hid_t fapl )
*-------------------------------------------------------------------------
*/
-
/* create the data space with unlimited dimensions. */
if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0)
FAIL_STACK_ERROR
- if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ if ((did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0)
+ if (H5Dwrite(did, H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0)
FAIL_STACK_ERROR
if (H5Sclose(sid) < 0)
FAIL_STACK_ERROR
+ /*-------------------------------------------------------------------------
+ * read
+ *-------------------------------------------------------------------------
+ */
- /*-------------------------------------------------------------------------
- * read
- *-------------------------------------------------------------------------
- */
-
- /* read */
+ /* read */
if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ro) < 0)
FAIL_STACK_ERROR
#if defined (H5_SET_EXTENT_DEBUG)
- printf("\n");
- for (i = 0; i < (int)dims_o[0]; i++ )
- {
- for (j = 0; j < (int)dims_o[1]; j++ )
- {
- printf("%d ", buf_ro[i][j]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_o[0]; i++ ) {
+ for (j = 0; j < (int)dims_o[1]; j++ ) {
+ HDprintf("%d ", buf_ro[i][j]);
}
- printf("\n");
+ HDprintf("\n");
}
#endif
-
-
- /*-------------------------------------------------------------------------
- * expand
- *-------------------------------------------------------------------------
- */
-
- /*-------------------------------------------------------------------------
- * set new dimensions for the array; expand it
- * data is now, extended space was initialized with default value
- *
- * 2 2 2 2
- * 2 2 2 2
- * 2 2 2 2
- * 2 2 2 2
- * 0 0 0 0
- * 0 0 0 0
- * 0 0 0 0
- *
- *-------------------------------------------------------------------------
- */
-
- /* set new dimensions for the array. */
- if (H5Dset_extent(did , dims_e) < 0)
+ /*-------------------------------------------------------------------------
+ * expand
+ *-------------------------------------------------------------------------
+ */
+
+ /*-------------------------------------------------------------------------
+ * set new dimensions for the array; expand it
+ * data is now, extended space was initialized with default value
+ *
+ * 2 2 2 2
+ * 2 2 2 2
+ * 2 2 2 2
+ * 2 2 2 2
+ * 0 0 0 0
+ * 0 0 0 0
+ * 0 0 0 0
+ *
+ *-------------------------------------------------------------------------
+ */
+
+ /* set new dimensions for the array. */
+ if (H5Dset_extent(did, dims_e) < 0)
FAIL_STACK_ERROR
- /* get the space */
+ /* get the space */
if ((sid = H5Dget_space(did)) < 0)
FAIL_STACK_ERROR
- /* get dimensions */
+ /* get dimensions */
if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
FAIL_STACK_ERROR
if (H5Sclose(sid) < 0)
FAIL_STACK_ERROR
-
- /* check dimensions */
- for( i = 0; i < RANK2; i++ )
- {
+ /* check dimensions */
+ for (i = 0; i < RANK2; i++) {
if (dims_r[i] != dims_e[i])
TEST_ERROR
}
@@ -2162,48 +1893,33 @@ static int test_external( hid_t fapl )
if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_e) < 0)
FAIL_STACK_ERROR
-
-
#if defined (H5_SET_EXTENT_DEBUG)
- printf("\n");
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- printf("%d ", buf_e[i][j]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_r[0]; i++ ) {
+ for (j = 0; j < (int)dims_r[1]; j++ ) {
+ HDprintf("%d ", buf_e[i][j]);
}
- printf("\n");
+ HDprintf("\n");
}
#endif
-
-
-
- /* compare the read array with the expanded array */
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- if ( i >= DIM0 || j >= DIM1 )
- {
- if(buf_e[i][j] != comp_value)
- {
- printf("buf_e[%d][%d] = %d\n", i, j, buf_e[i][j]);
- printf("value = %d\n", comp_value);
+ /* compare the read array with the expanded array */
+ for (i = 0; i < (int) dims_r[0]; i++) {
+ for (j = 0; j < (int) dims_r[1]; j++) {
+ if (i >= DIM0 || j >= DIM1) {
+ if (buf_e[i][j] != comp_value) {
+ HDprintf("buf_e[%d][%d] = %d\n", i, j, buf_e[i][j]);
+ HDprintf("value = %d\n", comp_value);
TEST_ERROR
}
- }
- else
- {
- if(buf_e[i][j] != buf_o[i][j])
+ } else {
+ if (buf_e[i][j] != buf_o[i][j])
TEST_ERROR
}
}
}
-
-
- /*-------------------------------------------------------------------------
+ /*-------------------------------------------------------------------------
* shrink
*
* data is now
@@ -2215,208 +1931,172 @@ static int test_external( hid_t fapl )
*/
/* set new dimensions for the array. */
- if (H5Dset_extent(did , dims_s) < 0)
+ if (H5Dset_extent(did, dims_s) < 0)
FAIL_STACK_ERROR
- /* get the space */
+ /* get the space */
if ((sid = H5Dget_space(did)) < 0)
FAIL_STACK_ERROR
- /* get dimensions */
+ /* get dimensions */
if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
FAIL_STACK_ERROR
if (H5Sclose(sid) < 0)
FAIL_STACK_ERROR
- /* check dimensions */
- for( i = 0; i < RANK2; i++ )
- {
+ /* check dimensions */
+ for (i = 0; i < RANK2; i++) {
if (dims_r[i] != dims_s[i])
TEST_ERROR
}
-
-
-
/*-------------------------------------------------------------------------
* read
*-------------------------------------------------------------------------
*/
/* read */
- if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s ) < 0)
+ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s) < 0)
FAIL_STACK_ERROR
#if defined (H5_SET_EXTENT_DEBUG)
- printf("\n");
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- printf("%d ", buf_s[i][j]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_r[0]; i++ ) {
+ for (j = 0; j < (int)dims_r[1]; j++ ) {
+ HDprintf("%d ", buf_s[i][j]);
}
- printf("\n");
+ HDprintf("\n");
}
#endif
-
-
-
- /* compare the read array with the shrinked array */
- for( i = 0; i < (int)dims_r[0]; i++ )
- {
- for( j = 0; j < (int)dims_r[1]; j++ )
- {
- if ( buf_s[i][j] != buf_o[i][j] )
- {
- printf("buf_s[%d][%d] = %d\n", i, j, buf_s[i][j]);
- printf("buf_o[%d][%d] = %d\n", i, j, buf_o[i][j]);
+ /* compare the read array with the shrinked array */
+ for (i = 0; i < (int) dims_r[0]; i++) {
+ for (j = 0; j < (int) dims_r[1]; j++) {
+ if (buf_s[i][j] != buf_o[i][j]) {
+ HDprintf("buf_s[%d][%d] = %d\n", i, j, buf_s[i][j]);
+ HDprintf("buf_o[%d][%d] = %d\n", i, j, buf_o[i][j]);
TEST_ERROR
}
}
}
-
/*-------------------------------------------------------------------------
* negative test
* try to extend dimension above maximum
*-------------------------------------------------------------------------
*/
-
dims_e[1] = DIME1;
-
H5E_BEGIN_TRY
- {
-
-
- /* set new dimensions for the array. */
- if (H5Dset_extent(did , dims_e) == SUCCEED)
{
- TEST_ERROR
- }
-
- } H5E_END_TRY;
+ /* set new dimensions for the array. */
+ if (H5Dset_extent(did, dims_e) == SUCCEED) {
+ TEST_ERROR
+ }
+ }H5E_END_TRY;
/*-------------------------------------------------------------------------
* close property list
*-------------------------------------------------------------------------
*/
-
if (H5Pclose(dcpl) < 0)
FAIL_STACK_ERROR
- if (H5Dclose( did ) < 0)
+ if (H5Dclose(did) < 0)
FAIL_STACK_ERROR
- if (H5Fclose( fid ) < 0)
+ if (H5Fclose(fid) < 0)
FAIL_STACK_ERROR
- PASSED();
+ PASSED()
+ ;
return 0;
-error:
+ error:
H5E_BEGIN_TRY
- {
- H5Dclose( did );
- H5Sclose( sid );
- H5Pclose( dcpl );
- H5Fclose( fid );
- } H5E_END_TRY;
+ {
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Pclose(dcpl);
+ H5Fclose(fid);
+ }H5E_END_TRY;
return -1;
}
-
/*-------------------------------------------------------------------------
* test usage with layouts compact and contiguous
*-------------------------------------------------------------------------
*/
-static int test_layouts( H5D_layout_t layout, hid_t fapl )
-{
-
- hid_t fid=-1;
- hid_t did=-1;
- hid_t sid=-1;
- hid_t dcpl=-1;
- herr_t ret;
- hsize_t dims_o[RANK2] = {DIM0,DIM1}; /* original dimensions */
- hsize_t dims_s[RANK2] = {DIMS0,DIMS1}; /* shrinking dimensions */
- hsize_t dims_e[RANK2] = {DIME0,DIME1}; /* extended dimensions */
- hsize_t dims_r[RANK2]; /* read dimensions */
- int buf_o[DIM0][DIM1];
- int buf_r[DIM0][DIM1];
- int i, j;
- char filename[NAME_BUF_SIZE];
-
- for( i = 0; i < DIM0; i++ )
- {
- for( j = 0; j < DIM1; j++ )
- {
+static int test_layouts(H5D_layout_t layout, hid_t fapl) {
+
+ hid_t fid = -1;
+ hid_t did = -1;
+ hid_t sid = -1;
+ hid_t dcpl = -1;
+ herr_t ret;
+ hsize_t dims_o[RANK2] = { DIM0, DIM1 }; /* original dimensions */
+ hsize_t dims_s[RANK2] = { DIMS0, DIMS1 }; /* shrinking dimensions */
+ hsize_t dims_e[RANK2] = { DIME0, DIME1 }; /* extended dimensions */
+ hsize_t dims_r[RANK2]; /* read dimensions */
+ int buf_o[DIM0][DIM1];
+ int buf_r[DIM0][DIM1];
+ int i, j;
+ char filename[NAME_BUF_SIZE];
+
+ for (i = 0; i < DIM0; i++) {
+ for (j = 0; j < DIM1; j++) {
buf_o[i][j] = 2;
}
}
-
/* create a new file */
h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
- if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- {
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
TEST_ERROR
}
/* create the data space with unlimited dimensions. */
- if ((sid = H5Screate_simple(RANK2, dims_o, NULL)) < 0)
- {
+ if ((sid = H5Screate_simple(RANK2, dims_o, NULL)) < 0) {
TEST_ERROR
}
/* modify dataset creation properties */
- if ((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0)
- {
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
TEST_ERROR
}
- if (H5Pset_layout (dcpl, layout) < 0)
- {
+ if (H5Pset_layout(dcpl, layout) < 0) {
TEST_ERROR
}
/* create a dataset */
- if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- {
+ if ((did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
TEST_ERROR
}
/* write */
- if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0)
- {
+ if (H5Dwrite(did, H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) {
TEST_ERROR
}
-
#if defined (H5_SET_EXTENT_DEBUG4)
- printf("\n");
- for (i = 0; i < (int)dims_o[0]; i++ )
- {
- for (j = 0; j < (int)dims_o[1]; j++ )
- {
- printf("%d ", buf_o[i][j]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_o[0]; i++ ) {
+ for (j = 0; j < (int)dims_o[1]; j++ ) {
+ HDprintf("%d ", buf_o[i][j]);
}
- printf("\n");
+ HDprintf("\n");
}
#endif
-
-
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
@@ -2427,39 +2107,31 @@ static int test_layouts( H5D_layout_t layout, hid_t fapl )
*/
H5E_BEGIN_TRY
- {
+ {
- ret = H5Dset_extent(did , dims_e);
+ ret = H5Dset_extent(did, dims_e);
- } H5E_END_TRY;
+ }H5E_END_TRY;
- if(ret >= 0)
+ if (ret >= 0)
TEST_ERROR
-
-
-
- /* get the space */
- if ((sid = H5Dget_space(did)) < 0)
- {
+ /* get the space */
+ if ((sid = H5Dget_space(did)) < 0) {
TEST_ERROR
}
/* get dimensions */
- if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
- {
+ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
-
/* check dimensions */
- for( i = 0; i < RANK2; i++ )
- {
+ for (i = 0; i < RANK2; i++) {
if (dims_r[i] != dims_o[i])
TEST_ERROR
}
@@ -2468,123 +2140,100 @@ static int test_layouts( H5D_layout_t layout, hid_t fapl )
if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_r) < 0)
TEST_ERROR
-
-
#if defined (H5_SET_EXTENT_DEBUG4)
- printf("\n");
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- printf("%d ", buf_r[i][j]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_r[0]; i++ ) {
+ for (j = 0; j < (int)dims_r[1]; j++ ) {
+ HDprintf("%d ", buf_r[i][j]);
}
- printf("\n");
+ HDprintf("\n");
}
#endif
-
-
- /*-------------------------------------------------------------------------
- * negative test
- * try to shrink dimension
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * negative test
+ * try to shrink dimension
+ *-------------------------------------------------------------------------
+ */
H5E_BEGIN_TRY
- {
+ {
- ret = H5Dset_extent(did , dims_s);
+ ret = H5Dset_extent(did, dims_s);
- } H5E_END_TRY;
+ }H5E_END_TRY;
- if(ret >= 0)
+ if (ret >= 0)
TEST_ERROR
-
- /* get the space */
- if ((sid = H5Dget_space(did)) < 0)
- {
+ /* get the space */
+ if ((sid = H5Dget_space(did)) < 0) {
TEST_ERROR
}
/* get dimensions */
- if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
- {
+ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) {
TEST_ERROR
}
- if (H5Sclose(sid) < 0)
- {
+ if (H5Sclose(sid) < 0) {
TEST_ERROR
}
/* check dimensions */
- for( i = 0; i < RANK2; i++ )
- {
+ for (i = 0; i < RANK2; i++) {
if (dims_r[i] != dims_o[i])
TEST_ERROR
}
-
/*-------------------------------------------------------------------------
* read
*-------------------------------------------------------------------------
*/
/* read */
- if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_r ) < 0)
- {
+ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_r) < 0) {
TEST_ERROR
}
#if defined (H5_SET_EXTENT_DEBUG4)
- printf("\n");
- for (i = 0; i < (int)dims_r[0]; i++ )
- {
- for (j = 0; j < (int)dims_r[1]; j++ )
- {
- printf("%d ", buf_r[i][j]);
+ HDprintf("\n");
+ for (i = 0; i < (int)dims_r[0]; i++ ) {
+ for (j = 0; j < (int)dims_r[1]; j++ ) {
+ HDprintf("%d ", buf_r[i][j]);
}
- printf("\n");
+ HDprintf("\n");
}
#endif
-
-
/*-------------------------------------------------------------------------
* close
*-------------------------------------------------------------------------
*/
- if (H5Dclose(did) < 0)
- {
+ if (H5Dclose(did) < 0) {
TEST_ERROR
}
- if (H5Pclose(dcpl) < 0)
- {
+ if (H5Pclose(dcpl) < 0) {
TEST_ERROR
}
- if (H5Fclose( fid ) < 0)
- {
+ if (H5Fclose(fid) < 0) {
TEST_ERROR
}
-
return 0;
-
-
-error:
+ error:
H5E_BEGIN_TRY
- {
- H5Dclose( did );
- H5Sclose( sid );
- H5Pclose( dcpl );
- H5Fclose( fid );
- } H5E_END_TRY;
+ {
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Pclose(dcpl);
+ H5Fclose(fid);
+ }H5E_END_TRY;
return -1;
}
@@ -3077,16 +2726,15 @@ static void test_random_rank4_dump( unsigned ndim_sets, hsize_t dim_log[][4],
{
unsigned i;
- printf(" Chunk dimensions: ( %u, %u, %u, %u )\n", (unsigned)cdims[0],
+ HDprintf(" Chunk dimensions: ( %u, %u, %u, %u )\n", (unsigned)cdims[0],
(unsigned)cdims[1], (unsigned)cdims[2], (unsigned)cdims[3]);
- printf(" Log of dataset dimensions (oldest first):\n");
+ HDprintf(" Log of dataset dimensions (oldest first):\n");
for(i=0; i<ndim_sets; i++)
- printf(" Iteration %-3u: ( %2u, %2u, %2u, %2u )\n", i,
+ HDprintf(" Iteration %-3u: ( %2u, %2u, %2u, %2u )\n", i,
(unsigned)dim_log[i][0], (unsigned)dim_log[i][1],
(unsigned)dim_log[i][2], (unsigned)dim_log[i][3]);
if(j>=0)
- printf(" First incorrect value read: ( %d, %d, %d, %d )\n", j, k, l,
- m);
+ HDprintf(" First incorrect value read: ( %d, %d, %d, %d )\n", j, k, l, m);
return;
} /* end test_random_rank4_dump */
diff --git a/test/stab.c b/test/stab.c
index 37097b7..80c8b06 100644
--- a/test/stab.c
+++ b/test/stab.c
@@ -16,13 +16,13 @@
* Tuesday, November 24, 1998
*/
-#define H5G_FRIEND /*suppress error about including H5Gpkg */
+#define H5G_FRIEND /*suppress error about including H5Gpkg */
/* Define this macro to indicate that the testing APIs should be available */
#define H5G_TESTING
#include "h5test.h"
-#include "H5Gpkg.h" /* Groups */
+#include "H5Gpkg.h" /* Groups */
const char *FILENAME[] = {
"stab",
@@ -78,17 +78,17 @@ const char *FILENAME[] = {
#define CORRUPT_STAB_TMP_FILE "corrupt_stab_msg_tmp.h5"
#define CORRUPT_STAB_DSET "DS1"
-
+
/*-------------------------------------------------------------------------
- * Function: test_misc
+ * Function: test_misc
*
- * Purpose: Test miscellaneous group stuff.
+ * Purpose: Test miscellaneous group stuff.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, November 24, 1998
*
*-------------------------------------------------------------------------
@@ -96,10 +96,10 @@ const char *FILENAME[] = {
static int
test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t g1 = (-1), g2 = (-1), g3 = (-1);
- char filename[NAME_BUF_SIZE];
- char comment[64];
+ hid_t fid = (-1); /* File ID */
+ hid_t g1 = (-1), g2 = (-1), g3 = (-1);
+ char filename[NAME_BUF_SIZE];
+ char comment[64];
if(new_format)
TESTING("miscellaneous group tests (w/new group format)")
@@ -125,10 +125,10 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format)
if((g3 = H5Gopen2(fid, "/test_1b", H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Oget_comment_by_name(g3, "././.", comment, sizeof comment, H5P_DEFAULT) < 0) TEST_ERROR
if(HDstrcmp(comment, "hello world")) {
- H5_FAILED();
- puts(" Read the wrong comment string from the group.");
- printf(" got: \"%s\"\n ans: \"hello world\"\n", comment);
- TEST_ERROR
+ H5_FAILED();
+ HDputs(" Read the wrong comment string from the group.");
+ HDprintf(" got: \"%s\"\n ans: \"hello world\"\n", comment);
+ TEST_ERROR
}
if(H5Gclose(g1) < 0) TEST_ERROR
if(H5Gclose(g2) < 0) TEST_ERROR
@@ -153,21 +153,21 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format)
error:
H5E_BEGIN_TRY {
- H5Gclose(g1);
- H5Gclose(g2);
- H5Gclose(g3);
- H5Fclose(fid);
+ H5Gclose(g1);
+ H5Gclose(g2);
+ H5Gclose(g3);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Purpose: Creates a group with a very long name
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
* Programmer: Robb Matzke <matzke@llnl.gov> 2002-03-28
*
@@ -177,10 +177,10 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format)
static int
test_long(hid_t fcpl, hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
+ hid_t fid = (-1); /* File ID */
hid_t g1 = (-1), g2 = (-1);
char *name1 = NULL, *name2 = NULL;
- char filename[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
size_t i;
if(new_format)
@@ -198,7 +198,7 @@ test_long(hid_t fcpl, hid_t fapl, hbool_t new_format)
name1[i] = (char)('A' + i%26);
name1[LONG_NAME_LEN - 1] = '\0';
name2 = (char *)HDmalloc((size_t)((2 * LONG_NAME_LEN) + 2));
- sprintf(name2, "%s/%s", name1, name1);
+ HDsprintf(name2, "%s/%s", name1, name1);
/* Create groups */
if((g1 = H5Gcreate2(fid, name1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -226,22 +226,22 @@ error:
H5E_BEGIN_TRY {
H5Gclose(g1);
H5Gclose(g2);
- H5Fclose(fid);
+ H5Fclose(fid);
HDfree(name2);
HDfree(name1);
} H5E_END_TRY;
return 1;
} /* end test_long() */
-
+
/*-------------------------------------------------------------------------
* Function: test_large
*
* Purpose: Creates a really large directory.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
* Programmer: Robb Matzke
* robb@maya.nuance.com
@@ -252,9 +252,9 @@ error:
static int
test_large(hid_t fcpl, hid_t fapl, hbool_t new_format)
{
- hid_t fid = (-1); /* File ID */
+ hid_t fid = (-1); /* File ID */
hid_t cwg = (-1), dir = (-1); /* Group IDs */
- char filename[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
char name[NAME_BUF_SIZE];
int i;
@@ -275,8 +275,8 @@ test_large(hid_t fcpl, hid_t fapl, hbool_t new_format)
if(new_format)
if(H5G__has_stab_test(cwg) != FALSE) TEST_ERROR
for(i = 0; i < LARGE_NOBJS; i++) {
- sprintf(name, "%05d%05d", (HDrandom() % 100000), i);
- if((dir = H5Gcreate2(cwg, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ HDsprintf(name, "%05d%05d", (HDrandom() % 100000), i);
+ if((dir = H5Gcreate2(cwg, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(dir) < 0) TEST_ERROR
}
if(new_format)
@@ -291,14 +291,14 @@ test_large(hid_t fcpl, hid_t fapl, hbool_t new_format)
error:
H5E_BEGIN_TRY {
- H5Gclose(dir);
- H5Gclose(cwg);
- H5Fclose(fid);
+ H5Gclose(dir);
+ H5Gclose(cwg);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
} /* end test_large() */
-
+
/*-------------------------------------------------------------------------
* Function: lifecycle
*
@@ -318,19 +318,19 @@ test_large(hid_t fcpl, hid_t fapl, hbool_t new_format)
static int
lifecycle(hid_t fcpl, hid_t fapl2)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group ID */
- hid_t gid2 = (-1); /* Datatype ID */
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group ID */
+ hid_t gid2 = (-1); /* Datatype ID */
hid_t gcpl = (-1); /* Group creation property list ID */
size_t lheap_size_hint; /* Local heap size hint */
unsigned max_compact; /* Maximum # of links to store in group compactly */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
- unsigned est_num_entries; /* Estimated # of entries in group */
- unsigned est_name_len; /* Estimated length of entry name */
- unsigned nmsgs; /* Number of messages in group's header */
+ unsigned est_num_entries; /* Estimated # of entries in group */
+ unsigned est_name_len; /* Estimated length of entry name */
+ unsigned nmsgs; /* Number of messages in group's header */
H5O_info_t oinfo; /* Object info */
char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
h5_stat_size_t empty_size; /* Size of an empty file */
unsigned u; /* Local index variable */
h5_stat_size_t file_size; /* Size of each file created */
@@ -385,7 +385,7 @@ lifecycle(hid_t fcpl, hid_t fapl2)
if(H5G__is_empty_test(gid) != TRUE) TEST_ERROR
/* Create first "bottom" group */
- sprintf(objname, LIFECYCLE_BOTTOM_GROUP, (unsigned)0);
+ HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, (unsigned)0);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Check on bottom group's status */
@@ -402,7 +402,7 @@ lifecycle(hid_t fcpl, hid_t fapl2)
/* Create several more bottom groups, to push the top group almost to a symbol table */
/* (Start counting at '1', since we've already created one bottom group */
for(u = 1; u < LIFECYCLE_MAX_COMPACT; u++) {
- sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
+ HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Check on bottom group's status */
@@ -426,7 +426,7 @@ lifecycle(hid_t fcpl, hid_t fapl2)
if(oinfo.hdr.nchunks != 1) TEST_ERROR
/* Create one more "bottom" group, which should push top group into using a symbol table */
- sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
+ HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Check on bottom group's status */
@@ -449,7 +449,7 @@ lifecycle(hid_t fcpl, hid_t fapl2)
/* Unlink objects from top group */
while(u >= LIFECYCLE_MIN_DENSE) {
- sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
+ HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
@@ -462,7 +462,7 @@ lifecycle(hid_t fcpl, hid_t fapl2)
if(H5G__is_new_dense_test(gid) != TRUE) TEST_ERROR
/* Unlink one more object from the group, which should transform back to using links */
- sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
+ HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
u--;
@@ -472,10 +472,10 @@ lifecycle(hid_t fcpl, hid_t fapl2)
if(nmsgs != (LIFECYCLE_MIN_DENSE - 1)) TEST_ERROR
/* Unlink last two objects from top group */
- sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
+ HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
u--;
- sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
+ HDsprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Check on top group's status */
@@ -505,15 +505,15 @@ lifecycle(hid_t fcpl, hid_t fapl2)
error:
H5E_BEGIN_TRY {
- H5Gclose(gcpl);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gcpl);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
} /* end lifecycle() */
-
+
/*-------------------------------------------------------------------------
* Function: long_compact
*
@@ -532,11 +532,11 @@ error:
static int
long_compact(hid_t fcpl, hid_t fapl2)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group ID */
- hid_t gid2 = (-1); /* Group ID */
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group ID */
+ hid_t gid2 = (-1); /* Group ID */
char *objname = NULL; /* Object name */
- char filename[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
h5_stat_size_t empty_size; /* Size of an empty file */
h5_stat_size_t file_size; /* Size of each file created */
@@ -638,9 +638,9 @@ long_compact(hid_t fcpl, hid_t fapl2)
error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
if(objname)
@@ -649,7 +649,7 @@ error:
return 1;
} /* end long_compact() */
-
+
/*-------------------------------------------------------------------------
* Function: read_old
*
@@ -691,7 +691,7 @@ read_old(void)
/* Create a bunch of objects in the group */
for(u = 0; u < READ_OLD_NGROUPS; u++) {
- sprintf(objname, "Group %u", u);
+ HDsprintf(objname, "Group %u", u);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Check on bottom group's status */
@@ -709,7 +709,7 @@ read_old(void)
/* Delete new objects from old group */
for(u = 0; u < READ_OLD_NGROUPS; u++) {
- sprintf(objname, "Group %u", u);
+ HDsprintf(objname, "Group %u", u);
if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -730,13 +730,13 @@ read_old(void)
error:
H5E_BEGIN_TRY {
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
} /* end read_old() */
-
+
/*-------------------------------------------------------------------------
* Function: no_compact
*
@@ -755,16 +755,16 @@ error:
static int
no_compact(hid_t fcpl, hid_t fapl2)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group ID */
- hid_t gid2 = (-1); /* Datatype ID */
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group ID */
+ hid_t gid2 = (-1); /* Datatype ID */
hid_t gcpl = (-1); /* Group creation property list ID */
char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
h5_stat_size_t empty_size; /* Size of an empty file */
h5_stat_size_t file_size; /* Size of each file created */
- unsigned est_num_entries; /* Estimated # of entries in group */
- unsigned est_name_len; /* Estimated length of entry name */
+ unsigned est_num_entries; /* Estimated # of entries in group */
+ unsigned est_name_len; /* Estimated length of entry name */
TESTING("group without compact form");
@@ -802,7 +802,7 @@ no_compact(hid_t fcpl, hid_t fapl2)
if(H5G__is_empty_test(gid) != TRUE) TEST_ERROR
/* Create first "bottom" group */
- sprintf(objname, NO_COMPACT_BOTTOM_GROUP, (unsigned)0);
+ HDsprintf(objname, NO_COMPACT_BOTTOM_GROUP, (unsigned)0);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Check on bottom group's status */
@@ -817,7 +817,7 @@ no_compact(hid_t fcpl, hid_t fapl2)
if(H5G__is_new_dense_test(gid) != TRUE) TEST_ERROR
/* Unlink object from top group */
- sprintf(objname, NO_COMPACT_BOTTOM_GROUP, (unsigned)0);
+ HDsprintf(objname, NO_COMPACT_BOTTOM_GROUP, (unsigned)0);
if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Check on top group's status */
@@ -843,15 +843,15 @@ no_compact(hid_t fcpl, hid_t fapl2)
error:
H5E_BEGIN_TRY {
- H5Gclose(gcpl);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gcpl);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
} /* end no_compact() */
-
+
/*-------------------------------------------------------------------------
* Function: gcpl_on_root
*
@@ -869,15 +869,15 @@ error:
static int
gcpl_on_root(hid_t fapl2)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group ID */
- hid_t gid2 = (-1); /* Datatype ID */
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group ID */
+ hid_t gid2 = (-1); /* Datatype ID */
hid_t fcpl = (-1); /* File creation property list ID */
hid_t gcpl = (-1); /* Group creation property list ID */
hid_t lcpl = (-1); /* Link creation property list ID */
unsigned max_compact; /* Maximum # of links to store in group compactly */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
- char filename[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
TESTING("setting root group creation properties");
@@ -962,17 +962,17 @@ gcpl_on_root(hid_t fapl2)
error:
H5E_BEGIN_TRY {
- H5Gclose(lcpl);
- H5Gclose(gcpl);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Gclose(fcpl);
- H5Fclose(fid);
+ H5Gclose(lcpl);
+ H5Gclose(gcpl);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Gclose(fcpl);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
} /* end gcpl_on_root() */
-
+
/*-------------------------------------------------------------------------
* Function: old_api
*
@@ -990,11 +990,11 @@ static int
old_api(hid_t fapl)
{
#ifndef H5_NO_DEPRECATED_SYMBOLS
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group ID */
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group ID */
h5_stat_size_t small_file_size; /* Size of small group file */
h5_stat_size_t large_file_size; /* Size of large group file */
- char filename[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
#endif /* H5_NO_DEPRECATED_SYMBOLS */
TESTING("old API routines");
@@ -1049,7 +1049,7 @@ old_api(hid_t fapl)
fapl = fapl;
SKIPPED();
- puts(" Deprecated API symbols not enabled");
+ HDputs(" Deprecated API symbols not enabled");
#endif /* H5_NO_DEPRECATED_SYMBOLS */
return 0;
@@ -1057,14 +1057,14 @@ old_api(hid_t fapl)
#ifndef H5_NO_DEPRECATED_SYMBOLS
error:
H5E_BEGIN_TRY {
- H5Gclose(gid);
- H5Fclose(fid);
+ H5Gclose(gid);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* end old_api() */
-
+
/*-------------------------------------------------------------------------
* Function: corrupt_stab_msg
*
@@ -1136,24 +1136,24 @@ corrupt_stab_msg(void)
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Fclose(fid);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
} /* end corrupt_stab_msg() */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test groups
+ * Purpose: Test groups
*
- * Return: Success: zero
+ * Return: Success: zero
*
- * Failure: non-zero
+ * Failure: non-zero
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, November 24, 1998
*
* Modifications:
@@ -1163,12 +1163,12 @@ error:
int
main(void)
{
- hid_t fapl, fapl2; /* File access property list IDs */
- hid_t fcpl, fcpl2; /* File creation property list ID */
- unsigned new_format; /* Whether to use the new format or not */
- const char *env_h5_drvr; /* File Driver value from environment */
- hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
- int nerrors = 0;
+ hid_t fapl, fapl2; /* File access property list IDs */
+ hid_t fcpl, fcpl2; /* File creation property list ID */
+ unsigned new_format; /* Whether to use the new format or not */
+ const char *env_h5_drvr; /* File Driver value from environment */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
+ int nerrors = 0;
/* Get the VFD to use */
env_h5_drvr = HDgetenv("HDF5_DRIVER");
@@ -1191,7 +1191,7 @@ main(void)
/* Set up file creation property list */
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR
if((fcpl2 = H5Pcopy(fcpl)) < 0) TEST_ERROR
-
+
/* Set to use paged aggregation strategy and persisting free-space */
/* Skip testing for multi/split drivers */
if(H5Pset_file_space_strategy(fcpl2, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)1) < 0)
@@ -1241,7 +1241,7 @@ main(void)
if(nerrors)
goto error;
- puts("All symbol table tests passed.");
+ HDputs("All symbol table tests passed.");
/* Cleanup */
if (GetTestCleanup()) {
@@ -1253,7 +1253,7 @@ main(void)
return 0;
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
return 1;
}
diff --git a/test/swmr.c b/test/swmr.c
index 0b352e2..e03d0c5 100644
--- a/test/swmr.c
+++ b/test/swmr.c
@@ -6484,106 +6484,104 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format)
if(childpid == 0) { /* Child process */
hid_t child_fid1 = -1; /* File ID */
hid_t child_fid2 = -1; /* File ID */
- hid_t child_did1 = -1, child_did2 = -1;
- hid_t child_sid = -1;
- hsize_t tdims[1];
- int rbuf[2] = {0, 0};
- int child_notify = 0;
+ hid_t child_did1 = -1, child_did2 = -1;
+ hid_t child_sid = -1;
+ hsize_t tdims[1];
+ int rbuf[2] = {0, 0};
+ int child_notify = 0;
- /* Close unused write end for out_pdf */
- if(HDclose(out_pdf[1]) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close unused write end for out_pdf */
+ if(HDclose(out_pdf[1]) < 0)
+ HDexit(EXIT_FAILURE);
- /* close unused read end for in_pdf */
- if(HDclose(in_pdf[0]) < 0)
- HDexit(EXIT_FAILURE);
+ /* close unused read end for in_pdf */
+ if(HDclose(in_pdf[0]) < 0)
+ HDexit(EXIT_FAILURE);
- /* Wait for notification from parent process */
- while(child_notify != 1) {
- if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
- HDexit(EXIT_FAILURE);
- }
+ /* Wait for notification from parent process */
+ while(child_notify != 1)
+ if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Open the file 2 times */
- if((child_fid1 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
- HDexit(EXIT_FAILURE);
+ /* Open the file 2 times */
+ if((child_fid1 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
+ HDexit(EXIT_FAILURE);
- if((child_fid2 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
- HDexit(EXIT_FAILURE);
+ if((child_fid2 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Open the dataset 2 times */
- if((child_did1 = H5Dopen2(child_fid1, "dataset", H5P_DEFAULT)) < 0)
- HDexit(EXIT_FAILURE);
- if((child_did2 = H5Dopen2(child_fid2, "dataset", H5P_DEFAULT)) < 0)
- HDexit(EXIT_FAILURE);
+ /* Open the dataset 2 times */
+ if((child_did1 = H5Dopen2(child_fid1, "dataset", H5P_DEFAULT)) < 0)
+ HDexit(EXIT_FAILURE);
+ if((child_did2 = H5Dopen2(child_fid2, "dataset", H5P_DEFAULT)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Get the dataset's dataspace via did1 */
- if((child_sid = H5Dget_space(child_did1)) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
- HDexit(EXIT_FAILURE);
- if(tdims[0] != 1)
- HDexit(EXIT_FAILURE);
+ /* Get the dataset's dataspace via did1 */
+ if((child_sid = H5Dget_space(child_did1)) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
+ HDexit(EXIT_FAILURE);
+ if(tdims[0] != 1)
+ HDexit(EXIT_FAILURE);
- /* Read from the dataset via did2 */
- if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- HDexit(EXIT_FAILURE);
+ /* Read from the dataset via did2 */
+ if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
+ HDexit(EXIT_FAILURE);
- /* Verify the data is correct */
- if(rbuf[0] != 99)
- HDexit(EXIT_FAILURE);
+ /* Verify the data is correct */
+ if(rbuf[0] != 99)
+ HDexit(EXIT_FAILURE);
- /* Notify parent process */
- child_notify = 2;
- if(HDwrite(in_pdf[1], &child_notify, sizeof(int)) < 0)
- HDexit(EXIT_FAILURE);
+ /* Notify parent process */
+ child_notify = 2;
+ if(HDwrite(in_pdf[1], &child_notify, sizeof(int)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Wait for notification from parent process */
- while(child_notify != 3) {
- if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
- HDexit(EXIT_FAILURE);
- }
+ /* Wait for notification from parent process */
+ while(child_notify != 3)
+ if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Refresh dataset via did1 */
- if(H5Drefresh(child_did1) < 0)
- HDexit(EXIT_FAILURE);
+ /* Refresh dataset via did1 */
+ if(H5Drefresh(child_did1) < 0)
+ HDexit(EXIT_FAILURE);
- /* Get the dataset's dataspace and verify */
- if((child_sid = H5Dget_space(child_did1)) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
- HDexit(EXIT_FAILURE);
+ /* Get the dataset's dataspace and verify */
+ if((child_sid = H5Dget_space(child_did1)) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
+ HDexit(EXIT_FAILURE);
- if(tdims[0] != 2)
- HDexit(EXIT_FAILURE);
+ if(tdims[0] != 2)
+ HDexit(EXIT_FAILURE);
- /* Read from the dataset */
- if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- HDexit(EXIT_FAILURE);
+ /* Read from the dataset */
+ if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
+ HDexit(EXIT_FAILURE);
- /* Verify the data is correct */
- if(rbuf[0] != 100 || rbuf[1] != 100)
- HDexit(EXIT_FAILURE);
+ /* Verify the data is correct */
+ if(rbuf[0] != 100 || rbuf[1] != 100)
+ HDexit(EXIT_FAILURE);
- /* Close the 2 datasets */
- if(H5Dclose(child_did1) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Dclose(child_did2) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close the 2 datasets */
+ if(H5Dclose(child_did1) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Dclose(child_did2) < 0)
+ HDexit(EXIT_FAILURE);
- /* Close the 2 files */
- if(H5Fclose(child_fid1) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Fclose(child_fid2) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close the 2 files */
+ if(H5Fclose(child_fid1) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Fclose(child_fid2) < 0)
+ HDexit(EXIT_FAILURE);
- /* Close the pipes */
- if(HDclose(out_pdf[0]) < 0)
- HDexit(EXIT_FAILURE);
- if(HDclose(in_pdf[1]) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close the pipes */
+ if(HDclose(out_pdf[0]) < 0)
+ HDexit(EXIT_FAILURE);
+ if(HDclose(in_pdf[1]) < 0)
+ HDexit(EXIT_FAILURE);
- HDexit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
}
/* Close unused read end for out_pdf */
@@ -6618,8 +6616,8 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format)
/* Wait for notification from child process */
while(notify != 2) {
- if(HDread(in_pdf[0], &notify, sizeof(int)) < 0)
- FAIL_STACK_ERROR;
+ if(HDread(in_pdf[0], &notify, sizeof(int)) < 0)
+ FAIL_STACK_ERROR;
}
/* Cork the metadata cache, to prevent the object header from being
@@ -7043,7 +7041,7 @@ main(void)
*/
driver = HDgetenv("HDF5_DRIVER");
if(!H5FD_supports_swmr_test(driver)) {
- printf("This VFD does not support SWMR I/O\n");
+ HDprintf("This VFD does not support SWMR I/O\n");
return EXIT_SUCCESS;
} /* end if */
@@ -7133,7 +7131,7 @@ main(void)
if(nerrors)
goto error;
- printf("All tests passed.\n");
+ HDprintf("All tests passed.\n");
h5_cleanup(FILENAME, fapl);
@@ -7141,7 +7139,7 @@ main(void)
error:
nerrors = MAX(1, nerrors);
- printf("***** %d SWMR TEST%s FAILED! *****\n",
+ HDprintf("***** %d SWMR TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
return EXIT_FAILURE;
diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c
index 51caa3d..df984b1 100644
--- a/test/swmr_addrem_writer.c
+++ b/test/swmr_addrem_writer.c
@@ -288,21 +288,21 @@ addrem_records(hid_t fid, unsigned verbose, unsigned long nops, unsigned long fl
static void
usage(void)
{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_addrem_writer [-q] [-f <# of operations between flushing\n");
- printf(" file contents>] [-r <random seed>] <# of operations>\n");
- printf("\n");
- printf("<# of operations between flushing file contents> should be 0 (for\n");
- printf("no flushing) or between 1 and (<# of operations> - 1).\n");
- printf("\n");
- printf("<# of operations> must be specified.\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given), flushing every 1000 operations\n");
- printf("('-f 1000'), and will generate a random seed (no -r given).\n");
- printf("\n");
- HDexit(1);
+ HDprintf("\n");
+ HDprintf("Usage error!\n");
+ HDprintf("\n");
+ HDprintf("Usage: swmr_addrem_writer [-q] [-f <# of operations between flushing\n");
+ HDprintf(" file contents>] [-r <random seed>] <# of operations>\n");
+ HDprintf("\n");
+ HDprintf("<# of operations between flushing file contents> should be 0 (for\n");
+ HDprintf("no flushing) or between 1 and (<# of operations> - 1).\n");
+ HDprintf("\n");
+ HDprintf("<# of operations> must be specified.\n");
+ HDprintf("\n");
+ HDprintf("Defaults to verbose (no '-q' given), flushing every 1000 operations\n");
+ HDprintf("('-f 1000'), and will generate a random seed (no -r given).\n");
+ HDprintf("\n");
+ HDexit(EXIT_FAILURE);
}
int main(int argc, const char *argv[])
@@ -401,7 +401,7 @@ int main(int argc, const char *argv[])
/* Open file skeleton */
if((fid = open_skeleton(FILENAME, verbose)) < 0) {
HDfprintf(stderr, "Error opening skeleton file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Send a message to indicate "H5Fopen" is complete--releasing the file lock */
@@ -414,7 +414,7 @@ int main(int argc, const char *argv[])
/* Grow and shrink datasets */
if(addrem_records(fid, verbose, (unsigned long)nops, (unsigned long)flush_count) < 0) {
HDfprintf(stderr, "Error adding and removing records from datasets!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -424,7 +424,7 @@ int main(int argc, const char *argv[])
/* Clean up the symbols */
if(shutdown_symbols() < 0) {
HDfprintf(stderr, "Error releasing symbols!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -434,7 +434,7 @@ int main(int argc, const char *argv[])
/* Close objects opened */
if(H5Fclose(fid) < 0) {
HDfprintf(stderr, "Error closing file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
return 0;
diff --git a/test/swmr_common.c b/test/swmr_common.c
index a0d79e3..b323769 100644
--- a/test/swmr_common.c
+++ b/test/swmr_common.c
@@ -73,7 +73,7 @@ unsigned symbol_count[NLEVELS] = {100, 200, 400, 800, 1600};
/* Array of dataset information entries (1 per dataset) */
symbol_info_t *symbol_info[NLEVELS];
-
+
/*-------------------------------------------------------------------------
* Function: choose_dataset
*
@@ -101,7 +101,7 @@ choose_dataset(void)
return &symbol_info[level][offset];
} /* end choose_dataset() */
-
+
/*-------------------------------------------------------------------------
* Function: create_symbol_datatype
*
@@ -142,7 +142,7 @@ create_symbol_datatype(void)
return sym_type_id;
} /* end create_symbol_datatype() */
-
+
/*-------------------------------------------------------------------------
* Function: generate_name
*
@@ -161,7 +161,7 @@ create_symbol_datatype(void)
* The dataset's count
*
* Return: Success: 0
- *
+ *
* Failure: Can't fail
*
*-------------------------------------------------------------------------
@@ -170,13 +170,13 @@ int
generate_name(char *name_buf, unsigned level, unsigned count)
{
HDassert(name_buf);
-
- sprintf(name_buf, "%u-%04u", level, count);
+
+ HDsprintf(name_buf, "%u-%04u", level, count);
return 0;
} /* end generate_name() */
-
+
/*-------------------------------------------------------------------------
* Function: generate_symbols
*
@@ -210,7 +210,7 @@ generate_symbols(void)
return 0;
} /* end generate_symbols() */
-
+
/*-------------------------------------------------------------------------
* Function: shutdown_symbols
*
@@ -238,7 +238,7 @@ shutdown_symbols(void)
return 0;
} /* end shutdown_symbols() */
-
+
/*-------------------------------------------------------------------------
* Function: print_metadata_retries_info
*
@@ -273,7 +273,7 @@ print_metadata_retries_info(hid_t fid)
power = 1;
for(j = 0; j < info.nbins; j++) {
if(info.retries[i][j])
- HDfprintf(stderr, "\t# of retries for %u - %u retries: %u\n",
+ HDfprintf(stderr, "\t# of retries for %u - %u retries: %u\n",
power, (power * 10) - 1, info.retries[i][j]);
power *= 10;
} /* end for */
diff --git a/test/swmr_generator.c b/test/swmr_generator.c
index 1c2ec04..1e00f1d 100644
--- a/test/swmr_generator.c
+++ b/test/swmr_generator.c
@@ -266,24 +266,24 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t swmr_write,
static void
usage(void)
{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_generator [-q] [-s] [-c <deflate compression level>]\n");
- printf(" [-i <index type>] [-r <random seed>]\n");
- printf("\n");
- printf("NOTE: The random seed option is only used by the sparse test. Other\n");
- printf(" tests specify the random seed as a reader/writer option.\n");
- printf("\n");
- printf("<deflate compression level> should be -1 (for no compression) or 0-9\n");
- printf("\n");
- printf("<index type> should be b2 or ea\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given), no SWMR_WRITE mode (no '-s' given) no\n");
- printf("compression ('-c -1'), v1 b-tree indexing (-i b1), and will generate a random\n");
- printf("seed (no -r given).\n");
- printf("\n");
- HDexit(1);
+ HDprintf("\n");
+ HDprintf("Usage error!\n");
+ HDprintf("\n");
+ HDprintf("Usage: swmr_generator [-q] [-s] [-c <deflate compression level>]\n");
+ HDprintf(" [-i <index type>] [-r <random seed>]\n");
+ HDprintf("\n");
+ HDprintf("NOTE: The random seed option is only used by the sparse test. Other\n");
+ HDprintf(" tests specify the random seed as a reader/writer option.\n");
+ HDprintf("\n");
+ HDprintf("<deflate compression level> should be -1 (for no compression) or 0-9\n");
+ HDprintf("\n");
+ HDprintf("<index type> should be b2 or ea\n");
+ HDprintf("\n");
+ HDprintf("Defaults to verbose (no '-q' given), no SWMR_WRITE mode (no '-s' given) no\n");
+ HDprintf("compression ('-c -1'), v1 b-tree indexing (-i b1), and will generate a random\n");
+ HDprintf("seed (no -r given).\n");
+ HDprintf("\n");
+ HDexit(EXIT_FAILURE);
} /* end usage() */
int main(int argc, const char *argv[])
@@ -377,7 +377,7 @@ int main(int argc, const char *argv[])
/* Generate file skeleton */
if(gen_skeleton(FILENAME, verbose, swmr_write, comp_level, index_type, random_seed) < 0) {
HDfprintf(stderr, "Error generating skeleton file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
return 0;
diff --git a/test/swmr_reader.c b/test/swmr_reader.c
index e181d3a..cb354a7 100644
--- a/test/swmr_reader.c
+++ b/test/swmr_reader.c
@@ -371,20 +371,20 @@ read_records(const char *filename, hbool_t verbose, FILE *verbose_file,
static void
usage(void)
{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_reader [-q] [-s <# of seconds to sleep between polling>]\n");
- printf(" [-h <# of common symbols to poll>] [-l <# of random symbols to poll>]\n");
- printf(" [-r <random seed>] <# of seconds to test>\n");
- printf("\n");
- printf("<# of seconds to test> must be specified.\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given), 1 second between polling ('-s 1'),\n");
- printf("5 common symbols to poll ('-h 5'), 10 random symbols to poll ('-l 10'),\n");
- printf("and will generate a random seed (no -r given).\n");
- printf("\n");
- HDexit(1);
+ HDprintf("\n");
+ HDprintf("Usage error!\n");
+ HDprintf("\n");
+ HDprintf("Usage: swmr_reader [-q] [-s <# of seconds to sleep between polling>]\n");
+ HDprintf(" [-h <# of common symbols to poll>] [-l <# of random symbols to poll>]\n");
+ HDprintf(" [-r <random seed>] <# of seconds to test>\n");
+ HDprintf("\n");
+ HDprintf("<# of seconds to test> must be specified.\n");
+ HDprintf("\n");
+ HDprintf("Defaults to verbose (no '-q' given), 1 second between polling ('-s 1'),\n");
+ HDprintf("5 common symbols to poll ('-h 5'), 10 random symbols to poll ('-l 10'),\n");
+ HDprintf("and will generate a random seed (no -r given).\n");
+ HDprintf("\n");
+ HDexit(EXIT_FAILURE);
}
int main(int argc, const char *argv[])
@@ -485,7 +485,7 @@ int main(int argc, const char *argv[])
HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_reader.out.%u", random_seed);
if(NULL == (verbose_file = HDfopen(verbose_name, "w"))) {
HDfprintf(stderr, "Can't open verbose output file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
}
} /* end if */
@@ -508,7 +508,7 @@ int main(int argc, const char *argv[])
/* Generate dataset names */
if(generate_symbols() < 0) {
HDfprintf(stderr, "Error generating symbol names!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Create datatype for creating datasets */
@@ -518,7 +518,7 @@ int main(int argc, const char *argv[])
/* Reading records from datasets */
if(read_records(FILENAME, verbose, verbose_file, random_seed, (unsigned long)nseconds, (unsigned)poll_time, (unsigned)ncommon, (unsigned)nrandom) < 0) {
HDfprintf(stderr, "Error reading records from datasets (random_seed = %u)!\n", random_seed);
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -528,7 +528,7 @@ int main(int argc, const char *argv[])
/* Clean up the symbols */
if(shutdown_symbols() < 0) {
HDfprintf(stderr, "Error releasing symbols!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -538,7 +538,7 @@ int main(int argc, const char *argv[])
/* Close objects created */
if(H5Tclose(symbol_tid) < 0) {
HDfprintf(stderr, "Error closing symbol datatype!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
return 0;
diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c
index 1fae5e7..9ca6045 100644
--- a/test/swmr_remove_reader.c
+++ b/test/swmr_remove_reader.c
@@ -359,18 +359,18 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds,
static void
usage(void)
{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_remove_reader [-q] [-s <# of seconds to sleep between\n");
- printf(" polling>] [-h <# of common symbols to poll>] [-l <# of random symbols\n");
- printf(" to poll>] [-r <random seed>] <# of seconds to test>\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given), 1 second between polling ('-s 1'),\n");
- printf("5 common symbols to poll ('-h 5'), 10 random symbols to poll ('-l 10'),\n");
- printf("and will generate a random seed (no -r given).\n");
- printf("\n");
- HDexit(1);
+ HDprintf("\n");
+ HDprintf("Usage error!\n");
+ HDprintf("\n");
+ HDprintf("Usage: swmr_remove_reader [-q] [-s <# of seconds to sleep between\n");
+ HDprintf(" polling>] [-h <# of common symbols to poll>] [-l <# of random symbols\n");
+ HDprintf(" to poll>] [-r <random seed>] <# of seconds to test>\n");
+ HDprintf("\n");
+ HDprintf("Defaults to verbose (no '-q' given), 1 second between polling ('-s 1'),\n");
+ HDprintf("5 common symbols to poll ('-h 5'), 10 random symbols to poll ('-l 10'),\n");
+ HDprintf("and will generate a random seed (no -r given).\n");
+ HDprintf("\n");
+ HDexit(EXIT_FAILURE);
}
int main(int argc, const char *argv[])
@@ -480,7 +480,7 @@ int main(int argc, const char *argv[])
/* Generate dataset names */
if(generate_symbols() < 0) {
HDfprintf(stderr, "Error generating symbol names!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Create datatype for creating datasets */
@@ -490,7 +490,7 @@ int main(int argc, const char *argv[])
/* Reading records from datasets */
if(read_records(FILENAME, verbose, (unsigned long)nseconds, (unsigned)poll_time, (unsigned)ncommon, (unsigned)nrandom) < 0) {
HDfprintf(stderr, "Error reading records from datasets!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -500,7 +500,7 @@ int main(int argc, const char *argv[])
/* Clean up the symbols */
if(shutdown_symbols() < 0) {
HDfprintf(stderr, "Error releasing symbols!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -510,7 +510,7 @@ int main(int argc, const char *argv[])
/* Close objects created */
if(H5Tclose(symbol_tid) < 0) {
HDfprintf(stderr, "Error closing symbol datatype!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
return 0;
diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c
index 43743d9..e6d23de 100644
--- a/test/swmr_remove_writer.c
+++ b/test/swmr_remove_writer.c
@@ -224,19 +224,19 @@ remove_records(hid_t fid, unsigned verbose, unsigned long nshrinks, unsigned lon
static void
usage(void)
{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_remove_writer [-q] [-o] [-f <# of shrinks between flushing\n");
- printf(" file contents>] [-r <random seed>] <# of shrinks>\n");
- printf("\n");
- printf("<# of shrinks between flushing file contents> should be 0 (for no\n");
- printf("flushing) or between 1 and (<# of shrinks> - 1)\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given), latest format when opening file (no '-o' given),\n");
- printf("flushing every 1000 shrinks ('-f 1000'), and will generate a random seed (no -r given).\n");
- printf("\n");
- HDexit(1);
+ HDprintf("\n");
+ HDprintf("Usage error!\n");
+ HDprintf("\n");
+ HDprintf("Usage: swmr_remove_writer [-q] [-o] [-f <# of shrinks between flushing\n");
+ HDprintf(" file contents>] [-r <random seed>] <# of shrinks>\n");
+ HDprintf("\n");
+ HDprintf("<# of shrinks between flushing file contents> should be 0 (for no\n");
+ HDprintf("flushing) or between 1 and (<# of shrinks> - 1)\n");
+ HDprintf("\n");
+ HDprintf("Defaults to verbose (no '-q' given), latest format when opening file (no '-o' given),\n");
+ HDprintf("flushing every 1000 shrinks ('-f 1000'), and will generate a random seed (no -r given).\n");
+ HDprintf("\n");
+ HDexit(EXIT_FAILURE);
}
int main(int argc, const char *argv[])
@@ -339,7 +339,7 @@ int main(int argc, const char *argv[])
/* Open file skeleton */
if((fid = open_skeleton(FILENAME, verbose, old)) < 0) {
HDfprintf(stderr, "Error opening skeleton file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Send a message to indicate "H5Fopen" is complete--releasing the file lock */
@@ -352,7 +352,7 @@ int main(int argc, const char *argv[])
/* Remove records from datasets */
if(remove_records(fid, verbose, (unsigned long)nshrinks, (unsigned long)flush_count) < 0) {
HDfprintf(stderr, "Error removing records from datasets!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -362,7 +362,7 @@ int main(int argc, const char *argv[])
/* Clean up the symbols */
if(shutdown_symbols() < 0) {
HDfprintf(stderr, "Error releasing symbols!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -372,7 +372,7 @@ int main(int argc, const char *argv[])
/* Close objects opened */
if(H5Fclose(fid) < 0) {
HDfprintf(stderr, "Error closing file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
return 0;
diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c
index 3c98f48..6adc6c5 100644
--- a/test/swmr_sparse_reader.c
+++ b/test/swmr_sparse_reader.c
@@ -326,19 +326,19 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords,
static void
usage(void)
{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_sparse_reader [-q] [-s <# of seconds to wait for writer>]\n");
- printf(" [-n <# of reads between reopens>] <# of records>\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given), 1 second wait ('-s 1') and 1 read\n");
- printf("between reopens ('-r 1')\n");
- printf("\n");
- printf("Note that the # of records *must* be the same as that supplied to\n");
- printf("swmr_sparse_writer\n");
- printf("\n");
- HDexit(1);
+ HDprintf("\n");
+ HDprintf("Usage error!\n");
+ HDprintf("\n");
+ HDprintf("Usage: swmr_sparse_reader [-q] [-s <# of seconds to wait for writer>]\n");
+ HDprintf(" [-n <# of reads between reopens>] <# of records>\n");
+ HDprintf("\n");
+ HDprintf("Defaults to verbose (no '-q' given), 1 second wait ('-s 1') and 1 read\n");
+ HDprintf("between reopens ('-r 1')\n");
+ HDprintf("\n");
+ HDprintf("Note that the # of records *must* be the same as that supplied to\n");
+ HDprintf("swmr_sparse_writer\n");
+ HDprintf("\n");
+ HDexit(EXIT_FAILURE);
} /* end usage() */
int main(int argc, const char *argv[])
@@ -410,7 +410,7 @@ int main(int argc, const char *argv[])
/* Generate dataset names */
if(generate_symbols() < 0) {
HDfprintf(stderr, "Error generating symbol names!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Create datatype for creating datasets */
@@ -420,7 +420,7 @@ int main(int argc, const char *argv[])
/* Reading records from datasets */
if(read_records(FILENAME, verbose, (unsigned long) nrecords, (unsigned)poll_time, (unsigned)reopen_count) < 0) {
HDfprintf(stderr, "Error reading records from datasets!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -430,7 +430,7 @@ int main(int argc, const char *argv[])
/* Clean up the symbols */
if(shutdown_symbols() < 0) {
HDfprintf(stderr, "Error releasing symbols!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -440,7 +440,7 @@ int main(int argc, const char *argv[])
/* Close objects created */
if(H5Tclose(symbol_tid) < 0) {
HDfprintf(stderr, "Error closing symbol datatype!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
return 0;
diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c
index e46f54c..5173c71 100644
--- a/test/swmr_sparse_writer.c
+++ b/test/swmr_sparse_writer.c
@@ -49,7 +49,7 @@ static int add_records(hid_t fid, unsigned verbose, unsigned long nrecords,
static void usage(void);
-
+
/*-------------------------------------------------------------------------
* Function: open_skeleton
*
@@ -117,7 +117,7 @@ open_skeleton(const char *filename, unsigned verbose)
/* Emit informational message */
if(verbose)
- fprintf(stderr, "Opening datasets\n");
+ HDfprintf(stderr, "Opening datasets\n");
/* Seed the random number generator with the attribute in the file */
if((aid = H5Aopen(fid, "seed", H5P_DEFAULT)) < 0)
@@ -139,7 +139,7 @@ open_skeleton(const char *filename, unsigned verbose)
return fid;
}
-
+
/*-------------------------------------------------------------------------
* Function: add_records
*
@@ -311,7 +311,7 @@ add_records(hid_t fid, unsigned verbose, unsigned long nrecords, unsigned long f
/* Emit informational message */
if(verbose)
- fprintf(stderr, "Closing datasets\n");
+ HDfprintf(stderr, "Closing datasets\n");
/* Close the datasets */
for(u = 0; u < NLEVELS; u++)
@@ -325,19 +325,19 @@ add_records(hid_t fid, unsigned verbose, unsigned long nrecords, unsigned long f
static void
usage(void)
{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_sparse_writer [-q] [-f <# of records to write between\n");
- printf(" flushing file contents>] <# of records>\n");
- printf("\n");
- printf("<# of records to write between flushing file contents> should be 0\n");
- printf("(for no flushing) or between 1 and (<# of records> - 1)\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given) and flushing every 1000 records\n");
- printf("('-f 1000')\n");
- printf("\n");
- HDexit(1);
+ HDprintf("\n");
+ HDprintf("Usage error!\n");
+ HDprintf("\n");
+ HDprintf("Usage: swmr_sparse_writer [-q] [-f <# of records to write between\n");
+ HDprintf(" flushing file contents>] <# of records>\n");
+ HDprintf("\n");
+ HDprintf("<# of records to write between flushing file contents> should be 0\n");
+ HDprintf("(for no flushing) or between 1 and (<# of records> - 1)\n");
+ HDprintf("\n");
+ HDprintf("Defaults to verbose (no '-q' given) and flushing every 1000 records\n");
+ HDprintf("('-f 1000')\n");
+ HDprintf("\n");
+ HDexit(EXIT_FAILURE);
}
int main(int argc, const char *argv[])
@@ -412,7 +412,7 @@ int main(int argc, const char *argv[])
/* Open file skeleton */
if((fid = open_skeleton(FILENAME, verbose)) < 0) {
HDfprintf(stderr, "Error opening skeleton file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Send a message to indicate "H5Fopen" is complete--releasing the file lock */
@@ -425,7 +425,7 @@ int main(int argc, const char *argv[])
/* Append records to datasets */
if(add_records(fid, verbose, (unsigned long)nrecords, (unsigned long)flush_count) < 0) {
HDfprintf(stderr, "Error appending records to datasets!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -435,7 +435,7 @@ int main(int argc, const char *argv[])
/* Clean up the symbols */
if(shutdown_symbols() < 0) {
HDfprintf(stderr, "Error releasing symbols!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -445,7 +445,7 @@ int main(int argc, const char *argv[])
/* Close objects opened */
if(H5Fclose(fid) < 0) {
HDfprintf(stderr, "Error closing file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
return 0;
diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c
index af4b743..c4222ad 100644
--- a/test/swmr_start_write.c
+++ b/test/swmr_start_write.c
@@ -337,27 +337,27 @@ add_records(hid_t fid, hbool_t verbose, FILE *verbose_file,
static void
usage(void)
{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_start_write [-f <# of records to write between flushing file contents>]\n");
- printf(" [-i <index type>] [-c <deflate compression level>]\n");
- printf(" [-r <random seed>] [-q] <# of records>\n");
- printf("\n");
- printf("<# of records to write between flushing file contents> should be 0\n");
- printf("(for no flushing) or between 1 and (<# of records> - 1).\n");
- printf("\n");
- printf("<index type> should be b2 or ea\n");
- printf("\n");
- printf("<deflate compression level> should be -1 (for no compression) or 0-9\n");
- printf("\n");
- printf("<# of records> must be specified.\n");
- printf("\n");
- printf("Defaults to flushing every 10000 records ('-f 10000'),\n");
- printf("v1 b-tree indexing (-i b1), compression ('-c -1'),\n");
- printf("will generate a random seed (no -r given), and verbose (no '-q' given)\n");
- printf("\n");
- HDexit(1);
+ HDprintf("\n");
+ HDprintf("Usage error!\n");
+ HDprintf("\n");
+ HDprintf("Usage: swmr_start_write [-f <# of records to write between flushing file contents>]\n");
+ HDprintf(" [-i <index type>] [-c <deflate compression level>]\n");
+ HDprintf(" [-r <random seed>] [-q] <# of records>\n");
+ HDprintf("\n");
+ HDprintf("<# of records to write between flushing file contents> should be 0\n");
+ HDprintf("(for no flushing) or between 1 and (<# of records> - 1).\n");
+ HDprintf("\n");
+ HDprintf("<index type> should be b2 or ea\n");
+ HDprintf("\n");
+ HDprintf("<deflate compression level> should be -1 (for no compression) or 0-9\n");
+ HDprintf("\n");
+ HDprintf("<# of records> must be specified.\n");
+ HDprintf("\n");
+ HDprintf("Defaults to flushing every 10000 records ('-f 10000'),\n");
+ HDprintf("v1 b-tree indexing (-i b1), compression ('-c -1'),\n");
+ HDprintf("will generate a random seed (no -r given), and verbose (no '-q' given)\n");
+ HDprintf("\n");
+ HDexit(EXIT_FAILURE);
} /* usage() */
/*
@@ -468,7 +468,7 @@ int main(int argc, const char *argv[])
HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_writer.out.%u", random_seed);
if(NULL == (verbose_file = HDfopen(verbose_name, "w"))) {
HDfprintf(stderr, "Can't open verbose output file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
}
} /* end if */
@@ -487,7 +487,7 @@ int main(int argc, const char *argv[])
/* Create the test file */
if((fid = create_file(FILENAME, verbose, verbose_file, random_seed)) < 0) {
HDfprintf(stderr, "Error creating the file...\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
}
/* Emit informational message */
@@ -501,13 +501,13 @@ int main(int argc, const char *argv[])
/* Create the datasets in the file */
if(create_datasets(fid, comp_level, verbose, verbose_file, index_type) < 0) {
HDfprintf(stderr, "Error creating datasets...\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
}
/* Enable SWMR writing mode */
if(H5Fstart_swmr_write(fid) < 0) {
HDfprintf(stderr, "Error starting SWMR writing mode...\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
}
/* Send a message to indicate "H5Fopen" is complete--releasing the file lock */
@@ -520,7 +520,7 @@ int main(int argc, const char *argv[])
/* Append records to datasets */
if(add_records(fid, verbose, verbose_file, (unsigned long)nrecords, (unsigned long)flush_count) < 0) {
HDfprintf(stderr, "Error appending records to datasets!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -530,7 +530,7 @@ int main(int argc, const char *argv[])
/* Clean up the symbols */
if(shutdown_symbols() < 0) {
HDfprintf(stderr, "Error releasing symbols!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -540,7 +540,7 @@ int main(int argc, const char *argv[])
/* Close objects opened */
if(H5Fclose(fid) < 0) {
HDfprintf(stderr, "Error closing file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
return 0;
diff --git a/test/swmr_writer.c b/test/swmr_writer.c
index ee7e32e..4c3e64a 100644
--- a/test/swmr_writer.c
+++ b/test/swmr_writer.c
@@ -277,21 +277,21 @@ add_records(hid_t fid, hbool_t verbose, FILE *verbose_file,
static void
usage(void)
{
- printf("\n");
- printf("Usage error!\n");
- printf("\n");
- printf("Usage: swmr_writer [-q] [-o] [-f <# of records to write between flushing\n");
- printf(" file contents>] [-r <random seed>] <# of records>\n");
- printf("\n");
- printf("<# of records to write between flushing file contents> should be 0\n");
- printf("(for no flushing) or between 1 and (<# of records> - 1).\n");
- printf("\n");
- printf("<# of records> must be specified.\n");
- printf("\n");
- printf("Defaults to verbose (no '-q' given), latest format when opening file (no '-o' given),\n");
- printf("flushing every 10000 records ('-f 10000'), and will generate a random seed (no -r given).\n");
- printf("\n");
- HDexit(1);
+ HDprintf("\n");
+ HDprintf("Usage error!\n");
+ HDprintf("\n");
+ HDprintf("Usage: swmr_writer [-q] [-o] [-f <# of records to write between flushing\n");
+ HDprintf(" file contents>] [-r <random seed>] <# of records>\n");
+ HDprintf("\n");
+ HDprintf("<# of records to write between flushing file contents> should be 0\n");
+ HDprintf("(for no flushing) or between 1 and (<# of records> - 1).\n");
+ HDprintf("\n");
+ HDprintf("<# of records> must be specified.\n");
+ HDprintf("\n");
+ HDprintf("Defaults to verbose (no '-q' given), latest format when opening file (no '-o' given),\n");
+ HDprintf("flushing every 10000 records ('-f 10000'), and will generate a random seed (no -r given).\n");
+ HDprintf("\n");
+ HDexit(EXIT_FAILURE);
}
int main(int argc, const char *argv[])
@@ -379,7 +379,7 @@ int main(int argc, const char *argv[])
HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_writer.out.%u", random_seed);
if(NULL == (verbose_file = HDfopen(verbose_name, "w"))) {
HDfprintf(stderr, "Can't open verbose output file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
}
} /* end if */
@@ -408,7 +408,7 @@ int main(int argc, const char *argv[])
/* Open file skeleton */
if((fid = open_skeleton(FILENAME, verbose, verbose_file, random_seed, old)) < 0) {
HDfprintf(stderr, "Error opening skeleton file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Send a message to indicate "H5Fopen" is complete--releasing the file lock */
@@ -421,7 +421,7 @@ int main(int argc, const char *argv[])
/* Append records to datasets */
if(add_records(fid, verbose, verbose_file, (unsigned long)nrecords, (unsigned long)flush_count) < 0) {
HDfprintf(stderr, "Error appending records to datasets!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -431,7 +431,7 @@ int main(int argc, const char *argv[])
/* Clean up the symbols */
if(shutdown_symbols() < 0) {
HDfprintf(stderr, "Error releasing symbols!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Emit informational message */
@@ -441,7 +441,7 @@ int main(int argc, const char *argv[])
/* Close objects opened */
if(H5Fclose(fid) < 0) {
HDfprintf(stderr, "Error closing file!\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
return 0;
diff --git a/test/tarray.c b/test/tarray.c
index 99f7bf8..0024746 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -26,8 +26,8 @@
#define TESTFILE "tarrold.h5"
/* 1-D array datatype */
-#define ARRAY1_RANK 1
-#define ARRAY1_DIM1 4
+#define ARRAY1_RANK 1
+#define ARRAY1_DIM1 4
/* 3-D array datatype */
#define ARRAY2_RANK 3
@@ -1074,7 +1074,7 @@ test_array_free_custom(void *_mem, void *info)
if(_mem != NULL) {
mem = ((unsigned char *)_mem) - extra;
- *mem_used -= *(size_t *)mem;
+ *mem_used -= *(size_t *)((void *)mem);
HDfree(mem);
} /* end if */
@@ -1341,7 +1341,7 @@ test_array_vlen_array(void)
for(k=0; k<(i+j+1); k++)
for(l=0; l<ARRAY1_DIM1; l++)
((unsigned int *)wdata[i][j].p)[k*ARRAY1_DIM1+l] = (unsigned int)(i*1000+j*100+k*10+l);
- } /* end for */
+ }
/* Create file */
fid1 = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1580,9 +1580,9 @@ test_array_bkg(void)
unsigned ndims[3] = {1,1,1};
typedef struct {
- int a[ALEN];
- float b[ALEN];
- double c[ALEN];
+ int a[ALEN];
+ float b[ALEN];
+ double c[ALEN];
} CmpField;
CmpField cf[LENGTH];
@@ -2146,7 +2146,7 @@ test_compat(void)
CHECK_I(ret, "H5Fclose");
} /* end if */
else
- printf("***cannot open the pre-created compound datatype test file (%s)\n",testfile);
+ HDprintf("***cannot open the pre-created compound datatype test file (%s)\n",testfile);
} /* end test_compat() */
diff --git a/test/tattr.c b/test/tattr.c
index 9b6ae90..5d35e41 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -571,107 +571,118 @@ test_attr_flush(hid_t fapl)
static void
test_attr_plist(hid_t fapl)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t plist; /* Property list ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {ATTR1_DIM1};
- H5T_cset_t cset; /* Character set for attributes */
- herr_t ret; /* Generic return value */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t dsid = H5I_INVALID_HID; /* Dataspace ID (for dataset) */
+ hid_t asid = H5I_INVALID_HID; /* Dataspace ID (for attribute) */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
+ hid_t acpl_id = H5I_INVALID_HID; /* Attribute creation property list ID */
+ hid_t aapl_id = H5I_INVALID_HID; /* Attribute access property list ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {ATTR1_DIM1};
+ H5T_cset_t cset; /* Character set for attributes */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Attribute Property Lists\n"));
/* Create file */
- fid1 = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- CHECK(fid1, FAIL, "H5Fcreate");
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
/* Create dataspace for dataset */
- sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
- CHECK(sid1, FAIL, "H5Screate_simple");
+ dsid = H5Screate_simple(SPACE1_RANK, dims1, NULL);
+ CHECK(dsid, H5I_INVALID_HID, "H5Screate_simple");
/* Create a dataset */
- dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
+ did = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, dsid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
/* Create dataspace for attribute */
- sid2 = H5Screate_simple(ATTR1_RANK, dims2, NULL);
- CHECK(sid2, FAIL, "H5Screate_simple");
+ asid = H5Screate_simple(ATTR1_RANK, dims2, NULL);
+ CHECK(asid, H5I_INVALID_HID, "H5Screate_simple");
- /* Create default property list for attribute */
- plist = H5Pcreate(H5P_ATTRIBUTE_CREATE);
- CHECK(plist, FAIL, "H5Pcreate");
+ /* Create default creation property list for attribute */
+ acpl_id = H5Pcreate(H5P_ATTRIBUTE_CREATE);
+ CHECK(acpl_id, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Create default access property list for attribute
+ * This currently has no properties, but we need to test its creation
+ * and use.
+ */
+ aapl_id = H5Pcreate(H5P_ATTRIBUTE_ACCESS);
+ CHECK(aapl_id, H5I_INVALID_HID, "H5Pcreate");
/* Get the character encoding and ensure that it is the default (ASCII) */
- ret = H5Pget_char_encoding(plist, &cset);
+ ret = H5Pget_char_encoding(acpl_id, &cset);
CHECK(ret, FAIL, "H5Pget_char_encoding");
VERIFY(cset, H5T_CSET_ASCII, "H5Pget_char_encoding");
/* Create an attribute for the dataset using the property list */
- attr = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, plist, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate2");
+ aid = H5Acreate2(did, ATTR1_NAME, H5T_NATIVE_INT, asid, acpl_id, aapl_id);
+ CHECK(aid, H5I_INVALID_HID, "H5Acreate2");
- /* Close the property list, and get the attribute's property list */
- ret = H5Pclose(plist);
+ /* Close the property list, and get the attribute's creation property list */
+ ret = H5Pclose(acpl_id);
CHECK(ret, FAIL, "H5Pclose");
- plist = H5Aget_create_plist(attr);
- CHECK(plist, FAIL, "H5Aget_create_plist");
+ acpl_id = H5Aget_create_plist(aid);
+ CHECK(acpl_id, H5I_INVALID_HID, "H5Aget_create_plist");
/* Get the character encoding and ensure that it is the default (ASCII) */
- ret = H5Pget_char_encoding(plist, &cset);
+ ret = H5Pget_char_encoding(acpl_id, &cset);
CHECK(ret, FAIL, "H5Pget_char_encoding");
VERIFY(cset, H5T_CSET_ASCII, "H5Pget_char_encoding");
/* Close the property list and attribute */
- ret = H5Pclose(plist);
+ ret = H5Pclose(acpl_id);
CHECK(ret, FAIL, "H5Pclose");
- ret = H5Aclose(attr);
+ ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
/* Create a new property list and modify it to use a different encoding */
- plist = H5Pcreate(H5P_ATTRIBUTE_CREATE);
- CHECK(plist, FAIL, "H5Pcreate");
- ret = H5Pset_char_encoding(plist, H5T_CSET_UTF8);
+ acpl_id = H5Pcreate(H5P_ATTRIBUTE_CREATE);
+ CHECK(acpl_id, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_char_encoding(acpl_id, H5T_CSET_UTF8);
CHECK(ret, FAIL, "H5Pset_char_encoding");
/* Get the character encoding and ensure that it has been changed */
- ret = H5Pget_char_encoding(plist, &cset);
+ ret = H5Pget_char_encoding(acpl_id, &cset);
CHECK(ret, FAIL, "H5Pget_char_encoding");
VERIFY(cset, H5T_CSET_UTF8, "H5Pget_char_encoding");
/* Create an attribute for the dataset using the modified property list */
- attr = H5Acreate2(dataset, ATTR2_NAME, H5T_NATIVE_INT, sid2, plist, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate2");
+ aid = H5Acreate2(did, ATTR2_NAME, H5T_NATIVE_INT, asid, acpl_id, aapl_id);
+ CHECK(aid, H5I_INVALID_HID, "H5Acreate2");
/* Close the property list and attribute */
- ret = H5Pclose(plist);
+ ret = H5Pclose(acpl_id);
CHECK(ret, FAIL, "H5Pclose");
- ret = H5Aclose(attr);
+ ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
/* Re-open the second attribute and ensure that its character encoding is correct */
- attr = H5Aopen(dataset, ATTR2_NAME, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Aopen");
- plist = H5Aget_create_plist(attr);
- CHECK(plist, FAIL, "H5Aget_create_plist");
- ret = H5Pget_char_encoding(plist, &cset);
+ aid = H5Aopen(did, ATTR2_NAME, H5P_DEFAULT);
+ CHECK(aid, H5I_INVALID_HID, "H5Aopen");
+ acpl_id = H5Aget_create_plist(aid);
+ CHECK(acpl_id, H5I_INVALID_HID, "H5Aget_create_plist");
+ ret = H5Pget_char_encoding(acpl_id, &cset);
CHECK(ret, FAIL, "H5Pget_char_encoding");
VERIFY(cset, H5T_CSET_UTF8, "H5Pget_char_encoding");
/* Close everything */
- ret=H5Sclose(sid1);
+ ret = H5Sclose(dsid);
CHECK(ret, FAIL, "H5Sclose");
- ret=H5Sclose(sid2);
+ ret = H5Sclose(asid);
CHECK(ret, FAIL, "H5Sclose");
- ret = H5Pclose(plist);
+ ret = H5Pclose(aapl_id);
CHECK(ret, FAIL, "H5Pclose");
- ret=H5Aclose(attr);
+ ret = H5Pclose(acpl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
- ret=H5Dclose(dataset);
+ ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- ret=H5Fclose(fid1);
+ ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_plist() */
@@ -886,8 +897,8 @@ test_attr_compound_read(hid_t fapl)
for(i = 0; i < ATTR4_DIM1; i++)
for(j = 0; j < ATTR4_DIM2; j++)
if(HDmemcmp(&attr_data4[i][j], &read_data4[i][j], sizeof(struct attr4_struct))) {
- printf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", __LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i);
- printf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", __LINE__, i, j, attr_data4[i][j].d, i, j, read_data4[i][j].d);
+ HDprintf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", __LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i);
+ HDprintf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", __LINE__, i, j, attr_data4[i][j].d, i, j, read_data4[i][j].d);
TestErrPrintf("%d: attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n", __LINE__, i, j, attr_data4[i][j].c, i, j, read_data4[i][j].c);
} /* end if */
@@ -1024,7 +1035,7 @@ test_attr_scalar_read(hid_t fapl)
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_FLT_ABS_EQUAL(rdata, attr_data5))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__);
/* Get the attribute's dataspace */
@@ -1664,7 +1675,6 @@ test_attr_dtype_shared(hid_t fapl)
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
-
/* Re-open file */
file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
CHECK(file_id, FAIL, "H5Fopen");
@@ -2071,7 +2081,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr)
/* Re-open all the attributes by name and verify the data */
for(u = 0; u < max_attr; u++) {
/* Open attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Aopen(loc_id, attrname, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Aopen");
@@ -2095,7 +2105,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr)
CHECK(attr, FAIL, "H5Aopen_by_idx");
/* Verify Name */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, check_name);
VERIFY(name_len, HDstrlen(attrname), "H5Aget_name");
if(HDstrcmp(check_name, attrname))
@@ -2166,9 +2176,14 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -2189,7 +2204,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
/* Add attributes, until just before converting to dense storage */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2208,7 +2223,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
/* Add one more attribute, to push into "dense" storage */
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2297,9 +2312,14 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Enable creation order tracking on attributes, so creation order tests work */
ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED);
@@ -2324,7 +2344,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
/* Add attributes, until just before converting to dense storage */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2347,7 +2367,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
/* Add one more attribute, to push into "dense" storage */
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2417,7 +2437,6 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
/* Output message about test being performed */
MESSAGE(5, ("Testing Deleting Attributes in Dense Storage\n"));
- /* Create file */
if (use_min_dset_oh) { /* using minimized dataset headers */
/* modify fcpl...
* sidestep "bug" where file space is lost with minimized dset ohdrs
@@ -2432,7 +2451,6 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
if (use_min_dset_oh)
CHECK(H5Pclose(fcpl), FAIL, "H5Pclose");
-
/* Close file */
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
@@ -2450,9 +2468,14 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = (use_min_dset_oh) ? H5Pcopy(dcpl_g) : H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (use_min_dset_oh) {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ } else {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ }
/* Enable creation order tracking on attributes, so creation order tests work */
ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED);
@@ -2477,7 +2500,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
/* Add attributes, until well into dense storage */
for(u = 0; u < (max_compact * 2); u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2523,7 +2546,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
/* Delete attributes until the attributes revert to compact storage again */
for(u--; u >= min_dense; u--) {
/* Delete attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -2537,7 +2560,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
/* Delete one more attribute, which should cause reversion to compact storage */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -2550,7 +2573,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "test_attr_dense_verify");
/* Delete another attribute, to verify deletion in compact storage */
- sprintf(attrname, "attr %02u", (u - 1));
+ HDsprintf(attrname, "attr %02u", (u - 1));
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -2604,12 +2627,12 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
H5O_info_t oinfo; /* Object info */
unsigned u; /* Local index variable */
int use_min_dset_oh = (dcpl_g != H5P_DEFAULT);
+ unsigned use_corder; /* Track creation order or not */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Renaming Attributes in Dense Storage\n"));
- /* Create file */
if (use_min_dset_oh) { /* using minimized dataset headers */
/* modify fcpl...
* sidestep "bug" where file space is lost with minimized dset ohdrs
@@ -2620,7 +2643,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pset_file_space_strategy");
}
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
if (use_min_dset_oh)
CHECK(H5Pclose(fcpl), FAIL, "H5Pclose");
@@ -2635,71 +2658,92 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
/* Re-open file */
fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
- CHECK(fid, FAIL, "H5Fopen");
+ CHECK(fid, H5I_INVALID_HID, "H5Fopen");
/* Create dataspace for dataset */
sid = H5Screate(H5S_SCALAR);
- CHECK(sid, FAIL, "H5Screate");
-
- /* Query the group creation properties */
- dcpl = (use_min_dset_oh) ? H5Pcopy(dcpl_g) : H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
-
- /* Create a dataset */
- dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
+
+ /* need DCPL to query the group creation properties */
+ if (use_min_dset_oh) {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcopy");
+ } else {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate");
+ }
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
CHECK(ret, FAIL, "H5Pget_attr_phase_change");
- /* Close property list */
- ret = H5Pclose(dcpl);
- CHECK(ret, FAIL, "H5Pclose");
+ /* Using creation order or not */
+ for(use_corder = FALSE; use_corder <= TRUE; use_corder++) {
- /* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ if(use_corder) {
+ ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED);
+ CHECK(ret, FAIL, "H5Pset_attr_creation_order");
+ }
- /* Add attributes, until well into dense storage */
- for(u = 0; u < (max_compact * 2); u++) {
- /* Create attribute */
- sprintf(attrname, "attr %02u", u);
- attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate2");
+ /* Create a dataset */
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
- /* Write data into the attribute */
- ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
- CHECK(ret, FAIL, "H5Awrite");
+ /* Check on dataset's attribute storage status */
+ is_dense = H5O_is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
- /* Close attribute */
- ret = H5Aclose(attr);
- CHECK(ret, FAIL, "H5Aclose");
+ /* Add attributes, until well into dense storage */
+ for(u = 0; u < (max_compact * 2); u++) {
+ /* Create attribute */
+ HDsprintf(attrname, "attr %02u", u);
+ attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
+
+ /* Write data into the attribute */
+ ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
+ CHECK(ret, FAIL, "H5Awrite");
- /* Rename attribute */
- sprintf(new_attrname, "new attr %02u", u);
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
- /* Rename attribute */
- ret = H5Arename_by_name(fid, DSET1_NAME, attrname, new_attrname, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Arename_by_name");
+ /* Rename attribute */
+ HDsprintf(new_attrname, "new attr %02u", u);
- /* Check # of attributes */
- ret = H5Oget_info2(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info");
- } /* end for */
+ /* Rename attribute */
+ ret = H5Arename_by_name(fid, DSET1_NAME, attrname, new_attrname, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Arename_by_name");
- /* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ /* Check # of attributes */
+ ret = H5Oget_info2(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info");
+ VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info");
+ } /* end for */
+
+ /* Check on dataset's attribute storage status */
+ is_dense = H5O_is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ if(!use_corder) {
+ /* Unlink dataset with attributes */
+ ret = H5Ldelete(fid, DSET1_NAME, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+ }
+
+ } /* end for use_corder */
/* Close dataspace */
ret = H5Sclose(sid);
CHECK(ret, FAIL, "H5Sclose");
- /* Close Dataset */
- ret = H5Dclose(dataset);
- CHECK(ret, FAIL, "H5Dclose");
+ /* Close property list */
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
/* Close file */
ret = H5Fclose(fid);
@@ -2708,20 +2752,20 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
/* Re-open file */
fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
- CHECK(fid, FAIL, "H5Fopen");
+ CHECK(fid, H5I_INVALID_HID, "H5Fopen");
/* Open dataset */
dataset = H5Dopen2(fid, DSET1_NAME, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dopen2");
+ CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
/* Verify renamed attributes */
for(u = 0; u < (max_compact * 2); u++) {
unsigned value; /* Attribute value */
/* Open attribute */
- sprintf(attrname, "new attr %02u", u);
+ HDsprintf(attrname, "new attr %02u", u);
attr = H5Aopen(dataset, attrname, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Aopen");
+ CHECK(attr, H5I_INVALID_HID, "H5Aopen");
/* Read data from the attribute */
ret = H5Aread(attr, H5T_NATIVE_UINT, &value);
@@ -2780,7 +2824,6 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
/* Output message about test being performed */
MESSAGE(5, ("Testing Unlinking Object with Attributes in Dense Storage\n"));
- /* Create file */
if (use_min_dset_oh) { /* using minimized dataset headers */
/* modify fcpl...
* sidestep "bug" where file space is lost with minimized dset ohdrs
@@ -2790,16 +2833,14 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, 1);
CHECK(ret, FAIL, "H5Pset_file_space_strategy");
}
- fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
if (use_min_dset_oh)
CHECK(H5Pclose(fcpl), FAIL, "H5Pclose");
- /* Close file */
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Get size of file */
empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -2812,9 +2853,14 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = (use_min_dset_oh) ? H5Pcopy(dcpl_g) : H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (use_min_dset_oh) {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ } else {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ }
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -2835,7 +2881,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
/* Add attributes, until well into dense storage */
for(u = 0; u < (max_compact * 2); u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2940,9 +2986,14 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Change limits on compact/dense attribute storage */
max_compact = 0;
@@ -2974,7 +3025,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 0;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -2995,7 +3046,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 1;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3027,7 +3078,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
/* Delete attribute */
u = 0;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -3107,9 +3158,14 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -3130,7 +3186,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
/* Add attributes, until just before converting to dense storage */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3153,7 +3209,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3441,7 +3497,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
/* Delete a few attributes until the storage switches to compact */
for(u = min_dense-1; u <= max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
add_attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(add_attr, FAIL, "H5Acreate2");
@@ -3511,7 +3567,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
/* Add attributes, until just before converting to dense storage */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(gid1, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3637,9 +3693,14 @@ test_attr_big(hid_t fcpl, hid_t fapl)
big_sid = H5Screate_simple(ATTR6_RANK, dims, NULL);
CHECK(big_sid, FAIL, "H5Screate_simple");
- /* Query the group creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -3673,7 +3734,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 0;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3692,7 +3753,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 1;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3711,7 +3772,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 2;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT);
if(low == H5F_LIBVER_LATEST) {
CHECK(attr, FAIL, "H5Acreate2");
@@ -3735,7 +3796,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Create attribute */
u = 3;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -3758,7 +3819,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Delete attribute */
u = 1;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -3773,7 +3834,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Delete attribute */
u = 3;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -3788,7 +3849,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Delete attribute */
u = 2;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -3803,7 +3864,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Delete attribute */
u = 0;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -4111,7 +4172,6 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
-
/* Close dataspaces */
ret = H5Sclose(sid);
@@ -4214,7 +4274,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create many attributes */
for(u = 0; u < nattr; u++) {
- sprintf(attrname, "a-%06u", u);
+ HDsprintf(attrname, "a-%06u", u);
exists = H5Aexists(gid, attrname);
VERIFY(exists, FALSE, "H5Aexists");
@@ -4267,7 +4327,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl)
for(u = 0; u < nattr; u++) {
unsigned value; /* Attribute value */
- sprintf(attrname, "a-%06u", u);
+ HDsprintf(attrname, "a-%06u", u);
exists = H5Aexists(gid, attrname);
VERIFY(exists, TRUE, "H5Aexists");
@@ -4333,8 +4393,13 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Get creation order indexing on object */
ret = H5Pget_attr_creation_order(dcpl, &crt_order_flags);
@@ -4456,8 +4521,13 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@@ -4507,7 +4577,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
/* Create several attributes, but keep storage in compact form */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -4597,7 +4667,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
H5A_info_t ainfo; /* Attribute information */
/* Retrieve information for attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Aget_info_by_name(my_dataset, ".", attrname, &ainfo, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_info_by_name");
@@ -4656,8 +4726,13 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@@ -4707,7 +4782,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
/* Create several attributes, but keep storage in compact form */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -4730,7 +4805,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
} /* end for */
/* Create another attribute, to push into dense storage */
- sprintf(attrname, "attr %02u", max_compact);
+ HDsprintf(attrname, "attr %02u", max_compact);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -4824,7 +4899,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
H5A_info_t ainfo; /* Attribute information */
/* Retrieve information for attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Aget_info_by_name(my_dataset, ".", attrname, &ainfo, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_info_by_name");
@@ -4991,8 +5066,13 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@@ -5095,7 +5175,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
/* Create several attributes, but keep storage in compact form */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5118,7 +5198,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end for */
/* Create another attribute, to push into dense storage */
- sprintf(attrname, "attr %02u", max_compact);
+ HDsprintf(attrname, "attr %02u", max_compact);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5146,7 +5226,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
/* Delete several attributes from object, until attribute storage resumes compact form */
for(u = max_compact; u >= min_dense; u--) {
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(my_dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -5166,7 +5246,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end for */
/* Delete another attribute, to push attribute storage into compact form */
- sprintf(attrname, "attr %02u", (min_dense - 1));
+ HDsprintf(attrname, "attr %02u", (min_dense - 1));
ret = H5Adelete(my_dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -5182,7 +5262,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
/* Re-add attributes to get back into dense form */
for(u = (min_dense - 1); u < (max_compact + 1); u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5270,7 +5350,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
/* Delete several attributes from object, until attribute storage resumes compact form */
for(u = max_compact; u >= min_dense; u--) {
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(my_dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -5290,7 +5370,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end for */
/* Delete another attribute, to push attribute storage into compact form */
- sprintf(attrname, "attr %02u", (min_dense - 1));
+ HDsprintf(attrname, "attr %02u", (min_dense - 1));
ret = H5Adelete(my_dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
@@ -5306,7 +5386,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
/* Re-add attributes to get back into dense form */
for(u = (min_dense - 1); u < (max_compact + 1); u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5335,11 +5415,11 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
/* Delete all attributes */
for(u = max_compact; u > 0; u--) {
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(my_dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
} /* end for */
- sprintf(attrname, "attr %02u", 0);
+ HDsprintf(attrname, "attr %02u", 0);
ret = H5Adelete(my_dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
} /* end for */
@@ -5402,8 +5482,13 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@@ -5476,7 +5561,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
/* Create attributes, until attribute storage is in dense form */
for(u = 0; u < max_compact * 2; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5745,8 +5830,13 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -5812,7 +5902,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create attributes, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5849,7 +5939,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create more attributes, to push into dense form */
for(; u < (max_compact * 2); u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -5957,8 +6047,13 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -6050,7 +6145,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create attributes, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -6122,9 +6217,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT);
if(order == H5_ITER_INC)
- sprintf(attrname, "attr %02u", (u + 1));
+ HDsprintf(attrname, "attr %02u", (u + 1));
else
- sprintf(attrname, "attr %02u", (max_compact - (u + 2)));
+ HDsprintf(attrname, "attr %02u", (max_compact - (u + 2)));
ret = HDstrcmp(attrname, tmpname);
VERIFY(ret, 0, "H5Aget_name_by_idx");
} /* end for */
@@ -6160,7 +6255,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create more attributes, to push into dense form */
for(u = 0; u < (max_compact * 2); u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -6247,9 +6342,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT);
if(order == H5_ITER_INC)
- sprintf(attrname, "attr %02u", (u + 1));
+ HDsprintf(attrname, "attr %02u", (u + 1));
else
- sprintf(attrname, "attr %02u", ((max_compact * 2) - (u + 2)));
+ HDsprintf(attrname, "attr %02u", ((max_compact * 2) - (u + 2)));
ret = HDstrcmp(attrname, tmpname);
VERIFY(ret, 0, "H5Aget_name_by_idx");
} /* end for */
@@ -6293,7 +6388,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create attributes, to push into dense form */
for(u = 0; u < (max_compact * 2); u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -6358,9 +6453,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT);
if(order == H5_ITER_INC)
- sprintf(attrname, "attr %02u", ((u * 2) + 1));
+ HDsprintf(attrname, "attr %02u", ((u * 2) + 1));
else
- sprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 2)));
+ HDsprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 2)));
ret = HDstrcmp(attrname, tmpname);
VERIFY(ret, 0, "H5Aget_name_by_idx");
} /* end for */
@@ -6407,9 +6502,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT);
if(order == H5_ITER_INC)
- sprintf(attrname, "attr %02u", ((u * 2) + 3));
+ HDsprintf(attrname, "attr %02u", ((u * 2) + 3));
else
- sprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 4)));
+ HDsprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 4)));
ret = HDstrcmp(attrname, tmpname);
VERIFY(ret, 0, "H5Aget_name_by_idx");
} /* end for */
@@ -6499,7 +6594,7 @@ HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr);
} /* end if */
/* Verify name of link */
- sprintf(attrname, "attr %02u", (unsigned)my_info.corder);
+ HDsprintf(attrname, "attr %02u", (unsigned)my_info.corder);
if(HDstrcmp(attr_name, attrname))
return(H5_ITER_ERROR);
@@ -6900,8 +6995,13 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -7008,7 +7108,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create attributes, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -7078,7 +7178,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create more attributes, to push into dense form */
for(u = max_compact; u < (max_compact * 2); u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -7261,8 +7361,13 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -7354,7 +7459,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create attributes, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -7412,7 +7517,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create more attributes, to push into dense form */
for(u = max_compact; u < (max_compact * 2); u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -7517,7 +7622,7 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id,
/* Open each attribute on object by index and check that it's the correct one */
for(u = 0; u < max_attrs; u++) {
/* Open the attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr_id = H5Aopen(obj_id, attrname, H5P_DEFAULT);
CHECK(attr_id, FAIL, "H5Aopen");
@@ -7608,8 +7713,13 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -7682,7 +7792,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create attributes, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -7749,7 +7859,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create more attributes, to push into dense form */
for(u = max_compact; u < (max_compact * 2); u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
@@ -7862,8 +7972,13 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -7926,7 +8041,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create attributes, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate_by_name(fid, dsetname, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate_by_name");
@@ -7983,7 +8098,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Create more attributes, to push into dense form */
for(u = max_compact; u < (max_compact * 2); u++) {
/* Create attribute */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
attr = H5Acreate_by_name(fid, dsetname, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate_by_name");
@@ -8163,8 +8278,13 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -8202,7 +8322,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
/* Add attributes to each dataset, until after converting to dense storage */
for(u = 0; u < max_compact * 2; u++) {
/* Create attribute name */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
/* Alternate between creating "small" & "big" attributes */
if(u % 2) {
@@ -8494,8 +8614,13 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -8533,7 +8658,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
/* Add attributes to each dataset, until after converting to dense storage */
for(u = 0; u < max_compact * 2; u++) {
/* Create attribute name */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
/* Alternate between creating "small" & "big" attributes */
if(u % 2) {
@@ -8640,7 +8765,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
/* Create new attribute name */
- sprintf(attrname2, "new attr %02u", u);
+ HDsprintf(attrname2, "new attr %02u", u);
/* Change second dataset's attribute's name */
ret = H5Arename_by_name(fid, DSET2_NAME, attrname, attrname2, H5P_DEFAULT);
@@ -8940,8 +9065,13 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -8979,7 +9109,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
/* Add attributes to each dataset, until after converting to dense storage */
for(u = 0; u < max_compact * 2; u++) {
/* Create attribute name */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
/* Alternate between creating "small" & "big" attributes */
if(u % 2) {
@@ -9089,7 +9219,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
/* Delete attributes from second dataset */
for(u = 0; u < max_compact * 2; u++) {
/* Create attribute name */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
/* Delete second dataset's attribute */
ret = H5Adelete_by_name(fid, DSET2_NAME, attrname, H5P_DEFAULT);
@@ -9309,8 +9439,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -9348,7 +9483,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
/* Add attributes to each dataset, until after converting to dense storage */
for(u = 0; u < max_compact * 2; u++) {
/* Create attribute name */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
/* Alternate between creating "small" & "big" attributes */
if(u % 2) {
@@ -9475,7 +9610,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
/* Check ref count on attributes of first dataset */
for(u = 0; u < max_compact * 2; u++) {
/* Create attribute name */
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
/* Open attribute on first dataset */
attr = H5Aopen(dataset, attrname, H5P_DEFAULT);
@@ -9718,7 +9853,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl)
hid_t tid; /* Datatype ID */
hid_t gcpl; /* Group creation property list */
hsize_t dims[2] = {10, 100}; /* Attribute dimensions */
- char aname[4]; /* Attribute name */
+ char aname[16]; /* Attribute name */
unsigned i; /* index */
herr_t ret; /* Generic return status */
htri_t tri_ret; /* htri_t return status */
@@ -9750,7 +9885,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl)
/* Create attributes on group */
for (i=0; i<BUG2_NATTR; i++) {
- sprintf(aname, "%03u", i);
+ HDsprintf(aname, "%03u", i);
aid = H5Acreate2(gid, aname, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(aid, FAIL, "H5Acreate2");
@@ -9760,7 +9895,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl)
/* Delete every other attribute */
for (i=1; i<BUG2_NATTR; i+=2) {
- sprintf(aname, "%03u", i);
+ HDsprintf(aname, "%03u", i);
ret = H5Adelete(gid, aname);
CHECK(ret, FAIL, "H5Adelete");
}
@@ -9784,7 +9919,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl)
/* Open an attribute in the middle */
i = (BUG2_NATTR / 4) * 2;
- sprintf(aname, "%03u", i);
+ HDsprintf(aname, "%03u", i);
aid = H5Aopen(gid, aname, H5P_DEFAULT);
CHECK(aid, FAIL, "H5Aopen");
@@ -9827,7 +9962,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl)
/* Create attributes on group */
for (i=0; i<BUG2_NATTR2; i++) {
- sprintf(aname, "%03u", i);
+ HDsprintf(aname, "%03u", i);
aid = H5Acreate2(gid, aname, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(aid, FAIL, "H5Acreate2");
@@ -9837,7 +9972,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl)
/* Delete every other attribute */
for (i=0; i<BUG2_NATTR2; i++) {
- sprintf(aname, "%03u", i);
+ HDsprintf(aname, "%03u", i);
ret = H5Adelete(gid, aname);
CHECK(ret, FAIL, "H5Adelete");
}
@@ -10722,7 +10857,7 @@ test_attr_bug9(hid_t fcpl, hid_t fapl)
/****************************************************************
**
-** test_attr_delete_dense():
+** test_attr_delete_dense():
** This is to verify the error as described in HDFFV-9277
** is fixed when deleting the last "large" attribute that
** is stored densely.
@@ -10836,9 +10971,8 @@ test_attr(void)
fcpl = H5Pcreate(H5P_FILE_CREATE);
CHECK(fcpl, FAIL, "H5Pcreate");
- /* files with fcpl make all attributes (> 1 byte) shared
- * i.e., all of them :-)
- */
+ /* files with fcpl2 make all attributes ( > 1 byte) shared
+ * (i.e. all of them :-) */
fcpl2 = H5Pcopy(fcpl);
CHECK(fcpl2, FAIL, "H5Pcopy");
ret = H5Pset_shared_mesg_nindexes(fcpl2, (unsigned)1);
@@ -10866,11 +11000,10 @@ test_attr(void)
if(new_format) {
MESSAGE(7, ("testing with new file format\n"));
my_fapl = fapl2;
- } /* end if */
- else {
+ } else {
MESSAGE(7, ("testing with old file format\n"));
my_fapl = fapl;
- } /* end else */
+ }
/* These next two tests use the same file information */
test_attr_basic_write(my_fapl); /* Test basic H5A writing code */
@@ -11014,6 +11147,6 @@ test_attr(void)
void
cleanup_attr(void)
{
- remove(FILENAME);
+ HDremove(FILENAME);
}
diff --git a/test/tcheck_version.c b/test/tcheck_version.c
index 574d7c9..2611178 100644
--- a/test/tcheck_version.c
+++ b/test/tcheck_version.c
@@ -29,7 +29,7 @@
#include "h5test.h"
-#define progname "tcheck_version"
+#define progname "tcheck_version"
/* prototypes */
void showhelp(void);
@@ -37,20 +37,20 @@ void parse(int ac, char **av);
void abort_intercept (int H5_ATTR_UNUSED sig);
/* global variables */
-unsigned major = H5_VERS_MAJOR;
-unsigned minor = H5_VERS_MINOR;
-unsigned release = H5_VERS_RELEASE;
+unsigned major = H5_VERS_MAJOR;
+unsigned minor = H5_VERS_MINOR;
+unsigned release = H5_VERS_RELEASE;
void
showhelp(void)
{
- printf("Usage: " progname " [-h] [-t<vers>]\n");
- printf("\t-h\tShow this page and version information\n");
- printf("\t-t<vers>: Test by changing (adding 1 to) the <vers> to trigger\n");
- printf("\t\t the warning. <vers> can be:\n");
- printf("\t\t\tM for Major version number (%d)\n", H5_VERS_MAJOR);
- printf("\t\t\tm for Minor version number (%d)\n", H5_VERS_MINOR);
- printf("\t\t\tr for Release number (%d)\n", H5_VERS_RELEASE);
+ HDprintf("Usage: " progname " [-h] [-t<vers>]\n");
+ HDprintf("\t-h\tShow this page and version information\n");
+ HDprintf("\t-t<vers>: Test by changing (adding 1 to) the <vers> to trigger\n");
+ HDprintf("\t\t the warning. <vers> can be:\n");
+ HDprintf("\t\t\tM for Major version number (%d)\n", H5_VERS_MAJOR);
+ HDprintf("\t\t\tm for Minor version number (%d)\n", H5_VERS_MINOR);
+ HDprintf("\t\t\tr for Release number (%d)\n", H5_VERS_RELEASE);
}
@@ -60,36 +60,36 @@ parse(int ac, char **av)
char *pt;
while (--ac > 0){
- pt = *(++av);
- if (*pt != '-') {
- fprintf(stderr, "Unknown option(%s). Aborted.\n", *av);
- exit(EXIT_FAILURE);
- }else{
- switch(*(++pt)) {
- case 't': /* option -t */
- switch(*(++pt)) {
- case 'M':
- major++;
- break;
- case 'm':
- minor++;
- break;
- case 'r':
- release++;
- break;
- default:
- fprintf(stderr, "Unknown -v parameter (%s). Aborted.\n", *av);
- exit(EXIT_FAILURE);
- }
- break;
- case 'h': /* help page */
- showhelp();
- exit(EXIT_SUCCESS);
- default:
- fprintf(stderr, "Unknown option(%s). Aborted.\n", *av);
- exit(EXIT_FAILURE);
- }
- }
+ pt = *(++av);
+ if (*pt != '-') {
+ HDfprintf(stderr, "Unknown option(%s). Aborted.\n", *av);
+ HDexit(EXIT_FAILURE);
+ }else{
+ switch(*(++pt)) {
+ case 't': /* option -t */
+ switch(*(++pt)) {
+ case 'M':
+ major++;
+ break;
+ case 'm':
+ minor++;
+ break;
+ case 'r':
+ release++;
+ break;
+ default:
+ HDfprintf(stderr, "Unknown -v parameter (%s). Aborted.\n", *av);
+ HDexit(EXIT_FAILURE);
+ }
+ break;
+ case 'h': /* help page */
+ showhelp();
+ HDexit(EXIT_SUCCESS);
+ default:
+ HDfprintf(stderr, "Unknown option(%s). Aborted.\n", *av);
+ HDexit(EXIT_FAILURE);
+ }
+ }
}
}
diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in
index 8bc2078..49868ca 100644
--- a/test/test_usecases.sh.in
+++ b/test/test_usecases.sh.in
@@ -40,7 +40,7 @@ fi
# Define symbols
EXIT_SUCCESS=0
EXIT_FAILURE=1
-EXIT_VALUE=$EXIT_SUCCESS # Default all tests succeed
+EXIT_VALUE=$EXIT_SUCCESS # Default all tests succeed
RESULT_PASSED=" PASSED"
RESULT_FAILED="*FAILED*"
RESULT_SKIP="-SKIP-"
@@ -97,17 +97,17 @@ TOOLTEST() {
cat $actual_err >> $actual
if [ $exit_code -eq 0 ];then
- echo "$RESULT_PASSED"
- test yes = "$verbose" && sed 's/^/ /' < $actual
+ echo "$RESULT_PASSED"
+ test yes = "$verbose" && sed 's/^/ /' < $actual
else
- echo "$RESULT_FAILED"
- nerrors="`expr $nerrors + 1`"
- test yes = "$verbose" && sed 's/^/ /' < $actual
+ echo "$RESULT_FAILED"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && sed 's/^/ /' < $actual
fi
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
- rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext
+ rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext
fi
}
@@ -122,7 +122,9 @@ for FILE in use_*; do
case "$FILE" in
*.o) continue ;; ## don't copy the .o files
esac
- cp $FILE usecases_test
+ if test -f "$FILE" ; then
+ cp $FILE usecases_test
+ fi
done
# With the --disable-shared option, swmr program files are built in the test
@@ -131,7 +133,14 @@ done
# always be copied, swmr files in .libs should be copied only if they exists.
if [ -f .libs/use_append_chunk ]; then
mkdir usecases_test/.libs
- cp .libs/use_* usecases_test/.libs
+ for FILE in .libs/use_*; do
+ case "$FILE" in
+ *.o) continue ;; ## don't copy the .o files
+ esac
+ if test -f "$FILE" ; then
+ cp $FILE usecases_test/.libs
+ fi
+ done
cp .libs/twriteorder usecases_test/.libs
fi
@@ -176,10 +185,10 @@ for p in $USECASES_PROGRAMS; do
TOOLTEST ./$p -l w
TOOLTEST ./$p -l r
# use case 1.9, testing with multi-planes chunks
- TOOLTEST ./$p -z 256 -y 5 # 5 planes chunks
+ TOOLTEST ./$p -z 256 -y 5 # 5 planes chunks
# cleanup temp datafile
if test -z "$HDF5_NOCLEANUP"; then
- rm -f $p.h5
+ rm -f $p.h5
fi
done
diff --git a/test/testexternal_env.sh.in b/test/testexternal_env.sh.in
new file mode 100644
index 0000000..3cc140d
--- /dev/null
+++ b/test/testexternal_env.sh.in
@@ -0,0 +1,42 @@
+#! /bin/sh
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+# Test for external file with environment variable: HDF5_EXTFILE_PREFIX
+
+srcdir=@srcdir@
+
+nerrors=0
+
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
+
+# test for external file with HDF5_EXTFILE_PREFIX
+echo "Testing external file with HDF5_EXTFILE_PREFIX"
+TEST_NAME=external_env # The test name
+TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary
+ENVCMD="env HDF5_EXTFILE_PREFIX=\${ORIGIN}" # The environment variable & value
+#
+# Run the test
+# echo "$ENVCMD $RUNSERIAL $TEST_BIN"
+$ENVCMD $RUNSERIAL $TEST_BIN
+exitcode=$?
+if [ $exitcode -eq 0 ]; then
+ echo "Test prefix for HDF5_EXTFILE_PREFIX PASSED"
+ else
+ nerrors="`expr $nerrors + 1`"
+ echo "***Error encountered for HDF5_EXTFILE_PREFIX test***"
+fi
+exit $nerrors
diff --git a/test/testfiles/err_compat_1 b/test/testfiles/err_compat_1
index 8190665..e8ea044 100644
--- a/test/testfiles/err_compat_1
+++ b/test/testfiles/err_compat_1
@@ -1,5 +1,5 @@
Testing error API H5Eset/get_auto Testing error API based on data I/O All error API tests passed.
- This program tests the Error API compatible with HDF5 version (number). There're supposed to be some error messages
+ This program tests the Error API compatible with HDF5 version (number). There are supposed to be some error messages
********* Print error stack in HDF5 default way *********
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in main(): Error test failed
diff --git a/test/testfiles/err_compat_2 b/test/testfiles/err_compat_2
index 75e8769..467ba4c 100644
--- a/test/testfiles/err_compat_2
+++ b/test/testfiles/err_compat_2
@@ -1 +1 @@
-Test skipped because backward compatbility with v1.6 is NOT configured in
+Test skipped because backward compatibility with v1.6 is NOT configured in
diff --git a/test/testfiles/error_test_2 b/test/testfiles/error_test_2
index 6852f6f..85bc2e7 100644
--- a/test/testfiles/error_test_2
+++ b/test/testfiles/error_test_2
@@ -1 +1 @@
-Test skipped because backward compatbility with v1.6 is configured in
+Test skipped because backward compatibility with v1.6 is configured in
diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in
index ca46dcb..3cdf10f 100644
--- a/test/testflushrefresh.sh.in
+++ b/test/testflushrefresh.sh.in
@@ -20,7 +20,7 @@
# the verification of this feature needs to occur in separate processes
# from the one in which the file is being manipulated in. (i.e., we have
# a single writer process, and various reader processes spawning off
-# and doing the verification that individual objects are being
+# and doing the verification that individual objects are being
# correctly flushed).
#
# Programmer:
@@ -80,23 +80,30 @@ fi
# HDF5 has several tests that create and delete signal files to communicate
# between processes, and it seems that even though the names of the files are
# different, occasionally the wrong file is deleted, interrupting the flow of
-# the test. Running each of these tests in its own directory should eliminate
+# the test. Running each of these tests in its own directory should eliminate
# the problem.
mkdir flushrefresh_test
cp flushrefresh flushrefresh_test
# With the --disable-shared option, flushrefresh is built in the test directory,
-# otherwise it is in test/.libs with a wrapper script named flushrefresh in
-# the test directory. test/flushrefresh should always be copied,
+# otherwise it is in test/.libs with a wrapper script named flushrefresh in
+# the test directory. test/flushrefresh should always be copied,
# .libs/flushrefresh should be copied only if it exists.
if [ -f .libs/flushrefresh ]; then
mkdir flushrefresh_test/.libs
- cp .libs/flushrefresh flushrefresh_test/.libs
+ for FILE in .libs/flushrefresh*; do
+ case "$FILE" in
+ *.o) continue ;; ## don't copy the .o files
+ esac
+ if test -f "$FILE" ; then
+ cp $FILE flushrefresh_test/.libs
+ fi
+ done
fi
cd flushrefresh_test
# =================================================
-# Set up/initialize some variables to be used later
+# Set up/initialize some variables to be used later
# =================================================
testfile=flushrefresh.h5
startsignal=flushrefresh_VERIFICATION_START
@@ -119,13 +126,13 @@ pid_main=$!
# =======================================
until [ $verification_done -eq 1 ]; do
-
+
# Wait for signal from test program that verification routine can run.
before=`TimeStamp`
until [ -s $startsignal ]; do
after=`TimeStamp`
timediff=`expr $after - $before`
- if [ $timediff -gt $timeout_length ]; then
+ if [ $timediff -gt $timeout_length ]; then
nerrors=`expr $nerrors + 1`
timedout=1
break
@@ -165,7 +172,7 @@ if [ $timedout -eq 0 ]; then
until [ -s $startsignal ]; do
after=`TimeStamp`
timediff=`expr $after - $before`
- if [ $timediff -gt $timeout_length ]; then
+ if [ $timediff -gt $timeout_length ]; then
nerrors=`expr $nerrors + 1`
timedout=1
break
diff --git a/test/testframe.c b/test/testframe.c
index 21f9ea3..3c2a335 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -15,7 +15,7 @@
* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
* Tuesday, January 6, 2004
*
- * Purpose: Provides support functions for the testing framework.
+ * Purpose: Provides support functions for the testing framework.
*
*/
@@ -28,24 +28,25 @@
#define MAXTESTDESC 64
typedef struct TestStruct {
- int NumErrors;
- char Description[MAXTESTDESC];
- int SkipFlag;
- char Name[MAXTESTNAME];
- void (*Call)(void);
- void (*Cleanup)(void);
- const void *Parameters;
+ int NumErrors;
+ char Description[MAXTESTDESC];
+ int SkipFlag;
+ char Name[MAXTESTNAME];
+ void (*Call)(void);
+ void (*Cleanup)(void);
+ const void *Parameters;
} TestStruct;
/*
* Variables used by testing framework.
*/
-static int num_errs = 0; /* Total number of errors during testing */
+static int enable_error_stack = 0; /* enable error stack; disable=0 enable=1 */
+static int num_errs = 0; /* Total number of errors during testing */
int TestVerbosity = VERBO_DEF; /* Default Verbosity is Low */
-static int Summary = 0; /* Show test summary. Default is no. */
-static int CleanUp = 1; /* Do cleanup or not. Default is yes. */
-static int TestExpress = -1; /* Do TestExpress or not. -1 means not set yet. */
+static int Summary = 0; /* Show test summary. Default is no. */
+static int CleanUp = 1; /* Do cleanup or not. Default is yes. */
+static int TestExpress = -1; /* Do TestExpress or not. -1 means not set yet. */
static TestStruct *Test = NULL; /* Array of tests */
static unsigned TestAlloc = 0; /* Size of the Test array */
static unsigned Index = 0;
@@ -54,7 +55,7 @@ static const char *TestProgName = NULL;
static void (*TestPrivateUsage)(void) = NULL;
static int (*TestPrivateParser)(int ac, char *av[]) = NULL;
-
+
/*
* Setup a test function and add it to the list of tests.
* It must have no parameters and returns void.
@@ -73,14 +74,12 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
{
/* Sanity checking */
if (HDstrlen(TheDescr) >= MAXTESTDESC) {
- printf("Test description ('%s') too long, increase MAXTESTDESC(%d).\n",
- TheDescr, MAXTESTDESC);
- exit(EXIT_FAILURE);
+ HDprintf("Test description ('%s') too long, increase MAXTESTDESC(%d).\n", TheDescr, MAXTESTDESC);
+ HDexit(EXIT_FAILURE);
} /* end if */
if (HDstrlen(TheName) >= MAXTESTNAME) {
- printf("Test name too long, increase MAXTESTNAME(%d).\n",
- MAXTESTNAME);
- exit(EXIT_FAILURE);
+ HDprintf("Test name too long, increase MAXTESTNAME(%d).\n", MAXTESTNAME);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Check for increasing the Test array size */
@@ -90,8 +89,8 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
/* Reallocate array */
if(NULL == (newTest = (TestStruct *)HDrealloc(Test, newAlloc * sizeof(TestStruct)))) {
- printf("Out of memory for tests, Index = %u, TestAlloc = %u, newAlloc = %u\n", Index, TestAlloc, newAlloc);
- exit(EXIT_FAILURE);
+ HDprintf("Out of memory for tests, Index = %u, TestAlloc = %u, newAlloc = %u\n", Index, TestAlloc, newAlloc);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Update info */
@@ -102,12 +101,12 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
/* Set up test function */
HDstrcpy(Test[Index].Description, TheDescr);
if(*TheName != '-') {
- HDstrcpy(Test[Index].Name, TheName);
- Test[Index].SkipFlag = 0;
+ HDstrcpy(Test[Index].Name, TheName);
+ Test[Index].SkipFlag = 0;
}
- else { /* skip test by default */
- HDstrcpy(Test[Index].Name, TheName+1);
- Test[Index].SkipFlag = 1;
+ else { /* skip test by default */
+ HDstrcpy(Test[Index].Name, TheName+1);
+ Test[Index].SkipFlag = 1;
}
Test[Index].Call = TheCall;
Test[Index].Cleanup = Cleanup;
@@ -118,7 +117,7 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
Index++;
}
-
+
/*
* Initialize testing framework
*
@@ -130,8 +129,8 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
* private options. Default to NULL which means none is provided.
*
* Modifications:
- * Albert Cheng 2004/08/17
- * Added the ProgName, private_usage and private_parser arguments.
+ * Albert Cheng 2004/08/17
+ * Added the ProgName, private_usage and private_parser arguments.
*/
void TestInit(const char *ProgName, void (*private_usage)(void), int (*private_parser)(int ac, char *av[]))
{
@@ -140,62 +139,63 @@ void TestInit(const char *ProgName, void (*private_usage)(void), int (*private_p
* half the functions this test calls are private, so automatic error
* reporting wouldn't do much good since it's triggered at the API layer.
*/
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
+ if (enable_error_stack == 0)
+ H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
/*
* Record the program name and private routines if provided.
*/
TestProgName = ProgName;
- if (NULL != private_usage)
- TestPrivateUsage = private_usage;
- if (NULL != private_parser)
- TestPrivateParser = private_parser;
+ if(NULL != private_usage)
+ TestPrivateUsage = private_usage;
+ if(NULL != private_parser)
+ TestPrivateParser = private_parser;
}
-
+
/*
* Print test usage.
- * First print the common test options, then the extra options if provided.
+ * First print the common test options, then the extra options if provided.
*
* Modification:
- * 2004/08/18 Albert Cheng. Add TestPrivateUsage feature.
+ * 2004/08/18 Albert Cheng. Add TestPrivateUsage feature.
*/
void TestUsage(void)
{
- unsigned i;
-
- print_func("Usage: %s [-v[erbose] (l[ow]|m[edium]|h[igh]|0-9)] %s\n",
- TestProgName, (TestPrivateUsage ? "<extra options>" : ""));
- print_func(" [-[e]x[clude] name]+ \n");
- print_func(" [-o[nly] name]+ \n");
- print_func(" [-b[egin] name] \n");
- print_func(" [-s[ummary]] \n");
- print_func(" [-c[leanoff]] \n");
- print_func(" [-h[elp]] \n");
- print_func("\n\n");
- print_func("verbose controls the amount of information displayed\n");
- print_func("exclude to exclude tests by name\n");
- print_func("only to name tests which should be run\n");
- print_func("begin start at the name of the test givin\n");
- print_func("summary prints a summary of test results at the end\n");
- print_func("cleanoff does not delete *.hdf files after execution of tests\n");
- print_func("help print out this information\n");
- if (TestPrivateUsage){
- print_func("\nExtra options\n");
- TestPrivateUsage();
- }
- print_func("\n\n");
- print_func("This program currently tests the following: \n\n");
- print_func("%16s %s\n", "Name", "Description");
- print_func("%16s %s\n", "----", "-----------");
-
- for (i = 0; i < Index; i++)
- print_func("%16s %s\n", Test[i].Name, Test[i].Description);
-
- print_func("\n\n");
+ unsigned i;
+
+ print_func("Usage: %s [-v[erbose] (l[ow]|m[edium]|h[igh]|0-9)] %s\n",
+ TestProgName, (TestPrivateUsage ? "<extra options>" : ""));
+ print_func(" [-[e]x[clude] name]+ \n");
+ print_func(" [-o[nly] name]+ \n");
+ print_func(" [-b[egin] name] \n");
+ print_func(" [-s[ummary]] \n");
+ print_func(" [-c[leanoff]] \n");
+ print_func(" [-h[elp]] \n");
+ print_func("\n\n");
+ print_func("verbose controls the amount of information displayed\n");
+ print_func("exclude to exclude tests by name\n");
+ print_func("only to name tests which should be run\n");
+ print_func("begin start at the name of the test givin\n");
+ print_func("summary prints a summary of test results at the end\n");
+ print_func("cleanoff does not delete *.hdf files after execution of tests\n");
+ print_func("help print out this information\n");
+ if (TestPrivateUsage){
+ print_func("\nExtra options\n");
+ TestPrivateUsage();
+ }
+ print_func("\n\n");
+ print_func("This program currently tests the following: \n\n");
+ print_func("%16s %s\n", "Name", "Description");
+ print_func("%16s %s\n", "----", "-----------");
+
+ for (i = 0; i < Index; i++)
+ print_func("%16s %s\n", Test[i].Name, Test[i].Description);
+
+ print_func("\n\n");
}
-
+
/*
* Print test info.
*/
@@ -209,7 +209,7 @@ void TestInfo(const char *ProgName)
print_func("Linked with hdf5 version %u.%u release %u\n", major, minor, release);
}
-
+
/*
* Parse command line information.
* argc, argv: the usual command line argument count and strings
@@ -218,7 +218,7 @@ void TestInfo(const char *ProgName)
* exit EXIT_FAILURE if error is encountered.
*
* Modification:
- * 2004/08/18 Albert Cheng. Add extra_parse feature.
+ * 2004/08/18 Albert Cheng. Add extra_parse feature.
*/
void TestParseCmdLine(int argc, char *argv[])
{
@@ -226,80 +226,84 @@ void TestParseCmdLine(int argc, char *argv[])
int ret_code;
while (argv++, --argc > 0){
- if ((HDstrcmp(*argv, "-verbose") == 0) ||
- (HDstrcmp(*argv, "-v") == 0)) {
- if (argc > 0){
- --argc; ++argv;
- ParseTestVerbosity(*argv);
- }else{
- TestUsage();
- exit(EXIT_FAILURE);
- }
- }
- else if (((HDstrcmp(*argv, "-exclude") == 0) ||
- (HDstrcmp(*argv, "-x") == 0))) {
- if (argc > 0){
- --argc; ++argv;
- SetTest(*argv, SKIPTEST);
- }else{
- TestUsage();
- exit(EXIT_FAILURE);
- }
- }
- else if (((HDstrcmp(*argv, "-begin") == 0) ||
- (HDstrcmp(*argv, "-b") == 0))) {
- if (argc > 0){
- --argc; ++argv;
- SetTest(*argv, BEGINTEST);
- }else{
- TestUsage();
- exit(EXIT_FAILURE);
- }
- }
- else if (((HDstrcmp(*argv, "-only") == 0) ||
- (HDstrcmp(*argv, "-o") == 0))) {
- if(argc > 0) {
- unsigned Loop;
-
- --argc; ++argv;
-
- /* Skip all tests, then activate only one. */
+ if ((HDstrcmp(*argv, "-verbose") == 0) || (HDstrcmp(*argv, "-v") == 0)) {
+ if (argc > 0){
+ --argc; ++argv;
+ ParseTestVerbosity(*argv);
+ }
+ else{
+ TestUsage();
+ HDexit(EXIT_FAILURE);
+ }
+ }
+ else if (((HDstrcmp(*argv, "-exclude") == 0) ||
+ (HDstrcmp(*argv, "-x") == 0))) {
+ if (argc > 0){
+ --argc; ++argv;
+ SetTest(*argv, SKIPTEST);
+ }
+ else{
+ TestUsage();
+ HDexit(EXIT_FAILURE);
+ }
+ }
+ else if (((HDstrcmp(*argv, "-begin") == 0) ||
+ (HDstrcmp(*argv, "-b") == 0))) {
+ if (argc > 0){
+ --argc; ++argv;
+ SetTest(*argv, BEGINTEST);
+ }
+ else{
+ TestUsage();
+ HDexit(EXIT_FAILURE);
+ }
+ }
+ else if (((HDstrcmp(*argv, "-only") == 0) ||
+ (HDstrcmp(*argv, "-o") == 0))) {
+ if(argc > 0) {
+ unsigned Loop;
+
+ --argc; ++argv;
+
+ /* Skip all tests, then activate only one. */
if(!skipped_all) {
for(Loop = 0; Loop < Index; Loop++)
Test[Loop].SkipFlag = 1;
skipped_all = TRUE;
} /* end if */
- SetTest(*argv, ONLYTEST);
- } /* end if */
- else {
- TestUsage();
- exit(EXIT_FAILURE);
- }
- }
- else if ((HDstrcmp(*argv, "-summary") == 0) || (HDstrcmp(*argv, "-s") == 0))
+ SetTest(*argv, ONLYTEST);
+ }
+ else{
+ TestUsage();
+ HDexit(EXIT_FAILURE);
+ }
+ }
+ else if ((HDstrcmp(*argv, "-summary") == 0) || (HDstrcmp(*argv, "-s") == 0))
Summary = 1;
- else if ((HDstrcmp(*argv, "-help") == 0) || (HDstrcmp(*argv, "-h") == 0)) {
+ else if (HDstrcmp(*argv, "-enable-error-stack") == 0)
+ enable_error_stack = 1;
+ else if ((HDstrcmp(*argv, "-help") == 0) || (HDstrcmp(*argv, "-h") == 0)) {
TestUsage();
- exit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
+ }
+ else if ((HDstrcmp(*argv, "-cleanoff") == 0) || (HDstrcmp(*argv, "-c") == 0))
+ SetTestNoCleanup();
+ else {
+ /* non-standard option. Break out. */
+ break;
}
- else if ((HDstrcmp(*argv, "-cleanoff") == 0) || (HDstrcmp(*argv, "-c") == 0))
- SetTestNoCleanup();
- else {
- /* non-standard option. Break out. */
- break;
- }
}
/* Call extra parsing function if provided. */
if (NULL != TestPrivateParser){
- ret_code=TestPrivateParser(argc+1, argv-1);
- if (ret_code != 0)
- exit(EXIT_FAILURE);
+ ret_code=TestPrivateParser(argc+1, argv-1);
+ if (ret_code != 0)
+ HDexit(EXIT_FAILURE);
}
}
-
+
/*
* Perform Tests.
*/
@@ -314,10 +318,10 @@ void PerformTests(void)
MESSAGE(2, ("Testing -- %s (%s) \n", Test[Loop].Description, Test[Loop].Name));
MESSAGE(5, ("===============================================\n"));
Test[Loop].NumErrors = num_errs;
- Test_parameters = Test[Loop].Parameters;
- ALARM_ON;
+ Test_parameters = Test[Loop].Parameters;
+ ALARM_ON;
Test[Loop].Call();
- ALARM_OFF;
+ ALARM_OFF;
Test[Loop].NumErrors = num_errs - Test[Loop].NumErrors;
MESSAGE(5, ("===============================================\n"));
MESSAGE(5, ("There were %d errors detected.\n\n", (int)Test[Loop].NumErrors));
@@ -332,7 +336,7 @@ void PerformTests(void)
print_func("All tests were successful. \n\n");
}
-
+
/*
* Display test summary.
*/
@@ -354,7 +358,7 @@ void TestSummary(void)
print_func("\n\n");
}
-
+
/*
* Cleanup files from testing
*/
@@ -370,7 +374,7 @@ void TestCleanup(void)
Test[Loop].Cleanup();
}
-
+
/*
* Shutdown the test infrastructure
*/
@@ -380,7 +384,7 @@ void TestShutdown(void)
HDfree(Test);
}
-
+
/*
* Retrieve the verbosity level for the testing framework
*/
@@ -436,18 +440,18 @@ int GetTestExpress(void)
/* set it here for now. Should be done in something like h5test_init(). */
if(TestExpress==-1)
{
- env_val = getenv("HDF5TestExpress");
-
- if(env_val == NULL)
- SetTestExpress(1);
- else if(strcmp(env_val, "0") == 0)
- SetTestExpress(0);
- else if(strcmp(env_val, "1") == 0)
- SetTestExpress(1);
- else if(strcmp(env_val, "2") == 0)
- SetTestExpress(2);
- else
- SetTestExpress(3);
+ env_val = getenv("HDF5TestExpress");
+
+ if(env_val == NULL)
+ SetTestExpress(1);
+ else if(strcmp(env_val, "0") == 0)
+ SetTestExpress(0);
+ else if(strcmp(env_val, "1") == 0)
+ SetTestExpress(1);
+ else if(strcmp(env_val, "2") == 0)
+ SetTestExpress(2);
+ else
+ SetTestExpress(3);
}
return(TestExpress);
@@ -504,16 +508,16 @@ int SetTestNoCleanup(void)
void ParseTestVerbosity(char *argv)
{
if (*argv == 'l')
- SetTestVerbosity(VERBO_LO);
+ SetTestVerbosity(VERBO_LO);
else if (*argv == 'm')
- SetTestVerbosity(VERBO_MED);
+ SetTestVerbosity(VERBO_MED);
else if (*argv == 'h')
- SetTestVerbosity(VERBO_HI);
+ SetTestVerbosity(VERBO_HI);
else
- SetTestVerbosity(atoi(argv));
+ SetTestVerbosity(atoi(argv));
}
-
+
/*
* Retrieve the number of testing errors for the testing framework
*/
@@ -522,7 +526,7 @@ H5_ATTR_PURE int GetTestNumErrs(void)
return(num_errs);
}
-
+
/*
* Increment the number of testing errors
*/
@@ -531,7 +535,7 @@ void IncTestNumErrs(void)
num_errs++;
}
-
+
/*
* Retrieve the current Test Parameters pointer.
*/
@@ -540,7 +544,7 @@ H5_ATTR_PURE const void *GetTestParameters(void)
return(Test_parameters);
}
-
+
/*
* This routine is designed to provide equivalent functionality to 'printf'
* and also increment the error count for the testing framework.
@@ -555,15 +559,15 @@ TestErrPrintf(const char *format, ...)
num_errs++;
/* Print the requested information */
- va_start(arglist, format);
- ret_value = vprintf(format, arglist);
- va_end(arglist);
+ HDva_start(arglist, format);
+ ret_value = HDvprintf(format, arglist);
+ HDva_end(arglist);
/* Return the length of the string produced (like printf() does) */
return ret_value;
}
-
+
/*
* Set (control) which test will be tested.
* SKIPTEST: skip this test
@@ -576,41 +580,41 @@ void SetTest(const char *testname, int action)
unsigned Loop;
switch (action){
- case SKIPTEST:
- for (Loop = 0; Loop < Index; Loop++)
- if (HDstrcmp(testname, Test[Loop].Name) == 0){
- Test[Loop].SkipFlag = 1;
- break;
- }
- break;
- case BEGINTEST:
- for (Loop = 0; Loop < Index; Loop++) {
- if (HDstrcmp(testname, Test[Loop].Name) != 0)
- Test[Loop].SkipFlag = 1;
- else{
- /* Found it. Set it to run. Done. */
- Test[Loop].SkipFlag = 0;
- break;
- }
- }
- break;
- case ONLYTEST:
- for (Loop = 0; Loop < Index; Loop++) {
- if (HDstrcmp(testname, Test[Loop].Name) == 0) {
- /* Found it. Set it to run. Break to skip the rest. */
- Test[Loop].SkipFlag = 0;
- break;
- }
- }
- break;
- default:
- /* error */
- printf("*** ERROR: Unknown action (%d) for SetTest\n", action);
- break;
+ case SKIPTEST:
+ for (Loop = 0; Loop < Index; Loop++)
+ if (HDstrcmp(testname, Test[Loop].Name) == 0){
+ Test[Loop].SkipFlag = 1;
+ break;
+ }
+ break;
+ case BEGINTEST:
+ for (Loop = 0; Loop < Index; Loop++) {
+ if (HDstrcmp(testname, Test[Loop].Name) != 0)
+ Test[Loop].SkipFlag = 1;
+ else{
+ /* Found it. Set it to run. Done. */
+ Test[Loop].SkipFlag = 0;
+ break;
+ }
+ }
+ break;
+ case ONLYTEST:
+ for (Loop = 0; Loop < Index; Loop++) {
+ if (HDstrcmp(testname, Test[Loop].Name) == 0) {
+ /* Found it. Set it to run. Break to skip the rest. */
+ Test[Loop].SkipFlag = 0;
+ break;
+ }
+ }
+ break;
+ default:
+ /* error */
+ HDprintf("*** ERROR: Unknown action (%d) for SetTest\n", action);
+ break;
}
}
-
+
/*
* Enable alarm on test execution, configurable by environment variable
*/
diff --git a/test/testhdf5.c b/test/testhdf5.c
index 713cccf..e136086 100644
--- a/test/testhdf5.c
+++ b/test/testhdf5.c
@@ -90,8 +90,8 @@ main(int argc, char *argv[])
/* Exit failure if errors encountered; else exit success. */
/* No need to print anything since PerformTests() already does. */
if (GetTestNumErrs() > 0)
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
else
- exit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
} /* end main() */
diff --git a/test/testhdf5.h b/test/testhdf5.h
index 1f3f6a0..ef3b784 100644
--- a/test/testhdf5.h
+++ b/test/testhdf5.h
@@ -177,53 +177,53 @@ extern "C" {
#endif
/* Prototypes for the test routines */
-void test_metadata(void);
-void test_checksum(void);
-void test_tst(void);
-void test_heap(void);
-void test_refstr(void);
-void test_file(void);
-void test_h5o(void);
-void test_h5t(void);
-void test_h5s(void);
-void test_coords(void);
-void test_h5d(void);
-void test_attr(void);
-void test_select(void);
-void test_time(void);
-void test_reference(void);
-void test_vltypes(void);
-void test_vlstrings(void);
-void test_iterate(void);
-void test_array(void);
-void test_genprop(void);
-void test_configure(void);
-void test_misc(void);
-void test_ids(void);
-void test_skiplist(void);
-void test_sohm(void);
-void test_unicode(void);
+void test_metadata(void);
+void test_checksum(void);
+void test_tst(void);
+void test_heap(void);
+void test_refstr(void);
+void test_file(void);
+void test_h5o(void);
+void test_h5t(void);
+void test_h5s(void);
+void test_coords(void);
+void test_h5d(void);
+void test_attr(void);
+void test_select(void);
+void test_time(void);
+void test_reference(void);
+void test_vltypes(void);
+void test_vlstrings(void);
+void test_iterate(void);
+void test_array(void);
+void test_genprop(void);
+void test_configure(void);
+void test_misc(void);
+void test_ids(void);
+void test_skiplist(void);
+void test_sohm(void);
+void test_unicode(void);
/* Prototypes for the cleanup routines */
-void cleanup_metadata(void);
-void cleanup_checksum(void);
-void cleanup_file(void);
-void cleanup_h5o(void);
-void cleanup_h5s(void);
-void cleanup_coords(void);
-void cleanup_attr(void);
-void cleanup_select(void);
-void cleanup_time(void);
-void cleanup_reference(void);
-void cleanup_vltypes(void);
-void cleanup_vlstrings(void);
-void cleanup_iterate(void);
-void cleanup_array(void);
-void cleanup_genprop(void);
-void cleanup_configure(void);
-void cleanup_sohm(void);
-void cleanup_misc(void);
-void cleanup_unicode(void);
+void cleanup_metadata(void);
+void cleanup_checksum(void);
+void cleanup_file(void);
+void cleanup_h5o(void);
+void cleanup_h5s(void);
+void cleanup_coords(void);
+void cleanup_attr(void);
+void cleanup_select(void);
+void cleanup_time(void);
+void cleanup_reference(void);
+void cleanup_vltypes(void);
+void cleanup_vlstrings(void);
+void cleanup_iterate(void);
+void cleanup_array(void);
+void cleanup_genprop(void);
+void cleanup_configure(void);
+void cleanup_sohm(void);
+void cleanup_misc(void);
+void cleanup_unicode(void);
#ifdef __cplusplus
}
diff --git a/test/testlinks_env.sh.in b/test/testlinks_env.sh.in
index 94e6c7e..3d6b3ce 100644
--- a/test/testlinks_env.sh.in
+++ b/test/testlinks_env.sh.in
@@ -19,15 +19,15 @@ nerrors=0
##############################################################################
##############################################################################
-### T H E T E S T S ###
+### T H E T E S T S ###
##############################################################################
##############################################################################
# test for external links with HDF5_EXT_PREFIX
echo "Testing external link with HDF5_EXT_PREFIX"
-TEST_NAME=links_env # The test name
-TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary
-ENVCMD="env HDF5_EXT_PREFIX=.:tmp" # The environment variable & value
+TEST_NAME=links_env # The test name
+TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary
+ENVCMD="env HDF5_EXT_PREFIX=.:tmp_links_env" # The environment variable & value
#
# Run the test
echo "$ENVCMD $RUNSERIAL $TEST_BIN"
@@ -36,7 +36,7 @@ exitcode=$?
if [ $exitcode -eq 0 ]; then
echo "Test for HDF5_EXT_PREFIX PASSED"
else
- nerrors="`expr $nerrors + 1`"
- echo "***Error encountered for HDF5_EXT_PREFIX test***"
+ nerrors="`expr $nerrors + 1`"
+ echo "***Error encountered for HDF5_EXT_PREFIX test***"
fi
exit $nerrors
diff --git a/test/testmeta.c b/test/testmeta.c
index b97eb68..9a40e6f 100644
--- a/test/testmeta.c
+++ b/test/testmeta.c
@@ -23,34 +23,34 @@
*/
-#include "hdf5.h"
+#include "h5test.h"
-#define FILEN "testmeta.h5"
+#define FILEN "testmeta.h5"
-#define CHUNK_SIZE 512
+#define CHUNK_SIZE 512
-#define NDATAARRAYS 3
-/*#define NPOINTS 2048*/
-#define NPOINTS 20
-#define NEXTARRAYS 10
-#define NDATAOBJECTS 100000
+#define NDATAARRAYS 3
+/*#define NPOINTS 2048*/
+#define NPOINTS 20
+#define NEXTARRAYS 10
+#define NDATAOBJECTS 100000
int main(void)
{
- hid_t file_id, prop_id, memspace_id, type_id;
- hid_t group_id;
- hid_t dataset_id, dataspace_id;
- herr_t status;
- hsize_t dims[1];
- hsize_t maxdims[1];
- float data[NPOINTS];
- float floatval;
- unsigned numdataobj = 0;
- unsigned i, j;
- char name[80];
- hsize_t start[1] = {0};
- hsize_t stride[1] = {1};
- hsize_t count[1] = {1};
+ hid_t file_id, prop_id, memspace_id, type_id;
+ hid_t group_id;
+ hid_t dataset_id, dataspace_id;
+ herr_t status;
+ hsize_t dims[1];
+ hsize_t maxdims[1];
+ float data[NPOINTS];
+ float floatval;
+ unsigned numdataobj = 0;
+ unsigned i, j;
+ char name[80];
+ hsize_t start[1] = {0};
+ hsize_t stride[1] = {1};
+ hsize_t count[1] = {1};
/* Create a file */
file_id = H5Fcreate(FILEN, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -64,8 +64,7 @@ int main(void)
H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write value to NumDataObj dataset */
- status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL,
- H5S_ALL, H5P_DEFAULT, &numdataobj);
+ status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &numdataobj);
/* Close the identifiers */
status = H5Dclose(dataset_id);
@@ -78,16 +77,14 @@ int main(void)
status = H5Pset_chunk(prop_id, 1, dims);
/* Create dataspace */
- dims[0]=1;
- maxdims[0]=H5S_UNLIMITED;
+ dims[0] = 1;
+ maxdims[0] = H5S_UNLIMITED;
dataspace_id = H5Screate_simple(1, dims, maxdims);
- for(i=0; i<NEXTARRAYS; i++)
- {
+ for(i = 0; i < NEXTARRAYS; i++) {
/* Create dataset */
sprintf(name, "/ExtArray%06d", i);
- dataset_id = H5Dcreate2(file_id, name,
- H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT);
+ dataset_id = H5Dcreate2(file_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT);
/* Close the identifier */
status = H5Dclose(dataset_id);
@@ -101,47 +98,43 @@ int main(void)
group_id = H5Gcreate2(file_id, "/DataArray", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group_id);
- for(j=0; j<NDATAOBJECTS; j++)
- {
+ for(j = 0; j < NDATAOBJECTS; j++) {
/* Removed print statement as it would lock system resources on Windows */
/*
- * printf("\rWriting Object #%d of %d", j+1, NDATAOBJECTS);
+ * HDprintf("\rWriting Object #%d of %d", j+1, NDATAOBJECTS);
* fflush(stdout);
*/
floatval = (float)j;
/* Create group to hold data arrays for this object */
- sprintf(name, "/DataArray/%06d", j);
+ HDsprintf(name, "/DataArray/%06d", j);
group_id = H5Gcreate2(file_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(group_id < 0) {
- fprintf(stderr, "Failed to create DataArray group.\n");
+ HDfprintf(stderr, "Failed to create DataArray group.\n");
status = H5Fclose(file_id);
return -1;
}
/* Loop over data arrays */
- for(i=0; i<NDATAARRAYS; i++)
- {
+ for(i = 0; i < NDATAARRAYS; i++) {
/* Create dataspace */
dims[0]=NPOINTS;
maxdims[0]=NPOINTS;
dataspace_id = H5Screate_simple(1 ,dims, maxdims);
/* Create dataset */
- sprintf(name, "DataArray%06d", i);
- dataset_id = H5Dcreate2(group_id, name,
- H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ HDsprintf(name, "DataArray%06d", i);
+ dataset_id = H5Dcreate2(group_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(dataset_id < 0) {
- fprintf(stderr, "Failed to create DataArray dataset.\n");
+ HDfprintf(stderr, "Failed to create DataArray dataset.\n");
status = H5Fclose(file_id);
return -1;
}
/* Write the data array data */
- status = H5Dwrite(dataset_id, H5T_NATIVE_FLOAT, H5S_ALL,
- H5S_ALL, H5P_DEFAULT, data);
+ status = H5Dwrite(dataset_id, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if(status < 0) {
- fprintf(stderr, "Failed to write DataArray dataset.\n");
+ HDfprintf(stderr, "Failed to write DataArray dataset.\n");
status = H5Fclose(file_id);
return -1;
}
@@ -154,17 +147,16 @@ int main(void)
/* Open NumDataObj dataset */
dataset_id = H5Dopen2(file_id, "/NumDataObj", H5P_DEFAULT);
if(dataset_id < 0) {
- fprintf(stderr, "Failed to open NumDataObj dataset.\n");
+ HDfprintf(stderr, "Failed to open NumDataObj dataset.\n");
status = H5Fclose(file_id);
return -1;
}
/* Write value to NumDataObj dataset */
numdataobj = j + 1;
- status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL,
- H5S_ALL, H5P_DEFAULT, &numdataobj);
+ status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &numdataobj);
if(status < 0) {
- fprintf(stderr, "Failed to write NumDataObj dataset.\n");
+ HDfprintf(stderr, "Failed to write NumDataObj dataset.\n");
status = H5Fclose(file_id);
return -1;
}
@@ -176,10 +168,10 @@ int main(void)
/* Extend attribute arrays */
for(i = 0; i < NEXTARRAYS; i++) {
/* Open extendable dataset */
- sprintf(name, "/ExtArray%06d", i);
+ HDsprintf(name, "/ExtArray%06d", i);
dataset_id = H5Dopen2(file_id, name, H5P_DEFAULT);
if(dataset_id < 0) {
- fprintf(stderr, "Failed to open ExtArray dataset.\n");
+ HDfprintf(stderr, "Failed to open ExtArray dataset.\n");
status = H5Fclose(file_id);
return -1;
} /* end if */
@@ -188,7 +180,7 @@ int main(void)
dims[0] = (hsize_t)j + 1;
status = H5Dset_extent(dataset_id, dims);
if(status < 0) {
- fprintf(stderr, "Failed to extend DataArray dataset.\n");
+ HDfprintf(stderr, "Failed to extend DataArray dataset.\n");
status = H5Fclose(file_id);
return -1;
} /* end if */
@@ -200,16 +192,12 @@ int main(void)
type_id = H5Dget_type(dataset_id);
start[0] = 0;
- status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET,
- start, stride, count, NULL);
+ status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET, start, stride, count, NULL);
start[0] = (hssize_t)j;
- status = H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET,
- start, stride, count, NULL);
- status = H5Dwrite(dataset_id, type_id, memspace_id,
- dataspace_id, H5P_DEFAULT, &floatval);
- if(status < 0)
- {
- fprintf(stderr, "Failed to write DataArray dataset.\n");
+ status = H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET, start, stride, count, NULL);
+ status = H5Dwrite(dataset_id, type_id, memspace_id, dataspace_id, H5P_DEFAULT, &floatval);
+ if(status < 0) {
+ HDfprintf(stderr, "Failed to write DataArray dataset.\n");
status = H5Fclose(file_id);
return -1;
}
@@ -226,7 +214,7 @@ int main(void)
/* Close the file */
status = H5Fclose(file_id);
- printf("\n");
+ HDprintf("\n");
return 0;
}
diff --git a/test/testswmr.sh.in b/test/testswmr.sh.in
index f81a7d7..a41947e 100644
--- a/test/testswmr.sh.in
+++ b/test/testswmr.sh.in
@@ -131,9 +131,10 @@ for FILE in swmr*; do
case "$FILE" in
*.o) continue ;; ## don't copy the .o files
esac
- cp $FILE swmr_test
+ if test -f "$FILE" ; then
+ cp $FILE swmr_test
+ fi
done
-cp swmr* swmr_test
# With the --disable-shared option, swmr program files are built in the test
# directory, otherwise they are in test/.libs with a corresponding wrapper
@@ -145,7 +146,9 @@ if [ -f .libs/swmr ]; then
case "$FILE" in
*.o) continue ;; ## don't copy the .o files
esac
- cp $FILE swmr_test/.libs
+ if test -f "$FILE" ; then
+ cp $FILE swmr_test/.libs
+ fi
done
fi
@@ -153,7 +156,7 @@ cd swmr_test
# Loop over index types
-for index_type in "-i ea" "-i b2"
+for index_type in "-i ea" "-i b2"
do
# Try with and without compression
for compress in "" "-c 5"
diff --git a/test/testvds_env.sh.in b/test/testvds_env.sh.in
new file mode 100644
index 0000000..e9a27da
--- /dev/null
+++ b/test/testvds_env.sh.in
@@ -0,0 +1,44 @@
+#! /bin/sh
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+# Test for external file with environment variable: HDF5_VDS_PREFIX
+
+srcdir=@srcdir@
+
+nerrors=0
+
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
+
+# test for VDS with HDF5_VDS_PREFIX
+echo "Testing basic virtual dataset I/O via H5Pset_vds_prefix(): all selection with ENV prefix"
+TEST_NAME=vds_env # The test name
+TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary
+ENVCMD="env HDF5_VDS_PREFIX=\${ORIGIN}/tmp_vds_env" # Set the environment variable & value
+UNENVCMD="unset HDF5_VDS_PREFIX" # Unset the environment variable & value
+#
+# Run the test
+# echo "$ENVCMD $RUNSERIAL $TEST_BIN"
+$ENVCMD $RUNSERIAL $TEST_BIN
+exitcode=$?
+if [ $exitcode -eq 0 ]; then
+ echo "Test prefix for HDF5_VDS_PREFIX PASSED"
+ else
+ nerrors="`expr $nerrors + 1`"
+ echo "***Error encountered for HDF5_VDS_PREFIX test***"
+fi
+$UNENVCMD
+exit $nerrors
diff --git a/test/testvdsswmr.sh.in b/test/testvdsswmr.sh.in
index 32af072..28abcf5 100644
--- a/test/testvdsswmr.sh.in
+++ b/test/testvdsswmr.sh.in
@@ -117,7 +117,9 @@ for FILE in vds_swmr*; do
case "$FILE" in
*.o) continue ;; ## don't copy the .o files
esac
- cp $FILE vds_swmr_test
+ if test -f "$FILE" ; then
+ cp $FILE vds_swmr_test
+ fi
done
# With the --disable-shared option, swmr program files are built in the test
@@ -126,7 +128,14 @@ done
# always be copied, swmr files in .libs should be copied only if they exists.
if [ -f .libs/vds_swmr_writer ]; then
mkdir vds_swmr_test/.libs
- cp .libs/vds_swmr* vds_swmr_test/.libs
+ for FILE in .libs/vds_swmr*; do
+ case "$FILE" in
+ *.o) continue ;; ## don't copy the .o files
+ esac
+ if test -f "$FILE" ; then
+ cp $FILE vds_swmr_test/.libs
+ fi
+ done
fi
cd vds_swmr_test
diff --git a/test/tfile.c b/test/tfile.c
index 2784204..a3bcfb7 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -169,11 +169,20 @@ const char *FILESPACE_NAME[] = {
NULL
};
+
+/* Declarations for test_libver_bounds_copy(): */
+/* SRC_FILE: source file created under 1.8 branch with latest format */
+/* DST_FILE: destination file for copying the dataset in SRC_FILE */
+/* DSET_DS1: the dataset created in SRC_FILE to be copied to DST_FILE */
+#define SRC_FILE "fill18.h5"
+#define DST_FILE "fill18_copy.h5"
+#define DSET_DS1 "DS1"
+
/* Local test function declarations for version bounds */
static void test_libver_bounds_low_high(void);
static void test_libver_bounds_super(hid_t fapl);
-static void test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr);
-static void test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr);
+static void test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non_def_fsm);
+static void test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non_def_fsm);
static void test_libver_bounds_obj(hid_t fapl);
static void test_libver_bounds_dataset(hid_t fapl);
static void test_libver_bounds_dataspace(hid_t fapl);
@@ -896,15 +905,15 @@ test_file_close(void)
CHECK(ret, FAIL, "H5Pget_fclose_degree");
switch(fc_degree) {
- case H5F_CLOSE_STRONG:
+ case H5F_CLOSE_STRONG:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
/* Close second open */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
- break;
- case H5F_CLOSE_SEMI:
+ break;
+ case H5F_CLOSE_SEMI:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
@@ -919,8 +928,8 @@ test_file_close(void)
/* Close second open */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
- break;
- case H5F_CLOSE_WEAK:
+ break;
+ case H5F_CLOSE_WEAK:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
@@ -935,7 +944,7 @@ test_file_close(void)
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id3);
CHECK(ret, FAIL, "H5Gclose");
- break;
+ break;
case H5F_CLOSE_DEFAULT:
default:
CHECK(fc_degree, H5F_CLOSE_DEFAULT, "H5Pget_fclose_degree");
@@ -1089,14 +1098,14 @@ test_get_obj_ids(void)
/* creates NGROUPS groups under the root group */
for(m = 0; m < NGROUPS; m++) {
- sprintf(gname, "group%d", m);
+ HDsprintf(gname, "group%d", m);
gid[m] = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(gid[m], FAIL, "H5Gcreate2");
}
/* create NDSETS datasets under the root group */
for(n = 0; n < NDSETS; n++) {
- sprintf(dname, "dataset%d", n);
+ HDsprintf(dname, "dataset%d", n);
dset[n] = H5Dcreate2(fid, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dset[n], FAIL, "H5Dcreate2");
}
@@ -1156,7 +1165,7 @@ test_get_obj_ids(void)
/* Open NDSETS datasets under the root group */
for(n = 0; n < NDSETS; n++) {
- sprintf(dname, "dataset%d", n);
+ HDsprintf(dname, "dataset%d", n);
dset[n] = H5Dopen2(fid, dname, H5P_DEFAULT);
CHECK(dset[n], FAIL, "H5Dcreate2");
}
@@ -1586,7 +1595,6 @@ test_file_perm2(void)
} /* end test_file_perm2() */
-
/****************************************************************
**
** test_file_ishdf5(): low-level file test routine.
@@ -1651,7 +1659,7 @@ test_file_ishdf5(void)
CHECK(fd, FAIL, "HDopen");
/* Initialize information to write */
- for(u=0; u<1024; u++)
+ for(u = 0; u < 1024; u++)
buf[u]=(unsigned char)u;
/* Write some information */
@@ -2145,6 +2153,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes for v2 B-tree index */
hsize_t chunks[1] = {2}, chunks2[2] = {4, 5}; /* Chunk dimension sizes */
hsize_t size; /* File size */
+ char filename[FILENAME_LEN]; /* Filename to use */
const char* data[] = {"String 1", "String 2", "String 3", "String 4", "String 5"}; /* Input Data */
const char* e_data[] = {"String 1", "String 2", "String 3", "String 4", "String 5", "String 6", "String 7"}; /* Input Data */
char* buffer[5]; /* Output buffer */
@@ -2155,17 +2164,16 @@ test_file_double_file_dataset_open(hbool_t new_format)
MESSAGE(5, ("Testing double file and dataset open/close\n"));
/* Setting up test file */
-
- fapl = H5Pcreate(H5P_FILE_ACCESS);
+ fapl = h5_fileaccess();
CHECK(fapl, FAIL, "H5Pcreate");
-
if(new_format) {
ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
CHECK(ret, FAIL, "H5Pset_libver_bounds");
} /* end if */
+ h5_fixname(FILE1, fapl, filename, sizeof filename);
/* Create the test file */
- fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
CHECK(fid1, FAIL, "H5Fcreate");
/* Create a chunked dataset with fixed array indexing */
@@ -2247,8 +2255,6 @@ test_file_double_file_dataset_open(hbool_t new_format)
CHECK(ret, FAIL, "H5Sclose");
ret = H5Pclose(dcpl);
CHECK(ret, FAIL, "H5Pclose");
- ret = H5Pclose(fapl);
- CHECK(ret, FAIL, "H5Pclose");
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
@@ -2257,7 +2263,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
*/
/* First file open */
- fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid1 = H5Fopen(filename, H5F_ACC_RDWR, fapl);
CHECK(fid1, FAIL, "H5Fopen");
/* First file's dataset open */
@@ -2272,7 +2278,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
CHECK(ret, FAIL, "H5Dwrite");
/* Second file open */
- fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid2 = H5Fopen(filename, H5F_ACC_RDWR, fapl);
CHECK(fid2, FAIL, "H5Fopen");
/* Second file's dataset open */
@@ -2313,11 +2319,11 @@ test_file_double_file_dataset_open(hbool_t new_format)
*/
/* First file open */
- fid1 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ fid1 = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
CHECK(fid1, FAIL, "H5Fopen");
/* Second file open */
- fid2 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ fid2 = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
CHECK(fid2, FAIL, "H5Fopen");
/* Second file's dataset open */
@@ -2378,7 +2384,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
*/
/* First file open */
- fid1 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ fid1 = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
CHECK(fid1, FAIL, "H5Fopen");
/* First file's dataset open */
@@ -2390,7 +2396,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
CHECK(size, 0, "H5Dget_storage_size");
/* Second file open */
- fid2 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ fid2 = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
CHECK(fid2, FAIL, "H5Fopen");
/* Second file's dataset open */
@@ -2423,7 +2429,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
* from second call to H5Dset_extent->...H5D__earray_idx_remove->H5EA_get...H5EA__iblock_protect...H5AC_protect
*/
/* First file open */
- fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid1 = H5Fopen(filename, H5F_ACC_RDWR, fapl);
CHECK(fid1, FAIL, "H5Fopen");
/* First file's dataset open */
@@ -2442,7 +2448,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
CHECK(ret, FAIL, "H5Dwrite");
/* Second file open */
- fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid2 = H5Fopen(filename, H5F_ACC_RDWR, fapl);
CHECK(fid2, FAIL, "H5Fopen");
/* Second file's dataset open */
@@ -2473,6 +2479,9 @@ test_file_double_file_dataset_open(hbool_t new_format)
ret = H5Tclose(tid1);
CHECK(ret, FAIL, "H5Tclose");
+ /* Close FAPL */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
} /* end test_file_double_dataset_open() */
/****************************************************************
@@ -3941,14 +3950,6 @@ error:
** This routine checks the free space available in a file as
** returned by the public routine H5Fget_freespace().
**
-** Modifications:
-** Vailin Choi; July 2012
-** Remove datasets in reverse order so that all file spaces are shrunk.
-** (A change due to H5FD_FLMAP_DICHOTOMY.)
-**
-** Vailin Choi; Dec 2012
-** Add changes due to paged aggregation via new format:
-** the amount of freespace is different.
**
*****************************************************************/
static void
@@ -4057,7 +4058,7 @@ test_file_freespace(const char *env_h5_drvr)
/* Create datasets in file */
for(u = 0; u < 10; u++) {
- sprintf(name, "Dataset %u", u);
+ HDsprintf(name, "Dataset %u", u);
dset = H5Dcreate2(file, name, H5T_STD_U32LE, dspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
CHECK(dset, FAIL, "H5Dcreate2");
@@ -4080,7 +4081,7 @@ test_file_freespace(const char *env_h5_drvr)
/* Delete datasets in file */
for(k = 9; k >= 0; k--) {
- sprintf(name, "Dataset %u", (unsigned)k);
+ HDsprintf(name, "Dataset %u", (unsigned)k);
ret = H5Ldelete(file, name, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Ldelete");
} /* end for */
@@ -4088,10 +4089,7 @@ test_file_freespace(const char *env_h5_drvr)
/* Check that there is the right amount of free space in the file */
free_space = H5Fget_freespace(file);
CHECK(free_space, FAIL, "H5Fget_freespace");
- if(new_format)
- VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
- else
- VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
+ VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
/* Close file */
ret = H5Fclose(file);
@@ -4211,7 +4209,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
/* Create datasets in file */
for(u = 0; u < 10; u++) {
- sprintf(name, "Dataset %u", u);
+ HDsprintf(name, "Dataset %u", u);
dset = H5Dcreate2(file, name, H5T_STD_U32LE, dspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
CHECK(dset, FAIL, "H5Dcreate2");
@@ -4229,7 +4227,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
/* Delete odd-numbered datasets in file */
for(u = 0; u < 10; u++) {
- sprintf(name, "Dataset %u", u);
+ HDsprintf(name, "Dataset %u", u);
if(u % 2) {
ret = H5Ldelete(file, name, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Ldelete");
@@ -4517,7 +4515,7 @@ test_filespace_1_10_0_compatible(void)
for(j = 0; j < NELMTS(OLD_1_10_0_FILENAME); j++) {
/* Make a copy of the test file */
status = h5_make_local_copy(OLD_1_10_0_FILENAME[j], FILE5);
- CHECK(status, FAIL, "h5_make_local_copy");
+ CHECK(status, FAIL, "h5_make_local_copy");
/* Open the temporary test file */
fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT);
@@ -5081,6 +5079,79 @@ test_libver_bounds_open(void)
} /* end test_libver_bounds_open() */
+/*-------------------------------------------------------------------------
+ * Function: test_libver_bounds_copy
+ *
+ * Purpose: Test to verify HDFFV-10800 is fixed:
+ * This test is copied from the user test program: copy10.c.
+ * (See attached programs in the jira issue.)
+ *
+ * The source file used in the test is generated by the user test
+ * program "fill18.c" with the 1.8 library. The file is created
+ * with the latest format and the dataset created in the file
+ * has version 3 fill value message (latest).
+ *
+ * The test creates the destination file with (v18, v18) version bounds.
+ * H5Ocopy() should succeed in copying the dataset in the source file
+ * to the destination file.
+ *
+ * Return: Success: 0
+ * Failure: number of errors
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+test_libver_bounds_copy(void)
+{
+ hid_t src_fid = -1; /* File ID */
+ hid_t dst_fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list ID */
+ const char *src_fname; /* Source file name */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about the test being performed */
+ MESSAGE(5, ("Testing H5Ocopy a dataset in a 1.8 library file to a 1.10 library file\n"));
+
+ /* Get the test file name */
+ src_fname = H5_get_srcdir_filename(SRC_FILE);
+
+ /* Open the source test file */
+ src_fid = H5Fopen(src_fname, H5F_ACC_RDONLY, H5P_DEFAULT);
+ CHECK(src_fid, FAIL, "H5Fopen");
+
+ /* Create file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Set library version bounds to (v18, v18) */
+ ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create the destination file with the fapl */
+ dst_fid = H5Fcreate(DST_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(dst_fid, FAIL, "H5Pcreate");
+
+ /* Close the fapl */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Copy the dataset in the source file to the destination file */
+ ret = H5Ocopy(src_fid, DSET_DS1, dst_fid, DSET_DS1, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(ret, SUCCEED, "H5Ocopy");
+
+ /* Close the source file */
+ ret = H5Fclose(src_fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Close the destination file */
+ ret = H5Fclose(dst_fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Remove the destination file */
+ HDremove(DST_FILE);
+
+} /* end test_libver_bounds_copy() */
+
/****************************************************************
**
** test_libver_bounds():
@@ -5099,6 +5170,7 @@ test_libver_bounds(void)
test_libver_bounds_real(H5F_LIBVER_EARLIEST, 1, H5F_LIBVER_LATEST, 2);
test_libver_bounds_real(H5F_LIBVER_LATEST, 2, H5F_LIBVER_EARLIEST, 2);
test_libver_bounds_open();
+ test_libver_bounds_copy();
} /* end test_libver_bounds() */
/**************************************************************************************
@@ -5125,16 +5197,16 @@ test_libver_bounds(void)
static void
test_libver_bounds_low_high(void)
{
- hid_t fapl = -1; /* File access property list */
- H5F_libver_t low, high; /* Low and high bounds */
- herr_t ret; /* The return value */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ H5F_libver_t low, high; /* Low and high bounds */
+ herr_t ret; /* The return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing setting (low, high) format version bounds\n"));
/* Create a file access property list */
fapl = H5Pcreate(H5P_FILE_ACCESS);
- CHECK(fapl, FAIL, "H5Pcreate");
+ CHECK(fapl, H5I_INVALID_HID, "H5Pcreate");
/* Loop through all the combinations of low/high version bounds */
for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++)
@@ -5197,23 +5269,23 @@ test_libver_bounds_low_high(void)
static void
test_libver_bounds_super(hid_t fapl)
{
- hid_t fcpl = -1; /* File creation property list */
- herr_t ret; /* The return value */
+ hid_t fcpl = H5I_INVALID_HID; /* File creation property list */
+ herr_t ret; /* The return value */
/* Create a default fcpl: #A */
/* This will result in superblock version 0 */
fcpl = H5Pcreate(H5P_FILE_CREATE);
- CHECK(fcpl, FAIL, "H5Pcreate");
+ CHECK(fcpl, H5I_INVALID_HID, "H5Pcreate");
/* Verify superblock version when creating a file with input fapl,
fcpl #A and with/without SWMR access */
- test_libver_bounds_super_create(fapl, fcpl, TRUE);
- test_libver_bounds_super_create(fapl, fcpl, FALSE);
+ test_libver_bounds_super_create(fapl, fcpl, TRUE, FALSE);
+ test_libver_bounds_super_create(fapl, fcpl, FALSE, FALSE);
/* Verify superblock version when opening a file which is created
with input fapl, fcpl #A and with/without SWMR access */
- test_libver_bounds_super_open(fapl, fcpl, TRUE);
- test_libver_bounds_super_open(fapl, fcpl, FALSE);
+ test_libver_bounds_super_open(fapl, fcpl, TRUE, FALSE);
+ test_libver_bounds_super_open(fapl, fcpl, FALSE, FALSE);
/* Close the fcpl */
ret = H5Pclose(fcpl);
@@ -5222,19 +5294,19 @@ test_libver_bounds_super(hid_t fapl)
/* Create a fcpl with v1-btree K value enabled: #B */
/* This will result in superblock version 1 */
fcpl = H5Pcreate(H5P_FILE_CREATE);
- CHECK(fcpl, FAIL, "H5Pcreate");
+ CHECK(fcpl, H5I_INVALID_HID, "H5Pcreate");
ret = H5Pset_istore_k(fcpl, 64);
CHECK(ret, FAIL, "H5Pset_istore_k");
/* Verify superblock version when creating a file with input fapl,
fcpl #B and with/without SWMR access */
- test_libver_bounds_super_create(fapl, fcpl, TRUE);
- test_libver_bounds_super_create(fapl, fcpl, FALSE);
+ test_libver_bounds_super_create(fapl, fcpl, TRUE, FALSE);
+ test_libver_bounds_super_create(fapl, fcpl, FALSE, FALSE);
/* Verify superblock version when opening a file which is created
with input fapl, fcpl #B and with/without SWMR access */
- test_libver_bounds_super_open(fapl, fcpl, TRUE);
- test_libver_bounds_super_open(fapl, fcpl, FALSE);
+ test_libver_bounds_super_open(fapl, fcpl, TRUE, FALSE);
+ test_libver_bounds_super_open(fapl, fcpl, FALSE, FALSE);
/* Close the fcpl */
ret = H5Pclose(fcpl);
@@ -5243,7 +5315,7 @@ test_libver_bounds_super(hid_t fapl)
/* Create a fcpl with shared messages enabled: #C */
/* This will result in superblock version 2 */
fcpl = H5Pcreate(H5P_FILE_CREATE);
- CHECK(fcpl, FAIL, "H5Pcreate");
+ CHECK(fcpl, H5I_INVALID_HID, "H5Pcreate");
ret = H5Pset_shared_mesg_nindexes(fcpl, 1);
CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes");
ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2);
@@ -5251,13 +5323,13 @@ test_libver_bounds_super(hid_t fapl)
/* Verify superblock version when creating a file with input fapl,
fcpl #C and with/without SWMR access */
- test_libver_bounds_super_create(fapl, fcpl, TRUE);
- test_libver_bounds_super_create(fapl, fcpl, FALSE);
+ test_libver_bounds_super_create(fapl, fcpl, TRUE, FALSE);
+ test_libver_bounds_super_create(fapl, fcpl, FALSE, FALSE);
/* Verify superblock version when opening a file which is created
with input fapl, fcpl #C and with/without SWMR access */
- test_libver_bounds_super_open(fapl, fcpl, TRUE);
- test_libver_bounds_super_open(fapl, fcpl, FALSE);
+ test_libver_bounds_super_open(fapl, fcpl, TRUE, FALSE);
+ test_libver_bounds_super_open(fapl, fcpl, FALSE, FALSE);
/* Close the fcpl */
ret = H5Pclose(fcpl);
@@ -5266,19 +5338,19 @@ test_libver_bounds_super(hid_t fapl)
/* Create a fcpl with persistent free-space manager enabled: #D */
/* This will result in superblock version 2 */
fcpl = H5Pcreate(H5P_FILE_CREATE);
- CHECK(fcpl, FAIL, "H5Pcreate");
+ CHECK(fcpl, H5I_INVALID_HID, "H5Pcreate");
ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, 1, (hsize_t)1);
CHECK(ret, FAIL, "H5Pset_file_space");
/* Verify superblock version when creating a file with input fapl,
fcpl #D and with/without SWMR access */
- test_libver_bounds_super_create(fapl, fcpl, TRUE);
- test_libver_bounds_super_create(fapl, fcpl, FALSE);
+ test_libver_bounds_super_create(fapl, fcpl, TRUE, TRUE);
+ test_libver_bounds_super_create(fapl, fcpl, FALSE, TRUE);
/* Verify superblock version when opening a file which is created
with input fapl, fcpl #D and with/without SWMR access */
- test_libver_bounds_super_open(fapl, fcpl, TRUE);
- test_libver_bounds_super_open(fapl, fcpl, FALSE);
+ test_libver_bounds_super_open(fapl, fcpl, TRUE, TRUE);
+ test_libver_bounds_super_open(fapl, fcpl, FALSE, TRUE);
/* Close the fcpl */
ret = H5Pclose(fcpl);
@@ -5290,8 +5362,8 @@ test_libver_bounds_super(hid_t fapl)
/**************************************************************************************************
**
** test_libver_bounds_super_create():
-** Verify the following when the file is created with the input fapl, fcpl, and
-** with/without SWMR access:
+** Verify the following when the file is created with the input fapl, fcpl,
+** and with/without SWMR access:
** (a) the superblock version #
** (b) the file's low bound setting
** (c) fail or succeed in creating the file
@@ -5303,7 +5375,10 @@ test_libver_bounds_super(hid_t fapl)
** in the input fapl. The next three rows list the expected results for #a to #c.
** "-->" indicates "upgrade to"
**
-** Creating a file with write access
+** The last table lists the expected results in creating the file when non-default
+** free-space info (fsinfo) is enabled in fcpl.
+**
+** Creating a file with write access
** --------------------------------------------------------------------------------
** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
** |______________________________________________________________________________|
@@ -5314,7 +5389,7 @@ test_libver_bounds_super(hid_t fapl)
** File creation | succeed |
** |______________________________________________________________________________|
**
-** Creating a file with SWMR-write access
+** Creating a file with SWMR-write access
** --------------------------------------------------------------------------------
** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
** |______________________________________________________________________________|
@@ -5322,18 +5397,25 @@ test_libver_bounds_super(hid_t fapl)
** |------------------------------------------------------------------------------|
** File's low bound | -- | ->v110 | -- | ->v110 | no change |
** |------------------------------------------------------------------------------|
-** File creation | fail | succeed | fail | succeed | succed |
+** File creation | fail | succeed | fail | succeed | succeed |
+** |______________________________________________________________________________|
+**
+** Creating a file with write/SWMR-write access + non-default fsinfo
+** --------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |______________________________________________________________________________|
+** File creation | fail | succeed | fail | succeed | succeed |
** |______________________________________________________________________________|
**
******************************************************************************************************/
static void
-test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr)
+test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non_def_fsm)
{
- hid_t fid = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file pointer */
- H5F_libver_t low, high; /* Low and high bounds */
- hbool_t ok; /* The result is ok or not */
- herr_t ret; /* The return value */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ hbool_t ok; /* The result is ok or not */
+ herr_t ret; /* The return value */
/* Try to create the file */
H5E_BEGIN_TRY {
@@ -5341,7 +5423,7 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr)
} H5E_END_TRY;
/* Get the internal file pointer if the create succeeds */
- if((ok = fid >= 0)) {
+ if(fid >= 0) {
f = (H5F_t *)H5I_object(fid);
CHECK(f, NULL, "H5I_object");
}
@@ -5350,47 +5432,50 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr)
ret = H5Pget_libver_bounds(fapl, &low, &high);
CHECK(ret, FAIL, "H5Pget_libver_bounds");
- if(is_swmr) { /* SWMR is enabled */
+ if(non_def_fsm && high < H5F_LIBVER_LATEST)
+ VERIFY(fid, H5I_INVALID_HID, "H5Fcreate");
+ else if(is_swmr) { /* SWMR is enabled */
if(high == H5F_LIBVER_LATEST) { /* Should succeed */
- VERIFY(ok, TRUE, "H5Fcreate");
+ VERIFY(fid >= 0, TRUE, "H5Fcreate");
VERIFY(HDF5_SUPERBLOCK_VERSION_3, f->shared->sblock->super_vers, "HDF5_superblock_ver_bounds");
VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds");
} else /* Should fail */
- VERIFY(ok, FALSE, "H5Fcreate");
+ VERIFY(fid >= 0, FALSE, "H5Fcreate");
} else { /* Should succeed */
- VERIFY(ok, TRUE, "H5Fcreate");
+ VERIFY(fid >= 0, TRUE, "H5Fcreate");
VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds");
switch(low) {
case H5F_LIBVER_EARLIEST:
- ok = (f->shared->sblock->super_vers == 0 ||
- f->shared->sblock->super_vers == 1 ||
- f->shared->sblock->super_vers == 2);
- VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
- break;
+ ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_DEF ||
+ f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_1 ||
+ f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2);
+ VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
+ break;
case H5F_LIBVER_V18:
- ok = (f->shared->sblock->super_vers == 2);
- VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
- break;
+ ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2);
+ VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
+ break;
case H5F_LIBVER_V110:
- ok = (f->shared->sblock->super_vers == 3);
+ ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_3);
VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
break;
case H5F_LIBVER_ERROR:
case H5F_LIBVER_NBOUNDS:
default:
- ERROR("H5Pget_libver_bounds");
+ ERROR("H5Pget_libver_bounds");
} /* end switch */
- }
- if(ok) { /* Close the file */
+ } /* end else */
+
+ if(fid >= 0) { /* Close the file */
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
}
@@ -5415,11 +5500,14 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr)
** For file open, the file's superblock version, the low/high bounds setting in fapl,
** and with/without SWMR file access will determine the results for #a and #b.
**
-** The first row for the following tables is the 5 pairs of low/high bounds setting
+** The first row for the following tables (#A - #B) is the 5 pairs of low/high bounds setting
** in the input fapl. The next two rows list the expected results for #a and #b.
** "-->" indicates "upgrade to"
**
-** Opening a file with write access
+** The last table (#C) lists the expected results in opening the file when non-default
+** free-space info (fsinfo) is enabled in fcpl.
+**
+** (A) Opening a file with write access
**
** Superblock version 0, 1
** --------------------------------------------------------------------------------
@@ -5451,7 +5539,7 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr)
**
**
**
-** Opening a file with SWMR-write access
+** (B) Opening a file with SWMR-write access
**
** Superblock version 0, 1, 2
** -------------------------------------------------------------------------------
@@ -5473,111 +5561,133 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr)
** |_____________________________________________________________________________|
**
**
+** (C) Opening a file with write/SWMR-write access + non-default fsinfo
+** -------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v10) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |_____________________________________________________________________________|
+** File open | fail | succeed | fail | succeed | succeed |
+** |_____________________________________________________________________________|
+**
+**
******************************************************************************************************/
static void
-test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr)
+test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non_def_fsm)
{
- hid_t fid = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file pointer */
- hid_t new_fapl = -1; /* File access property list */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ H5F_t *f = NULL; /* Internal file pointer */
+ hid_t new_fapl = H5I_INVALID_HID; /* File access property list */
unsigned super_vers; /* Superblock version */
H5F_libver_t low, high; /* Low and high bounds */
- hbool_t ok; /* The result is ok or not */
herr_t ret; /* Return value */
/* Create the file with the input fcpl and fapl */
- fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ H5E_BEGIN_TRY {
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl);
+ } H5E_END_TRY;
- /* Get the internal file pointer */
- f = (H5F_t *)H5I_object(fid);
- CHECK(f, NULL, "H5I_object");
+ /* Retrieve the low/high bounds */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
- /* The file's superblock version */
- super_vers = f->shared->sblock->super_vers;
+ if(non_def_fsm && high < H5F_LIBVER_LATEST) {
+ VERIFY(fid, H5I_INVALID_HID, "H5Fcreate");
- /* Close the file */
- ret = H5Fclose(fid);
- CHECK(ret, FAIL, "H5Fclose");
+ } else {
+ VERIFY(fid >= 0, TRUE, "H5Fcreate");
- /* Create a default file access property list */
- new_fapl = H5Pcreate(H5P_FILE_ACCESS);
- CHECK(new_fapl, FAIL, "H5Pcreate");
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5I_object(fid);
+ CHECK(f, NULL, "H5I_object");
- /* Loop through all the combinations of low/high bounds in new_fapl */
- for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
- for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
- H5E_BEGIN_TRY {
- ret = H5Pset_libver_bounds(new_fapl, low, high);
- } H5E_END_TRY;
+ /* The file's superblock version */
+ super_vers = f->shared->sblock->super_vers;
- /* Invalid combinations */
- if (ret < 0)
- continue;
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
- /* Open the file with or without SWMR access */
- H5E_BEGIN_TRY {
- fid = H5Fopen(FILE8, H5F_ACC_RDWR | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), new_fapl);
- } H5E_END_TRY;
+ /* Create a default file access property list */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, FAIL, "H5Pcreate");
- /* Get the internal file pointer if the open succeeds */
- if((ok = fid >= 0)) {
- f = (H5F_t *)H5I_object(fid);
- CHECK(f, NULL, "H5I_object");
- }
+ /* Loop through all the combinations of low/high bounds in new_fapl */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) {
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
- /* Verify the file open succeeds or fails */
- switch(super_vers) {
- case 3:
- if(high == H5F_LIBVER_LATEST) {
- /* Should succeed */
- VERIFY(ok, TRUE, "H5Fopen");
- VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds");
-
- /* Close the file */
- ret = H5Fclose(fid);
- CHECK(ret, FAIL, "H5Fclose");
- } else /* Should fail */
- VERIFY(ok, FALSE, "H5Fopen");
- break;
-
- case 2:
- if(is_swmr) /* Should fail */
- VERIFY(ok, FALSE, "H5Fopen");
- else { /* Should succeed */
- VERIFY(ok, TRUE, "H5Fopen");
-
- ok = f->shared->low_bound >= H5F_LIBVER_V18;
- VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
-
- /* Close the file */
- ret = H5Fclose(fid);
- CHECK(ret, FAIL, "H5Fclose");
- }
- break;
-
- case 1:
- case 0:
- if(is_swmr) /* Should fail */
- VERIFY(ok, FALSE, "H5Fopen");
- else { /* Should succeed */
- VERIFY(ok, TRUE, "H5Fopen");
- VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds");
-
- ret = H5Fclose(fid);
- CHECK(ret, FAIL, "H5Fclose");
- }
- break;
+ /* Invalid combinations */
+ if (ret < 0)
+ continue;
+
+ /* Open the file with or without SWMR access */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), new_fapl);
+ } H5E_END_TRY;
+
+ if(non_def_fsm && high < H5F_LIBVER_LATEST) {
+ VERIFY(fid, H5I_INVALID_HID, "H5Fopen");
+ continue;
+ }
- default:
- break;
- } /* end switch */
+ /* Get the internal file pointer if the open succeeds */
+ if(fid >= 0) {
+ f = (H5F_t *)H5I_object(fid);
+ CHECK(f, NULL, "H5I_object");
+ }
+
+ /* Verify the file open succeeds or fails */
+ switch(super_vers) {
+ case 3:
+ if(high == H5F_LIBVER_LATEST) {
+ /* Should succeed */
+ VERIFY(fid >= 0, TRUE, "H5Fopen");
+ VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ } else /* Should fail */
+ VERIFY(fid >= 0, FALSE, "H5Fopen");
+ break;
+
+ case 2:
+ if(is_swmr) /* Should fail */
+ VERIFY(fid >= 0, FALSE, "H5Fopen");
+ else { /* Should succeed */
+ VERIFY(fid >= 0, TRUE, "H5Fopen");
+ VERIFY(f->shared->low_bound >= H5F_LIBVER_V18, TRUE, "HDF5_superblock_ver_bounds");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ }
+ break;
+
+ case 1:
+ case 0:
+ if(is_swmr) /* Should fail */
+ VERIFY(fid >= 0, FALSE, "H5Fopen");
+ else { /* Should succeed */
+ VERIFY(fid >= 0, TRUE, "H5Fopen");
+ VERIFY(f->shared->low_bound, low, "HDF5_superblock_ver_bounds");
+
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ }
+ break;
+
+ default:
+ break;
+ } /* end switch */
+ } /* end for */
} /* end for */
- } /* end for */
- /* Close the file access property list */
- ret = H5Pclose(new_fapl);
- CHECK(ret, FAIL, "H5Pclose");
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+ } /* end else */
} /* end test_libver_bounds_super_open() */
@@ -5610,10 +5720,10 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr)
static void
test_libver_bounds_obj(hid_t fapl)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group ID */
- hid_t fcpl = -1; /* File creation property list */
- hid_t new_fapl = -1; /* File access property list */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t fcpl = H5I_INVALID_HID; /* File creation property list */
+ hid_t new_fapl = H5I_INVALID_HID; /* File access property list */
H5F_t *f = NULL; /* Internal file pointer */
H5F_libver_t low, high; /* Low and high bounds */
H5O_info_t oinfo; /* Object info */
@@ -5626,7 +5736,7 @@ test_libver_bounds_obj(hid_t fapl)
/* Create a default file creation property list */
fcpl = H5Pcreate(H5P_FILE_CREATE);
- CHECK(fcpl, FAIL, "H5Pcreate");
+ CHECK(fcpl, H5I_INVALID_HID, "H5Pcreate");
/* Enable shared message in the fcpl */
/* This will result in a version 2 object header */
@@ -5637,7 +5747,7 @@ test_libver_bounds_obj(hid_t fapl)
/* Create the file with the fcpl and the input fapl */
fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
/* Get root group's object info */
ret = H5Oget_info_by_name2(fid, "/", &oinfo, H5O_INFO_HDR, H5P_DEFAULT);
@@ -5656,7 +5766,7 @@ test_libver_bounds_obj(hid_t fapl)
/* Create a file with the default fcpl and input fapl */
fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
/* Get root group's object info */
ret = H5Oget_info_by_name2(fid, "/", &oinfo, H5O_INFO_HDR, H5P_DEFAULT);
@@ -5672,7 +5782,7 @@ test_libver_bounds_obj(hid_t fapl)
/* Create a new default file access property list which
is used to open the file in the "for" loop */
new_fapl = H5Pcreate(H5P_FILE_ACCESS);
- CHECK(new_fapl, FAIL, "H5Pcreate");
+ CHECK(new_fapl, H5I_INVALID_HID, "H5Pcreate");
/* Loop through all the combinations of low/high bounds in new_fapl */
/* Open the file with the fapl; create a group and verify the
@@ -5770,11 +5880,11 @@ test_libver_bounds_obj(hid_t fapl)
static void
test_libver_bounds_dataset(hid_t fapl)
{
- hid_t fid = -1; /* File ID */
- hid_t new_fapl = -1; /* File access property list */
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t new_fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
H5D_t *dset = NULL; /* Internal dataset pointer */
H5F_t *f = NULL; /* Internal file pointer */
H5F_libver_t low, high; /* Low and high bounds */
@@ -5791,15 +5901,15 @@ test_libver_bounds_dataset(hid_t fapl)
/* Create the file with the input fapl */
fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
/* Create the dataspace */
sid = H5Screate(H5S_SCALAR);
- CHECK(sid, FAIL, "H5Screate");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
/* Create a contiguous dataset */
did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate");
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate");
/* Get the internal dataset pointer */
dset = (H5D_t *)H5I_object(did);
@@ -5831,9 +5941,9 @@ test_libver_bounds_dataset(hid_t fapl)
with "no filter edge chunks" enabled.
This will result in a version 4 layout message */
sid = H5Screate_simple(2, fix_dims2, NULL);
- CHECK(sid, FAIL, "H5Screate_simple");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate");
ret = H5Pset_chunk(dcpl, 2, fix_chunks2);
CHECK(ret, FAIL, "H5Pset_chunk");
ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS);
@@ -5874,14 +5984,14 @@ test_libver_bounds_dataset(hid_t fapl)
/* Create a default file access property list which is used
to open the file in the 'for' loop */
new_fapl = H5Pcreate(H5P_FILE_ACCESS);
- CHECK(new_fapl, FAIL, "H5Pcreate");
+ CHECK(new_fapl, H5I_INVALID_HID, "H5Pcreate");
/* Set up dataspace and dcpl for creating a chunked dataset with
2 unlimited dimensions in the 'for' loop */
sid = H5Screate_simple(2, dims2, max_dims2);
- CHECK(sid, FAIL, "H5Screate_simple");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate");
ret = H5Pset_chunk(dcpl, 2, chunks2);
CHECK(ret, FAIL, "H5Pset_chunk");
@@ -5910,7 +6020,7 @@ test_libver_bounds_dataset(hid_t fapl)
/* Create the chunked dataset */
did = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate2");
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
/* Get the internal file pointer */
dset = (H5D_t *)H5I_object(did);
@@ -5994,14 +6104,14 @@ test_libver_bounds_dataset(hid_t fapl)
static void
test_libver_bounds_dataspace(hid_t fapl)
{
- hid_t fid = -1; /* File ID */
- hid_t new_fapl = -1; /* File access property list */
- hid_t did = -1, did_null = -1; /* Dataset IDs */
- hid_t did_compact = -1, did_contig = -1; /* Dataset IDs */
- hid_t sid = -1, sid_null = -1; /* Dataspace IDs */
- hid_t sid_compact = -1, sid_contig = -1; /* Dataspace IDs */
- hid_t dcpl = -1; /* Dataset creation property list */
- hid_t dcpl_compact = -1, dcpl_contig = -1; /* Dataset creation property lists */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t new_fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t did = H5I_INVALID_HID, did_null = H5I_INVALID_HID; /* Dataset IDs */
+ hid_t did_compact = H5I_INVALID_HID, did_contig = H5I_INVALID_HID; /* Dataset IDs */
+ hid_t sid = H5I_INVALID_HID, sid_null = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t sid_compact = H5I_INVALID_HID, sid_contig = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+ hid_t dcpl_compact = H5I_INVALID_HID, dcpl_contig = H5I_INVALID_HID; /* Dataset creation property lists */
H5S_t *space = NULL, *space_null = NULL; /* Internal dataspace pointers */
H5F_t *f = NULL; /* Internal file pointer */
H5F_libver_t low, high; /* Low and high bounds */
@@ -6017,19 +6127,19 @@ test_libver_bounds_dataspace(hid_t fapl)
/* Create the file with the input fapl */
fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
/* Create scalar dataspace */
sid = H5Screate(H5S_SCALAR);
- CHECK(sid, FAIL, "H5Screate");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
/* Create a dataset with the scalar dataspace */
did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate");
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate");
/* Get the internal dataspace pointer */
sid = H5Dget_space(did);
- CHECK(sid, FAIL, "H5Dget_space");
+ CHECK(sid, H5I_INVALID_HID, "H5Dget_space");
space = (H5S_t *)H5I_object(sid);
CHECK(space, NULL, "H5I_object");
@@ -6038,15 +6148,15 @@ test_libver_bounds_dataspace(hid_t fapl)
/* Create null dataspace */
sid_null = H5Screate(H5S_NULL);
- CHECK(sid_null, FAIL, "H5Screate");
+ CHECK(sid_null, H5I_INVALID_HID, "H5Screate");
/* Create a dataset with the null dataspace */
did_null = H5Dcreate2(fid, DSET_NULL, H5T_NATIVE_INT, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(did_null, FAIL, "H5Dcreate");
+ CHECK(did_null, H5I_INVALID_HID, "H5Dcreate");
/* Get the internal dataspace pointer */
sid_null = H5Dget_space(did_null);
- CHECK(sid_null, FAIL, "H5Dget_space");
+ CHECK(sid_null, H5I_INVALID_HID, "H5Dget_space");
space_null = (H5S_t *)H5I_object(sid_null);
CHECK(space_null, NULL, "H5I_object");
@@ -6072,29 +6182,29 @@ test_libver_bounds_dataspace(hid_t fapl)
/* Create a default file access property list which is used
to open the file in the 'for' loop */
new_fapl = H5Pcreate(H5P_FILE_ACCESS);
- CHECK(new_fapl, FAIL, "H5Pcreate");
+ CHECK(new_fapl, H5I_INVALID_HID, "H5Pcreate");
/* Set up dataspace and dcpl for creating a chunked dataset */
sid = H5Screate_simple(1, dims, max_dims);
- CHECK(sid, FAIL, "H5Screate_simple");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate");
ret = H5Pset_chunk(dcpl, 1, chunks);
CHECK(ret, FAIL, "H5Pset_chunk");
/* Set up dataspace and dcpl for creating a compact dataset */
sid_compact = H5Screate_simple(1, dims, NULL);
- CHECK(sid_compact, FAIL, "H5Screate_simple");
+ CHECK(sid_compact, H5I_INVALID_HID, "H5Screate_simple");
dcpl_compact = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl_compact, FAIL, "H5Pcreate");
+ CHECK(dcpl_compact, H5I_INVALID_HID, "H5Pcreate");
ret = H5Pset_layout(dcpl_compact, H5D_COMPACT);
CHECK(ret, FAIL, "H5Pset_layout");
/* Set up dataspace and dcpl for creating a contiguous dataset */
sid_contig = H5Screate_simple(2, dims2, NULL);
- CHECK(sid_contig, FAIL, "H5Screate_simple");
+ CHECK(sid_contig, H5I_INVALID_HID, "H5Screate_simple");
dcpl_contig = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl_contig, FAIL, "H5Pcreate");
+ CHECK(dcpl_contig, H5I_INVALID_HID, "H5Pcreate");
ret = H5Pset_layout(dcpl_contig, H5D_CONTIGUOUS);
CHECK(ret, FAIL, "H5Pset_layout");
@@ -6126,31 +6236,31 @@ test_libver_bounds_dataspace(hid_t fapl)
/* Create the chunked dataset */
did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate2");
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
/* Get the internal dataspace pointer for the chunked dataset */
tmp_sid = H5Dget_space(did);
- CHECK(tmp_sid, FAIL, "H5Dget_space");
+ CHECK(tmp_sid, H5I_INVALID_HID, "H5Dget_space");
tmp_space = (H5S_t *)H5I_object(tmp_sid);
CHECK(tmp_space, NULL, "H5I_object");
/* Create the compact dataset */
did_compact = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid_compact, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT);
- CHECK(did_compact, FAIL, "H5Dcreate2");
+ CHECK(did_compact, H5I_INVALID_HID, "H5Dcreate2");
/* Get the internal dataspace pointer for the compact dataset */
tmp_sid_compact = H5Dget_space(did_compact);
- CHECK(tmp_sid_compact, FAIL, "H5Dget_space");
+ CHECK(tmp_sid_compact, H5I_INVALID_HID, "H5Dget_space");
tmp_space_compact = (H5S_t *)H5I_object(tmp_sid_compact);
CHECK(tmp_space_compact, NULL, "H5I_object");
/* Create the contiguous dataset */
did_contig = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid_contig, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT);
- CHECK(did_contig, FAIL, "H5Dcreate2");
+ CHECK(did_contig, H5I_INVALID_HID, "H5Dcreate2");
/* Get the internal dataspace pointer for the contiguous dataset */
tmp_sid_contig = H5Dget_space(did_contig);
- CHECK(tmp_sid_contig, FAIL, "H5Dget_space");
+ CHECK(tmp_sid_contig, H5I_INVALID_HID, "H5Dget_space");
tmp_space_contig = (H5S_t *)H5I_object(tmp_sid_contig);
CHECK(tmp_space_contig, NULL, "H5I_object");
@@ -6232,8 +6342,8 @@ test_libver_bounds_dataspace(hid_t fapl)
static void
test_libver_bounds_datatype(hid_t fapl)
{
- hid_t tid = -1, tid_enum = -1, tid_array = -1; /* Datatype IDs */
- hid_t tid_compound = -1, tid_vlen = -1; /* Datatype IDs */
+ hid_t tid = H5I_INVALID_HID, tid_enum = H5I_INVALID_HID, tid_array = H5I_INVALID_HID; /* Datatype IDs */
+ hid_t tid_compound = H5I_INVALID_HID, tid_vlen = H5I_INVALID_HID; /* Datatype IDs */
int enum_value; /* Value for enum datatype */
typedef struct s1 { /* Data structure for compound datatype */
char c;
@@ -6324,13 +6434,13 @@ test_libver_bounds_datatype(hid_t fapl)
static void
test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
{
- hid_t fid = -1; /* File ID */
- hid_t new_fapl = -1; /* File acess property list */
- hid_t dcpl = -1; /* Dataset creation property list */
- hid_t dtid = -1; /* Datatype ID for the dataset */
- hid_t str_tid = -1; /* String datatype ID */
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t new_fapl = H5I_INVALID_HID; /* File acess property list */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+ hid_t dtid = H5I_INVALID_HID; /* Datatype ID for the dataset */
+ hid_t str_tid = H5I_INVALID_HID; /* String datatype ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
hsize_t dims[1] = {1}; /* Dimension sizes */
hsize_t dims2[2] = {5, 4}; /* Dimension sizes */
hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */
@@ -6347,12 +6457,12 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
/* Create the file with the input fapl */
fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
/* Create a committed datatype of string which will be used
later inside the 'for' loop */
str_tid = H5Tcopy(H5T_C_S1);
- CHECK(str_tid, FAIL, "H5Tcopy");
+ CHECK(str_tid, H5I_INVALID_HID, "H5Tcopy");
ret = H5Tset_size(str_tid, (size_t)10);
CHECK(ret, FAIL, "H5Tset_size");
ret = H5Tcommit2(fid, "datatype", str_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -6362,15 +6472,15 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
/* Create dataspace */
sid = H5Screate_simple(1, dims, NULL);
- CHECK(sid, FAIL, "H5Screate_simple");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
/* Create a dataset with the input tid */
did = H5Dcreate2(fid, DSET1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate2");
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
/* Get the dataset's datatype */
dtid = H5Dget_type(did);
- CHECK(dtid, FAIL, "H5Dget_type");
+ CHECK(dtid, H5I_INVALID_HID, "H5Dget_type");
/* Get the internal datatype pointer */
dtype = (H5T_t *)H5I_object(dtid);
@@ -6412,13 +6522,13 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
/* Create a default file access property list */
new_fapl = H5Pcreate(H5P_FILE_ACCESS);
- CHECK(new_fapl, FAIL, "H5Pcreate");
+ CHECK(new_fapl, H5I_INVALID_HID, "H5Pcreate");
/* Set up dataspace and dcpl for creating a chunked dataset */
sid = H5Screate_simple(2, dims2, max_dims2);
- CHECK(sid, FAIL, "H5Screate_simple");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate");
ret = H5Pset_chunk(dcpl, 2, chunks);
CHECK(ret, FAIL, "H5Pset_chunk");
@@ -6462,11 +6572,11 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
/* Create the chunked dataset */
did = H5Dcreate2(fid, DSETNAME, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate2");
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
/* Get the dataset's datatype */
dtid = H5Dget_type(did);
- CHECK(dtid, FAIL, "H5Dget_type");
+ CHECK(dtid, H5I_INVALID_HID, "H5Dget_type");
/* Get the internal datatype pointer */
dtype = (H5T_t *)H5I_object(dtid);
@@ -6559,14 +6669,14 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
static void
test_libver_bounds_attributes(hid_t fapl)
{
- hid_t fid = -1; /* File ID */
- hid_t fcpl = -1; /* File creation property list */
- hid_t new_fapl = -1; /* File access property list */
- hid_t tid = -1; /* Datatype ID */
- hid_t gid = -1; /* Group ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t aid = -1; /* Attribute ID */
- hid_t attr_cpl = -1; /* Attribute creation property list */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fcpl = H5I_INVALID_HID; /* File creation property list */
+ hid_t new_fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t tid = H5I_INVALID_HID; /* Datatype ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
+ hid_t attr_cpl = H5I_INVALID_HID; /* Attribute creation property list */
H5A_t *attr = NULL; /* Internal attribute pointer */
H5F_t *f = NULL; /* Internal file pointer */
H5F_libver_t low, high; /* Low and high bounds */
@@ -6578,11 +6688,11 @@ test_libver_bounds_attributes(hid_t fapl)
/* Create the file */
fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
/* Integer datatpye */
tid = H5Tcopy(H5T_NATIVE_INT);
- CHECK(tid, FAIL, "H5Tcopy");
+ CHECK(tid, H5I_INVALID_HID, "H5Tcopy");
/* Create a committed datatype */
ret = H5Tcommit2(fid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -6590,15 +6700,15 @@ test_libver_bounds_attributes(hid_t fapl)
/* Create dataspace */
sid = H5Screate(H5S_SCALAR);
- CHECK(sid, FAIL, "H5Screate");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
/* Create a group */
gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(gid, FAIL, "H5Gcreate2");
+ CHECK(gid, H5I_INVALID_HID, "H5Gcreate2");
/* Attach an attribute to the group with the committed datatype */
aid = H5Acreate2(gid, "attr1", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate2");
+ CHECK(aid, H5I_INVALID_HID, "H5Acreate2");
/* Get the internal attribute pointer */
attr = (H5A_t *)H5I_object(aid);
@@ -6632,13 +6742,13 @@ test_libver_bounds_attributes(hid_t fapl)
/* Enable character encoding in attribute creation property list */
attr_cpl = H5Pcreate(H5P_ATTRIBUTE_CREATE);
- CHECK(attr_cpl, FAIL, "H5Pcreate");
+ CHECK(attr_cpl, H5I_INVALID_HID, "H5Pcreate");
ret = H5Pset_char_encoding(attr_cpl, H5T_CSET_UTF8);
CHECK(ret, FAIL, "H5Pset_char_encoding");
/* Attach an attribute to the group with character encoding set */
aid = H5Acreate2(gid, "attr3", H5T_NATIVE_INT, sid, attr_cpl, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate2");
+ CHECK(aid, H5I_INVALID_HID, "H5Acreate2");
/* Get internal attribute pointer */
attr = (H5A_t *)H5I_object(aid);
@@ -6677,7 +6787,7 @@ test_libver_bounds_attributes(hid_t fapl)
/* Create a copy of the file creation property list */
fcpl = H5Pcreate(H5P_FILE_CREATE);
- CHECK(fcpl, FAIL, "H5Pcreate");
+ CHECK(fcpl, H5I_INVALID_HID, "H5Pcreate");
/* Enable shared datatype message */
ret = H5Pset_shared_mesg_nindexes(fcpl, 1);
@@ -6687,23 +6797,23 @@ test_libver_bounds_attributes(hid_t fapl)
/* Create the file with shared datatype message enabled */
fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
/* Create an integer datatye */
tid = H5Tcopy(H5T_NATIVE_INT);
- CHECK(tid, FAIL, "H5Tcopy");
+ CHECK(tid, H5I_INVALID_HID, "H5Tcopy");
/* Create dataspace */
sid = H5Screate(H5S_SCALAR);
- CHECK(sid, FAIL, "H5Screate");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
/* Create a group */
gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(gid, FAIL, "H5Gcreate2");
+ CHECK(gid, H5I_INVALID_HID, "H5Gcreate2");
/* Attach an attribute to the group with shared integer datatype */
aid = H5Acreate2(gid, ATTR_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(aid, FAIL, "H5Acreate2");
+ CHECK(aid, H5I_INVALID_HID, "H5Acreate2");
/* Get the internal attribute pointer */
attr = (H5A_t *)H5I_object(aid);
@@ -6742,7 +6852,7 @@ test_libver_bounds_attributes(hid_t fapl)
/* Create a scalar dataspace to be used later for the attribute */
sid = H5Screate(H5S_SCALAR);
- CHECK(sid, FAIL, "H5Screate");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
/* Loop through all the combinations of low/high bounds */
/* Open the file and group and attach an attribute to the group */
@@ -6991,7 +7101,7 @@ test_incr_filesize(void)
/* Create datasets in file */
for(u = 0; u < 10; u++) {
- sprintf(name, "Dataset %u", u);
+ HDsprintf(name, "Dataset %u", u);
dset = H5Dcreate2(fid, name, H5T_STD_U32LE, dspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
CHECK(dset, FAIL, "H5Dcreate2");
@@ -7021,7 +7131,7 @@ test_incr_filesize(void)
/* Get the stored EOA */
ret = H5Fget_eoa(fid, &stored_eoa);
CHECK(ret, FAIL, "H5Fget_eoa");
-
+
/* Verify the stored EOA is the same as filesize */
VERIFY(filesize, stored_eoa, "file size");
@@ -7411,6 +7521,8 @@ void
test_file(void)
{
const char *env_h5_drvr; /* File Driver value from environment */
+ hid_t fapl_id = H5I_INVALID_HID; /* VFD-dependent fapl ID */
+ herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File I/O\n"));
@@ -7420,6 +7532,10 @@ test_file(void)
if(env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
+ /* Improved version of VFD-dependent checks */
+ fapl_id = h5_fileaccess();
+ CHECK(fapl_id, H5I_INVALID_HID, "h5_fileaccess");
+
test_file_create(); /* Test file creation(also creation templates)*/
test_file_open(); /* Test file opening */
test_file_reopen(); /* Test file reopening */
@@ -7466,6 +7582,10 @@ test_file(void)
#ifndef H5_NO_DEPRECATED_SYMBOLS
test_deprec(); /* Test deprecated routines */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+ ret = H5Pclose(fapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
} /* test_file() */
@@ -7494,5 +7614,6 @@ cleanup_file(void)
HDremove(FILE5);
HDremove(FILE6);
HDremove(FILE7);
+ HDremove(DST_FILE);
}
diff --git a/test/tgenprop.c b/test/tgenprop.c
index 5031846..72fe7ca 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -678,7 +678,7 @@ test_genprop_basic_list(void)
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
@@ -770,7 +770,7 @@ test_genprop_basic_list_prop(void)
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
@@ -783,7 +783,7 @@ test_genprop_basic_list_prop(void)
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
/* Delete permanent property */
@@ -820,7 +820,7 @@ test_genprop_basic_list_prop(void)
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
/* Close list */
@@ -1225,7 +1225,7 @@ test_genprop_list_callback(void)
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
/* Check values of temporary properties (set with regular values) */
@@ -1240,7 +1240,7 @@ test_genprop_list_callback(void)
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
/* Verify get callback information for properties tracked */
@@ -1774,7 +1774,7 @@ test_genprop_path(void)
CHECK_I(ret, "H5Pregister2");
/* Get full path for first class */
- path=H5P_get_class_path_test(cid1);
+ path = H5P_get_class_path_test(cid1);
CHECK_PTR(path, "H5P_get_class_path_test");
if(HDstrcmp(path,CLASS1_PATH)!=0)
TestErrPrintf("Class names don't match!, path=%s, CLASS1_PATH=%s\n",path,CLASS1_PATH);
@@ -1789,7 +1789,7 @@ test_genprop_path(void)
CHECK_I(ret, "H5Pregister2");
/* Get full path for second class */
- path=H5P_get_class_path_test(cid2);
+ path = H5P_get_class_path_test(cid2);
CHECK_PTR(path, "H5P_get_class_path_test");
if(HDstrcmp(path,CLASS2_PATH)!=0)
TestErrPrintf("Class names don't match!, path=%s, CLASS2_PATH=%s\n",path,CLASS2_PATH);
diff --git a/test/th5o.c b/test/th5o.c
index 2949c4e..009cc2c 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 */
@@ -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 */
@@ -1419,7 +1419,7 @@ test_h5o_getinfo_visit(void)
/* Attach 10 attributes to "group1" */
for(j = 0; j <10; j++) {
/* Create the attribute name */
- sprintf(attrname, "attr%u", j);
+ HDsprintf(attrname, "attr%u", j);
/* Create the attribute */
aid = H5Acreate2(gid1, attrname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(aid, FAIL, "H5Acreate2");
@@ -1491,17 +1491,17 @@ 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_info/2 and H5Ovisit */
+ test_h5o_getinfo_visit(); /* Test object info for H5Oget_info/2 and H5Ovisit */
#endif
} /* test_h5o() */
diff --git a/test/th5s.c b/test/th5s.c
index 9d5273f..4d4eb82 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -91,12 +91,22 @@ struct space4_struct {
unsigned u;
float f;
char c2;
- } space4_data={'v',987123,-3.14F,'g'}; /* Test data for 4th dataspace */
+} space4_data={'v',987123,-3.14F,'g'}; /* Test data for 4th dataspace */
-
-/* Used in test_h5s_encode_irregular_exceed32() and test_h5s_encode_points_exceed32() */
+/*
+ * Testing configuration defines used by:
+ * test_h5s_encode_regular_hyper()
+ * test_h5s_encode_irregular_hyper()
+ * test_h5s_encode_points()
+ */
+#define CONFIG_8 1
+#define CONFIG_16 2
+#define CONFIG_32 3
+#define POWER8 256 /* 2^8 */
+#define POWER16 65536 /* 2^16 */
#define POWER32 4294967296 /* 2^32 */
+
/****************************************************************
**
** test_h5s_basic(): Test basic H5S (dataspace) code.
@@ -177,7 +187,7 @@ test_h5s_basic(void)
CHECK(ret, FAIL, "H5Sclose");
/*
- * Check to be sure we can't create a simple data space that has too many
+ * Check to be sure we can't create a simple dataspace that has too many
* dimensions.
*/
H5E_BEGIN_TRY {
@@ -204,7 +214,7 @@ test_h5s_basic(void)
CHECK_I(ret, "H5Fclose");
}
else
- printf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n", testfile);
+ HDprintf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n", testfile);
}
/* Verify that incorrect dimensions don't work */
@@ -308,7 +318,7 @@ test_h5s_basic(void)
/****************************************************************
**
-** test_h5s_null(): Test NULL data space
+** test_h5s_null(): Test NULL dataspace
**
****************************************************************/
static void
@@ -450,7 +460,7 @@ test_h5s_null(void)
CHECK(ret, FAIL, "H5Fclose");
/*============================================
- * Reopen the file to check the data space
+ * Reopen the file to check the dataspace
*============================================
*/
fid = H5Fopen(NULLFILE, H5F_ACC_RDONLY, H5P_DEFAULT);
@@ -673,7 +683,7 @@ test_h5s_zero_dim(void)
for(j=0; j<SPACE1_DIM3; j++) {
if(rdata[i][j] != 7) {
H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
+ HDprintf("element [%d][%d] is %d but should have been 7\n",
i, j, rdata[i][j]);
}
}
@@ -695,7 +705,7 @@ test_h5s_zero_dim(void)
for(j=0; j<SPACE1_DIM3; j++) {
if(rdata_short[i][j] != 7) {
H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
+ HDprintf("element [%d][%d] is %d but should have been 7\n",
i, j, rdata_short[i][j]);
}
}
@@ -762,7 +772,7 @@ test_h5s_zero_dim(void)
for(j=0; j<SPACE1_DIM3; j++) {
if(rdata[i][j] != 7) {
H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
+ HDprintf("element [%d][%d] is %d but should have been 7\n",
i, j, rdata[i][j]);
}
}
@@ -788,7 +798,7 @@ test_h5s_zero_dim(void)
for(k=0; k<SPACE1_DIM3; k++) {
if(rdata_real[i][j][k] != wdata_real[i][j][k]) {
H5_FAILED();
- printf("element [%d][%d][%d] is %d but should have been %d\n",
+ HDprintf("element [%d][%d][%d] is %d but should have been %d\n",
i, j, k, rdata_real[i][j][k], wdata_real[i][j][k]);
}
}
@@ -812,7 +822,7 @@ test_h5s_zero_dim(void)
for(j=0; j<SPACE1_DIM3; j++) {
if(rdata[i][j] != 7) {
H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
+ HDprintf("element [%d][%d] is %d but should have been 7\n",
i, j, rdata[i][j]);
}
}
@@ -859,7 +869,7 @@ test_h5s_zero_dim(void)
for(j=0; j<SPACE1_DIM3; j++) {
if(rdata[i][j] != 7) {
H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
+ HDprintf("element [%d][%d] is %d but should have been 7\n",
i, j, rdata[i][j]);
}
}
@@ -903,7 +913,7 @@ test_h5s_zero_dim(void)
for(j=0; j<SPACE1_DIM3; j++) {
if(rdata[i][j] != 7) {
H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
+ HDprintf("element [%d][%d] is %d but should have been 7\n",
i, j, rdata[i][j]);
}
}
@@ -935,7 +945,7 @@ test_h5s_zero_dim(void)
for(j=0; j<SPACE1_DIM3; j++) {
if(rdata[i][j] != 7) {
H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
+ HDprintf("element [%d][%d] is %d but should have been 7\n",
i, j, rdata[i][j]);
}
}
@@ -957,7 +967,7 @@ test_h5s_zero_dim(void)
for(j=0; j<SPACE1_DIM3; j++) {
if(rdata_short[i][j] != 7) {
H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
+ HDprintf("element [%d][%d] is %d but should have been 7\n",
i, j, rdata_short[i][j]);
}
}
@@ -1019,7 +1029,7 @@ test_h5s_zero_dim(void)
for(k=0; k<SPACE1_DIM3; k++) {
if(rdata_real[i][j][k] != wdata_real[i][j][k]) {
H5_FAILED();
- printf("element [%d][%d][%d] is %d but should have been %d\n",
+ HDprintf("element [%d][%d][%d] is %d but should have been %d\n",
i, j, k, rdata_real[i][j][k], wdata_real[i][j][k]);
}
}
@@ -1068,7 +1078,7 @@ test_h5s_zero_dim(void)
CHECK(ret, FAIL, "H5Fclose");
/*============================================
- * Reopen the file to check the data space
+ * Reopen the file to check the dataspace
*============================================
*/
fid1 = H5Fopen(ZEROFILE, H5F_ACC_RDONLY, H5P_DEFAULT);
@@ -1106,7 +1116,7 @@ test_h5s_zero_dim(void)
for(j=0; j<SPACE1_DIM3; j++) {
if(rdata[i][j] != 7) {
H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
+ HDprintf("element [%d][%d] is %d but should have been 7\n",
i, j, rdata[i][j]);
}
}
@@ -1144,7 +1154,7 @@ test_h5s_zero_dim(void)
for(j=0; j<SPACE1_DIM3; j++) {
if(rdata_short[i][j] != 7) {
H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
+ HDprintf("element [%d][%d] is %d but should have been 7\n",
i, j, rdata_short[i][j]);
}
}
@@ -1200,19 +1210,22 @@ test_h5s_encode(void)
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
CHECK(sid1, FAIL, "H5Screate_simple");
+ /* Set the hyperslab selection */
ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* Encode simple data space in a buffer */
+ /* Encode simple dataspace in a buffer */
ret = H5Sencode(sid1, NULL, &sbuf_size);
CHECK(ret, FAIL, "H5Sencode");
- if(sbuf_size>0)
+ if(sbuf_size>0) {
sbuf = (unsigned char*)HDcalloc((size_t)1, sbuf_size);
+ CHECK(sbuf, NULL, "HDcalloc");
+ }
/* Try decoding bogus buffer */
H5E_BEGIN_TRY {
- ret_id = H5Sdecode(sbuf);
+ ret_id = H5Sdecode(sbuf);
} H5E_END_TRY;
VERIFY(ret_id, FAIL, "H5Sdecode");
@@ -1229,22 +1242,26 @@ test_h5s_encode(void)
VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3,
"H5Sget_simple_extent_npoints");
+ /* Retrieve and verify the dataspace rank */
rank = H5Sget_simple_extent_ndims(decoded_sid1);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
VERIFY(rank, SPACE1_RANK, "H5Sget_simple_extent_ndims");
+ /* Retrieve and verify the dataspace dimensions */
rank = H5Sget_simple_extent_dims(decoded_sid1, tdims, NULL);
CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
"H5Sget_simple_extent_dims");
- /* Verify hyperslabe selection */
+ /* Verify the type of dataspace selection */
sel_type = H5Sget_select_type(decoded_sid1);
VERIFY(sel_type, H5S_SEL_HYPERSLABS, "H5Sget_select_type");
+ /* Verify the number of hyperslab blocks */
nblocks = H5Sget_select_hyper_nblocks(decoded_sid1);
VERIFY(nblocks, 2*2*2, "H5Sget_select_hyper_nblocks");
+ /* Close the dataspaces */
ret = H5Sclose(sid1);
CHECK(ret, FAIL, "H5Sclose");
@@ -1258,12 +1275,14 @@ test_h5s_encode(void)
sid2 = H5Screate(H5S_NULL);
CHECK(sid2, FAIL, "H5Screate");
- /* Encode null data space in a buffer */
+ /* Encode null dataspace in a buffer */
ret = H5Sencode(sid2, NULL, &null_size);
CHECK(ret, FAIL, "H5Sencode");
- if(null_size>0)
+ if(null_size>0) {
null_sbuf = (unsigned char*)HDcalloc((size_t)1, null_size);
+ CHECK(null_sbuf, NULL, "HDcalloc");
+ }
ret = H5Sencode(sid2, null_sbuf, &null_size);
CHECK(ret, FAIL, "H5Sencode");
@@ -1272,10 +1291,11 @@ test_h5s_encode(void)
decoded_sid2=H5Sdecode(null_sbuf);
CHECK(decoded_sid2, FAIL, "H5Sdecode");
- /* Verify decoded dataspace */
+ /* Verify the decoded dataspace type */
space_type = H5Sget_simple_extent_type(decoded_sid2);
VERIFY(space_type, H5S_NULL, "H5Sget_simple_extent_type");
+ /* Close the dataspaces */
ret = H5Sclose(sid2);
CHECK(ret, FAIL, "H5Sclose");
@@ -1290,12 +1310,14 @@ test_h5s_encode(void)
sid3 = H5Screate(H5S_SCALAR);
CHECK(sid3, FAIL, "H5Screate_simple");
- /* Encode scalar data space in a buffer */
+ /* Encode scalar dataspace in a buffer */
ret = H5Sencode(sid3, NULL, &scalar_size);
CHECK(ret, FAIL, "H5Sencode");
- if(scalar_size>0)
+ if(scalar_size>0) {
scalar_buf = (unsigned char*)HDcalloc((size_t)1, scalar_size);
+ CHECK(scalar_buf, NULL, "HDcalloc");
+ }
ret = H5Sencode(sid3, scalar_buf, &scalar_size);
CHECK(ret, FAIL, "H5Sencode");
@@ -1313,20 +1335,26 @@ test_h5s_encode(void)
CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
VERIFY(n, 1, "H5Sget_simple_extent_npoints");
+ /* Retrieve and verify the dataspace rank */
rank = H5Sget_simple_extent_ndims(decoded_sid3);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
VERIFY(rank, 0, "H5Sget_simple_extent_ndims");
+ /* Close the dataspaces */
ret = H5Sclose(sid3);
CHECK(ret, FAIL, "H5Sclose");
ret = H5Sclose(decoded_sid3);
CHECK(ret, FAIL, "H5Sclose");
- HDfree(sbuf);
- HDfree(null_sbuf);
- HDfree(scalar_buf);
-} /* test_h5s_encode() */
+ /* Release resources */
+ if(sbuf)
+ HDfree(sbuf);
+ if(null_sbuf)
+ HDfree(null_sbuf);
+ if(scalar_buf)
+ HDfree(scalar_buf);
+} /* test_h5s_encode() */
/****************************************************************
**
@@ -1336,14 +1364,14 @@ test_h5s_encode(void)
static void
test_h5s_scalar_write(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- int rank; /* Logical rank of dataspace */
- hsize_t tdims[4]; /* Dimension array to test with */
- hssize_t n; /* Number of dataspace elements */
- H5S_class_t ext_type; /* Extent type */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ int rank; /* Logical rank of dataspace */
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hssize_t n; /* Number of dataspace elements */
+ H5S_class_t ext_type; /* Extent type */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Scalar Dataspace Manipulation during Writing\n"));
@@ -1362,14 +1390,17 @@ test_h5s_scalar_write(void)
sid1 = H5Screate_simple(SPACE3_RANK, NULL, NULL);
CHECK(sid1, FAIL, "H5Screate_simple");
+ /* Retrieve the number of elements in the dataspace selection */
n = H5Sget_simple_extent_npoints(sid1);
CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
VERIFY(n, 1, "H5Sget_simple_extent_npoints");
+ /* Get the dataspace rank */
rank = H5Sget_simple_extent_ndims(sid1);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
VERIFY(rank, SPACE3_RANK, "H5Sget_simple_extent_ndims");
+ /* Get the dataspace dimension sizes */
rank = H5Sget_simple_extent_dims(sid1, tdims, NULL);
VERIFY(rank, 0, "H5Sget_simple_extent_dims");
@@ -1381,6 +1412,7 @@ test_h5s_scalar_write(void)
dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
+ /* Write to the dataset */
ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &space3_data);
CHECK(ret, FAIL, "H5Dwrite");
@@ -1395,7 +1427,7 @@ test_h5s_scalar_write(void)
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_scalar_write() */
+} /* test_h5s_scalar_write() */
/****************************************************************
**
@@ -1595,9 +1627,9 @@ test_h5s_compound_scalar_read(void)
ret = H5Dread(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct))) {
- printf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n",space4_data.c1,rdata.c1);
- printf("scalar data different: space4_data.u=%u, read_data4.u=%u\n",space4_data.u,rdata.u);
- printf("scalar data different: space4_data.f=%f, read_data4.f=%f\n",(double)space4_data.f,(double)rdata.f);
+ HDprintf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n",space4_data.c1,rdata.c1);
+ HDprintf("scalar data different: space4_data.u=%u, read_data4.u=%u\n",space4_data.u,rdata.u);
+ HDprintf("scalar data different: space4_data.f=%f, read_data4.f=%f\n",(double)space4_data.f,(double)rdata.f);
TestErrPrintf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n",space4_data.c1,rdata.c2);
} /* end if */
@@ -1651,7 +1683,7 @@ test_h5s_chunk(void)
status = H5Pset_chunk(plist_id, 2, csize);
CHECK(status, FAIL, "H5Pset_chunk");
- /* Create the data space */
+ /* Create the dataspace */
dims[0] = 50000;
dims[1] = 3;
space_id = H5Screate_simple(2, dims, NULL);
@@ -2690,6 +2722,83 @@ test_h5s_encode_points_exceed32(void)
/****************************************************************
**
+** test_h5s_encode_length():
+** Test to verify HDFFV-10271 is fixed.
+** Verify that version 2 hyperslab encoding length is correct.
+**
+** See "RFC: H5Sencode/H5Sdecode Format Change" for the
+** description of the encoding format.
+**
+****************************************************************/
+static void
+test_h5s_encode_length(void)
+{
+ hid_t sid; /* Dataspace ID */
+ hid_t decoded_sid; /* Dataspace ID from H5Sdecode2 */
+ size_t sbuf_size=0; /* Buffer size for H5Sencode2/1 */
+ unsigned char *sbuf=NULL; /* Buffer for H5Sencode2/1 */
+ hsize_t dims[1] = {500}; /* Dimension size */
+ hsize_t start, count, block, stride; /* Hyperslab selection specifications */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Version 2 Hyperslab Encoding Length is correct\n"));
+
+ /* Create dataspace */
+ sid = H5Screate_simple(1, dims, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+
+ /* Setting H5S_UNLIMITED in count will use version 2 for hyperslab encoding */
+ start = 0;
+ stride = 10;
+ block = 4;
+ count = H5S_UNLIMITED;
+
+ /* Set hyperslab selection */
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, &start, &stride, &count, &block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Encode simple data space in a buffer */
+ ret = H5Sencode(sid, NULL, &sbuf_size);
+ CHECK(ret, FAIL, "H5Sencode");
+
+ /* Allocate the buffer */
+ if(sbuf_size > 0) {
+ sbuf = (unsigned char*)HDcalloc((size_t)1, sbuf_size);
+ CHECK(sbuf, NULL, "H5Sencode2");
+ }
+
+ /* Encode the dataspace */
+ ret = H5Sencode(sid, sbuf, &sbuf_size);
+ CHECK(ret, FAIL, "H5Sencode");
+
+ /* Verify that length stored at this location in the buffer is correct */
+ VERIFY((uint32_t)sbuf[40], 36, "Length for encoding version 2");
+ VERIFY((uint32_t)sbuf[35], 2, "Hyperslab encoding version is 2");
+
+ /* Decode from the dataspace buffer and return an object handle */
+ decoded_sid = H5Sdecode(sbuf);
+ CHECK(decoded_sid, FAIL, "H5Sdecode");
+
+ /* Verify that the original and the decoded dataspace are equal */
+ VERIFY(H5Sget_select_npoints(sid), H5Sget_select_npoints(decoded_sid), "Compare npoints");
+
+ /* Close the decoded dataspace */
+ ret = H5Sclose(decoded_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Free the buffer */
+ if(sbuf)
+ HDfree(sbuf);
+
+ /* Close the original dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+} /* test_h5s_encode_length() */
+
+/****************************************************************
+**
** test_h5s(): Main H5S (dataspace) testing routine.
**
****************************************************************/
@@ -2706,9 +2815,10 @@ test_h5s(void)
test_h5s_encode_regular_exceed32(); /* Test encoding regular hyperslab selection that exceeds 32 bits */
test_h5s_encode_irregular_exceed32(); /* Testing encoding irregular hyperslab selection that exceeds 32 bits */
test_h5s_encode_points_exceed32(); /* Testing encoding point selection that exceeds 32 bits */
+ test_h5s_encode_length(); /* Test version 2 hyperslab encoding length is correct */
- test_h5s_scalar_write(); /* Test scalar H5S writing code */
- test_h5s_scalar_read(); /* Test scalar H5S reading code */
+ test_h5s_scalar_write(); /* Test scalar H5S writing code */
+ test_h5s_scalar_read(); /* Test scalar H5S reading code */
test_h5s_compound_scalar_write(); /* Test compound datatype scalar H5S writing code */
test_h5s_compound_scalar_read(); /* Test compound datatype scalar H5S reading code */
diff --git a/test/tid.c b/test/tid.c
index 8a27c3b..3587566 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -251,7 +251,10 @@ static int id_predefined_test(void )
testObj = HDmalloc(sizeof(int));
- /* Try to perform illegal functions on various predefined types */
+ /*
+ * Attempt to perform public functions on various library types
+ */
+
H5E_BEGIN_TRY
testID = H5Iregister(H5I_FILE, testObj);
H5E_END_TRY
@@ -317,7 +320,7 @@ static int id_predefined_test(void )
H5Tclose(typeID);
/* testObj was never registered as an atom, so it will not be
- * automatically freed. */
+ * automatically freed. */
HDfree(testObj);
return 0;
@@ -476,7 +479,7 @@ static int test_id_type_list(void)
goto out;
/* Sanity check */
- if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES)
+ if((int)startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES)
{
/* Error condition, throw an error */
CHECK(1, 1, "H5Iregister_type");
diff --git a/test/titerate.c b/test/titerate.c
index 093e8b5..9ad145d 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -116,7 +116,7 @@ liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_
return(count2 > 10 ? 1 : 0);
default:
- printf("invalid iteration command");
+ HDprintf("invalid iteration command");
return(-1);
} /* end switch */
} /* end liter_cb() */
@@ -163,7 +163,7 @@ test_iter_group(hid_t fapl, hbool_t new_format)
CHECK(filespace, FAIL, "H5Screate");
for(i=0; i< NDATASETS; i++) {
- sprintf(name,"Dataset %d",i);
+ HDsprintf(name,"Dataset %d",i);
dataset = H5Dcreate2(file, name, datatype, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
@@ -379,7 +379,7 @@ aiter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5A_info_t H5_ATTR_
return(count2 > 10 ? 1 : 0);
default:
- printf("invalid iteration command");
+ HDprintf("invalid iteration command");
return(-1);
} /* end switch */
} /* end aiter_cb() */
@@ -416,7 +416,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format)
CHECK(dataset, FAIL, "H5Dcreate2");
for(i = 0; i < NATTR; i++) {
- sprintf(name, "Attribute %02d", i);
+ HDsprintf(name, "Attribute %02d", i);
attribute = H5Acreate2(dataset, name, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attribute, FAIL, "H5Acreate2");
@@ -621,7 +621,7 @@ test_iter_group_large(hid_t fapl)
/* Create a bunch of groups */
for(i = 0; i < ITER_NGROUPS; i++) {
- sprintf(gname, "Group_%d", i);
+ HDsprintf(gname, "Group_%d", i);
/* Add the name to the list of objects in the root group */
HDstrcpy(names[i].name, gname);
@@ -737,7 +737,7 @@ static void test_grp_memb_funcs(hid_t fapl)
CHECK(filespace, FAIL, "H5Screate");
for(i = 0; i < NDATASETS; i++) {
- sprintf(name, "Dataset %d", i);
+ HDsprintf(name, "Dataset %d", i);
dataset = H5Dcreate2(file, name, datatype, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
@@ -945,7 +945,7 @@ find_err_msg_cb(unsigned n, const H5E_error2_t *err_desc, void *_client_data)
searched_err_t *searched_err = (searched_err_t *)_client_data;
if (searched_err == NULL)
- return -1;
+ 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)
@@ -953,6 +953,7 @@ find_err_msg_cb(unsigned n, const H5E_error2_t *err_desc, void *_client_data)
searched_err->found = true;
status = H5_ITER_STOP;
}
+
return status;
} /* end find_err_msg_cb() */
@@ -988,6 +989,7 @@ static void test_corrupted_attnamelen(void)
/* Call H5Aiterate2 to trigger the failure in HDFFV-10588. Failure should
occur in the decoding stage, so some arguments are not needed. */
err_status = H5Aiterate2(did, H5_INDEX_NAME, H5_ITER_INC, NULL, NULL, NULL);
+ VERIFY(err_status, FAIL, "H5Aiterate2");
/* Make sure the intended error was caught */
if(err_status == -1)
@@ -1077,6 +1079,6 @@ test_iterate(void)
void
cleanup_iterate(void)
{
- remove(DATAFILE);
+ HDremove(DATAFILE);
}
diff --git a/test/tmisc.c b/test/tmisc.c
index 22e1aad..b1c20dc 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -981,13 +981,13 @@ test_misc5(void)
/* Verify the correct information was read in */
for(i=0; i<(buf.len); i++) {
- /* printf("[%d]=%d\n",i, ((misc5_struct1 *)(buf.p))[i].st1_el1); */
+ /* HDprintf("[%d]=%d\n",i, ((misc5_struct1 *)(buf.p))[i].st1_el1); */
VERIFY(((misc5_struct1 *)(buf.p))[i].st1_el1,MISC5_DBGELVAL1,"H5Dread");
for(j=0; j<(((misc5_struct1 *)(buf.p)) [i].st1_el2.len); j++) {
- /* printf(" [%d]=%d\n",j, ((misc5_struct2 *)(((misc5_struct1 *) (buf.p))[i].st1_el2.p))[j].st2_el1); */
+ /* HDprintf(" [%d]=%d\n",j, ((misc5_struct2 *)(((misc5_struct1 *) (buf.p))[i].st1_el2.p))[j].st2_el1); */
VERIFY(((misc5_struct2 *)(((misc5_struct1 *) (buf.p))[i].st1_el2.p))[j].st2_el1, MISC5_DBGELVAL2,"H5Dread");
for(k=0; k<(((misc5_struct2 *) (((misc5_struct1 *)(buf.p))[i]. st1_el2.p))[j].st2_el2.len); k++) {
- /* printf(" [%d]=%d\n",k, ((misc5_struct3 *)(((misc5_struct2 *) (((misc5_struct1 *)(buf.p))[i]. st1_el2.p))[j].st2_el2.p))[k].st3_el1); */
+ /* HDprintf(" [%d]=%d\n",k, ((misc5_struct3 *)(((misc5_struct2 *) (((misc5_struct1 *)(buf.p))[i]. st1_el2.p))[j].st2_el2.p))[k].st3_el1); */
VERIFY(((misc5_struct3 *)(((misc5_struct2 *) (((misc5_struct1 *)(buf.p))[i]. st1_el2.p))[j].st2_el2.p))[k].st3_el1, MISC5_DBGELVAL3,"H5Dread");
} /* end for */
}
@@ -1064,7 +1064,7 @@ test_misc6(void)
/* Loop through adding attributes to each dataset */
for(u = 0; u < MISC6_NUMATTR; u++) {
/* Create name for attribute */
- sprintf(attr_name, "Attr#%u", u);
+ HDsprintf(attr_name, "Attr#%u", u);
/* Open the file */
loc_id = H5Fopen(MISC6_FILE, H5F_ACC_RDWR, H5P_DEFAULT);
@@ -2713,9 +2713,6 @@ test_misc15(void)
fapl = H5Fget_access_plist(file);
CHECK(fapl, FAIL, "H5Fget_access_plist");
- ret = H5Pclose(fapl);
- CHECK(ret, FAIL, "H5Pclose");
-
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
@@ -2723,6 +2720,9 @@ test_misc15(void)
ret = H5Fis_hdf5(MISC15_FILE);
CHECK(ret, FAIL, "H5Fis_hdf5");
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
file = H5Fopen(MISC15_FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fopen");
@@ -2953,7 +2953,7 @@ test_misc18(void)
/* Loop creating attributes on each dataset, flushing them to the file each time */
for(u = 0; u < 10; u++) {
/* Set up attribute name */
- sprintf(attr_name, "Attr %u", u);
+ HDsprintf(attr_name, "Attr %u", u);
/* Create & close attribute on first dataset */
aid = H5Acreate2(did1, attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT);
@@ -4721,6 +4721,7 @@ test_misc25a(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc25a() */
+
/****************************************************************
**
** test_misc25b(): Exercise null object header message merge bug
@@ -5291,7 +5292,7 @@ test_misc30(void)
CHECK(ret, FAIL, "test_misc30_get_info");
}
- sprintf(gname, "/g0/group%d", i);
+ HDsprintf(gname, "/g0/group%d", i);
gid = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(gid, FAIL, "H5Gcreate2");
@@ -5647,9 +5648,6 @@ test_misc(void)
*
* Programmer: Albert Cheng
* July 2, 1998
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
diff --git a/test/trefer.c b/test/trefer.c
index b7a1d59..6b67eb4 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -21,7 +21,7 @@
#include "testhdf5.h"
-#define FILE1 "trefer1.h5"
+#define FILE1 "trefer1.h5"
#define FILE2 "trefer2.h5"
#define FILE3 "trefer3.h5"
@@ -503,16 +503,16 @@ test_reference_obj(void)
**
****************************************************************/
static void
-test_reference_region(hbool_t new_format)
+test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
{
hid_t fid1; /* HDF5 File IDs */
hid_t fapl = -1; /* File access property list */
hid_t dset1, /* Dataset ID */
dset2, /* Dereferenced dataset ID */
dset3; /* Dereferenced dataset ID */
- hid_t sid1, /* Dataspace ID #1 */
- sid2, /* Dataspace ID #2 */
- sid3; /* Dataspace ID #3 */
+ hid_t sid1, /* Dataspace ID #1 */
+ sid2, /* Dataspace ID #2 */
+ sid3; /* Dataspace ID #3 */
hid_t dapl_id; /* Dataset access property list */
hsize_t dims1[] = {SPACE1_DIM1},
dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
@@ -549,11 +549,7 @@ test_reference_region(hbool_t new_format)
hsize_t start3, count3, block3;
/* Output message about test being performed */
- if(new_format) {
- MESSAGE(5, ("Testing Dataset Region Reference Functions for new format\n"));
- } else {
- MESSAGE(5, ("Testing Dataset Region Reference Functions for old format\n"));
- }
+ MESSAGE(5, ("Testing Object Reference Functions\n"));
/* Allocate write & read buffers */
wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
@@ -564,12 +560,12 @@ test_reference_region(hbool_t new_format)
/* Set to use the latest file format */
fapl = H5Pcreate(H5P_FILE_ACCESS);
CHECK(fapl, FAIL, "H5Pcreate");
- if(new_format) {
- ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
- CHECK(ret, FAIL, "H5Pset_libver_bounds");
- }
- /* Create file */
+ /* Set the low/high version bounds in fapl */
+ ret = H5Pset_libver_bounds(fapl, libver_low, libver_high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create file with the fapl */
fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
CHECK(fid1, FAIL, "H5Fcreate");
@@ -619,7 +615,7 @@ test_reference_region(hbool_t new_format)
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
CHECK(sid1, FAIL, "H5Screate_simple");
- /* Create the reference dataset */
+ /* Create a dataset */
dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Dcreate2");
@@ -676,19 +672,32 @@ test_reference_region(hbool_t new_format)
VERIFY(hssize_ret, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints");
/* Store third dataset region */
- ret = H5Rcreate(&wbuf[2], fid1, "/Dataset2", H5R_DATASET_REGION, sid2);
- CHECK(ret, FAIL, "H5Rcreate");
- ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &wbuf[2], &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+ H5E_BEGIN_TRY {
+ ret = H5Rcreate(&wbuf[2], fid1, "/Dataset2", H5R_DATASET_REGION, sid2);
+ } H5E_END_TRY;
+
+ if(libver_high < H5F_LIBVER_V110)
+ VERIFY(ret, FAIL, "H5Rcreate");
+ else {
+ CHECK(ret, FAIL, "H5Rcreate");
+ ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &wbuf[2], &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+ }
/* Store fourth dataset region */
- ret = H5Rcreate(&wbuf[3], fid1, "/Dataset3", H5R_DATASET_REGION, sid3);
- CHECK(ret, FAIL, "H5Rcreate");
- ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &wbuf[3], &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+ H5E_BEGIN_TRY {
+ ret = H5Rcreate(&wbuf[3], fid1, "/Dataset3", H5R_DATASET_REGION, sid3);
+ } H5E_END_TRY;
+ if(libver_high < H5F_LIBVER_V110)
+ VERIFY(ret, FAIL, "H5Rcreate");
+ else {
+ CHECK(ret, FAIL, "H5Rcreate");
+ ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &wbuf[3], &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+ }
/* Write selection to disk */
ret = H5Dwrite(dset1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
@@ -791,25 +800,27 @@ test_reference_region(hbool_t new_format)
/* Try to open the referenced dataset with dataspace exceeding 32 bits */
- dset3 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, &rbuf[3]);
- CHECK(dset3, FAIL, "H5Rdereference2");
-
- /* Check what H5Rget_obj_type2 function returns */
- ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &rbuf[3], &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
-
- /* Check information in the referenced dataset */
- sid3 = H5Dget_space(dset3);
- CHECK(sid3, FAIL, "H5Dget_space");
- ret_particles = H5Sget_select_npoints(sid3);
- VERIFY(ret_particles, total_particles, "H5Sget_select_npoints");
-
- /* Close the dataspace and dataset */
- ret = H5Sclose(sid3);
- CHECK(ret, FAIL, "H5Sclose");
- ret = H5Dclose(dset3);
- CHECK(ret, FAIL, "H5Dclose");
+ if(libver_high == H5F_LIBVER_V110) {
+ dset3 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, &rbuf[3]);
+ CHECK(dset3, FAIL, "H5Rdereference2");
+
+ /* Check what H5Rget_obj_type2 function returns */
+ ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &rbuf[3], &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+
+ /* Check information in the referenced dataset */
+ sid3 = H5Dget_space(dset3);
+ CHECK(sid3, FAIL, "H5Dget_space");
+ ret_particles = H5Sget_select_npoints(sid3);
+ VERIFY(ret_particles, total_particles, "H5Sget_select_npoints");
+
+ /* Close the dataspace and dataset */
+ ret = H5Sclose(sid3);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Dclose(dset3);
+ CHECK(ret, FAIL, "H5Dclose");
+ }
/* Try to open objects */
dset2 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, &rbuf[0]);
@@ -906,30 +917,33 @@ test_reference_region(hbool_t new_format)
ret = H5Sclose(sid2);
CHECK(ret, FAIL, "H5Sclose");
- /* Get the unlimited selection */
- sid2 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[2]);
- CHECK(sid2, FAIL, "H5Rget_region");
- /* Verify correct hyperslab selected */
- hssize_ret = H5Sget_select_npoints(sid2);
- VERIFY(hssize_ret, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints");
- tri_ret = H5Sis_regular_hyperslab(sid2);
- CHECK(tri_ret, FAIL, "H5Sis_regular_hyperslab");
- VERIFY(tri_ret, TRUE, "H5Sis_regular_hyperslab Result");
- ret = H5Sget_regular_hyperslab(sid2, start, stride, count, block);
- CHECK(ret, FAIL, "H5Sget_regular_hyperslab");
- VERIFY(start[0], (hsize_t)1, "Hyperslab Coordinates");
- VERIFY(start[1], (hsize_t)8, "Hyperslab Coordinates");
- VERIFY(stride[0], (hsize_t)4, "Hyperslab Coordinates");
- VERIFY(stride[1], (hsize_t)1, "Hyperslab Coordinates");
- VERIFY(count[0], H5S_UNLIMITED, "Hyperslab Coordinates");
- VERIFY(count[1], (hsize_t)1, "Hyperslab Coordinates");
- VERIFY(block[0], (hsize_t)2, "Hyperslab Coordinates");
- VERIFY(block[1], (hsize_t)2, "Hyperslab Coordinates");
-
- /* Close region space */
- ret = H5Sclose(sid2);
- CHECK(ret, FAIL, "H5Sclose");
+ /* Get the unlimited selection */
+ if(libver_high == H5F_LIBVER_V110) {
+ sid2 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[2]);
+ CHECK(sid2, FAIL, "H5Rget_region");
+
+ /* Verify correct hyperslab selected */
+ hssize_ret = H5Sget_select_npoints(sid2);
+ VERIFY(hssize_ret, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints");
+ tri_ret = H5Sis_regular_hyperslab(sid2);
+ CHECK(tri_ret, FAIL, "H5Sis_regular_hyperslab");
+ VERIFY(tri_ret, TRUE, "H5Sis_regular_hyperslab Result");
+ ret = H5Sget_regular_hyperslab(sid2, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sget_regular_hyperslab");
+ VERIFY(start[0], (hsize_t)1, "Hyperslab Coordinates");
+ VERIFY(start[1], (hsize_t)8, "Hyperslab Coordinates");
+ VERIFY(stride[0], (hsize_t)4, "Hyperslab Coordinates");
+ VERIFY(stride[1], (hsize_t)1, "Hyperslab Coordinates");
+ VERIFY(count[0], H5S_UNLIMITED, "Hyperslab Coordinates");
+ VERIFY(count[1], (hsize_t)1, "Hyperslab Coordinates");
+ VERIFY(block[0], (hsize_t)2, "Hyperslab Coordinates");
+ VERIFY(block[1], (hsize_t)2, "Hyperslab Coordinates");
+
+ /* Close region space */
+ ret = H5Sclose(sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+ }
/* Close first space */
ret = H5Sclose(sid1);
@@ -973,32 +987,33 @@ test_reference_region(hbool_t new_format)
**
****************************************************************/
static void
-test_reference_region_1D(hbool_t new_format)
+test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dset1, /* Dataset ID */
- dset3; /* Dereferenced dataset ID */
- hid_t sid1, /* Dataspace ID #1 */
- sid3; /* Dataspace ID #3 */
- hid_t dapl_id; /* Dataset access property list */
- hsize_t dims1[] = {SPACE1_DIM1},
- dims3[] = {SPACE3_DIM1};
- hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */
- hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
- hsize_t * coords; /* Coordinate buffer */
- hsize_t low[SPACE3_RANK]; /* Selection bounds */
- hsize_t high[SPACE3_RANK]; /* Selection bounds */
- hdset_reg_ref_t *wbuf, /* buffer to write to disk */
- *rbuf; /* buffer read from disk */
- uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
- *drbuf; /* Buffer for reading numeric data from disk */
- uint8_t *tu8; /* Temporary pointer to uint8 data */
- H5O_type_t obj_type; /* Object type */
- int i; /* counting variables */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t fapl = -1; /* File access property list */
+ hid_t dset1, /* Dataset ID */
+ dset3; /* Dereferenced dataset ID */
+ hid_t sid1, /* Dataspace ID #1 */
+ sid3; /* Dataspace ID #3 */
+ hid_t dapl_id; /* Dataset access property list */
+ hsize_t dims1[] = {SPACE1_DIM1},
+ dims3[] = {SPACE3_DIM1};
+ hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */
+ hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hsize_t *coords; /* Coordinate buffer */
+ hsize_t low[SPACE3_RANK]; /* Selection bounds */
+ hsize_t high[SPACE3_RANK]; /* Selection bounds */
+ hdset_reg_ref_t *wbuf, /* buffer to write to disk */
+ *rbuf; /* buffer read from disk */
+ uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
+ *drbuf; /* Buffer for reading numeric data from disk */
+ uint8_t *tu8; /* Temporary pointer to uint8 data */
+ H5O_type_t obj_type; /* Object type */
+ int i; /* counting variables */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n"));
@@ -1009,8 +1024,16 @@ test_reference_region_1D(hbool_t new_format)
dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1);
drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1);
- /* Create file */
- fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ /* Create the file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Set the low/high version bounds in fapl */
+ ret = H5Pset_libver_bounds(fapl, libver_low, libver_high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create file with the fapl */
+ fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
CHECK(fid1, FAIL, "H5Fcreate");
/* Create dataspace for datasets */
@@ -1106,7 +1129,7 @@ test_reference_region_1D(hbool_t new_format)
CHECK(ret, FAIL, "H5Fclose");
/* Re-open the file */
- fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, fapl);
CHECK(fid1, FAIL, "H5Fopen");
/* Open the dataset */
@@ -1240,6 +1263,10 @@ test_reference_region_1D(hbool_t new_format)
ret = H5Pclose(dapl_id);
CHECK(ret, FAIL, "H5Pclose");
+ /* Close file access property list */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
@@ -1817,19 +1844,32 @@ test_reference_compat(void)
void
test_reference(void)
{
+ H5F_libver_t low, high; /* Low and high bounds */
+
/* Output message about test being performed */
MESSAGE(5, ("Testing References\n"));
- test_reference_params(); /* Test for correct parameter checking */
- test_reference_obj(); /* Test basic H5R object reference code */
- test_reference_region(FALSE); /* Test basic H5R dataset region reference code */
- test_reference_region(TRUE); /* Test basic H5R dataset region reference code */
- test_reference_region_1D(FALSE); /* Test H5R dataset region reference code for 1-D datasets */
- test_reference_region_1D(TRUE); /* Test H5R dataset region reference code for 1-D datasets */
- test_reference_obj_deleted(); /* Test H5R object reference code for deleted objects */
- test_reference_group(); /* Test operations on dereferenced groups */
+ test_reference_params(); /* Test for correct parameter checking */
+ test_reference_obj(); /* Test basic H5R object reference code */
+
+ /* Loop through all the combinations of low/high version bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ /* Invalid combinations, just continue */
+ if(high == H5F_LIBVER_EARLIEST || high < low)
+ continue;
+
+ test_reference_region(low, high); /* Test basic H5R dataset region reference code */
+ test_reference_region_1D(low, high); /* Test H5R dataset region reference code for 1-D datasets */
+
+ } /* end high bound */
+ } /* end low bound */
+
+ test_reference_obj_deleted(); /* Test H5R object reference code for deleted objects */
+ test_reference_group(); /* Test operations on dereferenced groups */
#ifndef H5_NO_DEPRECATED_SYMBOLS
- test_reference_compat(); /* Test operations with old API routines */
+ test_reference_compat(); /* Test operations with old API routines */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* test_reference() */
diff --git a/test/tselect.c b/test/tselect.c
index 3c93e7a..9885a05 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -13,50 +13,50 @@
/***********************************************************
*
-* Test program: tselect
+* Test program: tselect
*
* Test the Dataspace selection functionality
*
*************************************************************/
-#define H5S_FRIEND /*suppress error about including H5Spkg */
+#define H5S_FRIEND /*suppress error about including H5Spkg */
/* Define this macro to indicate that the testing APIs should be available */
#define H5S_TESTING
#include "testhdf5.h"
#include "hdf5.h"
-#include "H5Spkg.h" /* Dataspaces */
+#include "H5Spkg.h" /* Dataspaces */
#define FILENAME "tselect.h5"
/* 3-D dataset with fixed dimensions */
#define SPACE1_NAME "Space1"
-#define SPACE1_RANK 3
-#define SPACE1_DIM1 3
-#define SPACE1_DIM2 15
-#define SPACE1_DIM3 13
+#define SPACE1_RANK 3
+#define SPACE1_DIM1 3
+#define SPACE1_DIM2 15
+#define SPACE1_DIM3 13
/* 2-D dataset with fixed dimensions */
#define SPACE2_NAME "Space2"
-#define SPACE2_RANK 2
-#define SPACE2_DIM1 30
-#define SPACE2_DIM2 26
-#define SPACE2A_RANK 1
-#define SPACE2A_DIM1 (SPACE2_DIM1*SPACE2_DIM2)
+#define SPACE2_RANK 2
+#define SPACE2_DIM1 30
+#define SPACE2_DIM2 26
+#define SPACE2A_RANK 1
+#define SPACE2A_DIM1 (SPACE2_DIM1*SPACE2_DIM2)
/* 2-D dataset with fixed dimensions */
#define SPACE3_NAME "Space3"
-#define SPACE3_RANK 2
-#define SPACE3_DIM1 15
-#define SPACE3_DIM2 26
+#define SPACE3_RANK 2
+#define SPACE3_DIM1 15
+#define SPACE3_DIM2 26
/* 3-D dataset with fixed dimensions */
#define SPACE4_NAME "Space4"
-#define SPACE4_RANK 3
-#define SPACE4_DIM1 11
-#define SPACE4_DIM2 13
-#define SPACE4_DIM3 17
+#define SPACE4_RANK 3
+#define SPACE4_DIM1 11
+#define SPACE4_DIM2 13
+#define SPACE4_DIM3 17
/* Number of random hyperslabs to test */
#define NHYPERSLABS 10
@@ -66,22 +66,22 @@
/* 5-D dataset with fixed dimensions */
#define SPACE5_NAME "Space5"
-#define SPACE5_RANK 5
-#define SPACE5_DIM1 10
-#define SPACE5_DIM2 10
-#define SPACE5_DIM3 10
-#define SPACE5_DIM4 10
-#define SPACE5_DIM5 10
+#define SPACE5_RANK 5
+#define SPACE5_DIM1 10
+#define SPACE5_DIM2 10
+#define SPACE5_DIM3 10
+#define SPACE5_DIM4 10
+#define SPACE5_DIM5 10
/* 1-D dataset with same size as 5-D dataset */
-#define SPACE6_RANK 1
-#define SPACE6_DIM1 (SPACE5_DIM1*SPACE5_DIM2*SPACE5_DIM3*SPACE5_DIM4*SPACE5_DIM5)
+#define SPACE6_RANK 1
+#define SPACE6_DIM1 (SPACE5_DIM1*SPACE5_DIM2*SPACE5_DIM3*SPACE5_DIM4*SPACE5_DIM5)
/* 2-D dataset with easy dimension sizes */
#define SPACE7_NAME "Space7"
-#define SPACE7_RANK 2
-#define SPACE7_DIM1 10
-#define SPACE7_DIM2 10
+#define SPACE7_RANK 2
+#define SPACE7_DIM1 10
+#define SPACE7_DIM2 10
#define SPACE7_FILL 254
#define SPACE7_CHUNK_DIM1 5
#define SPACE7_CHUNK_DIM2 5
@@ -89,16 +89,16 @@
/* 4-D dataset with fixed dimensions */
#define SPACE8_NAME "Space8"
-#define SPACE8_RANK 4
-#define SPACE8_DIM1 11
-#define SPACE8_DIM2 13
-#define SPACE8_DIM3 17
-#define SPACE8_DIM4 19
+#define SPACE8_RANK 4
+#define SPACE8_DIM1 11
+#define SPACE8_DIM2 13
+#define SPACE8_DIM3 17
+#define SPACE8_DIM4 19
/* Another 2-D dataset with easy dimension sizes */
-#define SPACE9_RANK 2
-#define SPACE9_DIM1 12
-#define SPACE9_DIM2 12
+#define SPACE9_RANK 2
+#define SPACE9_DIM1 12
+#define SPACE9_DIM2 12
/* Element selection information */
#define POINT1_NPOINTS 10
@@ -125,13 +125,13 @@
#define SPACE10_CHUNK_SIZE 12
/* Information for bounds checking test */
-#define SPACE11_RANK 2
+#define SPACE11_RANK 2
#define SPACE11_DIM1 100
#define SPACE11_DIM2 100
#define SPACE11_NPOINTS 4
/* Information for offsets w/chunks test #2 */
-#define SPACE12_RANK 1
+#define SPACE12_RANK 1
#define SPACE12_DIM0 25
#define SPACE12_CHUNK_DIM0 5
@@ -157,16 +157,25 @@
#define SPACERE5_DIM3 12
#define SPACERE5_DIM4 8
+/* Information for Space update diminfo test */
+#define SPACEUD1_DIM0 20
+#define SPACEUD3_DIM0 9
+#define SPACEUD3_DIM1 12
+#define SPACEUD3_DIM2 13
+
/* #defines for shape same / different rank tests */
-#define SS_DR_MAX_RANK 5
+#define SS_DR_MAX_RANK 5
/* Information for regular hyperslab query test */
-#define SPACE13_RANK 3
+#define SPACE13_RANK 3
#define SPACE13_DIM1 50
#define SPACE13_DIM2 50
#define SPACE13_DIM3 50
#define SPACE13_NPOINTS 4
+/* Information for testing selection iterators */
+#define SEL_ITER_MAX_SEQ 256
+
/* Location comparison function */
static int compare_size_t(const void *s1, const void *s2);
@@ -206,21 +215,21 @@ test_select_hyper_iter1(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_A
static void
test_select_hyper(hid_t xfer_plist)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
H5S_class_t ext_type; /* Extent type */
/* Output message about test being performed */
@@ -371,7 +380,7 @@ test_select_hyper(hid_t xfer_plist)
} /* test_select_hyper() */
struct pnt_iter {
- hsize_t coord[POINT1_NPOINTS*2][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t coord[POINT1_NPOINTS*2][SPACE2_RANK]; /* Coordinates for point selection */
uint8_t *buf; /* Buffer the points are in */
int offset; /* Which point we are looking at */
};
@@ -408,24 +417,24 @@ test_select_point_iter1(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_A
static void
test_select_point(hid_t xfer_plist)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
- hsize_t temp_coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
- hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
- hsize_t temp_coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
- hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
- hsize_t temp_coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
+ hsize_t temp_coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
+ hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t temp_coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hsize_t temp_coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf; /* temporary buffer pointer */
int i,j; /* Counters */
struct pnt_iter pi; /* Custom Pointer iterator struct */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Element Selection Functions\n"));
@@ -694,15 +703,15 @@ test_select_none_iter1(void H5_ATTR_UNUSED *_elem, hid_t H5_ATTR_UNUSED type_id,
static void
test_select_all(hid_t xfer_plist)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hsize_t dims1[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3};
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3};
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf; /* temporary buffer pointer */
int i,j,k; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
H5S_class_t ext_type; /* Extent type */
/* Output message about test being performed */
@@ -775,21 +784,21 @@ test_select_all(hid_t xfer_plist)
static void
test_select_all_hyper(hid_t xfer_plist)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE3_DIM1, SPACE3_DIM2};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
H5S_class_t ext_type; /* Extent type */
/* Output message about test being performed */
@@ -916,23 +925,23 @@ test_select_all_hyper(hid_t xfer_plist)
static void
test_select_combo(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
- hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf, /* temporary buffer pointer */
*tbuf2; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Combination of Hyperslab & Element Selection Functions\n"));
@@ -1060,16 +1069,16 @@ compare_size_t(const void *s1, const void *s2)
static void
test_select_hyper_stride(hid_t xfer_plist)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
uint16_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf, /* temporary buffer pointer */
@@ -1099,7 +1108,7 @@ test_select_hyper_stride(hid_t xfer_plist)
220,221,222,246,247,248, /* Block #12 */
};
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n"));
@@ -1179,8 +1188,8 @@ test_select_hyper_stride(hid_t xfer_plist)
tbuf=wbuf+loc1[i];
tbuf2=rbuf+loc2[i];
if(*tbuf!=*tbuf2) {
- printf("%d: hyperslab values don't match!, loc1[%d]=%d, loc2[%d]=%d\n",__LINE__,i,(int)loc1[i],i,(int)loc2[i]);
- printf("wbuf=%p, tbuf=%p, rbuf=%p, tbuf2=%p\n",(void *)wbuf,(void *)tbuf,(void *)rbuf,(void *)tbuf2);
+ HDprintf("%d: hyperslab values don't match!, loc1[%d]=%d, loc2[%d]=%d\n",__LINE__,i,(int)loc1[i],i,(int)loc2[i]);
+ HDprintf("wbuf=%p, tbuf=%p, rbuf=%p, tbuf2=%p\n",(void *)wbuf,(void *)tbuf,(void *)rbuf,(void *)tbuf2);
TestErrPrintf("*tbuf=%u, *tbuf2=%u\n",(unsigned)*tbuf,(unsigned)*tbuf2);
} /* end if */
} /* end for */
@@ -1215,19 +1224,19 @@ test_select_hyper_stride(hid_t xfer_plist)
static void
test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims2[] = {SPACE2_DIM2, SPACE2_DIM1};
- hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims2[] = {SPACE2_DIM2, SPACE2_DIM1};
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
uint16_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Contiguous Hyperslabs Functionality\n"));
@@ -1308,14 +1317,8 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if(HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12)) {
+ if(HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12))
TestErrPrintf("hyperslab values don't match! Line=%d\n",__LINE__);
-#ifdef QAK
- for(i=0, tbuf=wbuf; i<12; i++)
- for(j=0; j<30; j++)
- printf("i=%d, j=%d, *wbuf=%u, *rbuf=%u\n",i,j,(unsigned)*(wbuf+i*30+j),(unsigned)*(rbuf+i*30+j));
-#endif /* QAK */
- } /* end if */
/* Close memory dataspace */
ret = H5Sclose(sid2);
@@ -1347,17 +1350,17 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist)
static void
test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1};
- hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */
- hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1};
+ hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */
+ hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */
uint16_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf; /* temporary buffer pointer */
int i,j,k,l; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing More Contiguous Hyperslabs Functionality\n"));
@@ -1432,14 +1435,8 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if(HDmemcmp(rbuf,wbuf,sizeof(uint16_t)*2*SPACE8_DIM3*SPACE8_DIM2*SPACE8_DIM1)) {
+ if(HDmemcmp(rbuf,wbuf,sizeof(uint16_t)*2*SPACE8_DIM3*SPACE8_DIM2*SPACE8_DIM1))
TestErrPrintf("Error: hyperslab values don't match!\n");
-#ifdef QAK
- for(i=0, tbuf=wbuf; i<12; i++)
- for(j=0; j<30; j++)
- printf("i=%d, j=%d, *wbuf=%u, *rbuf=%u\n",i,j,(unsigned)*(wbuf+i*30+j),(unsigned)*(rbuf+i*30+j));
-#endif /* QAK */
- } /* end if */
/* Close memory dataspace */
ret = H5Sclose(sid2);
@@ -1474,17 +1471,17 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist)
static void
test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1};
- hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */
- hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1};
+ hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */
+ hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */
uint16_t *wbuf, /* Buffer to write to disk */
*rbuf, /* Buffer read from disk */
*tbuf, *tbuf2; /* Temporary buffer pointers */
unsigned i,j,k,l; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Yet More Contiguous Hyperslabs Functionality\n"));
@@ -1568,13 +1565,13 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist)
(k>=start[2] && k<(start[2]+count[2])) &&
(l>=start[3] && l<(start[3]+count[3])) ) {
if(*tbuf!=*tbuf2) {
- printf("Error: hyperslab values don't match!\n");
+ HDprintf("Error: hyperslab values don't match!\n");
TestErrPrintf("Line: %d, i=%u, j=%u, k=%u, l=%u, *tbuf=%u,*tbuf2=%u\n",__LINE__,i,j,k,l,(unsigned)*tbuf,(unsigned)*tbuf2);
} /* end if */
} /* end if */
else {
if(*tbuf2!=0) {
- printf("Error: invalid data in read buffer!\n");
+ HDprintf("Error: invalid data in read buffer!\n");
TestErrPrintf("Line: %d, i=%u, j=%u, k=%u, l=%u, *tbuf=%u,*tbuf2=%u\n",__LINE__,i,j,k,l,(unsigned)*tbuf,(unsigned)*tbuf2);
} /* end if */
} /* end else */
@@ -1600,7 +1597,7 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist)
HDfree(rbuf);
} /* test_select_hyper_contig3() */
-
+
/****************************************************************
**
** verify_select_hyper_contig_dr__run_test(): Verify data from
@@ -1612,10 +1609,10 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf,
size_t cube_size, unsigned edge_size, unsigned cube_rank)
{
const uint16_t *cube_ptr; /* Pointer into the cube buffer */
- uint16_t expected_value; /* Expected value in dataset */
+ uint16_t expected_value; /* Expected value in dataset */
unsigned i, j, k, l, m; /* Local index variables */
size_t s; /* Local index variable */
- hbool_t mis_match; /* Flag to indicate mis-match in expected value */
+ hbool_t mis_match; /* Flag to indicate mis-match in expected value */
HDassert(cube_buf);
HDassert(cube_size > 0);
@@ -1659,7 +1656,7 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf,
TestErrPrintf("Initial cube data don't match! Line = %d\n", __LINE__);
} /* verify_select_hyper_contig_dr__run_test() */
-
+
/****************************************************************
**
** test_select_hyper_contig_dr__run_test(): Test H5S (dataspace)
@@ -1674,37 +1671,37 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
const uint16_t *zero_buf, unsigned edge_size, unsigned chunk_edge_size,
unsigned small_rank, unsigned large_rank, hid_t dset_type, hid_t xfer_plist)
{
- hbool_t mis_match; /* Flag indicating a value read in wasn't what was expected */
+ hbool_t mis_match; /* Flag indicating a value read in wasn't what was expected */
hid_t fapl; /* File access property list */
- hid_t fid1; /* File ID */
- hid_t small_cube_sid; /* Dataspace ID for small cube in memory & file */
- hid_t mem_large_cube_sid; /* Dataspace ID for large cube in memory */
- hid_t file_large_cube_sid; /* Dataspace ID for large cube in file */
- hid_t small_cube_dcpl_id = H5P_DEFAULT; /* DCPL for small cube dataset */
- hid_t large_cube_dcpl_id = H5P_DEFAULT; /* DCPL for large cube dataset */
- hid_t small_cube_dataset; /* Dataset ID */
- hid_t large_cube_dataset; /* Dataset ID */
+ hid_t fid1; /* File ID */
+ hid_t small_cube_sid; /* Dataspace ID for small cube in memory & file */
+ hid_t mem_large_cube_sid; /* Dataspace ID for large cube in memory */
+ hid_t file_large_cube_sid; /* Dataspace ID for large cube in file */
+ hid_t small_cube_dcpl_id = H5P_DEFAULT; /* DCPL for small cube dataset */
+ hid_t large_cube_dcpl_id = H5P_DEFAULT; /* DCPL for large cube dataset */
+ hid_t small_cube_dataset; /* Dataset ID */
+ hid_t large_cube_dataset; /* Dataset ID */
size_t start_index; /* Offset within buffer to begin inspecting */
size_t stop_index; /* Offset within buffer to end inspecting */
- uint16_t expected_value; /* Expected value in dataset */
- uint16_t * small_cube_buf_1; /* Buffer for small cube data */
- uint16_t * large_cube_buf_1; /* Buffer for large cube data */
- uint16_t * ptr_1; /* Temporary pointer into cube data */
- hsize_t dims[SS_DR_MAX_RANK]; /* Dataspace dimensions */
- hsize_t start[SS_DR_MAX_RANK]; /* Shared hyperslab start offset */
- hsize_t stride[SS_DR_MAX_RANK]; /* Shared hyperslab stride */
- hsize_t count[SS_DR_MAX_RANK]; /* Shared hyperslab count */
- hsize_t block[SS_DR_MAX_RANK]; /* Shared hyperslab block size */
- hsize_t * start_ptr; /* Actual hyperslab start offset */
- hsize_t * stride_ptr; /* Actual hyperslab stride */
- hsize_t * count_ptr; /* Actual hyperslab count */
- hsize_t * block_ptr; /* Actual hyperslab block size */
+ uint16_t expected_value; /* Expected value in dataset */
+ uint16_t * small_cube_buf_1; /* Buffer for small cube data */
+ uint16_t * large_cube_buf_1; /* Buffer for large cube data */
+ uint16_t * ptr_1; /* Temporary pointer into cube data */
+ hsize_t dims[SS_DR_MAX_RANK]; /* Dataspace dimensions */
+ hsize_t start[SS_DR_MAX_RANK]; /* Shared hyperslab start offset */
+ hsize_t stride[SS_DR_MAX_RANK]; /* Shared hyperslab stride */
+ hsize_t count[SS_DR_MAX_RANK]; /* Shared hyperslab count */
+ hsize_t block[SS_DR_MAX_RANK]; /* Shared hyperslab block size */
+ hsize_t * start_ptr; /* Actual hyperslab start offset */
+ hsize_t * stride_ptr; /* Actual hyperslab stride */
+ hsize_t * count_ptr; /* Actual hyperslab count */
+ hsize_t * block_ptr; /* Actual hyperslab block size */
size_t small_cube_size; /* Number of elements in small cube */
size_t large_cube_size; /* Number of elements in large cube */
unsigned u, v, w, x; /* Local index variables */
size_t s; /* Local index variable */
- htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ htri_t check; /* Shape comparison return value */
+ herr_t ret; /* Generic return value */
MESSAGE(7, ("\tn-cube slice through m-cube I/O test %d.\n", test_num));
MESSAGE(7, ("\tranks = %u/%u, edge_size = %u, chunk_edge_size = %u.\n", small_rank, large_rank, edge_size, chunk_edge_size));
@@ -1773,10 +1770,10 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
* datasets.
*/
if(chunk_edge_size > 0) {
- hsize_t chunk_dims[SS_DR_MAX_RANK]; /* Chunk dimensions */
+ hsize_t chunk_dims[SS_DR_MAX_RANK]; /* Chunk dimensions */
chunk_dims[0] = chunk_dims[1] =
- chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = (hsize_t)chunk_edge_size;
+ chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = (hsize_t)chunk_edge_size;
small_cube_dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
CHECK(small_cube_dcpl_id, FAIL, "H5Pcreate");
@@ -2099,7 +2096,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
VERIFY(check, TRUE, "H5S_select_shape_same_test");
- /* write the slice from the in memory large cube to the on disk small cube */
+ /* write the slice from the in memory large cube to the on disk small cube */
ret = H5Dwrite(small_cube_dataset,
H5T_NATIVE_UINT16,
mem_large_cube_sid,
@@ -2210,7 +2207,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
VERIFY(check, TRUE, "H5S_select_shape_same_test");
- /* write the cube from memory to the target slice of the disk cube */
+ /* write the cube from memory to the target slice of the disk cube */
ret = H5Dwrite(large_cube_dataset,
H5T_NATIVE_UINT16,
small_cube_sid,
@@ -2306,7 +2303,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
} /* test_select_hyper_contig_dr__run_test() */
-
+
/****************************************************************
**
** test_select_hyper_contig_dr(): Test H5S (dataspace)
@@ -2374,25 +2371,25 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist)
} /* test_select_hyper_contig_dr() */
-
+
/****************************************************************
**
** test_select_hyper_checker_board_dr__select_checker_board():
-** Given an n-cube data space with each edge of length
-** edge_size, and a checker_edge_size either select a checker
-** board selection of the entire cube(if sel_rank == n),
-** or select a checker board selection of a
-** sel_rank dimensional slice through n-cube parallel to the
+** Given an n-cube dataspace with each edge of length
+** edge_size, and a checker_edge_size either select a checker
+** board selection of the entire cube(if sel_rank == n),
+** or select a checker board selection of a
+** sel_rank dimensional slice through n-cube parallel to the
** sel_rank fastest changing indices, with origin (in the
-** higher indices) as indicated by the start array.
+** higher indices) as indicated by the start array.
**
-** Note that this function, like all its relatives, is
-** hard coded to presume a maximum n-cube rank of 5.
-** While this maximum is declared as a constant, increasing
-** it will require extensive coding in addition to changing
+** Note that this function, like all its relatives, is
+** hard coded to presume a maximum n-cube rank of 5.
+** While this maximum is declared as a constant, increasing
+** it will require extensive coding in addition to changing
** the value of the constant.
**
-** JRM -- 9/9/09
+** JRM -- 9/9/09
**
****************************************************************/
static void
@@ -2400,18 +2397,18 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid,
unsigned tgt_n_cube_rank, unsigned edge_size, unsigned checker_edge_size,
unsigned sel_rank, hsize_t sel_start[])
{
- hbool_t first_selection = TRUE;
- unsigned n_cube_offset;
- unsigned sel_offset;
- hsize_t base_count;
+ hbool_t first_selection = TRUE;
+ unsigned n_cube_offset;
+ unsigned sel_offset;
+ hsize_t base_count;
hsize_t offset_count;
- hsize_t start[SS_DR_MAX_RANK]; /* Offset of hyperslab selection */
- hsize_t stride[SS_DR_MAX_RANK]; /* Stride of hyperslab selection */
- hsize_t count[SS_DR_MAX_RANK]; /* Count of hyperslab selection */
- hsize_t block[SS_DR_MAX_RANK]; /* Block size of hyperslab selection */
+ hsize_t start[SS_DR_MAX_RANK]; /* Offset of hyperslab selection */
+ hsize_t stride[SS_DR_MAX_RANK]; /* Stride of hyperslab selection */
+ hsize_t count[SS_DR_MAX_RANK]; /* Count of hyperslab selection */
+ hsize_t block[SS_DR_MAX_RANK]; /* Block size of hyperslab selection */
unsigned i, j, k, l, m; /* Local index variable */
unsigned u; /* Local index variables */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
HDassert(edge_size >= 6);
HDassert(0 < checker_edge_size);
@@ -2570,8 +2567,8 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid,
/* Wierdness alert:
*
* Some how, it seems that selections can extend beyond the
- * boundaries of the target data space -- hence the following
- * code to manually clip the selection back to the data space
+ * boundaries of the target dataspace -- hence the following
+ * code to manually clip the selection back to the dataspace
* proper.
*/
for(u = 0; u < SS_DR_MAX_RANK; u++) {
@@ -2585,47 +2582,47 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid,
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* test_select_hyper_checker_board_dr__select_checker_board() */
-
+
/****************************************************************
**
** test_select_hyper_checker_board_dr__verify_data():
**
-** Examine the supplied buffer to see if it contains the
-** expected data. Return TRUE if it does, and FALSE
+** Examine the supplied buffer to see if it contains the
+** expected data. Return TRUE if it does, and FALSE
** otherwise.
**
-** The supplied buffer is presumed to contain the results
-** of read or writing a checkerboard selection of an
-** n-cube, or a checkerboard selection of an m (1 <= m < n)
-** dimensional slice through an n-cube parallel to the
+** The supplied buffer is presumed to contain the results
+** of read or writing a checkerboard selection of an
+** n-cube, or a checkerboard selection of an m (1 <= m < n)
+** dimensional slice through an n-cube parallel to the
** fastest changing indices.
**
-** It is further presumed that the buffer was zeroed before
-** the read, and that the n-cube was initialize with the
+** It is further presumed that the buffer was zeroed before
+** the read, and that the n-cube was initialize with the
** natural numbers listed in order from the origin along
** the fastest changing axis.
**
** Thus for a 10x10x10 3-cube, the value stored in location
-** (x, y, z) (assuming that z is the fastest changing index
-** and x the slowest) is assumed to be:
+** (x, y, z) (assuming that z is the fastest changing index
+** and x the slowest) is assumed to be:
**
-** (10 * 10 * x) + (10 * y) + z
+** (10 * 10 * x) + (10 * y) + z
**
-** Thus, if the buffer contains the result of reading a
-** checker board selection of a 10x10x10 3-cube, location
-** (x, y, z) will contain zero if it is not in a checker,
-** and 100x + 10y + z if (x, y, z) is in a checker.
+** Thus, if the buffer contains the result of reading a
+** checker board selection of a 10x10x10 3-cube, location
+** (x, y, z) will contain zero if it is not in a checker,
+** and 100x + 10y + z if (x, y, z) is in a checker.
**
-** If the buffer contains the result of reading a 3
-** dimensional slice (parallel to the three fastest changing
-** indices) through an n cube (n > 3), then the expected
-** values in the buffer will be the same, save that we will
-** add a constant determined by the origin of the 3-cube
-** in the n-cube.
+** If the buffer contains the result of reading a 3
+** dimensional slice (parallel to the three fastest changing
+** indices) through an n cube (n > 3), then the expected
+** values in the buffer will be the same, save that we will
+** add a constant determined by the origin of the 3-cube
+** in the n-cube.
**
-** Finally, the function presumes that the first element
-** of the buffer resides either at the origin of either
-** a selected or an unselected checker.
+** Finally, the function presumes that the first element
+** of the buffer resides either at the origin of either
+** a selected or an unselected checker.
**
****************************************************************/
H5_ATTR_PURE static hbool_t
@@ -2729,7 +2726,7 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t * buf_ptr,
return(good_data);
} /* test_select_hyper_checker_board_dr__verify_data() */
-
+
/****************************************************************
**
** test_select_hyper_checker_board_dr__run_test(): Test H5S
@@ -2745,36 +2742,36 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
unsigned chunk_edge_size, unsigned small_rank, unsigned large_rank,
hid_t dset_type, hid_t xfer_plist)
{
- hbool_t data_ok;
+ hbool_t data_ok;
hid_t fapl; /* File access property list */
- hid_t fid; /* HDF5 File IDs */
- hid_t full_small_cube_sid; /* Dataspace for small cube w/all selection */
- hid_t mem_small_cube_sid;
- hid_t file_small_cube_sid;
- hid_t full_large_cube_sid; /* Dataspace for large cube w/all selection */
- hid_t mem_large_cube_sid;
- hid_t file_large_cube_sid;
- hid_t small_cube_dcpl_id = H5P_DEFAULT; /* DCPL for small cube dataset */
- hid_t large_cube_dcpl_id = H5P_DEFAULT; /* DCPL for large cube dataset */
- hid_t small_cube_dataset; /* Dataset ID */
- hid_t large_cube_dataset; /* Dataset ID */
- unsigned small_rank_offset; /* Rank offset of slice */
- const unsigned test_max_rank = 5; /* must update code if this changes */
+ hid_t fid; /* HDF5 File IDs */
+ hid_t full_small_cube_sid; /* Dataspace for small cube w/all selection */
+ hid_t mem_small_cube_sid;
+ hid_t file_small_cube_sid;
+ hid_t full_large_cube_sid; /* Dataspace for large cube w/all selection */
+ hid_t mem_large_cube_sid;
+ hid_t file_large_cube_sid;
+ hid_t small_cube_dcpl_id = H5P_DEFAULT; /* DCPL for small cube dataset */
+ hid_t large_cube_dcpl_id = H5P_DEFAULT; /* DCPL for large cube dataset */
+ hid_t small_cube_dataset; /* Dataset ID */
+ hid_t large_cube_dataset; /* Dataset ID */
+ unsigned small_rank_offset; /* Rank offset of slice */
+ const unsigned test_max_rank = 5; /* must update code if this changes */
size_t start_index; /* Offset within buffer to begin inspecting */
size_t stop_index; /* Offset within buffer to end inspecting */
- uint16_t expected_value;
- uint16_t * small_cube_buf_1;
- uint16_t * large_cube_buf_1;
- uint16_t * ptr_1;
+ uint16_t expected_value;
+ uint16_t * small_cube_buf_1;
+ uint16_t * large_cube_buf_1;
+ uint16_t * ptr_1;
size_t small_cube_size; /* Number of elements in small cube */
size_t large_cube_size; /* Number of elements in large cube */
- hsize_t dims[SS_DR_MAX_RANK];
- hsize_t chunk_dims[SS_DR_MAX_RANK];
- hsize_t sel_start[SS_DR_MAX_RANK];
+ hsize_t dims[SS_DR_MAX_RANK];
+ hsize_t chunk_dims[SS_DR_MAX_RANK];
+ hsize_t sel_start[SS_DR_MAX_RANK];
unsigned u, v, w, x; /* Local index variables */
size_t s; /* Local index variable */
- htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ htri_t check; /* Shape comparison return value */
+ herr_t ret; /* Generic return value */
MESSAGE(7, ("\tn-cube slice through m-cube I/O test %d.\n", test_num));
MESSAGE(7, ("\tranks = %d/%d, edge_size = %d, checker_edge_size = %d, chunk_edge_size = %d.\n", small_rank, large_rank, edge_size, checker_edge_size, chunk_edge_size));
@@ -2865,7 +2862,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
*/
if(chunk_edge_size > 0) {
chunk_dims[0] = chunk_dims[1] =
- chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = chunk_edge_size;
+ chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = chunk_edge_size;
small_cube_dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
CHECK(small_cube_dcpl_id, FAIL, "H5Pcreate");
@@ -3275,7 +3272,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
VERIFY(check, TRUE, "H5S_select_shape_same_test");
- /* write the slice from the in memory large cube to the
+ /* write the slice from the in memory large cube to the
* on disk small cube
*/
ret = H5Dwrite(small_cube_dataset,
@@ -3407,7 +3404,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
VERIFY(check, TRUE, "H5S_select_shape_same_test");
- /* write the checker board selection of the in memory
+ /* write the checker board selection of the in memory
* small cube to a slice through the on disk large
* cube.
*/
@@ -3534,17 +3531,17 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
} /* test_select_hyper_checker_board_dr__run_test() */
-
+
/****************************************************************
**
-** test_select_hyper_checker_board_dr(): Test H5S (dataspace)
-** selection code with checkerboard source and target having
+** test_select_hyper_checker_board_dr(): Test H5S (dataspace)
+** selection code with checkerboard source and target having
** different ranks but the same shape. We have already
-** tested H5S_shape_same in isolation, so now we try to do
+** tested H5S_shape_same in isolation, so now we try to do
** I/O.
**
-** This is just an initial smoke check, so we will work
-** with a slice through a cube only.
+** This is just an initial smoke check, so we will work
+** with a slice through a cube only.
**
****************************************************************/
static void
@@ -3619,7 +3616,7 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist)
} /* test_select_hyper_checker_board_dr() */
-
+
/****************************************************************
**
** test_select_hyper_copy(): Test H5S (dataspace) selection code.
@@ -3629,22 +3626,22 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist)
static void
test_select_hyper_copy(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t data1,data2; /* Dataset IDs */
- hid_t sid1,sid2,sid3; /* Dataspace IDs */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t data1,data2; /* Dataset IDs */
+ hid_t sid1,sid2,sid3; /* Dataspace IDs */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
uint16_t *wbuf, /* buffer to write to disk */
*rbuf, /* 1st buffer read from disk */
*rbuf2, /* 2nd buffer read from disk */
*tbuf; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n"));
@@ -3743,15 +3740,8 @@ test_select_hyper_copy(void)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if(HDmemcmp(rbuf,rbuf2,sizeof(uint16_t)*SPACE3_DIM1*SPACE3_DIM2)) {
+ if(HDmemcmp(rbuf,rbuf2,sizeof(uint16_t)*SPACE3_DIM1*SPACE3_DIM2))
TestErrPrintf("hyperslab values don't match! Line=%d\n",__LINE__);
-#ifdef QAK
- for(i=0; i<SPACE3_DIM1; i++)
- for(j=0; j<SPACE3_DIM2; j++)
- if((unsigned)*(rbuf+i*SPACE3_DIM2+j)!=(unsigned)*(rbuf2+i*SPACE3_DIM2+j))
- printf("i=%d, j=%d, *rbuf=%u, *rbuf2=%u\n",i,j,(unsigned)*(rbuf+i*SPACE3_DIM2+j),(unsigned)*(rbuf2+i*SPACE3_DIM2+j));
-#endif /* QAK */
- } /* end if */
/* Close memory dataspace */
ret = H5Sclose(sid2);
@@ -3792,21 +3782,21 @@ test_select_hyper_copy(void)
static void
test_select_point_copy(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t data1,data2; /* Dataset IDs */
- hid_t sid1,sid2,sid3; /* Dataspace IDs */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
- hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
- hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t data1,data2; /* Dataset IDs */
+ hid_t sid1,sid2,sid3; /* Dataspace IDs */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
+ hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
uint16_t *wbuf, /* buffer to write to disk */
*rbuf, /* 1st buffer read from disk */
*rbuf2, /* 2nd buffer read from disk */
*tbuf; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n"));
@@ -3966,24 +3956,24 @@ test_select_point_copy(void)
static void
test_select_hyper_offset(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
- hssize_t offset[SPACE1_RANK]; /* Offset of selection */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
+ hssize_t offset[SPACE1_RANK]; /* Offset of selection */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf, /* temporary buffer pointer */
*tbuf2; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
- htri_t valid; /* Generic boolean return value */
+ herr_t ret; /* Generic return value */
+ htri_t valid; /* Generic boolean return value */
H5S_class_t ext_type; /* Extent type */
/* Output message about test being performed */
@@ -4128,21 +4118,21 @@ test_select_hyper_offset(void)
static void
test_select_hyper_offset2(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
- hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2};
- hsize_t start[SPACE7_RANK]; /* Starting location of hyperslab */
- hsize_t count[SPACE7_RANK]; /* Element count of hyperslab */
- hssize_t offset[SPACE7_RANK]; /* Offset of selection */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
+ hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2};
+ hsize_t start[SPACE7_RANK]; /* Starting location of hyperslab */
+ hsize_t count[SPACE7_RANK]; /* Element count of hyperslab */
+ hssize_t offset[SPACE7_RANK]; /* Offset of selection */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf, /* temporary buffer pointer */
*tbuf2; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
- htri_t valid; /* Generic boolean return value */
+ herr_t ret; /* Generic return value */
+ htri_t valid; /* Generic boolean return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing More Hyperslab Selection Functions with Offsets\n"));
@@ -4249,23 +4239,23 @@ test_select_hyper_offset2(void)
static void
test_select_point_offset(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
- hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
- hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
- hssize_t offset[SPACE1_RANK]; /* Offset of selection */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
+ hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hssize_t offset[SPACE1_RANK]; /* Offset of selection */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf, /* temporary buffer pointer */
*tbuf2; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
- htri_t valid; /* Generic boolean return value */
+ herr_t ret; /* Generic return value */
+ htri_t valid; /* Generic boolean return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Element Selection Functions\n"));
@@ -4421,17 +4411,17 @@ test_select_point_offset(void)
static void
test_select_hyper_union(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hid_t xfer; /* Dataset Transfer Property List ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hid_t xfer; /* Dataset Transfer Property List ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
size_t begin[SPACE2_DIM1]= /* Offset within irregular block */
{0,0,0,0,0,0,0,0,0,0, /* First ten rows start at offset 0 */
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5}; /* Next eighteen rows start at offset 5 */
@@ -4444,8 +4434,8 @@ test_select_hyper_union(void)
*tbuf, /* temporary buffer pointer */
*tbuf2; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
- hssize_t npoints; /* Number of elements in selection */
+ herr_t ret; /* Generic return value */
+ hssize_t npoints; /* Number of elements in selection */
/* Output message about test being performed */
MESSAGE(5, ("Testing Hyperslab Selection Functions with unions of hyperslabs\n"));
@@ -5056,10 +5046,10 @@ test_select_hyper_union_stagger(void)
/* Verify input data */
for(i=0; i<8; i++) {
if(data[input_loc[i][0]][input_loc[i][1]]!=data_out[output_loc[i][0]][output_loc[i][1]]) {
- printf("input data #%d is wrong!\n",i);
- printf("input_loc=[%d][%d]\n",input_loc[i][0],input_loc[i][1]);
- printf("output_loc=[%d][%d]\n",output_loc[i][0],output_loc[i][1]);
- printf("data=%d\n",data[input_loc[i][0]][input_loc[i][1]]);
+ HDprintf("input data #%d is wrong!\n",i);
+ HDprintf("input_loc=[%d][%d]\n",input_loc[i][0],input_loc[i][1]);
+ HDprintf("output_loc=[%d][%d]\n",output_loc[i][0],output_loc[i][1]);
+ HDprintf("data=%d\n",data[input_loc[i][0]][input_loc[i][1]]);
TestErrPrintf("data_out=%d\n",data_out[output_loc[i][0]][output_loc[i][1]]);
} /* end if */
} /* end for */
@@ -5089,18 +5079,18 @@ test_select_hyper_union_stagger(void)
static void
test_select_hyper_union_3d(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hid_t tmp_space; /* Temporary Dataspace ID */
- hid_t tmp2_space; /* Another temporary Dataspace ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3};
- hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hid_t tmp_space; /* Temporary Dataspace ID */
+ hid_t tmp2_space; /* Another temporary Dataspace ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3};
+ hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
struct row_list {
size_t z;
size_t y;
@@ -5220,7 +5210,7 @@ test_select_hyper_union_3d(void)
tmp2_space = H5Scombine_select(sid2,H5S_SELECT_OR,tmp_space);
CHECK(tmp2_space, FAIL, "H5Scombin_select");
- npoints = H5Sget_select_npoints(tmp2_space);
+ npoints = (hsize_t)H5Sget_select_npoints(tmp2_space);
VERIFY(npoints, 15*26, "H5Sget_select_npoints");
/* Create a dataset */
@@ -5387,12 +5377,12 @@ test_select_hyper_and_2d(void)
for(j=0; j<SPACE2_DIM2; j++, tbuf++) {
if((i>=5 && i<=9) && (j>=5 && j<=9)) {
if(*tbuf!=*tbuf2)
- printf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2);
+ HDprintf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2);
tbuf2++;
} /* end if */
else {
if(*tbuf!=0)
- printf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf);
+ HDprintf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf);
} /* end else */
} /* end for */
@@ -5426,22 +5416,22 @@ test_select_hyper_and_2d(void)
static void
test_select_hyper_xor_2d(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims2[] = {SPACE2A_DIM1};
- hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims2[] = {SPACE2A_DIM1};
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf, /* temporary buffer pointer */
*tbuf2; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
- hssize_t npoints; /* Number of elements in selection */
+ herr_t ret; /* Generic return value */
+ hssize_t npoints; /* Number of elements in selection */
/* Output message about test being performed */
MESSAGE(5, ("Testing Hyperslab Selection Functions with XOR of 2-D hyperslabs\n"));
@@ -5518,12 +5508,12 @@ test_select_hyper_xor_2d(void)
((i>=5 && i<=9) && ((j>=0 && j<=4) || (j>=10 && j<=14))) ||
((i>=10 && i<=14) && (j>=5 && j<=14))) {
if(*tbuf!=*tbuf2)
- printf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2);
+ HDprintf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2);
tbuf2++;
} /* end if */
else {
if(*tbuf!=0)
- printf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf);
+ HDprintf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf);
} /* end else */
} /* end for */
@@ -5557,22 +5547,22 @@ test_select_hyper_xor_2d(void)
static void
test_select_hyper_notb_2d(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims2[] = {SPACE2A_DIM1};
- hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims2[] = {SPACE2A_DIM1};
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf, /* temporary buffer pointer */
*tbuf2; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
- hssize_t npoints; /* Number of elements in selection */
+ herr_t ret; /* Generic return value */
+ hssize_t npoints; /* Number of elements in selection */
/* Output message about test being performed */
MESSAGE(5, ("Testing Hyperslab Selection Functions with NOTB of 2-D hyperslabs\n"));
@@ -5648,12 +5638,12 @@ test_select_hyper_notb_2d(void)
if(((i>=0 && i<=4) && (j>=0 && j<=9)) ||
((i>=5 && i<=9) && (j>=0 && j<=4))) {
if(*tbuf!=*tbuf2)
- printf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2);
+ HDprintf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2);
tbuf2++;
} /* end if */
else {
if(*tbuf!=0)
- printf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf);
+ HDprintf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf);
} /* end else */
} /* end for */
@@ -5687,22 +5677,22 @@ test_select_hyper_notb_2d(void)
static void
test_select_hyper_nota_2d(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims2[] = {SPACE2A_DIM1};
- hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims2[] = {SPACE2A_DIM1};
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf, /* temporary buffer pointer */
*tbuf2; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
- hssize_t npoints; /* Number of elements in selection */
+ herr_t ret; /* Generic return value */
+ hssize_t npoints; /* Number of elements in selection */
/* Output message about test being performed */
MESSAGE(5, ("Testing Hyperslab Selection Functions with NOTA of 2-D hyperslabs\n"));
@@ -5822,14 +5812,14 @@ test_select_hyper_iter2(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned ndim
if(*tbuf!=**tbuf2) {
TestErrPrintf("Error in hyperslab iteration!\n");
- printf("location: { ");
+ HDprintf("location: { ");
for(u=0; u<ndim; u++) {
- printf("%2d",(int)point[u]);
+ HDprintf("%2d",(int)point[u]);
if(u<(ndim-1))
- printf(", ");
+ HDprintf(", ");
} /* end for */
- printf("}\n");
- printf("*tbuf=%d, **tbuf2=%d\n",*tbuf,**tbuf2);
+ HDprintf("}\n");
+ HDprintf("*tbuf=%d, **tbuf2=%d\n",*tbuf,**tbuf2);
return(-1);
} /* end if */
else {
@@ -5902,42 +5892,29 @@ test_select_hyper_union_random_5d(hid_t read_plist)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Get initial random # seed */
- seed=(unsigned)time(NULL)+(unsigned)clock();
+ seed = (unsigned)HDtime(NULL) + (unsigned)HDclock();
/* Crunch through a bunch of random hyperslab reads from the file dataset */
for(test_num=0; test_num<NRAND_HYPER; test_num++) {
/* Save random # seed for later use */
/* (Used in case of errors, to regenerate the hyperslab sequence) */
-#ifndef QAK
- seed+=(unsigned)clock();
-#else /* QAK */
- seed=987909620;
-#endif /* QAK */
+ seed += (unsigned)HDclock();
HDsrandom(seed);
-#ifdef QAK
-printf("test_num=%d, seed=%u\n",test_num,seed);
-#endif /* QAK */
-#ifndef QAK
for(i=0; i<NHYPERSLABS; i++) {
-#else /* QAK */
- for(i=0; i<2; i++) {
-#endif /* QAK */
-#ifdef QAK
-printf("hyperslab=%d\n",i);
-#endif /* QAK */
/* Select random hyperslab location & size for selection */
for(j=0; j<SPACE5_RANK; j++) {
start[j] = ((hsize_t)HDrandom() % dims1[j]);
count[j] = (((hsize_t)HDrandom() % (dims1[j] - start[j])) + 1);
-#ifdef QAK
-printf("start[%d]=%d, count[%d]=%d (end[%d]=%d)\n",j,(int)start[j],j,(int)count[j],j,(int)(start[j]+count[j]-1));
-#endif /* QAK */
} /* end for */
/* Select hyperslab */
ret = H5Sselect_hyperslab(sid1, (i == 0 ? H5S_SELECT_SET : H5S_SELECT_OR), start, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
+ if(ret < 0) {
+ TestErrPrintf("Random hyperslabs for seed %u failed!\n", seed);
+ break;
+ } /* end if */
} /* end for */
/* Get the number of elements selected */
@@ -5953,49 +5930,21 @@ printf("start[%d]=%d, count[%d]=%d (end[%d]=%d)\n",j,(int)start[j],j,(int)count[
npoints2 = H5Sget_select_npoints(sid2);
VERIFY(npoints, npoints2, "H5Sget_select_npoints");
-#ifdef QAK
-printf("random I/O, before H5Dread(), npoints=%lu\n",(unsigned long)npoints);
-{
- hsize_t blocks[128][2][SPACE5_RANK];
- hssize_t nblocks;
- int k;
-
- nblocks=H5Sget_select_hyper_nblocks(sid1);
- printf("nblocks=%d\n",(int)nblocks);
- H5Sget_select_hyper_blocklist(sid1,0,nblocks,blocks);
- for(j=0; j<nblocks; j++) {
- printf("Block #%d, start = {",j);
- for(k=0; k<SPACE5_RANK; k++) {
- printf("%d",blocks[j][0][k]);
- if(k<(SPACE5_RANK-1))
- printf(", ");
- else
- printf("}, end = {");
- } /* end for */
- for(k=0; k<SPACE5_RANK; k++) {
- printf("%d",blocks[j][1][k]);
- if(k<(SPACE5_RANK-1))
- printf(", ");
- else
- printf("}\n");
- } /* end for */
- } /* end for */
-}
-#endif /* QAK */
/* Read selection from disk */
ret=H5Dread(dataset,H5T_NATIVE_INT,sid2,sid1,read_plist,rbuf);
CHECK(ret, FAIL, "H5Dread");
-#ifdef QAK
-printf("random I/O, after H5Dread()\n");
-#endif /* QAK */
+ if(ret < 0) {
+ TestErrPrintf("Random hyperslabs for seed %u failed!\n", seed);
+ break;
+ } /* end if */
/* Compare data read with data written out */
tbuf=rbuf;
ret = H5Diterate(wbuf,H5T_NATIVE_INT,sid1,test_select_hyper_iter2,&tbuf);
- if(ret<0) {
- TestErrPrintf("Random hyperslabs for seed %u failed!\n",seed);
+ if(ret < 0) {
+ TestErrPrintf("Random hyperslabs for seed %u failed!\n", seed);
break;
- }
+ } /* end if */
/* Set the read buffer back to all zeroes */
HDmemset(rbuf, 0, (size_t)SPACE6_DIM1);
@@ -6282,9 +6231,6 @@ test_select_point_chunk(void)
herr_t ret; /* Generic return value */
unsigned *data_out; /* output buffer */
-#ifdef LATER
- unsigned *tmpdata_out; /* output buffer */
-#endif /* LATER */
hsize_t start[SPACE7_RANK]; /* hyperslab offset */
hsize_t count[SPACE7_RANK]; /* size of the hyperslab */
@@ -7042,15 +6988,15 @@ test_select_hyper_iter3(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned ndim
static void
test_select_fill_all(void)
{
- hid_t sid1; /* Dataspace ID */
- hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
+ hid_t sid1; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
unsigned fill_value; /* Fill value */
fill_iter_info iter_info; /* Iterator information structure */
hsize_t points[SPACE7_DIM1*SPACE7_DIM2][SPACE7_RANK]; /* Coordinates of selection */
unsigned *wbuf, /* buffer to write to disk */
*tbuf; /* temporary buffer pointer */
unsigned u, v; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Filling 'all' Selections\n"));
@@ -7116,8 +7062,8 @@ test_select_fill_all(void)
static void
test_select_fill_point(hssize_t *offset)
{
- hid_t sid1; /* Dataspace ID */
- hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
+ hid_t sid1; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */
hsize_t points[5][SPACE7_RANK] = {{2,4}, {3,8}, {8,4}, {7,5}, {7,7}};
size_t num_points = 5; /* Number of points selected */
@@ -7126,7 +7072,7 @@ test_select_fill_point(hssize_t *offset)
unsigned *wbuf, /* buffer to write to disk */
*tbuf; /* temporary buffer pointer */
unsigned u, v, w; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Filling 'point' Selections\n"));
@@ -7211,8 +7157,8 @@ test_select_fill_point(hssize_t *offset)
static void
test_select_fill_hyper_simple(hssize_t *offset)
{
- hid_t sid1; /* Dataspace ID */
- hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
+ hid_t sid1; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */
hsize_t start[SPACE7_RANK]; /* Hyperslab start */
hsize_t count[SPACE7_RANK]; /* Hyperslab block size */
@@ -7223,7 +7169,7 @@ test_select_fill_hyper_simple(hssize_t *offset)
unsigned *wbuf, /* buffer to write to disk */
*tbuf; /* temporary buffer pointer */
unsigned u, v; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Filling Simple 'hyperslab' Selections\n"));
@@ -7311,8 +7257,8 @@ test_select_fill_hyper_simple(hssize_t *offset)
static void
test_select_fill_hyper_regular(hssize_t *offset)
{
- hid_t sid1; /* Dataspace ID */
- hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
+ hid_t sid1; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */
hsize_t start[SPACE7_RANK]; /* Hyperslab start */
hsize_t stride[SPACE7_RANK]; /* Hyperslab stride size */
@@ -7330,7 +7276,7 @@ test_select_fill_hyper_regular(hssize_t *offset)
unsigned *wbuf, /* buffer to write to disk */
*tbuf; /* temporary buffer pointer */
unsigned u, v, w; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Filling Regular 'hyperslab' Selections\n"));
@@ -7419,8 +7365,8 @@ test_select_fill_hyper_regular(hssize_t *offset)
static void
test_select_fill_hyper_irregular(hssize_t *offset)
{
- hid_t sid1; /* Dataspace ID */
- hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
+ hid_t sid1; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */
hsize_t start[SPACE7_RANK]; /* Hyperslab start */
hsize_t count[SPACE7_RANK]; /* Hyperslab block count */
@@ -7449,7 +7395,7 @@ test_select_fill_hyper_irregular(hssize_t *offset)
unsigned *wbuf, /* buffer to write to disk */
*tbuf; /* temporary buffer pointer */
unsigned u, v, w; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Filling Irregular 'hyperslab' Selections\n"));
@@ -7542,16 +7488,16 @@ test_select_fill_hyper_irregular(hssize_t *offset)
static void
test_select_none(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
- hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2};
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
+ hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2};
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer to read from disk */
*tbuf; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing I/O on 0-sized Selections\n"));
@@ -7640,11 +7586,11 @@ test_select_none(void)
static void
test_scalar_select(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2};
- hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2};
+ hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */
hsize_t start[SPACE7_RANK]; /* Hyperslab start */
hsize_t count[SPACE7_RANK]; /* Hyperslab block count */
uint8_t *wbuf_uint8, /* buffer to write to disk */
@@ -7654,7 +7600,7 @@ test_scalar_select(void)
rval_ushort, /* value read back in */
*tbuf_ushort; /* temporary buffer pointer */
int i,j; /* Counters */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing I/O on Selections in Scalar Dataspaces\n"));
@@ -7786,18 +7732,18 @@ test_scalar_select(void)
/****************************************************************
**
** test_scalar_select2(): Tests selections on scalar dataspace,
-** verify H5Sselect_hyperslab and H5Sselect_elements fails for
-** scalar dataspace.
+** verify H5Sselect_hyperslab and H5Sselect_elements fails for
+** scalar dataspace.
**
****************************************************************/
static void
test_scalar_select2(void)
{
- hid_t sid; /* Dataspace ID */
- hsize_t coord1[1]; /* Coordinates for point selection */
+ hid_t sid; /* Dataspace ID */
+ hsize_t coord1[1]; /* Coordinates for point selection */
hsize_t start[1]; /* Hyperslab start */
hsize_t count[1]; /* Hyperslab block count */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(6, ("Testing Selections in Scalar Dataspaces\n"));
@@ -7809,7 +7755,7 @@ test_scalar_select2(void)
/* Select one element in memory with a point selection */
coord1[0]=0;
H5E_BEGIN_TRY {
- ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)&coord1);
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)&coord1);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sselect_elements");
@@ -7817,7 +7763,7 @@ test_scalar_select2(void)
start[0]=0;
count[0]=0;
H5E_BEGIN_TRY {
- ret = H5Sselect_hyperslab(sid,H5S_SELECT_SET,start,NULL,count,NULL);
+ ret = H5Sselect_hyperslab(sid,H5S_SELECT_SET,start,NULL,count,NULL);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sselect_hyperslab");
@@ -7843,18 +7789,18 @@ test_scalar_select2(void)
static void
test_scalar_select3(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2};
- hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2};
+ hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */
hsize_t start[SPACE7_RANK]; /* Hyperslab start */
hsize_t count[SPACE7_RANK]; /* Hyperslab block count */
uint8_t wval_uint8, /* Value written out */
rval_uint8; /* Value read in */
unsigned short wval_ushort, /* Another value written out */
rval_ushort; /* Another value read in */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing I/O on Selections in Scalar Dataspaces in Memory\n"));
@@ -7977,40 +7923,40 @@ test_scalar_select3(void)
/****************************************************************
**
** test_shape_same(): Tests selections on dataspace, verify that
-** "shape same" routine is working correctly.
+** "shape same" routine is working correctly.
**
****************************************************************/
static void
test_shape_same(void)
{
- hid_t all_sid; /* Dataspace ID with "all" selection */
- hid_t none_sid; /* Dataspace ID with "none" selection */
- hid_t single_pt_sid; /* Dataspace ID with single point selection */
- hid_t mult_pt_sid; /* Dataspace ID with multiple point selection */
- hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */
- hid_t single_hyper_all_sid; /* Dataspace ID with single block hyperslab
+ hid_t all_sid; /* Dataspace ID with "all" selection */
+ hid_t none_sid; /* Dataspace ID with "none" selection */
+ hid_t single_pt_sid; /* Dataspace ID with single point selection */
+ hid_t mult_pt_sid; /* Dataspace ID with multiple point selection */
+ hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */
+ hid_t single_hyper_all_sid; /* Dataspace ID with single block hyperslab
* selection that is the entire dataspace
*/
- hid_t single_hyper_pt_sid; /* Dataspace ID with single block hyperslab
+ hid_t single_hyper_pt_sid; /* Dataspace ID with single block hyperslab
* selection that is the same as the single
* point selection
*/
- hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */
- hid_t irreg_hyper_sid; /* Dataspace ID with irregular hyperslab selection */
- hid_t none_hyper_sid; /* Dataspace ID with "no hyperslabs" selection */
- hid_t scalar_all_sid; /* ID for scalar dataspace with "all" selection */
- hid_t scalar_none_sid; /* ID for scalar dataspace with "none" selection */
- hid_t tmp_sid; /* Temporary dataspace ID */
- hsize_t dims[] = {SPACE9_DIM1, SPACE9_DIM2};
- hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */
- hsize_t coord2[SPACE9_DIM2][SPACE9_RANK]; /* Coordinates for multiple point selection */
+ hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */
+ hid_t irreg_hyper_sid; /* Dataspace ID with irregular hyperslab selection */
+ hid_t none_hyper_sid; /* Dataspace ID with "no hyperslabs" selection */
+ hid_t scalar_all_sid; /* ID for scalar dataspace with "all" selection */
+ hid_t scalar_none_sid; /* ID for scalar dataspace with "none" selection */
+ hid_t tmp_sid; /* Temporary dataspace ID */
+ hsize_t dims[] = {SPACE9_DIM1, SPACE9_DIM2};
+ hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */
+ hsize_t coord2[SPACE9_DIM2][SPACE9_RANK]; /* Coordinates for multiple point selection */
hsize_t start[SPACE9_RANK]; /* Hyperslab start */
hsize_t stride[SPACE9_RANK]; /* Hyperslab stride */
hsize_t count[SPACE9_RANK]; /* Hyperslab block count */
hsize_t block[SPACE9_RANK]; /* Hyperslab block size */
unsigned u,v; /* Local index variables */
- htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ htri_t check; /* Shape comparison return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(6, ("Testing Same Shape Comparisons\n"));
@@ -8155,53 +8101,53 @@ test_shape_same(void)
/* Compare "all" selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(all_sid,all_sid);
+ check = H5S_select_shape_same_test(all_sid,all_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
tmp_sid=H5Scopy(all_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(all_sid,tmp_sid);
+ check = H5S_select_shape_same_test(all_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(all_sid,none_sid);
+ check = H5S_select_shape_same_test(all_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(all_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(all_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(all_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(all_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(all_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(all_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(all_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(all_sid,single_hyper_all_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(all_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(all_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(all_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(all_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(all_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(all_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(all_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(all_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against scalar "all" hyperslab selection */
@@ -8214,53 +8160,53 @@ test_shape_same(void)
/* Compare "none" selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(none_sid,none_sid);
+ check = H5S_select_shape_same_test(none_sid,none_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(none_sid);
+ tmp_sid = H5Scopy(none_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(none_sid,tmp_sid);
+ check = H5S_select_shape_same_test(none_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(none_sid,all_sid);
+ check = H5S_select_shape_same_test(none_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(none_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(none_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(none_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(none_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(none_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(none_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(none_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(none_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(none_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(none_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(none_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(none_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(none_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(none_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(none_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(none_sid,none_hyper_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against scalar "all" hyperslab selection */
@@ -8273,49 +8219,49 @@ test_shape_same(void)
/* Compare single point selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(single_pt_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,single_pt_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(single_pt_sid);
+ tmp_sid = H5Scopy(single_pt_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(single_pt_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(single_pt_sid,all_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(single_pt_sid,none_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(single_pt_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(single_pt_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(single_pt_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(single_pt_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,single_hyper_pt_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(single_pt_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(single_pt_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
@@ -8332,53 +8278,53 @@ test_shape_same(void)
/* Compare multiple point selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(mult_pt_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,mult_pt_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(mult_pt_sid);
+ tmp_sid = H5Scopy(mult_pt_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(mult_pt_sid,tmp_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(mult_pt_sid,all_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(mult_pt_sid,none_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(mult_pt_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(mult_pt_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(mult_pt_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(mult_pt_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(mult_pt_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(mult_pt_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(mult_pt_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against scalar "all" hyperslab selection */
@@ -8391,45 +8337,45 @@ test_shape_same(void)
/* Compare single "normal" hyperslab selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(single_hyper_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,single_hyper_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(single_hyper_sid);
+ tmp_sid = H5Scopy(single_hyper_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(single_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(single_hyper_sid,all_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(single_hyper_sid,none_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(single_hyper_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(single_hyper_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
@@ -8437,7 +8383,7 @@ test_shape_same(void)
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
#ifdef NOT_YET
@@ -8453,16 +8399,18 @@ test_shape_same(void)
CHECK(tmp_sid, FAIL, "H5Screate_simple");
/* Select sequence of points for point selection */
- for(u=1; u<(SPACE9_DIM1-1); u++) {
- for(v=1; v<(SPACE9_DIM2-1); v++) {
- coord2[v-1][0]=u; coord2[v-1][1]=v;
+ for(u = 1; u < (SPACE9_DIM1 - 1); u++) {
+ for(v = 1; v < (SPACE9_DIM2 - 1); v++) {
+ coord2[v - 1][0] = u;
+ coord2[v - 1][1] = v;
} /* end for */
- ret = H5Sselect_elements(tmp_sid,H5S_SELECT_APPEND,(SPACE9_DIM2-2),coord2);
+
+ ret = H5Sselect_elements(tmp_sid, H5S_SELECT_APPEND, (SPACE9_DIM2 - 2), coord2);
CHECK(ret, FAIL, "H5Sselect_elements");
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8479,17 +8427,17 @@ test_shape_same(void)
CHECK(ret, FAIL, "H5Sselect_none");
/* Select sequence of rows for hyperslab selection */
- for(u=1; u<(SPACE9_DIM1-1); u++) {
- start[0]=u; start[1]=1;
- stride[0]=1; stride[1]=1;
- count[0]=1; count[1]=1;
- block[0]=1; block[1]=(SPACE9_DIM2-2);
- ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block);
+ for(u = 1; u < (SPACE9_DIM1 - 1); u++) {
+ start[0] = u; start[1] = 1;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 1; count[1] = 1;
+ block[0] = 1; block[1] = (SPACE9_DIM2 - 2);
+ ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_OR, start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8505,53 +8453,53 @@ test_shape_same(void)
/* Compare single "all" hyperslab selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(single_hyper_all_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,single_hyper_all_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(single_hyper_all_sid);
+ tmp_sid = H5Scopy(single_hyper_all_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(single_hyper_all_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,all_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,all_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,none_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
#ifdef NOT_YET
@@ -8567,16 +8515,17 @@ test_shape_same(void)
CHECK(tmp_sid, FAIL, "H5Screate_simple");
/* Select sequence of points for point selection */
- for(u=0; u<SPACE9_DIM1; u++) {
- for(v=0; v<SPACE9_DIM2; v++) {
- coord2[v][0]=u; coord2[v][1]=v;
+ for(u = 0; u < SPACE9_DIM1; u++) {
+ for(v = 0; v < SPACE9_DIM2; v++) {
+ coord2[v][0] = u;
+ coord2[v][1] = v;
} /* end for */
- ret = H5Sselect_elements(tmp_sid,H5S_SELECT_APPEND,SPACE9_DIM2,coord2);
+ ret = H5Sselect_elements(tmp_sid, H5S_SELECT_APPEND, SPACE9_DIM2, coord2);
CHECK(ret, FAIL, "H5Sselect_elements");
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8593,17 +8542,17 @@ test_shape_same(void)
CHECK(ret, FAIL, "H5Sselect_none");
/* Select sequence of rows for hyperslab selection */
- for(u=0; u<SPACE9_DIM2; u++) {
- start[0]=u; start[1]=0;
- stride[0]=1; stride[1]=1;
- count[0]=1; count[1]=1;
- block[0]=1; block[1]=SPACE9_DIM2;
- ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block);
+ for(u = 0; u < SPACE9_DIM2; u++) {
+ start[0] = u; start[1] = 0;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 1; count[1] = 1;
+ block[0] = 1; block[1] = SPACE9_DIM2;
+ ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_OR, start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8619,53 +8568,53 @@ test_shape_same(void)
/* Compare single "point" hyperslab selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,single_hyper_pt_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(single_hyper_pt_sid);
+ tmp_sid = H5Scopy(single_hyper_pt_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(single_hyper_pt_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,all_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,none_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,single_pt_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against scalar "all" hyperslab selection */
@@ -8678,53 +8627,53 @@ test_shape_same(void)
/* Compare regular, strided hyperslab selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(regular_hyper_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,regular_hyper_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(regular_hyper_sid);
+ tmp_sid = H5Scopy(regular_hyper_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,all_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,none_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Construct point selection which matches regular, strided hyperslab selection */
@@ -8733,16 +8682,17 @@ test_shape_same(void)
CHECK(tmp_sid, FAIL, "H5Screate_simple");
/* Select sequence of points for point selection */
- for(u=2; u<11; u+=2) {
- for(v=0; v<2; v++) {
- coord2[v][0]=u; coord2[v][1]=(v*2)+2;
+ for(u = 2; u < 11; u += 2) {
+ for(v = 0; v < 2; v++) {
+ coord2[v][0] = u;
+ coord2[v][1] = (v * 2) + 2;
} /* end for */
ret = H5Sselect_elements(tmp_sid, H5S_SELECT_APPEND, (size_t)2, (const hsize_t *)coord2);
CHECK(ret, FAIL, "H5Sselect_elements");
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8758,17 +8708,17 @@ test_shape_same(void)
CHECK(ret, FAIL, "H5Sselect_none");
/* Select sequence of rows for hyperslab selection */
- for(u=2; u<11; u+=2) {
- start[0]=u; start[1]=3;
- stride[0]=1; stride[1]=2;
- count[0]=1; count[1]=2;
- block[0]=1; block[1]=1;
- ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block);
+ for(u = 2; u < 11; u += 2) {
+ start[0] = u; start[1] = 3;
+ stride[0] = 1; stride[1] = 2;
+ count[0] = 1; count[1] = 2;
+ block[0] = 1; block[1] = 1;
+ ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_OR, start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8780,15 +8730,15 @@ test_shape_same(void)
CHECK(tmp_sid, FAIL, "H5Screate_simple");
/* Select regular, strided hyperslab selection at an offset */
- start[0]=1; start[1]=1;
- stride[0]=2; stride[1]=2;
- count[0]=5; count[1]=2;
- block[0]=1; block[1]=1;
- ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_SET,start,stride,count,block);
+ start[0] = 1; start[1] = 1;
+ stride[0] = 2; stride[1] = 2;
+ count[0] = 5; count[1] = 2;
+ block[0] = 1; block[1] = 1;
+ ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_SET, start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8804,53 +8754,53 @@ test_shape_same(void)
/* Compare irregular hyperslab selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(irreg_hyper_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,irreg_hyper_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(irreg_hyper_sid);
+ tmp_sid = H5Scopy(irreg_hyper_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(irreg_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,all_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,none_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Construct hyperslab selection which matches irregular hyperslab selection */
@@ -8858,25 +8808,25 @@ test_shape_same(void)
tmp_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
CHECK(tmp_sid, FAIL, "H5Screate_simple");
- start[0]=2; start[1]=2;
- stride[0]=1; stride[1]=1;
- count[0]=1; count[1]=1;
- block[0]=1; block[1]=1;
- ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_SET,start,stride,count,block);
+ start[0] = 2; start[1] = 2;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 1; count[1] = 1;
+ block[0] = 1; block[1] = 1;
+ ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_SET, start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Select sequence of columns for hyperslab selection */
- for(u=0; u<3; u++) {
- start[0]=4; start[1]=u+4;
- stride[0]=1; stride[1]=1;
- count[0]=1; count[1]=1;
- block[0]=3; block[1]=1;
- ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block);
+ for(u = 0; u < 3; u++) {
+ start[0] = 4; start[1] = u + 4;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 1; count[1] = 1;
+ block[0] = 3; block[1] = 1;
+ ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_OR, start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -9042,54 +8992,54 @@ test_shape_same(void)
/****************************************************************
**
-** test_shape_same_dr__smoke_check_1():
+** test_shape_same_dr__smoke_check_1():
**
-** Create a square, 2 D data space (10 X 10), and select
-** all of it.
+** Create a square, 2-D dataspace (10 X 10), and select
+** all of it.
**
-** Similarly, create nine, 3 D data spaces (10 X 10 X 10),
-** and select (10 X 10 X 1) hyper slabs in each, three with
-** the slab parallel to the xy plane, three parallel to the
-** xz plane, and three parallel to the yz plane.
+** Similarly, create nine, 3-D dataspaces (10 X 10 X 10),
+** and select (10 X 10 X 1) hyperslabs in each, three with
+** the slab parallel to the xy plane, three parallel to the
+** xz plane, and three parallel to the yz plane.
**
-** Assuming that z is the fastest changing dimension,
-** H5S_select_shape_same() should return TRUE when comparing
-** the full 2 D space against any hyperslab parallel to the
-** yz plane in the 3 D space, and FALSE when comparing the
-** full 2 D space against the other two hyper slabs.
+** Assuming that z is the fastest changing dimension,
+** H5Sselect_shape_same() should return TRUE when comparing
+** the full 2-D space against any hyperslab parallel to the
+** yz plane in the 3-D space, and FALSE when comparing the
+** full 2-D space against the other two hyperslabs.
**
-** Also create two additional 3 D data spaces (10 X 10 X 10),
-** and select a (10 X 10 X 2) hyper slab parallel to the yz
-** axis in one of them, and two parallel (10 X 10 X 1) hyper
-** slabs parallel to the yz axis in the other.
-** H5S_select_shape_same() should return FALSE when comparing
-** each to the 2 D selection.
+** Also create two additional 3-D dataspaces (10 X 10 X 10),
+** and select a (10 X 10 X 2) hyperslab parallel to the yz
+** axis in one of them, and two parallel (10 X 10 X 1) hyper
+** slabs parallel to the yz axis in the other.
+** H5Sselect_shape_same() should return FALSE when comparing
+** each to the 2-D selection.
**
****************************************************************/
static void
test_shape_same_dr__smoke_check_1(void)
{
- hid_t small_square_sid;
- hid_t small_cube_xy_slice_0_sid;
- hid_t small_cube_xy_slice_1_sid;
- hid_t small_cube_xy_slice_2_sid;
- hid_t small_cube_xz_slice_0_sid;
- hid_t small_cube_xz_slice_1_sid;
- hid_t small_cube_xz_slice_2_sid;
- hid_t small_cube_yz_slice_0_sid;
- hid_t small_cube_yz_slice_1_sid;
- hid_t small_cube_yz_slice_2_sid;
- hid_t small_cube_yz_slice_3_sid;
- hid_t small_cube_yz_slice_4_sid;
- hsize_t small_cube_dims[] = {10, 10, 10};
- hsize_t start[3];
- hsize_t stride[3];
- hsize_t count[3];
- hsize_t block[3];
- htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
-
- MESSAGE(7, (" Smoke check 1: Slices through a cube.\n"));
+ hid_t small_square_sid;
+ hid_t small_cube_xy_slice_0_sid;
+ hid_t small_cube_xy_slice_1_sid;
+ hid_t small_cube_xy_slice_2_sid;
+ hid_t small_cube_xz_slice_0_sid;
+ hid_t small_cube_xz_slice_1_sid;
+ hid_t small_cube_xz_slice_2_sid;
+ hid_t small_cube_yz_slice_0_sid;
+ hid_t small_cube_yz_slice_1_sid;
+ hid_t small_cube_yz_slice_2_sid;
+ hid_t small_cube_yz_slice_3_sid;
+ hid_t small_cube_yz_slice_4_sid;
+ hsize_t small_cube_dims[] = {10, 10, 10};
+ hsize_t start[3];
+ hsize_t stride[3];
+ hsize_t count[3];
+ hsize_t block[3];
+ htri_t check; /* Shape comparison return value */
+ herr_t ret; /* Generic return value */
+
+ MESSAGE(7, (" Smoke check 1: Slices through a cube.\n"));
/* Create the 10 x 10 dataspace */
small_square_sid = H5Screate_simple(2, small_cube_dims, NULL);
@@ -9105,24 +9055,24 @@ test_shape_same_dr__smoke_check_1(void)
small_cube_xy_slice_2_sid = H5Screate_simple(3, small_cube_dims, NULL);
CHECK(small_cube_xy_slice_2_sid, FAIL, "H5Screate_simple");
- start[0] = 0; /* x */
- start[1] = 0; /* y */
- start[2] = 0; /* z */
+ start[0] = 0; /* x */
+ start[1] = 0; /* y */
+ start[2] = 0; /* z */
/* stride is a bit silly here, since we are only selecting a single */
/* contiguous plane, but include it anyway, with values large enough */
/* to ensure that we will only get the single block selected. */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
- stride[2] = 20; /* z */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
+ stride[2] = 20; /* z */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
- count[2] = 1; /* z */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
+ count[2] = 1; /* z */
- block[0] = 10; /* x */
- block[1] = 10; /* y */
- block[2] = 1; /* z */
+ block[0] = 10; /* x */
+ block[1] = 10; /* y */
+ block[2] = 1; /* z */
ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -9148,24 +9098,24 @@ test_shape_same_dr__smoke_check_1(void)
small_cube_xz_slice_2_sid = H5Screate_simple(3, small_cube_dims, NULL);
CHECK(small_cube_xz_slice_2_sid, FAIL, "H5Screate_simple");
- start[0] = 0; /* x */
- start[1] = 0; /* y */
- start[2] = 0; /* z */
+ start[0] = 0; /* x */
+ start[1] = 0; /* y */
+ start[2] = 0; /* z */
/* stride is a bit silly here, since we are only selecting a single */
/* contiguous chunk, but include it anyway, with values large enough */
/* to ensure that we will only get the single chunk. */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
- stride[2] = 20; /* z */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
+ stride[2] = 20; /* z */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
- count[2] = 1; /* z */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
+ count[2] = 1; /* z */
- block[0] = 10; /* x */
- block[1] = 1; /* y */
- block[2] = 10; /* z */
+ block[0] = 10; /* x */
+ block[1] = 1; /* y */
+ block[2] = 10; /* z */
ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -9197,24 +9147,24 @@ test_shape_same_dr__smoke_check_1(void)
small_cube_yz_slice_4_sid = H5Screate_simple(3, small_cube_dims, NULL);
CHECK(small_cube_yz_slice_4_sid, FAIL, "H5Screate_simple");
- start[0] = 0; /* x */
- start[1] = 0; /* y */
- start[2] = 0; /* z */
+ start[0] = 0; /* x */
+ start[1] = 0; /* y */
+ start[2] = 0; /* z */
/* stride is a bit silly here, since we are only selecting a single */
/* contiguous chunk, but include it anyway, with values large enough */
/* to ensure that we will only get the single chunk. */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
- stride[2] = 20; /* z */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
+ stride[2] = 20; /* z */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
- count[2] = 1; /* z */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
+ count[2] = 1; /* z */
- block[0] = 1; /* x */
- block[1] = 10; /* y */
- block[2] = 10; /* z */
+ block[0] = 1; /* x */
+ block[1] = 10; /* y */
+ block[2] = 10; /* z */
ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_SET,
start, stride, count, block);
@@ -9333,100 +9283,100 @@ test_shape_same_dr__smoke_check_1(void)
/****************************************************************
**
-** test_shape_same_dr__smoke_check_2():
+** test_shape_same_dr__smoke_check_2():
**
-** Create a square, 2 D data space (10 X 10), and select
-** a "checker board" hyper slab as follows:
+** Create a square, 2-D dataspace (10 X 10), and select
+** a "checker board" hyperslab as follows:
**
-** * * - - * * - - * *
+** * * - - * * - - * *
** * * - - * * - - * *
** - - * * - - * * - -
** - - * * - - * * - -
-** * * - - * * - - * *
+** * * - - * * - - * *
** * * - - * * - - * *
** - - * * - - * * - -
** - - * * - - * * - -
-** * * - - * * - - * *
+** * * - - * * - - * *
** * * - - * * - - * *
**
-** where asterisks indicate selected elements, and dashes
-** indicate unselected elements.
-**
-** Similarly, create nine, 3 D data spaces (10 X 10 X 10),
-** and select similar (10 X 10 X 1) checker board hyper
-** slabs in each, three with the slab parallel to the xy
-** plane, three parallel to the xz plane, and three parallel
-** to the yz plane.
-**
-** Assuming that z is the fastest changing dimension,
-** H5S_select_shape_same() should return TRUE when comparing
-** the 2 D space checker board selection against a checker
-** board hyperslab parallel to the yz plane in the 3 D
-** space, and FALSE when comparing the 2 D checkerboard
-** selection against two hyper slabs parallel to the xy
-** or xz planes.
-**
-** Also create an additional 3 D data spaces (10 X 10 X 10),
-** and select a checker board parallel with the yz axis,
-** save with some squares being on different planes.
-** H5S_select_shape_same() should return FALSE when
-** comparing this selection to the 2 D selection.
+** where asterisks indicate selected elements, and dashes
+** indicate unselected elements.
+**
+** Similarly, create nine, 3-D dataspaces (10 X 10 X 10),
+** and select similar (10 X 10 X 1) checker board hyper
+** slabs in each, three with the slab parallel to the xy
+** plane, three parallel to the xz plane, and three parallel
+** to the yz plane.
+**
+** Assuming that z is the fastest changing dimension,
+** H5Sselect_shape_same() should return TRUE when comparing
+** the 2-D space checker board selection against a checker
+** board hyperslab parallel to the yz plane in the 3-D
+** space, and FALSE when comparing the 2-D checkerboard
+** selection against two hyperslabs parallel to the xy
+** or xz planes.
+**
+** Also create an additional 3-D dataspaces (10 X 10 X 10),
+** and select a checker board parallel with the yz axis,
+** save with some squares being on different planes.
+** H5Sselect_shape_same() should return FALSE when
+** comparing this selection to the 2-D selection.
**
****************************************************************/
static void
test_shape_same_dr__smoke_check_2(void)
{
- hid_t small_square_sid;
- hid_t small_cube_xy_slice_0_sid;
- hid_t small_cube_xy_slice_1_sid;
- hid_t small_cube_xy_slice_2_sid;
- hid_t small_cube_xz_slice_0_sid;
- hid_t small_cube_xz_slice_1_sid;
- hid_t small_cube_xz_slice_2_sid;
- hid_t small_cube_yz_slice_0_sid;
- hid_t small_cube_yz_slice_1_sid;
- hid_t small_cube_yz_slice_2_sid;
- hid_t small_cube_yz_slice_3_sid;
- hsize_t small_cube_dims[] = {10, 10, 10};
- hsize_t start[3];
- hsize_t stride[3];
- hsize_t count[3];
- hsize_t block[3];
- htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
-
- MESSAGE(7, (" Smoke check 2: Checker board slices through a cube.\n"));
+ hid_t small_square_sid;
+ hid_t small_cube_xy_slice_0_sid;
+ hid_t small_cube_xy_slice_1_sid;
+ hid_t small_cube_xy_slice_2_sid;
+ hid_t small_cube_xz_slice_0_sid;
+ hid_t small_cube_xz_slice_1_sid;
+ hid_t small_cube_xz_slice_2_sid;
+ hid_t small_cube_yz_slice_0_sid;
+ hid_t small_cube_yz_slice_1_sid;
+ hid_t small_cube_yz_slice_2_sid;
+ hid_t small_cube_yz_slice_3_sid;
+ hsize_t small_cube_dims[] = {10, 10, 10};
+ hsize_t start[3];
+ hsize_t stride[3];
+ hsize_t count[3];
+ hsize_t block[3];
+ htri_t check; /* Shape comparison return value */
+ herr_t ret; /* Generic return value */
+
+ MESSAGE(7, (" Smoke check 2: Checker board slices through a cube.\n"));
/* Create the 10 x 10 dataspace */
small_square_sid = H5Screate_simple(2, small_cube_dims, NULL);
CHECK(small_square_sid, FAIL, "H5Screate_simple");
- start[0] = 0; /* x */
- start[1] = 0; /* y */
+ start[0] = 0; /* x */
+ start[1] = 0; /* y */
- stride[0] = 4; /* x */
- stride[1] = 4; /* y */
+ stride[0] = 4; /* x */
+ stride[1] = 4; /* y */
- count[0] = 3; /* x */
- count[1] = 3; /* y */
+ count[0] = 3; /* x */
+ count[1] = 3; /* y */
- block[0] = 2; /* x */
- block[1] = 2; /* y */
+ block[0] = 2; /* x */
+ block[1] = 2; /* y */
ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = 2; /* x */
- start[1] = 2; /* y */
+ start[0] = 2; /* x */
+ start[1] = 2; /* y */
- stride[0] = 4; /* x */
- stride[1] = 4; /* y */
+ stride[0] = 4; /* x */
+ stride[1] = 4; /* y */
- count[0] = 2; /* x */
- count[1] = 2; /* y */
+ count[0] = 2; /* x */
+ count[1] = 2; /* y */
- block[0] = 2; /* x */
- block[1] = 2; /* y */
+ block[0] = 2; /* x */
+ block[1] = 2; /* y */
ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -9443,21 +9393,21 @@ test_shape_same_dr__smoke_check_2(void)
CHECK(small_cube_xy_slice_2_sid, FAIL, "H5Screate_simple");
- start[0] = 0; /* x */
- start[1] = 0; /* y */
- start[2] = 0; /* z */
+ start[0] = 0; /* x */
+ start[1] = 0; /* y */
+ start[2] = 0; /* z */
- stride[0] = 4; /* x */
- stride[1] = 4; /* y */
- stride[2] = 20; /* z -- large enough that there will only be one slice */
+ stride[0] = 4; /* x */
+ stride[1] = 4; /* y */
+ stride[2] = 20; /* z -- large enough that there will only be one slice */
- count[0] = 3; /* x */
- count[1] = 3; /* y */
- count[2] = 1; /* z */
+ count[0] = 3; /* x */
+ count[1] = 3; /* y */
+ count[2] = 1; /* z */
- block[0] = 2; /* x */
- block[1] = 2; /* y */
- block[2] = 1; /* z */
+ block[0] = 2; /* x */
+ block[1] = 2; /* y */
+ block[2] = 1; /* z */
ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -9473,21 +9423,21 @@ test_shape_same_dr__smoke_check_2(void)
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = 2; /* x */
- start[1] = 2; /* y */
- start[2] = 0; /* z */
+ start[0] = 2; /* x */
+ start[1] = 2; /* y */
+ start[2] = 0; /* z */
- stride[0] = 4; /* x */
- stride[1] = 4; /* y */
- stride[2] = 20; /* z -- large enough that there will only be one slice */
+ stride[0] = 4; /* x */
+ stride[1] = 4; /* y */
+ stride[2] = 20; /* z -- large enough that there will only be one slice */
- count[0] = 2; /* x */
- count[1] = 2; /* y */
- count[2] = 1; /* z */
+ count[0] = 2; /* x */
+ count[1] = 2; /* y */
+ count[2] = 1; /* z */
- block[0] = 2; /* x */
- block[1] = 2; /* y */
- block[2] = 1; /* z */
+ block[0] = 2; /* x */
+ block[1] = 2; /* y */
+ block[2] = 1; /* z */
ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -9514,21 +9464,21 @@ test_shape_same_dr__smoke_check_2(void)
CHECK(small_cube_xz_slice_2_sid, FAIL, "H5Screate_simple");
- start[0] = 0; /* x */
- start[1] = 0; /* y */
- start[2] = 0; /* z */
+ start[0] = 0; /* x */
+ start[1] = 0; /* y */
+ start[2] = 0; /* z */
- stride[0] = 4; /* x */
- stride[1] = 20; /* y -- large enough that there will only be one slice */
- stride[2] = 4; /* z */
+ stride[0] = 4; /* x */
+ stride[1] = 20; /* y -- large enough that there will only be one slice */
+ stride[2] = 4; /* z */
- count[0] = 3; /* x */
- count[1] = 1; /* y */
- count[2] = 3; /* z */
+ count[0] = 3; /* x */
+ count[1] = 1; /* y */
+ count[2] = 3; /* z */
- block[0] = 2; /* x */
- block[1] = 1; /* y */
- block[2] = 2; /* z */
+ block[0] = 2; /* x */
+ block[1] = 1; /* y */
+ block[2] = 2; /* z */
ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -9543,21 +9493,21 @@ test_shape_same_dr__smoke_check_2(void)
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = 2; /* x */
- start[1] = 0; /* y */
- start[2] = 2; /* z */
+ start[0] = 2; /* x */
+ start[1] = 0; /* y */
+ start[2] = 2; /* z */
- stride[0] = 4; /* x */
- stride[1] = 20; /* y -- large enough that there will only be one slice */
- stride[2] = 4; /* z */
+ stride[0] = 4; /* x */
+ stride[1] = 20; /* y -- large enough that there will only be one slice */
+ stride[2] = 4; /* z */
- count[0] = 2; /* x */
- count[1] = 1; /* y */
- count[2] = 2; /* z */
+ count[0] = 2; /* x */
+ count[1] = 1; /* y */
+ count[2] = 2; /* z */
- block[0] = 2; /* x */
- block[1] = 1; /* y */
- block[2] = 2; /* z */
+ block[0] = 2; /* x */
+ block[1] = 1; /* y */
+ block[2] = 2; /* z */
ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -9586,21 +9536,21 @@ test_shape_same_dr__smoke_check_2(void)
small_cube_yz_slice_3_sid = H5Screate_simple(3, small_cube_dims, NULL);
CHECK(small_cube_yz_slice_3_sid, FAIL, "H5Screate_simple");
- start[0] = 0; /* x */
- start[1] = 0; /* y */
- start[2] = 0; /* z */
+ start[0] = 0; /* x */
+ start[1] = 0; /* y */
+ start[2] = 0; /* z */
stride[0] = 20; /* x -- large enough that there will only be one slice */
stride[1] = 4; /* y */
stride[2] = 4; /* z */
- count[0] = 1; /* x */
- count[1] = 3; /* y */
- count[2] = 3; /* z */
+ count[0] = 1; /* x */
+ count[1] = 3; /* y */
+ count[2] = 3; /* z */
- block[0] = 1; /* x */
- block[1] = 2; /* y */
- block[2] = 2; /* z */
+ block[0] = 1; /* x */
+ block[1] = 2; /* y */
+ block[2] = 2; /* z */
ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -9621,21 +9571,21 @@ test_shape_same_dr__smoke_check_2(void)
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = 0; /* x */
- start[1] = 2; /* y */
- start[2] = 2; /* z */
+ start[0] = 0; /* x */
+ start[1] = 2; /* y */
+ start[2] = 2; /* z */
- stride[0] = 20; /* x -- large enough that there will only be one slice */
- stride[1] = 4; /* y */
- stride[2] = 4; /* z */
+ stride[0] = 20; /* x -- large enough that there will only be one slice */
+ stride[1] = 4; /* y */
+ stride[2] = 4; /* z */
- count[0] = 1; /* x */
- count[1] = 2; /* y */
- count[2] = 2; /* z */
+ count[0] = 1; /* x */
+ count[1] = 2; /* y */
+ count[2] = 2; /* z */
- block[0] = 1; /* x */
- block[1] = 2; /* y */
- block[2] = 2; /* z */
+ block[0] = 1; /* x */
+ block[1] = 2; /* y */
+ block[2] = 2; /* z */
ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -9652,7 +9602,7 @@ test_shape_same_dr__smoke_check_2(void)
start[0] = 4;
/* This test gets the right answer, but it fails the shape same
- * test in an unexpected point. Bring this up with Quincey, as
+ * test in an unexpected point. Bring this up with Quincey, as
* the oddness looks like it is not related to my code.
* -- JRM
*/
@@ -9741,111 +9691,111 @@ test_shape_same_dr__smoke_check_2(void)
/****************************************************************
**
-** test_shape_same_dr__smoke_check_3():
-**
-** Create a square, 2 D data space (10 X 10), and select an
-** irregular hyper slab as follows:
-**
-** y
-** 9 - - - - - - - - - -
-** 8 - - - - - - - - - -
-** 7 - - - * * * * - - -
-** 6 - - * * * * * - - -
-** 5 - - * * - - - - - -
-** 4 - - * * - * * - - -
-** 3 - - * * - * * - - -
-** 2 - - - - - - - - - -
-** 1 - - - - - - - - - -
-** 0 - - - - - - - - - -
+** test_shape_same_dr__smoke_check_3():
+**
+** Create a square, 2-D dataspace (10 X 10), and select an
+** irregular hyperslab as follows:
+**
+** y
+** 9 - - - - - - - - - -
+** 8 - - - - - - - - - -
+** 7 - - - * * * * - - -
+** 6 - - * * * * * - - -
+** 5 - - * * - - - - - -
+** 4 - - * * - * * - - -
+** 3 - - * * - * * - - -
+** 2 - - - - - - - - - -
+** 1 - - - - - - - - - -
+** 0 - - - - - - - - - -
** 0 1 2 3 4 5 6 7 8 9 x
**
-** where asterisks indicate selected elements, and dashes
-** indicate unselected elements.
+** where asterisks indicate selected elements, and dashes
+** indicate unselected elements.
**
-** Similarly, create nine, 3 D data spaces (10 X 10 X 10),
-** and select similar irregular hyper slabs in each, three
-** with the slab parallel to the xy plane, three parallel
-** to the xz plane, and three parallel to the yz plane.
-** Further, translate the irregular slab in 2/3rds of the
-** cases.
+** Similarly, create nine, 3-D dataspaces (10 X 10 X 10),
+** and select similar irregular hyperslabs in each, three
+** with the slab parallel to the xy plane, three parallel
+** to the xz plane, and three parallel to the yz plane.
+** Further, translate the irregular slab in 2/3rds of the
+** cases.
**
-** Assuming that z is the fastest changing dimension,
-** H5S_select_shape_same() should return TRUE when
-** comparing the 2 D irregular hyperslab selection
-** against the irregular hyperslab selections parallel
-** to the yz plane in the 3 D space, and FALSE when
-** comparing it against the irregular hyper slabs
-** selections parallel to the xy or xz planes.
+** Assuming that z is the fastest changing dimension,
+** H5Sselect_shape_same() should return TRUE when
+** comparing the 2-D irregular hyperslab selection
+** against the irregular hyperslab selections parallel
+** to the yz plane in the 3-D space, and FALSE when
+** comparing it against the irregular hyperslabs
+** selections parallel to the xy or xz planes.
**
****************************************************************/
static void
test_shape_same_dr__smoke_check_3(void)
{
- hid_t small_square_sid;
- hid_t small_cube_xy_slice_0_sid;
- hid_t small_cube_xy_slice_1_sid;
- hid_t small_cube_xy_slice_2_sid;
- hid_t small_cube_xz_slice_0_sid;
- hid_t small_cube_xz_slice_1_sid;
- hid_t small_cube_xz_slice_2_sid;
- hid_t small_cube_yz_slice_0_sid;
- hid_t small_cube_yz_slice_1_sid;
- hid_t small_cube_yz_slice_2_sid;
- hsize_t small_cube_dims[] = {10, 10, 10};
- hsize_t start[3];
- hsize_t stride[3];
- hsize_t count[3];
- hsize_t block[3];
- htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
-
- MESSAGE(7, (" Smoke check 3: Offset subsets of slices through a cube.\n"));
+ hid_t small_square_sid;
+ hid_t small_cube_xy_slice_0_sid;
+ hid_t small_cube_xy_slice_1_sid;
+ hid_t small_cube_xy_slice_2_sid;
+ hid_t small_cube_xz_slice_0_sid;
+ hid_t small_cube_xz_slice_1_sid;
+ hid_t small_cube_xz_slice_2_sid;
+ hid_t small_cube_yz_slice_0_sid;
+ hid_t small_cube_yz_slice_1_sid;
+ hid_t small_cube_yz_slice_2_sid;
+ hsize_t small_cube_dims[] = {10, 10, 10};
+ hsize_t start[3];
+ hsize_t stride[3];
+ hsize_t count[3];
+ hsize_t block[3];
+ htri_t check; /* Shape comparison return value */
+ herr_t ret; /* Generic return value */
+
+ MESSAGE(7, (" Smoke check 3: Offset subsets of slices through a cube.\n"));
/* Create the 10 x 10 dataspace */
small_square_sid = H5Screate_simple(2, small_cube_dims, NULL);
CHECK(small_square_sid, FAIL, "H5Screate_simple");
- start[0] = 2; /* x */
- start[1] = 3; /* y */
+ start[0] = 2; /* x */
+ start[1] = 3; /* y */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
- block[0] = 2; /* x */
- block[1] = 4; /* y */
+ block[0] = 2; /* x */
+ block[1] = 4; /* y */
ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = 3; /* x */
- start[1] = 6; /* y */
+ start[0] = 3; /* x */
+ start[1] = 6; /* y */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
- block[0] = 4; /* x */
- block[1] = 2; /* y */
+ block[0] = 4; /* x */
+ block[1] = 2; /* y */
ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = 5; /* x */
- start[1] = 3; /* y */
+ start[0] = 5; /* x */
+ start[1] = 3; /* y */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
- block[0] = 2; /* x */
- block[1] = 2; /* y */
+ block[0] = 2; /* x */
+ block[1] = 2; /* y */
ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -9862,101 +9812,101 @@ test_shape_same_dr__smoke_check_3(void)
CHECK(small_cube_xy_slice_2_sid, FAIL, "H5Screate_simple");
- start[0] = 2; /* x */
- start[1] = 3; /* y */
- start[2] = 5; /* z */
+ start[0] = 2; /* x */
+ start[1] = 3; /* y */
+ start[2] = 5; /* z */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
- stride[2] = 20; /* z */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
+ stride[2] = 20; /* z */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
- count[2] = 1; /* z */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
+ count[2] = 1; /* z */
- block[0] = 2; /* x */
- block[1] = 4; /* y */
- block[2] = 1; /* z */
+ block[0] = 2; /* x */
+ block[1] = 4; /* y */
+ block[2] = 1; /* z */
ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the starting point to the origin */
- start[0] -= 1; /* x */
- start[1] -= 2; /* y */
+ start[0] -= 1; /* x */
+ start[1] -= 2; /* y */
ret = H5Sselect_hyperslab(small_cube_xy_slice_1_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the irregular selection to the upper right hand corner */
- start[0] += 5; /* x */
- start[1] += 5; /* y */
+ start[0] += 5; /* x */
+ start[1] += 5; /* y */
ret = H5Sselect_hyperslab(small_cube_xy_slice_2_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = 3; /* x */
- start[1] = 6; /* y */
- start[2] = 5; /* z */
+ start[0] = 3; /* x */
+ start[1] = 6; /* y */
+ start[2] = 5; /* z */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
- stride[2] = 20; /* z */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
+ stride[2] = 20; /* z */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
- count[2] = 1; /* z */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
+ count[2] = 1; /* z */
- block[0] = 4; /* x */
- block[1] = 2; /* y */
- block[2] = 1; /* z */
+ block[0] = 4; /* x */
+ block[1] = 2; /* y */
+ block[2] = 1; /* z */
ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the starting point to the origin */
- start[0] -= 1; /* x */
- start[1] -= 2; /* y */
+ start[0] -= 1; /* x */
+ start[1] -= 2; /* y */
ret = H5Sselect_hyperslab(small_cube_xy_slice_1_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the irregular selection to the upper right hand corner */
- start[0] += 5; /* x */
- start[1] += 5; /* y */
+ start[0] += 5; /* x */
+ start[1] += 5; /* y */
ret = H5Sselect_hyperslab(small_cube_xy_slice_2_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = 5; /* x */
- start[1] = 3; /* y */
- start[2] = 5; /* z */
+ start[0] = 5; /* x */
+ start[1] = 3; /* y */
+ start[2] = 5; /* z */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
- stride[2] = 20; /* z */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
+ stride[2] = 20; /* z */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
- count[2] = 1; /* z */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
+ count[2] = 1; /* z */
- block[0] = 2; /* x */
- block[1] = 2; /* y */
- block[2] = 1; /* z */
+ block[0] = 2; /* x */
+ block[1] = 2; /* y */
+ block[2] = 1; /* z */
ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the starting point to the origin */
- start[0] -= 1; /* x */
- start[1] -= 2; /* y */
+ start[0] -= 1; /* x */
+ start[1] -= 2; /* y */
ret = H5Sselect_hyperslab(small_cube_xy_slice_1_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the irregular selection to the upper right hand corner */
- start[0] += 5; /* x */
- start[1] += 5; /* y */
+ start[0] += 5; /* x */
+ start[1] += 5; /* y */
ret = H5Sselect_hyperslab(small_cube_xy_slice_2_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -9972,101 +9922,101 @@ test_shape_same_dr__smoke_check_3(void)
small_cube_xz_slice_2_sid = H5Screate_simple(3, small_cube_dims, NULL);
CHECK(small_cube_xz_slice_2_sid, FAIL, "H5Screate_simple");
- start[0] = 2; /* x */
- start[1] = 5; /* y */
- start[2] = 3; /* z */
+ start[0] = 2; /* x */
+ start[1] = 5; /* y */
+ start[2] = 3; /* z */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
- stride[2] = 20; /* z */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
+ stride[2] = 20; /* z */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
- count[2] = 1; /* z */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
+ count[2] = 1; /* z */
- block[0] = 2; /* x */
- block[1] = 1; /* y */
- block[2] = 4; /* z */
+ block[0] = 2; /* x */
+ block[1] = 1; /* y */
+ block[2] = 4; /* z */
ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the starting point to the origin */
- start[0] -= 1; /* x */
- start[2] -= 2; /* y */
+ start[0] -= 1; /* x */
+ start[2] -= 2; /* y */
ret = H5Sselect_hyperslab(small_cube_xz_slice_1_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the irregular selection to the upper right hand corner */
- start[0] += 5; /* x */
- start[2] += 5; /* y */
+ start[0] += 5; /* x */
+ start[2] += 5; /* y */
ret = H5Sselect_hyperslab(small_cube_xz_slice_2_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = 3; /* x */
- start[1] = 5; /* y */
- start[2] = 6; /* z */
+ start[0] = 3; /* x */
+ start[1] = 5; /* y */
+ start[2] = 6; /* z */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
- stride[2] = 20; /* z */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
+ stride[2] = 20; /* z */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
- count[2] = 1; /* z */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
+ count[2] = 1; /* z */
- block[0] = 4; /* x */
- block[1] = 1; /* y */
- block[2] = 2; /* z */
+ block[0] = 4; /* x */
+ block[1] = 1; /* y */
+ block[2] = 2; /* z */
ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the starting point to the origin */
- start[0] -= 1; /* x */
- start[2] -= 2; /* y */
+ start[0] -= 1; /* x */
+ start[2] -= 2; /* y */
ret = H5Sselect_hyperslab(small_cube_xz_slice_1_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the irregular selection to the upper right hand corner */
- start[0] += 5; /* x */
- start[2] += 5; /* y */
+ start[0] += 5; /* x */
+ start[2] += 5; /* y */
ret = H5Sselect_hyperslab(small_cube_xz_slice_2_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = 5; /* x */
- start[1] = 5; /* y */
- start[2] = 3; /* z */
+ start[0] = 5; /* x */
+ start[1] = 5; /* y */
+ start[2] = 3; /* z */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
- stride[2] = 20; /* z */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
+ stride[2] = 20; /* z */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
- count[2] = 1; /* z */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
+ count[2] = 1; /* z */
- block[0] = 2; /* x */
- block[1] = 1; /* y */
- block[2] = 2; /* z */
+ block[0] = 2; /* x */
+ block[1] = 1; /* y */
+ block[2] = 2; /* z */
ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the starting point to the origin */
- start[0] -= 1; /* x */
- start[2] -= 2; /* y */
+ start[0] -= 1; /* x */
+ start[2] -= 2; /* y */
ret = H5Sselect_hyperslab(small_cube_xz_slice_1_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the irregular selection to the upper right hand corner */
- start[0] += 5; /* x */
- start[2] += 5; /* y */
+ start[0] += 5; /* x */
+ start[2] += 5; /* y */
ret = H5Sselect_hyperslab(small_cube_xz_slice_2_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -10084,101 +10034,101 @@ test_shape_same_dr__smoke_check_3(void)
small_cube_yz_slice_2_sid = H5Screate_simple(3, small_cube_dims, NULL);
CHECK(small_cube_yz_slice_2_sid, FAIL, "H5Screate_simple");
- start[0] = 8; /* x */
- start[1] = 2; /* y */
- start[2] = 3; /* z */
+ start[0] = 8; /* x */
+ start[1] = 2; /* y */
+ start[2] = 3; /* z */
- stride[0] = 20; /* x -- large enough that there will only be one slice */
- stride[1] = 20; /* y */
- stride[2] = 20; /* z */
+ stride[0] = 20; /* x -- large enough that there will only be one slice */
+ stride[1] = 20; /* y */
+ stride[2] = 20; /* z */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
- count[2] = 1; /* z */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
+ count[2] = 1; /* z */
- block[0] = 1; /* x */
- block[1] = 2; /* y */
- block[2] = 4; /* z */
+ block[0] = 1; /* x */
+ block[1] = 2; /* y */
+ block[2] = 4; /* z */
ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the starting point to the origin */
- start[1] -= 1; /* x */
- start[2] -= 2; /* y */
+ start[1] -= 1; /* x */
+ start[2] -= 2; /* y */
ret = H5Sselect_hyperslab(small_cube_yz_slice_1_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the irregular selection to the upper right hand corner */
- start[0] += 5; /* x */
- start[2] += 5; /* y */
+ start[0] += 5; /* x */
+ start[2] += 5; /* y */
ret = H5Sselect_hyperslab(small_cube_yz_slice_2_sid, H5S_SELECT_SET,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = 8; /* x */
- start[1] = 3; /* y */
- start[2] = 6; /* z */
+ start[0] = 8; /* x */
+ start[1] = 3; /* y */
+ start[2] = 6; /* z */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
- stride[2] = 20; /* z */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
+ stride[2] = 20; /* z */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
- count[2] = 1; /* z */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
+ count[2] = 1; /* z */
- block[0] = 1; /* x */
- block[1] = 4; /* y */
- block[2] = 2; /* z */
+ block[0] = 1; /* x */
+ block[1] = 4; /* y */
+ block[2] = 2; /* z */
ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the starting point to the origin */
- start[1] -= 1; /* x */
- start[2] -= 2; /* y */
+ start[1] -= 1; /* x */
+ start[2] -= 2; /* y */
ret = H5Sselect_hyperslab(small_cube_yz_slice_1_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the irregular selection to the upper right hand corner */
- start[0] += 5; /* x */
- start[2] += 5; /* y */
+ start[0] += 5; /* x */
+ start[2] += 5; /* y */
ret = H5Sselect_hyperslab(small_cube_yz_slice_2_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = 8; /* x */
- start[1] = 5; /* y */
- start[2] = 3; /* z */
+ start[0] = 8; /* x */
+ start[1] = 5; /* y */
+ start[2] = 3; /* z */
- stride[0] = 20; /* x */
- stride[1] = 20; /* y */
- stride[2] = 20; /* z */
+ stride[0] = 20; /* x */
+ stride[1] = 20; /* y */
+ stride[2] = 20; /* z */
- count[0] = 1; /* x */
- count[1] = 1; /* y */
- count[2] = 1; /* z */
+ count[0] = 1; /* x */
+ count[1] = 1; /* y */
+ count[2] = 1; /* z */
- block[0] = 1; /* x */
- block[1] = 2; /* y */
- block[2] = 2; /* z */
+ block[0] = 1; /* x */
+ block[1] = 2; /* y */
+ block[2] = 2; /* z */
ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the starting point to the origin */
- start[1] -= 1; /* x */
- start[2] -= 2; /* y */
+ start[1] -= 1; /* x */
+ start[2] -= 2; /* y */
ret = H5Sselect_hyperslab(small_cube_yz_slice_1_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* move the irregular selection to the upper right hand corner */
- start[0] += 5; /* x */
- start[2] += 5; /* y */
+ start[0] += 5; /* x */
+ start[2] += 5; /* y */
ret = H5Sselect_hyperslab(small_cube_yz_slice_2_sid, H5S_SELECT_OR,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -10252,87 +10202,86 @@ test_shape_same_dr__smoke_check_3(void)
ret = H5Sclose(small_cube_yz_slice_2_sid);
CHECK(ret, FAIL, "H5Sclose");
-
} /* test_shape_same_dr__smoke_check_3() */
/****************************************************************
**
-** test_shape_same_dr__smoke_check_4():
+** test_shape_same_dr__smoke_check_4():
**
-** Create a square, 2 D data space (10 X 10), and select
-** the entire space.
+** Create a square, 2-D dataspace (10 X 10), and select
+** the entire space.
**
-** Similarly, create 3 D and 4 D data spaces:
+** Similarly, create 3-D and 4-D dataspaces:
**
-** (1 X 10 X 10)
-** (10 X 1 X 10)
-** (10 X 10 X 1)
-** (10 X 10 X 10)
+** (1 X 10 X 10)
+** (10 X 1 X 10)
+** (10 X 10 X 1)
+** (10 X 10 X 10)
**
-** (1 X 1 X 10 X 10)
-** (1 X 10 X 1 X 10)
-** (1 X 10 X 10 X 1)
-** (10 X 1 X 1 X 10)
-** (10 X 1 X 10 X 1)
-** (10 X 10 X 1 X 1)
-** (10 X 1 X 10 X 10)
+** (1 X 1 X 10 X 10)
+** (1 X 10 X 1 X 10)
+** (1 X 10 X 10 X 1)
+** (10 X 1 X 1 X 10)
+** (10 X 1 X 10 X 1)
+** (10 X 10 X 1 X 1)
+** (10 X 1 X 10 X 10)
**
-** And select these entire spaces as well.
+** And select these entire spaces as well.
**
-** Compare the 2 D space against all the other spaces
-** with H5S_select_shape_same(). The (1 X 10 X 10) &
-** (1 X 1 X 10 X 10) should return TRUE. All others
-** should return FALSE.
+** Compare the 2-D space against all the other spaces
+** with H5Sselect_shape_same(). The (1 X 10 X 10) &
+** (1 X 1 X 10 X 10) should return TRUE. All others
+** should return FALSE.
**
****************************************************************/
static void
test_shape_same_dr__smoke_check_4(void)
{
- hid_t square_sid;
- hid_t three_d_space_0_sid;
- hid_t three_d_space_1_sid;
- hid_t three_d_space_2_sid;
- hid_t three_d_space_3_sid;
- hid_t four_d_space_0_sid;
- hid_t four_d_space_1_sid;
- hid_t four_d_space_2_sid;
- hid_t four_d_space_3_sid;
- hid_t four_d_space_4_sid;
- hid_t four_d_space_5_sid;
- hid_t four_d_space_6_sid;
- hsize_t dims[] = {10, 10, 10, 10};
- htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
-
- MESSAGE(7, (" Smoke check 4: Spaces of different dimension but same size.\n"));
+ hid_t square_sid;
+ hid_t three_d_space_0_sid;
+ hid_t three_d_space_1_sid;
+ hid_t three_d_space_2_sid;
+ hid_t three_d_space_3_sid;
+ hid_t four_d_space_0_sid;
+ hid_t four_d_space_1_sid;
+ hid_t four_d_space_2_sid;
+ hid_t four_d_space_3_sid;
+ hid_t four_d_space_4_sid;
+ hid_t four_d_space_5_sid;
+ hid_t four_d_space_6_sid;
+ hsize_t dims[] = {10, 10, 10, 10};
+ htri_t check; /* Shape comparison return value */
+ herr_t ret; /* Generic return value */
+
+ MESSAGE(7, (" Smoke check 4: Spaces of different dimension but same size.\n"));
/* Create the 10 x 10 dataspace */
square_sid = H5Screate_simple(2, dims, NULL);
CHECK(square_sid, FAIL, "H5Screate_simple");
- /* create (1 X 10 X 10) data space */
+ /* create (1 X 10 X 10) dataspace */
dims[0] = 1;
dims[1] = 10;
dims[2] = 10;
three_d_space_0_sid = H5Screate_simple(3, dims, NULL);
CHECK(three_d_space_0_sid, FAIL, "H5Screate_simple");
- /* create (10 X 1 X 10) data space */
+ /* create (10 X 1 X 10) dataspace */
dims[0] = 10;
dims[1] = 1;
dims[2] = 10;
three_d_space_1_sid = H5Screate_simple(3, dims, NULL);
CHECK(three_d_space_1_sid, FAIL, "H5Screate_simple");
- /* create (10 X 10 X 1) data space */
+ /* create (10 X 10 X 1) dataspace */
dims[0] = 10;
dims[1] = 10;
dims[2] = 1;
three_d_space_2_sid = H5Screate_simple(3, dims, NULL);
CHECK(three_d_space_2_sid, FAIL, "H5Screate_simple");
- /* create (10 X 10 X 10) data space */
+ /* create (10 X 10 X 10) dataspace */
dims[0] = 10;
dims[1] = 10;
dims[2] = 10;
@@ -10340,7 +10289,7 @@ test_shape_same_dr__smoke_check_4(void)
CHECK(three_d_space_3_sid, FAIL, "H5Screate_simple");
- /* create (1 X 1 X 10 X 10) data space */
+ /* create (1 X 1 X 10 X 10) dataspace */
dims[0] = 1;
dims[1] = 1;
dims[2] = 10;
@@ -10348,7 +10297,7 @@ test_shape_same_dr__smoke_check_4(void)
four_d_space_0_sid = H5Screate_simple(4, dims, NULL);
CHECK(four_d_space_0_sid, FAIL, "H5Screate_simple");
- /* create (1 X 10 X 1 X 10) data space */
+ /* create (1 X 10 X 1 X 10) dataspace */
dims[0] = 1;
dims[1] = 10;
dims[2] = 1;
@@ -10356,7 +10305,7 @@ test_shape_same_dr__smoke_check_4(void)
four_d_space_1_sid = H5Screate_simple(4, dims, NULL);
CHECK(four_d_space_1_sid, FAIL, "H5Screate_simple");
- /* create (1 X 10 X 10 X 1) data space */
+ /* create (1 X 10 X 10 X 1) dataspace */
dims[0] = 1;
dims[1] = 10;
dims[2] = 10;
@@ -10364,7 +10313,7 @@ test_shape_same_dr__smoke_check_4(void)
four_d_space_2_sid = H5Screate_simple(4, dims, NULL);
CHECK(four_d_space_2_sid, FAIL, "H5Screate_simple");
- /* create (10 X 1 X 1 X 10) data space */
+ /* create (10 X 1 X 1 X 10) dataspace */
dims[0] = 10;
dims[1] = 1;
dims[2] = 1;
@@ -10372,7 +10321,7 @@ test_shape_same_dr__smoke_check_4(void)
four_d_space_3_sid = H5Screate_simple(4, dims, NULL);
CHECK(four_d_space_3_sid, FAIL, "H5Screate_simple");
- /* create (10 X 1 X 10 X 1) data space */
+ /* create (10 X 1 X 10 X 1) dataspace */
dims[0] = 10;
dims[1] = 1;
dims[2] = 10;
@@ -10380,7 +10329,7 @@ test_shape_same_dr__smoke_check_4(void)
four_d_space_4_sid = H5Screate_simple(4, dims, NULL);
CHECK(four_d_space_4_sid, FAIL, "H5Screate_simple");
- /* create (10 X 10 X 1 X 1) data space */
+ /* create (10 X 10 X 1 X 1) dataspace */
dims[0] = 10;
dims[1] = 10;
dims[2] = 1;
@@ -10388,7 +10337,7 @@ test_shape_same_dr__smoke_check_4(void)
four_d_space_5_sid = H5Screate_simple(4, dims, NULL);
CHECK(four_d_space_5_sid, FAIL, "H5Screate_simple");
- /* create (10 X 1 X 10 X 10) data space */
+ /* create (10 X 1 X 10 X 10) dataspace */
dims[0] = 10;
dims[1] = 1;
dims[2] = 10;
@@ -10478,15 +10427,15 @@ test_shape_same_dr__smoke_check_4(void)
/****************************************************************
**
** test_shape_same_dr__full_space_vs_slice(): Tests selection
-** of a full n-cube data space vs an n-dimensional slice of
-** of an m-cube (m > n) in a call to H5S_select_shape_same().
-** Note that this test does not require the n-cube and the
-** n-dimensional slice to have the same rank (although
-** H5S_select_shape_same() should always return FALSE if
-** they don't).
+** of a full n-cube dataspace vs an n-dimensional slice of
+** of an m-cube (m > n) in a call to H5Sselect_shape_same().
+** Note that this test does not require the n-cube and the
+** n-dimensional slice to have the same rank (although
+** H5Sselect_shape_same() should always return FALSE if
+** they don't).
**
-** Per Quincey's suggestion, only test up to 5 dimensional
-** spaces.
+** Per Quincey's suggestion, only test up to 5 dimensional
+** spaces.
**
****************************************************************/
static void
@@ -10498,38 +10447,38 @@ test_shape_same_dr__full_space_vs_slice(int test_num,
hbool_t dim_selected[],
hbool_t expected_result)
{
- char test_desc_0[128];
- char test_desc_1[128];
+ char test_desc_0[128];
+ char test_desc_1[256];
int i;
- hid_t n_cube_0_sid; /* the fully selected hyper cube */
- hid_t n_cube_1_sid; /* the hyper cube in which a slice is selected */
- hsize_t dims[SS_DR_MAX_RANK];
- hsize_t start[SS_DR_MAX_RANK];
- hsize_t * start_ptr;
- hsize_t stride[SS_DR_MAX_RANK];
- hsize_t * stride_ptr;
- hsize_t count[SS_DR_MAX_RANK];
- hsize_t * count_ptr;
- hsize_t block[SS_DR_MAX_RANK];
- hsize_t * block_ptr;
- htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ hid_t n_cube_0_sid; /* the fully selected hyper cube */
+ hid_t n_cube_1_sid; /* the hyper cube in which a slice is selected */
+ hsize_t dims[SS_DR_MAX_RANK];
+ hsize_t start[SS_DR_MAX_RANK];
+ hsize_t * start_ptr;
+ hsize_t stride[SS_DR_MAX_RANK];
+ hsize_t * stride_ptr;
+ hsize_t count[SS_DR_MAX_RANK];
+ hsize_t * count_ptr;
+ hsize_t block[SS_DR_MAX_RANK];
+ hsize_t * block_ptr;
+ htri_t check; /* Shape comparison return value */
+ herr_t ret; /* Generic return value */
HDassert( 0 < small_rank );
HDassert( small_rank <= large_rank );
HDassert( large_rank <= SS_DR_MAX_RANK );
HDassert( 0 <= offset );
HDassert( offset < large_rank );
- HDassert( edge_size > 0 );
- HDassert( edge_size <= 1000 );
+ HDassert( edge_size > 0 );
+ HDassert( edge_size <= 1000 );
- sprintf(test_desc_0,
- "\tn-cube slice through m-cube (n <= m) test %d.\n",
+ HDsprintf(test_desc_0,
+ "\tn-cube slice through m-cube (n <= m) test %d.\n",
test_num);
MESSAGE(7, (test_desc_0));
/* This statement must be updated if SS_DR_MAX_RANK is changed */
- sprintf(test_desc_1,
+ HDsprintf(test_desc_1,
"\t\tranks: %d/%d offset: %d dim_selected: %d/%d/%d/%d/%d.\n",
small_rank, large_rank, offset,
(int)dim_selected[0],
@@ -10587,7 +10536,7 @@ test_shape_same_dr__full_space_vs_slice(int test_num,
block_ptr = &(block[i]);
- /* select the hyper slab */
+ /* select the hyperslab */
ret = H5Sselect_hyperslab(n_cube_1_sid, H5S_SELECT_SET,
start_ptr, stride_ptr, count_ptr, block_ptr);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -10604,34 +10553,33 @@ test_shape_same_dr__full_space_vs_slice(int test_num,
ret = H5Sclose(n_cube_1_sid);
CHECK(ret, FAIL, "H5Sclose");
-
} /* test_shape_same_dr__full_space_vs_slice() */
/****************************************************************
**
-** test_shape_same_dr__run_full_space_vs_slice_tests():
+** test_shape_same_dr__run_full_space_vs_slice_tests():
**
-** Run the est_shape_same_dr__full_space_vs_slice() test
-** over a variety of ranks and offsets.
+** Run the test_shape_same_dr__full_space_vs_slice() test
+** over a variety of ranks and offsets.
**
-** At present, we test H5S_select_shape_same() with
-** fully selected 1, 2, 3, and 4 cubes as one parameter, and
-** 1, 2, 3, and 4 dimensional slices through a n-cube of rank
-** no more than 5 (and at least the rank of the slice).
-** We stop at rank 5, as Quincey suggested that it would be
-** sufficient.
+** At present, we test H5Sselect_shape_same() with
+** fully selected 1, 2, 3, and 4 cubes as one parameter, and
+** 1, 2, 3, and 4 dimensional slices through a n-cube of rank
+** no more than 5 (and at least the rank of the slice).
+** We stop at rank 5, as Quincey suggested that it would be
+** sufficient.
**
-** All the n-cubes will have lengths of the same size, so
-** H5S_select_shape_same() should return true iff:
+** All the n-cubes will have lengths of the same size, so
+** H5Sselect_shape_same() should return true iff:
**
-** 1) the rank for the fully selected n cube equals the
+** 1) the rank for the fully selected n cube equals the
** number of dimensions selected in the slice through the
** m-cube (m >= n).
**
-** 2) The dimensions selected in the slice through the m-cube
-** are the dimesnions with the most quickly changing
-** indices.
+** 2) The dimensions selected in the slice through the m-cube
+** are the dimesnions with the most quickly changing
+** indices.
**
****************************************************************/
static void
@@ -10736,7 +10684,7 @@ test_shape_same_dr__run_full_space_vs_slice_tests(void)
dim_selected,
expected_result
);
-
+
z++;
} while((z < 2) && (large_rank >= 1));
@@ -10753,24 +10701,23 @@ test_shape_same_dr__run_full_space_vs_slice_tests(void)
} while((v < 2) && (large_rank >= 5));
} /* end for */
} /* end for */
-
} /* test_shape_same_dr__run_full_space_vs_slice_tests() */
/****************************************************************
**
-** test_shape_same_dr__checkerboard(): Tests selection of a
-** "checker board" subset of a full n-cube data space vs
+** test_shape_same_dr__checkerboard(): Tests selection of a
+** "checker board" subset of a full n-cube data space vs
** a "checker board" n-dimensional slice of an m-cube (m > n).
-** in a call to H5S_select_shape_same().
+** in a call to H5S_select_shape_same().
**
-** Note that this test does not require the n-cube and the
+** Note that this test does not require the n-cube and the
** n-dimensional slice to have the same rank (although
-** H5S_select_shape_same() should always return FALSE if
-** they don't).
+** H5S_select_shape_same() should always return FALSE if
+** they don't).
**
-** Per Quincey's suggestion, only test up to 5 dimensional
-** spaces.
+** Per Quincey's suggestion, only test up to 5 dimensional
+** spaces.
**
****************************************************************/
static void
@@ -10783,38 +10730,38 @@ test_shape_same_dr__checkerboard(int test_num,
hbool_t dim_selected[],
hbool_t expected_result)
{
- char test_desc_0[128];
- char test_desc_1[128];
+ char test_desc_0[128];
+ char test_desc_1[256];
int i;
- int dims_selected = 0;
- hid_t n_cube_0_sid; /* the checker board selected
- * hyper cube
+ int dims_selected = 0;
+ hid_t n_cube_0_sid; /* the checker board selected
+ * hyper cube
*/
- hid_t n_cube_1_sid; /* the hyper cube in which a
- * checkerboard slice is selected
+ hid_t n_cube_1_sid; /* the hyper cube in which a
+ * checkerboard slice is selected
*/
- hsize_t dims[SS_DR_MAX_RANK];
- hsize_t base_start[2];
- hsize_t start[SS_DR_MAX_RANK];
- hsize_t * start_ptr;
- hsize_t base_stride[2];
- hsize_t stride[SS_DR_MAX_RANK];
- hsize_t * stride_ptr;
- hsize_t base_count[2];
- hsize_t count[SS_DR_MAX_RANK];
- hsize_t * count_ptr;
- hsize_t base_block[2];
- hsize_t block[SS_DR_MAX_RANK];
- hsize_t * block_ptr;
- htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ hsize_t dims[SS_DR_MAX_RANK];
+ hsize_t base_start[2];
+ hsize_t start[SS_DR_MAX_RANK];
+ hsize_t * start_ptr;
+ hsize_t base_stride[2];
+ hsize_t stride[SS_DR_MAX_RANK];
+ hsize_t * stride_ptr;
+ hsize_t base_count[2];
+ hsize_t count[SS_DR_MAX_RANK];
+ hsize_t * count_ptr;
+ hsize_t base_block[2];
+ hsize_t block[SS_DR_MAX_RANK];
+ hsize_t * block_ptr;
+ htri_t check; /* Shape comparison return value */
+ herr_t ret; /* Generic return value */
HDassert( 0 < small_rank );
HDassert( small_rank <= large_rank );
HDassert( large_rank <= SS_DR_MAX_RANK );
HDassert( 0 < checker_size );
- HDassert( checker_size <= edge_size );
- HDassert( edge_size <= 1000 );
+ HDassert( checker_size <= edge_size );
+ HDassert( edge_size <= 1000 );
HDassert( 0 <= offset );
HDassert( offset < (int)edge_size );
@@ -10825,13 +10772,13 @@ test_shape_same_dr__checkerboard(int test_num,
HDassert( dims_selected >= 0 );
HDassert( dims_selected <= large_rank );
- sprintf(test_desc_0,
- "\tcheckerboard n-cube slice through m-cube (n <= m) test %d.\n",
+ HDsprintf(test_desc_0,
+ "\tcheckerboard n-cube slice through m-cube (n <= m) test %d.\n",
test_num);
MESSAGE(7, (test_desc_0));
/* This statement must be updated if SS_DR_MAX_RANK is changed */
- sprintf(test_desc_1,
+ HDsprintf(test_desc_1,
"\tranks: %d/%d edge/chkr size: %d/%d offset: %d dim_selected: %d/%d/%d/%d/%d:%d.\n",
small_rank, large_rank,
(int)edge_size, (int)checker_size,
@@ -10856,37 +10803,37 @@ test_shape_same_dr__checkerboard(int test_num,
*
* In the 1-D case, the "checkerboard" would look like this:
*
- * * * - - * * - - * *
+ * * * - - * * - - * *
*
* and in the 2-D case, it would look like this:
*
- * * * - - * * - - * *
+ * * * - - * * - - * *
* * * - - * * - - * *
* - - * * - - * * - -
* - - * * - - * * - -
- * * * - - * * - - * *
+ * * * - - * * - - * *
* * * - - * * - - * *
* - - * * - - * * - -
* - - * * - - * * - -
- * * * - - * * - - * *
+ * * * - - * * - - * *
* * * - - * * - - * *
*
- * In both cases, asterisks indicate selected elements,
+ * In both cases, asterisks indicate selected elements,
* and dashes indicate unselected elements.
*
* 3-D and 4-D ascii art is somewhat painful, so I'll
* leave those selections to your imagination. :-)
*
* Note, that since the edge_size and checker_size are
- * parameters that are passed in, the selection need
+ * parameters that are passed in, the selection need
* not look exactly like the selection shown above.
- * At present, the function allows checker sizes that
- * are not even divisors of the edge size -- thus
+ * At present, the function allows checker sizes that
+ * are not even divisors of the edge size -- thus
* something like the following is also possible:
*
- * * * * - - - * * * -
- * * * * - - - * * * -
- * * * * - - - * * * -
+ * * * * - - - * * * -
+ * * * * - - - * * * -
+ * * * * - - - * * * -
* - - - * * * - - - *
* - - - * * * - - - *
* - - - * * * - - - *
@@ -10895,14 +10842,14 @@ test_shape_same_dr__checkerboard(int test_num,
* * * * - - - * * * -
* - - - * * * - - - *
*
- * As the above pattern can't be selected in one
+ * As the above pattern can't be selected in one
* call to H5Sselect_hyperslab(), and since the
* values in the start, stride, count, and block
- * arrays will be repeated over all entries in
+ * arrays will be repeated over all entries in
* the selected space case, and over all selected
* dimensions in the selected hyperslab case, we
- * compute these values first and store them in
- * in the base_start, base_stride, base_count,
+ * compute these values first and store them in
+ * in the base_start, base_stride, base_count,
* and base_block arrays.
*/
@@ -10912,9 +10859,9 @@ test_shape_same_dr__checkerboard(int test_num,
base_stride[0] = 2 * checker_size;
base_stride[1] = 2 * checker_size;
- /* Note that the following computation depends on the C99
- * requirement that integer division discard any fraction
- * (truncation towards zero) to function correctly. As we
+ /* Note that the following computation depends on the C99
+ * requirement that integer division discard any fraction
+ * (truncation towards zero) to function correctly. As we
* now require C99, this shouldn't be a problem, but noting
* it may save us some pain if we are ever obliged to support
* pre-C99 compilers again.
@@ -10922,7 +10869,7 @@ test_shape_same_dr__checkerboard(int test_num,
base_count[0] = edge_size / (checker_size * 2);
if((edge_size % (checker_size * 2)) > 0)
- base_count[0]++;
+ base_count[0]++;
base_count[1] = (edge_size - checker_size) / (checker_size * 2);
if(((edge_size - checker_size) % (checker_size * 2)) > 0)
@@ -10931,7 +10878,7 @@ test_shape_same_dr__checkerboard(int test_num,
base_block[0] = checker_size;
base_block[1] = checker_size;
- /* now setup start, stride, count, and block arrays for
+ /* now setup start, stride, count, and block arrays for
* the first call to H5Sselect_hyperslab().
*/
for(i = 0; i < SS_DR_MAX_RANK; i++) {
@@ -10945,10 +10892,10 @@ test_shape_same_dr__checkerboard(int test_num,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* if small_rank == 1, or if edge_size == checker_size, we
+ /* if small_rank == 1, or if edge_size == checker_size, we
* are done, as either there is no added dimension in which
* to place offset selected "checkers".
- *
+ *
* Otherwise, set up start, stride, count and block, and
* make the additional selection.
*/
@@ -10968,9 +10915,9 @@ test_shape_same_dr__checkerboard(int test_num,
/* Wierdness alert:
*
- * Some how, it seems that selections can extend beyond the
- * boundaries of the target data space -- hence the following
- * code to manually clip the selection back to the data space
+ * Some how, it seems that selections can extend beyond the
+ * boundaries of the target dataspace -- hence the following
+ * code to manually clip the selection back to the dataspace
* proper.
*/
for(i = 0; i < SS_DR_MAX_RANK; i++) {
@@ -10991,8 +10938,8 @@ test_shape_same_dr__checkerboard(int test_num,
/* Now select the checkerboard selection in the (possibly larger) n-cube.
- *
- * Since we have already calculated the base start, stride, count,
+ *
+ * Since we have already calculated the base start, stride, count,
* and block, re-use the values in setting up start, stride, count,
* and block.
*/
@@ -11031,15 +10978,15 @@ test_shape_same_dr__checkerboard(int test_num,
count_ptr = &(count[i]);
block_ptr = &(block[i]);
- /* select the hyper slab */
+ /* select the hyperslab */
ret = H5Sselect_hyperslab(n_cube_1_sid, H5S_SELECT_SET,
start_ptr, stride_ptr, count_ptr, block_ptr);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* As before, if the number of dimensions selected is less than or
- * equal to 1, or if edge_size == checker_size, we are done, as
- * either there is no added dimension in which to place offset selected
- * "checkers", or the hyperslab is completely occupied by one
+ /* As before, if the number of dimensions selected is less than or
+ * equal to 1, or if edge_size == checker_size, we are done, as
+ * either there is no added dimension in which to place offset selected
+ * "checkers", or the hyperslab is completely occupied by one
* "checker".
*
* Otherwise, set up start, stride, count and block, and
@@ -11069,9 +11016,9 @@ test_shape_same_dr__checkerboard(int test_num,
/* Wierdness alert:
*
- * Again, it seems that selections can extend beyond the
- * boundaries of the target data space -- hence the following
- * code to manually clip the selection back to the data space
+ * Again, it seems that selections can extend beyond the
+ * boundaries of the target dataspace -- hence the following
+ * code to manually clip the selection back to the dataspace
* proper.
*/
for(i = 0; i < SS_DR_MAX_RANK; i++) {
@@ -11102,23 +11049,23 @@ test_shape_same_dr__checkerboard(int test_num,
/****************************************************************
**
-** test_shape_same_dr__run_checkerboard_tests():
+** test_shape_same_dr__run_checkerboard_tests():
**
-** In this set of tests, we test H5S_select_shape_same()
-** with a "checkerboard" selection of 1, 2, 3, and 4 cubes as
-** one parameter, and 1, 2, 3, and 4 dimensional checkerboard
-** slices through a n-cube of rank no more than 5 (and at
-** least the rank of the slice).
+** In this set of tests, we test H5S_select_shape_same()
+** with a "checkerboard" selection of 1, 2, 3, and 4 cubes as
+** one parameter, and 1, 2, 3, and 4 dimensional checkerboard
+** slices through a n-cube of rank no more than 5 (and at
+** least the rank of the slice).
**
-** All the n-cubes will have lengths of the same size, so
+** All the n-cubes will have lengths of the same size, so
** H5S_select_shape_same() should return true iff:
**
-** 1) the rank of the n cube equals the number of dimensions
-** selected in the checker board slice through the m-cube
+** 1) the rank of the n cube equals the number of dimensions
+** selected in the checker board slice through the m-cube
** (m >= n).
**
-** 2) The dimensions selected in the checkerboard slice
-** through the m-cube are the dimensions with the most
+** 2) The dimensions selected in the checkerboard slice
+** through the m-cube are the dimensions with the most
** quickly changing indices.
**
****************************************************************/
@@ -11169,7 +11116,7 @@ test_shape_same_dr__run_checkerboard_tests(void)
dim_selected[4] = FALSE;
else
dim_selected[4] = TRUE;
-
+
/* compute the expected result: */
i = 0;
@@ -11367,23 +11314,22 @@ test_shape_same_dr__run_checkerboard_tests(void)
} while((v < 2) && (large_rank >= 5));
} /* end for */
} /* end for */
-
} /* test_shape_same_dr__run_checkerboard_tests() */
/****************************************************************
**
-** test_shape_same_dr__irregular():
+** test_shape_same_dr__irregular():
**
-** Tests selection of an "irregular" subset of a full
+** Tests selection of an "irregular" subset of a full
** n-cube data space vs an identical "irregular" subset
** of an n-dimensional slice of an m-cube (m > n).
-** in a call to H5S_select_shape_same().
+** in a call to H5S_select_shape_same().
**
-** Note that this test does not require the n-cube and the
+** Note that this test does not require the n-cube and the
** n-dimensional slice to have the same rank (although
-** H5S_select_shape_same() should always return FALSE if
-** they don't).
+** H5S_select_shape_same() should always return FALSE if
+** they don't).
**
****************************************************************/
static void
@@ -11395,77 +11341,77 @@ test_shape_same_dr__irregular(int test_num,
hbool_t dim_selected[],
hbool_t expected_result)
{
- char test_desc_0[128];
- char test_desc_1[128];
- int edge_size = 10;
+ char test_desc_0[128];
+ char test_desc_1[256];
+ int edge_size = 10;
int i;
int j;
int k;
- int dims_selected = 0;
- hid_t n_cube_0_sid; /* the hyper cube containing
+ int dims_selected = 0;
+ hid_t n_cube_0_sid; /* the hyper cube containing
* an irregular selection
*/
- hid_t n_cube_1_sid; /* the hyper cube in which a
+ hid_t n_cube_1_sid; /* the hyper cube in which a
* slice contains an irregular
* selection.
*/
- hsize_t dims[SS_DR_MAX_RANK];
- hsize_t start_0[SS_DR_MAX_RANK] = { 2, 2, 2, 2, 5};
- hsize_t stride_0[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
- hsize_t count_0[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1};
+ hsize_t dims[SS_DR_MAX_RANK];
+ hsize_t start_0[SS_DR_MAX_RANK] = { 2, 2, 2, 2, 5};
+ hsize_t stride_0[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
+ hsize_t count_0[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1};
hsize_t block_0[SS_DR_MAX_RANK] = { 2, 2, 2, 2, 3};
- hsize_t start_1[SS_DR_MAX_RANK] = { 2, 2, 2, 5, 2};
- hsize_t stride_1[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
- hsize_t count_1[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1};
+ hsize_t start_1[SS_DR_MAX_RANK] = { 2, 2, 2, 5, 2};
+ hsize_t stride_1[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
+ hsize_t count_1[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1};
hsize_t block_1[SS_DR_MAX_RANK] = { 2, 2, 2, 3, 2};
- hsize_t start_2[SS_DR_MAX_RANK] = { 2, 2, 5, 2, 2};
- hsize_t stride_2[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
- hsize_t count_2[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1};
+ hsize_t start_2[SS_DR_MAX_RANK] = { 2, 2, 5, 2, 2};
+ hsize_t stride_2[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
+ hsize_t count_2[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1};
hsize_t block_2[SS_DR_MAX_RANK] = { 2, 2, 3, 2, 2};
- hsize_t start_3[SS_DR_MAX_RANK] = { 2, 5, 2, 2, 2};
- hsize_t stride_3[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
- hsize_t count_3[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1};
+ hsize_t start_3[SS_DR_MAX_RANK] = { 2, 5, 2, 2, 2};
+ hsize_t stride_3[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
+ hsize_t count_3[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1};
hsize_t block_3[SS_DR_MAX_RANK] = { 2, 3, 2, 2, 2};
- hsize_t start_4[SS_DR_MAX_RANK] = { 5, 2, 2, 2, 2};
- hsize_t stride_4[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
- hsize_t count_4[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1};
+ hsize_t start_4[SS_DR_MAX_RANK] = { 5, 2, 2, 2, 2};
+ hsize_t stride_4[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
+ hsize_t count_4[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1};
hsize_t block_4[SS_DR_MAX_RANK] = { 3, 2, 2, 2, 2};
- hsize_t clip_start[SS_DR_MAX_RANK] = { 0, 0, 0, 0, 0};
- hsize_t clip_stride[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
- hsize_t clip_count[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1};
+ hsize_t clip_start[SS_DR_MAX_RANK] = { 0, 0, 0, 0, 0};
+ hsize_t clip_stride[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
+ hsize_t clip_count[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1};
hsize_t clip_block[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
- hsize_t *(starts[SS_DR_MAX_RANK]) =
- {start_0, start_1, start_2, start_3, start_4};
+ hsize_t *(starts[SS_DR_MAX_RANK]) =
+ {start_0, start_1, start_2, start_3, start_4};
hsize_t *(strides[SS_DR_MAX_RANK]) =
- {stride_0, stride_1, stride_2, stride_3, stride_4};
+ {stride_0, stride_1, stride_2, stride_3, stride_4};
hsize_t *(counts[SS_DR_MAX_RANK]) =
- {count_0, count_1, count_2, count_3, count_4};
+ {count_0, count_1, count_2, count_3, count_4};
hsize_t *(blocks[SS_DR_MAX_RANK]) =
- {block_0, block_1, block_2, block_3, block_4};
-
- hsize_t start[SS_DR_MAX_RANK];
- hsize_t * start_ptr;
- hsize_t stride[SS_DR_MAX_RANK];
- hsize_t * stride_ptr;
- hsize_t count[SS_DR_MAX_RANK];
- hsize_t * count_ptr;
- hsize_t block[SS_DR_MAX_RANK];
- hsize_t * block_ptr;
- htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ {block_0, block_1, block_2, block_3, block_4};
+
+ hsize_t start[SS_DR_MAX_RANK];
+ hsize_t * start_ptr;
+ hsize_t stride[SS_DR_MAX_RANK];
+ hsize_t * stride_ptr;
+ hsize_t count[SS_DR_MAX_RANK];
+ hsize_t * count_ptr;
+ hsize_t block[SS_DR_MAX_RANK];
+ hsize_t * block_ptr;
+ htri_t check; /* Shape comparison return value */
+ herr_t ret; /* Generic return value */
HDassert( 0 < small_rank );
HDassert( small_rank <= large_rank );
HDassert( large_rank <= SS_DR_MAX_RANK );
- HDassert( 9 <= edge_size );
- HDassert( edge_size <= 1000 );
+ HDassert( 9 <= edge_size );
+ HDassert( edge_size <= 1000 );
HDassert( 0 <= slice_offset );
HDassert( slice_offset < edge_size );
HDassert( -2 <= pattern_offset );
@@ -11478,16 +11424,16 @@ test_shape_same_dr__irregular(int test_num,
HDassert( dims_selected >= 0 );
HDassert( dims_selected <= large_rank );
- sprintf(test_desc_0,
- "\tirregular sub set of n-cube slice through m-cube (n <= m) test %d.\n",
+ HDsprintf(test_desc_0,
+ "\tirregular sub set of n-cube slice through m-cube (n <= m) test %d.\n",
test_num);
MESSAGE(7, (test_desc_0));
/* This statement must be updated if SS_DR_MAX_RANK is changed */
- sprintf(test_desc_1,
+ HDsprintf(test_desc_1,
"\tranks: %d/%d edge: %d s/p offset: %d/%d dim_selected: %d/%d/%d/%d/%d:%d.\n",
small_rank, large_rank,
- edge_size,
+ edge_size,
slice_offset, pattern_offset,
(int)dim_selected[0],
(int)dim_selected[1],
@@ -11506,42 +11452,42 @@ test_shape_same_dr__irregular(int test_num,
CHECK(n_cube_0_sid, FAIL, "H5Screate_simple");
/* Select an "irregular" pattern in the small n-cube. This
- * pattern can be though of a set of four 3 x 2 x 2 X 2
- * four dimensional prisims, each parallel to one of the
- * axies and none of them intersecting with the other.
+ * pattern can be though of a set of four 3 x 2 x 2 X 2
+ * four dimensional prisims, each parallel to one of the
+ * axies and none of them intersecting with the other.
*
- * In the lesser dimensional cases, this 4D pattern is
+ * In the lesser dimensional cases, this 4D pattern is
* projected onto the lower dimensional space.
*
* In the 1-D case, the projection of the pattern looks
* like this:
*
- * - - * * - * * * - -
+ * - - * * - * * * - -
* 0 1 2 3 4 5 6 7 8 9 x
*
* and in the 2-D case, it would look like this:
*
*
- * y
- * 9 - - - - - - - - - -
- * 8 - - - - - - - - - -
- * 7 - - * * - - - - - -
- * 6 - - * * - - - - - -
- * 5 - - * * - - - - - -
- * 4 - - - - - - - - - -
- * 3 - - * * - * * * - -
- * 2 - - * * - * * * - -
- * 1 - - - - - - - - - -
- * 0 - - - - - - - - - -
+ * y
+ * 9 - - - - - - - - - -
+ * 8 - - - - - - - - - -
+ * 7 - - * * - - - - - -
+ * 6 - - * * - - - - - -
+ * 5 - - * * - - - - - -
+ * 4 - - - - - - - - - -
+ * 3 - - * * - * * * - -
+ * 2 - - * * - * * * - -
+ * 1 - - - - - - - - - -
+ * 0 - - - - - - - - - -
* 0 1 2 3 4 5 6 7 8 9 x
*
- * In both cases, asterisks indicate selected elements,
+ * In both cases, asterisks indicate selected elements,
* and dashes indicate unselected elements.
*
* Note that is this case, since the edge size is fixed,
- * the pattern does not change. However, we do use the
- * displacement parameter to allow it to be moved around
- * within the n-cube or hyper slab.
+ * the pattern does not change. However, we do use the
+ * displacement parameter to allow it to be moved around
+ * within the n-cube or hyperslab.
*/
/* first, ensure that the small n-cube has no selection */
@@ -11555,7 +11501,7 @@ test_shape_same_dr__irregular(int test_num,
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end for */
- /* finally, clip the selection to ensure that it lies fully
+ /* finally, clip the selection to ensure that it lies fully
* within the n-cube.
*/
ret = H5Sselect_hyperslab(n_cube_0_sid, H5S_SELECT_AND,
@@ -11594,8 +11540,8 @@ test_shape_same_dr__irregular(int test_num,
/* Now select the irregular selection in the (possibly larger) n-cube.
- *
- * Basic idea is to project the pattern used in the smaller n-cube
+ *
+ * Basic idea is to project the pattern used in the smaller n-cube
* onto the dimensions selected in the larger n-cube, with the displacement
* specified.
*/
@@ -11617,13 +11563,13 @@ test_shape_same_dr__irregular(int test_num,
} /* end else */
} /* end for */
- /* select the hyper slab */
+ /* select the hyperslab */
ret = H5Sselect_hyperslab(n_cube_1_sid, H5S_SELECT_OR,
start_ptr, stride_ptr, count_ptr, block_ptr);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end for */
- /* it is possible that the selection extends beyond the data space.
+ /* it is possible that the selection extends beyond the dataspace.
* clip the selection to ensure that it doesn't.
*/
ret = H5Sselect_hyperslab(n_cube_1_sid, H5S_SELECT_AND,
@@ -11642,31 +11588,30 @@ test_shape_same_dr__irregular(int test_num,
ret = H5Sclose(n_cube_1_sid);
CHECK(ret, FAIL, "H5Sclose");
-
} /* test_shape_same_dr__irregular() */
/****************************************************************
**
-** test_shape_same_dr__run_irregular_tests():
+** test_shape_same_dr__run_irregular_tests():
**
-** In this set of tests, we test H5S_select_shape_same()
-** with an "irregular" subselection of 1, 2, 3, and 4 cubes as
-** one parameter, and irregular subselections of 1, 2, 3,
-** and 4 dimensional slices through a n-cube of rank no more
-** than 5 (and at least the rank of the slice) as the other.
-** Note that the "irregular" selection may be offset between
-** the n-cube and the slice.
+** In this set of tests, we test H5Sselect_shape_same()
+** with an "irregular" subselection of 1, 2, 3, and 4 cubes as
+** one parameter, and irregular subselections of 1, 2, 3,
+** and 4 dimensional slices through a n-cube of rank no more
+** than 5 (and at least the rank of the slice) as the other.
+** Note that the "irregular" selection may be offset between
+** the n-cube and the slice.
**
** All the irregular selections will be identical (modulo rank)
** so H5S_select_shape_same() should return true iff:
**
-** 1) the rank of the n cube equals the number of dimensions
-** selected in the irregular slice through the m-cube
+** 1) the rank of the n cube equals the number of dimensions
+** selected in the irregular slice through the m-cube
** (m >= n).
**
-** 2) The dimensions selected in the irregular slice
-** through the m-cube are the dimensions with the most
+** 2) The dimensions selected in the irregular slice
+** through the m-cube are the dimensions with the most
** quickly changing indices.
**
****************************************************************/
@@ -11717,7 +11662,7 @@ test_shape_same_dr__run_irregular_tests(void)
dim_selected[4] = FALSE;
else
dim_selected[4] = TRUE;
-
+
/* compute the expected result: */
i = 0;
@@ -11857,15 +11802,14 @@ test_shape_same_dr__run_irregular_tests(void)
} while((v < 2 ) && (large_rank >= 5));
} /* end for */
} /* end for */
-
} /* test_shape_same_dr__run_irregular_tests() */
/****************************************************************
**
-** test_shape_same_dr(): Tests selections on dataspace with
-** different ranks, to verify that "shape same" routine
-** is now handling this case correctly.
+** test_shape_same_dr(): Tests selections on dataspace with
+** different ranks, to verify that "shape same" routine
+** is now handling this case correctly.
**
****************************************************************/
static void
@@ -11874,19 +11818,16 @@ test_shape_same_dr(void)
/* Output message about test being performed */
MESSAGE(6, ("Testing Same Shape/Different Rank Comparisons\n"));
-
/* first run some smoke checks */
test_shape_same_dr__smoke_check_1();
test_shape_same_dr__smoke_check_2();
test_shape_same_dr__smoke_check_3();
test_shape_same_dr__smoke_check_4();
-
/* now run more intensive tests. */
test_shape_same_dr__run_full_space_vs_slice_tests();
test_shape_same_dr__run_checkerboard_tests();
test_shape_same_dr__run_irregular_tests();
-
} /* test_shape_same_dr() */
@@ -12550,7 +12491,7 @@ test_space_rebuild(void)
CHECK(ret, FAIL, "H5Sclose");
}
-
+
/****************************************************************
**
** test_select_hyper_chunk_offset(): Tests selections on dataspace,
@@ -13676,7 +13617,7 @@ test_select(void)
size_t rdcc_nbytes; /* Raw data number of bytes */
double rdcc_w0; /* Raw data write percentage */
hssize_t offset[SPACE7_RANK] = {1, 1}; /* Offset for testing selection offsets */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Selections\n"));
@@ -13830,24 +13771,22 @@ test_select(void)
} /* test_select() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_select
+ * Function: cleanup_select
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* July 2, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
cleanup_select(void)
{
- remove(FILENAME);
+ HDremove(FILENAME);
}
diff --git a/test/tsohm.c b/test/tsohm.c
index 93ba14f..4329514 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -11,13 +11,9 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/***********************************************************
-*
-* Test program: tsohm
-*
-* Test Shared Object Header Messages
-*
-*************************************************************/
+/*
+ * Purpose: Test Shared Object Header Messages
+ */
#include "testhdf5.h"
@@ -25,9 +21,9 @@
* This file needs to access private information from the H5F package.
* This file also needs to access the file testing code.
*/
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /* suppress error about including H5Fpkg */
#define H5F_TESTING
-#include "H5Fpkg.h" /* File access */
+#include "H5Fpkg.h" /* File access */
/* Default SOHM values */
#define DEF_NUM_INDEXES 0
@@ -178,14 +174,11 @@ static void test_sohm_extlink(void);
/****************************************************************
**
-** verify_fcpl_values(): Helper function for test_sohm_fcpl.
-** Verifies that the *_in and *_out parameters are equal.
+** verify_fcpl_values(): Verifies that FCPL is set as expected.
**
****************************************************************/
static void
-verify_fcpl_values(hid_t fcpl_id, const unsigned nindexes_expected,
- const unsigned *flags_expected, const unsigned *minsizes_expected,
- unsigned l2b, unsigned b2l)
+verify_fcpl_values(hid_t fcpl_id, const unsigned nindexes_expected, const unsigned *flags_expected, const unsigned *minsizes_expected, unsigned l2b, unsigned b2l)
{
unsigned nindexes_actual;
unsigned list_size;
@@ -197,6 +190,7 @@ verify_fcpl_values(hid_t fcpl_id, const unsigned nindexes_expected,
ret = H5Pget_shared_mesg_nindexes(fcpl_id, &nindexes_actual);
CHECK_I(ret, "H5Pget_shared_mesg_nindexes");
VERIFY(nindexes_actual, nindexes_expected, "H5Pget_shared_mesg_nindexes");
+
/* Index flags and minsizes */
for(x=0; x<nindexes_actual; ++x) {
unsigned flags_i;
@@ -223,11 +217,11 @@ verify_fcpl_values(hid_t fcpl_id, const unsigned nindexes_expected,
static void
test_sohm_fcpl(void)
{
- hid_t fid = -1;
- hid_t fcpl_id = -1;
- hid_t fcpl2_id = -1;
- unsigned x;
- herr_t ret; /* Generic return value */
+ hid_t fid = -1;
+ hid_t fcpl_id = -1;
+ hid_t fcpl2_id = -1;
+ unsigned x;
+ herr_t ret;
MESSAGE(5, ("Testing File Creation Properties for Shared Messages\n"));
@@ -320,9 +314,8 @@ test_sohm_fcpl(void)
CHECK_I(ret, "H5Fclose");
/* Actually, the list max can be exactly 1 greater than the
- * btree min, but no more. Also, the errors above shouldn't
- * have corrupted the fcpl, although we do need to reset the
- * second index that we changed above.
+ * btree min, but no more.
+ * Reset the second index.
*/
ret = H5Pset_shared_mesg_index(fcpl_id, 1, test_type_flags[1], 15);
CHECK_I(ret, "H5Pset_shared_mesg_index");
@@ -333,9 +326,10 @@ test_sohm_fcpl(void)
ret = H5Fclose(fid);
CHECK_I(ret, "H5Fclose");
- /* Test edge cases; H5O_SHMESG_MAX_NINDEXES and H5O_SHMESG_MAX_LIST_SIZE should be
- * valid values. Also, creating a file with uninitialized indexes
- * (indexes 3-5) should work.
+ /* Test edge cases:
+ * H5O_SHMESG_MAX_NINDEXES and H5O_SHMESG_MAX_LIST_SIZE should be valid
+ * values.
+ * Creating a file with uninitialized indexes should work. (TODO: not implemented?)
*/
ret = H5Pset_shared_mesg_nindexes(fcpl_id, H5O_SHMESG_MAX_NINDEXES);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
@@ -344,7 +338,6 @@ test_sohm_fcpl(void)
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
CHECK_I(fid, "H5Fcreate");
-
/* Clean up */
ret = H5Pclose(fcpl_id);
CHECK_I(ret, "H5Pclose");
@@ -352,7 +345,6 @@ test_sohm_fcpl(void)
CHECK_I(ret, "H5Fclose");
} /* test_sohm_fcpl */
-
/****************************************************************
**
@@ -385,7 +377,6 @@ test_sohm_fcpl_errors(void)
verify_fcpl_values(fcpl_id, TEST_NUM_INDEXES, test_type_flags, test_minsizes, TEST_L2B, TEST_B2L);
- /* Test giving bogus values to H5P* functions */
H5E_BEGIN_TRY {
/* Trying to create too many indexes should fail */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, H5O_SHMESG_MAX_NINDEXES + 1);
@@ -484,7 +475,7 @@ error:
H5Tclose(dtype1_id);
} H5E_END_TRY
return -1;
-} /* make_dtype_1 */
+} /* make_dtype1 */
/*-------------------------------------------------------------------------
@@ -587,12 +578,12 @@ error:
*
* Purpose: Creates object headers that use a large datatype message.
*
- * Set test_file_closing to 1 to add file closing and reopening
+ * Set test_file_closing to TRUE to add file closing and reopening
* whenever possible (to test that SOHMs are written correctly
* on disk and not just in memory).
*
- * Return: Success: file ID (may not be the same one passed in)
- * Failure: Negative
+ * Return: Success: file ID (may not be the same one passed in)
+ * Failure: H5I_INVALID_HID
*
* Programmer: James Laird
* Monday, April 10, 2006
@@ -600,13 +591,13 @@ error:
*-------------------------------------------------------------------------
*/
static hid_t
-size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_closing)
+size1_helper(hid_t file, const char *filename, hid_t fapl_id, hbool_t test_file_closing)
{
dtype1_struct wdata;
dtype1_struct rdata;
- hid_t dtype1_id = -1;
- hid_t space_id = -1;
- hid_t dset_id = -1;
+ hid_t dtype1_id = H5I_INVALID_HID;
+ hid_t space_id = H5I_INVALID_HID;
+ hid_t dset_id = H5I_INVALID_HID;
hsize_t dim1[1];
int x;
@@ -626,12 +617,12 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
HDmemset(&rdata, 0, sizeof(rdata)); \
if (0 > H5Dread((dset_id), (dtype_id), H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata)) { \
H5_FAILED(); AT(); \
- printf("Can't read data\n"); \
+ HDprintf("Can't read data\n"); \
goto error; \
} \
if ((rdata.i1 != wdata.i1) || (rdata.i2 != wdata.i2) || HDstrcmp(rdata.str, wdata.str)) { \
H5_FAILED(); AT(); \
- printf("incorrect read data\n"); \
+ HDprintf("incorrect read data\n"); \
goto error; \
} \
} /* TSOHM_S1H_VERIFY_DATA() definition */
@@ -640,7 +631,7 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
* local disks. Don't close and reopen if express testing is enabled.
*/
if(GetTestExpress() > 1)
- test_file_closing = 0;
+ test_file_closing = FALSE;
/* Intialize wdata */
HDmemset(&wdata, 0, sizeof(wdata));
@@ -658,17 +649,18 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
/* Intialize rdata */
HDmemset(&rdata, 0, sizeof(rdata));
- if((dtype1_id = make_dtype_1()) < 0) TEST_ERROR
+ dtype1_id = make_dtype_1();
+ if(dtype1_id < 0) TEST_ERROR
- /* Create the dataspace and dataset */
dim1[0] = 1;
- if((space_id = H5Screate_simple(1, dim1, NULL)) < 0) TEST_ERROR
+ space_id = H5Screate_simple(1, dim1, NULL);
+ if(space_id < 0) TEST_ERROR
- if((dset_id = H5Dcreate2(file, DSETNAME[0], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ dset_id = H5Dcreate2(file, DSETNAME[0], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dset_id < 0) FAIL_STACK_ERROR
/* Test writing and reading */
if(H5Dwrite(dset_id, dtype1_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) FAIL_STACK_ERROR
-
TSOHM_S1H_VERIFY_DATA(dset_id, dtype1_id)
if(H5Dclose(dset_id) < 0) FAIL_STACK_ERROR
@@ -702,7 +694,8 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
* this increases the amount of space saved by sharing the datatype message
*/
for(x = 0; x < SOHM_HELPER_NUM_EX_DSETS; x++) {
- if((dset_id = H5Dcreate2(file, EXTRA_DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ dset_id = H5Dcreate2(file, EXTRA_DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dset_id < 0) TEST_ERROR
if(H5Dclose(dset_id) < 0) TEST_ERROR
if(test_file_closing)
@@ -721,6 +714,7 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
if(H5Dclose(dset_id) < 0) TEST_ERROR
if(H5Tclose(dtype1_id) < 0) TEST_ERROR
+
return file;
error:
@@ -730,7 +724,8 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
H5Dclose(dset_id);
H5Fclose(file);
} H5E_END_TRY
- return -1;
+
+ return H5I_INVALID_HID;
#undef TSOHM_S1H_VERIFY_DATA /* macro is exclusive to this function */
} /* size1_helper */
@@ -747,25 +742,30 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
*----------------------------------------------------------------------------
*/
static h5_stat_size_t
-getsize_testsize1(const char *filename, hid_t fcpl_id, hid_t fapl_id, unsigned open_close, H5O_info_t *oinfo)
+getsize_testsize1(const char *filename, hid_t fcpl_id, hid_t fapl_id,
+ hbool_t test_file_closing, H5O_info_t *oinfo)
{
- hid_t file = -1;
+ hid_t fid = H5I_INVALID_HID;
herr_t ret;
- file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
- CHECK_I(file, "H5Fcreate");
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
- file = size1_helper(file, FILENAME, fapl_id, open_close);
- CHECK_I(file, "size1_helper");
+ /* If test_file_closing is TRUE, you will get back a different ID,
+ * which will need to be closed. The helper will close your passed-in
+ * ID.
+ */
+ fid = size1_helper(fid, filename, fapl_id, test_file_closing);
+ CHECK(fid, H5I_INVALID_HID, "size1_helper");
- ret = H5Oget_info_by_name2(file, DSETNAME[0], oinfo, H5O_INFO_HDR, H5P_DEFAULT);
- CHECK_I(ret, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name2(fid, DSETNAME[0], oinfo, H5O_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
- ret = H5Fclose(file);
- CHECK_I(ret, "H5Fclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
- return h5_get_file_size(FILENAME, fapl_id);
-} /* getsize_testsize1 */
+ return h5_get_file_size(filename, fapl_id);
+} /* getsize_testsize1() */
/*-------------------------------------------------------------------------
@@ -787,13 +787,14 @@ test_sohm_size1(void)
unsigned use_shared = 0;
unsigned use_btree = 0;
- unsigned open_close = 0;
h5_stat_size_t file_sizes[9];
unsigned size_index = 0;
hsize_t oh_sizes[3];
unsigned oh_size_index = 0;
+#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */
hsize_t norm_oh_size;
+#endif /* Jira HDFFV-10646 */
hsize_t sohm_oh_size;
hsize_t sohm_btree_oh_size;
h5_stat_size_t norm_empty_filesize;
@@ -819,7 +820,6 @@ test_sohm_size1(void)
/* Create a FAPL with "semi" close degree, to detect dangling IDs */
fapl_id = H5Pcreate(H5P_FILE_ACCESS);
CHECK_I(fapl_id, "H5Pcreate");
-
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI);
CHECK_I(ret, "H5Pset_fclose_degree");
@@ -829,6 +829,7 @@ test_sohm_size1(void)
for (use_shared = 0; use_shared < 2; use_shared++) {
for (use_btree = 0; use_btree < 2; use_btree++) {
+ hbool_t test_open_close;
/* cannot use btree indexing without shared messages; skip case */
if (use_btree && !use_shared)
@@ -864,8 +865,10 @@ test_sohm_size1(void)
file_sizes[size_index++] = h5_get_file_size(FILENAME, fapl_id);
/* size of populated file, with different populating behaviors */
- for (open_close = 0; open_close < 2; open_close++)
- file_sizes[size_index++] = getsize_testsize1(FILENAME, fcpl_id, fapl_id, open_close, &oinfo);
+ test_open_close = TRUE;
+ file_sizes[size_index++] = getsize_testsize1(FILENAME, fcpl_id, fapl_id, test_open_close, &oinfo);
+ test_open_close = FALSE;
+ file_sizes[size_index++] = getsize_testsize1(FILENAME, fcpl_id, fapl_id, test_open_close, &oinfo);
oh_sizes[oh_size_index++] = oinfo.hdr.space.total;
ret = H5Pclose(fcpl_id);
@@ -890,7 +893,9 @@ test_sohm_size1(void)
norm_empty_filesize = file_sizes[0];
norm_final_filesize = file_sizes[1];
norm_final_filesize2 = file_sizes[2];
+#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */
norm_oh_size = oh_sizes[0];
+#endif /* Jira HDFFV-10646 */
sohm_empty_filesize = file_sizes[3];
sohm_final_filesize = file_sizes[4];
@@ -928,16 +933,16 @@ test_sohm_size1(void)
VERIFY(sohm_btree_empty_filesize, 1, "h5_get_file_size");
/* When full, the sohm btree file should be smaller than the normal file.
- * The sohm list file should be at least as small, since it doesn't need the
- * overhead of a B-tree.
+ * The sohm list file should be at least as small, since it doesn't need
+ * the overhead of a B-tree.
*/
if(sohm_btree_final_filesize >= norm_final_filesize)
VERIFY(sohm_btree_final_filesize, 1, "h5_get_file_size");
if(sohm_final_filesize > sohm_btree_final_filesize)
VERIFY(sohm_final_filesize, 1, "h5_get_file_size");
- /* Comparative sizes shouldn't change even if we open and close the file */
-
+ /* Comparative sizes shouldn't change even if we open and close the file
+ */
if(sohm_btree_final_filesize2 >= norm_final_filesize2)
VERIFY(sohm_btree_final_filesize2, 1, "h5_get_file_size");
if(sohm_final_filesize2 > sohm_btree_final_filesize2)
@@ -946,7 +951,7 @@ test_sohm_size1(void)
} /* test_sohm_size1 */
-/*-------------------------------------------------------------------------
+/*---------------------------------------------------------------------------
* Function: test_sohm_size_consistency_open_create
*
* Purpose: Tests that header size is different depending on file open
@@ -957,8 +962,9 @@ test_sohm_size1(void)
* Programmer: Jacob Smith
* 2018 November 1
*
- *-------------------------------------------------------------------------
+ *---------------------------------------------------------------------------
*/
+#if 0 /* TODO: REVEALS BUG TO BE FIXED - SEE JIRA HDFFV-10645 */
static void
test_sohm_size_consistency_open_create(void)
{
@@ -976,7 +982,8 @@ test_sohm_size_consistency_open_create(void)
unsigned btree_min = 10;
herr_t ret;
- MESSAGE(5, ("Testing that header size is consistent between H5Fopen and H5Fcreate\n"));
+ MESSAGE(5, \
+ ("Testing that header size is consistent between H5Fopen and H5Fcreate\n"));
/* Create a FAPL with "semi" close degree, to detect dangling IDs */
fapl_id = H5Pcreate(H5P_FILE_ACCESS);
@@ -1013,11 +1020,11 @@ test_sohm_size_consistency_open_create(void)
* Add messages to previously-created file */
file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id);
CHECK_I(file, "H5Fopen");
- file = size1_helper(file, FILENAME, fapl_id, 0);
+ file = size1_helper(file, FILENAME, fapl_id, FALSE);
CHECK_I(file, "size1_helper");
/* Get the size of a dataset object header */
- ret = H5Oget_info_by_name2(file, DSETNAME[0], &oinfo, H5O_INFO_HDR, H5P_DEFAULT);
+ ret = H5Oget_info_by_name2(file, DSETNAME[0], &oinfo, H5O_INFO_HDR, H5P_DEFAULT);
CHECK_I(ret, "H5Oget_info_by_name");
oh_size_open = oinfo.hdr.space.total;
@@ -1028,7 +1035,7 @@ test_sohm_size_consistency_open_create(void)
* Add messages to a newly-created file */
file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
CHECK_I(file, "H5Fcreate");
- file = size1_helper(file, FILENAME, fapl_id, 0);
+ file = size1_helper(file, FILENAME, fapl_id, FALSE);
CHECK_I(file, "size1_helper");
/* Get the size of a dataset object header */
@@ -1048,6 +1055,7 @@ test_sohm_size_consistency_open_create(void)
ret = H5Pclose(fapl_id);
CHECK_I(ret, "H5Pclose");
} /* test_sohm_size_consistency_open_create */
+#endif /* Jira HDFFV-10645 */
/*-------------------------------------------------------------------------
@@ -1131,7 +1139,7 @@ sohm_attr_helper(hid_t fcpl_id)
ret = H5Gclose(group_id);
CHECK_I(ret, "H5Gclose");
ret = H5Tclose(type_id);
- CHECK_I(ret, "H5Tclose")
+ CHECK_I(ret, "H5Tclose");
/* Flush the file to force data to be written */
ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
@@ -1178,7 +1186,8 @@ sohm_attr_helper(hid_t fcpl_id)
static void
test_sohm_attrs(void)
{
- hid_t fcpl_id;
+ hid_t bad_fid = H5I_INVALID_HID;
+ hid_t fcpl_id = H5I_INVALID_HID;
unsigned i = 0;
#define TSOHM_TSA_NFLAGS_1 7
unsigned flags1[TSOHM_TSA_NFLAGS_1] = {
@@ -1238,7 +1247,8 @@ test_sohm_attrs(void)
MESSAGE(5, ("Testing that shared messages work with attributes\n"));
- /* No shared messages */
+ /* No shared messages
+ */
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
CHECK_I(fcpl_id, "H5Pcreate");
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 0);
@@ -1295,8 +1305,8 @@ test_sohm_attrs(void)
ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_SHMESG_ATTR_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
- VERIFY(ret, -1, "H5Fcreate");
+ bad_fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
+ VERIFY(bad_fid, H5I_INVALID_HID, "H5Fcreate");
ret = H5Pclose(fcpl_id);
CHECK_I(ret, "H5Pclose");
@@ -1328,7 +1338,6 @@ test_sohm_attrs(void)
} /* test_sohm_attrs */
-
/*-------------------------------------------------------------------------
* Function: size2_verify_plist1
@@ -1386,7 +1395,7 @@ size2_verify_plist1(hid_t plist)
ret = H5Pget_fill_value(plist, dtype1_id, &fill1);
CHECK_I(ret, "H5Pget_fill_value");
- ret = memcmp(&fill1, &fill1_correct, sizeof(fill1_correct));
+ ret = HDmemcmp(&fill1, &fill1_correct, sizeof(fill1_correct));
VERIFY(ret, 0, "memcmp");
ret = H5Tclose(dtype1_id);
@@ -1485,15 +1494,15 @@ size2_verify_plist2(hid_t plist)
static void
size2_dump_struct(const char *name, size2_helper_struct *sizes)
{
- puts(name);
- printf(" empty size: %llu\n", (unsigned long long)sizes->empty_size);
- printf(" first dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->first_dset, (unsigned long long)(sizes->first_dset - sizes->empty_size));
- printf("second dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->second_dset, (unsigned long long)(sizes->second_dset - sizes->first_dset));
- printf(" dsets 1: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets1, (unsigned long long)(sizes->dsets1 - sizes->second_dset));
- printf(" dsets 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets2, (unsigned long long)(sizes->dsets2 - sizes->dsets1));
- printf(" interleaved: %llu \tdelta: %llu\n", (unsigned long long)sizes->interleaved, (unsigned long long)(sizes->interleaved - sizes->dsets2));
- printf(" attributes: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs1, (unsigned long long)(sizes->attrs1 - sizes->interleaved));
- printf(" attributes 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs2, (unsigned long long)(sizes->attrs2 - sizes->attrs1));
+ HDputs(name);
+ HDprintf(" empty size: %llu\n", (unsigned long long)sizes->empty_size);
+ HDprintf(" first dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->first_dset, (unsigned long long)(sizes->first_dset - sizes->empty_size));
+ HDprintf("second dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->second_dset, (unsigned long long)(sizes->second_dset - sizes->first_dset));
+ HDprintf(" dsets 1: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets1, (unsigned long long)(sizes->dsets1 - sizes->second_dset));
+ HDprintf(" dsets 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets2, (unsigned long long)(sizes->dsets2 - sizes->dsets1));
+ HDprintf(" interleaved: %llu \tdelta: %llu\n", (unsigned long long)sizes->interleaved, (unsigned long long)(sizes->interleaved - sizes->dsets2));
+ HDprintf(" attributes: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs1, (unsigned long long)(sizes->attrs1 - sizes->interleaved));
+ HDprintf(" attributes 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs2, (unsigned long long)(sizes->attrs2 - sizes->attrs1));
} /* size2_dump_struct */
#endif /* NOT_NOW */
@@ -1715,7 +1724,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
group_id = H5Gopen2(file_id, "group", H5P_DEFAULT);
CHECK_I(group_id, "H5Gopen2");
}
- } /* for each dataset */
+ }
/* Close file and get its size now */
ret = H5Gclose(group_id);
@@ -1732,7 +1741,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
CHECK_I(group_id, "H5Gcreate2");
/* Create NUM_DATASETS datasets in the new group */
- for(x=0; x<NUM_DATASETS; x+=2) {
+ for(x=0; x<NUM_DATASETS; x+=2)
+ {
dset_id = H5Dcreate2(group_id, DSETNAME[x], dtype1_id, dspace1_id, H5P_DEFAULT, dcpl1_id, H5P_DEFAULT);
CHECK_I(dset_id, "H5Dcreate2");
@@ -1768,7 +1778,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
group_id = H5Gopen2(file_id, "interleaved group", H5P_DEFAULT);
CHECK_I(group_id, "H5Gopen2");
}
- } /* for each even dataset */
+ }
/* Close file and get its size now */
ret = H5Gclose(group_id);
@@ -1810,7 +1820,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
group_id = H5Gopen2(file_id, "group", H5P_DEFAULT);
CHECK_I(group_id, "H5Gopen2");
}
- } /* for each attribute */
+ }
/* Close file and get its size now */
ret = H5Gclose(group_id);
@@ -1826,7 +1836,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
group_id = H5Gopen2(file_id, "interleaved group", H5P_DEFAULT);
CHECK_I(group_id, "H5Gopen2");
- for(x=0; x<NUM_ATTRIBUTES; ++x) {
+ for(x=0; x<NUM_ATTRIBUTES; ++x)
+ {
/* Create the same name and value for each attribute as before */
attr_string1[0] = attr_name[0] = (char)((x / 10) + '0');
attr_string1[1] = attr_name[1] = (char)((x % 10) + '0');
@@ -1849,8 +1860,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
group_id = H5Gopen2(file_id, "interleaved group", H5P_DEFAULT);
CHECK_I(group_id, "H5Gopen2");
}
- } /* for each attribute */
-
+ }
/* Close file and get its size now */
ret = H5Gclose(group_id);
CHECK_I(ret, "H5Gclose");
@@ -2068,7 +2078,7 @@ size2_verify(void)
CHECK_I(attr1_id, "H5Aclose");
ret = H5Aclose(attr2_id);
CHECK_I(attr2_id, "H5Aclose");
- } /* for each attribute */
+ }
/* Close everything */
ret = H5Tclose(attr_type_id);
@@ -2697,7 +2707,7 @@ test_sohm_size2(int close_reopen)
VERIFY(0, 1, "h5_get_file_size");
if((h5_stat_size_t)((float)share_tiny_index.attrs2 * OVERHEAD_ALLOWED) < type_space_index.attrs2)
VERIFY(0, 1, "h5_get_file_size");
-} /* end test_sohm_size2() */
+} /* test_sohm_size2 */
/*-------------------------------------------------------------------------
@@ -2716,21 +2726,19 @@ test_sohm_size2(int close_reopen)
static void
delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id, int x)
{
- hid_t dset_id = -1;
- hid_t attr_id = -1;
- char wdata;
+ hid_t dset_id = -1;
+ hid_t attr_id = -1;
+ char wdata;
herr_t ret;
dset_id = H5Dcreate2(file_id, DSETNAME[x], H5T_NATIVE_CHAR, dspace_id[x], H5P_DEFAULT, dcpl_id[x], H5P_DEFAULT);
CHECK_I(dset_id, "H5Dcreate2");
-
wdata = (char)(x + 'a');
ret = H5Dwrite(dset_id, H5T_NATIVE_CHAR, dspace_id[x], dspace_id[x], H5P_DEFAULT, &wdata);
CHECK_I(ret, "H5Dwrite");
attr_id = H5Acreate2(dset_id, "attr_name", H5T_NATIVE_CHAR, dspace_id[x], H5P_DEFAULT, H5P_DEFAULT);
CHECK_I(attr_id, "H5Acreate2");
-
ret = H5Awrite(attr_id, H5T_NATIVE_CHAR, &wdata);
CHECK_I(ret, "H5Awrite");
@@ -2764,7 +2772,6 @@ delete_helper_read(hid_t file_id, hid_t *dspace_id, int x)
dset_id = H5Dopen2(file_id, DSETNAME[x], H5P_DEFAULT);
CHECK_I(dset_id, "H5Dopen2");
-
rdata = '\0';
ret = H5Dread(dset_id, H5T_NATIVE_CHAR, dspace_id[x], dspace_id[x], H5P_DEFAULT, &rdata);
CHECK_I(ret, "H5Dread");
@@ -2772,13 +2779,11 @@ delete_helper_read(hid_t file_id, hid_t *dspace_id, int x)
attr_id = H5Aopen(dset_id, "attr_name", H5P_DEFAULT);
CHECK_I(attr_id, "H5Aopen");
-
rdata = '\0';
ret = H5Aread(attr_id, H5T_NATIVE_CHAR, &rdata);
CHECK_I(ret, "H5Dread");
VERIFY(rdata, (x + 'a'), "H5Dread");
- /* Cleanup */
ret = H5Aclose(attr_id);
CHECK_I(ret, "H5Aclose");
ret = H5Dclose(dset_id);
@@ -3019,7 +3024,7 @@ test_sohm_delete(void)
ret = H5Pclose(dcpl_id[x]);
CHECK_I(ret, "H5Pclose");
} /* end for */
-} /* end test_sohm_delete() */
+} /* test_sohm_delete */
/*-------------------------------------------------------------------------
@@ -3348,7 +3353,7 @@ verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
hsize_t out_dims[2];
hsize_t out_maxdims[2];
int x;
- int old_nerrs; /* Number of errors when entering this routine */
+ int old_nerrs; /* Number of errors when entering this routine */
herr_t ret;
hsize_t *space_dims[3];
@@ -3454,28 +3459,25 @@ verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
CHECK_I(orig_space_id, "H5Screate_simple");
dset1_id = H5Dcreate2(file_id, "dataset", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset1_id, "H5Dcreate2");
-
if(close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(1);
/* Create another dataset starting with the same dataspace */
dset2_id = H5Dcreate2(file_id, "dataset2", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset2_id, "H5Dcreate2");
-
- if(close_reopen)
+ if (close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(2);
/* Create a third dataset with the same dataspace */
dset3_id = H5Dcreate2(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset3_id, "H5Dcreate2");
-
- if(close_reopen)
+ if (close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
/* Extend the first dataset */
ret = H5Dset_extent(dset1_id, dims2);
CHECK_I(ret, "H5Dset_extent");
- if(close_reopen)
+ if (close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
space_dims[0] = dims2;
@@ -3495,7 +3497,6 @@ verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
/* Extend the third dataset */
ret = H5Dset_extent(dset3_id, dims2);
CHECK_I(ret, "H5Dset_extent");
-
if(close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
@@ -3550,13 +3551,13 @@ verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
*/
dset3_id = H5Dcreate2(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset3_id, "H5Dcreate2");
- if (close_reopen)
+ if(close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
/* Extend the third dataset */
ret = H5Dset_extent(dset3_id, dims2);
CHECK_I(ret, "H5Dset_extent");
- if (close_reopen)
+ if(close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
TSOHM_VDE_VERIFY_SPACES(space_dims);
@@ -3577,7 +3578,7 @@ verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
ret = H5Pclose(dcpl_id);
CHECK_I(ret, "H5Pclose");
- /* Complaini if this test generated errors */
+ /* Complain if this test generated errors */
if(old_nerrs == GetTestNumErrs())
return(0);
else
@@ -3790,12 +3791,11 @@ test_sohm_external_dtype(void)
ret = H5Dwrite(dataset2, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig);
CHECK_I(ret, "H5Dwrite");
+ /* Close references to the first file */
ret = H5Dclose(dataset2);
CHECK_I(ret, "H5Dclose");
-
ret = H5Tclose(dset1_tid);
CHECK_I(ret, "H5Tclose");
-
ret = H5Fclose(file1);
CHECK_I(ret, "H5Fclose");
@@ -3809,13 +3809,11 @@ test_sohm_external_dtype(void)
dtype_class = H5Tget_class(dset2_tid);
VERIFY(dtype_class, H5T_COMPOUND, "H5Tget_class");
+ /* Cleanup */
ret = H5Tclose(dset2_tid);
CHECK_I(ret, "H5Tclose");
-
ret = H5Dclose(dataset2);
CHECK_I(ret, "H5Dclose");
-
- /* Cleanup */
ret = H5Sclose(space);
CHECK_I(ret, "H5Sclose");
ret = H5Tclose(s1_tid);
@@ -3838,7 +3836,7 @@ test_sohm(void)
{
MESSAGE(5, ("Testing Shared Object Header Messages\n"));
- test_sohm_fcpl(); /* Test SOHMs and file creation plists */
+ test_sohm_fcpl(); /* Test SOHMs and file creation plists */
test_sohm_fcpl_errors(); /* Bogus H5P* calls for SOHMs */
test_sohm_size1(); /* Tests the sizes of files with one SOHM */
#if 0 /* TODO: REVEALS BUG TO BE FIXED - SEE JIRA HDFFV-10645 */
@@ -3856,17 +3854,17 @@ test_sohm(void)
test_sohm_extend_dset(); /* Test extending shared datasets */
test_sohm_external_dtype(); /* Test using datatype in another file */
-} /* test_sohm() */
+} /* test_sohm */
/*-------------------------------------------------------------------------
- * Function: cleanup_sohm
+ * Function: cleanup_sohm
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: James Laird
+ * Programmer: James Laird
* October 9, 2006
*
* Modifications:
@@ -3876,8 +3874,8 @@ test_sohm(void)
void
cleanup_sohm(void)
{
- remove(FILENAME);
- remove(FILENAME_SRC);
- remove(FILENAME_DST);
+ HDremove(FILENAME);
+ HDremove(FILENAME_SRC);
+ HDremove(FILENAME_DST);
} /* cleanup_sohm */
diff --git a/test/ttime.c b/test/ttime.c
index 48c9ba8..5b3436d 100644
--- a/test/ttime.c
+++ b/test/ttime.c
@@ -178,13 +178,13 @@ test_time_io(void)
tid = H5Dget_type(dsid);
CHECK(tid, FAIL, "H5Dget_type");
if( H5Tget_class (tid) == H5T_TIME)
- fprintf(stderr,"datatype class is H5T_TIME\n");
+ HDfprintf(stderr,"datatype class is H5T_TIME\n");
status = H5Tclose (tid);
CHECK(status, FAIL, "H5Tclose");
status = H5Dread (dsid, H5T_UNIX_D32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &timethen);
CHECK(status, FAIL, "H5Dread");
-fprintf(stderr,"time written was: %s\n", HDctime(&timethen));
+HDfprintf(stderr,"time written was: %s\n", HDctime(&timethen));
status = H5Dclose(dsid);
CHECK(status, FAIL, "H5Dclose");
@@ -231,6 +231,6 @@ test_time(void)
void
cleanup_time(void)
{
- remove(DATAFILE);
+ HDremove(DATAFILE);
}
diff --git a/test/tunicode.c b/test/tunicode.c
index e0e1f24..b3fa237 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -163,7 +163,7 @@ void test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string)
/* Fill the buffer with two copies of the UTF-8 string, each with a
* terminating NULL. It will look like "abcdefg\0abcdefg\0". */
- strncpy(buf, new_string, big_len);
+ HDstrncpy(buf, new_string, big_len);
HDstrncpy(&buf[big_len], new_string, big_len);
ret = H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT);
@@ -774,15 +774,15 @@ void dump_string(const char * string)
size_t length;
size_t x;
- printf("The string was:\n %s", string);
- printf("Or in hex:\n");
+ HDprintf("The string was:\n %s", string);
+ HDprintf("Or in hex:\n");
length = HDstrlen(string);
for(x=0; x<length; x++)
- printf("%x ", string[x] & (0x000000FF));
+ HDprintf("%x ", string[x] & (0x000000FF));
- printf("\n");
+ HDprintf("\n");
}
/* Main test.
@@ -854,7 +854,7 @@ void test_unicode(void)
*/
void cleanup_unicode(void)
{
- remove(FILENAME);
+ HDremove(FILENAME);
}
diff --git a/test/tvlstr.c b/test/tvlstr.c
index 2c552eb..5f715ce 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -32,7 +32,7 @@
#define SPACE1_DIM1 4
#define NUMP 4
-#define VLSTR_TYPE "vl_string_type"
+#define VLSTR_TYPE "vl_string_type"
/* Definitions for the VL re-writing test */
#define REWRITE_NDATASETS 32
@@ -94,7 +94,7 @@ void test_vlstr_free_custom(void *_mem, void *info)
if(_mem!=NULL) {
mem=((unsigned char *)_mem)-extra;
- *mem_used-=*(size_t *)mem;
+ *mem_used-=*(size_t *)((void *)mem);
HDfree(mem);
} /* end if */
}
@@ -183,7 +183,7 @@ test_vlstrings_basic(void)
/* Count the actual number of bytes used by the strings */
for(i=0,str_used=0; i<SPACE1_DIM1; i++)
- str_used+=HDstrlen(wdata[i])+1;
+ str_used += HDstrlen(wdata[i])+1;
/* Compare against the strings actually written */
VERIFY(size,(hsize_t)str_used,"H5Dvlen_get_buf_size");
@@ -198,7 +198,7 @@ test_vlstrings_basic(void)
/* Compare data read in */
for(i = 0; i < SPACE1_DIM1; i++) {
if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
- TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
+ TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)HDstrlen(rdata[i]));
continue;
} /* end if */
if(HDstrcmp(wdata[i], rdata[i]) != 0 ) {
@@ -300,7 +300,7 @@ test_vlstrings_special(void)
/* Compare data read in */
for(i = 0; i < SPACE1_DIM1; i++) {
if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
- TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
+ TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)HDstrlen(rdata[i]));
continue;
} /* end if */
if((wdata[i] == NULL && rdata[i] != NULL) || (rdata[i] == NULL && wdata[i] != NULL)) {
@@ -527,7 +527,7 @@ test_compact_vlstring(void)
/* Compare data read in */
for(i = 0; i < SPACE1_DIM1; i++) {
if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
- TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
+ TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)HDstrlen(rdata[i]));
continue;
} /* end if */
if(HDstrcmp(wdata[i], rdata[i]) != 0) {
@@ -802,33 +802,33 @@ static void test_vl_rewrite(void)
/* Create in file 1 */
for(i=0; i<REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
write_scalar_dset(file1, type, space, name, name);
}
/* Effectively copy data from file 1 to 2 */
for(i=0; i<REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
read_scalar_dset(file1, type, space, name, name);
write_scalar_dset(file2, type, space, name, name);
}
/* Read back from file 2 */
for(i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
read_scalar_dset(file2, type, space, name, name);
} /* end for */
/* Remove from file 2. */
for(i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
ret = H5Ldelete(file2, name, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Ldelete");
} /* end for */
/* Effectively copy from file 1 to file 2 */
for(i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
read_scalar_dset(file1, type, space, name, name);
write_scalar_dset(file2, type, space, name, name);
} /* end for */
@@ -882,7 +882,7 @@ static void test_write_same_element(void)
dataset1 = H5Dcreate2(file1, DATASET, dtype, fspace, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dataset1, FAIL, "H5Dcreate2");
+ CHECK(dataset1, FAIL, "H5Dcreate");
ret = H5Dwrite(dataset1, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
@@ -906,7 +906,7 @@ static void test_write_same_element(void)
CHECK(file1, FAIL, "H5Fopen");
dataset1 = H5Dopen2(file1, DATASET, H5P_DEFAULT);
- CHECK(dataset1, FAIL, "H5Dopen2");
+ CHECK(dataset1, FAIL, "H5Dopen");
fspace = H5Dget_space(dataset1);
CHECK(fspace, FAIL, "H5Dget_space");
@@ -972,7 +972,6 @@ test_vlstrings(void)
test_write_same_element();
} /* test_vlstrings() */
-
/*-------------------------------------------------------------------------
* Function: cleanup_vlstrings
*
diff --git a/test/tvltypes.c b/test/tvltypes.c
index 91ef0c2..ffa2aff 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -88,7 +88,7 @@ void test_vltypes_free_custom(void *_mem, void *mem_used)
*/
unsigned char *mem = ((unsigned char *)_mem) - extra; /* Pointer to actual block allocated */
- *(size_t *)mem_used -= *(size_t *)mem;
+ *(size_t *)mem_used -= *(size_t *)((void *)mem);
HDfree(mem);
} /* end if */
}
@@ -1348,7 +1348,7 @@ test_vltypes_compound_vlstr(void)
} /* end if */
for(t1=(s2 *)(wdata[i].v.p), t2=(s2 *)(rdata[i].v.p), j=0; j<rdata[i].v.len; j++, t1++, t2++) {
- if( HDstrcmp(t1->string, t2->string) ) {
+ if(HDstrcmp(t1->string, t2->string)) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string);
continue;
} /* end if */
@@ -1406,7 +1406,7 @@ test_vltypes_compound_vlstr(void)
} /* end if */
for(t1=(s2 *)(wdata2[i].v.p), t2=(s2 *)(rdata2[i].v.p), j=0; j<rdata2[i].v.len; j++, t1++, t2++) {
- if( HDstrcmp(t1->string, t2->string) ) {
+ if(HDstrcmp(t1->string, t2->string)) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string);
continue;
} /* end if */
diff --git a/test/twriteorder.c b/test/twriteorder.c
index 4c86636..b104b72 100644
--- a/test/twriteorder.c
+++ b/test/twriteorder.c
@@ -25,7 +25,6 @@
* get the same data the write has written.
*
* Created: Albert Cheng, 2013/8/28.
-* Modified:
*************************************************************/
/***********************************************************
@@ -69,18 +68,18 @@
#ifdef H5_HAVE_FORK
#define DATAFILE "twriteorder.dat"
-/* #define READERS_MAX 10 */ /* max number of readers */
-#define BLOCKSIZE_DFT 1024 /* 1KB */
-#define PARTITION_DFT 2048 /* 2KB */
-#define NLINKEDBLOCKS_DFT 512 /* default 512 */
-#define SIZE_BLKADDR 4 /* expected sizeof blkaddr */
-#define Hgoto_error(val) {ret_value=val; goto done;}
+/* #define READERS_MAX 10 */ /* max number of readers */
+#define BLOCKSIZE_DFT 1024 /* 1KB */
+#define PARTITION_DFT 2048 /* 2KB */
+#define NLINKEDBLOCKS_DFT 512 /* default 512 */
+#define SIZE_BLKADDR 4 /* expected sizeof blkaddr */
+#define Hgoto_error(val) {ret_value=val; goto done;}
/* type declarations */
typedef enum part_t {
- UC_READWRITE =0, /* both writer and reader */
- UC_WRITER, /* writer only */
- UC_READER /* reader only */
+ UC_READWRITE = 0, /* both writer and reader */
+ UC_WRITER, /* writer only */
+ UC_READER /* reader only */
} part_t;
/* prototypes */
@@ -92,9 +91,9 @@ int setup_parameters(int argc, char * const argv[]);
int parse_option(int argc, char * const argv[]);
/* Global Variable definitions */
-const char *progname_g="twriteorder"; /* program name */
-int write_fd_g;
-int blocksize_g, part_size_g, nlinkedblock_g;
+const char *progname_g="twriteorder"; /* program name */
+int write_fd_g;
+int blocksize_g, part_size_g, nlinkedblock_g;
part_t launch_g;
/* Function definitions */
@@ -103,15 +102,15 @@ part_t launch_g;
void
usage(const char *prog)
{
- fprintf(stderr, "usage: %s [OPTIONS]\n", prog);
- fprintf(stderr, " OPTIONS\n");
- fprintf(stderr, " -h Print a usage message and exit\n");
- fprintf(stderr, " -l w|r launch writer or reader only. [default: launch both]\n");
- fprintf(stderr, " -b N Block size [default: %d]\n", BLOCKSIZE_DFT);
- fprintf(stderr, " -p N Partition size [default: %d]\n", PARTITION_DFT);
- fprintf(stderr, " -n N Number of linked blocks [default: %d]\n", NLINKEDBLOCKS_DFT);
- fprintf(stderr, " where N is an integer value\n");
- fprintf(stderr, "\n");
+ HDfprintf(stderr, "usage: %s [OPTIONS]\n", prog);
+ HDfprintf(stderr, " OPTIONS\n");
+ HDfprintf(stderr, " -h Print a usage message and exit\n");
+ HDfprintf(stderr, " -l w|r launch writer or reader only. [default: launch both]\n");
+ HDfprintf(stderr, " -b N Block size [default: %d]\n", BLOCKSIZE_DFT);
+ HDfprintf(stderr, " -p N Partition size [default: %d]\n", PARTITION_DFT);
+ HDfprintf(stderr, " -n N Number of linked blocks [default: %d]\n", NLINKEDBLOCKS_DFT);
+ HDfprintf(stderr, " where N is an integer value\n");
+ HDfprintf(stderr, "\n");
}
/* Setup test parameters by parsing command line options.
@@ -127,73 +126,73 @@ parse_option(int argc, char * const argv[])
/* suppress getopt from printing error */
opterr = 0;
- while (1){
- c = getopt (argc, argv, cmd_options);
- if (-1 == c)
- break;
- switch (c) {
- case 'h':
- usage(progname_g);
- exit(0);
- break;
- case 'b': /* number of planes to write/read */
- if ((blocksize_g = atoi(optarg)) <= 0){
- fprintf(stderr, "bad blocksize %s, must be a positive integer\n", optarg);
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case 'n': /* number of planes to write/read */
- if ((nlinkedblock_g = atoi(optarg)) < 2){
- fprintf(stderr, "bad number of linked blocks %s, must be greater than 1.\n", optarg);
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case 'p': /* number of planes to write/read */
- if ((part_size_g = atoi(optarg)) <= 0){
- fprintf(stderr, "bad partition size %s, must be a positive integer\n", optarg);
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case 'l': /* launch reader or writer only */
- switch (*optarg) {
- case 'r': /* reader only */
- launch_g = UC_READER;
- break;
- case 'w': /* writer only */
- launch_g = UC_WRITER;
- break;
- default:
- fprintf(stderr, "launch value(%c) should be w or r only.\n", *optarg);
- usage(progname_g);
- Hgoto_error(-1);
- break;
- }
- printf("launch = %d\n", launch_g);
- break;
- case '?':
- fprintf(stderr, "getopt returned '%c'.\n", c);
- usage(progname_g);
- Hgoto_error(-1);
- default:
- fprintf(stderr, "getopt returned unexpected value.\n");
- fprintf(stderr, "Unexpected value is %d\n", c);
- Hgoto_error(-1);
- }
- }
+ while (1) {
+ c = getopt (argc, argv, cmd_options);
+ if (-1 == c)
+ break;
+
+ switch (c) {
+ case 'h':
+ usage(progname_g);
+ HDexit(EXIT_SUCCESS);
+ break;
+ case 'b': /* number of planes to write/read */
+ if ((blocksize_g = atoi(optarg)) <= 0) {
+ HDfprintf(stderr, "bad blocksize %s, must be a positive integer\n", optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case 'n': /* number of planes to write/read */
+ if ((nlinkedblock_g = atoi(optarg)) < 2) {
+ HDfprintf(stderr, "bad number of linked blocks %s, must be greater than 1.\n", optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case 'p': /* number of planes to write/read */
+ if ((part_size_g = atoi(optarg)) <= 0) {
+ HDfprintf(stderr, "bad partition size %s, must be a positive integer\n", optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case 'l': /* launch reader or writer only */
+ switch (*optarg) {
+ case 'r': /* reader only */
+ launch_g = UC_READER;
+ break;
+ case 'w': /* writer only */
+ launch_g = UC_WRITER;
+ break;
+ default:
+ HDfprintf(stderr, "launch value(%c) should be w or r only.\n", *optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ break;
+ } /* end inner switch */
+ HDprintf("launch = %d\n", launch_g);
+ break;
+ case '?':
+ HDfprintf(stderr, "getopt returned '%c'.\n", c);
+ usage(progname_g);
+ Hgoto_error(-1);
+ default:
+ HDfprintf(stderr, "getopt returned unexpected value.\n");
+ HDfprintf(stderr, "Unexpected value is %d\n", c);
+ Hgoto_error(-1);
+ } /* end outer switch */
+ } /* end while */
/* verify partition size must be >= blocksize */
if (part_size_g < blocksize_g ){
- fprintf(stderr, "Blocksize %d should not be bigger than partition size %d\n",
- blocksize_g, part_size_g);
- Hgoto_error(-1);
+ HDfprintf(stderr, "Blocksize %d should not be bigger than partition size %d\n", blocksize_g, part_size_g);
+ Hgoto_error(-1);
}
done:
/* All done. */
- return(ret_value);
+ return ret_value;
}
/* Setup parameters for the test case.
@@ -209,15 +208,16 @@ int setup_parameters(int argc, char * const argv[])
/* parse options */
if (parse_option(argc, argv) < 0){
- return(-1);
+ return -1;
}
/* show parameters and return */
- printf("blocksize = %ld\n", (long)blocksize_g);
- printf("part_size = %ld\n", (long)part_size_g);
- printf("nlinkedblock = %ld\n", (long)nlinkedblock_g);
- printf("launch = %d\n", launch_g);
- return(0);
+ HDprintf("blocksize = %ld\n", (long)blocksize_g);
+ HDprintf("part_size = %ld\n", (long)part_size_g);
+ HDprintf("nlinkedblock = %ld\n", (long)nlinkedblock_g);
+ HDprintf("launch = %d\n", launch_g);
+
+ return 0;
}
/* Create the test file with initial "empty" file, that is,
@@ -227,19 +227,19 @@ int setup_parameters(int argc, char * const argv[])
*/
int create_wo_file(void)
{
- int blkaddr=0; /* blkaddress of next linked block */
- int ret_code;
+ int blkaddr = 0; /* blkaddress of next linked block */
+ h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */
/* Create the data file */
if ((write_fd_g = HDopen(DATAFILE, O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) {
HDprintf("WRITER: error from open\n");
return -1;
}
- blkaddr=0;
+ blkaddr = 0;
/* write it to partition 0 */
- if ((ret_code=HDwrite(write_fd_g, &blkaddr, (size_t)SIZE_BLKADDR)) != SIZE_BLKADDR){
- printf("blkaddr write failed\n");
- return -1;
+ if ((bytes_wrote = HDwrite(write_fd_g, &blkaddr, (size_t)SIZE_BLKADDR)) != SIZE_BLKADDR){
+ HDprintf("blkaddr write failed\n");
+ return -1;
}
/* File initialized, return success */
@@ -252,38 +252,45 @@ int write_wo_file(void)
int blkaddr_old=0;
int i;
char buffer[BLOCKSIZE_DFT];
- int ret_code;
+ h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */
/* write block 1, 2, ... */
- for (i=1; i<nlinkedblock_g; i++){
- /* calculate where to write this block */
- blkaddr = i*part_size_g + i;
- /* store old block address in byte 0-3 */
- HDmemcpy(&buffer[0], &blkaddr_old, sizeof(blkaddr_old));
- /* fill the rest with the lowest byte of i */
- HDmemset(&buffer[4], i & 0xff, (size_t) (BLOCKSIZE_DFT-4));
- /* write the block */
+ for (i = 1; i < nlinkedblock_g; i++) {
+
+ /* calculate where to write this block */
+ blkaddr = i * part_size_g + i;
+
+ /* store old block address in byte 0-3 */
+ HDmemcpy(&buffer[0], &blkaddr_old, sizeof(blkaddr_old));
+
+ /* fill the rest with the lowest byte of i */
+ HDmemset(&buffer[4], i & 0xff, (size_t) (BLOCKSIZE_DFT-4));
+
+ /* write the block */
#ifdef DEBUG
- printf("writing block at %d\n", blkaddr);
+ HDprintf("writing block at %d\n", blkaddr);
#endif
- HDlseek(write_fd_g, (HDoff_t)blkaddr, SEEK_SET);
- if ((ret_code=HDwrite(write_fd_g, buffer, (size_t)blocksize_g)) != blocksize_g){
- printf("blkaddr write failed in partition %d\n", i);
- return -1;
- }
- blkaddr_old = blkaddr;
- }
+ HDlseek(write_fd_g, (HDoff_t)blkaddr, SEEK_SET);
+ if ((bytes_wrote = HDwrite(write_fd_g, buffer, (size_t)blocksize_g)) != blocksize_g){
+ HDprintf("blkaddr write failed in partition %d\n", i);
+ return -1;
+ }
+
+ blkaddr_old = blkaddr;
+
+ } /* end for */
+
/* write the last blkaddr in partition 0 */
HDlseek(write_fd_g, (HDoff_t)0, SEEK_SET);
- if ((ret_code=HDwrite(write_fd_g, &blkaddr_old, (size_t)sizeof(blkaddr_old))) != sizeof(blkaddr_old)){
- printf("blkaddr write failed in partition %d\n", 0);
- return -1;
+ if ((bytes_wrote = HDwrite(write_fd_g, &blkaddr_old, (size_t)sizeof(blkaddr_old))) != sizeof(blkaddr_old)){
+ HDprintf("blkaddr write failed in partition %d\n", 0);
+ return -1;
}
/* all writes done. return succeess. */
#ifdef DEBUG
- printf("wrote %d blocks\n", nlinkedblock_g);
+ HDprintf("wrote %d blocks\n", nlinkedblock_g);
#endif
return 0;
}
@@ -291,9 +298,9 @@ int write_wo_file(void)
int read_wo_file(void)
{
int read_fd;
- int blkaddr=0;
- int ret_code;
- int linkedblocks_read=0;
+ int blkaddr = 0;
+ h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */
+ int linkedblocks_read = 0;
char buffer[BLOCKSIZE_DFT];
/* Open the data file */
@@ -301,36 +308,38 @@ int read_wo_file(void)
HDprintf("READER: error from open\n");
return -1;
}
+
/* keep reading the initial block address until it is non-zero before proceeding. */
- while (blkaddr == 0){
- HDlseek(read_fd, (HDoff_t)0, SEEK_SET);
- if ((ret_code=HDread(read_fd, &blkaddr, (size_t)sizeof(blkaddr))) != sizeof(blkaddr)){
- printf("blkaddr read failed in partition %d\n", 0);
- return -1;
- }
+ while (blkaddr == 0) {
+ HDlseek(read_fd, (HDoff_t)0, SEEK_SET);
+ if ((bytes_read = HDread(read_fd, &blkaddr, (size_t)sizeof(blkaddr))) != sizeof(blkaddr)) {
+ HDprintf("blkaddr read failed in partition %d\n", 0);
+ return -1;
+ }
}
linkedblocks_read++;
/* got a non-zero blkaddr. Proceed down the linked blocks. */
#ifdef DEBUG
- printf("got initial block address=%d\n", blkaddr);
+ HDprintf("got initial block address=%d\n", blkaddr);
#endif
- while (blkaddr != 0){
- HDlseek(read_fd, (HDoff_t)blkaddr, SEEK_SET);
- if ((ret_code=HDread(read_fd, buffer, (size_t)blocksize_g)) != blocksize_g){
- printf("blkaddr read failed in partition %d\n", 0);
- return -1;
- }
- linkedblocks_read++;
- /* retrieve the block address in byte 0-3 */
- HDmemcpy(&blkaddr, &buffer[0], sizeof(blkaddr));
+ while (blkaddr != 0) {
+ HDlseek(read_fd, (HDoff_t)blkaddr, SEEK_SET);
+ if ((bytes_read = HDread(read_fd, buffer, (size_t)blocksize_g)) != blocksize_g){
+ HDprintf("blkaddr read failed in partition %d\n", 0);
+ return -1;
+ }
+ linkedblocks_read++;
+
+ /* retrieve the block address in byte 0-3 */
+ HDmemcpy(&blkaddr, &buffer[0], sizeof(blkaddr));
#ifdef DEBUG
- printf("got next block address=%d\n", blkaddr);
+ HDprintf("got next block address=%d\n", blkaddr);
#endif
}
#ifdef DEBUG
- printf("read %d blocks\n", linkedblocks_read);
+ HDprintf("read %d blocks\n", linkedblocks_read);
#endif
return 0;
}
@@ -351,13 +360,13 @@ main(int argc, char *argv[])
pid_t childpid=0;
int child_ret_value;
pid_t mypid, tmppid;
- int child_status;
+ int child_status;
int child_wait_option=0;
int ret_value = 0;
/* initialization */
if (setup_parameters(argc, argv) < 0){
- Hgoto_error(1);
+ Hgoto_error(1);
}
/* ==============================================================*/
@@ -368,41 +377,43 @@ main(int argc, char *argv[])
/* ============*/
/* Create file */
/* ============*/
- if (launch_g != UC_READER){
- printf("Creating skeleton data file for test...\n");
- if (create_wo_file() < 0){
- fprintf(stderr, "***encounter error\n");
- Hgoto_error(1);
- }else
- printf("File created.\n");
+ if (launch_g != UC_READER) {
+ HDprintf("Creating skeleton data file for test...\n");
+ if (create_wo_file() < 0) {
+ HDfprintf(stderr, "***encounter error\n");
+ Hgoto_error(1);
+ }
+ else
+ HDprintf("File created.\n");
}
/* flush output before possible fork */
HDfflush(stdout);
- if (launch_g==UC_READWRITE){
- /* fork process */
- if((childpid = fork()) < 0) {
- perror("fork");
- Hgoto_error(1);
- };
+ if (launch_g==UC_READWRITE) {
+ /* fork process */
+ if((childpid = HDfork()) < 0) {
+ HDperror("fork");
+ Hgoto_error(1);
+ };
};
mypid = getpid();
/* ============= */
/* launch reader */
/* ============= */
- if (launch_g != UC_WRITER){
- /* child process launch the reader */
- if(0 == childpid) {
- printf("%d: launch reader process\n", mypid);
- if (read_wo_file() < 0){
- fprintf(stderr, "read_wo_file encountered error\n");
- exit(1);
- }
- /* Reader is done. Clean up by removing the data file */
- HDremove(DATAFILE);
- exit(0);
- }
+ if (launch_g != UC_WRITER) {
+ /* child process launch the reader */
+ if(0 == childpid) {
+ HDprintf("%d: launch reader process\n", mypid);
+ if (read_wo_file() < 0) {
+ HDfprintf(stderr, "read_wo_file encountered error\n");
+ HDexit(EXIT_FAILURE);
+ }
+
+ /* Reader is done. Clean up by removing the data file */
+ HDremove(DATAFILE);
+ HDexit(EXIT_SUCCESS);
+ }
}
/* ============= */
@@ -410,42 +421,43 @@ main(int argc, char *argv[])
/* ============= */
/* this process continues to launch the writer */
#ifdef DEBUG
- printf("%d: continue as the writer process\n", mypid);
+ HDprintf("%d: continue as the writer process\n", mypid);
#endif
- if (write_wo_file() < 0){
- fprintf(stderr, "write_wo_file encountered error\n");
- Hgoto_error(1);
+ if (write_wo_file() < 0) {
+ HDfprintf(stderr, "write_wo_file encountered error\n");
+ Hgoto_error(1);
}
/* ================================================ */
/* If readwrite, collect exit code of child process */
/* ================================================ */
- if (launch_g == UC_READWRITE){
- if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0){
- perror("waitpid");
- Hgoto_error(1);
- }
- if (WIFEXITED(child_status)){
- if ((child_ret_value=WEXITSTATUS(child_status)) != 0){
- printf("%d: child process exited with non-zero code (%d)\n",
- mypid, child_ret_value);
- Hgoto_error(2);
- }
- } else {
- printf("%d: child process terminated abnormally\n", mypid);
- Hgoto_error(2);
- }
+ if (launch_g == UC_READWRITE) {
+ if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) {
+ HDperror("waitpid");
+ Hgoto_error(1);
+ }
+ if (WIFEXITED(child_status)) {
+ if ((child_ret_value=WEXITSTATUS(child_status)) != 0) {
+ HDprintf("%d: child process exited with non-zero code (%d)\n", mypid, child_ret_value);
+ Hgoto_error(2);
+ }
+ }
+ else {
+ HDprintf("%d: child process terminated abnormally\n", mypid);
+ Hgoto_error(2);
+ }
}
done:
/* Print result and exit */
if (ret_value != 0){
- printf("Error(s) encountered\n");
- }else{
- printf("All passed\n");
+ HDprintf("Error(s) encountered\n");
+ }
+ else {
+ HDprintf("All passed\n");
}
- return(ret_value);
+ return ret_value;
}
#else /* H5_HAVE_FORK */
diff --git a/test/unlink.c b/test/unlink.c
index 2a7bbcd..6825dec 100644
--- a/test/unlink.c
+++ b/test/unlink.c
@@ -15,16 +15,16 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Friday, September 25, 1998
*
- * Purpose: Test unlinking operations.
+ * Purpose: Test unlinking operations.
*/
-#define H5G_FRIEND /*suppress error about including H5Gpkg */
+#define H5G_FRIEND /*suppress error about including H5Gpkg */
/* Define this macro to indicate that the testing APIs should be available */
#define H5G_TESTING
#include "h5test.h"
-#include "H5Gpkg.h" /* Groups */
+#include "H5Gpkg.h" /* Groups */
const char *FILENAME[] = {
"unlink",
@@ -77,18 +77,18 @@ const char *FILENAME[] = {
#define FULL_GROUP_EST_NUM_ENTRIES 8
#define FULL_GROUP_EST_ENTRY_LEN 9
-
+
/*-------------------------------------------------------------------------
- * Function: test_one
+ * Function: test_one
*
- * Purpose: Creates a group that has just one entry and then unlinks that
- * entry.
+ * Purpose: Creates a group that has just one entry and then unlinks that
+ * entry.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, September 25, 1998
*
* Modifications:
@@ -98,8 +98,8 @@ const char *FILENAME[] = {
static int
test_one(hid_t file)
{
- hid_t work = -1, grp = -1;
- herr_t status;
+ hid_t work = -1, grp = -1;
+ herr_t status;
/* Create a test group */
if((work = H5Gcreate2(file, "/test_one", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -122,10 +122,10 @@ test_one(hid_t file)
TESTING("unlink without a name");
if((grp = H5Gcreate2(work, "foo", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
H5E_BEGIN_TRY {
- status = H5Ldelete(grp, ".", H5P_DEFAULT);
+ status = H5Ldelete(grp, ".", H5P_DEFAULT);
} H5E_END_TRY;
if(status>=0)
- FAIL_PUTS_ERROR(" Unlinking object w/o a name should have failed.")
+ FAIL_PUTS_ERROR(" Unlinking object w/o a name should have failed.")
if(H5Gclose(grp) < 0) FAIL_STACK_ERROR
/* Cleanup */
@@ -136,23 +136,23 @@ test_one(hid_t file)
error:
H5E_BEGIN_TRY {
- H5Gclose(work);
- H5Gclose(grp);
+ H5Gclose(work);
+ H5Gclose(grp);
} H5E_END_TRY;
return 1;
} /* end test_one() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_many
+ * Function: test_many
*
- * Purpose: Tests many unlinks in a single directory.
+ * Purpose: Tests many unlinks in a single directory.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, September 25, 1998
*
* Modifications:
@@ -162,10 +162,10 @@ test_one(hid_t file)
static int
test_many(hid_t file)
{
- hid_t work=-1, grp=-1;
- int i;
- const int how_many=500;
- char name[32];
+ hid_t work=-1, grp=-1;
+ int i;
+ const int how_many=500;
+ char name[32];
/* Create a test group */
if((work = H5Gcreate2(file, "/test_many", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
@@ -175,54 +175,54 @@ test_many(hid_t file)
/* Create a bunch of names and unlink them in order */
TESTING("forward unlink");
for(i = 0; i < how_many; i++) {
- sprintf(name, "obj_%05d", i);
- if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ HDsprintf(name, "obj_%05d", i);
+ if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
for(i = 0; i < how_many; i++) {
- sprintf(name, "obj_%05d", i);
- if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ HDsprintf(name, "obj_%05d", i);
+ if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
PASSED();
/* Create a bunch of names and unlink them in reverse order */
TESTING("backward unlink");
for(i = 0; i < how_many; i++) {
- sprintf(name, "obj_%05d", i);
- if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ HDsprintf(name, "obj_%05d", i);
+ if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
for(i = (how_many - 1); i >= 0; --i) {
- sprintf(name, "obj_%05d", i);
- if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ HDsprintf(name, "obj_%05d", i);
+ if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
PASSED();
/* Create a bunch of names and unlink them from both directions */
TESTING("inward unlink");
for(i = 0; i < how_many; i++) {
- sprintf(name, "obj_%05d", i);
- if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ HDsprintf(name, "obj_%05d", i);
+ if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
for(i = 0; i < how_many; i++) {
- if(i % 2)
- sprintf(name, "obj_%05d", how_many - (1 + i / 2));
- else
- sprintf(name, "obj_%05d", i / 2);
- if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(i % 2)
+ HDsprintf(name, "obj_%05d", how_many - (1 + i / 2));
+ else
+ HDsprintf(name, "obj_%05d", i / 2);
+ if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
PASSED();
/* Create a bunch of names and unlink them from the midle */
TESTING("outward unlink");
for(i = 0; i < how_many; i++) {
- sprintf(name, "obj_%05d", i);
- if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ HDsprintf(name, "obj_%05d", i);
+ if(H5Lcreate_hard(work, "/test_many_foo", H5L_SAME_LOC, name, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
for(i = (how_many - 1); i >= 0; --i) {
- if(i % 2)
- sprintf(name, "obj_%05d", how_many - (1 + i / 2));
- else
- sprintf(name, "obj_%05d", i / 2);
- if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(i % 2)
+ HDsprintf(name, "obj_%05d", how_many - (1 + i / 2));
+ else
+ HDsprintf(name, "obj_%05d", i / 2);
+ if(H5Ldelete(work, name, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
PASSED();
@@ -233,23 +233,23 @@ test_many(hid_t file)
error:
H5E_BEGIN_TRY {
- H5Gclose(work);
- H5Gclose(grp);
+ H5Gclose(work);
+ H5Gclose(grp);
} H5E_END_TRY;
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_symlink
+ * Function: test_symlink
*
- * Purpose: Tests removal of symbolic links.
+ * Purpose: Tests removal of symbolic links.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, September 25, 1998
*
*-------------------------------------------------------------------------
@@ -257,7 +257,7 @@ test_many(hid_t file)
static int
test_symlink(hid_t file)
{
- hid_t work=-1;
+ hid_t work=-1;
TESTING("symlink removal");
@@ -274,22 +274,22 @@ test_symlink(hid_t file)
error:
H5E_BEGIN_TRY {
- H5Gclose(work);
+ H5Gclose(work);
} H5E_END_TRY;
return 1;
} /* end test_symlink() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_rename
+ * Function: test_rename
*
- * Purpose: Tests H5Lmove()
+ * Purpose: Tests H5Lmove()
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, September 25, 1998
*
* Modifications:
@@ -299,7 +299,7 @@ error:
static int
test_rename(hid_t file)
{
- hid_t work=-1, foo=-1, inner=-1;
+ hid_t work=-1, foo=-1, inner=-1;
/* Create a test group and rename something */
TESTING("object renaming");
@@ -326,14 +326,14 @@ test_rename(hid_t file)
error:
H5E_BEGIN_TRY {
- H5Gclose(work);
- H5Gclose(foo);
- H5Gclose(inner);
+ H5Gclose(work);
+ H5Gclose(foo);
+ H5Gclose(inner);
} H5E_END_TRY;
return 1;
} /* end test_rename() */
-
+
/*-------------------------------------------------------------------------
* Function: test_new_move
*
@@ -353,9 +353,9 @@ error:
static int
test_new_move(hid_t fapl)
{
- hid_t file_a, file_b=(-1);
- hid_t grp_1=(-1), grp_2=(-1), grp_move=(-1), moved_grp=(-1);
- char filename[1024];
+ hid_t file_a, file_b=(-1);
+ hid_t grp_1=(-1), grp_2=(-1), grp_move=(-1), moved_grp=(-1);
+ char filename[1024];
TESTING("new move");
@@ -403,17 +403,17 @@ test_new_move(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Gclose(grp_1);
- H5Gclose(grp_2);
- H5Gclose(grp_move);
+ H5Gclose(grp_1);
+ H5Gclose(grp_2);
+ H5Gclose(grp_move);
H5Gclose(moved_grp);
- H5Fclose(file_a);
- H5Fclose(file_b);
+ H5Fclose(file_a);
+ H5Fclose(file_b);
} H5E_END_TRY;
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: check_new_move
*
@@ -433,10 +433,10 @@ test_new_move(hid_t fapl)
static int
check_new_move(hid_t fapl)
{
- hid_t file;
- H5O_info_t oi_hard1, oi_hard2;
- char filename[1024];
- char linkval[1024];
+ hid_t file;
+ H5O_info_t oi_hard1, oi_hard2;
+ char filename[1024];
+ char linkval[1024];
TESTING("check new move function");
@@ -473,7 +473,7 @@ error:
return 1;
} /* end check_new_move() */
-
+
/*-------------------------------------------------------------------------
* Function: test_filespace
*
@@ -492,21 +492,21 @@ error:
static int
test_filespace(hid_t fapl)
{
- hid_t fapl_nocache; /* File access property list with raw data cache turned off */
- hid_t contig_dcpl; /* Dataset creation property list for contiguous dataset */
- hid_t early_chunk_dcpl; /* Dataset creation property list for chunked dataset & early allocation */
- hid_t late_chunk_dcpl; /* Dataset creation property list for chunked dataset & late allocation */
- hid_t comp_dcpl; /* Dataset creation property list for compressed, chunked dataset */
- hid_t compact_dcpl; /* Dataset creation property list for compact dataset */
- hid_t file; /* File ID */
- hid_t group, group2; /* Group IDs */
- hid_t dataset, dataset2; /* Dataset IDs */
- hid_t space; /* Dataspace ID */
- hid_t type; /* Datatype ID */
- hid_t attr_space; /* Dataspace ID for attributes */
- hid_t attr; /* Attribute ID */
- char filename[1024]; /* Name of file to create */
- char objname[128]; /* Name of object to create */
+ hid_t fapl_nocache; /* File access property list with raw data cache turned off */
+ hid_t contig_dcpl; /* Dataset creation property list for contiguous dataset */
+ hid_t early_chunk_dcpl; /* Dataset creation property list for chunked dataset & early allocation */
+ hid_t late_chunk_dcpl; /* Dataset creation property list for chunked dataset & late allocation */
+ hid_t comp_dcpl; /* Dataset creation property list for compressed, chunked dataset */
+ hid_t compact_dcpl; /* Dataset creation property list for compact dataset */
+ hid_t file; /* File ID */
+ hid_t group, group2; /* Group IDs */
+ hid_t dataset, dataset2; /* Dataset IDs */
+ hid_t space; /* Dataspace ID */
+ hid_t type; /* Datatype ID */
+ hid_t attr_space; /* Dataspace ID for attributes */
+ hid_t attr; /* Attribute ID */
+ char filename[1024]; /* Name of file to create */
+ char objname[128]; /* Name of object to create */
hsize_t dims[FILESPACE_NDIMS]= {FILESPACE_DIM0, FILESPACE_DIM1, FILESPACE_DIM2}; /* Dataset dimensions */
hsize_t chunk_dims[FILESPACE_NDIMS]= {FILESPACE_CHUNK0, FILESPACE_CHUNK1, FILESPACE_CHUNK2}; /* Chunk dimensions */
hsize_t attr_dims[FILESPACE_ATTR_NDIMS]= {FILESPACE_ATTR_DIM0, FILESPACE_ATTR_DIM1}; /* Attribute dimensions */
@@ -514,7 +514,7 @@ test_filespace(hid_t fapl)
int *tmp_data; /* Temporary pointer to dataset buffer */
h5_stat_size_t empty_size; /* Size of an empty file */
h5_stat_size_t file_size; /* Size of each file created */
- herr_t status; /* Function status return value */
+ herr_t status; /* Function status return value */
unsigned u,v,w; /* Local index variables */
/* Metadata cache parameters */
@@ -806,7 +806,7 @@ test_filespace(hid_t fapl)
/* Alternate adding attributes to each one */
for(u = 0; u < FILESPACE_NATTR; u++) {
/* Set the name of the attribute to create */
- sprintf(objname,"%s %u",ATTRNAME,u);
+ HDsprintf(objname,"%s %u",ATTRNAME,u);
/* Create an attribute on the first dataset */
if((attr = H5Acreate2(dataset, objname, H5T_NATIVE_INT, attr_space, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -912,7 +912,7 @@ test_filespace(hid_t fapl)
/* Create a many groups to remove */
for(u = 0; u < UNLINK_NGROUPS; u++) {
- sprintf(objname, "%s %u", GROUPNAME, u);
+ HDsprintf(objname, "%s %u", GROUPNAME, u);
if((group = H5Gcreate2(file, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Gclose(group) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -920,7 +920,7 @@ test_filespace(hid_t fapl)
/* Remove the all the groups */
/* (Remove them in reverse order just to make file size calculation easier -QAK) */
for(u = UNLINK_NGROUPS; u > 0; u--) {
- sprintf(objname, "%s %u", GROUPNAME, (u - 1));
+ HDsprintf(objname, "%s %u", GROUPNAME, (u - 1));
if(H5Ldelete(file, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -975,19 +975,19 @@ test_filespace(hid_t fapl)
/* Create a complex group hierarchy to remove */
for(u = 0; u < FILESPACE_TOP_GROUPS; u++) {
/* Create group */
- sprintf(objname,"%s %u",GROUPNAME,u);
+ HDsprintf(objname,"%s %u",GROUPNAME,u);
if((group = H5Gcreate2(file, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Create nested groups inside top groups */
for(v = 0; v < FILESPACE_NESTED_GROUPS; v++) {
/* Create group */
- sprintf(objname, "%s %u", GROUP2NAME, v);
+ HDsprintf(objname, "%s %u", GROUP2NAME, v);
if((group2 = H5Gcreate2(group, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Create datasets inside nested groups */
for(w = 0; w < FILESPACE_NDATASETS; w++) {
/* Create & close a dataset */
- sprintf(objname, "%s %u", DATASETNAME, w);
+ HDsprintf(objname, "%s %u", DATASETNAME, w);
if((dataset = H5Dcreate2(group2, objname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -1004,19 +1004,19 @@ test_filespace(hid_t fapl)
/* (Remove them in reverse order just to make file size calculation easier -QAK) */
for(u = FILESPACE_TOP_GROUPS; u > 0; u--) {
/* Open group */
- sprintf(objname, "%s %u", GROUPNAME, (u - 1));
+ HDsprintf(objname, "%s %u", GROUPNAME, (u - 1));
if((group = H5Gopen2(file, objname, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Open nested groups inside top groups */
for(v = 0; v < FILESPACE_NESTED_GROUPS; v++) {
/* Create group */
- sprintf(objname, "%s %u", GROUP2NAME, v);
+ HDsprintf(objname, "%s %u", GROUP2NAME, v);
if((group2 = H5Gopen2(group, objname, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Remove datasets inside nested groups */
for(w = 0; w < FILESPACE_NDATASETS; w++) {
/* Remove dataset */
- sprintf(objname, "%s %u", DATASETNAME, w);
+ HDsprintf(objname, "%s %u", DATASETNAME, w);
if(H5Ldelete(group2, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -1024,7 +1024,7 @@ test_filespace(hid_t fapl)
if(H5Gclose(group2) < 0) FAIL_STACK_ERROR
/* Remove nested group */
- sprintf(objname, "%s %u",GROUP2NAME, v);
+ HDsprintf(objname, "%s %u",GROUP2NAME, v);
if(H5Ldelete(group, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -1032,7 +1032,7 @@ test_filespace(hid_t fapl)
if(H5Gclose(group) < 0) FAIL_STACK_ERROR
/* Remove top group */
- sprintf(objname, "%s %u", GROUPNAME, (u - 1));
+ HDsprintf(objname, "%s %u", GROUPNAME, (u - 1));
if(H5Ldelete(file, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -1232,7 +1232,7 @@ error:
return 1;
} /* end test_filespace() */
-
+
/*-------------------------------------------------------------------------
* Function: test_create_unlink
*
@@ -1251,10 +1251,10 @@ error:
static int
test_create_unlink(const char *msg, hid_t fapl)
{
- hid_t file, group;
+ hid_t file, group;
unsigned u;
- char groupname[1024];
- char filename[1024];
+ char groupname[1024];
+ char filename[1024];
TESTING(msg);
@@ -1265,25 +1265,25 @@ test_create_unlink(const char *msg, hid_t fapl)
/* Create a many groups to remove */
for(u = 0; u < UNLINK_NGROUPS; u++) {
- sprintf(groupname, "%s %u", GROUPNAME, u);
+ HDsprintf(groupname, "%s %u", GROUPNAME, u);
if((group = H5Gcreate2(file, groupname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf("group %s creation failed\n", groupname);
+ HDprintf("group %s creation failed\n", groupname);
goto error;
} /* end if */
if(H5Gclose (group) < 0) {
H5_FAILED();
- printf("closing group %s failed\n", groupname);
+ HDprintf("closing group %s failed\n", groupname);
goto error;
} /* end if */
} /* end for */
/* Remove the all the groups */
for(u = 0; u < UNLINK_NGROUPS; u++) {
- sprintf(groupname, "%s %u", GROUPNAME, u);
+ HDsprintf(groupname, "%s %u", GROUPNAME, u);
if(H5Ldelete(file, groupname, H5P_DEFAULT) < 0) {
H5_FAILED();
- printf("Unlinking group %s failed\n", groupname);
+ HDprintf("Unlinking group %s failed\n", groupname);
goto error;
} /* end if */
} /* end for */
@@ -1299,7 +1299,7 @@ error:
return 1;
} /* end test_create_unlink() */
-
+
/*-------------------------------------------------------------------------
* Function: test_link_slashes
*
@@ -1320,7 +1320,7 @@ test_link_slashes(hid_t fapl)
{
hid_t fid; /* File ID */
hid_t gid, gid2; /* Group ID */
- char filename[1024];
+ char filename[1024];
TESTING("creating links with multiple slashes");
@@ -1367,7 +1367,7 @@ error:
return 1;
} /* end test_link_slashes() */
-
+
/*-------------------------------------------------------------------------
* Function: test_unlink_slashes
*
@@ -1388,7 +1388,7 @@ test_unlink_slashes(hid_t fapl)
{
hid_t fid; /* File ID */
hid_t gid; /* Group ID */
- char filename[1024];
+ char filename[1024];
TESTING("deleting links with multiple slashes");
@@ -1464,7 +1464,7 @@ delete_node(hid_t pid, hid_t id)
return(0);
}
-
+
/*-------------------------------------------------------------------------
* Function: test_unlink_rightleaf
*
@@ -1499,14 +1499,14 @@ test_unlink_rightleaf(hid_t fid)
/* Create all the groups */
for (n = 0; n < ngroups; n++) {
- sprintf(name, "Zone%d", n + 1);
+ HDsprintf(name, "Zone%d", n + 1);
if((gids[n] = H5Gcreate2(rootid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
} /* end for */
/* Unlink & re-create each group */
for (n = 0; n < ngroups; n++) {
if(delete_node (rootid, gids[n]) < 0) TEST_ERROR
- sprintf(name, "Zone%d", n + 1);
+ HDsprintf(name, "Zone%d", n + 1);
if((gids[n] = H5Gcreate2(rootid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
} /* end for */
@@ -1543,7 +1543,7 @@ error:
return 1;
} /* end test_unlink_rightleaf() */
-
+
/*-------------------------------------------------------------------------
* Function: test_unlink_rightnode
*
@@ -1578,7 +1578,7 @@ test_unlink_rightnode(hid_t fid)
/* Create all the groups */
for (n = 0; n < ngroups; n++) {
- sprintf(name, "ZoneB%d", n + 1);
+ HDsprintf(name, "ZoneB%d", n + 1);
if((gids[n] = H5Gcreate2(rootid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -1622,7 +1622,7 @@ error:
return 1;
} /* end test_unlink_rightnode() */
-
+
/*-------------------------------------------------------------------------
* Function: test_unlink_middlenode
*
@@ -1657,7 +1657,7 @@ test_unlink_middlenode(hid_t fid)
/* Create all the groups */
for (n = 0; n < ngroups; n++) {
- sprintf(name, "ZoneC%d", n + 1);
+ HDsprintf(name, "ZoneC%d", n + 1);
if((gids[n] = H5Gcreate2(rootid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -1844,7 +1844,7 @@ error:
return 1;
} /* end test_unlink_middlenode() */
-
+
/*-------------------------------------------------------------------------
* Function: test_resurrect_dataset
*
@@ -1865,7 +1865,7 @@ static int
test_resurrect_dataset(hid_t fapl)
{
hid_t f = -1, s = -1, d = -1;
- char filename[1024];
+ char filename[1024];
TESTING("resurrecting dataset after deletion");
@@ -1908,14 +1908,14 @@ test_resurrect_dataset(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Sclose(s);
- H5Dclose(d);
- H5Fclose(f);
+ H5Sclose(s);
+ H5Dclose(d);
+ H5Fclose(f);
} H5E_END_TRY;
return 1;
} /* end test_resurrect_dataset() */
-
+
/*-------------------------------------------------------------------------
* Function: test_resurrect_datatype
*
@@ -1978,13 +1978,13 @@ test_resurrect_datatype(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Tclose(type);
- H5Fclose(file);
+ H5Tclose(type);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* end test_resurrect_datatype() */
-
+
/*-------------------------------------------------------------------------
* Function: test_resurrect_group
*
@@ -2046,13 +2046,13 @@ test_resurrect_group(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Gclose(group);
- H5Fclose(file);
+ H5Gclose(group);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* end test_resurrect_group() */
-
+
/*-------------------------------------------------------------------------
* Function: test_unlink_chunked_dataset
*
@@ -2129,15 +2129,15 @@ test_unlink_chunked_dataset(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Pclose(dcpl_id);
- H5Sclose(space_id);
- H5Dclose(dset_id);
- H5Fclose(file_id);
+ H5Pclose(dcpl_id);
+ H5Sclose(space_id);
+ H5Dclose(dset_id);
+ H5Fclose(file_id);
} H5E_END_TRY;
return 1;
} /* end test_unlink_chunked_dataset() */
-
+
/*-------------------------------------------------------------------------
* Function: test_full_group_compact
*
@@ -2156,7 +2156,7 @@ test_full_group_compact(hid_t fapl)
{
hid_t file_id = -1;
hid_t gid = -1, gid2 = -1; /* Group IDs */
- H5O_info_t oi; /* Stat buffer for object */
+ H5O_info_t oi; /* Stat buffer for object */
char objname[128]; /* Buffer for name of objects to create */
char objname2[128]; /* Buffer for name of objects to create */
char filename[1024]; /* Buffer for filename */
@@ -2177,7 +2177,7 @@ test_full_group_compact(hid_t fapl)
/* Create several objects to link to */
for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) {
- sprintf(objname, "keep %u\n", u);
+ HDsprintf(objname, "keep %u\n", u);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid2) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -2205,14 +2205,14 @@ test_full_group_compact(hid_t fapl)
/* Create hard links to objects in group to keep */
for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) {
- sprintf(objname, "/keep/keep %u\n", u);
- sprintf(objname2, "keep %u\n", u);
+ HDsprintf(objname, "/keep/keep %u\n", u);
+ HDsprintf(objname2, "keep %u\n", u);
if(H5Lcreate_hard(file_id, objname, gid, objname2, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
/* Create several objects to delete */
for(u = 0; u < FULL_GROUP_NUM_DELETE_COMPACT; u++) {
- sprintf(objname, "delete %u\n", u);
+ HDsprintf(objname, "delete %u\n", u);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid2) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -2227,7 +2227,7 @@ test_full_group_compact(hid_t fapl)
/* Check reference count on objects to keep */
for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) {
- sprintf(objname, "/keep/keep %u\n", u);
+ HDsprintf(objname, "/keep/keep %u\n", u);
if(H5Oget_info_by_name2(file_id, objname, &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(oi.rc != 2) TEST_ERROR
} /* end for */
@@ -2244,7 +2244,7 @@ test_full_group_compact(hid_t fapl)
/* Check reference count on objects to keep */
for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) {
- sprintf(objname, "/keep/keep %u\n", u);
+ HDsprintf(objname, "/keep/keep %u\n", u);
if(H5Oget_info_by_name2(file_id, objname, &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(oi.rc != 1) TEST_ERROR
} /* end for */
@@ -2263,14 +2263,14 @@ test_full_group_compact(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(file_id);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(file_id);
} H5E_END_TRY;
return 1;
} /* end test_full_group_compact() */
-
+
/*-------------------------------------------------------------------------
* Function: test_full_group_dense
*
@@ -2290,7 +2290,7 @@ test_full_group_dense(hid_t fapl)
hid_t file_id = -1;
hid_t gcpl = (-1); /* Group creation property list ID */
hid_t gid = -1, gid2 = -1; /* Group IDs */
- H5O_info_t oi; /* Stat buffer for object */
+ H5O_info_t oi; /* Stat buffer for object */
char objname[128]; /* Buffer for name of objects to create */
char objname2[128]; /* Buffer for name of objects to create */
char filename[1024]; /* Buffer for filename */
@@ -2311,7 +2311,7 @@ test_full_group_dense(hid_t fapl)
/* Create several objects to link to */
for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) {
- sprintf(objname, "keep %u\n", u);
+ HDsprintf(objname, "keep %u\n", u);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid2) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -2351,14 +2351,14 @@ test_full_group_dense(hid_t fapl)
/* Create hard links to objects in group to keep */
for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) {
- sprintf(objname, "/keep/keep %u\n", u);
- sprintf(objname2, "keep %u\n", u);
+ HDsprintf(objname, "/keep/keep %u\n", u);
+ HDsprintf(objname2, "keep %u\n", u);
if(H5Lcreate_hard(file_id, objname, gid, objname2, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
/* Create several objects to delete */
for(u = 0; u < FULL_GROUP_NUM_DELETE_DENSE; u++) {
- sprintf(objname, "delete %u\n", u);
+ HDsprintf(objname, "delete %u\n", u);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid2) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -2373,7 +2373,7 @@ test_full_group_dense(hid_t fapl)
/* Check reference count on objects to keep */
for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) {
- sprintf(objname, "/keep/keep %u\n", u);
+ HDsprintf(objname, "/keep/keep %u\n", u);
if(H5Oget_info_by_name2(file_id, objname, &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(oi.rc != 2) TEST_ERROR
} /* end for */
@@ -2390,7 +2390,7 @@ test_full_group_dense(hid_t fapl)
/* Check reference count on objects to keep */
for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) {
- sprintf(objname, "/keep/keep %u\n", u);
+ HDsprintf(objname, "/keep/keep %u\n", u);
if(H5Oget_info_by_name2(file_id, objname, &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(oi.rc != 1) TEST_ERROR
} /* end for */
@@ -2409,38 +2409,34 @@ test_full_group_dense(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Pclose(gcpl);
- H5Fclose(file_id);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Pclose(gcpl);
+ H5Fclose(file_id);
} H5E_END_TRY;
return 1;
} /* end test_full_group_dense() */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test unlinking operations
+ * Purpose: Test unlinking operations
*
- * Return: Success: zero
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
- * Failure: non-zero
- *
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, September 25, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
main(void)
{
- hid_t fapl, fapl2, file;
- int nerrors = 0;
- char filename[1024];
- unsigned new_format;
+ hid_t fapl, fapl2, file;
+ int nerrors = 0;
+ char filename[1024];
+ unsigned new_format;
/* Metadata cache parameters */
int mdc_nelmts;
@@ -2467,11 +2463,11 @@ main(void)
/* Set the FAPL for the type of format */
if(new_format) {
- puts("\nTesting with new group format:");
+ HDputs("\nTesting with new group format:");
my_fapl = fapl2;
} /* end if */
else {
- puts("Testing with old group format:");
+ HDputs("Testing with old group format:");
my_fapl = fapl;
} /* end else */
@@ -2500,12 +2496,12 @@ main(void)
/* Get FAPL cache settings */
if(H5Pget_cache(fapl_small_mdc, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0)
- printf("H5Pget_cache failed\n");
+ HDprintf("H5Pget_cache failed\n");
/* Change FAPL cache settings */
mdc_nelmts=1;
if(H5Pset_cache(fapl_small_mdc, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0)
- printf("H5Pset_cache failed\n");
+ HDprintf("H5Pset_cache failed\n");
/* Test creating & unlinking lots of objects with a 1-element metadata cache FAPL */
nerrors += test_create_unlink("create and unlink large number of objects with small cache", fapl_small_mdc);
@@ -2550,17 +2546,17 @@ main(void)
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
if (nerrors) {
- printf("***** %d FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S");
- exit(EXIT_FAILURE);
+ HDprintf("***** %d FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S");
+ HDexit(EXIT_FAILURE);
}
- puts("All unlink tests passed.");
+ HDputs("All unlink tests passed.");
h5_cleanup(FILENAME, fapl);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
- return 1;
-}
+ HDexit(EXIT_FAILURE);
+} /* end main() */
diff --git a/test/unregister.c b/test/unregister.c
index dbf6293..ff116cf 100644
--- a/test/unregister.c
+++ b/test/unregister.c
@@ -16,6 +16,7 @@
* Purpose: Tests H5Zunregister function
*/
#include "h5test.h"
+
#include "H5CXprivate.h" /* API Contexts */
const char *FILENAME[] = {
@@ -24,8 +25,8 @@ const char *FILENAME[] = {
NULL
};
-#define GROUP_NAME "group"
-#define DSET_NAME "dataset"
+#define GROUP_NAME "test_group"
+#define DSET_NAME "test_dataset"
#define FILENAME_BUF_SIZE 1024
#define DSET_DIM1 100
#define DSET_DIM2 200
@@ -35,39 +36,34 @@ const char *FILENAME[] = {
#define H5Z_FILTER_DUMMY 312
-static size_t filter_dummy(unsigned int flags, size_t cd_nelmts,
+static size_t do_nothing(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
/* Dummy filter for test_unregister_filters only */
const H5Z_class2_t H5Z_DUMMY[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DUMMY, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dummy", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- filter_dummy, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DUMMY, /* Filter ID number */
+ 1, 1, /* Encoding and decoding enabled */
+ "dummy", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ do_nothing, /* The actual filter function */
}};
/*-------------------------------------------------------------------------
- * Function: filter_dummy
+ * Function: do_nothing
*
- * Purpose: A dummy compression method that doesn't do anything. This
- * filter is only for test_unregister_filters. Please don't
+ * Purpose: A dummy compression method that doesn't do anything. This
+ * filter is only for test_unregister_filters. Please don't
* use it for other tests because it may mess up this test.
*
- * Return: Success: Data chunk size
- *
- * Failure: 0
- *
- * Programmer: Raymond Lu
- * April 24, 2013
+ * Return: Data chunk size
*
*-------------------------------------------------------------------------
*/
static size_t
-filter_dummy(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
+do_nothing(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes,
size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf)
{
@@ -75,194 +71,233 @@ filter_dummy(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
}
/*-------------------------------------------------------------------------
- * Function: test_unregister_filters
- *
- * Purpose: Tests unregistering filter before closing the file
+ * Function: test_unregister_filters
*
- * Return: Success: 0
- * Failure: -1
+ * Purpose: Tests unregistering filter before closing the file
*
- * Programmer: Raymond Lu
- * 11 April 2013
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
static herr_t
-test_unregister_filters(hid_t my_fapl)
+test_unregister_filters(hid_t fapl_id)
{
- hid_t file1, file2;
- hid_t dc;
- hid_t gcpl, gid, group;
- hid_t dataset, space;
- int i, j, n;
- char gname[256];
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t dcpl_id = H5I_INVALID_HID;
+ hid_t gcpl_id = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t gid_loop = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ int i, j, n;
+ char group_name[32];
char filename[FILENAME_BUF_SIZE];
- const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */
- hsize_t dims[2];
- int points[DSET_DIM1][DSET_DIM2];
+ const hsize_t chunk_dims[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */
+ hsize_t dims[2];
+ int data[DSET_DIM1][DSET_DIM2];
herr_t ret;
TESTING("Unregistering filter");
/* Create first file */
- h5_fixname(FILENAME[0], my_fapl, filename, sizeof filename);
- if((file1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) goto error;
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof(filename));
+ if((fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ goto error;
/* Create second file */
- h5_fixname(FILENAME[1], my_fapl, filename, sizeof filename);
- if((file2 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) goto error;
+ h5_fixname(FILENAME[1], fapl_id, filename, sizeof(filename));
+ if((fid2 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ goto error;
/* Register DUMMY filter */
- if(H5Zregister(H5Z_DUMMY) < 0) goto error;
-
- if(H5Zfilter_avail(H5Z_FILTER_DUMMY)!=TRUE) goto error;
+ if (H5Zregister(H5Z_DUMMY) < 0)
+ goto error;
+ if (H5Zfilter_avail(H5Z_FILTER_DUMMY) != TRUE)
+ goto error;
+
+ /*******************
+ * PART 1 - GROUPS *
+ *******************/
- if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error;
-
/* Use DUMMY filter for creating groups */
- if(H5Pset_filter (gcpl, H5Z_FILTER_DUMMY, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) goto error;
+ if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
+ goto error;
+ if(H5Pset_filter(gcpl_id, H5Z_FILTER_DUMMY, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0)
+ goto error;
/* Create a group using this filter */
- if((gid = H5Gcreate2(file1, GROUP_NAME, H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) goto error;
+ if((gid = H5Gcreate2(fid1, GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+ goto error;
/* Create multiple groups under the main group */
- for (i=0; i < GROUP_ITERATION; i++) {
- sprintf(gname, "group_%d", i);
- if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
- if(H5Gclose(group) < 0) goto error;
+ for(i = 0; i < GROUP_ITERATION; i++) {
+ HDsprintf(group_name, "group_%d", i);
+ if((gid_loop = H5Gcreate2(gid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Gclose(gid_loop) < 0)
+ goto error;
}
- if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error;
+ /* Flush the file containing the groups */
+ if(H5Fflush(fid1, H5F_SCOPE_GLOBAL) < 0)
+ goto error;
/* Unregister the filter before closing the group. It should fail */
H5E_BEGIN_TRY {
ret = H5Zunregister(H5Z_FILTER_DUMMY);
} H5E_END_TRY;
- if(ret>=0) {
+ if(ret >= 0) {
H5_FAILED();
- printf(" Line %d: Should not be able to unregister filter\n", __LINE__);
+ HDprintf(" Line %d: Should not be able to unregister filter\n", __LINE__);
goto error;
- } /* end if */
+ }
/* Close the group */
- if(H5Gclose(gid) < 0) goto error;
+ if(H5Gclose(gid) < 0)
+ goto error;
/* Clean up objects used for this test */
- if(H5Pclose (gcpl) < 0) goto error;
+ if(H5Pclose (gcpl_id) < 0)
+ goto error;
- if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ /*********************
+ * PART 2 - DATASETS *
+ *********************/
- if(H5Pset_filter(dc, H5Z_FILTER_DUMMY, 0, (size_t)0, NULL) < 0) goto error;
+ /* Use DUMMY filter for creating datasets */
+ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+ if(H5Pset_chunk(dcpl_id, 2, chunk_dims) < 0)
+ goto error;
+ if(H5Pset_filter(dcpl_id, H5Z_FILTER_DUMMY, 0, (size_t)0, NULL) < 0)
+ goto error;
- /* Initialize the dataset */
+ /* Initialize the data for writing */
for(i = n = 0; i < DSET_DIM1; i++)
for(j = 0; j < DSET_DIM2; j++)
- points[i][j] = n++;
+ data[i][j] = n++;
- /* Create the data space */
+ /* Create the dataspace */
dims[0] = DSET_DIM1;
dims[1] = DSET_DIM2;
- if((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0)
+ goto error;
/* Create a dataset in the first file */
- if((dataset = H5Dcreate2(file1, DSET_NAME, H5T_NATIVE_INT, space,
- H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
+ if((did = H5Dcreate2(fid1, DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ goto error;
/* Write the data to the dataset */
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
goto error;
/* Unregister the filter before closing the dataset. It should fail */
H5E_BEGIN_TRY {
ret = H5Zunregister(H5Z_FILTER_DUMMY);
} H5E_END_TRY;
- if(ret>=0) {
+ if(ret >= 0) {
H5_FAILED();
- printf(" Line %d: Should not be able to unregister filter\n", __LINE__);
+ HDprintf(" Line %d: Should not be able to unregister filter\n", __LINE__);
goto error;
- } /* end if */
+ }
- if(H5Dclose(dataset) < 0) goto error;
+ /* Close the dataset */
+ if(H5Dclose(did) < 0)
+ goto error;
/* Create a dataset in the second file */
- if((dataset = H5Dcreate2(file2, DSET_NAME, H5T_NATIVE_INT, space,
- H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
+ if((did = H5Dcreate2(fid2, DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ goto error;
/* Write the data to the dataset */
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
goto error;
- if(H5Dclose(dataset) < 0) goto error;
+ /* Close the dataset in the second file */
+ if(H5Dclose(did) < 0)
+ goto error;
/* Unregister the filter after closing all objects but before closing files.
- * It should flush all files. */
- if(H5Zunregister(H5Z_FILTER_DUMMY) < 0) goto error;
+ * It should flush all files.
+ */
+ if(H5Zunregister(H5Z_FILTER_DUMMY) < 0)
+ goto error;
/* Clean up objects used for this test */
- if(H5Pclose (dc) < 0) goto error;
- if(H5Fclose(file1) < 0) goto error;
- if(H5Fclose(file2) < 0) goto error;
+ if(H5Pclose(dcpl_id) < 0)
+ goto error;
+ if(H5Fclose(fid1) < 0)
+ goto error;
+ if(H5Fclose(fid2) < 0)
+ goto error;
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ H5E_BEGIN_TRY {
+ H5Fclose(fid1);
+ H5Fclose(fid2);
+ H5Pclose(dcpl_id);
+ H5Pclose(gcpl_id);
+ H5Gclose(gid);
+ H5Gclose(gid_loop);
+ H5Dclose(did);
+ H5Sclose(sid);
+ } H5E_END_TRY;
+
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Tests unregistering filter with H5Zunregister
+ * Function: main
*
- * Return: Success: exit(EXIT_SUCCESS)
+ * Purpose: Tests unregistering filter with H5Zunregister
*
- * Failure: exit(EXIT_FAILURE)
- *
- * Programmer: Raymond Lu
- * 11 April 2013
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
*-------------------------------------------------------------------------
*/
int
main(void)
{
- hid_t fapl;
- int nerrors = 0;
+ hid_t fapl_id = H5I_INVALID_HID;
+ int nerrors = 0;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Testing setup */
h5_reset();
- fapl = h5_fileaccess();
+ fapl_id = h5_fileaccess();
/* Push API context */
if(H5CX_push() < 0) FAIL_STACK_ERROR
api_ctx_pushed = TRUE;
/* Test unregistering filter in its own file */
- nerrors += (test_unregister_filters(fapl) < 0 ? 1 : 0);
+ nerrors += (test_unregister_filters(fapl_id) < 0 ? 1 : 0);
- if(nerrors)
+ h5_cleanup(FILENAME, fapl_id);
+
+ if (nerrors)
goto error;
- printf("All filter unregistration tests passed.\n");
+ HDprintf("All filter unregistration tests passed.\n");
/* Pop API context */
if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
api_ctx_pushed = FALSE;
- h5_cleanup(FILENAME, fapl);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
nerrors = MAX(1, nerrors);
- printf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n",
+ HDprintf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
if(api_ctx_pushed) H5CX_pop();
- return 1;
-}
+ HDexit(EXIT_FAILURE);
+} /* end main() */
diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c
index 4e8c672..6b34f1e 100644
--- a/test/use_append_chunk.c
+++ b/test/use_append_chunk.c
@@ -174,9 +174,9 @@ main(int argc, char *argv[])
HDprintf("%d: launch reader process\n", mypid);
if (read_uc_file(send_wait) < 0){
HDfprintf(stderr, "read_uc_file encountered error\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
}
- HDexit(0);
+ HDexit(EXIT_SUCCESS);
}
}
diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c
index 0414628..b7d45a4 100644
--- a/test/use_append_mchunks.c
+++ b/test/use_append_mchunks.c
@@ -167,9 +167,9 @@ main(int argc, char *argv[])
HDprintf("%d: launch reader process\n", mypid);
if (read_uc_file(send_wait) < 0){
HDfprintf(stderr, "read_uc_file encountered error\n");
- HDexit(1);
+ HDexit(EXIT_FAILURE);
}
- HDexit(0);
+ HDexit(EXIT_SUCCESS);
}
}
diff --git a/test/use_common.c b/test/use_common.c
index 3ecb2e1..9effa06 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -21,7 +21,7 @@
#include "use.h"
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
#define H5D_TESTING
#include "H5Dpkg.h"
@@ -57,88 +57,88 @@ parse_option(int argc, char * const argv[])
opterr = 0;
while (1){
- c = getopt (argc, argv, nagg_options);
- if (-1 == c)
- break;
- switch (c) {
- case 'h':
- usage(progname_g);
- exit(0);
- break;
- case 'f': /* usecase data file name */
- UC_opts.filename = optarg;
- break;
- case 'i': /* iterations */
- if ((UC_opts.iterations = HDatoi(optarg)) <= 0) {
- fprintf(stderr, "bad iterations number %s, must be a positive integer\n", optarg);
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case 'l': /* launch reader or writer only */
- switch (*optarg) {
- case 'r': /* reader only */
- UC_opts.launch = UC_READER;
- break;
- case 'w': /* writer only */
- UC_opts.launch = UC_WRITER;
- break;
- default:
- fprintf(stderr, "launch value(%c) should be w or r only.\n", *optarg);
- usage(progname_g);
- Hgoto_error(-1);
- break;
- }
- break;
- case 'n': /* number of planes to write/read */
- if ((UC_opts.nplanes = HDstrtoul(optarg, NULL, 0)) <= 0) {
- fprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg);
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case 's': /* use swmr file open mode */
+ c = getopt (argc, argv, nagg_options);
+ if (-1 == c)
+ break;
+ switch (c) {
+ case 'h':
+ usage(progname_g);
+ HDexit(EXIT_SUCCESS);
+ break;
+ case 'f': /* usecase data file name */
+ UC_opts.filename = optarg;
+ break;
+ case 'i': /* iterations */
+ if ((UC_opts.iterations = HDatoi(optarg)) <= 0) {
+ HDfprintf(stderr, "bad iterations number %s, must be a positive integer\n", optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case 'l': /* launch reader or writer only */
+ switch (*optarg) {
+ case 'r': /* reader only */
+ UC_opts.launch = UC_READER;
+ break;
+ case 'w': /* writer only */
+ UC_opts.launch = UC_WRITER;
+ break;
+ default:
+ HDfprintf(stderr, "launch value(%c) should be w or r only.\n", *optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ break;
+ }
+ break;
+ case 'n': /* number of planes to write/read */
+ if ((UC_opts.nplanes = HDstrtoul(optarg, NULL, 0)) <= 0) {
+ HDfprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case 's': /* use swmr file open mode */
use_swmr = HDatoi(optarg);
- if (use_swmr != 0 && use_swmr != 1) {
+ if (use_swmr != 0 && use_swmr != 1) {
HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
usage(progname_g);
Hgoto_error(-1);
- }
+ }
UC_opts.use_swmr = (hbool_t)use_swmr;
- break;
- case 'y': /* Number of planes per chunk */
- if ((UC_opts.chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) {
- fprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n", optarg);
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case 'z': /* size of chunk=(z,z) */
- if ((UC_opts.chunksize = HDstrtoull(optarg, NULL, 0)) <= 0) {
- fprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg);
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case '?':
- fprintf(stderr, "getopt returned '%c'.\n", c);
- Hgoto_error(-1);
- default:
- fprintf(stderr, "getopt returned unexpected value.\n");
- fprintf(stderr, "Unexpected value is %d\n", c);
- Hgoto_error(-1);
- }
+ break;
+ case 'y': /* Number of planes per chunk */
+ if ((UC_opts.chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) {
+ HDfprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n", optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case 'z': /* size of chunk=(z,z) */
+ if ((UC_opts.chunksize = HDstrtoull(optarg, NULL, 0)) <= 0) {
+ HDfprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case '?':
+ HDfprintf(stderr, "getopt returned '%c'.\n", c);
+ Hgoto_error(-1);
+ default:
+ HDfprintf(stderr, "getopt returned unexpected value.\n");
+ HDfprintf(stderr, "Unexpected value is %d\n", c);
+ Hgoto_error(-1);
+ }
}
/* set test file name if not given */
if (!UC_opts.filename){
- /* default data file name is <progname>.h5 */
- if ((UC_opts.filename=(char*)HDmalloc(HDstrlen(progname_g)+4))==NULL) {
- fprintf(stderr, "malloc: failed\n");
- Hgoto_error(-1);
- };
- HDstrcpy(UC_opts.filename, progname_g);
- HDstrcat(UC_opts.filename, ".h5");
+ /* default data file name is <progname>.h5 */
+ if ((UC_opts.filename=(char*)HDmalloc(HDstrlen(progname_g)+4))==NULL) {
+ HDfprintf(stderr, "malloc: failed\n");
+ Hgoto_error(-1);
+ };
+ HDstrcpy(UC_opts.filename, progname_g);
+ HDstrcat(UC_opts.filename, ".h5");
}
done:
@@ -148,31 +148,31 @@ done:
/* Show parameters used for this use case */
void show_parameters(void){
- printf("===Parameters used:===\n");
- printf("chunk dims=(%llu, %llu, %llu)\n", (unsigned long long)UC_opts.chunkdims[0],
+ HDprintf("===Parameters used:===\n");
+ printf("chunk dims=(%llu, %llu, %llu)\n", (unsigned long long)UC_opts.chunkdims[0],
(unsigned long long)UC_opts.chunkdims[1], (unsigned long long)UC_opts.chunkdims[2]);
- printf("dataset max dims=(%llu, %llu, %llu)\n", (unsigned long long)UC_opts.max_dims[0],
+ printf("dataset max dims=(%llu, %llu, %llu)\n", (unsigned long long)UC_opts.max_dims[0],
(unsigned long long)UC_opts.max_dims[1], (unsigned long long)UC_opts.max_dims[2]);
- printf("number of planes to write=%llu\n", (unsigned long long)UC_opts.nplanes);
- printf("using SWMR mode=%s\n", UC_opts.use_swmr ? "yes(1)" : "no(0)");
- printf("data filename=%s\n", UC_opts.filename);
- printf("launch part=");
- switch (UC_opts.launch){
- case UC_READWRITE:
- printf("Reader/Writer\n");
- break;
- case UC_WRITER:
- printf("Writer\n");
- break;
- case UC_READER:
- printf("Reader\n");
- break;
- default:
- /* should not happen */
- printf("Illegal part(%d)\n", UC_opts.launch);
- };
- printf("number of iterations=%d (not used yet)\n", UC_opts.iterations);
- printf("===Parameters shown===\n");
+ HDprintf("number of planes to write=%llu\n", (unsigned long long)UC_opts.nplanes);
+ HDprintf("using SWMR mode=%s\n", UC_opts.use_swmr ? "yes(1)" : "no(0)");
+ HDprintf("data filename=%s\n", UC_opts.filename);
+ HDprintf("launch part=");
+ switch (UC_opts.launch){
+ case UC_READWRITE:
+ printf("Reader/Writer\n");
+ break;
+ case UC_WRITER:
+ printf("Writer\n");
+ break;
+ case UC_READER:
+ printf("Reader\n");
+ break;
+ default:
+ /* should not happen */
+ printf("Illegal part(%d)\n", UC_opts.launch);
+ };
+ HDprintf("number of iterations=%d (not used yet)\n", UC_opts.iterations);
+ HDprintf("===Parameters shown===\n");
}
/* Create the skeleton use case file for testing.
@@ -185,7 +185,7 @@ void show_parameters(void){
*/
int create_uc_file(void)
{
- hsize_t dims[3]; /* Dataset starting dimensions */
+ hsize_t dims[3]; /* Dataset starting dimensions */
hid_t fid; /* File ID for new HDF5 file */
hid_t dcpl; /* Dataset creation property list */
hid_t sid; /* Dataspace ID */
@@ -217,7 +217,7 @@ int create_uc_file(void)
/* create dataset of progname */
if((dsid = H5Dcreate2(fid, progname_g, UC_DATATYPE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- return -1;
+ return -1;
/* Check that the chunk index type is not version 1 B-tree.
* Version 1 B-trees are not supported under SWMR.
@@ -225,13 +225,13 @@ int create_uc_file(void)
if(H5D__layout_idx_type_test(dsid, &idx_type) < 0)
return -1;
if(idx_type == H5D_CHUNK_IDX_BTREE) {
- fprintf(stderr, "ERROR: Chunk index is version 1 B-tree: aborting.\n");
+ HDfprintf(stderr, "ERROR: Chunk index is version 1 B-tree: aborting.\n");
return -1;
}
/* Close everything */
if(H5Dclose(dsid) < 0)
- return -1;
+ return -1;
if(H5Pclose(fapl) < 0)
return -1;
if(H5Pclose(dcpl) < 0)
@@ -254,17 +254,17 @@ int create_uc_file(void)
*/
int write_uc_file(hbool_t tosend, hid_t fid)
{
- hid_t dsid; /* dataset ID */
- hid_t dcpl; /* Dataset creation property list */
- UC_CTYPE *buffer, *bufptr; /* data buffer */
- hsize_t cz=UC_opts.chunksize; /* Chunk size */
- hid_t f_sid; /* dataset file space id */
- hid_t m_sid; /* memory space id */
- int rank; /* rank */
- hsize_t chunk_dims[3]; /* Chunk dimensions */
- hsize_t dims[3]; /* Dataspace dimensions */
- hsize_t memdims[3]; /* Memory space dimensions */
- hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */
+ hid_t dsid; /* dataset ID */
+ hid_t dcpl; /* Dataset creation property list */
+ UC_CTYPE *buffer, *bufptr; /* data buffer */
+ hsize_t cz=UC_opts.chunksize; /* Chunk size */
+ hid_t f_sid; /* dataset file space id */
+ hid_t m_sid; /* memory space id */
+ int rank; /* rank */
+ hsize_t chunk_dims[3]; /* Chunk dimensions */
+ hsize_t dims[3]; /* Dataspace dimensions */
+ hsize_t memdims[3]; /* Memory space dimensions */
+ hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */
hsize_t i, j, k;
if(tosend)
@@ -273,30 +273,30 @@ int write_uc_file(hbool_t tosend, hid_t fid)
/* Open the dataset of the program name */
if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){
- fprintf(stderr, "H5Dopen2 failed\n");
- return -1;
+ HDfprintf(stderr, "H5Dopen2 failed\n");
+ return -1;
}
/* Find chunksize used */
if ((dcpl = H5Dget_create_plist(dsid)) < 0){
- fprintf(stderr, "H5Dget_create_plist failed\n");
- return -1;
+ HDfprintf(stderr, "H5Dget_create_plist failed\n");
+ return -1;
}
if (H5D_CHUNKED != H5Pget_layout(dcpl)){
- fprintf(stderr, "storage layout is not chunked\n");
- return -1;
+ HDfprintf(stderr, "storage layout is not chunked\n");
+ return -1;
}
if ((rank = H5Pget_chunk(dcpl, 3, chunk_dims)) != 3){
- fprintf(stderr, "storage rank is not 3\n");
- return -1;
+ HDfprintf(stderr, "storage rank is not 3\n");
+ return -1;
}
/* verify chunk_dims against set paramenters */
if (chunk_dims[0]!=UC_opts.chunkdims[0] || chunk_dims[1] != cz || chunk_dims[2] != cz){
- fprintf(stderr, "chunk size is not as expected. Got dims=(%llu,%llu,%llu)\n",
- (unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1],
+ HDfprintf(stderr, "chunk size is not as expected. Got dims=(%llu,%llu,%llu)\n",
+ (unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1],
(unsigned long long)chunk_dims[2]);
- return -1;
+ return -1;
}
/* allocate space for data buffer 1 X dims[1] X dims[2] of UC_CTYPE */
@@ -304,8 +304,8 @@ int write_uc_file(hbool_t tosend, hid_t fid)
memdims[1] = UC_opts.dims[1];
memdims[2] = UC_opts.dims[2];
if ((buffer=(UC_CTYPE*)HDmalloc((size_t)memdims[1]*(size_t)memdims[2]*sizeof(UC_CTYPE)))==NULL) {
- fprintf(stderr, "malloc: failed\n");
- return -1;
+ HDfprintf(stderr, "malloc: failed\n");
+ return -1;
};
/*
@@ -314,28 +314,28 @@ int write_uc_file(hbool_t tosend, hid_t fid)
f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
rank = H5Sget_simple_extent_ndims(f_sid);
if (rank != UC_RANK){
- fprintf(stderr, "rank(%d) of dataset does not match\n", rank);
- return -1;
+ HDfprintf(stderr, "rank(%d) of dataset does not match\n", rank);
+ return -1;
}
if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){
- fprintf(stderr, "H5Sget_simple_extent_dims got error\n");
- return -1;
+ HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
+ return -1;
}
- printf("dataset rank %d, dimensions %llu x %llu x %llu\n",
- rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]),
+ HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n",
+ rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]),
(unsigned long long)(dims[2]));
/* verify that file space dims are as expected and are consistent with memory space dims */
if (dims[0] != 0 || dims[1] != memdims[1] || dims[2] != memdims[2]){
- fprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n",
- (unsigned long long)dims[0], (unsigned long long)dims[1],
+ HDfprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n",
+ (unsigned long long)dims[0], (unsigned long long)dims[1],
(unsigned long long)dims[2]);
- return -1;
+ return -1;
}
-
+
/* setup mem-space for buffer */
if ((m_sid=H5Screate_simple(rank, memdims, NULL))<0){
- fprintf(stderr, "H5Screate_simple for memory failed\n");
- return -1;
+ HDfprintf(stderr, "H5Screate_simple for memory failed\n");
+ return -1;
};
/* write planes */
@@ -343,73 +343,73 @@ int write_uc_file(hbool_t tosend, hid_t fid)
count[1]=dims[1];
count[2]=dims[2];
for (i=0; i<UC_opts.nplanes; i++){
- /* fill buffer with value i+1 */
- bufptr = buffer;
- for (j=0; j<dims[1]; j++)
- for (k=0; k<dims[2]; k++)
- *bufptr++ = (UC_CTYPE)i;
+ /* fill buffer with value i+1 */
+ bufptr = buffer;
+ for (j=0; j<dims[1]; j++)
+ for (k=0; k<dims[2]; k++)
+ *bufptr++ = (UC_CTYPE)i;
/* Cork the dataset's metadata in the cache, if SWMR is enabled */
if(UC_opts.use_swmr)
if(H5Odisable_mdc_flushes(dsid) < 0) {
- fprintf(stderr, "H5Odisable_mdc_flushes failed\n");
+ HDfprintf(stderr, "H5Odisable_mdc_flushes failed\n");
return -1;
}
- /* extend the dataset by one for new plane */
- dims[0]=i+1;
+ /* extend the dataset by one for new plane */
+ dims[0]=i+1;
if(H5Dset_extent(dsid, dims) < 0){
- fprintf(stderr, "H5Dset_extent failed\n");
+ HDfprintf(stderr, "H5Dset_extent failed\n");
return -1;
- }
+ }
/* Get the dataset's dataspace */
if((f_sid = H5Dget_space(dsid)) < 0){
- fprintf(stderr, "H5Dset_extent failed\n");
+ HDfprintf(stderr, "H5Dset_extent failed\n");
return -1;
- }
+ }
- start[0]=i;
+ start[0]=i;
/* Choose the next plane to write */
if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){
- fprintf(stderr, "Failed H5Sselect_hyperslab\n");
+ HDfprintf(stderr, "Failed H5Sselect_hyperslab\n");
return -1;
- }
+ }
/* Write plane to the dataset */
if(H5Dwrite(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){
- fprintf(stderr, "Failed H5Dwrite\n");
+ HDfprintf(stderr, "Failed H5Dwrite\n");
return -1;
- }
+ }
/* Uncork the dataset's metadata from the cache, if SWMR is enabled */
if(UC_opts.use_swmr)
if(H5Oenable_mdc_flushes(dsid) < 0) {
- fprintf(stderr, "H5Oenable_mdc_flushes failed\n");
+ HDfprintf(stderr, "H5Oenable_mdc_flushes failed\n");
return -1;
}
- /* flush file to make the just written plane available. */
- if(H5Dflush(dsid) < 0)
- {
- fprintf(stderr, "Failed to H5Fflush file\n");
- return -1;
- }
+ /* flush file to make the just written plane available. */
+ if(H5Dflush(dsid) < 0)
+ {
+ HDfprintf(stderr, "Failed to H5Fflush file\n");
+ return -1;
+ }
}
/* Done writing. Free/Close all resources including data file */
HDfree(buffer);
if (H5Dclose(dsid) < 0){
- fprintf(stderr, "Failed to close datasete\n");
- return -1;
+ HDfprintf(stderr, "Failed to close datasete\n");
+ return -1;
}
if (H5Sclose(m_sid) < 0){
- fprintf(stderr, "Failed to close memory space\n");
- return -1;
+ HDfprintf(stderr, "Failed to close memory space\n");
+ return -1;
}
if (H5Sclose(f_sid) < 0){
- fprintf(stderr, "Failed to close file space\n");
- return -1;
+ HDfprintf(stderr, "Failed to close file space\n");
+ return -1;
}
return 0;
@@ -429,21 +429,21 @@ int write_uc_file(hbool_t tosend, hid_t fid)
int read_uc_file(hbool_t towait)
{
hid_t fapl; /* file access property list ID */
- hid_t fid; /* File ID for new HDF5 file */
- hid_t dsid; /* dataset ID */
- char *name;
- UC_CTYPE *buffer, *bufptr; /* read data buffer */
- hid_t f_sid; /* dataset file space id */
- hid_t m_sid; /* memory space id */
- int rank; /* rank */
- hsize_t dims[3]; /* Dataspace dimensions */
- hsize_t memdims[3]; /* Memory space dimensions */
- hsize_t nplane=0, nplane_old=0; /* nth plane, last nth plane */
- hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */
- hsize_t j, k;
- int nreadererr=0;
- int nerrs;
- int nonewplane;
+ hid_t fid; /* File ID for new HDF5 file */
+ hid_t dsid; /* dataset ID */
+ char *name;
+ UC_CTYPE *buffer, *bufptr; /* read data buffer */
+ hid_t f_sid; /* dataset file space id */
+ hid_t m_sid; /* memory space id */
+ int rank; /* rank */
+ hsize_t dims[3]; /* Dataspace dimensions */
+ hsize_t memdims[3]; /* Memory space dimensions */
+ hsize_t nplane=0, nplane_old=0; /* nth plane, last nth plane */
+ hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */
+ hsize_t j, k;
+ int nreadererr=0;
+ int nerrs;
+ int nonewplane;
/* Before reading, wait for the message that H5Fopen is complete--file lock is released */
if(towait && h5_wait_message(WRITER_MESSAGE) < 0) {
@@ -461,8 +461,8 @@ int read_uc_file(hbool_t towait)
return -1;
}
if (H5Pclose(fapl) < 0){
- HDfprintf(stderr, "Failed to property list\n");
- return -1;
+ HDfprintf(stderr, "Failed to property list\n");
+ return -1;
}
@@ -504,11 +504,11 @@ int read_uc_file(hbool_t towait)
(unsigned long long)dims[0], (unsigned long long)dims[1],
(unsigned long long)dims[2]);
HDfprintf(stderr, "But memdims=(%llu,%llu,%llu)\n",
- (unsigned long long)memdims[0], (unsigned long long)memdims[1],
+ (unsigned long long)memdims[0], (unsigned long long)memdims[1],
(unsigned long long)memdims[2]);
return -1;
}
-
+
/* setup mem-space for buffer */
if ((m_sid=H5Screate_simple(rank, memdims, NULL))<0){
HDfprintf(stderr, "H5Screate_simple for memory failed\n");
@@ -523,102 +523,102 @@ int read_uc_file(hbool_t towait)
/* quit when all nplanes have been read */
nonewplane=0;
while (nplane_old < UC_opts.nplanes ){
- /* print progress message according to if new planes are availalbe */
- if (nplane_old < dims[0]) {
- if (nonewplane){
+ /* print progress message according to if new planes are availalbe */
+ if (nplane_old < dims[0]) {
+ if (nonewplane){
/* end the previous message */
HDprintf("\n");
nonewplane=0;
- }
- HDprintf("reading planes %llu to %llu\n", (unsigned long long)nplane_old,
+ }
+ HDprintf("reading planes %llu to %llu\n", (unsigned long long)nplane_old,
(unsigned long long)dims[0]);
- }else{
- if (nonewplane){
+ }else{
+ if (nonewplane){
HDprintf(".");
- if (nonewplane>=30){
- HDfprintf(stderr, "waited too long for new plane, quit.\n");
- return -1;
- }
- }else{
+ if (nonewplane>=30){
+ HDfprintf(stderr, "waited too long for new plane, quit.\n");
+ return -1;
+ }
+ }else{
/* print mesg only the first time; dots still no new plane */
HDprintf("no new planes to read ");
- }
- nonewplane++;
- /* pause for a second */
+ }
+ nonewplane++;
+ /* pause for a second */
HDsleep(1);
- }
- for (nplane=nplane_old; nplane < dims[0]; nplane++){
- /* read planes between last old nplanes and current extent */
- /* Get the dataset's dataspace */
- if((f_sid = H5Dget_space(dsid)) < 0){
+ }
+ for (nplane=nplane_old; nplane < dims[0]; nplane++){
+ /* read planes between last old nplanes and current extent */
+ /* Get the dataset's dataspace */
+ if((f_sid = H5Dget_space(dsid)) < 0){
HDfprintf(stderr, "H5Dget_space failed\n");
return -1;
- }
+ }
- start[0]=nplane;
- /* Choose the next plane to read */
- if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){
+ start[0]=nplane;
+ /* Choose the next plane to read */
+ if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){
HDfprintf(stderr, "H5Sselect_hyperslab failed\n");
return -1;
- }
+ }
- /* Read the plane from the dataset */
- if(H5Dread(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){
+ /* Read the plane from the dataset */
+ if(H5Dread(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){
HDfprintf(stderr, "H5Dread failed\n");
return -1;
- }
+ }
- /* compare read data with expected data value which is nplane */
- bufptr = buffer;
- nerrs=0;
- for (j=0; j<dims[1]; j++){
+ /* compare read data with expected data value which is nplane */
+ bufptr = buffer;
+ nerrs=0;
+ for (j=0; j<dims[1]; j++){
for (k=0; k<dims[2]; k++){
if ((hsize_t)*bufptr++ != nplane){
if (++nerrs < ErrorReportMax){
HDfprintf(stderr,
"found error %llu plane(%llu,%llu), expected %llu, got %d\n",
- (unsigned long long)nplane, (unsigned long long)j,
+ (unsigned long long)nplane, (unsigned long long)j,
(unsigned long long)k, (unsigned long long)nplane, (int)*(bufptr-1));
}
}
}
- }
- if (nerrs){
+ }
+ if (nerrs){
nreadererr++;
- HDfprintf(stderr, "found %d unexpected values in plane %llu\n", nerrs,
+ HDfprintf(stderr, "found %d unexpected values in plane %llu\n", nerrs,
(unsigned long long)nplane);
- }
- }
- /* Have read all current planes */
- nplane_old=dims[0];
+ }
+ }
+ /* Have read all current planes */
+ nplane_old=dims[0];
- /* check if dataset has grown since last time */
+ /* check if dataset has grown since last time */
#if 0
- /* close dsid and file, then reopen them */
- if (H5Dclose(dsid) < 0){
- HDfprintf(stderr, "H5Dclose failed\n");
- return -1;
- }
- if (H5Fclose(fid) < 0){
- HDfprintf(stderr, "H5Fclose failed\n");
- return -1;
- }
- if((fid = H5Fopen(name, H5F_ACC_RDONLY | (UC_opts.use_swmr ? H5F_ACC_SWMR_READ : 0), H5P_DEFAULT)) < 0){
- HDfprintf(stderr, "H5Fopen failed\n");
- return -1;
- }
- if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){
- HDfprintf(stderr, "H5Dopen2 failed\n");
- return -1;
- }
+ /* close dsid and file, then reopen them */
+ if (H5Dclose(dsid) < 0){
+ HDfprintf(stderr, "H5Dclose failed\n");
+ return -1;
+ }
+ if (H5Fclose(fid) < 0){
+ HDfprintf(stderr, "H5Fclose failed\n");
+ return -1;
+ }
+ if((fid = H5Fopen(name, H5F_ACC_RDONLY | (UC_opts.use_swmr ? H5F_ACC_SWMR_READ : 0), H5P_DEFAULT)) < 0){
+ HDfprintf(stderr, "H5Fopen failed\n");
+ return -1;
+ }
+ if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){
+ HDfprintf(stderr, "H5Dopen2 failed\n");
+ return -1;
+ }
#else
- H5Drefresh(dsid);
+ H5Drefresh(dsid);
#endif
- f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
- if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){
- HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
- return -1;
- }
+ f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
+ if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){
+ HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
+ return -1;
+ }
}
/* Close the file */
diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c
index 340f578..9cd202c 100644
--- a/test/use_disable_mdc_flushes.c
+++ b/test/use_disable_mdc_flushes.c
@@ -24,12 +24,12 @@
*/
#ifdef H5_HAVE_FORK
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
#define H5D_TESTING
#include "H5Dpkg.h"
/* Global Variable definitions */
-const char *progname_g="use_disable_mdc_flushes"; /* program name */
+const char *progname_g="use_disable_mdc_flushes"; /* program name */
/* these two definitions must match each other */
#define UC_DATATYPE H5T_NATIVE_SHORT /* use case HDF5 data type */
@@ -59,7 +59,7 @@ static int setup_parameters(int argc, char * const argv[]);
*
* usage: use_disable_mdc_flushes [OPTIONS]
* OPTIONS
- * -h, --help Print a usage message and exit
+ * -h, --help Print a usage message and exit
* -f FN Test file name [default: use_disable_mdc_flushes.h5]
* -n N, --nplanes=N Number of planes to write. [default: 1000]
* -s N, --swmr=N Use SWMR mode (0: no, non-0: yes) default is yes
@@ -69,19 +69,19 @@ static int setup_parameters(int argc, char * const argv[]);
static void
usage(const char *prog)
{
- fprintf(stderr, "usage: %s [OPTIONS]\n", prog);
- fprintf(stderr, " OPTIONS\n");
- fprintf(stderr, " -h Print a usage message and exit\n");
- fprintf(stderr, " -f FN Test file name [default: %s.h5]\n", prog);
- fprintf(stderr, " -n N Number of planes to write. [default: 1000]\n");
- fprintf(stderr, " -s N Use SWMR mode (0: no, non-0: yes) default is yes\n");
- fprintf(stderr, " -z N Chunk size [default: %d]\n", Chunksize_DFT);
- fprintf(stderr, " -y N Number of planes per chunk [default: 1]\n");
- fprintf(stderr, "\n");
+ HDfprintf(stderr, "usage: %s [OPTIONS]\n", prog);
+ HDfprintf(stderr, " OPTIONS\n");
+ HDfprintf(stderr, " -h Print a usage message and exit\n");
+ HDfprintf(stderr, " -f FN Test file name [default: %s.h5]\n", prog);
+ HDfprintf(stderr, " -n N Number of planes to write. [default: 1000]\n");
+ HDfprintf(stderr, " -s N Use SWMR mode (0: no, non-0: yes) default is yes\n");
+ HDfprintf(stderr, " -z N Chunk size [default: %d]\n", Chunksize_DFT);
+ HDfprintf(stderr, " -y N Number of planes per chunk [default: 1]\n");
+ HDfprintf(stderr, "\n");
} /* usage() */
-/*
+/*
* Setup Use Case parameters by parsing command line options.
* Setup default values if not set by options. */
static int
@@ -96,64 +96,64 @@ parse_option(int argc, char * const argv[])
opterr = 0;
while (1){
- c = getopt (argc, argv, cmd_options);
- if (-1 == c)
- break;
- switch (c) {
- case 'h':
- usage(progname_g);
- exit(0);
- break;
- case 'f': /* usecase data file name */
- filename_g = optarg;
- break;
- case 'n': /* number of planes to write/read */
- if ((nplanes_g = atoi(optarg)) <= 0){
- fprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg);
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case 's': /* use swmr file open mode */
- if ((use_swmr_g = atoi(optarg)) < 0){
- fprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case 'y': /* Number of planes per chunk */
- if ((chunkplanes_g = atoi(optarg)) <= 0){
- fprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n", optarg);
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case 'z': /* size of chunk=(z,z) */
- if ((chunksize_g = atoi(optarg)) <= 0){
- fprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg);
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case '?':
- fprintf(stderr, "getopt returned '%c'.\n", c);
- Hgoto_error(-1);
- default:
- fprintf(stderr, "getopt returned unexpected value.\n");
- fprintf(stderr, "Unexpected value is %d\n", c);
- Hgoto_error(-1);
- }
+ c = getopt (argc, argv, cmd_options);
+ if (-1 == c)
+ break;
+ switch (c) {
+ case 'h':
+ usage(progname_g);
+ HDexit(EXIT_SUCCESS);
+ break;
+ case 'f': /* usecase data file name */
+ filename_g = optarg;
+ break;
+ case 'n': /* number of planes to write/read */
+ if ((nplanes_g = HDatoi(optarg)) <= 0){
+ HDfprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case 's': /* use swmr file open mode */
+ if ((use_swmr_g = HDatoi(optarg)) < 0){
+ HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case 'y': /* Number of planes per chunk */
+ if ((chunkplanes_g = HDatoi(optarg)) <= 0){
+ HDfprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n", optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case 'z': /* size of chunk=(z,z) */
+ if ((chunksize_g = HDatoi(optarg)) <= 0){
+ HDfprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case '?':
+ HDfprintf(stderr, "getopt returned '%c'.\n", c);
+ Hgoto_error(-1);
+ default:
+ HDfprintf(stderr, "getopt returned unexpected value.\n");
+ HDfprintf(stderr, "Unexpected value is %d\n", c);
+ Hgoto_error(-1);
+ }
}
/* set test file name if not given */
if (!filename_g){
- /* default data file name is <progname>.h5 */
- if ((filename_g = (char*)HDmalloc(HDstrlen(progname_g)+4))==NULL) {
- fprintf(stderr, "malloc: failed\n");
- Hgoto_error(-1);
- };
- HDstrcpy(filename_g, progname_g);
- HDstrcat(filename_g, ".h5");
+ /* default data file name is <progname>.h5 */
+ if ((filename_g = (char*)HDmalloc(HDstrlen(progname_g)+4))==NULL) {
+ HDfprintf(stderr, "malloc: failed\n");
+ Hgoto_error(-1);
+ };
+ HDstrcpy(filename_g, progname_g);
+ HDstrcat(filename_g, ".h5");
}
done:
@@ -162,35 +162,35 @@ done:
} /* parse_option() */
/* Show parameters used for this use case */
-static void
+static void
show_parameters(void)
{
- printf("===Parameters used:===\n");
- printf("chunk dims=(%llu, %llu, %llu)\n", (unsigned long long)chunkdims_g[0],
+ HDprintf("===Parameters used:===\n");
+ HDprintf("chunk dims=(%llu, %llu, %llu)\n", (unsigned long long)chunkdims_g[0],
(unsigned long long)chunkdims_g[1], (unsigned long long)chunkdims_g[2]);
- printf("dataset max dims=(%llu, %llu, %llu)\n", (unsigned long long)max_dims_g[0],
+ HDprintf("dataset max dims=(%llu, %llu, %llu)\n", (unsigned long long)max_dims_g[0],
(unsigned long long)max_dims_g[1], (unsigned long long)max_dims_g[2]);
- printf("number of planes to write=%llu\n", (unsigned long long)nplanes_g);
- printf("using SWMR mode=%s\n", use_swmr_g ? "yes(1)" : "no(0)");
- printf("data filename=%s\n", filename_g);
- printf("===Parameters shown===\n");
+ HDprintf("number of planes to write=%llu\n", (unsigned long long)nplanes_g);
+ HDprintf("using SWMR mode=%s\n", use_swmr_g ? "yes(1)" : "no(0)");
+ HDprintf("data filename=%s\n", filename_g);
+ HDprintf("===Parameters shown===\n");
} /* show_parameters() */
-/*
+/*
* Setup parameters for the use case.
* Return: 0 succeed; -1 fail.
*/
-static int
+static int
setup_parameters(int argc, char * const argv[])
{
/* use case defaults */
chunksize_g = Chunksize_DFT;
- use_swmr_g = 1; /* use swmr open */
+ use_swmr_g = 1; /* use swmr open */
chunkplanes_g = 1;
/* parse options */
if (parse_option(argc, argv) < 0){
- return(-1);
+ return(-1);
}
/* set chunk dims */
chunkdims_g[0] = chunkplanes_g;
@@ -210,7 +210,7 @@ setup_parameters(int argc, char * const argv[])
return(0);
} /* setup_parameters() */
-/*
+/*
* Create the skeleton use case file for testing.
* It has one 3d dataset using chunked storage.
* The dataset is (unlimited, chunksize, chunksize).
@@ -219,10 +219,10 @@ setup_parameters(int argc, char * const argv[])
*
* Return: 0 succeed; -1 fail.
*/
-static int
+static int
create_file(void)
{
- hsize_t dims[3]; /* Dataset starting dimensions */
+ hsize_t dims[3]; /* Dataset starting dimensions */
hid_t fid; /* File ID for new HDF5 file */
hid_t dcpl; /* Dataset creation property list */
hid_t sid; /* Dataspace ID */
@@ -254,7 +254,7 @@ create_file(void)
/* create dataset of progname */
if((dsid = H5Dcreate2(fid, progname_g, UC_DATATYPE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- return -1;
+ return -1;
/* Check that the chunk index type is not version 1 B-tree.
* Version 1 B-trees are not supported under SWMR.
@@ -262,13 +262,13 @@ create_file(void)
if(H5D__layout_idx_type_test(dsid, &idx_type) < 0)
return -1;
if(idx_type == H5D_CHUNK_IDX_BTREE) {
- fprintf(stderr, "ERROR: Chunk index is version 1 B-tree: aborting.\n");
+ HDfprintf(stderr, "ERROR: Chunk index is version 1 B-tree: aborting.\n");
return -1;
}
/* Close everything */
if(H5Dclose(dsid) < 0)
- return -1;
+ return -1;
if(H5Pclose(fapl) < 0)
return -1;
if(H5Pclose(dcpl) < 0)
@@ -281,7 +281,7 @@ create_file(void)
return 0;
} /* create_file() */
-/*
+/*
* Append planes, each of (1,2*chunksize,2*chunksize) to the dataset.
* In other words, 4 chunks are appended to the dataset at a time.
* Fill each plane with the plane number and then write it at the nth plane.
@@ -290,24 +290,24 @@ create_file(void)
*
* Return: 0 succeed; -1 fail.
*/
-static int
+static int
write_file(void)
{
- hid_t fid; /* File ID for new HDF5 file */
- hid_t dsid; /* dataset ID */
- hid_t fapl; /* File access property list */
- hid_t dcpl; /* Dataset creation property list */
- char *name;
- UC_CTYPE *buffer, *bufptr; /* data buffer */
- hsize_t cz=chunksize_g; /* Chunk size */
- hid_t f_sid; /* dataset file space id */
- hid_t m_sid; /* memory space id */
- int rank; /* rank */
- hsize_t chunk_dims[3]; /* Chunk dimensions */
- hsize_t dims[3]; /* Dataspace dimensions */
- hsize_t memdims[3]; /* Memory space dimensions */
- hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */
- hbool_t disabled; /* Object's disabled status */
+ hid_t fid; /* File ID for new HDF5 file */
+ hid_t dsid; /* dataset ID */
+ hid_t fapl; /* File access property list */
+ hid_t dcpl; /* Dataset creation property list */
+ char *name;
+ UC_CTYPE *buffer, *bufptr; /* data buffer */
+ hsize_t cz=chunksize_g; /* Chunk size */
+ hid_t f_sid; /* dataset file space id */
+ hid_t m_sid; /* memory space id */
+ int rank; /* rank */
+ hsize_t chunk_dims[3]; /* Chunk dimensions */
+ hsize_t dims[3]; /* Dataspace dimensions */
+ hsize_t memdims[3]; /* Memory space dimensions */
+ hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */
+ hbool_t disabled; /* Object's disabled status */
hsize_t i, j, k;
name = filename_g;
@@ -319,51 +319,51 @@ write_file(void)
if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
return -1;
if((fid = H5Fopen(name, H5F_ACC_RDWR | (use_swmr_g ? H5F_ACC_SWMR_WRITE : 0), fapl)) < 0){
- fprintf(stderr, "H5Fopen failed\n");
+ HDfprintf(stderr, "H5Fopen failed\n");
return -1;
}
/* Open the dataset of the program name */
if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){
- fprintf(stderr, "H5Dopen2 failed\n");
- return -1;
+ HDfprintf(stderr, "H5Dopen2 failed\n");
+ return -1;
}
/* Disabled mdc flushed for the dataset */
if(H5Odisable_mdc_flushes(dsid) < 0) {
- fprintf(stderr, "H5Odisable_mdc_flushes failed\n");
- return -1;
+ HDfprintf(stderr, "H5Odisable_mdc_flushes failed\n");
+ return -1;
}
/* Get mdc disabled status of the dataset */
if(H5Oare_mdc_flushes_disabled(dsid, &disabled) < 0) {
- fprintf(stderr, "H5Oare_mdc_flushes_disabled failed\n");
- return -1;
+ HDfprintf(stderr, "H5Oare_mdc_flushes_disabled failed\n");
+ return -1;
} else if(disabled)
- printf("Dataset has disabled mdc flushes.\n");
+ HDprintf("Dataset has disabled mdc flushes.\n");
else
- printf("Dataset should have disabled its mdc flushes.\n");
+ HDprintf("Dataset should have disabled its mdc flushes.\n");
/* Find chunksize used */
if ((dcpl = H5Dget_create_plist(dsid)) < 0){
- fprintf(stderr, "H5Dget_create_plist failed\n");
- return -1;
+ HDfprintf(stderr, "H5Dget_create_plist failed\n");
+ return -1;
}
if (H5D_CHUNKED != H5Pget_layout(dcpl)){
- fprintf(stderr, "storage layout is not chunked\n");
- return -1;
+ HDfprintf(stderr, "storage layout is not chunked\n");
+ return -1;
}
if ((rank = H5Pget_chunk(dcpl, 3, chunk_dims)) != 3){
- fprintf(stderr, "storage rank is not 3\n");
- return -1;
+ HDfprintf(stderr, "storage rank is not 3\n");
+ return -1;
}
/* verify chunk_dims against set paramenters */
if (chunk_dims[0]!= chunkdims_g[0] || chunk_dims[1] != cz || chunk_dims[2] != cz){
- fprintf(stderr, "chunk size is not as expected. Got dims=(%llu,%llu,%llu)\n",
- (unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1],
+ HDfprintf(stderr, "chunk size is not as expected. Got dims=(%llu,%llu,%llu)\n",
+ (unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1],
(unsigned long long)chunk_dims[2]);
- return -1;
+ return -1;
}
/* allocate space for data buffer 1 X dims[1] X dims[2] of UC_CTYPE */
@@ -371,8 +371,8 @@ write_file(void)
memdims[1] = dims_g[1];
memdims[2] = dims_g[2];
if ((buffer=(UC_CTYPE*)HDmalloc((size_t)memdims[1]*(size_t)memdims[2]*sizeof(UC_CTYPE)))==NULL) {
- fprintf(stderr, "malloc: failed\n");
- return -1;
+ HDfprintf(stderr, "malloc: failed\n");
+ return -1;
};
/*
@@ -381,28 +381,28 @@ write_file(void)
f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
rank = H5Sget_simple_extent_ndims(f_sid);
if (rank != UC_RANK){
- fprintf(stderr, "rank(%d) of dataset does not match\n", rank);
- return -1;
+ HDfprintf(stderr, "rank(%d) of dataset does not match\n", rank);
+ return -1;
}
if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){
- fprintf(stderr, "H5Sget_simple_extent_dims got error\n");
- return -1;
+ HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
+ return -1;
}
- printf("dataset rank %d, dimensions %llu x %llu x %llu\n",
- rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]),
+ HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n",
+ rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]),
(unsigned long long)(dims[2]));
/* verify that file space dims are as expected and are consistent with memory space dims */
if (dims[0] != 0 || dims[1] != memdims[1] || dims[2] != memdims[2]){
- fprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n",
- (unsigned long long)dims[0], (unsigned long long)dims[1],
+ HDfprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n",
+ (unsigned long long)dims[0], (unsigned long long)dims[1],
(unsigned long long)dims[2]);
- return -1;
+ return -1;
}
-
+
/* setup mem-space for buffer */
if ((m_sid=H5Screate_simple(rank, memdims, NULL))<0){
- fprintf(stderr, "H5Screate_simple for memory failed\n");
- return -1;
+ HDfprintf(stderr, "H5Screate_simple for memory failed\n");
+ return -1;
};
/* write planes */
@@ -410,82 +410,82 @@ write_file(void)
count[1]=dims[1];
count[2]=dims[2];
for (i=0; i<nplanes_g; i++){
- /* fill buffer with value i+1 */
- bufptr = buffer;
- for (j=0; j<dims[1]; j++)
- for (k=0; k<dims[2]; k++)
- *bufptr++ = i;
-
- /* extend the dataset by one for new plane */
- dims[0]=i+1;
+ /* fill buffer with value i+1 */
+ bufptr = buffer;
+ for (j=0; j<dims[1]; j++)
+ for (k=0; k<dims[2]; k++)
+ *bufptr++ = i;
+
+ /* extend the dataset by one for new plane */
+ dims[0]=i+1;
if(H5Dset_extent(dsid, dims) < 0){
- fprintf(stderr, "H5Dset_extent failed\n");
+ HDfprintf(stderr, "H5Dset_extent failed\n");
return -1;
- }
+ }
/* Get the dataset's dataspace */
if((f_sid = H5Dget_space(dsid)) < 0){
- fprintf(stderr, "H5Dset_extent failed\n");
+ HDfprintf(stderr, "H5Dset_extent failed\n");
return -1;
- }
+ }
- start[0]=i;
+ start[0]=i;
/* Choose the next plane to write */
if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){
- fprintf(stderr, "Failed H5Sselect_hyperslab\n");
+ HDfprintf(stderr, "Failed H5Sselect_hyperslab\n");
return -1;
- }
+ }
/* Write plane to the dataset */
if(H5Dwrite(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){
- fprintf(stderr, "Failed H5Dwrite\n");
+ HDfprintf(stderr, "Failed H5Dwrite\n");
return -1;
- }
-
- /* Flush the dataset for every "chunkplanes_g" planes */
- if(!((i + 1) % (hsize_t)chunkplanes_g)) {
- if(H5Dflush(dsid) < 0) {
- fprintf(stderr, "Failed to H5Dflush dataset\n");
- return -1;
- }
- }
+ }
+
+ /* Flush the dataset for every "chunkplanes_g" planes */
+ if(!((i + 1) % (hsize_t)chunkplanes_g)) {
+ if(H5Dflush(dsid) < 0) {
+ HDfprintf(stderr, "Failed to H5Dflush dataset\n");
+ return -1;
+ }
+ }
}
if(H5Dflush(dsid) < 0) {
- fprintf(stderr, "Failed to H5Dflush dataset\n");
- return -1;
+ HDfprintf(stderr, "Failed to H5Dflush dataset\n");
+ return -1;
}
/* Enable mdc flushes for the dataset */
/* Closing the dataset later will enable mdc flushes automatically if this is not done */
if(disabled)
- if(H5Oenable_mdc_flushes(dsid) < 0) {
- fprintf(stderr, "Failed to H5Oenable_mdc_flushes\n");
- return -1;
- }
+ if(H5Oenable_mdc_flushes(dsid) < 0) {
+ HDfprintf(stderr, "Failed to H5Oenable_mdc_flushes\n");
+ return -1;
+ }
/* Done writing. Free/Close all resources including data file */
HDfree(buffer);
if(H5Dclose(dsid) < 0){
- fprintf(stderr, "Failed to close datasete\n");
- return -1;
+ HDfprintf(stderr, "Failed to close datasete\n");
+ return -1;
}
if(H5Sclose(m_sid) < 0){
- fprintf(stderr, "Failed to close memory space\n");
- return -1;
+ HDfprintf(stderr, "Failed to close memory space\n");
+ return -1;
}
if(H5Sclose(f_sid) < 0){
- fprintf(stderr, "Failed to close file space\n");
- return -1;
+ HDfprintf(stderr, "Failed to close file space\n");
+ return -1;
}
if(H5Pclose(fapl) < 0){
- fprintf(stderr, "Failed to property list\n");
- return -1;
+ HDfprintf(stderr, "Failed to property list\n");
+ return -1;
}
if(H5Fclose(fid) < 0){
- fprintf(stderr, "Failed to close file id\n");
- return -1;
+ HDfprintf(stderr, "Failed to close file id\n");
+ return -1;
}
return 0;
@@ -493,7 +493,7 @@ write_file(void)
-/* Overall Algorithm:
+/* Overall Algorithm:
* Parse options from user;
* Generate/pre-created test files needed and close it;
* Write to the file.
@@ -505,31 +505,31 @@ main(int argc, char *argv[])
/* initialization */
if(setup_parameters(argc, argv) < 0)
- Hgoto_error(1);
+ Hgoto_error(1);
/* ============*/
/* Create file */
/* ============*/
- printf("Creating skeleton data file for testing H5Odisable_mdc_flushes()...\n");
+ HDprintf("Creating skeleton data file for testing H5Odisable_mdc_flushes()...\n");
if(create_file() < 0) {
- fprintf(stderr, "***encounter error\n");
- Hgoto_error(1);
+ HDfprintf(stderr, "***encounter error\n");
+ Hgoto_error(1);
} /* end if */
else
- printf("File created.\n");
+ HDprintf("File created.\n");
- printf("writing to the file\n");
+ HDprintf("writing to the file\n");
if(write_file() < 0) {
- fprintf(stderr, "write_file encountered error\n");
- Hgoto_error(1);
+ HDfprintf(stderr, "write_file encountered error\n");
+ Hgoto_error(1);
}
done:
/* Print result and exit */
if(ret_value != 0)
- printf("Error(s) encountered\n");
+ HDprintf("Error(s) encountered\n");
else
- printf("All passed\n");
+ HDprintf("All passed\n");
return(ret_value);
}
@@ -540,7 +540,7 @@ int
main(void)
{
HDfprintf(stderr, "Non-POSIX platform. Skipping.\n");
- return EXIT_SUCCESS;
+ HDexit(EXIT_SUCCESS);
} /* end main() */
#endif /* H5_HAVE_FORK */
diff --git a/test/vds.c b/test/vds.c
index 66e137f..9c7fd5c 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -55,7 +55,7 @@ const char *FILENAME[] = {
#define FILENAME_BUF_SIZE 1024
-#define TMPDIR "tmp/"
+#define TMPDIR "tmp_vds/"
/*-------------------------------------------------------------------------
@@ -378,7 +378,7 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
TEST_ERROR
if(config == TEST_API_REOPEN_FILE) {
if(oinfo.meta_size.obj.heap_size != exp_meta_size) {
- printf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size);
+ HDprintf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size);
TEST_ERROR
}
}
@@ -619,9 +619,8 @@ test_api(test_api_config_t config, hid_t fapl)
/* Get examination DCPL */
-
- /* Should be a value of 174, not 213. HDFFV-10469 */
- if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)174) < 0)
+ /* Correct previous fix for HDFFV-10469 */
+ if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)213) < 0)
TEST_ERROR
/* Test H5Pget_virtual_count */
@@ -1122,7 +1121,7 @@ error:
} /* end test_api() */
/*-------------------------------------------------------------------------
- * Function: vds_link_prefix
+ * Function: vds_link_prefix_first
*
* Purpose: Set up vds link prefix via H5Pset_virtual_prefix() to be "tmp"
* Should be able to access the target source files in tmp directory via the prefix set
@@ -1133,7 +1132,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-test_vds_prefix(unsigned config, hid_t fapl)
+test_vds_prefix_first(unsigned config, hid_t fapl)
{
char srcfilename[FILENAME_BUF_SIZE];
char srcfilename_map[FILENAME_BUF_SIZE];
@@ -1159,7 +1158,7 @@ test_vds_prefix(unsigned config, hid_t fapl)
int i, j;
char buffer[1024]; /* buffer to read vds_prefix */
- TESTING("basic virtual dataset I/O via H5Pset_vds_prefix()")
+ TESTING("basic virtual dataset I/O via H5Pset_vds_prefix(): all selection")
h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename);
h5_fixname(FILENAME[7], fapl, vfilename2, sizeof vfilename2);
@@ -1192,9 +1191,6 @@ test_vds_prefix(unsigned config, hid_t fapl)
if(HDstrcmp(buffer, TMPDIR) != 0)
FAIL_PUTS_ERROR("vds prefix not set correctly");
- /*
- * Test 1: All - all selection
- */
/* Create source dataspace */
if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR
@@ -1219,11 +1215,14 @@ test_vds_prefix(unsigned config, hid_t fapl)
/* Create source file if requested */
if(config & TEST_IO_DIFFERENT_FILE) {
- HDgetcwd(buffer, 1024);
- HDchdir(TMPDIR);
+ if(NULL == HDgetcwd(buffer, 1024))
+ TEST_ERROR
+ if(HDchdir(TMPDIR) < 0)
+ TEST_ERROR
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- HDchdir(buffer);
+ if(HDchdir(buffer) < 0)
+ TEST_ERROR
}
else {
srcfile[0] = vfile;
@@ -1300,11 +1299,14 @@ test_vds_prefix(unsigned config, hid_t fapl)
/* Reopen srcdset and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
if(config & TEST_IO_DIFFERENT_FILE) {
- HDgetcwd(buffer, 1024);
- HDchdir(TMPDIR);
+ if(NULL == HDgetcwd(buffer, 1024))
+ TEST_ERROR
+ if(HDchdir(TMPDIR) < 0)
+ TEST_ERROR
if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR
- HDchdir(buffer);
+ if(HDchdir(buffer) < 0)
+ TEST_ERROR
}
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
@@ -1347,187 +1349,6 @@ test_vds_prefix(unsigned config, hid_t fapl)
TEST_ERROR
dcpl = -1;
- /*
- * Test 2: All - all selection with ENV prefix
- */
- if(HDsetenv("HDF5_VDS_PREFIX", "${ORIGIN}/tmp", 1))
- TEST_ERROR
-
- /* Create DCPL */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- TEST_ERROR
-
- /* Set fill value */
- if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0)
- TEST_ERROR
-
- /* Set prefix to a nonexistent directory, will be overwritten by environment variable */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
- TEST_ERROR
-
- if(H5Pset_virtual_prefix(dapl, "someprefix") < 0)
- TEST_ERROR
- if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0)
- TEST_ERROR
-
- if(HDstrcmp(buffer, "someprefix") != 0)
- FAIL_PUTS_ERROR("vds prefix not set correctly");
-
- /* Create source dataspace */
- if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
- TEST_ERROR
-
- /* Create virtual dataspace */
- if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
- TEST_ERROR
-
- /* Select all (should not be necessary, but just to be sure) */
- if(H5Sselect_all(srcspace[0]) < 0)
- TEST_ERROR
- if(H5Sselect_all(vspace[0]) < 0)
- TEST_ERROR
-
- /* Add virtual layout mapping */
- if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0)
- TEST_ERROR
-
- /* Create virtual file */
- if((vfile = H5Fcreate(vfilename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
-
- /* Create source file if requested */
- if(config & TEST_IO_DIFFERENT_FILE) {
- HDgetcwd(buffer, 1024);
- HDchdir(TMPDIR);
- if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
- HDchdir(buffer);
- }
- else {
- srcfile[0] = vfile;
- if(H5Iinc_ref(srcfile[0]) < 0)
- TEST_ERROR
- }
-
- /* Create source dataset */
- if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
-
- /* Create virtual dataset */
- if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
- TEST_ERROR
-
- /* Populate write buffer */
- for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
- for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
- buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j;
-
- /* Write data directly to source dataset */
- if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
- TEST_ERROR
-
- /* Close srcdset and srcfile if config option specified */
- if(config & TEST_IO_CLOSE_SRC) {
- if(H5Dclose(srcdset[0]) < 0)
- TEST_ERROR
- srcdset[0] = -1;
-
- if(config & TEST_IO_DIFFERENT_FILE) {
- if(H5Fclose(srcfile[0]) < 0)
- TEST_ERROR
- srcfile[0] = -1;
- }
- }
-
- /* Reopen virtual dataset and file if config option specified */
- if(config & TEST_IO_REOPEN_VIRT) {
- if(H5Dclose(vdset) < 0)
- TEST_ERROR
- vdset = -1;
- if(H5Fclose(vfile) < 0)
- TEST_ERROR
- vfile = -1;
- if((vfile = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0)
- TEST_ERROR
- if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
- TEST_ERROR
- }
-
- /* Read data through virtual dataset */
- HDmemset(rbuf[0], 0, sizeof(rbuf));
- if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
- TEST_ERROR
-
- /* Verify read data */
- for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) {
- for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
- if(rbuf[i][j] != buf[i][j]) {
- TEST_ERROR
- }
- }
-
- /* Adjust write buffer */
- for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
- for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
- buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
-
- /* Write data through virtual dataset */
- if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
- TEST_ERROR
-
- /* Reopen srcdset and srcfile if config option specified */
- if(config & TEST_IO_CLOSE_SRC) {
- if(config & TEST_IO_DIFFERENT_FILE) {
- HDgetcwd(buffer, 1024);
- HDchdir(TMPDIR);
- if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0)
- TEST_ERROR
- HDchdir(buffer);
- }
- if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
- TEST_ERROR
- }
-
- /* Read data directly from source dataset */
- HDmemset(rbuf[0], 0, sizeof(rbuf));
- if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
- TEST_ERROR
-
- /* Verify read data */
- for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
- for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
- if(rbuf[i][j] != buf[i][j])
- TEST_ERROR
-
- /* Close */
- if(H5Dclose(vdset) < 0)
- TEST_ERROR
- vdset = -1;
- if(H5Dclose(srcdset[0]) < 0)
- TEST_ERROR
- srcdset[0] = -1;
- if(H5Fclose(srcfile[0]) < 0)
- TEST_ERROR
- srcfile[0] = -1;
- if(H5Fclose(vfile) < 0)
- TEST_ERROR
- vfile = -1;
- if(H5Sclose(srcspace[0]) < 0)
- TEST_ERROR
- srcspace[0] = -1;
- if(H5Sclose(vspace[0]) < 0)
- TEST_ERROR
- vspace[0] = -1;
- if(H5Pclose(dapl) < 0)
- TEST_ERROR
- dapl = -1;
- if(H5Pclose(dcpl) < 0)
- TEST_ERROR
- dcpl = -1;
-
- if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0)
- TEST_ERROR
-
PASSED();
return 0;
@@ -1539,7 +1360,6 @@ test_vds_prefix(unsigned config, hid_t fapl)
for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
H5Fclose(srcfile[i]);
H5Fclose(vfile);
- H5Fclose(vfile2);
for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
H5Sclose(srcspace[i]);
for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
@@ -1553,7 +1373,7 @@ test_vds_prefix(unsigned config, hid_t fapl)
TEST_ERROR
return 1;
-} /* end vds_link_prefix() */
+} /* end test_vds_prefix */
/*-------------------------------------------------------------------------
@@ -11624,7 +11444,7 @@ main(void)
for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) {
printf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : "");
nerrors += test_basic_io(bit_config, fapl);
- nerrors += test_vds_prefix(bit_config, fapl);
+ nerrors += test_vds_prefix_first(bit_config, fapl);
nerrors += test_unlim(bit_config, fapl);
nerrors += test_printf(bit_config, fapl);
nerrors += test_all(bit_config, fapl);
@@ -11637,14 +11457,14 @@ main(void)
if(nerrors)
goto error;
- printf("All virtual dataset tests passed.\n");
+ HDprintf("All virtual dataset tests passed.\n");
h5_cleanup(FILENAME, fapl);
return EXIT_SUCCESS;
error:
nerrors = MAX(1, nerrors);
- printf("***** %d VIRTUAL DATASET TEST%s FAILED! *****\n",
+ HDprintf("***** %d VIRTUAL DATASET TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
return EXIT_FAILURE;
} /* end main() */
diff --git a/test/vds_env.c b/test/vds_env.c
new file mode 100644
index 0000000..bc3bd59
--- /dev/null
+++ b/test/vds_env.c
@@ -0,0 +1,333 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Neil Fortner <nfortne2@hdfgroup.org>
+ * Monday, February 16, 2015
+ *
+ * Purpose: Tests datasets with virtual layout.
+ */
+#include "h5test.h"
+
+const char *FILENAME[] = {
+ "vds_env_virt_0",
+ "vds_env_virt_3",
+ "vds_env_src_2",
+ "vds_env%%_src2",
+ NULL
+};
+
+/* I/O test config flags */
+#define TEST_IO_CLOSE_SRC 0x01u
+#define TEST_IO_DIFFERENT_FILE 0x02u
+#define TEST_IO_REOPEN_VIRT 0x04u
+#define TEST_IO_NTESTS 0x08u
+
+#define FILENAME_BUF_SIZE 1024
+
+#define TMPDIR "tmp_vds_env/"
+
+/*-------------------------------------------------------------------------
+ * Function: test_vds_prefix_second
+ *
+ * Purpose: Set up vds link prefix via H5Pset_virtual_prefix() to be "tmp"
+ * Should be able to access the target source files in tmp directory via the prefix set
+ * by H5Pset_virtual_prefix()
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+test_vds_prefix_second(unsigned config, hid_t fapl)
+{
+ char srcfilename[FILENAME_BUF_SIZE];
+ char srcfilename_map[FILENAME_BUF_SIZE];
+ char vfilename[FILENAME_BUF_SIZE];
+ char vfilename2[FILENAME_BUF_SIZE];
+ char srcfilenamepct[FILENAME_BUF_SIZE];
+ char srcfilenamepct_map[FILENAME_BUF_SIZE];
+ const char *srcfilenamepct_map_orig = "vds%%%%_src";
+ hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */
+ hid_t vfile = -1; /* File with virtual dset */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t dapl = -1; /* Dataset access property list */
+ hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */
+ hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */
+ hid_t memspace = -1; /* Memory dataspace */
+ hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datsets */
+ hid_t vdset = -1; /* Virtual dataset */
+ hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */
+ int buf[10][26]; /* Write and expected read buffer */
+ int rbuf[10][26]; /* Read buffer */
+ int fill = -1; /* Fill value */
+ int i, j;
+ char buffer[1024]; /* buffer to read vds_prefix */
+
+ TESTING("basic virtual dataset I/O via H5Pset_vds_prefix(): all selection with ENV prefix")
+
+ h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename);
+ h5_fixname(FILENAME[1], fapl, vfilename2, sizeof vfilename2);
+ h5_fixname(FILENAME[2], fapl, srcfilename, sizeof srcfilename);
+ h5_fixname_printf(FILENAME[2], fapl, srcfilename_map, sizeof srcfilename_map);
+ h5_fixname(FILENAME[3], fapl, srcfilenamepct, sizeof srcfilenamepct);
+ h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, sizeof srcfilenamepct_map);
+
+ /* create tmp directory and get current working directory path */
+ if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
+ TEST_ERROR
+
+ /* Create DCPL */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR
+
+ /* Set fill value */
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0)
+ TEST_ERROR
+
+ /* Set prefix to a nonexistent directory, will be overwritten by environment variable */
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ TEST_ERROR
+
+ if(H5Pset_virtual_prefix(dapl, "someprefix") < 0)
+ TEST_ERROR
+ if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0)
+ TEST_ERROR
+
+ if(HDstrcmp(buffer, "someprefix") != 0)
+ FAIL_PUTS_ERROR("vds prefix not set correctly");
+
+ /* Create source dataspace */
+ if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspace */
+ if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Select all (should not be necessary, but just to be sure) */
+ if(H5Sselect_all(srcspace[0]) < 0)
+ TEST_ERROR
+ if(H5Sselect_all(vspace[0]) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mapping */
+ if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0)
+ TEST_ERROR
+
+ /* Create virtual file */
+ if((vfile = H5Fcreate(vfilename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create source file if requested */
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(NULL == HDgetcwd(buffer, 1024))
+ TEST_ERROR
+ if(HDchdir(TMPDIR) < 0)
+ TEST_ERROR
+ if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ if(HDchdir(buffer) < 0)
+ TEST_ERROR
+ }
+ else {
+ srcfile[0] = vfile;
+ if(H5Iinc_ref(srcfile[0]) < 0)
+ TEST_ERROR
+ }
+
+ /* Create source dataset */
+ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataset */
+ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR
+
+ /* Populate write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j;
+
+ /* Write data directly to source dataset */
+ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Close srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ }
+ }
+
+ /* Reopen virtual dataset and file if config option specified */
+ if(config & TEST_IO_REOPEN_VIRT) {
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if((vfile = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data through virtual dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) {
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j]) {
+ TEST_ERROR
+ }
+ }
+
+ /* Adjust write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
+
+ /* Write data through virtual dataset */
+ if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Reopen srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(NULL == HDgetcwd(buffer, 1024))
+ TEST_ERROR
+ if(HDchdir(TMPDIR) < 0)
+ TEST_ERROR
+ if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0)
+ TEST_ERROR
+ if(HDchdir(buffer) < 0)
+ TEST_ERROR
+ }
+ if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data directly from source dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j])
+ TEST_ERROR
+
+ /* Close */
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if(H5Sclose(srcspace[0]) < 0)
+ TEST_ERROR
+ srcspace[0] = -1;
+ if(H5Sclose(vspace[0]) < 0)
+ TEST_ERROR
+ vspace[0] = -1;
+ if(H5Pclose(dapl) < 0)
+ TEST_ERROR
+ dapl = -1;
+ if(H5Pclose(dcpl) < 0)
+ TEST_ERROR
+ dcpl = -1;
+
+ PASSED();
+ return 0;
+
+ error:
+ H5E_BEGIN_TRY {
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(memspace);
+ H5Pclose(dapl);
+ H5Pclose(dcpl);
+ } H5E_END_TRY;
+
+ return 1;
+} /* end test_vds_prefix2 */
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Tests datasets with virtual layout
+ *
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ hid_t fapl;
+ int test_api_config;
+ unsigned bit_config;
+ H5F_libver_t low, high; /* Low and high bounds */
+ unsigned latest = FALSE; /* Using the latest library version bound */
+ int nerrors = 0;
+
+ /* Testing setup */
+ h5_reset();
+ fapl = h5_fileaccess();
+
+ for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) {
+ HDprintf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : "");
+ nerrors += test_vds_prefix_second(bit_config, fapl);
+ }
+
+ /* Verify symbol table messages are cached */
+ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
+
+ if(nerrors)
+ goto error;
+ HDprintf("All virtual dataset tests passed.\n");
+ h5_cleanup(FILENAME, fapl);
+
+ return EXIT_SUCCESS;
+
+error:
+ nerrors = MAX(1, nerrors);
+ HDprintf("***** %d VIRTUAL DATASET TEST%s FAILED! *****\n",
+ nerrors, 1 == nerrors ? "" : "S");
+ return EXIT_FAILURE;
+} /* end main() */
diff --git a/test/vds_swmr.h b/test/vds_swmr.h
index a8e4d50..f2e7a6d 100644
--- a/test/vds_swmr.h
+++ b/test/vds_swmr.h
@@ -128,7 +128,6 @@ static hsize_t PLANES[N_SOURCES][RANK] = {
{1, SM_HEIGHT, WIDTH},
{1, LG_HEIGHT, WIDTH}
};
-static hsize_t VDS_PLANE[RANK] = {1, FULL_HEIGHT, WIDTH};
/* File names for source datasets */
static char FILE_NAMES[N_SOURCES][NAME_LEN] = {
diff --git a/test/vds_swmr_gen.c b/test/vds_swmr_gen.c
index 24c6131..1cb9744 100644
--- a/test/vds_swmr_gen.c
+++ b/test/vds_swmr_gen.c
@@ -61,7 +61,7 @@ main(void)
map_start = 0;
/* All SWMR files need to use the latest file format */
- if((faplid = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ if((faplid = h5_fileaccess()) < 0)
TEST_ERROR
if(H5Pset_libver_bounds(faplid, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
TEST_ERROR
diff --git a/test/vds_swmr_reader.c b/test/vds_swmr_reader.c
index 42721d5..eb9a82b 100644
--- a/test/vds_swmr_reader.c
+++ b/test/vds_swmr_reader.c
@@ -14,10 +14,13 @@
#include "h5test.h"
#include "vds_swmr.h"
+static hsize_t VDS_PLANE[RANK] = {1, FULL_HEIGHT, WIDTH};
+
int
main(void)
{
hid_t fid = -1; /* HDF5 file ID */
+ hid_t faplid = -1; /* file access property list ID */
hid_t did = -1; /* dataset ID */
hid_t msid = -1; /* memory dataspace ID */
hid_t fsid = -1; /* file dataspace ID */
@@ -34,7 +37,9 @@ main(void)
/* Open the VDS file and dataset */
- if((fid = H5Fopen(VDS_FILE_NAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, H5P_DEFAULT)) < 0)
+ if((faplid = h5_fileaccess()) < 0)
+ TEST_ERROR
+ if((fid = H5Fopen(VDS_FILE_NAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, faplid)) < 0)
TEST_ERROR
if((did = H5Dopen2(fid, VDS_DSET_NAME, H5P_DEFAULT)) < 0)
TEST_ERROR
@@ -97,13 +102,14 @@ main(void)
TEST_ERROR
if(H5Dread(did, H5T_NATIVE_INT, msid, fsid, H5P_DEFAULT, buffer) < 0)
TEST_ERROR
-
if(H5Sclose(fsid) < 0)
TEST_ERROR
} while (dims[0] < N_PLANES_TO_WRITE);
/* Close file and dataset */
+ if(H5Pclose(faplid) < 0)
+ TEST_ERROR
if(H5Sclose(msid) < 0)
TEST_ERROR
if(H5Dclose(did) < 0)
@@ -121,6 +127,8 @@ error:
H5E_BEGIN_TRY {
if(fid >= 0)
(void)H5Fclose(fid);
+ if(faplid >= 0)
+ (void)H5Pclose(faplid);
if(did >= 0)
(void)H5Dclose(did);
if(msid >= 0)
diff --git a/test/vds_swmr_writer.c b/test/vds_swmr_writer.c
index 7824aa0..d62ecaf 100644
--- a/test/vds_swmr_writer.c
+++ b/test/vds_swmr_writer.c
@@ -56,7 +56,7 @@ main(int argc, char *argv[])
/* Open the source file and dataset */
/* All SWMR files need to use the latest file format */
- if((faplid = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ if((faplid = h5_fileaccess()) < 0)
TEST_ERROR
if(H5Pset_libver_bounds(faplid, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
TEST_ERROR
diff --git a/test/vfd.c b/test/vfd.c
index dfc5047..68fe0bd 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -58,6 +58,7 @@ const char *FILENAME[] = {
"stdio_file", /*7*/
"windows_file", /*8*/
"new_multi_file_v16",/*9*/
+ "ro_s3_file", /*10*/
NULL
};
@@ -66,7 +67,7 @@ const char *FILENAME[] = {
#define COMPAT_BASENAME "family_v16_"
#define MULTI_COMPAT_BASENAME "multi_file_v16"
-
+
/*-------------------------------------------------------------------------
* Function: test_sec2
*
@@ -178,7 +179,7 @@ error:
return -1;
} /* end test_sec2() */
-
+
/*-------------------------------------------------------------------------
* Function: test_core
*
@@ -412,8 +413,8 @@ test_core(void)
for(j = 0; j < CORE_DSET_DIM2; j++)
if(*pr++ != *pw++) {
H5_FAILED();
- printf(" Read different values than written in data set.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written in data set.\n");
+ HDprintf(" At index %d,%d\n", i, j);
TEST_ERROR;
} /* end if */
@@ -480,8 +481,8 @@ test_core(void)
for(j = 0; j < CORE_DSET_DIM2; j++)
if(*pw++ != *pr++) {
H5_FAILED();
- printf(" Read different values than written in data set.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written in data set.\n");
+ HDprintf(" At index %d,%d\n", i, j);
TEST_ERROR;
} /* end if */
@@ -534,7 +535,7 @@ error:
return -1;
} /* end test_core() */
-
+
/*-------------------------------------------------------------------------
* Function: test_direct
*
@@ -597,7 +598,7 @@ test_direct(void)
if(file<0) {
H5Pclose (fapl);
SKIPPED();
- printf(" Probably the file system doesn't support Direct I/O\n");
+ HDprintf(" Probably the file system doesn't support Direct I/O\n");
return 0;
}
@@ -674,8 +675,8 @@ test_direct(void)
for(j = 0; j < DSET1_DIM2; j++)
if(*p1++ != *p2++) {
H5_FAILED();
- printf(" Read different values than written in data set 1.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written in data set 1.\n");
+ HDprintf(" At index %d,%d\n", i, j);
TEST_ERROR;
} /* end if */
@@ -706,8 +707,8 @@ test_direct(void)
for(i = 0; i < DSET2_DIM; i++)
if(wdata2[i] != rdata2[i]) {
H5_FAILED();
- printf(" Read different values than written in data set 2.\n");
- printf(" At index %d\n", i);
+ HDprintf(" Read different values than written in data set 2.\n");
+ HDprintf(" At index %d\n", i);
TEST_ERROR;
} /* end if */
@@ -754,7 +755,7 @@ error:
#endif /*H5_HAVE_DIRECT*/
}
-
+
/*-------------------------------------------------------------------------
* Function: test_family_opens
*
@@ -769,6 +770,14 @@ error:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'first_name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static herr_t
test_family_opens(char *fname, hid_t fa_pl)
{
@@ -825,8 +834,9 @@ test_family_opens(char *fname, hid_t fa_pl)
error:
return -1;
} /* end test_family_opens() */
+#pragma GCC diagnostic pop
+
-
/*-------------------------------------------------------------------------
* Function: test_family
*
@@ -1008,7 +1018,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_family_compat
*
@@ -1027,6 +1037,14 @@ error:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'newname_individual', etc. in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static herr_t
test_family_compat(void)
{
@@ -1110,26 +1128,34 @@ error:
return -1;
} /* end test_family_compat() */
+#pragma GCC diagnostic pop
+
-
/*-------------------------------------------------------------------------
* Function: test_multi_opens
*
* Purpose: Private function for test_multi() to tests wrong ways of
* reopening multi file.
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
* Programmer: Raymond Lu
* Thursday, May 19, 2005
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'sf_name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static herr_t
test_multi_opens(char *fname)
{
- hid_t file=-1;
+ hid_t fid = H5I_INVALID_HID;
char super_name[1024]; /*name string "%%s-s.h5"*/
char sf_name[1024]; /*name string "multi_file-s.h5"*/
@@ -1138,20 +1164,20 @@ test_multi_opens(char *fname)
HDsnprintf(sf_name, sizeof(sf_name), super_name, fname);
H5E_BEGIN_TRY {
- file = H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid = H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT);
} H5E_END_TRY;
- return(file >= 0 ? -1 : 0);
-}
+ return(fid >= 0 ? FAIL : SUCCEED);
+} /* end test_multi_opens() */
+#pragma GCC diagnostic pop
+
-
/*-------------------------------------------------------------------------
* Function: test_multi
*
* Purpose: Tests the file handle interface for MUTLI driver
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
* Programmer: Raymond Lu
* Tuesday, Sept 24, 2002
@@ -1201,19 +1227,19 @@ test_multi(void)
memb_map[H5FD_MEM_BTREE] = H5FD_MEM_BTREE;
memb_map[H5FD_MEM_GHEAP] = H5FD_MEM_GHEAP;
- sprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's');
+ HDsprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's');
memb_name[H5FD_MEM_SUPER] = sv[H5FD_MEM_SUPER];
memb_addr[H5FD_MEM_SUPER] = 0;
- sprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b');
+ HDsprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b');
memb_name[H5FD_MEM_BTREE] = sv[H5FD_MEM_BTREE];
memb_addr[H5FD_MEM_BTREE] = HADDR_MAX/4;
- sprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r');
+ HDsprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r');
memb_name[H5FD_MEM_DRAW] = sv[H5FD_MEM_DRAW];
memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2;
- sprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g');
+ HDsprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g');
memb_name[H5FD_MEM_GHEAP] = sv[H5FD_MEM_GHEAP];
memb_addr[H5FD_MEM_GHEAP] = (HADDR_MAX/4)*3;
@@ -1365,7 +1391,7 @@ test_multi(void)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -1374,11 +1400,12 @@ error:
H5Pclose(fapl);
H5Pclose(fapl2);
H5Fclose(file);
+ H5Aclose(attr);
} H5E_END_TRY;
- return -1;
-}
+ return FAIL;
+} /* end test_multi() */
+
-
/*-------------------------------------------------------------------------
* Function: test_multi_compat
*
@@ -1432,12 +1459,12 @@ test_multi_compat(void)
memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
memb_fapl[H5FD_MEM_SUPER] = H5P_DEFAULT;
- sprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's');
+ HDsprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's');
memb_name[H5FD_MEM_SUPER] = sv[H5FD_MEM_SUPER];
memb_addr[H5FD_MEM_SUPER] = 0;
memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT;
- sprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r');
+ HDsprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r');
memb_name[H5FD_MEM_DRAW] = sv[H5FD_MEM_DRAW];
memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2;
@@ -1447,17 +1474,19 @@ test_multi_compat(void)
h5_fixname(FILENAME[9], fapl, newname, sizeof newname);
/* Make copy for the data file in the build directory, to protect the
- * original file in the source directory */
- sprintf(filename_s, "%s-%c.h5", MULTI_COMPAT_BASENAME, 's');
- sprintf(newname_s, "%s-%c.h5", FILENAME[9], 's');
+ * original file in the source directory
+ */
+ HDsprintf(filename_s, "%s-%c.h5", MULTI_COMPAT_BASENAME, 's');
+ HDsprintf(newname_s, "%s-%c.h5", FILENAME[9], 's');
h5_make_local_copy(filename_s, newname_s);
- sprintf(filename_r, "%s-%c.h5", MULTI_COMPAT_BASENAME, 'r');
- sprintf(newname_r, "%s-%c.h5", FILENAME[9], 'r');
+ HDsprintf(filename_r, "%s-%c.h5", MULTI_COMPAT_BASENAME, 'r');
+ HDsprintf(newname_r, "%s-%c.h5", FILENAME[9], 'r');
h5_make_local_copy(filename_r, newname_r);
/* Reopen the file for read only. Verify 1.8 library can open file
- * created with 1.6 library. */
+ * created with 1.6 library.
+ */
if((file=H5Fopen(newname, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR;
@@ -1550,7 +1579,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_log
*
@@ -1661,7 +1690,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_stdio
*
@@ -1766,7 +1795,7 @@ error:
}
-
+
/*-------------------------------------------------------------------------
* Function: test_windows
*
@@ -1888,7 +1917,104 @@ error:
} /* end test_windows() */
-
+/*-------------------------------------------------------------------------
+ * Function: test_ros3
+ *
+ * Purpose: Tests the file handle interface for the ROS3 driver
+ *
+ * As the ROS3 driver is 1) read only, 2) requires access
+ * to an S3 server (minio for now), this test is quite
+ * different from the other tests.
+ *
+ * For now, test only fapl & flags. Extend as the
+ * work on the VFD continues.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: John Mainzer
+ * 7/12/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_ros3(void)
+{
+#ifdef H5_HAVE_ROS3_VFD
+ hid_t fid = -1; /* file ID */
+ hid_t fapl_id = -1; /* file access property list ID */
+ hid_t fapl_id_out = -1; /* from H5Fget_access_plist */
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
+ char filename[1024]; /* filename */
+ void *os_file_handle = NULL; /* OS file handle */
+ hsize_t file_size; /* file size */
+ H5FD_ros3_fapl_t test_ros3_fa;
+ H5FD_ros3_fapl_t ros3_fa_0 =
+ {
+ /* version = */ H5FD_CURR_ROS3_FAPL_T_VERSION,
+ /* authenticate = */ FALSE,
+ /* aws_region = */ "",
+ /* secret_id = */ "",
+ /* secret_key = */ "plugh",
+ };
+#endif /*H5_HAVE_ROS3_VFD */
+
+ TESTING("Read-only S3 file driver");
+
+#ifndef H5_HAVE_ROS3_VFD
+ SKIPPED();
+ return 0;
+#else /* H5_HAVE_ROS3_VFD */
+
+ /* Set property list and file name for ROS3 driver. */
+ if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ TEST_ERROR;
+
+ if(H5Pset_fapl_ros3(fapl_id, &ros3_fa_0) < 0)
+ TEST_ERROR;
+
+ /* verify that the ROS3 FAPL entry is set as expected */
+ if(H5Pget_fapl_ros3(fapl_id, &test_ros3_fa) < 0)
+ TEST_ERROR;
+
+ /* need a macro to compare instances of H5FD_ros3_fapl_t */
+ if((test_ros3_fa.version != ros3_fa_0.version) ||
+ (test_ros3_fa.authenticate != ros3_fa_0.authenticate) ||
+ (strcmp(test_ros3_fa.aws_region, ros3_fa_0.aws_region) != 0) ||
+ (strcmp(test_ros3_fa.secret_id, ros3_fa_0.secret_id) != 0) ||
+ (strcmp(test_ros3_fa.secret_key, ros3_fa_0.secret_key) != 0))
+ TEST_ERROR;
+
+ h5_fixname(FILENAME[10], fapl_id, filename, sizeof(filename));
+
+ /* Check that the VFD feature flags are correct */
+ if ((driver_id = H5Pget_driver(fapl_id)) < 0)
+ TEST_ERROR;
+
+ if (H5FDdriver_query(driver_id, &driver_flags) < 0)
+ TEST_ERROR;
+
+ if(!(driver_flags & H5FD_FEAT_DATA_SIEVE))
+ TEST_ERROR
+
+ /* Check for extra flags not accounted for above */
+ if(driver_flags != (H5FD_FEAT_DATA_SIEVE))
+ TEST_ERROR
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(fapl_id);
+ H5Pclose(fapl_id_out);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ return -1;
+#endif /* H5_HAVE_ROS3_VFD */
+} /* end test_ros3() */
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -1921,6 +2047,7 @@ main(void)
nerrors += test_log() < 0 ? 1 : 0;
nerrors += test_stdio() < 0 ? 1 : 0;
nerrors += test_windows() < 0 ? 1 : 0;
+ nerrors += test_ros3() < 0 ? 1 : 0;
if(nerrors) {
HDprintf("***** %d Virtual File Driver TEST%s FAILED! *****\n",
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index 71459c7..51c3420 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -22,24 +22,40 @@ set (testphdf5_SOURCES
#-- Adding test for testhdf5
add_executable (testphdf5 ${testphdf5_SOURCES})
-target_include_directories(testphdf5
+target_include_directories (testphdf5
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
-TARGET_C_PROPERTIES (testphdf5 STATIC)
-target_link_libraries (testphdf5
- PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
-)
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (testphdf5 STATIC)
+ target_link_libraries (testphdf5
+ PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
+ )
+else ()
+ TARGET_C_PROPERTIES (testphdf5 SHARED)
+ target_link_libraries (testphdf5
+ PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
+ )
+endif ()
set_target_properties (testphdf5 PROPERTIES FOLDER test/par)
MACRO (ADD_H5P_EXE file)
add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c)
- target_include_directories(${file}
+ target_include_directories (${file}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
- TARGET_C_PROPERTIES (${file} STATIC)
- target_link_libraries (${file}
- PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
- )
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (${file} STATIC)
+ target_link_libraries (${file}
+ PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
+ $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
+ )
+ else ()
+ TARGET_C_PROPERTIES (${file} SHARED)
+ target_link_libraries (${file}
+ PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
+ $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
+ )
+ endif ()
set_target_properties (${file} PROPERTIES FOLDER test/par)
ENDMACRO (ADD_H5P_EXE file)
@@ -47,7 +63,7 @@ set (H5P_TESTS
t_mpi
t_bigio
t_cache
- #t_cache_image
+ t_cache_image
t_pflush1
t_pflush2
t_pread
@@ -58,8 +74,8 @@ set (H5P_TESTS
t_filters_parallel
)
-foreach (testp ${H5P_TESTS})
- ADD_H5P_EXE(${testp})
+foreach (h5_testp ${H5P_TESTS})
+ ADD_H5P_EXE(${h5_testp})
endforeach ()
include (CMakeTests.cmake)
diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake
index 12ccc58..5848c60 100644
--- a/testpar/CMakeTests.cmake
+++ b/testpar/CMakeTests.cmake
@@ -16,19 +16,32 @@
##############################################################################
##############################################################################
# Remove any output file left over from previous test run
-add_test (NAME MPI_TEST-clear-testphdf5-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ParaTest.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_PAR_BINARY_DIR}
+add_test (
+ NAME MPI_TEST-clear-testphdf5-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ParaTest.h5
+ WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR}
)
set_tests_properties (MPI_TEST-clear-testphdf5-objects PROPERTIES FIXTURES_SETUP par_clear_testphdf5)
+set (SKIP_tests
+ cchunk1
+ cchunk2
+ cchunk3
+ cchunk4
+ ecdsetw
+ eidsetw2
+ selnone
+ cngrpw-ingrpr
+ cschunkw
+ ccchunkw
+ tldsc
+ actualio
+ MC_coll_MD_read
+)
set (SKIP_testphdf5 "")
-#if (${HDF5_OPENMPI_VERSION_SKIP})
-# set (SKIP_testphdf5 "${SKIP_testphdf5};-x;ecdsetw")
-#endif ()
+foreach (skiptest ${SKIP_tests})
+ set (SKIP_testphdf5 "${SKIP_testphdf5};-x;${skiptest}")
+endforeach ()
add_test (NAME MPI_TEST_testphdf5 COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:testphdf5> ${MPIEXEC_POSTFLAGS} ${SKIP_testphdf5})
set_tests_properties (MPI_TEST_testphdf5 PROPERTIES
@@ -36,15 +49,32 @@ set_tests_properties (MPI_TEST_testphdf5 PROPERTIES
ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_PAR_BINARY_DIR}"
WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR}
)
-if (NOT "${last_test}" STREQUAL "")
+if (last_test)
set_tests_properties (MPI_TEST_testphdf5 PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "MPI_TEST_testphdf5")
-#if (${HDF5_OPENMPI_VERSION_SKIP})
+#execute the skipped tests
+foreach (skiptest ${SKIP_tests})
+ add_test (NAME MPI_TEST_testphdf5_${skiptest} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:testphdf5> ${MPIEXEC_POSTFLAGS} -o ${skiptest})
+ set_tests_properties (MPI_TEST_testphdf5_${skiptest} PROPERTIES
+ FIXTURES_REQUIRED par_clear_testphdf5
+ ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_PAR_BINARY_DIR}"
+ WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR}
+ )
+ if (last_test)
+ set_tests_properties (MPI_TEST_testphdf5_${skiptest} PROPERTIES DEPENDS ${last_test})
+ endif ()
+ set (last_test "MPI_TEST_testphdf5_${skiptest}")
+endforeach ()
+
+#if (HDF5_OPENMPI_VERSION_SKIP)
# list (REMOVE_ITEM H5P_TESTS t_shapesame)
#endif ()
+# do not test until new version is added
+list (REMOVE_ITEM H5P_TESTS t_cache_image)
+
set (test_par_CLEANFILES
t_cache_image_00.h5
t_cache_image_01.h5
@@ -65,26 +95,24 @@ set (test_par_CLEANFILES
)
# Remove any output file left over from previous test run
-add_test (NAME MPI_TEST-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${test_par_CLEANFILES}
- WORKING_DIRECTORY
- ${HDF5_TEST_PAR_BINARY_DIR}
+add_test (
+ NAME MPI_TEST-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${test_par_CLEANFILES}
+ WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR}
)
set_tests_properties (MPI_TEST-clear-objects PROPERTIES FIXTURES_SETUP par_clear_objects)
-foreach (testp ${H5P_TESTS})
- add_test (NAME MPI_TEST_${testp} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:${testp}> ${MPIEXEC_POSTFLAGS})
- set_tests_properties (MPI_TEST_${testp} PROPERTIES
+foreach (h5_testp ${H5P_TESTS})
+ add_test (NAME MPI_TEST_${h5_testp} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:${h5_testp}> ${MPIEXEC_POSTFLAGS})
+ set_tests_properties (MPI_TEST_${h5_testp} PROPERTIES
FIXTURES_REQUIRED par_clear_objects
ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_PAR_BINARY_DIR}"
WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR}
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (MPI_TEST_${testp} PROPERTIES DEPENDS ${last_test})
+ if (last_test)
+ set_tests_properties (MPI_TEST_${h5_testp} PROPERTIES DEPENDS ${last_test})
endif ()
- set (last_test "MPI_TEST_${testp}")
+ set (last_test "MPI_TEST_${h5_testp}")
endforeach ()
# The t_pflush1 test is hard-coded to fail.
diff --git a/testpar/CMakeVFDTests.cmake b/testpar/CMakeVFDTests.cmake
index de16a31..d21de10 100644
--- a/testpar/CMakeVFDTests.cmake
+++ b/testpar/CMakeVFDTests.cmake
@@ -15,59 +15,61 @@
### T E S T I N G ###
##############################################################################
##############################################################################
- set (VFD_LIST
- sec2
- stdio
- core
- split
- multi
- family
- )
+set (VFD_LIST
+ sec2
+ stdio
+ core
+ split
+ multi
+ family
+)
- set (H5P_VFD_TESTS
- t_pflush1
- t_pflush2
- )
+set (H5P_VFD_TESTS
+ t_pflush1
+ t_pflush2
+)
- if (DIRECT_VFD)
- set (VFD_LIST ${VFD_LIST} direct)
- endif ()
+if (DIRECT_VFD)
+ set (VFD_LIST ${VFD_LIST} direct)
+endif ()
foreach (vfdtest ${VFD_LIST})
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}")
endforeach ()
- macro (ADD_VFD_TEST vfdname resultcode)
- if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- foreach (test ${H5P_VFD_TESTS})
- add_test (
- NAME MPI_TEST_VFD-${vfdname}-${test}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${vfdname}-shared/${vfdname}-${test}.out
- ${vfdname}-shared/${vfdname}-${test}.out.err
- )
- add_test (
- NAME MPI_TEST_VFD-${vfdname}-${test}
+macro (ADD_VFD_TEST vfdname resultcode)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ foreach (h5_test ${H5P_VFD_TESTS})
+ add_test (
+ NAME MPI_TEST_VFD-${vfdname}-${h5_test}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${test}>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:${h5_test}>"
-D "TEST_ARGS:STRING="
-D "TEST_VFD:STRING=${vfdname}"
-D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${test}.out"
+ -D "TEST_OUTPUT=${vfdname}-${h5_test}.out"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
-P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (MPI_TEST_VFD-${vfdname}-${test} PROPERTIES
- DEPENDS MPI_TEST_VFD-${vfdname}-${test}-clear-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_PAR_BINARY_DIR}/${vfdname}"
- WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR}/${vfdname}
- )
- endforeach ()
- endif ()
- endmacro ()
+ )
+ set_tests_properties (MPI_TEST_VFD-${vfdname}-${h5_test} PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_PAR_BINARY_DIR}/${vfdname}"
+ WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR}/${vfdname}
+ )
+ endforeach ()
+ set_tests_properties (MPI_TEST_VFD-${vfdname}-pflush1 PROPERTIES WILL_FAIL "true")
+ #set_property (TEST MPI_TEST_t_pflush1 PROPERTY PASS_REGULAR_EXPRESSION "PASSED")
+ set_tests_properties (MPI_TEST_VFD-${vfdname}-pflush2 PROPERTIES DEPENDS MPI_TEST_VFD-${vfdname}-pflush1)
+ endif ()
+endmacro ()
+
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
- # Run test with different Virtual File Driver
- foreach (vfd ${VFD_LIST})
- ADD_VFD_TEST (${vfd} 0)
- endforeach ()
+# Run test with different Virtual File Driver
+foreach (h5_vfd ${VFD_LIST})
+ ADD_VFD_TEST (${h5_vfd} 0)
+endforeach ()
diff --git a/testpar/Makefile.in b/testpar/Makefile.in
index 7afbfad..05819f4 100644
--- a/testpar/Makefile.in
+++ b/testpar/Makefile.in
@@ -539,7 +539,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -562,9 +561,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -591,6 +593,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -645,6 +648,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -669,7 +673,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1396,7 +1399,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c
index 1d882b8..9ca077c 100644
--- a/testpar/t_bigio.c
+++ b/testpar/t_bigio.c
@@ -1,7 +1,7 @@
#include "hdf5.h"
#include "testphdf5.h"
-#include "H5Dprivate.h" /* For Chunk tests */
+#include "H5Dprivate.h" /* For Chunk tests */
/* FILENAME and filenames must have the same number of names */
const char *FILENAME[2]={ "bigio_test.h5",
@@ -17,7 +17,7 @@ const char *FILENAME[2]={ "bigio_test.h5",
#define MAINPROCESS (!mpi_rank) /* define process 0 as main process */
/* Constants definitions */
-#define RANK 2
+#define RANK 2
#define IN_ORDER 1
#define OUT_OF_ORDER 2
@@ -33,12 +33,12 @@ const char *FILENAME[2]={ "bigio_test.h5",
#define HYPER 1
#define POINT 2
-#define ALL 3
+#define ALL 3
/* Dataset data type. Int's can be easily octo dumped. */
typedef hsize_t B_DATATYPE;
-int facc_type = FACC_MPIO; /*Test file access type */
+int facc_type = FACC_MPIO; /*Test file access type */
int dxfer_coll_type = DXFER_COLLECTIVE_IO;
size_t bigcount = DXFER_BIGCOUNT;
int nerrors = 0;
@@ -54,12 +54,12 @@ hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type);
/*
* Setup the coordinates for point selection.
*/
-static void
+static void
set_coords(hsize_t start[],
hsize_t count[],
hsize_t stride[],
hsize_t block[],
- size_t num_points,
+ size_t num_points,
hsize_t coords[],
int order)
{
@@ -99,10 +99,10 @@ fill_datasets(hsize_t start[], hsize_t block[], B_DATATYPE * dataset)
/* put some trivial data in the data_array */
for (i=0; i < block[0]; i++){
- for (j=0; j < block[1]; j++){
- *dataptr = (B_DATATYPE)((i+start[0])*100 + (j+start[1]+1));
- dataptr++;
- }
+ for (j=0; j < block[1]; j++){
+ *dataptr = (B_DATATYPE)((i+start[0])*100 + (j+start[1]+1));
+ dataptr++;
+ }
}
}
@@ -113,7 +113,7 @@ void point_set(hsize_t start[],
hsize_t count[],
hsize_t stride[],
hsize_t block[],
- size_t num_points,
+ size_t num_points,
hsize_t coords[],
int order)
{
@@ -143,13 +143,13 @@ void point_set(hsize_t start[],
}
if(VERBOSE_MED) {
- printf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n",
+ HDprintf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n",
(unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
(unsigned long)(block[0] * block[1] * count[0] * count[1]));
k = 0;
for(i = 0; i < num_points ; i++) {
- printf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]);
+ HDprintf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]);
k += 2;
}
}
@@ -165,19 +165,19 @@ dataset_print(hsize_t start[], hsize_t block[], B_DATATYPE * dataset)
hsize_t i, j;
/* print the column heading */
- printf("%-8s", "Cols:");
+ HDprintf("%-8s", "Cols:");
for (j=0; j < block[1]; j++){
- printf("%3lu ", (unsigned long)(start[1]+j));
+ HDprintf("%3lu ", (unsigned long)(start[1]+j));
}
- printf("\n");
+ HDprintf("\n");
/* print the slab data */
for (i=0; i < block[0]; i++){
- printf("Row %2lu: ", (unsigned long)(i+start[0]));
- for (j=0; j < block[1]; j++){
- printf("%llu ", *dataptr++);
- }
- printf("\n");
+ HDprintf("Row %2lu: ", (unsigned long)(i+start[0]));
+ for (j=0; j < block[1]; j++){
+ HDprintf("%llu ", *dataptr++);
+ }
+ HDprintf("\n");
}
}
@@ -193,90 +193,90 @@ verify_data(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[],
/* print it if VERBOSE_MED */
if(VERBOSE_MED) {
- printf("verify_data dumping:::\n");
- printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
- (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
- (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
- printf("original values:\n");
- dataset_print(start, block, original);
- printf("compared values:\n");
- dataset_print(start, block, dataset);
+ HDprintf("verify_data dumping:::\n");
+ HDprintf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
+ HDprintf("original values:\n");
+ dataset_print(start, block, original);
+ HDprintf("compared values:\n");
+ dataset_print(start, block, dataset);
}
vrfyerrs = 0;
for (i=0; i < block[0]; i++){
- for (j=0; j < block[1]; j++){
- if(*dataset != *original){
- if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
- printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %llu, got %llu\n",
+ for (j=0; j < block[1]; j++){
+ if(*dataset != *original){
+ if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
+ HDprintf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %llu, got %llu\n",
(unsigned long)i, (unsigned long)j,
(unsigned long)(i+start[0]), (unsigned long)(j+start[1]),
*(original), *(dataset));
- }
- dataset++;
- original++;
- }
- }
+ }
+ dataset++;
+ original++;
+ }
+ }
}
if(vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("[more errors ...]\n");
+ HDprintf("[more errors ...]\n");
if(vrfyerrs)
- printf("%d errors found in verify_data\n", vrfyerrs);
+ HDprintf("%d errors found in verify_data\n", vrfyerrs);
return(vrfyerrs);
}
/* Set up the selection */
static void
ccslab_set(int mpi_rank,
- int mpi_size,
- hsize_t start[],
- hsize_t count[],
- hsize_t stride[],
- hsize_t block[],
- int mode)
+ int mpi_size,
+ hsize_t start[],
+ hsize_t count[],
+ hsize_t stride[],
+ hsize_t block[],
+ int mode)
{
switch (mode){
case BYROW_CONT:
- /* Each process takes a slabs of rows. */
- block[0] = 1;
- block[1] = 1;
- stride[0] = 1;
- stride[1] = 1;
- count[0] = space_dim1;
- count[1] = space_dim2;
- start[0] = mpi_rank*count[0];
- start[1] = 0;
-
- break;
+ /* Each process takes a slabs of rows. */
+ block[0] = 1;
+ block[1] = 1;
+ stride[0] = 1;
+ stride[1] = 1;
+ count[0] = space_dim1;
+ count[1] = space_dim2;
+ start[0] = mpi_rank*count[0];
+ start[1] = 0;
+
+ break;
case BYROW_DISCONT:
- /* Each process takes several disjoint blocks. */
- block[0] = 1;
- block[1] = 1;
+ /* Each process takes several disjoint blocks. */
+ block[0] = 1;
+ block[1] = 1;
stride[0] = 3;
stride[1] = 3;
count[0] = space_dim1/(stride[0]*block[0]);
count[1] = (space_dim2)/(stride[1]*block[1]);
- start[0] = space_dim1*mpi_rank;
- start[1] = 0;
+ start[0] = space_dim1*mpi_rank;
+ start[1] = 0;
- break;
+ break;
case BYROW_SELECTNONE:
- /* Each process takes a slabs of rows, there are
+ /* Each process takes a slabs of rows, there are
no selections for the last process. */
- block[0] = 1;
- block[1] = 1;
- stride[0] = 1;
- stride[1] = 1;
- count[0] = ((mpi_rank >= MAX(1,(mpi_size-2)))?0:space_dim1);
- count[1] = space_dim2;
- start[0] = mpi_rank*count[0];
- start[1] = 0;
+ block[0] = 1;
+ block[1] = 1;
+ stride[0] = 1;
+ stride[1] = 1;
+ count[0] = ((mpi_rank >= MAX(1,(mpi_size-2)))?0:space_dim1);
+ count[1] = space_dim2;
+ start[0] = mpi_rank*count[0];
+ start[1] = 0;
- break;
+ break;
case BYROW_SELECTUNBALANCE:
/* The first one-third of the number of processes only
@@ -284,14 +284,14 @@ ccslab_set(int mpi_rank,
half of the domain. */
block[0] = 1;
- count[0] = 2;
+ count[0] = 2;
stride[0] = space_dim1*mpi_size/4+1;
block[1] = space_dim2;
count[1] = 1;
start[1] = 0;
stride[1] = 1;
- if((mpi_rank *3)<(mpi_size*2)) start[0] = mpi_rank;
- else start[0] = 1 + space_dim1*mpi_size/2 + (mpi_rank-2*mpi_size/3);
+ if((mpi_rank *3)<(mpi_size*2)) start[0] = mpi_rank;
+ else start[0] = 1 + space_dim1*mpi_size/2 + (mpi_rank-2*mpi_size/3);
break;
case BYROW_SELECTINCHUNK:
@@ -299,33 +299,33 @@ ccslab_set(int mpi_rank,
block[0] = 1;
count[0] = 1;
- start[0] = mpi_rank*space_dim1;
+ start[0] = mpi_rank*space_dim1;
stride[0]= 1;
- block[1] = space_dim2;
- count[1] = 1;
- stride[1]= 1;
- start[1] = 0;
+ block[1] = space_dim2;
+ count[1] = 1;
+ stride[1]= 1;
+ start[1] = 0;
break;
default:
- /* Unknown mode. Set it to cover the whole dataset. */
- block[0] = space_dim1*mpi_size;
- block[1] = space_dim2;
- stride[0] = block[0];
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = 0;
- start[1] = 0;
-
- break;
+ /* Unknown mode. Set it to cover the whole dataset. */
+ block[0] = space_dim1*mpi_size;
+ block[1] = space_dim2;
+ stride[0] = block[0];
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = 0;
+ start[1] = 0;
+
+ break;
}
if (VERBOSE_MED){
- printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
- (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
- (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
- (unsigned long)(block[0]*block[1]*count[0]*count[1]));
+ HDprintf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
+ (unsigned long)(block[0]*block[1]*count[0]*count[1]));
}
}
@@ -336,10 +336,10 @@ ccslab_set(int mpi_rank,
*/
static void
ccdataset_fill(hsize_t start[],
- hsize_t stride[],
- hsize_t count[],
- hsize_t block[],
- DATATYPE * dataset,
+ hsize_t stride[],
+ hsize_t count[],
+ hsize_t block[],
+ DATATYPE * dataset,
int mem_selection)
{
DATATYPE *dataptr = dataset;
@@ -377,28 +377,28 @@ ccdataset_fill(hsize_t start[],
*/
static void
ccdataset_print(hsize_t start[],
- hsize_t block[],
- DATATYPE * dataset)
+ hsize_t block[],
+ DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
hsize_t i, j;
/* print the column heading */
- printf("Print only the first block of the dataset\n");
- printf("%-8s", "Cols:");
+ HDprintf("Print only the first block of the dataset\n");
+ HDprintf("%-8s", "Cols:");
for (j=0; j < block[1]; j++){
- printf("%3lu ", (unsigned long)(start[1]+j));
+ HDprintf("%3lu ", (unsigned long)(start[1]+j));
}
- printf("\n");
+ HDprintf("\n");
/* print the slab data */
for (i=0; i < block[0]; i++){
- printf("Row %2lu: ", (unsigned long)(i+start[0]));
- for (j=0; j < block[1]; j++){
- printf("%03d ", *dataptr++);
- }
- printf("\n");
+ HDprintf("Row %2lu: ", (unsigned long)(i+start[0]));
+ for (j=0; j < block[1]; j++){
+ HDprintf("%03d ", *dataptr++);
+ }
+ HDprintf("\n");
}
}
@@ -407,11 +407,11 @@ ccdataset_print(hsize_t start[],
*/
static int
ccdataset_vrfy(hsize_t start[],
- hsize_t count[],
- hsize_t stride[],
- hsize_t block[],
- DATATYPE *dataset,
- DATATYPE *original,
+ hsize_t count[],
+ hsize_t stride[],
+ hsize_t block[],
+ DATATYPE *dataset,
+ DATATYPE *original,
int mem_selection)
{
hsize_t i, j,k1,k2,k=0;
@@ -420,14 +420,14 @@ ccdataset_vrfy(hsize_t start[],
/* print it if VERBOSE_MED */
if (VERBOSE_MED) {
- printf("dataset_vrfy dumping:::\n");
- printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
- (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
- (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
- printf("original values:\n");
- ccdataset_print(start, block, original);
- printf("compared values:\n");
- ccdataset_print(start, block, dataset);
+ HDprintf("dataset_vrfy dumping:::\n");
+ HDprintf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
+ HDprintf("original values:\n");
+ ccdataset_print(start, block, original);
+ HDprintf("compared values:\n");
+ ccdataset_print(start, block, dataset);
}
vrfyerrs = 0;
@@ -449,7 +449,7 @@ ccdataset_vrfy(hsize_t start[],
}
if (*dataptr != *oriptr){
if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
- printf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n",
+ HDprintf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n",
(unsigned long)i, (unsigned long)j,
*(oriptr), *(dataptr));
}
@@ -459,9 +459,9 @@ ccdataset_vrfy(hsize_t start[],
}
}
if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("[more errors ...]\n");
+ HDprintf("[more errors ...]\n");
if (vrfyerrs)
- printf("%d errors found in ccdataset_vrfy\n", vrfyerrs);
+ HDprintf("%d errors found in ccdataset_vrfy\n", vrfyerrs);
return(vrfyerrs);
}
@@ -478,28 +478,28 @@ static void
dataset_big_write(void)
{
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
hid_t dataset;
- hid_t datatype; /* Datatype ID */
- hsize_t dims[RANK]; /* dataset dim sizes */
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hid_t datatype; /* Datatype ID */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
hsize_t *coords = NULL;
int i;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
+ hid_t acc_tpl; /* File access templates */
hsize_t h;
size_t num_points;
B_DATATYPE * wdata;
/* allocate memory for data buffer */
- wdata = (B_DATATYPE *)malloc(bigcount*sizeof(B_DATATYPE));
+ wdata = (B_DATATYPE *)HDmalloc(bigcount*sizeof(B_DATATYPE));
VRFY((wdata != NULL), "wdata malloc succeeded");
/* setup file access template */
@@ -552,8 +552,8 @@ dataset_big_write(void)
fill_datasets(start, block, wdata);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, wdata);
+ MESG("data_array created");
+ dataset_print(start, block, wdata);
}
/* set up the collective transfer properties list */
@@ -580,7 +580,7 @@ dataset_big_write(void)
/* Each process takes a slabs of cols. */
- if (mpi_rank == 0)
+ if (mpi_rank == 0)
HDprintf("\nTesting Dataset2 write by COL\n");
/* Create a large dataset */
dims[0] = bigcount;
@@ -615,8 +615,8 @@ dataset_big_write(void)
fill_datasets(start, block, wdata);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, wdata);
+ MESG("data_array created");
+ dataset_print(start, block, wdata);
}
/* set up the collective transfer properties list */
@@ -690,7 +690,7 @@ dataset_big_write(void)
fill_datasets(start, dims, wdata);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
+ MESG("data_array created");
}
ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace,
@@ -729,7 +729,7 @@ dataset_big_write(void)
num_points = bigcount;
- coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t));
+ coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t));
VRFY((coords != NULL), "coords malloc succeeded");
set_coords (start, count, stride, block, num_points, coords, IN_ORDER);
@@ -744,8 +744,8 @@ dataset_big_write(void)
fill_datasets(start, block, wdata);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, wdata);
+ MESG("data_array created");
+ dataset_print(start, block, wdata);
}
/* create a memory dataspace */
@@ -778,7 +778,7 @@ dataset_big_write(void)
ret = H5Dclose(dataset);
VRFY((ret >= 0), "H5Dclose1 succeeded");
- free(wdata);
+ HDfree(wdata);
H5Fclose(fid);
}
@@ -795,30 +795,30 @@ static void
dataset_big_read(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
hid_t dataset;
- B_DATATYPE *rdata = NULL; /* data buffer */
- B_DATATYPE *wdata = NULL; /* expected data buffer */
- hsize_t dims[RANK]; /* dataset dim sizes */
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ B_DATATYPE *rdata = NULL; /* data buffer */
+ B_DATATYPE *wdata = NULL; /* expected data buffer */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
int i,j,k;
hsize_t h;
size_t num_points;
hsize_t *coords = NULL;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* allocate memory for data buffer */
- rdata = (B_DATATYPE *)malloc(bigcount*sizeof(B_DATATYPE));
+ rdata = (B_DATATYPE *)HDmalloc(bigcount*sizeof(B_DATATYPE));
VRFY((rdata != NULL), "rdata malloc succeeded");
- wdata = (B_DATATYPE *)malloc(bigcount*sizeof(B_DATATYPE));
+ wdata = (B_DATATYPE *)HDmalloc(bigcount*sizeof(B_DATATYPE));
VRFY((wdata != NULL), "wdata malloc succeeded");
- memset(rdata, 0, bigcount*sizeof(B_DATATYPE));
+ HDmemset(rdata, 0, bigcount*sizeof(B_DATATYPE));
/* setup file access template */
acc_tpl = H5Pcreate (H5P_FILE_ACCESS);
@@ -865,7 +865,7 @@ dataset_big_read(void)
fill_datasets(start, block, wdata);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
+ MESG("data_array created");
}
/* set up the collective transfer properties list */
@@ -885,7 +885,7 @@ dataset_big_read(void)
/* verify the read data with original expected data */
ret = verify_data(start, count, stride, block, rdata, wdata);
- if(ret) {fprintf(stderr, "verify failed\n"); exit(1);}
+ if(ret) {HDfprintf(stderr, "verify failed\n"); exit(1);}
/* release all temporary handles. */
H5Sclose(file_dataspace);
@@ -897,7 +897,7 @@ dataset_big_read(void)
if (mpi_rank == 0)
HDprintf("\nRead Testing Dataset2 by ROW\n");
- memset(rdata, 0, bigcount*sizeof(B_DATATYPE));
+ HDmemset(rdata, 0, bigcount*sizeof(B_DATATYPE));
dataset = H5Dopen2(fid, DATASET2, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dopen2 succeeded");
@@ -927,7 +927,7 @@ dataset_big_read(void)
fill_datasets(start, block, wdata);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
+ MESG("data_array created");
}
/* set up the collective transfer properties list */
@@ -947,7 +947,7 @@ dataset_big_read(void)
/* verify the read data with original expected data */
ret = verify_data(start, count, stride, block, rdata, wdata);
- if(ret) {fprintf(stderr, "verify failed\n"); exit(1);}
+ if(ret) {HDfprintf(stderr, "verify failed\n"); exit(1);}
/* release all temporary handles. */
H5Sclose(file_dataspace);
@@ -958,7 +958,7 @@ dataset_big_read(void)
if (mpi_rank == 0)
HDprintf("\nRead Testing Dataset3 read select ALL proc 0, NONE others\n");
- memset(rdata, 0, bigcount*sizeof(B_DATATYPE));
+ HDmemset(rdata, 0, bigcount*sizeof(B_DATATYPE));
dataset = H5Dopen2(fid, DATASET3, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dopen2 succeeded");
@@ -989,7 +989,7 @@ dataset_big_read(void)
fill_datasets(start, dims, wdata);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
+ MESG("data_array created");
}
/* set up the collective transfer properties list */
@@ -1010,7 +1010,7 @@ dataset_big_read(void)
if(mpi_rank == 0) {
/* verify the read data with original expected data */
ret = verify_data(start, count, stride, block, rdata, wdata);
- if(ret) {fprintf(stderr, "verify failed\n"); exit(1);}
+ if(ret) {HDfprintf(stderr, "verify failed\n"); exit(1);}
}
/* release all temporary handles. */
@@ -1040,13 +1040,13 @@ dataset_big_read(void)
fill_datasets(start, block, wdata);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, wdata);
+ MESG("data_array created");
+ dataset_print(start, block, wdata);
}
num_points = bigcount;
- coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t));
+ coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t));
VRFY((coords != NULL), "coords malloc succeeded");
set_coords (start, count, stride, block, num_points, coords, IN_ORDER);
@@ -1056,7 +1056,7 @@ dataset_big_read(void)
ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords);
VRFY((ret >= 0), "H5Sselect_elements succeeded");
- if(coords) free(coords);
+ if(coords) HDfree(coords);
/* create a memory dataspace */
/* Warning: H5Screate_simple requires an array of hsize_t elements
@@ -1082,7 +1082,7 @@ dataset_big_read(void)
VRFY((ret >= 0), "H5Dread dataset1 succeeded");
ret = verify_data(start, count, stride, block, rdata, wdata);
- if(ret) {fprintf(stderr, "verify failed\n"); exit(1);}
+ if(ret) {HDfprintf(stderr, "verify failed\n"); exit(1);}
/* release all temporary handles. */
H5Sclose(file_dataspace);
@@ -1091,8 +1091,8 @@ dataset_big_read(void)
ret = H5Dclose(dataset);
VRFY((ret >= 0), "H5Dclose1 succeeded");
- free(wdata);
- free(rdata);
+ HDfree(wdata);
+ HDfree(rdata);
wdata = NULL;
rdata = NULL;
@@ -1115,8 +1115,8 @@ dataset_big_read(void)
H5Fclose(fid);
/* release data buffers */
- if(rdata) free(rdata);
- if(wdata) free(wdata);
+ if(rdata) HDfree(rdata);
+ if(wdata) HDfree(wdata);
} /* dataset_large_readAll */
@@ -1129,7 +1129,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
{
hid_t ret_pl = -1;
herr_t ret; /* generic return value */
- int mpi_rank; /* mpi variables */
+ int mpi_rank; /* mpi variables */
/* need the rank for error checking macros */
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -1138,36 +1138,36 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
VRFY((ret_pl >= 0), "H5P_FILE_ACCESS");
if (l_facc_type == FACC_DEFAULT)
- return (ret_pl);
+ return (ret_pl);
if (l_facc_type == FACC_MPIO){
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_mpio(ret_pl, comm, info);
- VRFY((ret >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_mpio(ret_pl, comm, info);
+ VRFY((ret >= 0), "");
ret = H5Pset_all_coll_metadata_ops(ret_pl, TRUE);
- VRFY((ret >= 0), "");
+ VRFY((ret >= 0), "");
ret = H5Pset_coll_metadata_write(ret_pl, TRUE);
- VRFY((ret >= 0), "");
- return(ret_pl);
+ VRFY((ret >= 0), "");
+ return(ret_pl);
}
if (l_facc_type == (FACC_MPIO | FACC_SPLIT)){
- hid_t mpio_pl;
-
- mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((mpio_pl >= 0), "");
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_mpio(mpio_pl, comm, info);
- VRFY((ret >= 0), "");
-
- /* setup file access template */
- ret_pl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((ret_pl >= 0), "");
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl);
- VRFY((ret >= 0), "H5Pset_fapl_split succeeded");
- H5Pclose(mpio_pl);
- return(ret_pl);
+ hid_t mpio_pl;
+
+ mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((mpio_pl >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_mpio(mpio_pl, comm, info);
+ VRFY((ret >= 0), "");
+
+ /* setup file access template */
+ ret_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((ret_pl >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl);
+ VRFY((ret >= 0), "H5Pset_fapl_split succeeded");
+ H5Pclose(mpio_pl);
+ return(ret_pl);
}
/* unknown file access types */
@@ -1176,17 +1176,17 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
/*-------------------------------------------------------------------------
- * Function: coll_chunk1
+ * Function: coll_chunk1
*
- * Purpose: Wrapper to test the collective chunk IO for regular JOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular JOINT
selection with a single chunk
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * July 12th, 2004
+ * Programmer: Unknown
+ * July 12th, 2004
*
* Modifications:
*
@@ -1215,7 +1215,7 @@ coll_chunk1(void)
{
const char *filename = FILENAME[0];
if (mpi_rank == 0)
- printf("coll_chunk1\n");
+ HDprintf("coll_chunk1\n");
coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER);
coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER);
@@ -1230,17 +1230,17 @@ coll_chunk1(void)
/*-------------------------------------------------------------------------
- * Function: coll_chunk2
+ * Function: coll_chunk2
*
- * Purpose: Wrapper to test the collective chunk IO for regular DISJOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular DISJOINT
selection with a single chunk
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * July 12th, 2004
+ * Programmer: Unknown
+ * July 12th, 2004
*
* Modifications:
*
@@ -1269,7 +1269,7 @@ coll_chunk2(void)
{
const char *filename = FILENAME[0];
if (mpi_rank == 0)
- printf("coll_chunk2\n");
+ HDprintf("coll_chunk2\n");
coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER);
coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, POINT, OUT_OF_ORDER);
@@ -1284,17 +1284,17 @@ coll_chunk2(void)
/*-------------------------------------------------------------------------
- * Function: coll_chunk3
+ * Function: coll_chunk3
*
- * Purpose: Wrapper to test the collective chunk IO for regular JOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular JOINT
selection with at least number of 2*mpi_size chunks
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * July 12th, 2004
+ * Programmer: Unknown
+ * July 12th, 2004
*
* Modifications:
*
@@ -1324,7 +1324,7 @@ coll_chunk3(void)
{
const char *filename = FILENAME[0];
if (mpi_rank == 0)
- printf("coll_chunk3\n");
+ HDprintf("coll_chunk3\n");
coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER);
coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER);
@@ -1341,17 +1341,17 @@ coll_chunk3(void)
//-------------------------------------------------------------------------
// Borrowed/Modified (slightly) from t_coll_chunk.c
/*-------------------------------------------------------------------------
- * Function: coll_chunktest
+ * Function: coll_chunktest
*
* Purpose: The real testing routine for regular selection of collective
chunking storage
testing both write and read,
- If anything fails, it may be read or write. There is no
- separation test between read and write.
+ If anything fails, it may be read or write. There is no
+ separation test between read and write.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
* Modifications:
* Remove invalid temporary property checkings for API_LINK_HARD and
@@ -1359,8 +1359,8 @@ coll_chunk3(void)
* Programmer: Jonathan Kim
* Date: 2012-10-10
*
- * Programmer: Unknown
- * July 12th, 2004
+ * Programmer: Unknown
+ * July 12th, 2004
*
* Modifications:
*
@@ -1369,14 +1369,14 @@ coll_chunk3(void)
static void
coll_chunktest(const char* filename,
- int chunk_factor,
- int select_factor,
+ int chunk_factor,
+ int select_factor,
int api_option,
int file_selection,
int mem_selection,
int mode)
{
- hid_t file, dataset, file_dataspace, mem_dataspace;
+ hid_t file, dataset, file_dataspace, mem_dataspace;
hid_t acc_plist,xfer_plist,crp_plist;
hsize_t dims[RANK], chunk_dims[RANK];
@@ -1524,41 +1524,41 @@ coll_chunktest(const char* filename,
}
switch(api_option){
- case API_LINK_HARD:
- status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_ONE_IO);
+ case API_LINK_HARD:
+ status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_ONE_IO);
VRFY((status>= 0),"collective chunk optimization succeeded");
break;
- case API_MULTI_HARD:
- status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_MULTI_IO);
- VRFY((status>= 0),"collective chunk optimization succeeded ");
+ case API_MULTI_HARD:
+ status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_MULTI_IO);
+ VRFY((status>= 0),"collective chunk optimization succeeded ");
break;
- case API_LINK_TRUE:
+ case API_LINK_TRUE:
status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,2);
- VRFY((status>= 0),"collective chunk optimization set chunk number succeeded");
+ VRFY((status>= 0),"collective chunk optimization set chunk number succeeded");
break;
- case API_LINK_FALSE:
+ case API_LINK_FALSE:
status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,6);
VRFY((status>= 0),"collective chunk optimization set chunk number succeeded");
break;
- case API_MULTI_COLL:
+ case API_MULTI_COLL:
status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */
VRFY((status>= 0),"collective chunk optimization set chunk number succeeded");
- status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,50);
+ status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,50);
VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded");
break;
- case API_MULTI_IND:
+ case API_MULTI_IND:
status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */
VRFY((status>= 0),"collective chunk optimization set chunk number succeeded");
- status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,100);
+ status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,100);
VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded");
break;
- default:
+ default:
;
}
@@ -1615,7 +1615,7 @@ coll_chunktest(const char* filename,
/* write data collectively */
status = H5Dwrite(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((status >= 0),"dataset write succeeded");
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
@@ -1820,22 +1820,22 @@ coll_chunktest(const char* filename,
/*****************************************************************************
*
- * Function: do_express_test()
+ * Function: do_express_test()
*
- * Purpose: Do an MPI_Allreduce to obtain the maximum value returned
- * by GetTestExpress() across all processes. Return this
- * value.
+ * Purpose: Do an MPI_Allreduce to obtain the maximum value returned
+ * by GetTestExpress() across all processes. Return this
+ * value.
*
- * Envirmoment variables can be different across different
- * processes. This function ensures that all processes agree
- * on whether to do an express test.
+ * Envirmoment variables can be different across different
+ * processes. This function ensures that all processes agree
+ * on whether to do an express test.
*
- * Return: Success: Maximum of the values returned by
- * GetTestExpress() across all processes.
+ * Return: Success: Maximum of the values returned by
+ * GetTestExpress() across all processes.
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: JRM -- 4/25/06
+ * Programmer: JRM -- 4/25/06
*
*****************************************************************************/
static int
@@ -1868,7 +1868,7 @@ do_express_test(int world_mpi_rank)
} /* do_express_test() */
-int main(int argc, char **argv)
+int main(int argc, char **argv)
{
int ExpressMode = 0;
hsize_t newsize = 1048576;
@@ -1894,12 +1894,12 @@ int main(int argc, char **argv)
* calls. By then, MPI calls may not work.
*/
if (H5dont_atexit() < 0){
- HDprintf("Failed to turn off atexit processing. Continue.\n");
+ HDprintf("Failed to turn off atexit processing. Continue.\n");
};
/* set alarm. */
ALARM_ON;
-
+
ExpressMode = do_express_test(mpi_rank);
dataset_big_write();
@@ -1923,7 +1923,7 @@ int main(int argc, char **argv)
/* turn off alarm */
ALARM_OFF;
- if (mpi_rank == 0)
+ if (mpi_rank == 0)
HDremove(FILENAME[0]);
/* close HDF5 library */
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 29c6f4a..ff89ee4 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -621,7 +621,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: MPI_Comm_group() failed with error %d.\n",
world_mpi_rank, FUNC, mpi_result);
}
@@ -640,7 +640,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: MPI_Group_excl() failed with error %d.\n",
world_mpi_rank, FUNC, mpi_result);
}
@@ -657,7 +657,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: MPI_Comm_create() failed with error %d.\n",
world_mpi_rank, FUNC, mpi_result);
}
@@ -671,7 +671,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: file_mpi_comm == MPI_COMM_NULL.\n",
world_mpi_rank, FUNC);
}
@@ -685,7 +685,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: file_mpi_comm != MPI_COMM_NULL.\n",
world_mpi_rank, FUNC);
}
@@ -703,7 +703,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: MPI_Comm_size() failed with error %d.\n",
world_mpi_rank, FUNC, mpi_result);
}
@@ -719,7 +719,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: MPI_Comm_rank() failed with error %d.\n",
world_mpi_rank, FUNC, mpi_result);
}
@@ -1228,7 +1228,7 @@ setup_derived_types(void)
nerrors++;
success = FALSE;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: MPI_Get_Address() call failed.\n",
+ HDfprintf(stdout, "%d:%s: MPI_Get_address() call failed.\n",
world_mpi_rank, FUNC);
}
@@ -1250,7 +1250,7 @@ setup_derived_types(void)
nerrors++;
success = FALSE;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: MPI_Type_struct() call failed.\n",
+ HDfprintf(stdout, "%d:%s: MPI_Type_create_struct() call failed.\n",
world_mpi_rank, FUNC);
}
}
@@ -7456,7 +7456,7 @@ main(int argc, char **argv)
* calls. By then, MPI calls may not work.
*/
if (H5dont_atexit() < 0){
- printf("%d:Failed to turn off atexit processing. Continue.\n",
+ HDprintf("%d:Failed to turn off atexit processing. Continue.\n",
mpi_rank);
};
H5open();
@@ -7475,24 +7475,24 @@ main(int argc, char **argv)
}
#ifdef H5_HAVE_MPE
- if ( MAINPROCESS ) { printf(" Tests compiled for MPE.\n"); }
+ if ( MAINPROCESS ) { HDprintf(" Tests compiled for MPE.\n"); }
virt_num_data_entries = MPE_VIRT_NUM_DATA_ENTIES;
#endif /* H5_HAVE_MPE */
if (MAINPROCESS){
- printf("===================================\n");
- printf("Parallel metadata cache tests\n");
- printf(" mpi_size = %d\n", mpi_size);
- printf(" express_test = %d\n", express_test);
- printf("===================================\n");
+ HDprintf("===================================\n");
+ HDprintf("Parallel metadata cache tests\n");
+ HDprintf(" mpi_size = %d\n", mpi_size);
+ HDprintf(" express_test = %d\n", express_test);
+ HDprintf("===================================\n");
}
if ( mpi_size < 3 ) {
if ( MAINPROCESS ) {
- printf(" Need at least 3 processes. Exiting.\n");
+ HDprintf(" Need at least 3 processes. Exiting.\n");
}
goto finish;
}
@@ -7638,15 +7638,15 @@ finish:
*/
MPI_Barrier(MPI_COMM_WORLD);
if (MAINPROCESS){ /* only process 0 reports */
- printf("===================================\n");
+ HDprintf("===================================\n");
if (failures){
- printf("***metadata cache tests detected %d failures***\n",
+ HDprintf("***metadata cache tests detected %d failures***\n",
failures);
}
else{
- printf("metadata cache tests finished with no failures\n");
+ HDprintf("metadata cache tests finished with no failures\n");
}
- printf("===================================\n");
+ HDprintf("===================================\n");
}
takedown_derived_types();
diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c
index 5b512d6..e0c8211 100644
--- a/testpar/t_cache_image.c
+++ b/testpar/t_cache_image.c
@@ -519,7 +519,7 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset)
/* create the dataset */
if ( pass ) {
- sprintf(dset_name, "/dset%03d", i);
+ HDsprintf(dset_name, "/dset%03d", i);
dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE,
dataspace_id, H5P_DEFAULT,
properties, H5P_DEFAULT);
@@ -713,7 +713,7 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset)
if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, m);
}
@@ -830,7 +830,7 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset)
while ( ( pass ) && ( i <= max_dset ) )
{
- sprintf(dset_name, "/dset%03d", i);
+ HDsprintf(dset_name, "/dset%03d", i);
if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) {
@@ -1446,7 +1446,7 @@ par_create_dataset(int dset_num,
show_progress = (show_progress && (mpi_rank == 0));
verbose = (verbose && (mpi_rank == 0));
- sprintf(dset_name, "/dset%03d", dset_num);
+ HDsprintf(dset_name, "/dset%03d", dset_num);
if ( show_progress ) {
HDfprintf(stdout, "%s: dset name = \"%s\".\n", fcn_name, dset_name);
@@ -1750,7 +1750,7 @@ par_create_dataset(int dset_num,
if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, dset_num);
}
@@ -1848,7 +1848,7 @@ par_delete_dataset(int dset_num,
show_progress = (show_progress && (mpi_rank == 0));
- sprintf(dset_name, "/dset%03d", dset_num);
+ HDsprintf(dset_name, "/dset%03d", dset_num);
if ( show_progress ) {
HDfprintf(stdout, "%s: dset name = \"%s\".\n", fcn_name, dset_name);
@@ -1932,8 +1932,8 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size )
int child_status;
pid_t child_pid;
- sprintf(file_name_idx_str, "%d", file_name_idx);
- sprintf(mpi_size_str, "%d", mpi_size);
+ HDsprintf(file_name_idx_str, "%d", file_name_idx);
+ HDsprintf(mpi_size_str, "%d", mpi_size);
child_pid = fork();
@@ -1954,7 +1954,7 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size )
HDfprintf(stdout,
"execl() of ici process failed. errno = %d(%s)\n",
errno, strerror(errno));
- exit(1);
+ HDexit(1);
}
} else if ( child_pid != -1 ) {
@@ -2056,7 +2056,7 @@ par_verify_dataset(int dset_num,
show_progress = (show_progress && (mpi_rank == 0));
verbose = (verbose && (mpi_rank == 0));
- sprintf(dset_name, "/dset%03d", dset_num);
+ HDsprintf(dset_name, "/dset%03d", dset_num);
if ( show_progress ) {
HDfprintf(stdout, "%s: dset name = \"%s\".\n", fcn_name, dset_name);
@@ -2233,7 +2233,7 @@ par_verify_dataset(int dset_num,
if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, dset_num);
}
@@ -2448,7 +2448,7 @@ serial_verify_dataset(int dset_num,
hid_t dset_id = -1;
hid_t filespace_id = -1;
- sprintf(dset_name, "/dset%03d", dset_num);
+ HDsprintf(dset_name, "/dset%03d", dset_num);
if ( show_progress ) {
HDfprintf(stdout, "%s: dset name = \"%s\".\n", fcn_name, dset_name);
@@ -2603,7 +2603,7 @@ serial_verify_dataset(int dset_num,
if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
j, k, dset_num);
}
@@ -2801,7 +2801,7 @@ usage(void)
int i = 0;
while(s[i] != NULL) {
- fprintf(stdout, "%s", s[i]);
+ HDfprintf(stdout, "%s", s[i]);
i++;
}
@@ -2876,7 +2876,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset)
/* open the dataset */
if ( pass ) {
- sprintf(dset_name, "/dset%03d", i);
+ HDsprintf(dset_name, "/dset%03d", i);
dataset_ids[i] = H5Dopen2(file_id, dset_name, H5P_DEFAULT);
if ( dataset_ids[i] < 0 ) {
@@ -3016,7 +3016,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset)
if ( verbose ) {
- fprintf(stdout,
+ HDfprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, m);
}
@@ -4137,31 +4137,31 @@ main(int argc, char **argv)
if ( pass ) {
- printf("done.\n");
+ HDprintf("done.\n");
HDfflush(stdout);
} else {
- printf("failed.\n");
- exit(1);
+ HDprintf("failed.\n");
+ HDexit(1);
}
i++;
}
HDfprintf(stdout, "Test file construction complete.\n");
- exit(0);
+ HDexit(0);
} else if ( ici ) {
if ( serial_insert_cache_image(file_idx, mpi_size) ) {
- exit(0);
+ HDexit(0);
} else {
HDfprintf(stderr, "\n\nCache image insertion failed.\n");
HDfprintf(stderr, " failure mssg = \"%s\"\n", failure_mssg);
- exit(1);
+ HDexit(1);
}
}
@@ -4178,24 +4178,24 @@ main(int argc, char **argv)
* calls. By then, MPI calls may not work.
*/
if (H5dont_atexit() < 0){
- printf("%d:Failed to turn off atexit processing. Continue.\n",
+ HDprintf("%d:Failed to turn off atexit processing. Continue.\n",
mpi_rank);
};
H5open();
if ( mpi_rank == 0 ) {
- printf("===================================\n");
- printf("Parallel metadata cache image tests\n");
- printf(" mpi_size = %d\n", mpi_size);
- printf("===================================\n");
+ HDprintf("===================================\n");
+ HDprintf("Parallel metadata cache image tests\n");
+ HDprintf(" mpi_size = %d\n", mpi_size);
+ HDprintf("===================================\n");
}
if ( mpi_size < 2 ) {
if ( mpi_rank == 0 ) {
- printf(" Need at least 2 processes. Exiting.\n");
+ HDprintf(" Need at least 2 processes. Exiting.\n");
}
goto finish;
}
@@ -4220,7 +4220,7 @@ main(int argc, char **argv)
HDfprintf(stdout,
"execl() of setup process failed. errno = %d(%s)\n",
errno, strerror(errno));
- exit(1);
+ HDexit(1);
}
} else if ( child_pid != -1 ) {
@@ -4271,16 +4271,16 @@ finish:
MPI_Barrier(MPI_COMM_WORLD);
if ( mpi_rank == 0 ) { /* only process 0 reports */
- sleep(10);
- printf("===================================\n");
+ HDsleep(10);
+ HDprintf("===================================\n");
if ( nerrs > 0 ) {
- printf("***metadata cache image tests detected %d failures***\n",
+ HDprintf("***metadata cache image tests detected %d failures***\n",
nerrs);
}
else {
- printf("metadata cache image tests finished with no failures\n");
+ HDprintf("metadata cache image tests finished with no failures\n");
}
- printf("===================================\n");
+ HDprintf("===================================\n");
}
/* takedown_derived_types(); */
diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c
index 2340ae0..bfa0bfe 100644
--- a/testpar/t_chunk_alloc.c
+++ b/testpar/t_chunk_alloc.c
@@ -20,23 +20,23 @@
*/
#include "testphdf5.h"
-static int mpi_size, mpi_rank;
+static int mpi_size, mpi_rank;
#define DSET_NAME "ExtendibleArray"
-#define CHUNK_SIZE 1000 /* #elements per chunk */
-#define CHUNK_FACTOR 200 /* default dataset size in terms of chunks */
+#define CHUNK_SIZE 1000 /* #elements per chunk */
+#define CHUNK_FACTOR 200 /* default dataset size in terms of chunks */
#define CLOSE 1
#define NO_CLOSE 0
static MPI_Offset
get_filesize(const char *filename)
{
- int mpierr;
- MPI_File fd;
- MPI_Offset filesize;
+ int mpierr;
+ MPI_File fd;
+ MPI_Offset filesize;
mpierr = MPI_File_open(MPI_COMM_SELF, filename, MPI_MODE_RDONLY,
- MPI_INFO_NULL, &fd);
+ MPI_INFO_NULL, &fd);
VRFY((mpierr == MPI_SUCCESS), "");
mpierr = MPI_File_get_size(fd, &filesize);
@@ -85,8 +85,8 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_
long nchunks;
herr_t hrc;
- MPI_Offset filesize, /* actual file size */
- est_filesize; /* estimated file size */
+ MPI_Offset filesize, /* actual file size */
+ est_filesize; /* estimated file size */
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -95,34 +95,33 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_
/* Only MAINPROCESS should create the file. Others just wait. */
if (MAINPROCESS){
nchunks=chunk_factor*mpi_size;
- dims[0]=nchunks*CHUNK_SIZE;
- /* Create the data space with unlimited dimensions. */
- dataspace = H5Screate_simple (1, dims, maxdims);
- VRFY((dataspace >= 0), "");
+ dims[0]=nchunks*CHUNK_SIZE;
+ /* Create the data space with unlimited dimensions. */
+ dataspace = H5Screate_simple (1, dims, maxdims);
+ VRFY((dataspace >= 0), "");
- memspace = H5Screate_simple(1, chunk_dims, NULL);
- VRFY((memspace >= 0), "");
+ memspace = H5Screate_simple(1, chunk_dims, NULL);
+ VRFY((memspace >= 0), "");
- /* Create a new file. If file exists its contents will be overwritten. */
- file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT,
- H5P_DEFAULT);
- VRFY((file_id >= 0), "H5Fcreate");
+ /* Create a new file. If file exists its contents will be overwritten. */
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((file_id >= 0), "H5Fcreate");
- /* Modify dataset creation properties, i.e. enable chunking */
- cparms = H5Pcreate(H5P_DATASET_CREATE);
- VRFY((cparms >= 0), "");
+ /* Modify dataset creation properties, i.e. enable chunking */
+ cparms = H5Pcreate(H5P_DATASET_CREATE);
+ VRFY((cparms >= 0), "");
- hrc = H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY);
- VRFY((hrc >= 0), "");
+ hrc = H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY);
+ VRFY((hrc >= 0), "");
- hrc = H5Pset_chunk(cparms, 1, chunk_dims);
- VRFY((hrc >= 0), "");
+ hrc = H5Pset_chunk(cparms, 1, chunk_dims);
+ VRFY((hrc >= 0), "");
- /* Create a new dataset within the file using cparms creation properties. */
- dataset = H5Dcreate2(file_id, DSET_NAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT);
- VRFY((dataset >= 0), "");
+ /* Create a new dataset within the file using cparms creation properties. */
+ dataset = H5Dcreate2(file_id, DSET_NAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT);
+ VRFY((dataset >= 0), "");
- if(write_pattern == sec_last) {
+ if(write_pattern == sec_last) {
HDmemset(buffer, 100, CHUNK_SIZE);
count[0] = 1;
@@ -138,28 +137,28 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_
VRFY((hrc >= 0), "H5Dwrite");
} /* end if */
- /* Close resources */
- hrc = H5Dclose (dataset);
- VRFY((hrc >= 0), "");
- dataset = -1;
+ /* Close resources */
+ hrc = H5Dclose (dataset);
+ VRFY((hrc >= 0), "");
+ dataset = -1;
- hrc = H5Sclose (dataspace);
- VRFY((hrc >= 0), "");
+ hrc = H5Sclose (dataspace);
+ VRFY((hrc >= 0), "");
- hrc = H5Sclose (memspace);
- VRFY((hrc >= 0), "");
+ hrc = H5Sclose (memspace);
+ VRFY((hrc >= 0), "");
- hrc = H5Pclose (cparms);
- VRFY((hrc >= 0), "");
+ hrc = H5Pclose (cparms);
+ VRFY((hrc >= 0), "");
- hrc = H5Fclose (file_id);
- VRFY((hrc >= 0), "");
- file_id = -1;
+ hrc = H5Fclose (file_id);
+ VRFY((hrc >= 0), "");
+ file_id = -1;
- /* verify file size */
- filesize = get_filesize(filename);
- est_filesize = nchunks * CHUNK_SIZE * sizeof(unsigned char);
- VRFY((filesize >= est_filesize), "file size check");
+ /* verify file size */
+ filesize = get_filesize(filename);
+ est_filesize = nchunks * CHUNK_SIZE * sizeof(unsigned char);
+ VRFY((filesize >= est_filesize), "file size check");
}
@@ -200,8 +199,8 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
int i;
long nchunks;
/* MPI Gubbins */
- MPI_Offset filesize, /* actual file size */
- est_filesize; /* estimated file size */
+ MPI_Offset filesize, /* actual file size */
+ est_filesize; /* estimated file size */
/* Initialize MPI */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -241,19 +240,19 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
/* all chunks are written by all the processes in an interleaved way*/
case write_all:
- memset(buffer, mpi_rank+1, CHUNK_SIZE);
- count[0] = 1;
- stride[0] = 1;
- block[0] = chunk_dims[0];
- for (i=0; i<nchunks/mpi_size; i++){
- offset[0] = (i*mpi_size+mpi_rank)*chunk_dims[0];
+ HDmemset(buffer, mpi_rank+1, CHUNK_SIZE);
+ count[0] = 1;
+ stride[0] = 1;
+ block[0] = chunk_dims[0];
+ for (i=0; i<nchunks/mpi_size; i++) {
+ offset[0] = (i*mpi_size+mpi_rank)*chunk_dims[0];
- hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
- VRFY((hrc >= 0), "");
+ hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
+ VRFY((hrc >= 0), "");
- /* Write the buffer out */
- hrc = H5Dwrite(*dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
- VRFY((hrc >= 0), "H5Dwrite");
+ /* Write the buffer out */
+ hrc = H5Dwrite(*dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
+ VRFY((hrc >= 0), "H5Dwrite");
}
break;
@@ -318,7 +317,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
* interleaved pattern.
*/
static void
-verify_data(const char *filename, int chunk_factor, write_type write_pattern, int vclose,
+verify_data(const char *filename, int chunk_factor, write_type write_pattern, int vclose,
hid_t *file_id, hid_t *dataset)
{
/* HDF5 gubbins */
@@ -372,8 +371,8 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in
stride[0] = 1;
block[0] = chunk_dims[0];
for (i=0; i<nchunks; i++){
- /* reset buffer values */
- memset(buffer, -1, CHUNK_SIZE);
+ /* reset buffer values */
+ HDmemset(buffer, -1, CHUNK_SIZE);
offset[0] = i*chunk_dims[0];
@@ -385,22 +384,22 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in
VRFY((hrc >= 0), "H5Dread");
/* set expected value according the write pattern */
- switch (write_pattern) {
- case all:
- value = i%mpi_size + 1;
- break;
- case none:
- value = 0;
- break;
- case sec_last:
- if (i==nchunks-2)
- value = 100;
- else
- value = 0;
+ switch (write_pattern) {
+ case all:
+ value = i%mpi_size + 1;
+ break;
+ case none:
+ value = 0;
+ break;
+ case sec_last:
+ if (i==nchunks-2)
+ value = 100;
+ else
+ value = 0;
break;
default:
HDassert(0);
- }
+ }
/* verify content of the chunk */
for (index_l = 0; index_l < CHUNK_SIZE; index_l++)
@@ -408,10 +407,10 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in
}
hrc = H5Sclose (dataspace);
- VRFY((hrc >= 0), "");
+ VRFY((hrc >= 0), "");
- hrc = H5Sclose (memspace);
- VRFY((hrc >= 0), "");
+ hrc = H5Sclose (memspace);
+ VRFY((hrc >= 0), "");
/* Can close some plists */
hrc = H5Pclose(access_plist);
@@ -469,7 +468,7 @@ test_chunk_alloc(void)
filename = (const char*)GetTestParameters();
if (VERBOSE_MED)
- printf("Extend Chunked allocation test on file %s\n", filename);
+ HDprintf("Extend Chunked allocation test on file %s\n", filename);
/* Case 1 */
/* Create chunked dataset without writing anything.*/
diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c
index c6fa3d4..40cc1ca 100644
--- a/testpar/t_coll_chunk.c
+++ b/testpar/t_coll_chunk.c
@@ -1134,7 +1134,7 @@ ccslab_set(int mpi_rank,
break;
}
if (VERBOSE_MED){
- printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
+ HDprintf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
(unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
(unsigned long)(block[0]*block[1]*count[0]*count[1]));
@@ -1197,20 +1197,20 @@ ccdataset_print(hsize_t start[],
hsize_t i, j;
/* print the column heading */
- printf("Print only the first block of the dataset\n");
- printf("%-8s", "Cols:");
+ HDprintf("Print only the first block of the dataset\n");
+ HDprintf("%-8s", "Cols:");
for (j=0; j < block[1]; j++){
- printf("%3lu ", (unsigned long)(start[1]+j));
+ HDprintf("%3lu ", (unsigned long)(start[1]+j));
}
- printf("\n");
+ HDprintf("\n");
/* print the slab data */
for (i=0; i < block[0]; i++){
- printf("Row %2lu: ", (unsigned long)(i+start[0]));
+ HDprintf("Row %2lu: ", (unsigned long)(i+start[0]));
for (j=0; j < block[1]; j++){
- printf("%03d ", *dataptr++);
+ HDprintf("%03d ", *dataptr++);
}
- printf("\n");
+ HDprintf("\n");
}
}
@@ -1233,13 +1233,13 @@ ccdataset_vrfy(hsize_t start[],
/* print it if VERBOSE_MED */
if (VERBOSE_MED) {
- printf("dataset_vrfy dumping:::\n");
- printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
+ HDprintf("dataset_vrfy dumping:::\n");
+ HDprintf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
(unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
- printf("original values:\n");
+ HDprintf("original values:\n");
ccdataset_print(start, block, original);
- printf("compared values:\n");
+ HDprintf("compared values:\n");
ccdataset_print(start, block, dataset);
}
@@ -1262,7 +1262,7 @@ ccdataset_vrfy(hsize_t start[],
}
if (*dataptr != *oriptr){
if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
- printf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n",
+ HDprintf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n",
(unsigned long)i, (unsigned long)j,
*(oriptr), *(dataptr));
}
@@ -1272,8 +1272,8 @@ ccdataset_vrfy(hsize_t start[],
}
}
if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("[more errors ...]\n");
+ HDprintf("[more errors ...]\n");
if (vrfyerrs)
- printf("%d errors found in ccdataset_vrfy\n", vrfyerrs);
+ HDprintf("%d errors found in ccdataset_vrfy\n", vrfyerrs);
return(vrfyerrs);
}
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index d4e556d..6c91a41 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -4162,7 +4162,7 @@ dataset_atomicity(void)
}
/* should fail */
- ret = H5Fset_mpi_atomicity (fid , TRUE);
+ ret = H5Fset_mpi_atomicity(fid , TRUE);
VRFY((ret == FAIL), "H5Fset_mpi_atomicity failed");
if(MAINPROCESS){
@@ -4184,7 +4184,7 @@ dataset_atomicity(void)
ret = H5Pclose(acc_tpl);
VRFY((ret >= 0), "H5Pclose succeeded");
- ret = H5Fset_mpi_atomicity (fid , TRUE);
+ ret = H5Fset_mpi_atomicity(fid , TRUE);
VRFY((ret >= 0), "H5Fset_mpi_atomicity succeeded");
/* open dataset1 (contiguous case) */
@@ -4203,7 +4203,7 @@ dataset_atomicity(void)
}
/* check that the atomicity flag is set */
- ret = H5Fget_mpi_atomicity (fid , &atomicity);
+ ret = H5Fget_mpi_atomicity(fid , &atomicity);
VRFY((ret >= 0), "atomcity get failed");
VRFY((atomicity == TRUE), "atomcity set failed");
@@ -4272,7 +4272,7 @@ dataset_atomicity(void)
atomicity = FALSE;
/* check that the atomicity flag is set */
- ret = H5Fget_mpi_atomicity (fid , &atomicity);
+ ret = H5Fget_mpi_atomicity(fid , &atomicity);
VRFY((ret >= 0), "atomcity get failed");
VRFY((atomicity == TRUE), "atomcity set failed");
diff --git a/testpar/t_file.c b/testpar/t_file.c
index f670034..7b5acfc 100644
--- a/testpar/t_file.c
+++ b/testpar/t_file.c
@@ -24,14 +24,14 @@
/*
* This file needs to access private information from the H5F package.
*/
-#define H5AC_FRIEND /*suppress error about including H5ACpkg */
+#define H5AC_FRIEND /*suppress error about including H5ACpkg */
#include "H5ACpkg.h"
-#define H5C_FRIEND /*suppress error about including H5Cpkg */
+#define H5C_FRIEND /*suppress error about including H5Cpkg */
#include "H5Cpkg.h"
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_TESTING
#include "H5Fpkg.h"
-#define H5MF_FRIEND /*suppress error about including H5MFpkg */
+#define H5MF_FRIEND /*suppress error about including H5MFpkg */
#include "H5MFpkg.h"
#define NUM_DSETS 5
@@ -39,7 +39,7 @@
int mpi_size, mpi_rank;
static int create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_strategy);
-static int open_file(const char *filename, hid_t fapl, int metadata_write_strategy,
+static int open_file(const char *filename, hid_t fapl, int metadata_write_strategy,
hsize_t page_size, size_t page_buffer_size);
/*
@@ -60,15 +60,15 @@ test_split_comm_access(void)
MPI_Info info = MPI_INFO_NULL;
int is_old, mrc;
int newrank, newprocs;
- hid_t fid; /* file IDs */
- hid_t acc_tpl; /* File access properties */
- herr_t ret; /* generic return value */
+ hid_t fid; /* file IDs */
+ hid_t acc_tpl; /* File access properties */
+ herr_t ret; /* generic return value */
const char *filename;
filename = (const char *)GetTestParameters();
if (VERBOSE_MED)
- printf("Split Communicator access test on file %s\n",
- filename);
+ HDprintf("Split Communicator access test on file %s\n",
+ filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -80,35 +80,35 @@ test_split_comm_access(void)
MPI_Comm_rank(comm,&newrank);
if (is_old){
- /* odd-rank processes */
- mrc = MPI_Barrier(comm);
- VRFY((mrc==MPI_SUCCESS), "");
+ /* odd-rank processes */
+ mrc = MPI_Barrier(comm);
+ VRFY((mrc==MPI_SUCCESS), "");
}else{
- /* even-rank processes */
- int sub_mpi_rank; /* rank in the sub-comm */
- MPI_Comm_rank(comm,&sub_mpi_rank);
-
- /* setup file access template */
- acc_tpl = create_faccess_plist(comm, info, facc_type);
- VRFY((acc_tpl >= 0), "");
-
- /* create the file collectively */
- fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl);
- VRFY((fid >= 0), "H5Fcreate succeeded");
-
- /* Release file-access template */
- ret=H5Pclose(acc_tpl);
- VRFY((ret >= 0), "");
-
- /* close the file */
- ret=H5Fclose(fid);
- VRFY((ret >= 0), "");
-
- /* delete the test file */
- if (sub_mpi_rank == 0){
- mrc = MPI_File_delete((char *)filename, info);
- /*VRFY((mrc==MPI_SUCCESS), ""); */
- }
+ /* even-rank processes */
+ int sub_mpi_rank; /* rank in the sub-comm */
+ MPI_Comm_rank(comm,&sub_mpi_rank);
+
+ /* setup file access template */
+ acc_tpl = create_faccess_plist(comm, info, facc_type);
+ VRFY((acc_tpl >= 0), "");
+
+ /* create the file collectively */
+ fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl);
+ VRFY((fid >= 0), "H5Fcreate succeeded");
+
+ /* Release file-access template */
+ ret=H5Pclose(acc_tpl);
+ VRFY((ret >= 0), "");
+
+ /* close the file */
+ ret=H5Fclose(fid);
+ VRFY((ret >= 0), "");
+
+ /* delete the test file */
+ if (sub_mpi_rank == 0){
+ mrc = MPI_File_delete((char *)filename, info);
+ /*VRFY((mrc==MPI_SUCCESS), ""); */
+ }
}
mrc = MPI_Comm_free(&comm);
VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free succeeded");
@@ -126,7 +126,7 @@ test_page_buffer_access(void)
haddr_t raw_addr, meta_addr;
int *data;
H5F_t *f = NULL;
- herr_t ret; /* generic return value */
+ herr_t ret; /* generic return value */
const char *filename;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
@@ -136,7 +136,7 @@ test_page_buffer_access(void)
filename = (const char *)GetTestParameters();
if (VERBOSE_MED)
- printf("Page Buffer Usage in Parallel %s\n", filename);
+ HDprintf("Page Buffer Usage in Parallel %s\n", filename);
fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type);
VRFY((fapl >= 0), "create_faccess_plist succeeded");
@@ -403,7 +403,7 @@ test_page_buffer_access(void)
ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
- for (i=0; i < 50; i++)
+ for (i=0; i < 50; i++)
VRFY((data[i] == -1), "Read different values than written");
/* close the file */
@@ -507,28 +507,28 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str
VRFY((mem_dataspace >= 0), "");
for(k=0 ; k<NUM_DSETS; k++) {
- sprintf(dset_name, "D1dset%d", k);
+ HDsprintf(dset_name, "D1dset%d", k);
dset_id = H5Dcreate2(grp_id, dset_name, H5T_NATIVE_INT, sid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dset_id >= 0), "");
ret = H5Dclose(dset_id);
VRFY((ret == 0), "");
- sprintf(dset_name, "D2dset%d", k);
+ HDsprintf(dset_name, "D2dset%d", k);
dset_id = H5Dcreate2(grp_id, dset_name, H5T_NATIVE_INT, sid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dset_id >= 0), "");
ret = H5Dclose(dset_id);
VRFY((ret == 0), "");
- sprintf(dset_name, "D3dset%d", k);
+ HDsprintf(dset_name, "D3dset%d", k);
dset_id = H5Dcreate2(grp_id, dset_name, H5T_NATIVE_INT, sid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dset_id >= 0), "");
ret = H5Dclose(dset_id);
VRFY((ret == 0), "");
- sprintf(dset_name, "dset%d", k);
+ HDsprintf(dset_name, "dset%d", k);
dset_id = H5Dcreate2(grp_id, dset_name, H5T_NATIVE_INT, sid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dset_id >= 0), "");
@@ -552,13 +552,13 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str
for (i=0; i < num_elements; i++)
VRFY((data_array[i] == mpi_rank+1), "Dataset Verify failed");
- sprintf(dset_name, "D1dset%d", k);
+ HDsprintf(dset_name, "D1dset%d", k);
ret = H5Ldelete(grp_id, dset_name, H5P_DEFAULT);
VRFY((ret == 0), "");
- sprintf(dset_name, "D2dset%d", k);
+ HDsprintf(dset_name, "D2dset%d", k);
ret = H5Ldelete(grp_id, dset_name, H5P_DEFAULT);
VRFY((ret == 0), "");
- sprintf(dset_name, "D3dset%d", k);
+ HDsprintf(dset_name, "D3dset%d", k);
ret = H5Ldelete(grp_id, dset_name, H5P_DEFAULT);
VRFY((ret == 0), "");
}
@@ -660,7 +660,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy,
VRFY((mem_dataspace >= 0), "");
for(k=0 ; k<NUM_DSETS; k++) {
- sprintf(dset_name, "dset%d", k);
+ HDsprintf(dset_name, "dset%d", k);
dset_id = H5Dopen2(grp_id, dset_name, H5P_DEFAULT);
VRFY((dset_id >= 0), "");
@@ -744,7 +744,7 @@ void
test_file_properties(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t fapl_id; /* File access plist */
+ hid_t fapl_id; /* File access plist */
hbool_t is_coll;
const char *filename;
MPI_Comm comm = MPI_COMM_WORLD;
diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c
index 4556b01..28baed5 100644
--- a/testpar/t_filter_read.c
+++ b/testpar/t_filter_read.c
@@ -37,9 +37,9 @@ static int mpi_size, mpi_rank;
#define HS_DIM1 200
#define HS_DIM2 100
-
+
/*-------------------------------------------------------------------------
- * Function: filter_read_internal
+ * Function: filter_read_internal
*
* Purpose: Tests parallel reading of a 2D dataset written serially using
* filters. During the parallel reading phase, the dataset is
@@ -54,13 +54,13 @@ static void
filter_read_internal(const char *filename, hid_t dcpl,
hsize_t *dset_size)
{
- hid_t file, dataset; /* HDF5 IDs */
- hid_t access_plist; /* Access property list ID */
- hid_t sid, memspace; /* Dataspace IDs */
- hsize_t size[2]; /* Dataspace dimensions */
- hsize_t hs_offset[2]; /* Hyperslab offset */
- hsize_t hs_size[2]; /* Hyperslab size */
- size_t i, j; /* Local index variables */
+ hid_t file, dataset; /* HDF5 IDs */
+ hid_t access_plist; /* Access property list ID */
+ hid_t sid, memspace; /* Dataspace IDs */
+ hsize_t size[2]; /* Dataspace dimensions */
+ hsize_t hs_offset[2]; /* Hyperslab offset */
+ hsize_t hs_size[2]; /* Hyperslab size */
+ size_t i, j; /* Local index variables */
char name[32] = "dataset";
herr_t hrc; /* Error status */
int *points = NULL; /* Writing buffer for entire dataset */
@@ -151,17 +151,17 @@ filter_read_internal(const char *filename, hid_t dcpl,
for (j=0; j<hs_size[1]; j++) {
if(points[i*size[1]+(size_t)hs_offset[1]+j] !=
check[i*hs_size[1]+j]) {
- fprintf(stderr," Read different values than written.\n");
- fprintf(stderr," At index %lu,%lu\n",
- (unsigned long)(i),
- (unsigned long)(hs_offset[1]+j));
- fprintf(stderr," At original: %d\n",
- (int)points[i*size[1]+(size_t)hs_offset[1]+j]);
- fprintf(stderr," At returned: %d\n",
- (int)check[i*hs_size[1]+j]);
+ HDfprintf(stderr," Read different values than written.\n");
+ HDfprintf(stderr," At index %lu,%lu\n",
+ (unsigned long)(i),
+ (unsigned long)(hs_offset[1]+j));
+ HDfprintf(stderr," At original: %d\n",
+ (int)points[i*size[1]+(size_t)hs_offset[1]+j]);
+ HDfprintf(stderr," At returned: %d\n",
+ (int)check[i*hs_size[1]+j]);
VRFY(FALSE, "");
- }
- }
+ }
+ }
}
/* Get the storage size of the dataset */
@@ -194,10 +194,10 @@ filter_read_internal(const char *filename, hid_t dcpl,
/*-------------------------------------------------------------------------
* Function: test_filter_read
*
- * Purpose: Tests parallel reading of datasets written serially using
+ * Purpose: Tests parallel reading of datasets written serially using
* several (combinations of) filters.
*
- * Programmer: Christian Chilan
+ * Programmer: Christian Chilan
* Tuesday, May 15, 2007
*
* Modifications:
@@ -208,7 +208,7 @@ filter_read_internal(const char *filename, hid_t dcpl,
void
test_filter_read(void)
{
- hid_t dc; /* HDF5 IDs */
+ hid_t dc; /* HDF5 IDs */
const hsize_t chunk_size[2] = {CHUNK_DIM1, CHUNK_DIM2}; /* Chunk dimensions */
hsize_t null_size; /* Size of dataset without filters */
unsigned chunk_opts; /* Chunk options */
@@ -236,7 +236,7 @@ test_filter_read(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Parallel reading of dataset written with filters %s\n", filename);
+ HDprintf("Parallel reading of dataset written with filters %s\n", filename);
/*----------------------------------------------------------
* STEP 0: Test without filters.
@@ -448,10 +448,10 @@ test_filter_read(void)
/* Make sure encoding is enabled */
if(h5_szip_can_encode() == 1) {
- hrc = H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block);
+ hrc = H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block);
VRFY(hrc>=0, "H5Pset_szip");
- filter_read_internal(filename,dc,&combo_size);
+ filter_read_internal(filename,dc,&combo_size);
}
/* Clean up objects used for this test */
@@ -461,25 +461,25 @@ test_filter_read(void)
/* Testing shuffle+szip(with encoder)+checksum filters(checksum last) */
/* Make sure encoding is enabled */
if(h5_szip_can_encode() == 1) {
- dc = H5Pcreate(H5P_DATASET_CREATE);
+ dc = H5Pcreate(H5P_DATASET_CREATE);
VRFY(dc>=0, "H5Pcreate");
- hrc = H5Pset_chunk (dc, 2, chunk_size);
+ hrc = H5Pset_chunk (dc, 2, chunk_size);
VRFY(hrc>=0, "H5Pset_chunk");
- hrc = H5Pset_shuffle (dc);
+ hrc = H5Pset_shuffle (dc);
VRFY(hrc>=0, "H5Pset_shuffle");
- hrc = H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block);
+ hrc = H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block);
VRFY(hrc>=0, "H5Pset_szip");
- hrc = H5Pset_fletcher32 (dc);
+ hrc = H5Pset_fletcher32 (dc);
VRFY(hrc>=0, "H5Pset_fletcher32");
- filter_read_internal(filename,dc,&combo_size);
+ filter_read_internal(filename,dc,&combo_size);
- /* Clean up objects used for this test */
- hrc = H5Pclose (dc);
+ /* Clean up objects used for this test */
+ hrc = H5Pclose (dc);
VRFY(hrc>=0, "H5Pclose");
}
diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c
index 1f26e0d..76f9276 100644
--- a/testpar/t_filters_parallel.c
+++ b/testpar/t_filters_parallel.c
@@ -3683,6 +3683,8 @@ test_read_filtered_dataset_point_selection(void)
if (read_buf) HDfree(read_buf);
if (correct_buf) HDfree(correct_buf);
+ HDfree(coords);
+
VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded");
VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded");
VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded");
@@ -5791,6 +5793,9 @@ test_write_parallel_read_serial(void)
VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded");
VRFY((H5Fclose(file_id) >= 0), "File close succeeded");
+
+ HDfree(correct_buf);
+ HDfree(read_buf);
}
return;
@@ -5808,7 +5813,7 @@ test_write_parallel_read_serial(void)
static void
test_shrinking_growing_chunks(void)
{
- float *data = NULL;
+ double *data = NULL;
hsize_t dataset_dims[SHRINKING_GROWING_CHUNKS_DATASET_DIMS];
hsize_t chunk_dims[SHRINKING_GROWING_CHUNKS_DATASET_DIMS];
hsize_t sel_dims[SHRINKING_GROWING_CHUNKS_DATASET_DIMS];
@@ -5903,9 +5908,9 @@ test_shrinking_growing_chunks(void)
VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0),
"Set DXPL MPIO succeeded");
- data_size = sel_dims[0] * sel_dims[1] * sizeof(*data);
+ data_size = sel_dims[0] * sel_dims[1] * sizeof(double);
- data = (float *) HDcalloc(1, data_size);
+ data = (double *) HDcalloc(1, data_size);
VRFY((NULL != data), "HDcalloc succeeded");
for (i = 0; i < SHRINKING_GROWING_CHUNKS_NLOOPS; i++) {
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index 16eb13c..63ac8d3 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -21,7 +21,7 @@
enum obj_type { is_group, is_dset };
-static int get_size(void);
+static int get_size(void);
static void write_dataset(hid_t, hid_t, hid_t);
static int read_dataset(hid_t, hid_t, hid_t);
static void create_group_recursive(hid_t, hid_t, hid_t, int);
@@ -54,13 +54,9 @@ get_size(void)
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
if(mpi_size > size ) {
-
if((mpi_size % 2) == 0 ) {
-
size = mpi_size;
-
} else {
-
size = mpi_size + 1;
}
}
@@ -79,7 +75,7 @@ get_size(void)
void zero_dim_dset(void)
{
int mpi_size, mpi_rank;
- const char *filename;
+ const char *filename;
hid_t fid, plist, dcpl, dsid, sid;
hsize_t dim, chunk_dim;
herr_t ret;
@@ -133,27 +129,27 @@ void zero_dim_dset(void)
* Example of using PHDF5 to create ndatasets datasets. Each process write
* a slab of array to the file.
*
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
+ * Changes: Updated function to use a dynamically calculated size,
+ * instead of the old SIZE #define. This should allow it
+ * to function with an arbitrary number of processors.
*
- * JRM - 8/11/04
+ * JRM - 8/11/04
*/
void multiple_dset_write(void)
{
- int i, j, n, mpi_size, mpi_rank, size;
+ int i, j, n, mpi_size, mpi_rank, size;
hid_t iof, plist, dataset, memspace, filespace;
hid_t dcpl; /* Dataset creation property list */
hsize_t chunk_origin [DIM];
hsize_t chunk_dims [DIM], file_dims [DIM];
hsize_t count[DIM]={1,1};
- double * outme = NULL;
+ double *outme = NULL;
double fill=1.0; /* Fill value */
- char dname [100];
+ char dname [100];
herr_t ret;
- const H5Ptest_param_t *pt;
- char *filename;
- int ndatasets;
+ const H5Ptest_param_t *pt;
+ char *filename;
+ int ndatasets;
pt = GetTestParameters();
filename = pt->name;
@@ -190,23 +186,23 @@ void multiple_dset_write(void)
VRFY((ret>=0), "set fill-value succeeded");
for(n = 0; n < ndatasets; n++) {
- sprintf(dname, "dataset %d", n);
- dataset = H5Dcreate2(iof, dname, H5T_NATIVE_DOUBLE, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- VRFY((dataset > 0), dname);
+ HDsprintf(dname, "dataset %d", n);
+ dataset = H5Dcreate2(iof, dname, H5T_NATIVE_DOUBLE, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ VRFY((dataset > 0), dname);
- /* calculate data to write */
- for(i = 0; i < size; i++)
- for(j = 0; j < size; j++)
- outme [(i * size) + j] = n*1000 + mpi_rank;
+ /* calculate data to write */
+ for(i = 0; i < size; i++)
+ for(j = 0; j < size; j++)
+ outme [(i * size) + j] = n*1000 + mpi_rank;
- H5Dwrite(dataset, H5T_NATIVE_DOUBLE, memspace, filespace, H5P_DEFAULT, outme);
+ H5Dwrite(dataset, H5T_NATIVE_DOUBLE, memspace, filespace, H5P_DEFAULT, outme);
- H5Dclose(dataset);
+ H5Dclose(dataset);
#ifdef BARRIER_CHECKS
- if(!((n+1) % 10)) {
- printf("created %d datasets\n", n+1);
- MPI_Barrier(MPI_COMM_WORLD);
- }
+ if(!((n+1) % 10)) {
+ HDprintf("created %d datasets\n", n+1);
+ MPI_Barrier(MPI_COMM_WORLD);
+ }
#endif /* BARRIER_CHECKS */
}
@@ -221,21 +217,21 @@ void multiple_dset_write(void)
/* Example of using PHDF5 to create, write, and read compact dataset.
*
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
+ * Changes: Updated function to use a dynamically calculated size,
+ * instead of the old SIZE #define. This should allow it
+ * to function with an arbitrary number of processors.
*
- * JRM - 8/11/04
+ * JRM - 8/11/04
*/
void compact_dataset(void)
{
- int i, j, mpi_size, mpi_rank, size, err_num=0;
- hid_t iof, plist, dcpl, dxpl, dataset, filespace;
+ int i, j, mpi_size, mpi_rank, size, err_num=0;
+ hid_t iof, plist, dcpl, dxpl, dataset, filespace;
hsize_t file_dims [DIM];
- double * outme;
- double * inme;
- char dname[]="dataset";
- herr_t ret;
+ double *outme;
+ double *inme;
+ char dname[]="dataset";
+ herr_t ret;
const char *filename;
size = get_size();
@@ -278,15 +274,15 @@ void compact_dataset(void)
ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
/* Recalculate data to write. Each process writes the same data. */
for(i = 0; i < size; i++)
for(j = 0; j < size; j++)
- outme[(i * size) + j] =(i + j) * 1000;
+ outme[(i * size) + j] =(i + j) * 1000;
ret = H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, dxpl, outme);
VRFY((ret >= 0), "H5Dwrite succeeded");
@@ -308,8 +304,8 @@ void compact_dataset(void)
ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
dataset = H5Dopen2(iof, dname, H5P_DEFAULT);
@@ -338,7 +334,7 @@ void compact_dataset(void)
for(j = 0; j < size; j++)
if(inme[(i * size) + j] != outme[(i * size) + j])
if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- printf("Dataset Verify failed at [%d][%d]: expect %f, got %f\n", i, j, outme[(i * size) + j], inme[(i * size) + j]);
+ HDprintf("Dataset Verify failed at [%d][%d]: expect %f, got %f\n", i, j, outme[(i * size) + j], inme[(i * size) + j]);
H5Pclose(plist);
H5Pclose(dxpl);
@@ -352,24 +348,24 @@ void compact_dataset(void)
* Example of using PHDF5 to create, write, and read dataset and attribute
* of Null dataspace.
*
- * Changes: Removed the assert that mpi_size <= the SIZE #define.
- * As best I can tell, this assert isn't needed here,
- * and in any case, the SIZE #define is being removed
- * in an update of the functions in this file to run
- * with an arbitrary number of processes.
+ * Changes: Removed the assert that mpi_size <= the SIZE #define.
+ * As best I can tell, this assert isn't needed here,
+ * and in any case, the SIZE #define is being removed
+ * in an update of the functions in this file to run
+ * with an arbitrary number of processes.
*
* JRM - 8/24/04
*/
void null_dataset(void)
{
- int mpi_size, mpi_rank;
- hid_t iof, plist, dxpl, dataset, attr, sid;
+ int mpi_size, mpi_rank;
+ hid_t iof, plist, dxpl, dataset, attr, sid;
unsigned uval=2; /* Buffer for writing to dataset */
- int val=1; /* Buffer for writing to attribute */
- int nelem;
- char dname[]="dataset";
- char attr_name[]="attribute";
- herr_t ret;
+ int val=1; /* Buffer for writing to attribute */
+ int nelem;
+ char dname[]="dataset";
+ char attr_name[]="attribute";
+ herr_t ret;
const char *filename;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -397,8 +393,8 @@ void null_dataset(void)
ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
@@ -431,8 +427,8 @@ void null_dataset(void)
ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
@@ -464,11 +460,11 @@ void null_dataset(void)
* sizes(2GB, 4GB, etc.), but the metadata for the file pushes the file over
* the boundary of interest.
*
- * Changes: Removed the assert that mpi_size <= the SIZE #define.
- * As best I can tell, this assert isn't needed here,
- * and in any case, the SIZE #define is being removed
- * in an update of the functions in this file to run
- * with an arbitrary number of processes.
+ * Changes: Removed the assert that mpi_size <= the SIZE #define.
+ * As best I can tell, this assert isn't needed here,
+ * and in any case, the SIZE #define is being removed
+ * in an update of the functions in this file to run
+ * with an arbitrary number of processes.
*
* JRM - 8/11/04
*/
@@ -592,13 +588,13 @@ void big_dataset(void)
* not have actual data written to the entire raw data area and relies on the
* default fill value of zeros to work correctly.
*
- * Changes: Removed the assert that mpi_size <= the SIZE #define.
- * As best I can tell, this assert isn't needed here,
- * and in any case, the SIZE #define is being removed
- * in an update of the functions in this file to run
- * with an arbitrary number of processes.
+ * Changes: Removed the assert that mpi_size <= the SIZE #define.
+ * As best I can tell, this assert isn't needed here,
+ * and in any case, the SIZE #define is being removed
+ * in an update of the functions in this file to run
+ * with an arbitrary number of processes.
*
- * Also added code to free dynamically allocated buffers.
+ * Also added code to free dynamically allocated buffers.
*
* JRM - 8/11/04
*/
@@ -619,7 +615,7 @@ void dataset_fillvalue(void)
hsize_t dset_size; /* Dataset size */
int *rdata, *wdata; /* Buffers for data to read and write */
int *twdata, *trdata; /* Temporary pointer into buffer */
- int acc, i, j, k, l, ii; /* Local index variables */
+ int acc, i, ii, j, k, l; /* Local index variables */
herr_t ret; /* Generic return value */
const char *filename;
@@ -707,11 +703,11 @@ void dataset_fillvalue(void)
for(l = 0; l < (int)dset_dims[3]; l++, twdata++, trdata++)
if(*trdata != 0)
if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i, j, k, l, *trdata);
+ HDprintf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i, j, k, l, *trdata);
if(err_num > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("[more errors ...]\n");
+ HDprintf("[more errors ...]\n");
if(err_num) {
- printf("%d errors found in check_value\n", err_num);
+ HDprintf("%d errors found in check_value\n", err_num);
nerrors++;
}
}
@@ -798,21 +794,21 @@ void dataset_fillvalue(void)
if(i<mpi_size) {
if(*twdata != *trdata )
if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- printf("Dataset Verify failed at [%d][%d][%d][%d]: expect %d, got %d\n", i,j,k,l, *twdata, *trdata);
+ HDprintf("Dataset Verify failed at [%d][%d][%d][%d]: expect %d, got %d\n", i,j,k,l, *twdata, *trdata);
} /* end if */
else {
if(*trdata != 0)
if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i,j,k,l, *trdata);
+ HDprintf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i,j,k,l, *trdata);
} /* end else */
if(err_num > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("[more errors ...]\n");
+ HDprintf("[more errors ...]\n");
if(err_num){
- printf("%d errors found in check_value\n", err_num);
+ HDprintf("%d errors found in check_value\n", err_num);
nerrors++;
}
}
-
+
/* Close all file objects */
ret = H5Dclose(dataset);
VRFY((ret >= 0), "H5Dclose succeeded");
@@ -838,6 +834,13 @@ void dataset_fillvalue(void)
HDfree(wdata);
}
+/* combined cngrpw and ingrpr tests because ingrpr reads file created by cngrpw. */
+void collective_group_write_independent_group_read(void)
+{
+ collective_group_write();
+ independent_group_read();
+}
+
/* Write multiple groups with a chunked dataset in each group collectively.
* These groups and datasets are for testing independent read later.
*
@@ -849,18 +852,18 @@ void dataset_fillvalue(void)
*/
void collective_group_write(void)
{
- int mpi_rank, mpi_size, size;
- int i, j, m;
- char gname[64], dname[32];
+ int mpi_rank, mpi_size, size;
+ int i, j, m;
+ char gname[64], dname[32];
hid_t fid, gid, did, plist, dcpl, memspace, filespace;
- DATATYPE * outme = NULL;
- hsize_t chunk_origin[DIM];
- hsize_t chunk_dims[DIM], file_dims[DIM], count[DIM];
- hsize_t chunk_size[2]; /* Chunk dimensions - computed shortly */
- herr_t ret1, ret2;
+ DATATYPE *outme = NULL;
+ hsize_t chunk_origin[DIM];
+ hsize_t chunk_dims[DIM], file_dims[DIM], count[DIM];
+ hsize_t chunk_size[2]; /* Chunk dimensions - computed shortly */
+ herr_t ret1, ret2;
const H5Ptest_param_t *pt;
- char *filename;
- int ngroups;
+ char *filename;
+ int ngroups;
pt = GetTestParameters();
filename = pt->name;
@@ -905,11 +908,11 @@ void collective_group_write(void)
/* creates ngroups groups under the root group, writes chunked
* datasets in parallel. */
for(m = 0; m < ngroups; m++) {
- sprintf(gname, "group%d", m);
+ HDsprintf(gname, "group%d", m);
gid = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((gid > 0), gname);
- sprintf(dname, "dataset%d", m);
+ HDsprintf(dname, "dataset%d", m);
did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
VRFY((did > 0), dname);
@@ -917,15 +920,14 @@ void collective_group_write(void)
for(j = 0; j < size; j++)
outme[(i * size) + j] =(i + j) * 1000 + mpi_rank;
- H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT,
- outme);
+ H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme);
H5Dclose(did);
H5Gclose(gid);
#ifdef BARRIER_CHECKS
if(!((m+1) % 10)) {
- printf("created %d groups\n", m+1);
+ HDprintf("created %d groups\n", m+1);
MPI_Barrier(MPI_COMM_WORLD);
}
#endif /* BARRIER_CHECKS */
@@ -947,8 +949,8 @@ void independent_group_read(void)
int mpi_rank, m;
hid_t plist, fid;
const H5Ptest_param_t *pt;
- char *filename;
- int ngroups;
+ char *filename;
+ int ngroups;
pt = GetTestParameters();
filename = pt->name;
@@ -982,9 +984,9 @@ void independent_group_read(void)
* instead of the old SIZE #define. This should allow it
* to function with an arbitrary number of processors.
*
- * Also added code to verify the results of dynamic memory
- * allocations, and to free dynamically allocated memeory
- * when we are done with it.
+ * Also added code to verify the results of dynamic memory
+ * allocations, and to free dynamically allocated memeory
+ * when we are done with it.
*
* JRM - 8/16/04
*/
@@ -1006,12 +1008,12 @@ group_dataset_read(hid_t fid, int mpi_rank, int m)
VRFY((outdata != NULL), "HDmalloc succeeded for outdata");
/* open every group under root group. */
- sprintf(gname, "group%d", m);
+ HDsprintf(gname, "group%d", m);
gid = H5Gopen2(fid, gname, H5P_DEFAULT);
VRFY((gid > 0), gname);
/* check the data. */
- sprintf(dname, "dataset%d", m);
+ HDsprintf(dname, "dataset%d", m);
did = H5Dopen2(gid, dname, H5P_DEFAULT);
VRFY((did>0), dname);
@@ -1068,16 +1070,16 @@ group_dataset_read(hid_t fid, int mpi_rank, int m)
*/
void multiple_group_write(void)
{
- int mpi_rank, mpi_size, size;
- int m;
- char gname[64];
- hid_t fid, gid, plist, memspace, filespace;
+ int mpi_rank, mpi_size, size;
+ int m;
+ char gname[64];
+ hid_t fid, gid, plist, memspace, filespace;
hsize_t chunk_origin[DIM];
hsize_t chunk_dims[DIM], file_dims[DIM], count[DIM];
- herr_t ret;
+ herr_t ret;
const H5Ptest_param_t *pt;
- char *filename;
- int ngroups;
+ char *filename;
+ int ngroups;
pt = GetTestParameters();
filename = pt->name;
@@ -1112,23 +1114,23 @@ void multiple_group_write(void)
/* creates ngroups groups under the root group, writes datasets in
* parallel. */
for(m = 0; m < ngroups; m++) {
- sprintf(gname, "group%d", m);
+ HDsprintf(gname, "group%d", m);
gid = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((gid > 0), gname);
/* create attribute for these groups. */
- write_attribute(gid, is_group, m);
+ write_attribute(gid, is_group, m);
if(m != 0)
- write_dataset(memspace, filespace, gid);
+ write_dataset(memspace, filespace, gid);
H5Gclose(gid);
#ifdef BARRIER_CHECKS
if(!((m+1) % 10)) {
- printf("created %d groups\n", m+1);
+ HDprintf("created %d groups\n", m+1);
MPI_Barrier(MPI_COMM_WORLD);
- }
+ }
#endif /* BARRIER_CHECKS */
}
@@ -1159,11 +1161,11 @@ void multiple_group_write(void)
static void
write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
{
- int i, j, n, size;
- int mpi_rank, mpi_size;
- char dname[32];
- DATATYPE * outme = NULL;
- hid_t did;
+ int i, j, n, size;
+ int mpi_rank, mpi_size;
+ char dname[32];
+ DATATYPE *outme = NULL;
+ hid_t did;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
@@ -1174,13 +1176,13 @@ write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
VRFY((outme != NULL), "HDmalloc succeeded for outme");
for(n = 0; n < NDATASET; n++) {
- sprintf(dname, "dataset%d", n);
+ HDsprintf(dname, "dataset%d", n);
did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((did > 0), dname);
for(i = 0; i < size; i++)
for(j = 0; j < size; j++)
- outme[(i * size) + j] = n * 1000 + mpi_rank;
+ outme[(i * size) + j] = n * 1000 + mpi_rank;
H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme);
@@ -1207,12 +1209,12 @@ create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, int counter)
#ifdef BARRIER_CHECKS
if(!((counter+1) % 10)) {
- printf("created %dth child groups\n", counter+1);
+ HDprintf("created %dth child groups\n", counter+1);
MPI_Barrier(MPI_COMM_WORLD);
}
#endif /* BARRIER_CHECKS */
- sprintf(gname, "%dth_child_group", counter+1);
+ HDsprintf(gname, "%dth_child_group", counter+1);
child_gid = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((child_gid > 0), gname);
@@ -1244,8 +1246,8 @@ void multiple_group_read(void)
hsize_t chunk_origin[DIM];
hsize_t chunk_dims[DIM], file_dims[DIM], count[DIM];
const H5Ptest_param_t *pt;
- char *filename;
- int ngroups;
+ char *filename;
+ int ngroups;
pt = GetTestParameters();
filename = pt->name;
@@ -1273,19 +1275,19 @@ void multiple_group_read(void)
/* open every group under root group. */
for(m=0; m<ngroups; m++) {
- sprintf(gname, "group%d", m);
+ HDsprintf(gname, "group%d", m);
gid = H5Gopen2(fid, gname, H5P_DEFAULT);
VRFY((gid > 0), gname);
/* check the data. */
if(m != 0)
if((error_num = read_dataset(memspace, filespace, gid))>0)
- nerrors += error_num;
+ nerrors += error_num;
/* check attribute.*/
error_num = 0;
if((error_num = read_attribute(gid, is_group, m))>0 )
- nerrors += error_num;
+ nerrors += error_num;
H5Gclose(gid);
@@ -1320,10 +1322,10 @@ void multiple_group_read(void)
static int
read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
{
- int i, j, n, mpi_rank, mpi_size, size, attr_errors=0, vrfy_errors=0;
- char dname[32];
+ int i, j, n, mpi_rank, mpi_size, size, attr_errors=0, vrfy_errors=0;
+ char dname[32];
DATATYPE *outdata = NULL, *indata = NULL;
- hid_t did;
+ hid_t did;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
@@ -1337,19 +1339,18 @@ read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
VRFY((outdata != NULL), "HDmalloc succeeded for outdata");
for(n=0; n<NDATASET; n++) {
- sprintf(dname, "dataset%d", n);
+ HDsprintf(dname, "dataset%d", n);
did = H5Dopen2(gid, dname, H5P_DEFAULT);
VRFY((did>0), dname);
- H5Dread(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT,
- indata);
+ H5Dread(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, indata);
/* this is the original value */
for(i=0; i<size; i++)
- for(j=0; j<size; j++) {
- *outdata = n*1000 + mpi_rank;
+ for(j=0; j<size; j++) {
+ *outdata = n*1000 + mpi_rank;
outdata++;
- }
+ }
outdata -= size * size;
/* compare the original value(outdata) to the value in file(indata).*/
@@ -1389,7 +1390,7 @@ recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid, int counter)
nerrors += err_num;
if(counter < GROUP_DEPTH ) {
- sprintf(gname, "%dth_child_group", counter+1);
+ HDsprintf(gname, "%dth_child_group", counter+1);
child_gid = H5Gopen2(gid, gname, H5P_DEFAULT);
VRFY((child_gid>0), gname);
recursive_read_group(memspace, filespace, child_gid, counter+1);
@@ -1411,7 +1412,7 @@ write_attribute(hid_t obj_id, int this_type, int num)
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
if(this_type == is_group) {
- sprintf(attr_name, "Group Attribute %d", num);
+ HDsprintf(attr_name, "Group Attribute %d", num);
sid = H5Screate(H5S_SCALAR);
aid = H5Acreate2(obj_id, attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT);
H5Awrite(aid, H5T_NATIVE_INT, &num);
@@ -1419,7 +1420,7 @@ write_attribute(hid_t obj_id, int this_type, int num)
H5Sclose(sid);
} /* end if */
else if(this_type == is_dset) {
- sprintf(attr_name, "Dataset Attribute %d", num);
+ HDsprintf(attr_name, "Dataset Attribute %d", num);
for(i=0; i<8; i++)
attr_data[i] = i;
sid = H5Screate_simple(dspace_rank, dspace_dims, NULL);
@@ -1443,23 +1444,23 @@ read_attribute(hid_t obj_id, int this_type, int num)
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
if(this_type == is_group) {
- sprintf(attr_name, "Group Attribute %d", num);
+ HDsprintf(attr_name, "Group Attribute %d", num);
aid = H5Aopen(obj_id, attr_name, H5P_DEFAULT);
if(MAINPROCESS) {
H5Aread(aid, H5T_NATIVE_INT, &in_num);
vrfy_errors = dataset_vrfy(NULL, NULL, NULL, group_block, &in_num, &num);
- }
+ }
H5Aclose(aid);
}
else if(this_type == is_dset) {
- sprintf(attr_name, "Dataset Attribute %d", num);
+ HDsprintf(attr_name, "Dataset Attribute %d", num);
for(i=0; i<8; i++)
out_data[i] = i;
aid = H5Aopen(obj_id, attr_name, H5P_DEFAULT);
if(MAINPROCESS) {
H5Aread(aid, H5T_NATIVE_INT, in_data);
vrfy_errors = dataset_vrfy(NULL, NULL, NULL, dset_block, in_data, out_data);
- }
+ }
H5Aclose(aid);
}
@@ -1469,18 +1470,18 @@ read_attribute(hid_t obj_id, int this_type, int num)
/* This functions compares the original data with the read-in data for its
* hyperslab part only by process ID.
*
- * Changes: Modified function to use a passed in size parameter
- * instead of the old SIZE #define. This should let us
- * run with an arbitrary number of processes.
+ * Changes: Modified function to use a passed in size parameter
+ * instead of the old SIZE #define. This should let us
+ * run with an arbitrary number of processes.
*
- * JRM - 8/16/04
+ * JRM - 8/16/04
*/
static int
check_value(DATATYPE *indata, DATATYPE *outdata, int size)
{
- int mpi_rank, mpi_size, err_num=0;
- hsize_t i, j;
- hsize_t chunk_origin[DIM];
+ int mpi_rank, mpi_size, err_num=0;
+ hsize_t i, j;
+ hsize_t chunk_origin[DIM];
hsize_t chunk_dims[DIM], count[DIM];
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -1491,25 +1492,25 @@ check_value(DATATYPE *indata, DATATYPE *outdata, int size)
indata += chunk_origin[0]*size;
outdata += chunk_origin[0]*size;
for(i=chunk_origin[0]; i<(chunk_origin[0]+chunk_dims[0]); i++)
- for(j=chunk_origin[1]; j<(chunk_origin[1]+chunk_dims[1]); j++) {
- if(*indata != *outdata )
- if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- printf("Dataset Verify failed at [%lu][%lu](row %lu, col%lu): expect %d, got %d\n",(unsigned long)i,(unsigned long)j,(unsigned long)i,(unsigned long)j, *outdata, *indata);
- }
+ for(j=chunk_origin[1]; j<(chunk_origin[1]+chunk_dims[1]); j++) {
+ if(*indata != *outdata )
+ if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
+ HDprintf("Dataset Verify failed at [%lu][%lu](row %lu, col%lu): expect %d, got %d\n",(unsigned long)i,(unsigned long)j,(unsigned long)i,(unsigned long)j, *outdata, *indata);
+ }
if(err_num > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("[more errors ...]\n");
+ HDprintf("[more errors ...]\n");
if(err_num)
- printf("%d errors found in check_value\n", err_num);
+ HDprintf("%d errors found in check_value\n", err_num);
return err_num;
}
/* Decide the portion of data chunk in dataset by process ID.
*
- * Changes: Modified function to use a passed in size parameter
- * instead of the old SIZE #define. This should let us
- * run with an arbitrary number of processes.
+ * Changes: Modified function to use a passed in size parameter
+ * instead of the old SIZE #define. This should let us
+ * run with an arbitrary number of processes.
*
- * JRM - 8/11/04
+ * JRM - 8/11/04
*/
static void
@@ -1553,7 +1554,7 @@ get_slab(hsize_t chunk_origin[], hsize_t chunk_dims[], hsize_t count[],
* on failure.
* JRM - 9/13/04
*
- * Changes: None.
+ * Changes: None.
*/
#define N 4
@@ -1588,10 +1589,10 @@ void io_mode_confusion(void)
* test bed related variables
*/
- const char * fcn_name = "io_mode_confusion";
- const hbool_t verbose = FALSE;
- const H5Ptest_param_t * pt;
- char * filename;
+ const char * fcn_name = "io_mode_confusion";
+ const hbool_t verbose = FALSE;
+ const H5Ptest_param_t * pt;
+ char * filename;
pt = GetTestParameters();
@@ -1737,8 +1738,8 @@ void io_mode_confusion(void)
status = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE);
VRFY((status >= 0 ), "H5Pset_dxpl_mpio() failed");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- status = H5Pset_dxpl_mpio_collective_opt(plist_id, H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((status>= 0),"set independent IO collectively succeeded");
+ status = H5Pset_dxpl_mpio_collective_opt(plist_id, H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((status>= 0),"set independent IO collectively succeeded");
}
@@ -1792,13 +1793,13 @@ void io_mode_confusion(void)
/*
* At present, the object header code maintains an image of its on disk
* representation, which is updates as necessary instead of generating on
- * request.
+ * request.
*
* Prior to the fix that this test in designed to verify, the image of the
* on disk representation was only updated on flush -- not when the object
* header was marked clean.
*
- * This worked perfectly well as long as all writes of a given object
+ * This worked perfectly well as long as all writes of a given object
* header were written from a single process. However, with the implementation
* of round robin metadata data writes in parallel HDF5, this is no longer
* the case -- it is possible for a given object header to be flushed from
@@ -1806,14 +1807,14 @@ void io_mode_confusion(void)
* clean in all other processes on each flush. This resulted in NULL or
* out of data object header information being written to disk.
*
- * To repair this, I modified the object header code to update its
- * on disk image both on flush on when marked clean.
+ * To repair this, I modified the object header code to update its
+ * on disk image both on flush on when marked clean.
*
* This test is directed at verifying that the fix performs as expected.
*
* The test functions by creating a HDF5 file with several small datasets,
- * and then flushing the file. This should result of at least one of
- * the associated object headers being flushed by a process other than
+ * and then flushing the file. This should result of at least one of
+ * the associated object headers being flushed by a process other than
* process 0.
*
* Then for each data set, add an attribute and flush the file again.
@@ -1823,26 +1824,26 @@ void io_mode_confusion(void)
* Open the each of the data sets in turn. If all opens are successful,
* the test passes. Otherwise the test fails.
*
- * Note that this test will probably become irrelevent shortly, when we
+ * Note that this test will probably become irrelevent shortly, when we
* land the journaling modifications on the trunk -- at which point all
* cache clients will have to construct on disk images on demand.
*
- * JRM -- 10/13/10
+ * JRM -- 10/13/10
*
* Changes:
- * Break it into two parts, a writer to write the file and a reader
- * the correctness of the writer. AKC -- 2010/10/27
+ * Break it into two parts, a writer to write the file and a reader
+ * the correctness of the writer. AKC -- 2010/10/27
*/
-#define NUM_DATA_SETS 4
-#define LOCAL_DATA_SIZE 4
-#define LARGE_ATTR_SIZE 256
+#define NUM_DATA_SETS 4
+#define LOCAL_DATA_SIZE 4
+#define LARGE_ATTR_SIZE 256
/* Since all even and odd processes are split into writer and reader comm
* respectively, process 0 and 1 in COMM_WORLD become the root process of
* the writer and reader comm respectively.
*/
-#define Writer_Root 0
-#define Reader_Root 1
+#define Writer_Root 0
+#define Reader_Root 1
#define Reader_wait(mpi_err, xsteps) \
mpi_err = MPI_Bcast(&xsteps, 1, MPI_INT, Writer_Root, MPI_COMM_WORLD)
#define Reader_result(mpi_err, xsteps_done) \
@@ -1854,26 +1855,26 @@ void io_mode_confusion(void)
/* object names used by both rr_obj_hdr_flush_confusion and
* rr_obj_hdr_flush_confusion_reader.
*/
-const char * dataset_name[NUM_DATA_SETS] =
- {
- "dataset_0",
- "dataset_1",
- "dataset_2",
- "dataset_3"
+const char * dataset_name[NUM_DATA_SETS] =
+ {
+ "dataset_0",
+ "dataset_1",
+ "dataset_2",
+ "dataset_3"
};
-const char * att_name[NUM_DATA_SETS] =
- {
- "attribute_0",
- "attribute_1",
- "attribute_2",
- "attribute_3"
+const char * att_name[NUM_DATA_SETS] =
+ {
+ "attribute_0",
+ "attribute_1",
+ "attribute_2",
+ "attribute_3"
};
-const char * lg_att_name[NUM_DATA_SETS] =
- {
- "large_attribute_0",
- "large_attribute_1",
- "large_attribute_2",
- "large_attribute_3"
+const char * lg_att_name[NUM_DATA_SETS] =
+ {
+ "large_attribute_0",
+ "large_attribute_1",
+ "large_attribute_2",
+ "large_attribute_3"
};
void rr_obj_hdr_flush_confusion(void)
@@ -1882,14 +1883,14 @@ void rr_obj_hdr_flush_confusion(void)
/* private communicator size and rank */
int mpi_size;
int mpi_rank;
- int mrc; /* mpi error code */
- int is_reader; /* 1 for reader process; 0 for writer process. */
+ int mrc; /* mpi error code */
+ int is_reader; /* 1 for reader process; 0 for writer process. */
MPI_Comm comm;
/* test bed related variables */
- const char * fcn_name = "rr_obj_hdr_flush_confusion";
- const hbool_t verbose = FALSE;
+ const char * fcn_name = "rr_obj_hdr_flush_confusion";
+ const hbool_t verbose = FALSE;
/* Create two new private communicators from MPI_COMM_WORLD.
* Even and odd ranked processes go to comm_writers and comm_readers
@@ -1912,9 +1913,9 @@ void rr_obj_hdr_flush_confusion(void)
* step. When all steps are done, they inform readers to end.
*/
if (is_reader)
- rr_obj_hdr_flush_confusion_reader(comm);
+ rr_obj_hdr_flush_confusion_reader(comm);
else
- rr_obj_hdr_flush_confusion_writer(comm);
+ rr_obj_hdr_flush_confusion_writer(comm);
MPI_Comm_free(&comm);
if(verbose )
@@ -1958,16 +1959,16 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
/* private communicator size and rank */
int mpi_size;
int mpi_rank;
- int mrc; /* mpi error code */
+ int mrc; /* mpi error code */
/* steps to verify and have been verified */
int steps = 0;
int steps_done = 0;
/* test bed related variables */
- const char * fcn_name = "rr_obj_hdr_flush_confusion_writer";
- const hbool_t verbose = FALSE;
- const H5Ptest_param_t * pt;
- char * filename;
+ const char *fcn_name = "rr_obj_hdr_flush_confusion_writer";
+ const hbool_t verbose = FALSE;
+ const H5Ptest_param_t *pt;
+ char *filename;
/*
* setup test bed related variables:
@@ -2001,7 +2002,7 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
*/
if(verbose )
- HDfprintf(stdout, "%0d:%s: Creating new file \"%s\".\n",
+ HDfprintf(stdout, "%0d:%s: Creating new file \"%s\".\n",
mpi_rank, fcn_name, filename);
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
@@ -2016,7 +2017,7 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
*/
if(verbose )
- HDfprintf(stdout, "%0d:%s: Creating the datasets.\n",
+ HDfprintf(stdout, "%0d:%s: Creating the datasets.\n",
mpi_rank, fcn_name);
disk_size[0] = (hsize_t)(LOCAL_DATA_SIZE * mpi_size);
@@ -2025,15 +2026,15 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
for ( i = 0; i < NUM_DATA_SETS; i++ ) {
disk_space[i] = H5Screate_simple(1, disk_size, NULL);
- VRFY((disk_space[i] >= 0), "H5Screate_simple(1) failed.\n");
+ VRFY((disk_space[i] >= 0), "H5Screate_simple(1) failed.\n");
- dataset[i] = H5Dcreate2(file_id, dataset_name[i], H5T_NATIVE_DOUBLE,
+ dataset[i] = H5Dcreate2(file_id, dataset_name[i], H5T_NATIVE_DOUBLE,
disk_space[i], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dataset[i] >= 0), "H5Dcreate(1) failed.\n");
}
- /*
+ /*
* setup data transfer property list
*/
@@ -2044,11 +2045,11 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
VRFY((dxpl_id != -1), "H5Pcreate(H5P_DATASET_XFER) failed.\n");
err = H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE);
- VRFY((err >= 0),
+ VRFY((err >= 0),
"H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) failed.\n");
- /*
- * write data to the data sets
+ /*
+ * write data to the data sets
*/
if(verbose )
@@ -2064,22 +2065,22 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
}
for ( i = 0; i < NUM_DATA_SETS; i++ ) {
- err = H5Sselect_hyperslab(disk_space[i], H5S_SELECT_SET, disk_start,
- NULL, disk_count, NULL);
+ err = H5Sselect_hyperslab(disk_space[i], H5S_SELECT_SET, disk_start,
+ NULL, disk_count, NULL);
VRFY((err >= 0), "H5Sselect_hyperslab(1) failed.\n");
mem_space[i] = H5Screate_simple(1, mem_size, NULL);
- VRFY((mem_space[i] >= 0), "H5Screate_simple(2) failed.\n");
- err = H5Sselect_hyperslab(mem_space[i], H5S_SELECT_SET,
- mem_start, NULL, mem_count, NULL);
+ VRFY((mem_space[i] >= 0), "H5Screate_simple(2) failed.\n");
+ err = H5Sselect_hyperslab(mem_space[i], H5S_SELECT_SET,
+ mem_start, NULL, mem_count, NULL);
VRFY((err >= 0), "H5Sselect_hyperslab(2) failed.\n");
- err = H5Dwrite(dataset[i], H5T_NATIVE_DOUBLE, mem_space[i],
- disk_space[i], dxpl_id, data);
+ err = H5Dwrite(dataset[i], H5T_NATIVE_DOUBLE, mem_space[i],
+ disk_space[i], dxpl_id, data);
VRFY((err >= 0), "H5Dwrite(1) failed.\n");
for ( j = 0; j < LOCAL_DATA_SIZE; j++ )
- data[j] *= 10.0;
+ data[j] *= 10.0;
}
- /*
+ /*
* close the data spaces
*/
@@ -2095,12 +2096,12 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
/* End of Step 1: create the data sets and write data. */
- /*
+ /*
* flush the metadata cache
*/
if(verbose )
- HDfprintf(stdout, "%0d:%s: flushing metadata cache.\n",
+ HDfprintf(stdout, "%0d:%s: flushing metadata cache.\n",
mpi_rank, fcn_name);
err = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
VRFY((err >= 0), "H5Fflush(1) failed.\n");
@@ -2124,7 +2125,7 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
for ( i = 0; i < NUM_DATA_SETS; i++ ) {
att_space[i] = H5Screate_simple(1, att_size, NULL);
VRFY((att_space[i] >= 0), "H5Screate_simple(3) failed.\n");
- att_id[i] = H5Acreate2(dataset[i], att_name[i], H5T_NATIVE_DOUBLE,
+ att_id[i] = H5Acreate2(dataset[i], att_name[i], H5T_NATIVE_DOUBLE,
att_space[i], H5P_DEFAULT, H5P_DEFAULT);
VRFY((att_id[i] >= 0), "H5Acreate(1) failed.\n");
err = H5Awrite(att_id[i], H5T_NATIVE_DOUBLE, att);
@@ -2135,15 +2136,14 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
}
/*
- * close attribute IDs and spaces
+ * close attribute IDs and spaces
*/
if(verbose )
- HDfprintf(stdout, "%0d:%s: closing attr ids and spaces .\n",
+ HDfprintf(stdout, "%0d:%s: closing attr ids and spaces .\n",
mpi_rank, fcn_name);
for ( i = 0; i < NUM_DATA_SETS; i++ ) {
-
err = H5Sclose(att_space[i]);
VRFY((err >= 0), "H5Sclose(att_space[i]) failed.\n");
err = H5Aclose(att_id[i]);
@@ -2152,12 +2152,12 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
/* End of Step 2: write attributes to each dataset */
- /*
+ /*
* flush the metadata cache again
*/
if(verbose )
- HDfprintf(stdout, "%0d:%s: flushing metadata cache.\n",
+ HDfprintf(stdout, "%0d:%s: flushing metadata cache.\n",
mpi_rank, fcn_name);
err = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
VRFY((err >= 0), "H5Fflush(2) failed.\n");
@@ -2171,7 +2171,7 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
*/
if(verbose )
- HDfprintf(stdout, "%0d:%s: writing large attributes.\n",
+ HDfprintf(stdout, "%0d:%s: writing large attributes.\n",
mpi_rank, fcn_name);
lg_att_size[0] = (hsize_t)(LARGE_ATTR_SIZE);
@@ -2183,7 +2183,7 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
for ( i = 0; i < NUM_DATA_SETS; i++ ) {
lg_att_space[i] = H5Screate_simple(1, lg_att_size, NULL);
VRFY((lg_att_space[i] >= 0), "H5Screate_simple(4) failed.\n");
- lg_att_id[i] = H5Acreate2(dataset[i], lg_att_name[i], H5T_NATIVE_DOUBLE,
+ lg_att_id[i] = H5Acreate2(dataset[i], lg_att_name[i], H5T_NATIVE_DOUBLE,
lg_att_space[i], H5P_DEFAULT, H5P_DEFAULT);
VRFY((lg_att_id[i] >= 0), "H5Acreate(2) failed.\n");
err = H5Awrite(lg_att_id[i], H5T_NATIVE_DOUBLE, lg_att);
@@ -2192,21 +2192,21 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
lg_att[j] /= 10.0;
}
}
-
+
/* Step 3: write large attributes to each dataset */
- /*
+ /*
* flush the metadata cache yet again to clean the object headers.
*
* This is an attempt to crate a situation where we have dirty
* object header continuation chunks, but clean opject headers
* to verify a speculative bug fix -- it doesn't seem to work,
- * but I will leave the code in anyway, as the object header
+ * but I will leave the code in anyway, as the object header
* code is going to change a lot in the near future.
*/
if(verbose )
- HDfprintf(stdout, "%0d:%s: flushing metadata cache.\n",
+ HDfprintf(stdout, "%0d:%s: flushing metadata cache.\n",
mpi_rank, fcn_name);
err = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
VRFY((err >= 0), "H5Fflush(3) failed.\n");
@@ -2220,7 +2220,7 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
*/
if(verbose )
- HDfprintf(stdout, "%0d:%s: writing different large attributes.\n",
+ HDfprintf(stdout, "%0d:%s: writing different large attributes.\n",
mpi_rank, fcn_name);
for ( j = 0; j < LARGE_ATTR_SIZE; j++ ) {
@@ -2237,11 +2237,11 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
/* End of Step 4: write different large attributes to each dataset */
- /*
+ /*
* flush the metadata cache again
*/
if(verbose )
- HDfprintf(stdout, "%0d:%s: flushing metadata cache.\n",
+ HDfprintf(stdout, "%0d:%s: flushing metadata cache.\n",
mpi_rank, fcn_name);
err = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
VRFY((err >= 0), "H5Fflush(3) failed.\n");
@@ -2253,11 +2253,11 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
/* Step 5: Close all objects and the file */
/*
- * close large attribute IDs and spaces
+ * close large attribute IDs and spaces
*/
if(verbose )
- HDfprintf(stdout, "%0d:%s: closing large attr ids and spaces .\n",
+ HDfprintf(stdout, "%0d:%s: closing large attr ids and spaces .\n",
mpi_rank, fcn_name);
for ( i = 0; i < NUM_DATA_SETS; i++ ) {
@@ -2269,7 +2269,7 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
}
- /*
+ /*
* close the data sets
*/
@@ -2301,7 +2301,7 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
err = H5Fclose(file_id);
VRFY((err >= 0 ), "H5Fclose(1) failed");
-
+
/* End of Step 5: Close all objects and the file */
/* Tell the reader to check the file up to steps. */
steps++;
@@ -2347,20 +2347,20 @@ void rr_obj_hdr_flush_confusion_reader(MPI_Comm comm)
/* MPI variables */
/* world communication size and rank */
- int mpi_world_size;
- int mpi_world_rank;
+ int mpi_world_size;
+ int mpi_world_rank;
/* private communicator size and rank */
- int mpi_size;
- int mpi_rank;
- int mrc; /* mpi error code */
- int steps = -1; /* How far (steps) to verify the file */
- int steps_done = -1; /* How far (steps) have been verified */
+ int mpi_size;
+ int mpi_rank;
+ int mrc; /* mpi error code */
+ int steps = -1; /* How far (steps) to verify the file */
+ int steps_done = -1; /* How far (steps) have been verified */
/* test bed related variables */
- const char * fcn_name = "rr_obj_hdr_flush_confusion_reader";
- const hbool_t verbose = FALSE;
- const H5Ptest_param_t * pt;
- char * filename;
+ const char *fcn_name = "rr_obj_hdr_flush_confusion_reader";
+ const hbool_t verbose = FALSE;
+ const H5Ptest_param_t *pt;
+ char *filename;
/*
* setup test bed related variables:
@@ -2377,291 +2377,290 @@ void rr_obj_hdr_flush_confusion_reader(MPI_Comm comm)
/* Repeatedly re-open the file and verify its contents until it is */
/* told to end (when steps=0). */
while (steps_done != 0){
- Reader_wait(mrc, steps);
- VRFY((mrc >= 0), "Reader_wait failed");
- steps_done = 0;
+ Reader_wait(mrc, steps);
+ VRFY((mrc >= 0), "Reader_wait failed");
+ steps_done = 0;
- if (steps > 0 ){
- /*
- * Set up file access property list with parallel I/O access
- */
+ if (steps > 0 ){
+ /*
+ * Set up file access property list with parallel I/O access
+ */
- if(verbose )
- HDfprintf(stdout, "%0d:%s: Setting up property list.\n",
- mpi_rank, fcn_name);
+ if(verbose )
+ HDfprintf(stdout, "%0d:%s: Setting up property list.\n",
+ mpi_rank, fcn_name);
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
- VRFY((fapl_id != -1), "H5Pcreate(H5P_FILE_ACCESS) failed");
- err = H5Pset_fapl_mpio(fapl_id, comm, MPI_INFO_NULL);
- VRFY((err >= 0 ), "H5Pset_fapl_mpio() failed");
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ VRFY((fapl_id != -1), "H5Pcreate(H5P_FILE_ACCESS) failed");
+ err = H5Pset_fapl_mpio(fapl_id, comm, MPI_INFO_NULL);
+ VRFY((err >= 0 ), "H5Pset_fapl_mpio() failed");
- /*
- * Create a new file collectively and release property list identifier.
- */
+ /*
+ * Create a new file collectively and release property list identifier.
+ */
- if(verbose )
- HDfprintf(stdout, "%0d:%s: Re-open file \"%s\".\n",
- mpi_rank, fcn_name, filename);
+ if(verbose )
+ HDfprintf(stdout, "%0d:%s: Re-open file \"%s\".\n",
+ mpi_rank, fcn_name, filename);
- file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id);
- VRFY((file_id >= 0 ), "H5Fopen() failed");
- err = H5Pclose(fapl_id);
- VRFY((err >= 0 ), "H5Pclose(fapl_id) failed");
+ file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id);
+ VRFY((file_id >= 0 ), "H5Fopen() failed");
+ err = H5Pclose(fapl_id);
+ VRFY((err >= 0 ), "H5Pclose(fapl_id) failed");
#if 1
- if (steps >= 1){
- /*=====================================================*
- * Step 1: open the data sets and read data.
- *=====================================================*/
-
- if(verbose )
- HDfprintf(stdout, "%0d:%s: opening the datasets.\n",
- mpi_rank, fcn_name);
-
- for ( i = 0; i < NUM_DATA_SETS; i++ ) {
- dataset[i] = -1;
- }
-
- for ( i = 0; i < NUM_DATA_SETS; i++ ) {
- dataset[i] = H5Dopen2(file_id, dataset_name[i], H5P_DEFAULT);
- VRFY((dataset[i] >= 0), "H5Dopen(1) failed.\n");
- disk_space[i] = H5Dget_space(dataset[i]);
- VRFY((disk_space[i] >= 0), "H5Dget_space failed.\n");
- }
-
- /*
- * setup data transfer property list
- */
-
- if(verbose )
- HDfprintf(stdout, "%0d:%s: Setting up dxpl.\n", mpi_rank, fcn_name);
-
- dxpl_id = H5Pcreate(H5P_DATASET_XFER);
- VRFY((dxpl_id != -1), "H5Pcreate(H5P_DATASET_XFER) failed.\n");
- err = H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE);
- VRFY((err >= 0),
- "H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) failed.\n");
-
- /*
- * read data from the data sets
- */
-
- if(verbose )
- HDfprintf(stdout, "%0d:%s: Reading datasets.\n", mpi_rank, fcn_name);
-
- disk_count[0] = (hsize_t)(LOCAL_DATA_SIZE);
- disk_start[0] = (hsize_t)(LOCAL_DATA_SIZE * mpi_rank);
-
- mem_size[0] = (hsize_t)(LOCAL_DATA_SIZE);
-
- mem_count[0] = (hsize_t)(LOCAL_DATA_SIZE);
- mem_start[0] = (hsize_t)(0);
-
- /* set up expected data for verification */
- for ( j = 0; j < LOCAL_DATA_SIZE; j++ ) {
- data[j] = (double)(mpi_rank + 1);
- }
-
- for ( i = 0; i < NUM_DATA_SETS; i++ ) {
- err = H5Sselect_hyperslab(disk_space[i], H5S_SELECT_SET, disk_start,
- NULL, disk_count, NULL);
- VRFY((err >= 0), "H5Sselect_hyperslab(1) failed.\n");
- mem_space[i] = H5Screate_simple(1, mem_size, NULL);
- VRFY((mem_space[i] >= 0), "H5Screate_simple(2) failed.\n");
- err = H5Sselect_hyperslab(mem_space[i], H5S_SELECT_SET,
- mem_start, NULL, mem_count, NULL);
- VRFY((err >= 0), "H5Sselect_hyperslab(2) failed.\n");
- err = H5Dread(dataset[i], H5T_NATIVE_DOUBLE, mem_space[i],
- disk_space[i], dxpl_id, data_read);
- VRFY((err >= 0), "H5Dread(1) failed.\n");
-
- /* compare read data with expected data */
- for ( j = 0; j < LOCAL_DATA_SIZE; j++ )
- if (data_read[j] != data[j]){
- HDfprintf(stdout,
- "%0d:%s: Reading datasets value failed in "
- "Dataset %d, at position %d: expect %f, got %f.\n",
- mpi_rank, fcn_name, i, j, data[j], data_read[j]);
- nerrors++;
- }
- for ( j = 0; j < LOCAL_DATA_SIZE; j++ )
- data[j] *= 10.0;
- }
-
- /*
- * close the data spaces
- */
-
- if(verbose )
- HDfprintf(stdout, "%0d:%s: closing dataspaces.\n", mpi_rank, fcn_name);
-
- for ( i = 0; i < NUM_DATA_SETS; i++ ) {
- err = H5Sclose(disk_space[i]);
- VRFY((err >= 0), "H5Sclose(disk_space[i]) failed.\n");
- err = H5Sclose(mem_space[i]);
- VRFY((err >= 0), "H5Sclose(mem_space[i]) failed.\n");
- }
- steps_done++;
- }
- /* End of Step 1: open the data sets and read data. */
+ if (steps >= 1){
+ /*=====================================================*
+ * Step 1: open the data sets and read data.
+ *=====================================================*/
+
+ if(verbose )
+ HDfprintf(stdout, "%0d:%s: opening the datasets.\n",
+ mpi_rank, fcn_name);
+
+ for ( i = 0; i < NUM_DATA_SETS; i++ ) {
+ dataset[i] = -1;
+ }
+
+ for ( i = 0; i < NUM_DATA_SETS; i++ ) {
+ dataset[i] = H5Dopen2(file_id, dataset_name[i], H5P_DEFAULT);
+ VRFY((dataset[i] >= 0), "H5Dopen(1) failed.\n");
+ disk_space[i] = H5Dget_space(dataset[i]);
+ VRFY((disk_space[i] >= 0), "H5Dget_space failed.\n");
+ }
+
+ /*
+ * setup data transfer property list
+ */
+
+ if(verbose )
+ HDfprintf(stdout, "%0d:%s: Setting up dxpl.\n", mpi_rank, fcn_name);
+
+ dxpl_id = H5Pcreate(H5P_DATASET_XFER);
+ VRFY((dxpl_id != -1), "H5Pcreate(H5P_DATASET_XFER) failed.\n");
+ err = H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE);
+ VRFY((err >= 0),
+ "H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) failed.\n");
+
+ /*
+ * read data from the data sets
+ */
+
+ if(verbose )
+ HDfprintf(stdout, "%0d:%s: Reading datasets.\n", mpi_rank, fcn_name);
+
+ disk_count[0] = (hsize_t)(LOCAL_DATA_SIZE);
+ disk_start[0] = (hsize_t)(LOCAL_DATA_SIZE * mpi_rank);
+
+ mem_size[0] = (hsize_t)(LOCAL_DATA_SIZE);
+
+ mem_count[0] = (hsize_t)(LOCAL_DATA_SIZE);
+ mem_start[0] = (hsize_t)(0);
+
+ /* set up expected data for verification */
+ for ( j = 0; j < LOCAL_DATA_SIZE; j++ ) {
+ data[j] = (double)(mpi_rank + 1);
+ }
+
+ for ( i = 0; i < NUM_DATA_SETS; i++ ) {
+ err = H5Sselect_hyperslab(disk_space[i], H5S_SELECT_SET, disk_start,
+ NULL, disk_count, NULL);
+ VRFY((err >= 0), "H5Sselect_hyperslab(1) failed.\n");
+ mem_space[i] = H5Screate_simple(1, mem_size, NULL);
+ VRFY((mem_space[i] >= 0), "H5Screate_simple(2) failed.\n");
+ err = H5Sselect_hyperslab(mem_space[i], H5S_SELECT_SET,
+ mem_start, NULL, mem_count, NULL);
+ VRFY((err >= 0), "H5Sselect_hyperslab(2) failed.\n");
+ err = H5Dread(dataset[i], H5T_NATIVE_DOUBLE, mem_space[i],
+ disk_space[i], dxpl_id, data_read);
+ VRFY((err >= 0), "H5Dread(1) failed.\n");
+
+ /* compare read data with expected data */
+ for ( j = 0; j < LOCAL_DATA_SIZE; j++ )
+ if (data_read[j] != data[j]){
+ HDfprintf(stdout,
+ "%0d:%s: Reading datasets value failed in "
+ "Dataset %d, at position %d: expect %f, got %f.\n",
+ mpi_rank, fcn_name, i, j, data[j], data_read[j]);
+ nerrors++;
+ }
+ for ( j = 0; j < LOCAL_DATA_SIZE; j++ )
+ data[j] *= 10.0;
+ }
+
+ /*
+ * close the data spaces
+ */
+
+ if(verbose )
+ HDfprintf(stdout, "%0d:%s: closing dataspaces.\n", mpi_rank, fcn_name);
+
+ for ( i = 0; i < NUM_DATA_SETS; i++ ) {
+ err = H5Sclose(disk_space[i]);
+ VRFY((err >= 0), "H5Sclose(disk_space[i]) failed.\n");
+ err = H5Sclose(mem_space[i]);
+ VRFY((err >= 0), "H5Sclose(mem_space[i]) failed.\n");
+ }
+ steps_done++;
+ }
+ /* End of Step 1: open the data sets and read data. */
#endif
#if 1
- /*=====================================================*
- * Step 2: reading attributes from each dataset
- *=====================================================*/
-
- if (steps >= 2){
- if(verbose )
- HDfprintf(stdout, "%0d:%s: reading attributes.\n", mpi_rank, fcn_name);
-
- for ( j = 0; j < LOCAL_DATA_SIZE; j++ ) {
-
- att[j] = (double)(j + 1);
- }
-
- for ( i = 0; i < NUM_DATA_SETS; i++ ) {
- hid_t att_id, att_type;
-
- att_id = H5Aopen(dataset[i], att_name[i], H5P_DEFAULT);
- VRFY((att_id >= 0), "H5Aopen failed.\n");
- att_type = H5Aget_type(att_id);
- VRFY((att_type >= 0), "H5Aget_type failed.\n");
- tri_err = H5Tequal(att_type, H5T_NATIVE_DOUBLE);
- VRFY((tri_err >= 0), "H5Tequal failed.\n");
- if (tri_err==0){
- HDfprintf(stdout,
- "%0d:%s: Mismatched Attribute type of Dataset %d.\n",
- mpi_rank, fcn_name, i);
- nerrors++;
- }else{
- /* should verify attribute size before H5Aread */
- err = H5Aread(att_id, H5T_NATIVE_DOUBLE, att_read);
- VRFY((err >= 0), "H5Aread failed.\n");
- /* compare read attribute data with expected data */
- for ( j = 0; j < LOCAL_DATA_SIZE; j++ )
- if (att_read[j] != att[j]){
- HDfprintf(stdout,
- "%0d:%s: Mismatched attribute data read in Dataset %d, at position %d: expect %f, got %f.\n",
- mpi_rank, fcn_name, i, j, att[j], att_read[j]);
- nerrors++;
- }
- for ( j = 0; j < LOCAL_DATA_SIZE; j++ ) {
-
- att[j] /= 10.0;
- }
- }
- err = H5Aclose(att_id);
- VRFY((err >= 0), "H5Aclose failed.\n");
- }
- steps_done++;
- }
- /* End of Step 2: reading attributes from each dataset */
+ /*=====================================================*
+ * Step 2: reading attributes from each dataset
+ *=====================================================*/
+
+ if (steps >= 2){
+ if(verbose )
+ HDfprintf(stdout, "%0d:%s: reading attributes.\n", mpi_rank, fcn_name);
+
+ for ( j = 0; j < LOCAL_DATA_SIZE; j++ ) {
+ att[j] = (double)(j + 1);
+ }
+
+ for ( i = 0; i < NUM_DATA_SETS; i++ ) {
+ hid_t att_id, att_type;
+
+ att_id = H5Aopen(dataset[i], att_name[i], H5P_DEFAULT);
+ VRFY((att_id >= 0), "H5Aopen failed.\n");
+ att_type = H5Aget_type(att_id);
+ VRFY((att_type >= 0), "H5Aget_type failed.\n");
+ tri_err = H5Tequal(att_type, H5T_NATIVE_DOUBLE);
+ VRFY((tri_err >= 0), "H5Tequal failed.\n");
+ if (tri_err==0){
+ HDfprintf(stdout,
+ "%0d:%s: Mismatched Attribute type of Dataset %d.\n",
+ mpi_rank, fcn_name, i);
+ nerrors++;
+ }
+ else {
+ /* should verify attribute size before H5Aread */
+ err = H5Aread(att_id, H5T_NATIVE_DOUBLE, att_read);
+ VRFY((err >= 0), "H5Aread failed.\n");
+ /* compare read attribute data with expected data */
+ for ( j = 0; j < LOCAL_DATA_SIZE; j++ )
+ if (att_read[j] != att[j]){
+ HDfprintf(stdout,
+ "%0d:%s: Mismatched attribute data read in Dataset %d, at position %d: expect %f, got %f.\n",
+ mpi_rank, fcn_name, i, j, att[j], att_read[j]);
+ nerrors++;
+ }
+ for ( j = 0; j < LOCAL_DATA_SIZE; j++ ) {
+ att[j] /= 10.0;
+ }
+ }
+ err = H5Aclose(att_id);
+ VRFY((err >= 0), "H5Aclose failed.\n");
+ }
+ steps_done++;
+ }
+ /* End of Step 2: reading attributes from each dataset */
#endif
#if 1
- /*=====================================================*
- * Step 3 or 4: read large attributes from each dataset.
- * Step 4 has different attribute value from step 3.
- *=====================================================*/
-
- if (steps >= 3){
- if(verbose )
- HDfprintf(stdout, "%0d:%s: reading large attributes.\n", mpi_rank, fcn_name);
-
- for ( j = 0; j < LARGE_ATTR_SIZE; j++ ) {
-
- lg_att[j] = (steps==3) ? (double)(j + 1) : (double)(j+2);
- }
-
- for ( i = 0; i < NUM_DATA_SETS; i++ ) {
- lg_att_id[i] = H5Aopen(dataset[i], lg_att_name[i], H5P_DEFAULT);
- VRFY((lg_att_id[i] >= 0), "H5Aopen(2) failed.\n");
- lg_att_type[i] = H5Aget_type(lg_att_id[i]);
- VRFY((err >= 0), "H5Aget_type failed.\n");
- tri_err = H5Tequal(lg_att_type[i], H5T_NATIVE_DOUBLE);
- VRFY((tri_err >= 0), "H5Tequal failed.\n");
- if (tri_err==0){
- HDfprintf(stdout,
- "%0d:%s: Mismatched Large attribute type of Dataset %d.\n",
- mpi_rank, fcn_name, i);
- nerrors++;
- }else{
- /* should verify large attribute size before H5Aread */
- err = H5Aread(lg_att_id[i], H5T_NATIVE_DOUBLE, lg_att_read);
- VRFY((err >= 0), "H5Aread failed.\n");
- /* compare read attribute data with expected data */
- for ( j = 0; j < LARGE_ATTR_SIZE; j++ )
- if (lg_att_read[j] != lg_att[j]){
- HDfprintf(stdout,
- "%0d:%s: Mismatched large attribute data read in Dataset %d, at position %d: expect %f, got %f.\n",
- mpi_rank, fcn_name, i, j, lg_att[j], lg_att_read[j]);
- nerrors++;
- }
- for ( j = 0; j < LARGE_ATTR_SIZE; j++ ) {
-
- lg_att[j] /= 10.0;
- }
- }
- err = H5Tclose(lg_att_type[i]);
- VRFY((err >= 0), "H5Tclose failed.\n");
- err = H5Aclose(lg_att_id[i]);
- VRFY((err >= 0), "H5Aclose failed.\n");
- }
- /* Both step 3 and 4 use this same read checking code. */
- steps_done = (steps==3) ? 3 : 4;
- }
-
- /* End of Step 3 or 4: read large attributes from each dataset */
+ /*=====================================================*
+ * Step 3 or 4: read large attributes from each dataset.
+ * Step 4 has different attribute value from step 3.
+ *=====================================================*/
+
+ if (steps >= 3){
+ if(verbose )
+ HDfprintf(stdout, "%0d:%s: reading large attributes.\n", mpi_rank, fcn_name);
+
+ for ( j = 0; j < LARGE_ATTR_SIZE; j++ ) {
+ lg_att[j] = (steps==3) ? (double)(j + 1) : (double)(j+2);
+ }
+
+ for ( i = 0; i < NUM_DATA_SETS; i++ ) {
+ lg_att_id[i] = H5Aopen(dataset[i], lg_att_name[i], H5P_DEFAULT);
+ VRFY((lg_att_id[i] >= 0), "H5Aopen(2) failed.\n");
+ lg_att_type[i] = H5Aget_type(lg_att_id[i]);
+ VRFY((err >= 0), "H5Aget_type failed.\n");
+ tri_err = H5Tequal(lg_att_type[i], H5T_NATIVE_DOUBLE);
+ VRFY((tri_err >= 0), "H5Tequal failed.\n");
+ if (tri_err==0){
+ HDfprintf(stdout,
+ "%0d:%s: Mismatched Large attribute type of Dataset %d.\n",
+ mpi_rank, fcn_name, i);
+ nerrors++;
+ }
+ else{
+ /* should verify large attribute size before H5Aread */
+ err = H5Aread(lg_att_id[i], H5T_NATIVE_DOUBLE, lg_att_read);
+ VRFY((err >= 0), "H5Aread failed.\n");
+ /* compare read attribute data with expected data */
+ for ( j = 0; j < LARGE_ATTR_SIZE; j++ )
+ if (lg_att_read[j] != lg_att[j]){
+ HDfprintf(stdout,
+ "%0d:%s: Mismatched large attribute data read in Dataset %d, at position %d: expect %f, got %f.\n",
+ mpi_rank, fcn_name, i, j, lg_att[j], lg_att_read[j]);
+ nerrors++;
+ }
+ for ( j = 0; j < LARGE_ATTR_SIZE; j++ ) {
+
+ lg_att[j] /= 10.0;
+ }
+ }
+ err = H5Tclose(lg_att_type[i]);
+ VRFY((err >= 0), "H5Tclose failed.\n");
+ err = H5Aclose(lg_att_id[i]);
+ VRFY((err >= 0), "H5Aclose failed.\n");
+ }
+ /* Both step 3 and 4 use this same read checking code. */
+ steps_done = (steps==3) ? 3 : 4;
+ }
+
+ /* End of Step 3 or 4: read large attributes from each dataset */
#endif
- /*=====================================================*
- * Step 5: read all objects from the file
- *=====================================================*/
- if (steps>=5){
- /* nothing extra to verify. The file is closed normally. */
- /* Just increment steps_done */
- steps_done++;
- }
-
- /*
- * Close the data sets
- */
-
- if(verbose )
- HDfprintf(stdout, "%0d:%s: closing datasets again.\n",
- mpi_rank, fcn_name);
-
- for ( i = 0; i < NUM_DATA_SETS; i++ ) {
- if ( dataset[i] >= 0 ) {
- err = H5Dclose(dataset[i]);
- VRFY((err >= 0), "H5Dclose(dataset[i])1 failed.\n");
- }
- }
-
- /*
- * close the data transfer property list.
- */
-
- if(verbose )
- HDfprintf(stdout, "%0d:%s: closing dxpl .\n", mpi_rank, fcn_name);
-
- err = H5Pclose(dxpl_id);
- VRFY((err >= 0), "H5Pclose(dxpl_id) failed.\n");
-
- /*
- * Close the file
- */
- if(verbose)
- HDfprintf(stdout, "%0d:%s: closing file again.\n",
- mpi_rank, fcn_name);
- err = H5Fclose(file_id);
- VRFY((err >= 0 ), "H5Fclose(1) failed");
-
- } /* else if (steps_done==0) */
- Reader_result(mrc, steps_done);
+ /*=====================================================*
+ * Step 5: read all objects from the file
+ *=====================================================*/
+ if (steps>=5){
+ /* nothing extra to verify. The file is closed normally. */
+ /* Just increment steps_done */
+ steps_done++;
+ }
+
+ /*
+ * Close the data sets
+ */
+
+ if(verbose )
+ HDfprintf(stdout, "%0d:%s: closing datasets again.\n",
+ mpi_rank, fcn_name);
+
+ for ( i = 0; i < NUM_DATA_SETS; i++ ) {
+ if ( dataset[i] >= 0 ) {
+ err = H5Dclose(dataset[i]);
+ VRFY((err >= 0), "H5Dclose(dataset[i])1 failed.\n");
+ }
+ }
+
+ /*
+ * close the data transfer property list.
+ */
+
+ if(verbose )
+ HDfprintf(stdout, "%0d:%s: closing dxpl .\n", mpi_rank, fcn_name);
+
+ err = H5Pclose(dxpl_id);
+ VRFY((err >= 0), "H5Pclose(dxpl_id) failed.\n");
+
+ /*
+ * Close the file
+ */
+ if(verbose)
+ HDfprintf(stdout, "%0d:%s: closing file again.\n",
+ mpi_rank, fcn_name);
+ err = H5Fclose(file_id);
+ VRFY((err >= 0 ), "H5Fclose(1) failed");
+
+ } /* else if (steps_done==0) */
+ Reader_result(mrc, steps_done);
} /* end while(1) */
if(verbose )
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index 3d501c9..890a918 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -28,149 +28,143 @@
#include "testpar.h"
/* FILENAME and filenames must have the same number of names */
-const char *FILENAME[2]={
- "MPItest",
- NULL};
-char filenames[2][200];
-int nerrors = 0;
-hid_t fapl; /* file access property list */
+const char *FILENAME[2] = { "MPItest", NULL };
+char filenames[2][200];
+int nerrors = 0;
+hid_t fapl; /* file access property list */
/* protocols */
static int errors_sum(int nerrs);
#define MPIO_TEST_WRITE_SIZE 1024*1024 /* 1 MB */
-static int
-test_mpio_overlap_writes(char *filename)
-{
+static int test_mpio_overlap_writes(char *filename) {
int mpi_size, mpi_rank;
MPI_Comm comm;
MPI_Info info = MPI_INFO_NULL;
int color, mrc;
- MPI_File fh;
+ MPI_File fh;
int i;
int vrfyerrs, nerrs;
- unsigned char buf[4093]; /* use some prime number for size */
+ unsigned char buf[4093]; /* use some prime number for size */
int bufsize = sizeof(buf);
- MPI_Offset stride;
- MPI_Offset mpi_off;
- MPI_Status mpi_stat;
-
+ MPI_Offset stride;
+ MPI_Offset mpi_off;
+ MPI_Status mpi_stat;
if (VERBOSE_MED)
- printf("MPIO independent overlapping writes test on file %s\n",
- filename);
+ HDprintf("MPIO independent overlapping writes test on file %s\n",
+ filename);
nerrs = 0;
/* set up MPI parameters */
- MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
- MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
/* Need at least 2 processes */
if (mpi_size < 2) {
- if (MAINPROCESS)
- printf("Need at least 2 processes to run MPIO test.\n");
- printf(" -SKIP- \n");
- return 0;
+ if (MAINPROCESS)
+ HDprintf("Need at least 2 processes to run MPIO test.\n");
+ HDprintf(" -SKIP- \n");
+ return 0;
}
/* splits processes 0 to n-2 into one comm. and the last one into another */
color = ((mpi_rank < (mpi_size - 1)) ? 0 : 1);
- mrc = MPI_Comm_split (MPI_COMM_WORLD, color, mpi_rank, &comm);
- VRFY((mrc==MPI_SUCCESS), "Comm_split succeeded");
-
- if (color==0){
- /* First n-1 processes (color==0) open a file and write it */
- mrc = MPI_File_open(comm, filename, MPI_MODE_CREATE|MPI_MODE_RDWR,
- info, &fh);
- VRFY((mrc==MPI_SUCCESS), "");
-
- stride = 1;
- mpi_off = mpi_rank*stride;
- while (mpi_off < MPIO_TEST_WRITE_SIZE){
- /* make sure the write does not exceed the TEST_WRITE_SIZE */
- if (mpi_off+stride > MPIO_TEST_WRITE_SIZE)
- stride = MPIO_TEST_WRITE_SIZE - mpi_off;
-
- /* set data to some trivial pattern for easy verification */
- for (i=0; i<stride; i++)
- buf[i] = (unsigned char)(mpi_off+i);
- mrc = MPI_File_write_at(fh, mpi_off, buf, (int)stride, MPI_BYTE,
- &mpi_stat);
- VRFY((mrc==MPI_SUCCESS), "");
-
- /* move the offset pointer to last byte written by all processes */
- mpi_off += (mpi_size - 1 - mpi_rank) * stride;
-
- /* Increase chunk size without exceeding buffer size. */
- /* Then move the starting offset for next write. */
- stride *= 2;
- if (stride > bufsize)
- stride = bufsize;
- mpi_off += mpi_rank*stride;
- }
-
- /* close file and free the communicator */
- mrc = MPI_File_close(&fh);
- VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE");
- mrc = MPI_Comm_free(&comm);
- VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free");
-
- /* sync with the other waiting processes */
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc==MPI_SUCCESS), "Sync after writes");
- }else{
- /* last process waits till writes are done,
- * then opens file to verify data.
- */
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc==MPI_SUCCESS), "Sync after writes");
-
- mrc = MPI_File_open(comm, filename, MPI_MODE_RDONLY,
- info, &fh);
- VRFY((mrc==MPI_SUCCESS), "");
-
- stride = bufsize;
- for (mpi_off=0; mpi_off < MPIO_TEST_WRITE_SIZE; mpi_off += bufsize){
- /* make sure it does not read beyond end of data */
- if (mpi_off+stride > MPIO_TEST_WRITE_SIZE)
- stride = MPIO_TEST_WRITE_SIZE - mpi_off;
- mrc = MPI_File_read_at(fh, mpi_off, buf, (int)stride, MPI_BYTE,
- &mpi_stat);
- VRFY((mrc==MPI_SUCCESS), "");
- vrfyerrs=0;
- for (i=0; i<stride; i++){
- unsigned char expected;
- expected = (unsigned char)(mpi_off+i);
- if ((expected != buf[i]) &&
- (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED)) {
- printf("proc %d: found data error at [%ld], expect %u, got %u\n",
- mpi_rank, (long)(mpi_off+i), expected, buf[i]);
- }
- }
- if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("proc %d: [more errors ...]\n", mpi_rank);
-
- nerrs += vrfyerrs;
- }
-
- /* close file and free the communicator */
- mrc = MPI_File_close(&fh);
- VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE");
- mrc = MPI_Comm_free(&comm);
- VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free");
+ mrc = MPI_Comm_split(MPI_COMM_WORLD, color, mpi_rank, &comm);
+ VRFY((mrc == MPI_SUCCESS), "Comm_split succeeded");
+
+ if (color == 0) {
+ /* First n-1 processes (color==0) open a file and write it */
+ mrc = MPI_File_open(comm, filename, MPI_MODE_CREATE | MPI_MODE_RDWR,
+ info, &fh);
+ VRFY((mrc == MPI_SUCCESS), "");
+
+ stride = 1;
+ mpi_off = mpi_rank * stride;
+ while (mpi_off < MPIO_TEST_WRITE_SIZE) {
+ /* make sure the write does not exceed the TEST_WRITE_SIZE */
+ if (mpi_off + stride > MPIO_TEST_WRITE_SIZE)
+ stride = MPIO_TEST_WRITE_SIZE - mpi_off;
+
+ /* set data to some trivial pattern for easy verification */
+ for (i = 0; i < stride; i++)
+ buf[i] = (unsigned char) (mpi_off + i);
+ mrc = MPI_File_write_at(fh, mpi_off, buf, (int) stride, MPI_BYTE,
+ &mpi_stat);
+ VRFY((mrc == MPI_SUCCESS), "");
+
+ /* move the offset pointer to last byte written by all processes */
+ mpi_off += (mpi_size - 1 - mpi_rank) * stride;
+
+ /* Increase chunk size without exceeding buffer size. */
+ /* Then move the starting offset for next write. */
+ stride *= 2;
+ if (stride > bufsize)
+ stride = bufsize;
+ mpi_off += mpi_rank * stride;
+ }
+
+ /* close file and free the communicator */
+ mrc = MPI_File_close(&fh);
+ VRFY((mrc == MPI_SUCCESS), "MPI_FILE_CLOSE");
+ mrc = MPI_Comm_free(&comm);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free");
+
+ /* sync with the other waiting processes */
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync after writes");
+ } else {
+ /* last process waits till writes are done,
+ * then opens file to verify data.
+ */
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync after writes");
+
+ mrc = MPI_File_open(comm, filename, MPI_MODE_RDONLY, info, &fh);
+ VRFY((mrc == MPI_SUCCESS), "");
+
+ stride = bufsize;
+ for (mpi_off = 0; mpi_off < MPIO_TEST_WRITE_SIZE; mpi_off += bufsize) {
+ /* make sure it does not read beyond end of data */
+ if (mpi_off + stride > MPIO_TEST_WRITE_SIZE)
+ stride = MPIO_TEST_WRITE_SIZE - mpi_off;
+ mrc = MPI_File_read_at(fh, mpi_off, buf, (int) stride, MPI_BYTE,
+ &mpi_stat);
+ VRFY((mrc == MPI_SUCCESS), "");
+ vrfyerrs = 0;
+ for (i = 0; i < stride; i++) {
+ unsigned char expected;
+ expected = (unsigned char) (mpi_off + i);
+ if ((expected != buf[i])
+ && (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED)) {
+ HDprintf(
+ "proc %d: found data error at [%ld], expect %u, got %u\n",
+ mpi_rank, (long) (mpi_off + i), expected, buf[i]);
+ }
+ }
+ if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
+ HDprintf("proc %d: [more errors ...]\n", mpi_rank);
+
+ nerrs += vrfyerrs;
+ }
+
+ /* close file and free the communicator */
+ mrc = MPI_File_close(&fh);
+ VRFY((mrc == MPI_SUCCESS), "MPI_FILE_CLOSE");
+ mrc = MPI_Comm_free(&comm);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free");
}
/*
- * one more sync to ensure all processes have done reading
- * before ending this test.
- */
+ * one more sync to ensure all processes have done reading
+ * before ending this test.
+ */
mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc==MPI_SUCCESS), "Sync before leaving test");
+ VRFY((mrc == MPI_SUCCESS), "Sync before leaving test");
return (nerrs);
}
-
#define MB 1048576 /* 1024*1024 == 2**20 */
#define GB 1073741824 /* 1024**3 == 2**30 */
#define TWO_GB_LESS1 2147483647 /* 2**31 - 1 */
@@ -186,227 +180,236 @@ test_mpio_overlap_writes(char *filename)
* Then reads the file back in by reverse order, that is process 0
* reads the data of process n-1 and vice versa.
*/
-static int
-test_mpio_gb_file(char *filename)
-{
+static int test_mpio_gb_file(char *filename) {
int mpi_size, mpi_rank;
MPI_Info info = MPI_INFO_NULL;
int mrc;
- MPI_File fh;
+ MPI_File fh;
int i, j, n;
int vrfyerrs;
- int writerrs; /* write errors */
+ int writerrs; /* write errors */
int nerrs;
- int ntimes; /* how many times */
- char *buf = NULL;
- char expected;
- MPI_Offset size;
- MPI_Offset mpi_off;
- MPI_Offset mpi_off_old;
- MPI_Status mpi_stat;
+ int ntimes; /* how many times */
+ char *buf = NULL;
+ char expected;
+ MPI_Offset size;
+ MPI_Offset mpi_off;
+ MPI_Offset mpi_off_old;
+ MPI_Status mpi_stat;
int is_signed, sizeof_mpi_offset;
nerrs = 0;
/* set up MPI parameters */
- MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
- MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
if (VERBOSE_MED)
- printf("MPI_Offset range test\n");
+ HDprintf("MPI_Offset range test\n");
/* figure out the signness and sizeof MPI_Offset */
mpi_off = 0;
is_signed = ((MPI_Offset)(mpi_off - 1)) < 0;
- sizeof_mpi_offset = (int)(sizeof(MPI_Offset));
+ sizeof_mpi_offset = (int) (sizeof(MPI_Offset));
/*
- * Verify the sizeof MPI_Offset and correctness of handling multiple GB
- * sizes.
- */
- if (MAINPROCESS){ /* only process 0 needs to check it*/
- printf("MPI_Offset is %s %d bytes integeral type\n",
- is_signed ? "signed" : "unsigned", (int)sizeof(MPI_Offset));
- if (sizeof_mpi_offset <= 4 && is_signed){
- printf("Skipped 2GB range test "
- "because MPI_Offset cannot support it\n");
- }else {
- /* verify correctness of assigning 2GB sizes */
- mpi_off = 2 * 1024 * (MPI_Offset)MB;
- INFO((mpi_off>0), "2GB OFFSET assignment no overflow");
- INFO((mpi_off-1)==TWO_GB_LESS1, "2GB OFFSET assignment succeed");
-
- /* verify correctness of increasing from below 2 GB to above 2GB */
- mpi_off = TWO_GB_LESS1;
- for (i=0; i < 3; i++){
- mpi_off_old = mpi_off;
- mpi_off = mpi_off + 1;
- /* no overflow */
- INFO((mpi_off>0), "2GB OFFSET increment no overflow");
- /* correct inc. */
- INFO((mpi_off-1)==mpi_off_old, "2GB OFFSET increment succeed");
- }
- }
-
- if (sizeof_mpi_offset <= 4){
- printf("Skipped 4GB range test "
- "because MPI_Offset cannot support it\n");
- }else {
- /* verify correctness of assigning 4GB sizes */
- mpi_off = 4 * 1024 * (MPI_Offset)MB;
- INFO((mpi_off>0), "4GB OFFSET assignment no overflow");
- INFO((mpi_off-1)==FOUR_GB_LESS1, "4GB OFFSET assignment succeed");
-
- /* verify correctness of increasing from below 4 GB to above 4 GB */
- mpi_off = FOUR_GB_LESS1;
- for (i=0; i < 3; i++){
- mpi_off_old = mpi_off;
- mpi_off = mpi_off + 1;
- /* no overflow */
- INFO((mpi_off>0), "4GB OFFSET increment no overflow");
- /* correct inc. */
- INFO((mpi_off-1)==mpi_off_old, "4GB OFFSET increment succeed");
- }
- }
+ * Verify the sizeof MPI_Offset and correctness of handling multiple GB
+ * sizes.
+ */
+ if (MAINPROCESS) { /* only process 0 needs to check it*/
+ HDprintf("MPI_Offset is %s %d bytes integeral type\n",
+ is_signed ? "signed" : "unsigned", (int) sizeof(MPI_Offset));
+ if (sizeof_mpi_offset <= 4 && is_signed) {
+ HDprintf("Skipped 2GB range test "
+ "because MPI_Offset cannot support it\n");
+ } else {
+ /* verify correctness of assigning 2GB sizes */
+ mpi_off = 2 * 1024 * (MPI_Offset) MB;
+ INFO((mpi_off > 0), "2GB OFFSET assignment no overflow");
+ INFO((mpi_off-1)==TWO_GB_LESS1, "2GB OFFSET assignment succeed");
+
+ /* verify correctness of increasing from below 2 GB to above 2GB */
+ mpi_off = TWO_GB_LESS1;
+ for (i = 0; i < 3; i++) {
+ mpi_off_old = mpi_off;
+ mpi_off = mpi_off + 1;
+ /* no overflow */
+ INFO((mpi_off > 0), "2GB OFFSET increment no overflow");
+ /* correct inc. */
+ INFO((mpi_off - 1) == mpi_off_old,
+ "2GB OFFSET increment succeed");
+ }
+ }
+
+ if (sizeof_mpi_offset <= 4) {
+ HDprintf("Skipped 4GB range test "
+ "because MPI_Offset cannot support it\n");
+ } else {
+ /* verify correctness of assigning 4GB sizes */
+ mpi_off = 4 * 1024 * (MPI_Offset) MB;
+ INFO((mpi_off > 0), "4GB OFFSET assignment no overflow");
+ INFO((mpi_off-1)==FOUR_GB_LESS1, "4GB OFFSET assignment succeed");
+
+ /* verify correctness of increasing from below 4 GB to above 4 GB */
+ mpi_off = FOUR_GB_LESS1;
+ for (i = 0; i < 3; i++) {
+ mpi_off_old = mpi_off;
+ mpi_off = mpi_off + 1;
+ /* no overflow */
+ INFO((mpi_off > 0), "4GB OFFSET increment no overflow");
+ /* correct inc. */
+ INFO((mpi_off - 1) == mpi_off_old,
+ "4GB OFFSET increment succeed");
+ }
+ }
}
/*
- * Verify if we can write to a file of multiple GB sizes.
- */
+ * Verify if we can write to a file of multiple GB sizes.
+ */
if (VERBOSE_MED)
- printf("MPIO GB file test %s\n", filename);
-
- if (sizeof_mpi_offset <= 4){
- printf("Skipped GB file range test "
- "because MPI_Offset cannot support it\n");
- }else{
- buf = (char *)HDmalloc(MB);
- VRFY((buf!=NULL), "malloc succeed");
-
- /* open a new file. Remove it first in case it exists. */
- /* Must delete because MPI_File_open does not have a Truncate mode. */
- /* Don't care if it has error. */
- MPI_File_delete(filename, MPI_INFO_NULL);
- MPI_Barrier(MPI_COMM_WORLD); /* prevent racing condition */
-
- mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE|MPI_MODE_RDWR,
- info, &fh);
- VRFY((mrc==MPI_SUCCESS), "MPI_FILE_OPEN");
-
- printf("MPIO GB file write test %s\n", filename);
-
- /* instead of writing every bytes of the file, we will just write
- * some data around the 2 and 4 GB boundaries. That should cover
- * potential integer overflow and filesystem size limits.
- */
- writerrs = 0;
- for (n=2; n <= 4; n+=2){
- ntimes = GB/MB*n/mpi_size + 1;
- for (i=ntimes-2; i <= ntimes; i++){
- mpi_off = (i*mpi_size + mpi_rank)*(MPI_Offset)MB;
- if (VERBOSE_MED)
- HDfprintf(stdout,"proc %d: write to mpi_off=%016llx, %lld\n",
- mpi_rank, mpi_off, mpi_off);
- /* set data to some trivial pattern for easy verification */
- for (j=0; j<MB; j++)
- *(buf+j) = i*mpi_size + mpi_rank;
- if (VERBOSE_MED)
- HDfprintf(stdout,"proc %d: writing %d bytes at offset %lld\n",
- mpi_rank, MB, mpi_off);
- mrc = MPI_File_write_at(fh, mpi_off, buf, MB, MPI_BYTE, &mpi_stat);
- INFO((mrc==MPI_SUCCESS), "GB size file write");
- if (mrc!=MPI_SUCCESS)
- writerrs++;
- }
- }
-
- /* close file and free the communicator */
- mrc = MPI_File_close(&fh);
- VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE");
-
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc==MPI_SUCCESS), "Sync after writes");
-
- /*
- * Verify if we can read the multiple GB file just created.
- */
- /* open it again to verify the data written */
- /* but only if there was no write errors */
- printf("MPIO GB file read test %s\n", filename);
- if (errors_sum(writerrs)>0){
- printf("proc %d: Skip read test due to previous write errors\n",
- mpi_rank);
- goto finish;
- }
- mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_RDONLY, info, &fh);
- VRFY((mrc==MPI_SUCCESS), "");
-
- /* Only read back parts of the file that have been written. */
- for (n=2; n <= 4; n+=2){
- ntimes = GB/MB*n/mpi_size + 1;
- for (i=ntimes-2; i <= ntimes; i++){
- mpi_off = (i*mpi_size + (mpi_size - mpi_rank - 1))*(MPI_Offset)MB;
- if (VERBOSE_MED)
- HDfprintf(stdout,"proc %d: read from mpi_off=%016llx, %lld\n",
- mpi_rank, mpi_off, mpi_off);
- mrc = MPI_File_read_at(fh, mpi_off, buf, MB, MPI_BYTE, &mpi_stat);
- INFO((mrc==MPI_SUCCESS), "GB size file read");
- expected = i*mpi_size + (mpi_size - mpi_rank - 1);
- vrfyerrs=0;
- for (j=0; j<MB; j++){
- if ((*(buf+j) != expected) &&
- (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED)){
- printf("proc %d: found data error at [%ld+%d], expect %d, got %d\n",
- mpi_rank, (long)mpi_off, j, expected, *(buf+j));
- }
- }
- if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("proc %d: [more errors ...]\n", mpi_rank);
-
- nerrs += vrfyerrs;
- }
- }
-
- /* close file and free the communicator */
- mrc = MPI_File_close(&fh);
- VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE");
-
- /*
- * one more sync to ensure all processes have done reading
- * before ending this test.
- */
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc==MPI_SUCCESS), "Sync before leaving test");
-
- printf("Test if MPI_File_get_size works correctly with %s\n", filename);
-
- mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_RDONLY, info, &fh);
- VRFY((mrc==MPI_SUCCESS), "");
-
- if (MAINPROCESS){ /* only process 0 needs to check it*/
+ HDprintf("MPIO GB file test %s\n", filename);
+
+ if (sizeof_mpi_offset <= 4) {
+ HDprintf("Skipped GB file range test "
+ "because MPI_Offset cannot support it\n");
+ } else {
+ buf = (char *) HDmalloc(MB);
+ VRFY((buf != NULL), "malloc succeed");
+
+ /* open a new file. Remove it first in case it exists. */
+ /* Must delete because MPI_File_open does not have a Truncate mode. */
+ /* Don't care if it has error. */
+ MPI_File_delete(filename, MPI_INFO_NULL);
+ MPI_Barrier(MPI_COMM_WORLD); /* prevent racing condition */
+
+ mrc = MPI_File_open(MPI_COMM_WORLD, filename,
+ MPI_MODE_CREATE | MPI_MODE_RDWR, info, &fh);
+ VRFY((mrc == MPI_SUCCESS), "MPI_FILE_OPEN");
+
+ HDprintf("MPIO GB file write test %s\n", filename);
+
+ /* instead of writing every bytes of the file, we will just write
+ * some data around the 2 and 4 GB boundaries. That should cover
+ * potential integer overflow and filesystem size limits.
+ */
+ writerrs = 0;
+ for (n = 2; n <= 4; n += 2) {
+ ntimes = GB / MB * n / mpi_size + 1;
+ for (i = ntimes - 2; i <= ntimes; i++) {
+ mpi_off = (i * mpi_size + mpi_rank) * (MPI_Offset) MB;
+ if (VERBOSE_MED)
+ HDfprintf(stdout,
+ "proc %d: write to mpi_off=%016llx, %lld\n",
+ mpi_rank, mpi_off, mpi_off);
+ /* set data to some trivial pattern for easy verification */
+ for (j = 0; j < MB; j++)
+ *(buf + j) = i * mpi_size + mpi_rank;
+ if (VERBOSE_MED)
+ HDfprintf(stdout,
+ "proc %d: writing %d bytes at offset %lld\n",
+ mpi_rank, MB, mpi_off);
+ mrc = MPI_File_write_at(fh, mpi_off, buf, MB, MPI_BYTE,
+ &mpi_stat);
+ INFO((mrc == MPI_SUCCESS), "GB size file write");
+ if (mrc != MPI_SUCCESS)
+ writerrs++;
+ }
+ }
+
+ /* close file and free the communicator */
+ mrc = MPI_File_close(&fh);
+ VRFY((mrc == MPI_SUCCESS), "MPI_FILE_CLOSE");
+
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync after writes");
+
+ /*
+ * Verify if we can read the multiple GB file just created.
+ */
+ /* open it again to verify the data written */
+ /* but only if there was no write errors */
+ HDprintf("MPIO GB file read test %s\n", filename);
+ if (errors_sum(writerrs) > 0) {
+ HDprintf("proc %d: Skip read test due to previous write errors\n",
+ mpi_rank);
+ goto finish;
+ }
+ mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_RDONLY, info,
+ &fh);
+ VRFY((mrc == MPI_SUCCESS), "");
+
+ /* Only read back parts of the file that have been written. */
+ for (n = 2; n <= 4; n += 2) {
+ ntimes = GB / MB * n / mpi_size + 1;
+ for (i = ntimes - 2; i <= ntimes; i++) {
+ mpi_off = (i * mpi_size + (mpi_size - mpi_rank - 1))
+ * (MPI_Offset) MB;
+ if (VERBOSE_MED)
+ HDfprintf(stdout,
+ "proc %d: read from mpi_off=%016llx, %lld\n",
+ mpi_rank, mpi_off, mpi_off);
+ mrc = MPI_File_read_at(fh, mpi_off, buf, MB, MPI_BYTE,
+ &mpi_stat);
+ INFO((mrc == MPI_SUCCESS), "GB size file read");
+ expected = i * mpi_size + (mpi_size - mpi_rank - 1);
+ vrfyerrs = 0;
+ for (j = 0; j < MB; j++) {
+ if ((*(buf + j) != expected)
+ && (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED)) {
+ HDprintf(
+ "proc %d: found data error at [%ld+%d], expect %d, got %d\n",
+ mpi_rank, (long) mpi_off, j, expected,
+ *(buf + j));
+ }
+ }
+ if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
+ HDprintf("proc %d: [more errors ...]\n", mpi_rank);
+
+ nerrs += vrfyerrs;
+ }
+ }
+
+ /* close file and free the communicator */
+ mrc = MPI_File_close(&fh);
+ VRFY((mrc == MPI_SUCCESS), "MPI_FILE_CLOSE");
+
+ /*
+ * one more sync to ensure all processes have done reading
+ * before ending this test.
+ */
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync before leaving test");
+
+ HDprintf("Test if MPI_File_get_size works correctly with %s\n", filename);
+
+ mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_RDONLY, info,
+ &fh);
+ VRFY((mrc == MPI_SUCCESS), "");
+
+ if (MAINPROCESS) { /* only process 0 needs to check it*/
mrc = MPI_File_get_size(fh, &size);
- VRFY((mrc==MPI_SUCCESS), "");
- VRFY((size == mpi_off+MB), "MPI_File_get_size doesn't return correct file size.");
+ VRFY((mrc == MPI_SUCCESS), "");
+ VRFY((size == mpi_off+MB),
+ "MPI_File_get_size doesn't return correct file size.");
}
- /* close file and free the communicator */
- mrc = MPI_File_close(&fh);
- VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE");
+ /* close file and free the communicator */
+ mrc = MPI_File_close(&fh);
+ VRFY((mrc == MPI_SUCCESS), "MPI_FILE_CLOSE");
- /*
- * one more sync to ensure all processes have done reading
- * before ending this test.
- */
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc==MPI_SUCCESS), "Sync before leaving test");
+ /*
+ * one more sync to ensure all processes have done reading
+ * before ending this test.
+ */
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync before leaving test");
}
-finish:
- if (buf)
- HDfree(buf);
+ finish: if (buf)
+ HDfree(buf);
return (nerrs);
}
-
/*
* MPI-IO Test: One writes, Many reads.
* Verify if only one process writes some data and then all other
@@ -424,191 +427,190 @@ finish:
* Each process writes something, then reads all data back.
*/
-#define DIMSIZE 32 /* Dimension size. */
-#define PRINTID printf("Proc %d: ", mpi_rank)
+#define DIMSIZE 32 /* Dimension size. */
+#define PRINTID HDprintf("Proc %d: ", mpi_rank)
#define USENONE 0
-#define USEATOM 1 /* request atomic I/O */
-#define USEFSYNC 2 /* request file_sync */
-
+#define USEATOM 1 /* request atomic I/O */
+#define USEFSYNC 2 /* request file_sync */
-static int
-test_mpio_1wMr(char *filename, int special_request)
-{
+static int test_mpio_1wMr(char *filename, int special_request) {
char hostname[128];
- int mpi_size, mpi_rank;
+ int mpi_size, mpi_rank;
MPI_File fh;
char mpi_err_str[MPI_MAX_ERROR_STRING];
- int mpi_err_strlen;
- int mpi_err;
+ int mpi_err_strlen;
+ int mpi_err;
unsigned char writedata[DIMSIZE], readdata[DIMSIZE];
unsigned char expect_val;
- int i, irank;
- int nerrs = 0; /* number of errors */
- int atomicity;
- MPI_Offset mpi_off;
- MPI_Status mpi_stat;
+ int i, irank;
+ int nerrs = 0; /* number of errors */
+ int atomicity;
+ MPI_Offset mpi_off;
+ MPI_Status mpi_stat;
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
- if (MAINPROCESS && VERBOSE_MED){
- printf("Testing one process writes, all processes read.\n");
- printf("Using %d processes accessing file %s\n", mpi_size, filename);
- printf(" (Filename can be specified via program argument)\n");
+ if (MAINPROCESS && VERBOSE_MED) {
+ HDprintf("Testing one process writes, all processes read.\n");
+ HDprintf("Using %d processes accessing file %s\n", mpi_size, filename);
+ HDprintf(" (Filename can be specified via program argument)\n");
}
/* show the hostname so that we can tell where the processes are running */
- if (VERBOSE_DEF){
- if (gethostname(hostname, 128) < 0){
- PRINTID;
- printf("gethostname failed\n");
- return 1;
- }
- PRINTID;
- printf("hostname=%s\n", hostname);
+ if (VERBOSE_DEF) {
+#ifdef H5_HAVE_GETHOSTNAME
+ if(HDgethostname(hostname, sizeof(hostname)) < 0) {
+ HDprintf("gethostname failed\n");
+ hostname[0] = '\0';
+ }
+#else
+ HDprintf("gethostname unavailable\n");
+ hostname[0] = '\0';
+#endif
+ PRINTID;
+ HDprintf("hostname=%s\n", hostname);
}
/* Delete any old file in order to start anew. */
/* Must delete because MPI_File_open does not have a Truncate mode. */
/* Don't care if it has error. */
MPI_File_delete(filename, MPI_INFO_NULL);
- MPI_Barrier(MPI_COMM_WORLD); /* prevent racing condition */
+ MPI_Barrier(MPI_COMM_WORLD); /* prevent racing condition */
if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename,
- MPI_MODE_RDWR | MPI_MODE_CREATE ,
- MPI_INFO_NULL, &fh))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_open failed (%s)\n", mpi_err_str);
- return 1;
+ MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fh))
+ != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ HDprintf("MPI_File_open failed (%s)\n", mpi_err_str);
+ return 1;
}
-if (special_request & USEATOM){
- /* ==================================================
- * Set atomcity to true (1). A POSIX compliant filesystem
- * should not need this.
- * ==================================================*/
- if ((mpi_err = MPI_File_get_atomicity(fh, &atomicity)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_get_atomicity failed (%s)\n", mpi_err_str);
- }
- if (VERBOSE_HI)
- printf("Initial atomicity = %d\n", atomicity);
- if ((mpi_err = MPI_File_set_atomicity(fh, 1)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_set_atomicity failed (%s)\n", mpi_err_str);
- }
- if ((mpi_err = MPI_File_get_atomicity(fh, &atomicity)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_get_atomicity failed (%s)\n", mpi_err_str);
+ if (special_request & USEATOM) {
+ /* ==================================================
+ * Set atomcity to true (1). A POSIX compliant filesystem
+ * should not need this.
+ * ==================================================*/
+ if ((mpi_err = MPI_File_get_atomicity(fh, &atomicity)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ HDprintf("MPI_File_get_atomicity failed (%s)\n", mpi_err_str);
+ }
+ if (VERBOSE_HI)
+ HDprintf("Initial atomicity = %d\n", atomicity);
+ if ((mpi_err = MPI_File_set_atomicity(fh, 1)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ HDprintf("MPI_File_set_atomicity failed (%s)\n", mpi_err_str);
+ }
+ if ((mpi_err = MPI_File_get_atomicity(fh, &atomicity)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ HDprintf("MPI_File_get_atomicity failed (%s)\n", mpi_err_str);
+ }
+ if (VERBOSE_HI)
+ HDprintf("After set_atomicity atomicity = %d\n", atomicity);
}
- if (VERBOSE_HI)
- printf("After set_atomicity atomicity = %d\n", atomicity);
-}
/* This barrier is not necessary but do it anyway. */
MPI_Barrier(MPI_COMM_WORLD);
- if (VERBOSE_HI){
- PRINTID;
- printf("between MPI_Barrier and MPI_File_write_at\n");
+ if (VERBOSE_HI) {
+ PRINTID;
+ HDprintf("between MPI_Barrier and MPI_File_write_at\n");
}
/* ==================================================
- * Each process calculates what to write but
- * only process irank(0) writes.
- * ==================================================*/
- irank=0;
- for (i=0; i < DIMSIZE; i++)
- writedata[i] = irank*DIMSIZE + i;
- mpi_off = irank*DIMSIZE;
+ * Each process calculates what to write but
+ * only process irank(0) writes.
+ * ==================================================*/
+ irank = 0;
+ for (i = 0; i < DIMSIZE; i++)
+ writedata[i] = irank * DIMSIZE + i;
+ mpi_off = irank * DIMSIZE;
/* Only one process writes */
- if (mpi_rank==irank){
- if (VERBOSE_HI){
- PRINTID; printf("wrote %d bytes at %ld\n", DIMSIZE, (long)mpi_off);
- }
- if ((mpi_err = MPI_File_write_at(fh, mpi_off, writedata, DIMSIZE,
- MPI_BYTE, &mpi_stat))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
- (long) mpi_off, DIMSIZE, mpi_err_str);
- return 1;
- };
+ if (mpi_rank == irank) {
+ if (VERBOSE_HI) {
+ PRINTID;
+ HDprintf("wrote %d bytes at %ld\n", DIMSIZE, (long) mpi_off);
+ }
+ if ((mpi_err = MPI_File_write_at(fh, mpi_off, writedata, DIMSIZE,
+ MPI_BYTE, &mpi_stat)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ HDprintf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
+ (long) mpi_off, DIMSIZE, mpi_err_str);
+ return 1;
+ };
};
/* Bcast the return code and */
/* make sure all writing are done before reading. */
MPI_Bcast(&mpi_err, 1, MPI_INT, irank, MPI_COMM_WORLD);
- if (VERBOSE_HI){
- PRINTID;
- printf("MPI_Bcast: mpi_err = %d\n", mpi_err);
+ if (VERBOSE_HI) {
+ PRINTID;
+ HDprintf("MPI_Bcast: mpi_err = %d\n", mpi_err);
}
-if (special_request & USEFSYNC){
- /* ==================================================
- * Do a file sync. A POSIX compliant filesystem
- * should not need this.
- * ==================================================*/
- if (VERBOSE_HI)
- printf("Apply MPI_File_sync\n");
- /* call file_sync to force the write out */
- if ((mpi_err = MPI_File_sync(fh)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_sync failed (%s)\n", mpi_err_str);
- }
- MPI_Barrier(MPI_COMM_WORLD);
- /* call file_sync to force the write out */
- if ((mpi_err = MPI_File_sync(fh)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_sync failed (%s)\n", mpi_err_str);
+ if (special_request & USEFSYNC) {
+ /* ==================================================
+ * Do a file sync. A POSIX compliant filesystem
+ * should not need this.
+ * ==================================================*/
+ if (VERBOSE_HI)
+ HDprintf("Apply MPI_File_sync\n");
+ /* call file_sync to force the write out */
+ if ((mpi_err = MPI_File_sync(fh)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ HDprintf("MPI_File_sync failed (%s)\n", mpi_err_str);
+ }
+ MPI_Barrier(MPI_COMM_WORLD);
+ /* call file_sync to force the write out */
+ if ((mpi_err = MPI_File_sync(fh)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ HDprintf("MPI_File_sync failed (%s)\n", mpi_err_str);
+ }
}
-}
/* This barrier is not necessary because the Bcase or File_sync above */
/* should take care of it. Do it anyway. */
MPI_Barrier(MPI_COMM_WORLD);
- if (VERBOSE_HI){
- PRINTID;
- printf("after MPI_Barrier\n");
+ if (VERBOSE_HI) {
+ PRINTID;
+ HDprintf("after MPI_Barrier\n");
}
/* ==================================================
- * Each process reads what process 0 wrote and verify.
- * ==================================================*/
- irank=0;
- mpi_off = irank*DIMSIZE;
+ * Each process reads what process 0 wrote and verify.
+ * ==================================================*/
+ irank = 0;
+ mpi_off = irank * DIMSIZE;
if ((mpi_err = MPI_File_read_at(fh, mpi_off, readdata, DIMSIZE, MPI_BYTE,
- &mpi_stat))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_read_at offset(%ld), bytes (%d), failed (%s)\n",
- (long) mpi_off, DIMSIZE, mpi_err_str);
- return 1;
+ &mpi_stat)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ HDprintf("MPI_File_read_at offset(%ld), bytes (%d), failed (%s)\n",
+ (long) mpi_off, DIMSIZE, mpi_err_str);
+ return 1;
};
- for (i=0; i < DIMSIZE; i++){
- expect_val = irank*DIMSIZE + i;
- if (readdata[i] != expect_val){
- PRINTID;
- printf("read data[%d:%d] got %02x, expect %02x\n", irank, i,
- readdata[i], expect_val);
- nerrs++;
- }
+ for (i = 0; i < DIMSIZE; i++) {
+ expect_val = irank * DIMSIZE + i;
+ if (readdata[i] != expect_val) {
+ PRINTID;
+ HDprintf("read data[%d:%d] got %02x, expect %02x\n", irank, i,
+ readdata[i], expect_val);
+ nerrs++;
+ }
}
MPI_File_close(&fh);
- if (VERBOSE_HI){
- PRINTID;
- printf("%d data errors detected\n", nerrs);
+ if (VERBOSE_HI) {
+ PRINTID;
+ HDprintf("%d data errors detected\n", nerrs);
}
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
@@ -617,272 +619,268 @@ if (special_request & USEFSYNC){
/*
-Function: test_mpio_derived_dtype
-
-Test Whether the Displacement of MPI derived datatype
-(+ File_set_view + MPI_write)works or not on this MPI-IO package
-and this platform.
-
-1. Details for the test:
-1) Create two derived datatypes with MPI_Type_create_hindexed:
- datatype1:
- count = 1, blocklens = 1, offsets = 0,
- base type = MPI_BYTE(essentially a char)
- datatype2:
- count = 1, blocklens = 1, offsets = 1(byte),
- base type = MPI_BYTE
-
-2) Using these two derived datatypes,
- Build another derived datatype with MPI_Type_create_struct:
- advtype: derived from datatype1 and datatype2
- advtype:
- count = 2, blocklens[0] = 1, blocklens[1]=1,
- offsets[0] = 0, offsets[1] = 1(byte),
- bas_type[0]=datatype1,
- bas_type[1] = datatype2;
-
-3) Setting MPI file view with advtype
-4) Writing 2 bytes 1 to 2 using MPI_File_write to a file
-5) File content:
-Suppose the fill value of the file is 0(most machines indeed do so)
-and Fill value is embraced with "() in the following output:
-Expected output should be:
-1,0,2
-
-
-
-However, at some platforms, for example, IBM AIX(at March 23rd, 2005):
-the following values were obtained:
-1,2,0
-
-The problem is that the displacement of the second derived datatype(datatype2) which formed the final derived datatype(advtype)
+ Function: test_mpio_derived_dtype
+
+ Test Whether the Displacement of MPI derived datatype
+ (+ File_set_view + MPI_write)works or not on this MPI-IO package
+ and this platform.
+
+ 1. Details for the test:
+ 1) Create two derived datatypes with MPI_Type_create_hindexed:
+ datatype1:
+ count = 1, blocklens = 1, offsets = 0,
+ base type = MPI_BYTE(essentially a char)
+ datatype2:
+ count = 1, blocklens = 1, offsets = 1(byte),
+ base type = MPI_BYTE
+
+ 2) Using these two derived datatypes,
+ Build another derived datatype with MPI_Type_create_struct:
+ advtype: derived from datatype1 and datatype2
+ advtype:
+ count = 2, blocklens[0] = 1, blocklens[1]=1,
+ offsets[0] = 0, offsets[1] = 1(byte),
+ bas_type[0]=datatype1,
+ bas_type[1] = datatype2;
+
+ 3) Setting MPI file view with advtype
+ 4) Writing 2 bytes 1 to 2 using MPI_File_write to a file
+ 5) File content:
+ Suppose the fill value of the file is 0(most machines indeed do so)
+ and Fill value is embraced with "() in the following output:
+ Expected output should be:
+ 1,0,2
+
+
+
+ However, at some platforms, for example, IBM AIX(at March 23rd, 2005):
+ the following values were obtained:
+ 1,2,0
+
+ The problem is that the displacement of the second derived datatype(datatype2) which formed the final derived datatype(advtype)
has been put after the basic datatype(MPI_BYTE) of datatype2. This is a bug.
-2. This test will verify whether the complicated derived datatype is working on
-the current platform.
+ 2. This test will verify whether the complicated derived datatype is working on
+ the current platform.
-If this bug has been fixed in the previous not-working package, this test will issue a printf message to tell the developer to change
-the configuration specific file of HDF5 so that we can change our configurationsetting to support collective IO for irregular selections.
+ If this bug has been fixed in the previous not-working package, this test will issue a HDprintf message to tell the developer to change
+ the configuration specific file of HDF5 so that we can change our configurationsetting to support collective IO for irregular selections.
-If it turns out that the previous working MPI-IO package no longer works, this test will also issue a message to inform the corresponding failure so that
-we can turn off collective IO support for irregular selections.
-*/
+ If it turns out that the previous working MPI-IO package no longer works, this test will also issue a message to inform the corresponding failure so that
+ we can turn off collective IO support for irregular selections.
+ */
static int test_mpio_derived_dtype(char *filename) {
MPI_File fh;
char mpi_err_str[MPI_MAX_ERROR_STRING];
- int mpi_err_strlen;
- int mpi_err;
- int i;
- MPI_Datatype etype,filetype;
- MPI_Datatype adv_filetype,bas_filetype[2];
- MPI_Datatype filetypenew;
- MPI_Offset disp;
- MPI_Status Status;
- MPI_Aint adv_disp[2];
- MPI_Aint offsets[1];
- int blocklens[1],adv_blocklens[2];
- int count,outcount;
- int retcode;
-
- int mpi_rank,mpi_size;
-
- char buf[3],outbuf[3] = {0};
+ int mpi_err_strlen;
+ int mpi_err;
+ int i;
+ MPI_Datatype etype, filetype;
+ MPI_Datatype adv_filetype, bas_filetype[2];
+ MPI_Datatype filetypenew;
+ MPI_Offset disp;
+ MPI_Status Status;
+ MPI_Aint adv_disp[2];
+ MPI_Aint offsets[1];
+ int blocklens[1], adv_blocklens[2];
+ int count, outcount;
+ int retcode;
+
+ int mpi_rank, mpi_size;
+
+ char buf[3], outbuf[3] = { 0 };
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
retcode = 0;
- for(i=0;i<3;i++)
- buf[i] = i+1;
-
+ for (i = 0; i < 3; i++)
+ buf[i] = i + 1;
if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename,
- MPI_MODE_RDWR | MPI_MODE_CREATE,
- MPI_INFO_NULL, &fh))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_open failed (%s)\n", mpi_err_str);
- return 1;
+ MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fh))
+ != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ HDprintf("MPI_File_open failed (%s)\n", mpi_err_str);
+ return 1;
}
- disp = 0;
+ disp = 0;
etype = MPI_BYTE;
count = 1;
blocklens[0] = 1;
- offsets[0] = 0;
+ offsets[0] = 0;
- if((mpi_err= MPI_Type_create_hindexed(count,blocklens,offsets,MPI_BYTE,&filetype))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
- return 1;
+ if ((mpi_err = MPI_Type_create_hindexed(count, blocklens, offsets, MPI_BYTE,
+ &filetype)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ HDprintf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
+ return 1;
}
- if((mpi_err=MPI_Type_commit(&filetype))!=MPI_SUCCESS){
+ if ((mpi_err = MPI_Type_commit(&filetype)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
- return 1;
+ HDprintf("MPI_Type_commit failed (%s)\n", mpi_err_str);
+ return 1;
}
count = 1;
- blocklens[0]=1;
+ blocklens[0] = 1;
offsets[0] = 1;
- if((mpi_err= MPI_Type_create_hindexed(count,blocklens,offsets,MPI_BYTE,&filetypenew))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
- return 1;
+ if ((mpi_err = MPI_Type_create_hindexed(count, blocklens, offsets, MPI_BYTE,
+ &filetypenew)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ HDprintf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
+ return 1;
}
- if((mpi_err=MPI_Type_commit(&filetypenew))!=MPI_SUCCESS){
+ if ((mpi_err = MPI_Type_commit(&filetypenew)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
- return 1;
+ HDprintf("MPI_Type_commit failed (%s)\n", mpi_err_str);
+ return 1;
}
- outcount = 2;
+ outcount = 2;
adv_blocklens[0] = 1;
adv_blocklens[1] = 1;
- adv_disp[0] = 0;
- adv_disp[1] = 1;
- bas_filetype[0] = filetype;
- bas_filetype[1] = filetypenew;
-
- if((mpi_err= MPI_Type_create_struct(outcount,adv_blocklens,adv_disp,bas_filetype,&adv_filetype))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_create_struct failed (%s)\n", mpi_err_str);
- return 1;
+ adv_disp[0] = 0;
+ adv_disp[1] = 1;
+ bas_filetype[0] = filetype;
+ bas_filetype[1] = filetypenew;
+
+ if ((mpi_err = MPI_Type_create_struct(outcount, adv_blocklens, adv_disp,
+ bas_filetype, &adv_filetype)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ HDprintf("MPI_Type_create_struct failed (%s)\n", mpi_err_str);
+ return 1;
}
- if((mpi_err=MPI_Type_commit(&adv_filetype))!=MPI_SUCCESS){
+ if ((mpi_err = MPI_Type_commit(&adv_filetype)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
- return 1;
+ HDprintf("MPI_Type_commit failed (%s)\n", mpi_err_str);
+ return 1;
}
-
- if((mpi_err = MPI_File_set_view(fh,disp,etype,adv_filetype,"native",MPI_INFO_NULL))!= MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_set_view failed (%s)\n", mpi_err_str);
- return 1;
+ if ((mpi_err = MPI_File_set_view(fh, disp, etype, adv_filetype, "native",
+ MPI_INFO_NULL)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ HDprintf("MPI_File_set_view failed (%s)\n", mpi_err_str);
+ return 1;
}
- if((mpi_err = MPI_File_write(fh,buf,3,MPI_BYTE,&Status))!= MPI_SUCCESS){
+ if ((mpi_err = MPI_File_write(fh, buf, 3, MPI_BYTE, &Status))
+ != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_write failed (%s)\n", mpi_err_str);
- return 1;
- ;
+ HDprintf("MPI_File_write failed (%s)\n", mpi_err_str);
+ return 1;
}
-
- if((mpi_err = MPI_File_close(&fh)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_close failed (%s)\n", mpi_err_str);
- return 1;
+ if ((mpi_err = MPI_File_close(&fh)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ HDprintf("MPI_File_close failed (%s)\n", mpi_err_str);
+ return 1;
}
-
- if((mpi_err = MPI_File_open(MPI_COMM_WORLD,filename,MPI_MODE_RDONLY,MPI_INFO_NULL,&fh)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_open failed (%s)\n", mpi_err_str);
- return 1;
+ if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_RDONLY,
+ MPI_INFO_NULL, &fh)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ HDprintf("MPI_File_open failed (%s)\n", mpi_err_str);
+ return 1;
}
- if((mpi_err = MPI_File_set_view(fh,0,MPI_BYTE,MPI_BYTE,"native",MPI_INFO_NULL))!= MPI_SUCCESS){
+ if ((mpi_err = MPI_File_set_view(fh, 0, MPI_BYTE, MPI_BYTE, "native",
+ MPI_INFO_NULL)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_set_view failed (%s)\n", mpi_err_str);
- return 1;
+ HDprintf("MPI_File_set_view failed (%s)\n", mpi_err_str);
+ return 1;
}
- if((mpi_err = MPI_File_read(fh,outbuf,3,MPI_BYTE,&Status))!=MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_read failed (%s)\n", mpi_err_str);
- return 1;
+ if ((mpi_err = MPI_File_read(fh, outbuf, 3, MPI_BYTE, &Status))
+ != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ HDprintf("MPI_File_read failed (%s)\n", mpi_err_str);
+ return 1;
}
- if(outbuf[2]==2) {
- retcode = 0;
- }
- else {
-/* if(mpi_rank == 0) {
- printf("complicated derived datatype is NOT working at this platform\n");
- printf("go back to hdf5/config and find the corresponding\n");
- printf("configure-specific file and change ?????\n");
- }
-*/
- retcode = -1;
- }
-
- if((mpi_err = MPI_File_close(&fh)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_close failed (%s)\n", mpi_err_str);
- return 1;
+ if (outbuf[2] == 2) {
+ retcode = 0;
+ } else {
+ /* if(mpi_rank == 0) {
+ HDprintf("complicated derived datatype is NOT working at this platform\n");
+ HDprintf("go back to hdf5/config and find the corresponding\n");
+ HDprintf("configure-specific file and change ?????\n");
+ }
+ */
+ retcode = -1;
}
+ if ((mpi_err = MPI_File_close(&fh)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ HDprintf("MPI_File_close failed (%s)\n", mpi_err_str);
+ return 1;
+ }
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
- if(retcode == -1) {
- if(mpi_rank == 0) {
- printf("Complicated derived datatype is NOT working at this platform\n");
- printf(" Please report to help@hdfgroup.org about this problem.\n");
- }
- retcode = 1;
+ if (retcode == -1) {
+ if (mpi_rank == 0) {
+ HDprintf(
+ "Complicated derived datatype is NOT working at this platform\n");
+ HDprintf(" Please report to help@hdfgroup.org about this problem.\n");
+ }
+ retcode = 1;
}
return retcode;
}
/*
-Function: test_mpio_special_collective
+ Function: test_mpio_special_collective
-Test Whether collective IO is still working when more than one process
-has no contribution to IO. To properly test this case, at least FOUR
-processes are needed.
+ Test Whether collective IO is still working when more than one process
+ has no contribution to IO. To properly test this case, at least FOUR
+ processes are needed.
-1. Details for the test:
-1) Create one derived datatype with MPI_Type_create_hindexed:
+ 1. Details for the test:
+ 1) Create one derived datatype with MPI_Type_create_hindexed:
-2) Choosing at least two processes to contribute none for IO with
- the buf size inside MPI_Write_at_all to 0.
-3) Choosing at least two processes to have real contributions for IO.
-4) Do collective IO.
+ 2) Choosing at least two processes to contribute none for IO with
+ the buf size inside MPI_Write_at_all to 0.
+ 3) Choosing at least two processes to have real contributions for IO.
+ 4) Do collective IO.
-2. This test will fail with the MPI-IO package that doesn't support this. For example,
-mpich 1.2.6.
+ 2. This test will fail with the MPI-IO package that doesn't support this. For example,
+ mpich 1.2.6.
-If this bug has been fixed in the previous not-working package, this test will issue a printf message to tell the developer to change
-the configuration specific file of HDF5 so that we can change our configurationsetting to support special collective IO; currently only special collective IO.
+ If this bug has been fixed in the previous not-working package, this test will issue a HDprintf message to tell the developer to change
+ the configuration specific file of HDF5 so that we can change our configurationsetting to support special collective IO; currently only special collective IO.
-If it turns out that the previous working MPI-IO package no longer works, this test will also issue a message to inform the corresponding failure so that
-we can turn off the support for special collective IO; currently only special collective IO.
-*/
+ If it turns out that the previous working MPI-IO package no longer works, this test will also issue a message to inform the corresponding failure so that
+ we can turn off the support for special collective IO; currently only special collective IO.
+ */
-static int
-test_mpio_special_collective(char *filename)
-{
- int mpi_size, mpi_rank;
+static int test_mpio_special_collective(char *filename) {
+ int mpi_size, mpi_rank;
MPI_File fh;
- MPI_Datatype etype,buftype,filetype;
+ MPI_Datatype etype, buftype, filetype;
char mpi_err_str[MPI_MAX_ERROR_STRING];
- int mpi_err_strlen;
- int mpi_err;
- char writedata[2*DIMSIZE];
+ int mpi_err_strlen;
+ int mpi_err;
+ char writedata[2 * DIMSIZE];
char filerep[7] = "native";
- int i;
- int count,bufcount;
+ int i;
+ int count, bufcount;
int blocklens[2];
MPI_Aint offsets[2];
- MPI_Offset mpi_off = 0;
- MPI_Status mpi_stat;
- int retcode = 0;
+ MPI_Offset mpi_off = 0;
+ MPI_Status mpi_stat;
+ int retcode = 0;
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
/* create MPI data type */
etype = MPI_BYTE;
- if(mpi_rank == 0 || mpi_rank == 1) {
+ if (mpi_rank == 0 || mpi_rank == 1) {
count = DIMSIZE;
bufcount = 1;
} /* end if */
@@ -892,101 +890,85 @@ test_mpio_special_collective(char *filename)
} /* end else */
blocklens[0] = count;
- offsets[0] = mpi_rank*count;
+ offsets[0] = mpi_rank * count;
blocklens[1] = count;
- offsets[1] = (mpi_size+mpi_rank)*count;
-
- if(count !=0) {
- if((mpi_err = MPI_Type_create_hindexed(2,
- blocklens,
- offsets,
- etype,
- &filetype)) != MPI_SUCCESS) {
+ offsets[1] = (mpi_size + mpi_rank) * count;
+
+ if (count != 0) {
+ if ((mpi_err = MPI_Type_create_hindexed(2, blocklens, offsets, etype,
+ &filetype)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
+ HDprintf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
- if((mpi_err = MPI_Type_commit(&filetype)) != MPI_SUCCESS) {
+ if ((mpi_err = MPI_Type_commit(&filetype)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
+ HDprintf("MPI_Type_commit failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
- if((mpi_err = MPI_Type_create_hindexed(2,
- blocklens,
- offsets,
- etype,
- &buftype)) != MPI_SUCCESS) {
+ if ((mpi_err = MPI_Type_create_hindexed(2, blocklens, offsets, etype,
+ &buftype)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
+ HDprintf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
- if((mpi_err = MPI_Type_commit(&buftype)) != MPI_SUCCESS) {
+ if ((mpi_err = MPI_Type_commit(&buftype)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
+ HDprintf("MPI_Type_commit failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
} /* end if */
else {
filetype = MPI_BYTE;
- buftype = MPI_BYTE;
+ buftype = MPI_BYTE;
} /* end else */
/* Open a file */
- if ((mpi_err = MPI_File_open(MPI_COMM_WORLD,
- filename,
- MPI_MODE_RDWR | MPI_MODE_CREATE,
- MPI_INFO_NULL,
- &fh)) != MPI_SUCCESS) {
+ if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename,
+ MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fh))
+ != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_open failed (%s)\n", mpi_err_str);
+ HDprintf("MPI_File_open failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
/* each process writes some data */
- for (i=0; i < 2*DIMSIZE; i++)
- writedata[i] = (char)(mpi_rank*DIMSIZE + i);
+ for (i = 0; i < 2 * DIMSIZE; i++)
+ writedata[i] = (char) (mpi_rank * DIMSIZE + i);
/* Set the file view */
- if((mpi_err = MPI_File_set_view(fh,
- mpi_off,
- MPI_BYTE,
- filetype,
- filerep,
- MPI_INFO_NULL)) != MPI_SUCCESS) {
+ if ((mpi_err = MPI_File_set_view(fh, mpi_off, MPI_BYTE, filetype, filerep,
+ MPI_INFO_NULL)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_set_view failed (%s)\n", mpi_err_str);
+ HDprintf("MPI_File_set_view failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
/* Collectively write into the file */
- if ((mpi_err = MPI_File_write_at_all(fh,
- mpi_off,
- writedata,
- bufcount,
- buftype,
- &mpi_stat)) != MPI_SUCCESS) {
+ if ((mpi_err = MPI_File_write_at_all(fh, mpi_off, writedata, bufcount,
+ buftype, &mpi_stat)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
- (long) mpi_off, bufcount, mpi_err_str);
+ HDprintf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
+ (long) mpi_off, bufcount, mpi_err_str);
return 1;
} /* end if */
/* Close the file */
if ((mpi_err = MPI_File_close(&fh)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_close failed. \n");
+ HDprintf("MPI_File_close failed. \n");
return 1;
} /* end if */
/* Perform a barrier */
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
- if(retcode != 0) {
- if(mpi_rank == 0) {
- printf("special collective IO is NOT working at this platform\n");
- printf(" Please report to help@hdfgroup.org about this problem.\n");
+ if (retcode != 0) {
+ if (mpi_rank == 0) {
+ HDprintf("special collective IO is NOT working at this platform\n");
+ HDprintf(" Please report to help@hdfgroup.org about this problem.\n");
} /* end if */
retcode = 1;
} /* end if */
@@ -998,93 +980,86 @@ test_mpio_special_collective(char *filename)
/*
* parse the command line options
*/
-static int
-parse_options(int argc, char **argv)
-{
- while (--argc){
- if (**(++argv) != '-'){
- break;
- }else{
- switch(*(*argv+1)){
- case 'v': if (*((*argv+1)+1))
- ParseTestVerbosity((*argv+1)+1);
- else
- SetTestVerbosity(VERBO_MED);
- break;
- case 'f': if (--argc < 1) {
- nerrors++;
- return(1);
- }
- if (**(++argv) == '-') {
- nerrors++;
- return(1);
- }
- paraprefix = *argv;
- break;
- case 'h': /* print help message--return with nerrors set */
- return(1);
- default: nerrors++;
- return(1);
- }
- }
+static int parse_options(int argc, char **argv) {
+ while (--argc) {
+ if (**(++argv) != '-') {
+ break;
+ } else {
+ switch (*(*argv + 1)) {
+ case 'v':
+ if (*((*argv + 1) + 1))
+ ParseTestVerbosity((*argv + 1) + 1);
+ else
+ SetTestVerbosity(VERBO_MED);
+ break;
+ case 'f':
+ if (--argc < 1) {
+ nerrors++;
+ return (1);
+ }
+ if (**(++argv) == '-') {
+ nerrors++;
+ return (1);
+ }
+ paraprefix = *argv;
+ break;
+ case 'h': /* print help message--return with nerrors set */
+ return (1);
+ default:
+ nerrors++;
+ return (1);
+ }
+ }
} /*while*/
/* compose the test filenames */
{
- int i, n;
- hid_t plist;
-
- plist = H5Pcreate (H5P_FILE_ACCESS);
- H5Pset_fapl_mpio(plist, MPI_COMM_WORLD, MPI_INFO_NULL);
- n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */
-
- for (i=0; i < n; i++)
- if (h5_fixname(FILENAME[i],plist,filenames[i],sizeof(filenames[i]))
- == NULL){
- printf("h5_fixname failed\n");
- nerrors++;
- return(1);
- }
- H5Pclose(plist);
- if (VERBOSE_MED){
- printf("Test filenames are:\n");
- for (i=0; i < n; i++)
- printf(" %s\n", filenames[i]);
- }
+ int i, n;
+ hid_t plist;
+
+ plist = H5Pcreate(H5P_FILE_ACCESS);
+ H5Pset_fapl_mpio(plist, MPI_COMM_WORLD, MPI_INFO_NULL);
+ n = sizeof(FILENAME) / sizeof(FILENAME[0]) - 1; /* exclude the NULL */
+
+ for (i = 0; i < n; i++)
+ if (h5_fixname(FILENAME[i], plist, filenames[i],
+ sizeof(filenames[i])) == NULL) {
+ HDprintf("h5_fixname failed\n");
+ nerrors++;
+ return (1);
+ }
+ H5Pclose(plist);
+ if (VERBOSE_MED) {
+ HDprintf("Test filenames are:\n");
+ for (i = 0; i < n; i++)
+ HDprintf(" %s\n", filenames[i]);
+ }
}
- return(0);
+ return (0);
}
-
/*
* Show command usage
*/
-static void
-usage(void)
-{
- printf("Usage: t_mpi [-v<verbosity>] [-f <prefix>]\n");
- printf("\t-v<verbosity>\tset verbose level (0-9,l,m,h)\n");
- printf("\t-f <prefix>\tfilename prefix\n");
- printf("\n");
+static void usage(void) {
+ HDprintf("Usage: t_mpi [-v<verbosity>] [-f <prefix>]\n");
+ HDprintf("\t-v<verbosity>\tset verbose level (0-9,l,m,h)\n");
+ HDprintf("\t-f <prefix>\tfilename prefix\n");
+ HDprintf("\n");
}
/*
* return the sum of all errors.
*/
-static int
-errors_sum(int nerrs)
-{
+static int errors_sum(int nerrs) {
int temp;
MPI_Allreduce(&nerrs, &temp, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
- return(temp);
+ return (temp);
}
-
-int
-main(int argc, char **argv)
-{
- int mpi_size, mpi_rank; /* mpi variables */
+int main(int argc, char **argv) {
+ int mpi_size, mpi_rank; /* mpi variables */
int ret_code;
MPI_Init(&argc, &argv);
@@ -1092,113 +1067,111 @@ main(int argc, char **argv)
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
/* Attempt to turn off atexit post processing so that in case errors
- * happen during the test and the process is aborted, it will not get
- * hang in the atexit post processing in which it may try to make MPI
- * calls. By then, MPI calls may not work.
- */
- if (H5dont_atexit() < 0){
- printf("Failed to turn off atexit processing. Continue.\n");
+ * happen during the test and the process is aborted, it will not get
+ * hang in the atexit post processing in which it may try to make MPI
+ * calls. By then, MPI calls may not work.
+ */
+ if (H5dont_atexit() < 0) {
+ HDprintf("Failed to turn off atexit processing. Continue.\n");
};
H5open();
- if (parse_options(argc, argv) != 0){
- if (MAINPROCESS)
- usage();
- goto finish;
+ if (parse_options(argc, argv) != 0) {
+ if (MAINPROCESS)
+ usage();
+ goto finish;
}
- if (MAINPROCESS){
- printf("===================================\n");
- printf("MPI functionality tests\n");
- printf("===================================\n");
+ if (MAINPROCESS) {
+ HDprintf("===================================\n");
+ HDprintf("MPI functionality tests\n");
+ HDprintf("===================================\n");
}
if (VERBOSE_MED)
- h5_show_hostname();
+ h5_show_hostname();
- fapl = H5Pcreate (H5P_FILE_ACCESS);
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_mpio(fapl, MPI_COMM_WORLD, MPI_INFO_NULL);
/* set alarm. */
ALARM_ON;
-
/*=======================================
- * MPIO 1 write Many read test
- *=======================================*/
+ * MPIO 1 write Many read test
+ *=======================================*/
MPI_BANNER("MPIO 1 write Many read test...");
ret_code = test_mpio_1wMr(filenames[0], USENONE);
ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
+ if (mpi_rank == 0 && ret_code > 0) {
+ HDprintf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
}
/* test atomicity and file sync in high verbose mode only */
/* since they often hang when broken and PHDF5 does not use them. */
- if (VERBOSE_HI){
- MPI_BANNER("MPIO 1 write Many read test with atomicity...");
- ret_code = test_mpio_1wMr(filenames[0], USEATOM);
- ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
- }
-
- MPI_BANNER("MPIO 1 write Many read test with file sync...");
- ret_code = test_mpio_1wMr(filenames[0], USEFSYNC);
- ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
- }
- }
+ if (VERBOSE_HI) {
+ MPI_BANNER("MPIO 1 write Many read test with atomicity...");
+ ret_code = test_mpio_1wMr(filenames[0], USEATOM);
+ ret_code = errors_sum(ret_code);
+ if (mpi_rank == 0 && ret_code > 0) {
+ HDprintf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
+ }
+ MPI_BANNER("MPIO 1 write Many read test with file sync...");
+ ret_code = test_mpio_1wMr(filenames[0], USEFSYNC);
+ ret_code = errors_sum(ret_code);
+ if (mpi_rank == 0 && ret_code > 0) {
+ HDprintf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
+ }
+ }
/*=======================================
- * MPIO MPIO File size range test
- *=======================================*/
+ * MPIO MPIO File size range test
+ *=======================================*/
MPI_BANNER("MPIO File size range test...");
#ifndef H5_HAVE_WIN32_API
ret_code = test_mpio_gb_file(filenames[0]);
ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
+ if (mpi_rank == 0 && ret_code > 0) {
+ HDprintf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
}
#else
if (mpi_rank==0)
- printf(" will be skipped on Windows (JIRA HDDFV-8064)\n");
+ HDprintf(" will be skipped on Windows (JIRA HDDFV-8064)\n");
#endif
/*=======================================
- * MPIO independent overlapping writes
- *=======================================*/
+ * MPIO independent overlapping writes
+ *=======================================*/
MPI_BANNER("MPIO independent overlapping writes...");
ret_code = test_mpio_overlap_writes(filenames[0]);
ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
+ if (mpi_rank == 0 && ret_code > 0) {
+ HDprintf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
}
/*=======================================
- * MPIO complicated derived datatype test
- *=======================================*/
+ * MPIO complicated derived datatype test
+ *=======================================*/
MPI_BANNER("MPIO complicated derived datatype test...");
ret_code = test_mpio_derived_dtype(filenames[0]);
ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
+ if (mpi_rank == 0 && ret_code > 0) {
+ HDprintf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
}
/*=======================================
- * MPIO special collective IO test
- *=======================================*/
+ * MPIO special collective IO test
+ *=======================================*/
if (mpi_size < 4) {
MPI_BANNER("MPIO special collective io test SKIPPED.");
if (mpi_rank == 0)
- printf("This test needs at least four processes to run.\n");
+ HDprintf("This test needs at least four processes to run.\n");
ret_code = 0;
goto sc_finish;
} /* end if */
@@ -1206,28 +1179,26 @@ main(int argc, char **argv)
MPI_BANNER("MPIO special collective io test...");
ret_code = test_mpio_special_collective(filenames[0]);
-sc_finish:
- ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
+ sc_finish: ret_code = errors_sum(ret_code);
+ if (mpi_rank == 0 && ret_code > 0) {
+ HDprintf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
}
-
-finish:
+ finish:
/* make sure all processes are finished before final report, cleanup
- * and exit.
- */
+ * and exit.
+ */
MPI_Barrier(MPI_COMM_WORLD);
- if (MAINPROCESS){ /* only process 0 reports */
- printf("===================================\n");
- if (nerrors){
- printf("***MPI tests detected %d errors***\n", nerrors);
- }
- else{
- printf("MPI tests finished with no errors\n");
- }
- printf("===================================\n");
+ if (MAINPROCESS) { /* only process 0 reports */
+ HDprintf("===================================\n");
+ if (nerrors) {
+ HDprintf("***MPI tests detected %d errors***\n", nerrors);
+ }
+ else {
+ HDprintf("MPI tests finished with no errors\n");
+ }
+ HDprintf("===================================\n");
}
/* turn off alarm */
@@ -1240,6 +1211,6 @@ finish:
MPI_Finalize();
/* cannot just return (nerrors) because exit code is limited to 1byte */
- return(nerrors!=0);
+ return (nerrors != 0);
}
diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c
index 574591c..73d262e 100644
--- a/testpar/t_ph5basic.c
+++ b/testpar/t_ph5basic.c
@@ -22,17 +22,15 @@
* Function: test_fapl_mpio_dup
*
* Purpose: Test if fapl_mpio property list keeps a duplicate of the
- * communicator and INFO objects given when set; and returns
- * duplicates of its components when H5Pget_fapl_mpio is called.
+ * communicator and INFO objects given when set; and returns
+ * duplicates of its components when H5Pget_fapl_mpio is called.
*
- * Return: Success: None
- *
- * Failure: Abort
+ * Return: Success: None
+ * Failure: Abort
*
* Programmer: Albert Cheng
* January 9, 2003
*
- * Modifications:
*-------------------------------------------------------------------------
*/
void
@@ -44,43 +42,43 @@ test_fapl_mpio_dup(void)
int mpi_size_tmp, mpi_rank_tmp;
MPI_Info info = MPI_INFO_NULL;
MPI_Info info_tmp = MPI_INFO_NULL;
- int mrc; /* MPI return value */
- hid_t acc_pl; /* File access properties */
- herr_t ret; /* hdf5 return value */
+ int mrc; /* MPI return value */
+ hid_t acc_pl; /* File access properties */
+ herr_t ret; /* HDF5 return value */
int nkeys, nkeys_tmp;
if (VERBOSE_MED)
- printf("Verify fapl_mpio duplicates communicator and INFO objects\n");
+ HDprintf("Verify fapl_mpio duplicates communicator and INFO objects\n");
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
if (VERBOSE_MED)
- printf("rank/size of MPI_COMM_WORLD are %d/%d\n", mpi_rank, mpi_size);
+ HDprintf("rank/size of MPI_COMM_WORLD are %d/%d\n", mpi_rank, mpi_size);
/* Create a new communicator that has the same processes as MPI_COMM_WORLD.
* Use MPI_Comm_split because it is simplier than MPI_Comm_create
*/
mrc = MPI_Comm_split(MPI_COMM_WORLD, 0, 0, &comm);
- VRFY((mrc==MPI_SUCCESS), "MPI_Comm_split");
- MPI_Comm_size(comm,&mpi_size_old);
- MPI_Comm_rank(comm,&mpi_rank_old);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Comm_split");
+ MPI_Comm_size(comm, &mpi_size_old);
+ MPI_Comm_rank(comm, &mpi_rank_old);
if (VERBOSE_MED)
- printf("rank/size of comm are %d/%d\n", mpi_rank_old, mpi_size_old);
+ HDprintf("rank/size of comm are %d/%d\n", mpi_rank_old, mpi_size_old);
/* create a new INFO object with some trivial information. */
mrc = MPI_Info_create(&info);
- VRFY((mrc==MPI_SUCCESS), "MPI_Info_create");
+ VRFY((mrc == MPI_SUCCESS), "MPI_Info_create");
mrc = MPI_Info_set(info, "hdf_info_name", "XYZ");
- VRFY((mrc==MPI_SUCCESS), "MPI_Info_set");
- if (MPI_INFO_NULL != info){
- mrc=MPI_Info_get_nkeys(info, &nkeys);
- VRFY((mrc==MPI_SUCCESS), "MPI_Info_get_nkeys");
+ VRFY((mrc == MPI_SUCCESS), "MPI_Info_set");
+ if (MPI_INFO_NULL != info) {
+ mrc = MPI_Info_get_nkeys(info, &nkeys);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Info_get_nkeys");
}
if (VERBOSE_MED)
- h5_dump_info_object(info);
+ h5_dump_info_object(info);
- acc_pl = H5Pcreate (H5P_FILE_ACCESS);
+ acc_pl = H5Pcreate(H5P_FILE_ACCESS);
VRFY((acc_pl >= 0), "H5P_FILE_ACCESS");
ret = H5Pset_fapl_mpio(acc_pl, comm, info);
@@ -92,28 +90,27 @@ test_fapl_mpio_dup(void)
* valid communicator and INFO object.
*/
mrc = MPI_Comm_free(&comm);
- VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free");
- if (MPI_INFO_NULL!=info){
- mrc = MPI_Info_free(&info);
- VRFY((mrc==MPI_SUCCESS), "MPI_Info_free");
+ VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free");
+ if (MPI_INFO_NULL != info) {
+ mrc = MPI_Info_free(&info);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Info_free");
}
ret = H5Pget_fapl_mpio(acc_pl, &comm_tmp, &info_tmp);
VRFY((ret >= 0), "H5Pget_fapl_mpio");
- MPI_Comm_size(comm_tmp,&mpi_size_tmp);
- MPI_Comm_rank(comm_tmp,&mpi_rank_tmp);
+ MPI_Comm_size(comm_tmp, &mpi_size_tmp);
+ MPI_Comm_rank(comm_tmp, &mpi_rank_tmp);
if (VERBOSE_MED)
- printf("After H5Pget_fapl_mpio: rank/size of comm are %d/%d\n",
- mpi_rank_tmp, mpi_size_tmp);
- VRFY((mpi_size_tmp==mpi_size), "MPI_Comm_size");
- VRFY((mpi_rank_tmp==mpi_rank), "MPI_Comm_rank");
- if (MPI_INFO_NULL != info_tmp){
- mrc=MPI_Info_get_nkeys(info_tmp, &nkeys_tmp);
- VRFY((mrc==MPI_SUCCESS), "MPI_Info_get_nkeys");
- VRFY((nkeys_tmp==nkeys), "new and old nkeys equal");
+ HDprintf("After H5Pget_fapl_mpio: rank/size of comm are %d/%d\n", mpi_rank_tmp, mpi_size_tmp);
+ VRFY((mpi_size_tmp == mpi_size), "MPI_Comm_size");
+ VRFY((mpi_rank_tmp == mpi_rank), "MPI_Comm_rank");
+ if (MPI_INFO_NULL != info_tmp) {
+ mrc = MPI_Info_get_nkeys(info_tmp, &nkeys_tmp);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Info_get_nkeys");
+ VRFY((nkeys_tmp == nkeys), "new and old nkeys equal");
}
if (VERBOSE_MED)
- h5_dump_info_object(info_tmp);
+ h5_dump_info_object(info_tmp);
/* Case 2:
* Free the retrieved communicator and INFO object.
@@ -122,23 +119,23 @@ test_fapl_mpio_dup(void)
* Also verify the NULL argument option.
*/
mrc = MPI_Comm_free(&comm_tmp);
- VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free");
- if (MPI_INFO_NULL!=info_tmp){
- mrc = MPI_Info_free(&info_tmp);
- VRFY((mrc==MPI_SUCCESS), "MPI_Info_free");
+ VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free");
+ if (MPI_INFO_NULL != info_tmp) {
+ mrc = MPI_Info_free(&info_tmp);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Info_free");
}
/* check NULL argument options. */
ret = H5Pget_fapl_mpio(acc_pl, &comm_tmp, NULL);
VRFY((ret >= 0), "H5Pget_fapl_mpio Comm only");
mrc = MPI_Comm_free(&comm_tmp);
- VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free");
+ VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free");
ret = H5Pget_fapl_mpio(acc_pl, NULL, &info_tmp);
VRFY((ret >= 0), "H5Pget_fapl_mpio Info only");
- if (MPI_INFO_NULL!=info_tmp){
- mrc = MPI_Info_free(&info_tmp);
- VRFY((mrc==MPI_SUCCESS), "MPI_Info_free");
+ if (MPI_INFO_NULL != info_tmp) {
+ mrc = MPI_Info_free(&info_tmp);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Info_free");
}
ret = H5Pget_fapl_mpio(acc_pl, NULL, NULL);
@@ -148,44 +145,44 @@ test_fapl_mpio_dup(void)
/* Donot free the returned objects which are used in the next case. */
ret = H5Pget_fapl_mpio(acc_pl, &comm_tmp, &info_tmp);
VRFY((ret >= 0), "H5Pget_fapl_mpio");
- MPI_Comm_size(comm_tmp,&mpi_size_tmp);
- MPI_Comm_rank(comm_tmp,&mpi_rank_tmp);
+ MPI_Comm_size(comm_tmp, &mpi_size_tmp);
+ MPI_Comm_rank(comm_tmp, &mpi_rank_tmp);
if (VERBOSE_MED)
- printf("After second H5Pget_fapl_mpio: rank/size of comm are %d/%d\n",
- mpi_rank_tmp, mpi_size_tmp);
- VRFY((mpi_size_tmp==mpi_size), "MPI_Comm_size");
- VRFY((mpi_rank_tmp==mpi_rank), "MPI_Comm_rank");
- if (MPI_INFO_NULL != info_tmp){
- mrc=MPI_Info_get_nkeys(info_tmp, &nkeys_tmp);
- VRFY((mrc==MPI_SUCCESS), "MPI_Info_get_nkeys");
- VRFY((nkeys_tmp==nkeys), "new and old nkeys equal");
+ HDprintf("After second H5Pget_fapl_mpio: rank/size of comm are %d/%d\n",
+ mpi_rank_tmp, mpi_size_tmp);
+ VRFY((mpi_size_tmp == mpi_size), "MPI_Comm_size");
+ VRFY((mpi_rank_tmp == mpi_rank), "MPI_Comm_rank");
+ if (MPI_INFO_NULL != info_tmp) {
+ mrc = MPI_Info_get_nkeys(info_tmp, &nkeys_tmp);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Info_get_nkeys");
+ VRFY((nkeys_tmp == nkeys), "new and old nkeys equal");
}
if (VERBOSE_MED)
- h5_dump_info_object(info_tmp);
+ h5_dump_info_object(info_tmp);
/* Case 3:
* Close the property list and verify the retrieved communicator and INFO
* object are still valid.
*/
H5Pclose(acc_pl);
- MPI_Comm_size(comm_tmp,&mpi_size_tmp);
- MPI_Comm_rank(comm_tmp,&mpi_rank_tmp);
+ MPI_Comm_size(comm_tmp, &mpi_size_tmp);
+ MPI_Comm_rank(comm_tmp, &mpi_rank_tmp);
if (VERBOSE_MED)
- printf("After Property list closed: rank/size of comm are %d/%d\n",
- mpi_rank_tmp, mpi_size_tmp);
- if (MPI_INFO_NULL != info_tmp){
- mrc=MPI_Info_get_nkeys(info_tmp, &nkeys_tmp);
- VRFY((mrc==MPI_SUCCESS), "MPI_Info_get_nkeys");
+ HDprintf("After Property list closed: rank/size of comm are %d/%d\n",
+ mpi_rank_tmp, mpi_size_tmp);
+ if (MPI_INFO_NULL != info_tmp) {
+ mrc = MPI_Info_get_nkeys(info_tmp, &nkeys_tmp);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Info_get_nkeys");
}
if (VERBOSE_MED)
- h5_dump_info_object(info_tmp);
+ h5_dump_info_object(info_tmp);
/* clean up */
mrc = MPI_Comm_free(&comm_tmp);
- VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free");
- if (MPI_INFO_NULL!=info_tmp){
- mrc = MPI_Info_free(&info_tmp);
- VRFY((mrc==MPI_SUCCESS), "MPI_Info_free");
+ VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free");
+ if (MPI_INFO_NULL != info_tmp) {
+ mrc = MPI_Info_free(&info_tmp);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Info_free");
}
-}
+} /* end test_fapl_mpio_dup() */
diff --git a/testpar/t_pread.c b/testpar/t_pread.c
index ac33b88..74feeb6 100644
--- a/testpar/t_pread.c
+++ b/testpar/t_pread.c
@@ -1079,18 +1079,11 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id)
* with the opening and validation of the data contained
* therein.
*
- * WARNING: This test uses fork() and execve(), and
- * therefore will not run on Windows.
- *
* Return: Success: 0
- *
* Failure: 1
*
* Programmer: Richard Warren
* 10/1/17
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c
index 719d150..d75e627 100644
--- a/testpar/t_prestart.c
+++ b/testpar/t_prestart.c
@@ -107,7 +107,7 @@ main (int argc, char **argv)
for (i=0; i < block[0]; i++){
for (j=0; j < block[1]; j++){
if(*dataptr != mpi_rank+1) {
- printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n",
+ HDprintf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n",
(unsigned long)i, (unsigned long)j,
(unsigned long)(i+start[0]), (unsigned long)(j+start[1]),
mpi_rank+1, *(dataptr));
diff --git a/testpar/t_prop.c b/testpar/t_prop.c
index d5efa94..3f72db9 100644
--- a/testpar/t_prop.c
+++ b/testpar/t_prop.c
@@ -141,7 +141,7 @@ test_plist_ed(void)
herr_t ret; /* Generic return value */
if(VERBOSE_MED)
- printf("Encode/Decode DCPLs\n");
+ HDprintf("Encode/Decode DCPLs\n");
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c
index eddbada..0eb4838 100644
--- a/testpar/t_shapesame.c
+++ b/testpar/t_shapesame.c
@@ -110,10 +110,6 @@ struct hs_dr_pio_test_vars_t
*
* Programmer: JRM -- 8/9/11
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
@@ -573,7 +569,7 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->block);
VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid_0, set) suceeded");
- /* In passing, setup the process slice data spaces as well */
+ /* In passing, setup the process slice dataspaces as well */
ret = H5Sselect_hyperslab(tv_ptr->mem_large_ds_process_slice_sid,
H5S_SELECT_SET,
@@ -685,10 +681,6 @@ hs_dr_pio_test__setup(const int test_num,
*
* Programmer: JRM -- 9/18/09
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
@@ -803,10 +795,6 @@ hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr)
*
* Programmer: JRM -- 9/10/11
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
@@ -831,7 +819,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
mpi_rank = tv_ptr->mpi_rank;
- /* We have already done a H5Sselect_all() on the data space
+ /* We have already done a H5Sselect_all() on the dataspace
* small_ds_slice_sid in the initialization phase, so no need to
* call H5Sselect_all() again.
*/
@@ -1044,10 +1032,6 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
*
* Programmer: JRM -- 8/10/11
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
@@ -1329,10 +1313,6 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
*
* Programmer: JRM -- 8/10/11
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
@@ -1659,10 +1639,6 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
*
* Programmer: JRM -- 8/10/11
*
- * Modifications:
- *
- * None
- *
*-------------------------------------------------------------------------
*/
@@ -2395,18 +2371,18 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
/****************************************************************
**
** ckrbrd_hs_dr_pio_test__slct_ckrbrd():
-** Given a data space of tgt_rank, and dimensions:
+** Given a dataspace of tgt_rank, and dimensions:
**
** (mpi_size + 1), edge_size, ... , edge_size
**
** edge_size, and a checker_edge_size, select a checker
** board selection of a sel_rank (sel_rank < tgt_rank)
-** dimensional slice through the data space parallel to the
+** dimensional slice through the dataspace parallel to the
** sel_rank fastest changing indicies, with origin (in the
** higher indicies) as indicated by the start array.
**
** Note that this function, like all its relatives, is
-** hard coded to presume a maximum data space rank of 5.
+** hard coded to presume a maximum dataspace rank of 5.
** While this maximum is declared as a constant, increasing
** it will require extensive coding in addition to changing
** the value of the constant.
@@ -2707,7 +2683,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid));
#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */
- /* Clip the selection back to the data space proper. */
+ /* Clip the selection back to the dataspace proper. */
for ( i = 0; i < test_max_rank; i++ ) {
@@ -2958,7 +2934,7 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
* board selections of different rank that
* H5S_select_shape_same() views as being of the same shape.
*
- * In this function, we test this by reading small_rank - 1
+ * In this function, we test this by reading small_rank - 1
* checker board slices from the on disk large cube, and
* verifying that the data read is correct. Verify that
* H5S_select_shape_same() returns true on the memory and
@@ -2968,10 +2944,6 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
*
* Programmer: JRM -- 9/15/11
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
@@ -3243,10 +3215,6 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
*
* Programmer: JRM -- 8/15/11
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
@@ -3575,10 +3543,6 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
*
* Programmer: JRM -- 8/15/11
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
@@ -3938,10 +3902,6 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
*
* Programmer: JRM -- 8/15/11
*
- * Modifications:
- *
- * None
- *
*-------------------------------------------------------------------------
*/
@@ -4755,10 +4715,10 @@ void pause_proc(void)
if (MAINPROCESS)
while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){
if (!loops++){
- printf("Proc %d (%*s, %d): to debug, attach %d\n",
+ HDprintf("Proc %d (%*s, %d): to debug, attach %d\n",
mpi_rank, mpi_namelen, mpi_name, pid, pid);
}
- printf("waiting(%ds) for file %s ...\n", time_int, greenlight);
+ HDprintf("waiting(%ds) for file %s ...\n", time_int, greenlight);
fflush(stdout);
HDsleep(time_int);
}
@@ -4782,18 +4742,18 @@ int MPI_Init(int *argc, char ***argv)
static void
usage(void)
{
- printf(" [-r] [-w] [-m<n_datasets>] [-n<n_groups>] "
+ HDprintf(" [-r] [-w] [-m<n_datasets>] [-n<n_groups>] "
"[-o] [-f <prefix>] [-d <dim0> <dim1>]\n");
- printf("\t-m<n_datasets>"
+ HDprintf("\t-m<n_datasets>"
"\tset number of datasets for the multiple dataset test\n");
- printf("\t-n<n_groups>"
+ HDprintf("\t-n<n_groups>"
"\tset number of groups for the multiple group test\n");
- printf("\t-f <prefix>\tfilename prefix\n");
- printf("\t-2\t\tuse Split-file together with MPIO\n");
- printf("\t-d <factor0> <factor1>\tdataset dimensions factors. Defaults (%d,%d)\n",
+ HDprintf("\t-f <prefix>\tfilename prefix\n");
+ HDprintf("\t-2\t\tuse Split-file together with MPIO\n");
+ HDprintf("\t-d <factor0> <factor1>\tdataset dimensions factors. Defaults (%d,%d)\n",
ROW_FACTOR, COL_FACTOR);
- printf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n");
- printf("\n");
+ HDprintf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n");
+ HDprintf("\n");
}
@@ -4871,7 +4831,7 @@ parse_options(int argc, char **argv)
break;
case 'h': /* print help message--return with nerrors set */
return(1);
- default: printf("Illegal option(%s)\n", *argv);
+ default: HDprintf("Illegal option(%s)\n", *argv);
nerrors++;
return(1);
}
@@ -4880,12 +4840,12 @@ parse_options(int argc, char **argv)
/* check validity of dimension and chunk sizes */
if (dim0 <= 0 || dim1 <= 0){
- printf("Illegal dim sizes (%d, %d)\n", dim0, dim1);
+ HDprintf("Illegal dim sizes (%d, %d)\n", dim0, dim1);
nerrors++;
return(1);
}
if (chunkdim0 <= 0 || chunkdim1 <= 0){
- printf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1);
+ HDprintf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1);
nerrors++;
return(1);
}
@@ -4893,7 +4853,7 @@ parse_options(int argc, char **argv)
/* Make sure datasets can be divided into equal portions by the processes */
if ((dim0 % mpi_size) || (dim1 % mpi_size)){
if (MAINPROCESS)
- printf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n",
+ HDprintf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n",
dim0, dim1, mpi_size);
nerrors++;
return(1);
@@ -4908,13 +4868,13 @@ parse_options(int argc, char **argv)
for (i=0; i < n; i++)
if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i]))
== NULL){
- printf("h5_fixname failed\n");
+ HDprintf("h5_fixname failed\n");
nerrors++;
return(1);
}
- printf("Test filenames are:\n");
+ HDprintf("Test filenames are:\n");
for (i=0; i < n; i++)
- printf(" %s\n", filenames[i]);
+ HDprintf(" %s\n", filenames[i]);
}
return(0);
@@ -5051,10 +5011,10 @@ int main(int argc, char **argv)
dim1 = COL_FACTOR*mpi_size;
if (MAINPROCESS){
- printf("===================================\n");
- printf("Shape Same Tests Start\n");
- printf(" express_test = %d.\n", GetTestExpress());
- printf("===================================\n");
+ HDprintf("===================================\n");
+ HDprintf("Shape Same Tests Start\n");
+ HDprintf(" express_test = %d.\n", GetTestExpress());
+ HDprintf("===================================\n");
}
/* Attempt to turn off atexit post processing so that in case errors
@@ -5063,7 +5023,7 @@ int main(int argc, char **argv)
* calls. By then, MPI calls may not work.
*/
if (H5dont_atexit() < 0){
- printf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank);
+ HDprintf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank);
};
H5open();
h5_show_hostname();
@@ -5102,7 +5062,7 @@ int main(int argc, char **argv)
TestParseCmdLine(argc, argv);
if (dxfer_coll_type == DXFER_INDEPENDENT_IO && MAINPROCESS){
- printf("===================================\n"
+ HDprintf("===================================\n"
" Using Independent I/O with file set view to replace collective I/O \n"
"===================================\n");
}
@@ -5133,12 +5093,12 @@ int main(int argc, char **argv)
}
if (MAINPROCESS){ /* only process 0 reports */
- printf("===================================\n");
+ HDprintf("===================================\n");
if (nerrors)
- printf("***Shape Same tests detected %d errors***\n", nerrors);
+ HDprintf("***Shape Same tests detected %d errors***\n", nerrors);
else
- printf("Shape Same tests finished with no errors\n");
- printf("===================================\n");
+ HDprintf("Shape Same tests finished with no errors\n");
+ HDprintf("===================================\n");
}
/* close HDF5 library */
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index 02d2cca..0466839 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -51,7 +51,7 @@ static void coll_read_test(int chunk_factor);
* Function: coll_irregular_cont_write
*
* Purpose: Wrapper to test the collectively irregular hyperslab write in
- contiguous storage
+ * contiguous storage
*
* Return: Success: 0
*
@@ -60,8 +60,6 @@ static void coll_read_test(int chunk_factor);
* Programmer: Unknown
* Dec 2nd, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -78,7 +76,7 @@ coll_irregular_cont_write(void)
* Function: coll_irregular_cont_read
*
* Purpose: Wrapper to test the collectively irregular hyperslab read in
- contiguous storage
+ * contiguous storage
*
* Return: Success: 0
*
@@ -87,8 +85,6 @@ coll_irregular_cont_write(void)
* Programmer: Unknown
* Dec 2nd, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -104,7 +100,7 @@ coll_irregular_cont_read(void)
* Function: coll_irregular_simple_chunk_write
*
* Purpose: Wrapper to test the collectively irregular hyperslab write in
- chunk storage(1 chunk)
+ * chunk storage(1 chunk)
*
* Return: Success: 0
*
@@ -113,8 +109,6 @@ coll_irregular_cont_read(void)
* Programmer: Unknown
* Dec 2nd, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -131,7 +125,7 @@ coll_irregular_simple_chunk_write(void)
* Function: coll_irregular_simple_chunk_read
*
* Purpose: Wrapper to test the collectively irregular hyperslab read in chunk
- storage(1 chunk)
+ * storage(1 chunk)
*
* Return: Success: 0
*
@@ -140,8 +134,6 @@ coll_irregular_simple_chunk_write(void)
* Programmer: Unknown
* Dec 2nd, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -156,7 +148,7 @@ coll_irregular_simple_chunk_read(void)
* Function: coll_irregular_complex_chunk_write
*
* Purpose: Wrapper to test the collectively irregular hyperslab write in chunk
- storage(4 chunks)
+ * storage(4 chunks)
*
* Return: Success: 0
*
@@ -165,8 +157,6 @@ coll_irregular_simple_chunk_read(void)
* Programmer: Unknown
* Dec 2nd, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -183,7 +173,7 @@ coll_irregular_complex_chunk_write(void)
* Function: coll_irregular_complex_chunk_read
*
* Purpose: Wrapper to test the collectively irregular hyperslab read in chunk
- storage(1 chunk)
+ * storage(1 chunk)
*
* Return: Success: 0
*
@@ -192,8 +182,6 @@ coll_irregular_complex_chunk_write(void)
* Programmer: Unknown
* Dec 2nd, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -209,9 +197,9 @@ coll_irregular_complex_chunk_read(void)
* Function: coll_write_test
*
* Purpose: To test the collectively irregular hyperslab write in chunk
- storage
+ * storage
* Input: number of chunks on each dimension
- if number is equal to 0, contiguous storage
+ * if number is equal to 0, contiguous storage
* Return: Success: 0
*
* Failure: -1
@@ -219,8 +207,6 @@ coll_irregular_complex_chunk_read(void)
* Programmer: Unknown
* Dec 2nd, 2004
*
- * Modifications: Oct 18th, 2005
- *
*-------------------------------------------------------------------------
*/
void coll_write_test(int chunk_factor)
@@ -231,19 +217,11 @@ void coll_write_test(int chunk_factor)
hid_t file, datasetc,dataseti; /* File and dataset identifiers */
hid_t mspaceid1, mspaceid, fspaceid,fspaceid1; /* Dataspace identifiers */
- hsize_t mdim1[1],fsdim[2],mdim[2];
-
-#if 0
- hsize_t mdim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset
- (in memory) */
- hsize_t fsdim[] = {FSPACE_DIM1, FSPACE_DIM2}; /* Dimension sizes of the dataset
- (on disk) */
-
- hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the
- dataset in memory when we
- read selection from the
- dataset on the disk */
-#endif
+ hsize_t mdim1[1]; /* Dimension size of the first dataset (in memory) */
+ hsize_t fsdim[2]; /* Dimension sizes of the dataset (on disk) */
+ hsize_t mdim[2]; /* Dimension sizes of the dataset in memory when we
+ * read selection from the dataset on the disk
+ */
hsize_t start[2]; /* Start of hyperslab */
hsize_t stride[2]; /* Stride of hyperslab */
@@ -255,15 +233,9 @@ void coll_write_test(int chunk_factor)
unsigned i;
int fillvalue = 0; /* Fill value for the dataset */
-#if 0
- int matrix_out[MSPACE_DIM1][MSPACE_DIM2];
- int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the
- dataset */
- int vector[MSPACE1_DIM];
-#endif
-
-
- int *matrix_out = NULL, *matrix_out1 = NULL, *vector = NULL;
+ int *matrix_out = NULL;
+ int *matrix_out1 = NULL; /* Buffer to read from the dataset */
+ int *vector = NULL;
int mpi_size,mpi_rank;
@@ -684,9 +656,9 @@ void coll_write_test(int chunk_factor)
* Function: coll_read_test
*
* Purpose: To test the collectively irregular hyperslab read in chunk
- storage
+ * storage
* Input: number of chunks on each dimension
- if number is equal to 0, contiguous storage
+ * if number is equal to 0, contiguous storage
* Return: Success: 0
*
* Failure: -1
@@ -694,9 +666,6 @@ void coll_write_test(int chunk_factor)
* Programmer: Unknown
* Dec 2nd, 2004
*
- * Modifications: Oct 18th, 2005
- * Note: This test must be used with the correpsonding
- coll_write_test.
*-------------------------------------------------------------------------
*/
static void
@@ -710,14 +679,10 @@ coll_read_test(int chunk_factor)
/* Dimension sizes of the dataset (on disk) */
-#if 0
- hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the
- dataset in memory when we
- read selection from the
- dataset on the disk */
+ hsize_t mdim[2]; /* Dimension sizes of the dataset in memory when we
+ * read selection from the dataset on the disk
+ */
-#endif
- hsize_t mdim[2];
hsize_t start[2]; /* Start of hyperslab */
hsize_t stride[2]; /* Stride of hyperslab */
hsize_t count[2]; /* Block count */
@@ -727,13 +692,8 @@ coll_read_test(int chunk_factor)
unsigned i;
int *matrix_out;
- int *matrix_out1;
-#if 0
- int matrix_out[MSPACE_DIM1][MSPACE_DIM2];
- int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the
- dataset */
+ int *matrix_out1; /* Buffer to read from the dataset */
-#endif
int mpi_size,mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -940,7 +900,7 @@ coll_read_test(int chunk_factor)
ret = H5Fclose(file);
VRFY((ret >= 0),"");
- return ;
+ return;
}
@@ -948,18 +908,18 @@ coll_read_test(int chunk_factor)
**
** lower_dim_size_comp_test__select_checker_board():
**
-** Given a data space of tgt_rank, and dimensions:
+** Given a dataspace of tgt_rank, and dimensions:
**
** (mpi_size + 1), edge_size, ... , edge_size
**
** edge_size, and a checker_edge_size, select a checker
** board selection of a sel_rank (sel_rank < tgt_rank)
-** dimensional slice through the data space parallel to the
+** dimensional slice through the dataspace parallel to the
** sel_rank fastest changing indicies, with origin (in the
** higher indicies) as indicated by the start array.
**
** Note that this function, is hard coded to presume a
-** maximum data space rank of 5.
+** maximum dataspace rank of 5.
**
** While this maximum is declared as a constant, increasing
** it will require extensive coding in addition to changing
@@ -1304,7 +1264,7 @@ lower_dim_size_comp_test__select_checker_board(
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
- /* Clip the selection back to the data space proper. */
+ /* Clip the selection back to the dataspace proper. */
for ( i = 0; i < test_max_rank; i++ ) {
@@ -1564,15 +1524,13 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
* Function: lower_dim_size_comp_test__run_test()
*
* Purpose: Verify that a bug in the computation of the size of the
- * lower dimensions of a data space in H5S_obtain_datatype()
+ * lower dimensions of a dataspace in H5S_obtain_datatype()
* has been corrected.
*
* Return: void
*
* Programmer: JRM -- 11/11/09
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
@@ -1763,7 +1721,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
}
#endif
- /* create data spaces */
+ /* create dataspaces */
full_mem_small_ds_sid = H5Screate_simple(5, small_dims, NULL);
VRFY((full_mem_small_ds_sid != 0),
@@ -2177,7 +2135,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
}
- /* try clipping the selection back to the large data space proper */
+ /* try clipping the selection back to the large dataspace proper */
start[0] = start[1] = start[2] = start[3] = start[4] = (hsize_t)0;
stride[0] = (hsize_t)(2 * (mpi_size + 1));
@@ -2334,8 +2292,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
/* verify that H5S_select_shape_same() reports the two
* selections as having the same shape.
*/
- check = H5S_select_shape_same_test(mem_large_ds_sid,
- file_small_ds_sid);
+ check = H5S_select_shape_same_test(mem_large_ds_sid, file_small_ds_sid);
VRFY((check == TRUE), "H5S_select_shape_same_test passed (1)");
@@ -2455,8 +2412,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
/* verify that H5S_select_shape_same() reports the two
* selections as having the same shape.
*/
- check = H5S_select_shape_same_test(mem_small_ds_sid,
- file_large_ds_sid);
+ check = H5S_select_shape_same_test(mem_small_ds_sid, file_large_ds_sid);
VRFY((check == TRUE), "H5S_select_shape_same_test passed (2)");
@@ -2613,8 +2569,6 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
*
* Programmer: JRM -- 11/11/09
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
@@ -2622,31 +2576,23 @@ void
lower_dim_size_comp_test(void)
{
/* const char *fcnName = "lower_dim_size_comp_test()"; */
- int chunk_edge_size = 0;
- int use_collective_io = 1;
- hid_t dset_type = H5T_NATIVE_UINT;
-#if 0
- HDsleep(60);
-#endif
- HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned));
- for ( use_collective_io = (hbool_t)0;
- (int)use_collective_io <= 1;
- (hbool_t)(use_collective_io++) ) {
+ int chunk_edge_size = 0;
+ int use_collective_io;
+ HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned));
+ for(use_collective_io = 0; use_collective_io <= 1; use_collective_io++) {
chunk_edge_size = 0;
lower_dim_size_comp_test__run_test(chunk_edge_size,
(hbool_t)use_collective_io,
- dset_type);
-
+ H5T_NATIVE_UINT);
chunk_edge_size = 5;
lower_dim_size_comp_test__run_test(chunk_edge_size,
(hbool_t)use_collective_io,
- dset_type);
- }
+ H5T_NATIVE_UINT);
+ } /* end for */
return;
-
} /* lower_dim_size_comp_test() */
@@ -2676,8 +2622,6 @@ lower_dim_size_comp_test(void)
*
* Programmer: JRM -- 12/16/09
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
@@ -2741,7 +2685,7 @@ link_chunk_collective_io_test(void)
/* setup dims */
dims[0] = ((hsize_t)mpi_size) * ((hsize_t)(LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE));
- /* setup mem and file data spaces */
+ /* setup mem and file dataspaces */
write_mem_ds_sid = H5Screate_simple(1, chunk_dims, NULL);
VRFY((write_mem_ds_sid != 0),
"H5Screate_simple() write_mem_ds_sid succeeded");
diff --git a/testpar/testpar.h b/testpar/testpar.h
index 84c073f..86677d1 100644
--- a/testpar/testpar.h
+++ b/testpar/testpar.h
@@ -32,7 +32,7 @@
*/
#define MESG(mesg) \
if (VERBOSE_MED && *mesg != '\0') \
- printf("%s\n", mesg)
+ HDprintf("%s\n", mesg)
/*
* VRFY: Verify if the condition val is true.
@@ -46,16 +46,17 @@
*/
#define VRFY(val, mesg) do { \
if (val) { \
- MESG(mesg); \
- } else { \
- printf("Proc %d: ", mpi_rank); \
- printf("*** Parallel ERROR ***\n"); \
- printf(" VRFY (%s) failed at line %4d in %s\n", \
+ MESG(mesg); \
+ } \
+ else { \
+ HDprintf("Proc %d: ", mpi_rank); \
+ HDprintf("*** Parallel ERROR ***\n"); \
+ HDprintf(" VRFY (%s) failed at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
++nerrors; \
fflush(stdout); \
if (!VERBOSE_MED) { \
- printf("aborting MPI processes\n"); \
+ HDprintf("aborting MPI processes\n"); \
MPI_Abort(MPI_COMM_WORLD, 1); \
} \
} \
@@ -70,9 +71,9 @@
if (val) { \
MESG(mesg); \
} else { \
- printf("Proc %d: ", mpi_rank); \
- printf("*** PHDF5 REMARK (not an error) ***\n"); \
- printf(" Condition (%s) failed at line %4d in %s\n", \
+ HDprintf("Proc %d: ", mpi_rank); \
+ HDprintf("*** PHDF5 REMARK (not an error) ***\n"); \
+ HDprintf(" Condition (%s) failed at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
fflush(stdout); \
} \
@@ -80,10 +81,10 @@
#define MPI_BANNER(mesg) do { \
if (VERBOSE_MED || MAINPROCESS){ \
- printf("--------------------------------\n"); \
- printf("Proc %d: ", mpi_rank); \
- printf("*** %s\n", mesg); \
- printf("--------------------------------\n"); \
+ HDprintf("--------------------------------\n"); \
+ HDprintf("Proc %d: ", mpi_rank); \
+ HDprintf("*** %s\n", mesg); \
+ HDprintf("--------------------------------\n"); \
} \
} while(0)
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index 999e17a..b89c790 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -26,15 +26,15 @@ int dim0;
int dim1;
int chunkdim0;
int chunkdim1;
-int nerrors = 0; /* errors count */
-int ndatasets = 300; /* number of datasets to create*/
+int nerrors = 0; /* errors count */
+int ndatasets = 300; /* number of datasets to create*/
int ngroups = 512; /* number of groups to create in root
- * group. */
-int facc_type = FACC_MPIO; /*Test file access type */
+ * group. */
+int facc_type = FACC_MPIO; /*Test file access type */
int dxfer_coll_type = DXFER_COLLECTIVE_IO;
-H5E_auto2_t old_func; /* previous error handler */
-void *old_client_data; /* previous error handler arg.*/
+H5E_auto2_t old_func; /* previous error handler */
+void *old_client_data; /* previous error handler arg.*/
/* other option flags */
@@ -46,10 +46,10 @@ void *old_client_data; /* previous error handler arg.*/
#define NFILENAME 2
#define PARATESTFILE filenames[0]
const char *FILENAME[NFILENAME]={
- "ParaTest",
- NULL};
-char filenames[NFILENAME][PATH_MAX];
-hid_t fapl; /* file access property list */
+ "ParaTest",
+ NULL};
+char filenames[NFILENAME][PATH_MAX];
+hid_t fapl; /* file access property list */
#ifdef USE_PAUSE
/* pause the process for a moment to allow debugger to attach if desired. */
@@ -62,7 +62,7 @@ void pause_proc(void)
{
int pid;
- h5_stat_t statbuf;
+ h5_stat_t statbuf;
char greenlight[] = "go";
int maxloop = 10;
int loops = 0;
@@ -79,15 +79,15 @@ void pause_proc(void)
MPI_Get_processor_name(mpi_name, &mpi_namelen);
if (MAINPROCESS)
- while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){
- if (!loops++){
- printf("Proc %d (%*s, %d): to debug, attach %d\n",
- mpi_rank, mpi_namelen, mpi_name, pid, pid);
- }
- printf("waiting(%ds) for file %s ...\n", time_int, greenlight);
- fflush(stdout);
+ while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){
+ if (!loops++){
+ HDprintf("Proc %d (%*s, %d): to debug, attach %d\n",
+ mpi_rank, mpi_namelen, mpi_name, pid, pid);
+ }
+ HDprintf("waiting(%ds) for file %s ...\n", time_int, greenlight);
+ HDfflush(stdout);
HDsleep(time_int);
- }
+ }
MPI_Barrier(MPI_COMM_WORLD);
}
@@ -99,7 +99,7 @@ int MPI_Init(int *argc, char ***argv)
pause_proc();
return (ret_code);
}
-#endif /* USE_PAUSE */
+#endif /* USE_PAUSE */
/*
@@ -108,18 +108,18 @@ int MPI_Init(int *argc, char ***argv)
static void
usage(void)
{
- printf(" [-r] [-w] [-m<n_datasets>] [-n<n_groups>] "
- "[-o] [-f <prefix>] [-d <dim0> <dim1>]\n");
- printf("\t-m<n_datasets>"
- "\tset number of datasets for the multiple dataset test\n");
- printf("\t-n<n_groups>"
- "\tset number of groups for the multiple group test\n");
- printf("\t-f <prefix>\tfilename prefix\n");
- printf("\t-2\t\tuse Split-file together with MPIO\n");
- printf("\t-d <factor0> <factor1>\tdataset dimensions factors. Defaults (%d,%d)\n",
- ROW_FACTOR, COL_FACTOR);
- printf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n");
- printf("\n");
+ HDprintf(" [-r] [-w] [-m<n_datasets>] [-n<n_groups>] "
+ "[-o] [-f <prefix>] [-d <dim0> <dim1>]\n");
+ HDprintf("\t-m<n_datasets>"
+ "\tset number of datasets for the multiple dataset test\n");
+ HDprintf("\t-n<n_groups>"
+ "\tset number of groups for the multiple group test\n");
+ HDprintf("\t-f <prefix>\tfilename prefix\n");
+ HDprintf("\t-2\t\tuse Split-file together with MPIO\n");
+ HDprintf("\t-d <factor0> <factor1>\tdataset dimensions factors. Defaults (%d,%d)\n",
+ ROW_FACTOR, COL_FACTOR);
+ HDprintf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n");
+ HDprintf("\n");
}
@@ -129,7 +129,7 @@ usage(void)
static int
parse_options(int argc, char **argv)
{
- int mpi_size, mpi_rank; /* mpi variables */
+ int mpi_size, mpi_rank; /* mpi variables */
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -140,107 +140,107 @@ parse_options(int argc, char **argv)
chunkdim1 = (dim1+9)/10;
while (--argc){
- if (**(++argv) != '-'){
- break;
- }else{
- switch(*(*argv+1)){
- case 'm': ndatasets = atoi((*argv+1)+1);
- if (ndatasets < 0){
- nerrors++;
- return(1);
- }
- break;
- case 'n': ngroups = atoi((*argv+1)+1);
- if (ngroups < 0){
- nerrors++;
- return(1);
- }
- break;
- case 'f': if (--argc < 1) {
- nerrors++;
- return(1);
- }
- if (**(++argv) == '-') {
- nerrors++;
- return(1);
- }
- paraprefix = *argv;
- break;
- case 'i': /* Collective MPI-IO access with independent IO */
- dxfer_coll_type = DXFER_INDEPENDENT_IO;
- break;
- case '2': /* Use the split-file driver with MPIO access */
- /* Can use $HDF5_METAPREFIX to define the */
- /* meta-file-prefix. */
- facc_type = FACC_MPIO | FACC_SPLIT;
- break;
- case 'd': /* dimensizes */
- if (--argc < 2){
- nerrors++;
- return(1);
- }
- dim0 = atoi(*(++argv))*mpi_size;
- argc--;
- dim1 = atoi(*(++argv))*mpi_size;
- /* set default chunkdim sizes too */
- chunkdim0 = (dim0+9)/10;
- chunkdim1 = (dim1+9)/10;
- break;
- case 'c': /* chunk dimensions */
- if (--argc < 2){
- nerrors++;
- return(1);
- }
- chunkdim0 = atoi(*(++argv));
- argc--;
- chunkdim1 = atoi(*(++argv));
- break;
- case 'h': /* print help message--return with nerrors set */
- return(1);
- default: printf("Illegal option(%s)\n", *argv);
- nerrors++;
- return(1);
- }
- }
+ if (**(++argv) != '-'){
+ break;
+ }else{
+ switch(*(*argv+1)){
+ case 'm': ndatasets = atoi((*argv+1)+1);
+ if (ndatasets < 0){
+ nerrors++;
+ return(1);
+ }
+ break;
+ case 'n': ngroups = atoi((*argv+1)+1);
+ if (ngroups < 0){
+ nerrors++;
+ return(1);
+ }
+ break;
+ case 'f': if (--argc < 1) {
+ nerrors++;
+ return(1);
+ }
+ if (**(++argv) == '-') {
+ nerrors++;
+ return(1);
+ }
+ paraprefix = *argv;
+ break;
+ case 'i': /* Collective MPI-IO access with independent IO */
+ dxfer_coll_type = DXFER_INDEPENDENT_IO;
+ break;
+ case '2': /* Use the split-file driver with MPIO access */
+ /* Can use $HDF5_METAPREFIX to define the */
+ /* meta-file-prefix. */
+ facc_type = FACC_MPIO | FACC_SPLIT;
+ break;
+ case 'd': /* dimensizes */
+ if (--argc < 2){
+ nerrors++;
+ return(1);
+ }
+ dim0 = atoi(*(++argv))*mpi_size;
+ argc--;
+ dim1 = atoi(*(++argv))*mpi_size;
+ /* set default chunkdim sizes too */
+ chunkdim0 = (dim0+9)/10;
+ chunkdim1 = (dim1+9)/10;
+ break;
+ case 'c': /* chunk dimensions */
+ if (--argc < 2){
+ nerrors++;
+ return(1);
+ }
+ chunkdim0 = atoi(*(++argv));
+ argc--;
+ chunkdim1 = atoi(*(++argv));
+ break;
+ case 'h': /* print help message--return with nerrors set */
+ return(1);
+ default: HDprintf("Illegal option(%s)\n", *argv);
+ nerrors++;
+ return(1);
+ }
+ }
} /*while*/
/* check validity of dimension and chunk sizes */
if (dim0 <= 0 || dim1 <= 0){
- printf("Illegal dim sizes (%d, %d)\n", dim0, dim1);
- nerrors++;
- return(1);
+ HDprintf("Illegal dim sizes (%d, %d)\n", dim0, dim1);
+ nerrors++;
+ return(1);
}
if (chunkdim0 <= 0 || chunkdim1 <= 0){
- printf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1);
- nerrors++;
- return(1);
+ HDprintf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1);
+ nerrors++;
+ return(1);
}
/* Make sure datasets can be divided into equal portions by the processes */
if ((dim0 % mpi_size) || (dim1 % mpi_size)){
- if (MAINPROCESS)
- printf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n",
- dim0, dim1, mpi_size);
- nerrors++;
- return(1);
+ if (MAINPROCESS)
+ HDprintf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n",
+ dim0, dim1, mpi_size);
+ nerrors++;
+ return(1);
}
/* compose the test filenames */
{
- int i, n;
-
- n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */
-
- for (i=0; i < n; i++)
- if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i]))
- == NULL){
- printf("h5_fixname failed\n");
- nerrors++;
- return(1);
- }
- printf("Test filenames are:\n");
- for (i=0; i < n; i++)
- printf(" %s\n", filenames[i]);
+ int i, n;
+
+ n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */
+
+ for (i=0; i < n; i++)
+ if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i]))
+ == NULL){
+ HDprintf("h5_fixname failed\n");
+ nerrors++;
+ return(1);
+ }
+ HDprintf("Test filenames are:\n");
+ for (i=0; i < n; i++)
+ HDprintf(" %s\n", filenames[i]);
}
return(0);
@@ -255,7 +255,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
{
hid_t ret_pl = -1;
herr_t ret; /* generic return value */
- int mpi_rank; /* mpi variables */
+ int mpi_rank; /* mpi variables */
/* need the rank for error checking macros */
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -264,36 +264,36 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
VRFY((ret_pl >= 0), "H5P_FILE_ACCESS");
if (l_facc_type == FACC_DEFAULT)
- return (ret_pl);
+ return (ret_pl);
if (l_facc_type == FACC_MPIO){
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_mpio(ret_pl, comm, info);
- VRFY((ret >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_mpio(ret_pl, comm, info);
+ VRFY((ret >= 0), "");
ret = H5Pset_all_coll_metadata_ops(ret_pl, TRUE);
- VRFY((ret >= 0), "");
+ VRFY((ret >= 0), "");
ret = H5Pset_coll_metadata_write(ret_pl, TRUE);
- VRFY((ret >= 0), "");
- return(ret_pl);
+ VRFY((ret >= 0), "");
+ return(ret_pl);
}
if (l_facc_type == (FACC_MPIO | FACC_SPLIT)){
- hid_t mpio_pl;
-
- mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((mpio_pl >= 0), "");
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_mpio(mpio_pl, comm, info);
- VRFY((ret >= 0), "");
-
- /* setup file access template */
- ret_pl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((ret_pl >= 0), "");
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl);
- VRFY((ret >= 0), "H5Pset_fapl_split succeeded");
- H5Pclose(mpio_pl);
- return(ret_pl);
+ hid_t mpio_pl;
+
+ mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((mpio_pl >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_mpio(mpio_pl, comm, info);
+ VRFY((ret >= 0), "");
+
+ /* setup file access template */
+ ret_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((ret_pl >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl);
+ VRFY((ret >= 0), "H5Pset_fapl_split succeeded");
+ H5Pclose(mpio_pl);
+ return(ret_pl);
}
/* unknown file access types */
@@ -303,7 +303,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
int main(int argc, char **argv)
{
- int mpi_size, mpi_rank; /* mpi variables */
+ int mpi_size, mpi_rank; /* mpi variables */
H5Ptest_param_t ndsets_params, ngroups_params;
H5Ptest_param_t collngroups_params;
H5Ptest_param_t io_mode_confusion_params;
@@ -323,18 +323,18 @@ int main(int argc, char **argv)
dim1 = COL_FACTOR*mpi_size;
if (MAINPROCESS){
- printf("===================================\n");
- printf("PHDF5 TESTS START\n");
- printf("===================================\n");
+ HDprintf("===================================\n");
+ HDprintf("PHDF5 TESTS START\n");
+ HDprintf("===================================\n");
}
/* Attempt to turn off atexit post processing so that in case errors
- * happen during the test and the process is aborted, it will not get
- * hang in the atexit post processing in which it may try to make MPI
- * calls. By then, MPI calls may not work.
- */
+ * happen during the test and the process is aborted, it will not get
+ * hang in the atexit post processing in which it may try to make MPI
+ * calls. By then, MPI calls may not work.
+ */
if (H5dont_atexit() < 0){
- printf("Failed to turn off atexit processing. Continue.\n");
+ HDprintf("Failed to turn off atexit processing. Continue.\n");
};
H5open();
h5_show_hostname();
@@ -344,10 +344,10 @@ int main(int argc, char **argv)
/* Tests are generally arranged from least to most complexity... */
AddTest("mpiodup", test_fapl_mpio_dup, NULL,
- "fapl_mpio duplicate", NULL);
+ "fapl_mpio duplicate", NULL);
AddTest("split", test_split_comm_access, NULL,
- "dataset using split communicators", PARATESTFILE);
+ "dataset using split communicators", PARATESTFILE);
#ifdef PB_OUT /* temporary: disable page buffering when parallel */
AddTest("page_buffer", test_page_buffer_access, NULL,
@@ -355,141 +355,141 @@ int main(int argc, char **argv)
#endif
AddTest("props", test_file_properties, NULL,
- "Coll Metadata file property settings", PARATESTFILE);
+ "Coll Metadata file property settings", PARATESTFILE);
AddTest("idsetw", dataset_writeInd, NULL,
- "dataset independent write", PARATESTFILE);
+ "dataset independent write", PARATESTFILE);
AddTest("idsetr", dataset_readInd, NULL,
- "dataset independent read", PARATESTFILE);
+ "dataset independent read", PARATESTFILE);
AddTest("cdsetw", dataset_writeAll, NULL,
- "dataset collective write", PARATESTFILE);
+ "dataset collective write", PARATESTFILE);
AddTest("cdsetr", dataset_readAll, NULL,
- "dataset collective read", PARATESTFILE);
+ "dataset collective read", PARATESTFILE);
AddTest("eidsetw", extend_writeInd, NULL,
- "extendible dataset independent write", PARATESTFILE);
+ "extendible dataset independent write", PARATESTFILE);
AddTest("eidsetr", extend_readInd, NULL,
- "extendible dataset independent read", PARATESTFILE);
+ "extendible dataset independent read", PARATESTFILE);
AddTest("ecdsetw", extend_writeAll, NULL,
- "extendible dataset collective write", PARATESTFILE);
+ "extendible dataset collective write", PARATESTFILE);
AddTest("ecdsetr", extend_readAll, NULL,
- "extendible dataset collective read", PARATESTFILE);
+ "extendible dataset collective read", PARATESTFILE);
AddTest("eidsetw2", extend_writeInd2, NULL,
- "extendible dataset independent write #2", PARATESTFILE);
+ "extendible dataset independent write #2", PARATESTFILE);
AddTest("selnone", none_selection_chunk, NULL,
"chunked dataset with none-selection", PARATESTFILE);
AddTest("calloc", test_chunk_alloc, NULL,
"parallel extend Chunked allocation on serial file", PARATESTFILE);
AddTest("fltread", test_filter_read, NULL,
- "parallel read of dataset written serially with filters", PARATESTFILE);
+ "parallel read of dataset written serially with filters", PARATESTFILE);
#ifdef H5_HAVE_FILTER_DEFLATE
AddTest("cmpdsetr", compress_readAll, NULL,
- "compressed dataset collective read", PARATESTFILE);
+ "compressed dataset collective read", PARATESTFILE);
#endif /* H5_HAVE_FILTER_DEFLATE */
AddTest("zerodsetr", zero_dim_dset, NULL,
- "zero dim dset", PARATESTFILE);
+ "zero dim dset", PARATESTFILE);
ndsets_params.name = PARATESTFILE;
ndsets_params.count = ndatasets;
AddTest("ndsetw", multiple_dset_write, NULL,
- "multiple datasets write", &ndsets_params);
+ "multiple datasets write", &ndsets_params);
ngroups_params.name = PARATESTFILE;
ngroups_params.count = ngroups;
AddTest("ngrpw", multiple_group_write, NULL,
- "multiple groups write", &ngroups_params);
+ "multiple groups write", &ngroups_params);
AddTest("ngrpr", multiple_group_read, NULL,
- "multiple groups read", &ngroups_params);
+ "multiple groups read", &ngroups_params);
AddTest("compact", compact_dataset, NULL,
- "compact dataset test", PARATESTFILE);
+ "compact dataset test", PARATESTFILE);
collngroups_params.name = PARATESTFILE;
collngroups_params.count = ngroups;
- AddTest("cngrpw", collective_group_write, NULL,
- "collective group and dataset write", &collngroups_params);
- AddTest("ingrpr", independent_group_read, NULL,
- "independent group and dataset read", &collngroups_params);
+ /* combined cngrpw and ingrpr tests because ingrpr reads file created by cngrpw. */
+ AddTest("cngrpw-ingrpr", collective_group_write_independent_group_read, NULL,
+ "collective grp/dset write - independent grp/dset read",
+ &collngroups_params);
#ifndef H5_HAVE_WIN32_API
AddTest("bigdset", big_dataset, NULL,
"big dataset test", PARATESTFILE);
#else
- printf("big dataset test will be skipped on Windows (JIRA HDDFV-8064)\n");
+ HDprintf("big dataset test will be skipped on Windows (JIRA HDDFV-8064)\n");
#endif
AddTest("fill", dataset_fillvalue, NULL,
- "dataset fill value", PARATESTFILE);
+ "dataset fill value", PARATESTFILE);
AddTest("cchunk1",
- coll_chunk1,NULL, "simple collective chunk io",PARATESTFILE);
+ coll_chunk1,NULL, "simple collective chunk io",PARATESTFILE);
AddTest("cchunk2",
- coll_chunk2,NULL, "noncontiguous collective chunk io",PARATESTFILE);
+ coll_chunk2,NULL, "noncontiguous collective chunk io",PARATESTFILE);
AddTest("cchunk3",
- coll_chunk3,NULL, "multi-chunk collective chunk io",PARATESTFILE);
+ coll_chunk3,NULL, "multi-chunk collective chunk io",PARATESTFILE);
AddTest("cchunk4",
- coll_chunk4,NULL, "collective chunk io with partial non-selection ",PARATESTFILE);
+ coll_chunk4,NULL, "collective chunk io with partial non-selection ",PARATESTFILE);
if((mpi_size < 3)&& MAINPROCESS ) {
- printf("Collective chunk IO optimization APIs ");
- printf("needs at least 3 processes to participate\n");
- printf("Collective chunk IO API tests will be skipped \n");
+ HDprintf("Collective chunk IO optimization APIs ");
+ HDprintf("needs at least 3 processes to participate\n");
+ HDprintf("Collective chunk IO API tests will be skipped \n");
}
AddTest((mpi_size <3)? "-cchunk5":"cchunk5" ,
- coll_chunk5,NULL,
- "linked chunk collective IO without optimization",PARATESTFILE);
+ coll_chunk5,NULL,
+ "linked chunk collective IO without optimization",PARATESTFILE);
AddTest((mpi_size < 3)? "-cchunk6" : "cchunk6",
- coll_chunk6,NULL,
- "multi-chunk collective IO with direct request",PARATESTFILE);
+ coll_chunk6,NULL,
+ "multi-chunk collective IO with direct request",PARATESTFILE);
AddTest((mpi_size < 3)? "-cchunk7" : "cchunk7",
- coll_chunk7,NULL,
- "linked chunk collective IO with optimization",PARATESTFILE);
+ coll_chunk7,NULL,
+ "linked chunk collective IO with optimization",PARATESTFILE);
AddTest((mpi_size < 3)? "-cchunk8" : "cchunk8",
- coll_chunk8,NULL,
- "linked chunk collective IO transferring to multi-chunk",PARATESTFILE);
+ coll_chunk8,NULL,
+ "linked chunk collective IO transferring to multi-chunk",PARATESTFILE);
AddTest((mpi_size < 3)? "-cchunk9" : "cchunk9",
- coll_chunk9,NULL,
- "multiple chunk collective IO with optimization",PARATESTFILE);
+ coll_chunk9,NULL,
+ "multiple chunk collective IO with optimization",PARATESTFILE);
AddTest((mpi_size < 3)? "-cchunk10" : "cchunk10",
- coll_chunk10,NULL,
- "multiple chunk collective IO transferring to independent IO",PARATESTFILE);
+ coll_chunk10,NULL,
+ "multiple chunk collective IO transferring to independent IO",PARATESTFILE);
-/* irregular collective IO tests*/
+ /* irregular collective IO tests*/
AddTest("ccontw",
- coll_irregular_cont_write,NULL,
- "collective irregular contiguous write",PARATESTFILE);
+ coll_irregular_cont_write,NULL,
+ "collective irregular contiguous write",PARATESTFILE);
AddTest("ccontr",
- coll_irregular_cont_read,NULL,
- "collective irregular contiguous read",PARATESTFILE);
+ coll_irregular_cont_read,NULL,
+ "collective irregular contiguous read",PARATESTFILE);
AddTest("cschunkw",
- coll_irregular_simple_chunk_write,NULL,
- "collective irregular simple chunk write",PARATESTFILE);
+ coll_irregular_simple_chunk_write,NULL,
+ "collective irregular simple chunk write",PARATESTFILE);
AddTest("cschunkr",
- coll_irregular_simple_chunk_read,NULL,
- "collective irregular simple chunk read",PARATESTFILE);
+ coll_irregular_simple_chunk_read,NULL,
+ "collective irregular simple chunk read",PARATESTFILE);
AddTest("ccchunkw",
- coll_irregular_complex_chunk_write,NULL,
- "collective irregular complex chunk write",PARATESTFILE);
+ coll_irregular_complex_chunk_write,NULL,
+ "collective irregular complex chunk write",PARATESTFILE);
AddTest("ccchunkr",
- coll_irregular_complex_chunk_read,NULL,
- "collective irregular complex chunk read",PARATESTFILE);
+ coll_irregular_complex_chunk_read,NULL,
+ "collective irregular complex chunk read",PARATESTFILE);
AddTest("null", null_dataset, NULL,
- "null dataset test", PARATESTFILE);
+ "null dataset test", PARATESTFILE);
io_mode_confusion_params.name = PARATESTFILE;
io_mode_confusion_params.count = 0; /* value not used */
AddTest("I/Omodeconf", io_mode_confusion, NULL,
- "I/O mode confusion test -- hangs quickly on failure",
+ "I/O mode confusion test -- hangs quickly on failure",
&io_mode_confusion_params);
if((mpi_size < 3) && MAINPROCESS) {
- printf("rr_obj_hdr_flush_confusion test needs at least 3 processes.\n");
- printf("rr_obj_hdr_flush_confusion test will be skipped \n");
+ HDprintf("rr_obj_hdr_flush_confusion test needs at least 3 processes.\n");
+ HDprintf("rr_obj_hdr_flush_confusion test will be skipped \n");
}
if(mpi_size > 2) {
rr_obj_flush_confusion_params.name = PARATESTFILE;
@@ -506,12 +506,12 @@ int main(int argc, char **argv)
AddTest("tldsc",
lower_dim_size_comp_test, NULL,
- "test lower dim size comp in span tree to mpi derived type",
+ "test lower dim size comp in span tree to mpi derived type",
PARATESTFILE);
AddTest("lccio",
link_chunk_collective_io_test, NULL,
- "test mpi derived type management",
+ "test mpi derived type management",
PARATESTFILE);
AddTest("actualio", actual_io_mode_tests, NULL,
@@ -523,21 +523,21 @@ int main(int argc, char **argv)
PARATESTFILE);
AddTest("edpl", test_plist_ed, NULL,
- "encode/decode Property Lists", NULL);
+ "encode/decode Property Lists", NULL);
if((mpi_size < 2) && MAINPROCESS) {
- printf("File Image Ops daisy chain test needs at least 2 processes.\n");
- printf("File Image Ops daisy chain test will be skipped \n");
+ HDprintf("File Image Ops daisy chain test needs at least 2 processes.\n");
+ HDprintf("File Image Ops daisy chain test will be skipped \n");
}
AddTest((mpi_size < 2)? "-fiodc" : "fiodc", file_image_daisy_chain_test, NULL,
"file image ops daisy chain", NULL);
if((mpi_size < 2)&& MAINPROCESS ) {
- printf("Atomicity tests need at least 2 processes to participate\n");
- printf("8 is more recommended.. Atomicity tests will be skipped \n");
+ HDprintf("Atomicity tests need at least 2 processes to participate\n");
+ HDprintf("8 is more recommended.. Atomicity tests will be skipped \n");
}
else if (facc_type != FACC_MPIO && MAINPROCESS) {
- printf("Atomicity tests will not work with a non MPIO VFD\n");
+ HDprintf("Atomicity tests will not work with a non MPIO VFD\n");
}
else if(mpi_size >= 2 && facc_type == FACC_MPIO){
AddTest("atomicity", dataset_atomicity, NULL,
@@ -545,13 +545,13 @@ int main(int argc, char **argv)
}
AddTest("denseattr", test_dense_attr, NULL,
- "Store Dense Attributes", PARATESTFILE);
+ "Store Dense Attributes", PARATESTFILE);
AddTest("noselcollmdread", test_partial_no_selection_coll_md_read, NULL,
"Collective Metadata read with some ranks having no selection", PARATESTFILE);
- AddTest("MC coll MD read", test_multi_chunk_io_addrmap_issue, NULL,
+ AddTest("MC_coll_MD_read", test_multi_chunk_io_addrmap_issue, NULL,
"Collective MD read with multi chunk I/O (H5D__chunk_addrmap)", PARATESTFILE);
- AddTest("LC coll MD read", test_link_chunk_io_sort_chunk_issue, NULL,
+ AddTest("LC_coll_MD_read", test_link_chunk_io_sort_chunk_issue, NULL,
"Collective MD read with link chunk I/O (H5D__sort_chunk)", PARATESTFILE);
/* Display testing information */
@@ -565,9 +565,9 @@ int main(int argc, char **argv)
TestParseCmdLine(argc, argv);
if (dxfer_coll_type == DXFER_INDEPENDENT_IO && MAINPROCESS){
- printf("===================================\n"
- " Using Independent I/O with file set view to replace collective I/O \n"
- "===================================\n");
+ HDprintf("===================================\n"
+ " Using Independent I/O with file set view to replace collective I/O \n"
+ "===================================\n");
}
@@ -575,8 +575,8 @@ int main(int argc, char **argv)
PerformTests();
/* make sure all processes are finished before final report, cleanup
- * and exit.
- */
+ * and exit.
+ */
MPI_Barrier(MPI_COMM_WORLD);
/* Display test summary, if requested */
@@ -592,16 +592,16 @@ int main(int argc, char **argv)
{
int temp;
MPI_Allreduce(&nerrors, &temp, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
- nerrors=temp;
+ nerrors=temp;
}
- if (MAINPROCESS){ /* only process 0 reports */
- printf("===================================\n");
- if (nerrors)
- printf("***PHDF5 tests detected %d errors***\n", nerrors);
- else
- printf("PHDF5 tests finished with no errors\n");
- printf("===================================\n");
+ if (MAINPROCESS){ /* only process 0 reports */
+ HDprintf("===================================\n");
+ if (nerrors)
+ HDprintf("***PHDF5 tests detected %d errors***\n", nerrors);
+ else
+ HDprintf("PHDF5 tests finished with no errors\n");
+ HDprintf("===================================\n");
}
/* close HDF5 library */
diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h
index 4409221..cf611b7 100644
--- a/testpar/testphdf5.h
+++ b/testpar/testphdf5.h
@@ -19,7 +19,7 @@
#include "testpar.h"
enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD,
- API_MULTI_HARD,API_LINK_TRUE,API_LINK_FALSE,
+ API_MULTI_HARD,API_LINK_TRUE,API_LINK_FALSE,
API_MULTI_COLL,API_MULTI_IND};
#ifndef FALSE
@@ -32,20 +32,20 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD,
/* Constants definitions */
-#define DIM0 600 /* Default dataset sizes. */
-#define DIM1 1200 /* Values are from a monitor pixel sizes */
-#define ROW_FACTOR 8 /* Nominal row factor for dataset size */
-#define COL_FACTOR 16 /* Nominal column factor for dataset size */
-#define RANK 2
-#define DATASETNAME1 "Data1"
-#define DATASETNAME2 "Data2"
-#define DATASETNAME3 "Data3"
-#define DATASETNAME4 "Data4"
-#define DATASETNAME5 "Data5"
-#define DATASETNAME6 "Data6"
-#define DATASETNAME7 "Data7"
-#define DATASETNAME8 "Data8"
-#define DATASETNAME9 "Data9"
+#define DIM0 600 /* Default dataset sizes. */
+#define DIM1 1200 /* Values are from a monitor pixel sizes */
+#define ROW_FACTOR 8 /* Nominal row factor for dataset size */
+#define COL_FACTOR 16 /* Nominal column factor for dataset size */
+#define RANK 2
+#define DATASETNAME1 "Data1"
+#define DATASETNAME2 "Data2"
+#define DATASETNAME3 "Data3"
+#define DATASETNAME4 "Data4"
+#define DATASETNAME5 "Data5"
+#define DATASETNAME6 "Data6"
+#define DATASETNAME7 "Data7"
+#define DATASETNAME8 "Data8"
+#define DATASETNAME9 "Data9"
/* point selection order */
#define IN_ORDER 1
@@ -179,14 +179,14 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD,
/* Definitions of the selection mode for the no_collective_cause_tests function. */
#define TEST_COLLECTIVE 0x001
-#define TEST_SET_INDEPENDENT 0x002
+#define TEST_SET_INDEPENDENT 0x002
#define TEST_DATATYPE_CONVERSION 0x004
#define TEST_DATA_TRANSFORMS 0x008
#define TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES 0x010
#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT 0x020
#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL 0x040
#define TEST_FILTERS 0x080
-/* TEST_FILTERS will take place of this after supporting mpio + filter for
+/* TEST_FILTERS will take place of this after supporting mpio + filter for
* H5Dcreate and H5Dwrite */
#define TEST_FILTERS_READ 0x100
@@ -209,8 +209,8 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD,
/* type definitions */
typedef struct H5Ptest_param_t /* holds extra test parameters */
{
- char *name;
- int count;
+ char *name;
+ int count;
} H5Ptest_param_t;
/* Dataset data type. Int's can be easily octo dumped. */
@@ -218,19 +218,19 @@ typedef int DATATYPE;
/* Shape Same Tests Definitions */
typedef enum {
- IND_CONTIG, /* Independent IO on contigous datasets */
- COL_CONTIG, /* Collective IO on contigous datasets */
- IND_CHUNKED, /* Independent IO on chunked datasets */
- COL_CHUNKED /* Collective IO on chunked datasets */
+ IND_CONTIG, /* Independent IO on contigous datasets */
+ COL_CONTIG, /* Collective IO on contigous datasets */
+ IND_CHUNKED, /* Independent IO on chunked datasets */
+ COL_CHUNKED /* Collective IO on chunked datasets */
} ShapeSameTestMethods;
/* Shared global variables */
-extern int dim0, dim1; /*Dataset dimensions */
-extern int chunkdim0, chunkdim1; /*Chunk dimensions */
-extern int nerrors; /*errors count */
-extern H5E_auto2_t old_func; /* previous error handler */
-extern void *old_client_data; /*previous error handler arg.*/
-extern int facc_type; /*Test file access type */
+extern int dim0, dim1; /*Dataset dimensions */
+extern int chunkdim0, chunkdim1; /*Chunk dimensions */
+extern int nerrors; /*errors count */
+extern H5E_auto2_t old_func; /* previous error handler */
+extern void *old_client_data; /*previous error handler arg.*/
+extern int facc_type; /*Test file access type */
extern int dxfer_coll_type;
/* Test program prototypes */
@@ -240,6 +240,7 @@ void test_file_properties(void);
void multiple_dset_write(void);
void multiple_group_write(void);
void multiple_group_read(void);
+void collective_group_write_independent_group_read(void);
void collective_group_write(void);
void independent_group_read(void);
void test_fapl_mpio_dup(void);
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 400039e..aa09aa6 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -9,4 +9,11 @@ add_subdirectory (src)
#-- Add the tests
if (BUILD_TESTING)
add_subdirectory (test)
+
+# --------------------------------------------------------------------
+# If S3 or HDFS enabled, then we need to test the tools library
+# --------------------------------------------------------------------
+ if (HDF5_ENABLE_ROS3_VFD OR HDF5_ENABLE_HDFS)
+ add_subdirectory (libtest)
+ endif ()
endif ()
diff --git a/tools/Makefile.am b/tools/Makefile.am
index b0c33ed..4a59121 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -19,9 +19,15 @@
include $(top_srcdir)/config/commence.am
+if BUILD_TESTS_CONDITIONAL
+ TESTSERIAL_DIR =test
+else
+ TESTSERIAL_DIR=
+endif
+
CONFIG=ordered
# All subdirectories
-SUBDIRS=lib src test
+SUBDIRS=lib src $(TESTSERIAL_DIR)
include $(top_srcdir)/config/conclude.am
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 66fb113..2aa3c39 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -384,7 +384,7 @@ am__set_b = \
*) \
b='$*';; \
esac
-DIST_SUBDIRS = $(SUBDIRS)
+DIST_SUBDIRS = lib src test
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/bin/test-driver \
$(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am COPYING
@@ -485,7 +485,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -508,9 +507,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -537,6 +539,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -591,6 +594,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -615,7 +619,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -732,10 +735,12 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
+@BUILD_TESTS_CONDITIONAL_FALSE@TESTSERIAL_DIR =
+@BUILD_TESTS_CONDITIONAL_TRUE@TESTSERIAL_DIR = test
CONFIG = ordered
# All subdirectories
-SUBDIRS = lib src test
+SUBDIRS = lib src $(TESTSERIAL_DIR)
# Automake needs to be taught how to build lib, progs and tests targets.
# These will be filled in automatically for the most part (e.g.,
@@ -1268,7 +1273,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt
index 1596ea7..75ed627 100644
--- a/tools/lib/CMakeLists.txt
+++ b/tools/lib/CMakeLists.txt
@@ -32,25 +32,27 @@ set (H5_TOOLS_LIB_HDRS
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.h
)
-add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS})
-target_include_directories(${HDF5_TOOLS_LIB_TARGET}
- PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-#target_compile_definitions(${HDF5_TOOLS_LIB_TARGET} PRIVATE H5DIFF_DEBUG>)
-TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC)
-target_link_libraries (${HDF5_TOOLS_LIB_TARGET}
- PUBLIC ${HDF5_LIB_TARGET}
- PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
-)
-set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}")
-H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} STATIC 0)
-set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools)
-set (install_targets ${HDF5_TOOLS_LIB_TARGET})
+if (NOT ONLY_SHARED_LIBS)
+ add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS})
+ target_include_directories (${HDF5_TOOLS_LIB_TARGET}
+ PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ #target_compile_definitions(${HDF5_TOOLS_LIB_TARGET} PRIVATE H5DIFF_DEBUG>)
+ TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC)
+ target_link_libraries (${HDF5_TOOLS_LIB_TARGET}
+ PUBLIC ${HDF5_LIB_TARGET}
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
+ )
+ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}")
+ H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} STATIC 0)
+ set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools)
+ set (install_targets ${HDF5_TOOLS_LIB_TARGET})
+endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS})
- target_include_directories(${HDF5_TOOLS_LIBSH_TARGET}
+ target_include_directories (${HDF5_TOOLS_LIBSH_TARGET}
PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
@@ -82,7 +84,9 @@ if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries)
endif ()
- INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries)
+ if (NOT ONLY_SHARED_LIBS)
+ INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} toolslibraries)
+ endif ()
install (
TARGETS
diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in
index 2cf2778..70cf495 100644
--- a/tools/lib/Makefile.in
+++ b/tools/lib/Makefile.in
@@ -482,7 +482,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -505,9 +504,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -534,6 +536,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -588,6 +591,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -612,7 +616,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1276,7 +1279,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 594bf51..c2153e5 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -119,7 +119,7 @@ print_incoming_data(void)
HDmemset(data, 0, PRINT_DATA_MAX_SIZE+1);
MPI_Recv(data, PRINT_DATA_MAX_SIZE, MPI_CHAR, Status.MPI_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &Status);
- printf("%s", data);
+ HDprintf("%s", data);
}
} while(incomingMessage);
}
@@ -1119,7 +1119,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
/*Set up args to pass to worker task. */
if(HDstrlen(obj1_fullpath) > 255 ||
HDstrlen(obj2_fullpath) > 255) {
- printf("The parallel diff only supports object names up to 255 characters\n");
+ HDprintf("The parallel diff only supports object names up to 255 characters\n");
MPI_Abort(MPI_COMM_WORLD, 0);
} /* end if */
@@ -1247,7 +1247,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD);
} /* end else-if */
else {
- printf("ERROR: Invalid tag (%d) received \n", Status.MPI_TAG);
+ HDprintf("ERROR: Invalid tag (%d) received \n", Status.MPI_TAG);
MPI_Abort(MPI_COMM_WORLD, 0);
MPI_Finalize();
} /* end else */
@@ -1324,10 +1324,10 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
MPI_Recv(data, PRINT_DATA_MAX_SIZE, MPI_CHAR, Status.MPI_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &Status);
- printf("%s", data);
+ HDprintf("%s", data);
} /* end else-if */
else {
- printf("ph5diff-manager: ERROR!! Invalid tag (%d) received \n", Status.MPI_TAG);
+ HDprintf("ph5diff-manager: ERROR!! Invalid tag (%d) received \n", Status.MPI_TAG);
MPI_Abort(MPI_COMM_WORLD, 0);
} /* end else */
} /* end while */
@@ -1344,7 +1344,6 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
}
#endif /* H5_HAVE_PARALLEL */
-out:
opts->err_stat = opts->err_stat | ret_value;
/* free table */
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 9d5f062..2a45913 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -516,14 +516,14 @@ static hsize_t diff_datum(
if (H5Tis_variable_str(m_type)) {
h5difftrace("diff_datum H5T_STRING variable\n");
/* Get pointer to first string */
- s1 = *(char**) mem1;
+ s1 = *(char **)((void *)mem1);
if (s1)
size1 = HDstrlen(s1);
else
size1 = 0;
/* Get pointer to second string */
- s2 = *(char**) mem2;
+ s2 = *(char **)((void *)mem2);
if (s2)
size2 = HDstrlen(s2);
else
@@ -783,12 +783,11 @@ static hsize_t diff_datum(
}
/* check object type */
- if (ret_value >= 0)
- if (obj1_type != obj2_type) {
- parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2);
- opts->not_cmp = 1;
- HGOTO_DONE (opts->err_stat);
- }
+ if (obj1_type != obj2_type) {
+ parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2);
+ opts->not_cmp = 1;
+ HGOTO_DONE (opts->err_stat);
+ }
if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_OBJECT, _mem1)) < 0) {
opts->err_stat = 1;
@@ -829,10 +828,10 @@ static hsize_t diff_datum(
size = H5Tget_size(memb_type);
/* get the number of sequence elements */
- nelmts = ((hvl_t *) mem1)->len;
+ nelmts = ((hvl_t *)((void *)mem1))->len;
for (j = 0; j < nelmts; j++)
- nfound += diff_datum(((char *) (((hvl_t *) mem1)->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index,
+ nfound += diff_datum(((char *) (((hvl_t *)((void *)mem1))->p)) + j * size, ((char *) (((hvl_t *)((void *)mem2))->p)) + j * size, memb_type, index, /* Extra (void *) cast to quiet "cast to create alignment" warning - 2019/07/05, QAK */
rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members);
H5Tclose(memb_type);
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index d93f7b0..627d4f2 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -1241,10 +1241,10 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
H5T_class_t type_class;
if((size = H5Tget_size(tid)) == 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
if((type_class = H5Tget_class(tid)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_class failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_class failed");
switch (type_class) {
case H5T_INTEGER:
@@ -1264,7 +1264,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
bytes_wrote = HDfwrite(mem, 1, bytes_in, stream);
if(bytes_wrote != bytes_in || (0 == bytes_wrote && HDferror(stream)))
- H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed");
block_index -= (hsize_t)bytes_wrote;
mem = mem + bytes_wrote;
@@ -1283,11 +1283,11 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
mem = ((unsigned char*)_mem) + block_index * size;
if (H5Tis_variable_str(tid)) {
- s = *(char**) mem;
+ s = *(char **)((void *)mem);
if (s != NULL)
size = HDstrlen(s);
else
- H5E_THROW(FAIL, H5E_tools_min_id_g, "NULL string")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "NULL string");
}
else {
s = (char *) mem;
@@ -1295,7 +1295,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) {
HDmemcpy(&tempuchar, &s[i], sizeof(unsigned char));
if (1 != HDfwrite(&tempuchar, sizeof(unsigned char), 1, stream))
- H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed");
} /* i */
} /* for (block_index = 0; block_index < block_nelmts; block_index++) */
}
@@ -1306,7 +1306,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
unsigned nmembs;
if((snmembs = H5Tget_nmembers(tid)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers of compound failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers of compound failed");
nmembs = (unsigned)snmembs;
for (block_index = 0; block_index < block_nelmts; block_index++) {
@@ -1322,7 +1322,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
if (render_bin_output(stream, container, memb, mem + offset, 1) < 0) {
H5Tclose(memb);
- H5E_THROW(FAIL, H5E_tools_min_id_g, "render_bin_output of compound member failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "render_bin_output of compound member failed");
}
H5Tclose(memb);
@@ -1350,7 +1350,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
}
else {
H5Tclose(memb);
- H5E_THROW(FAIL, H5E_tools_min_id_g, "calculate the number of array elements failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "calculate the number of array elements failed");
}
for (block_index = 0; block_index < block_nelmts; block_index++) {
@@ -1358,7 +1358,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
/* dump the array element */
if (render_bin_output(stream, container, memb, mem, nelmts) < 0) {
H5Tclose(memb);
- H5E_THROW(FAIL, H5E_tools_min_id_g, "render_bin_output failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "render_bin_output failed");
}
}
H5Tclose(memb);
@@ -1375,12 +1375,12 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
for (block_index = 0; block_index < block_nelmts; block_index++) {
mem = ((unsigned char*)_mem) + block_index * size;
/* Get the number of sequence elements */
- nelmts = ((hvl_t *) mem)->len;
+ nelmts = ((hvl_t *)((void *)mem))->len;
/* dump the array element */
- if (render_bin_output(stream, container, memb, ((char *) (((hvl_t *) mem)->p)), nelmts) < 0) {
+ if (render_bin_output(stream, container, memb, ((char *) (((hvl_t *)((void *)mem))->p)), nelmts) < 0) {
H5Tclose(memb);
- H5E_THROW(FAIL, H5E_tools_min_id_g, "render_bin_output failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "render_bin_output failed");
}
}
H5Tclose(memb);
@@ -1426,7 +1426,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
for (block_index = 0; block_index < block_nelmts; block_index++) {
mem = ((unsigned char*)_mem) + block_index * size;
if (size != HDfwrite(mem, sizeof(char), size, stream))
- H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed");
} /* end for */
break;
@@ -1434,7 +1434,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
case H5T_NCLASSES:
default:
/* Badness */
- H5E_THROW(FAIL, H5E_tools_min_id_g, "bad type class")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "bad type class");
break;
} /* end switch */
@@ -1562,12 +1562,12 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id,
hid_t type_id = -1;
if((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0)
- H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed")
+ H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed");
nblocks = (hsize_t)snblocks;
/* Print block information */
if((sndims = H5Sget_simple_extent_ndims(region_space)) < 0)
- H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed")
+ H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
ndims = (unsigned)sndims;
alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]);
@@ -1683,12 +1683,12 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id,
hid_t type_id = -1;
if((snpoints = H5Sget_select_elem_npoints(region_space)) <= 0)
- H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_select_elem_npoints failed")
+ H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_select_elem_npoints failed");
npoints = (hsize_t)snpoints;
/* Allocate space for the dimension array */
if((sndims = H5Sget_simple_extent_ndims(region_space)) < 0)
- H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed")
+ H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
ndims = (unsigned)sndims;
if((dtype = H5Dget_type(region_id)) < 0)
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index a8b7e30..eaac94a 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -94,7 +94,7 @@ h5tool_format_t h5tools_dataformat = {
const h5tools_dump_header_t h5tools_standardformat = {
"standardformat", /*name */
-"HDF5", /*fileebgin */
+"HDF5", /*filebegin */
"", /*fileend */
SUPER_BLOCK, /*bootblockbegin */
"", /*bootblockend */
@@ -618,12 +618,12 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
HDassert(buffer);
if((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0)
- H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed")
+ H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed");
nblocks = (hsize_t)snblocks;
/* Print block information */
if((sndims = H5Sget_simple_extent_ndims(region_space)) < 0)
- H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed")
+ H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
ndims = (unsigned)sndims;
/* Render the region { element begin */
@@ -944,12 +944,12 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
HDassert(buffer);
if((snpoints = H5Sget_select_elem_npoints(region_space)) <= 0)
- H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_elem_npoints failed")
+ H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_elem_npoints failed");
npoints = (hsize_t)snpoints;
/* Allocate space for the dimension array */
if((sndims = H5Sget_simple_extent_ndims(region_space)) < 0)
- H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed")
+ H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
ndims = (unsigned)sndims;
/* Render the region { element begin */
@@ -1156,7 +1156,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
unsigned int vl_data = 0; /* contains VL datatypes */
if ((size_t) ctx->ndims > NELMTS(sm_size))
- H5E_THROW(FAIL, H5E_tools_min_id_g, "ndims and sm_size comparision failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "ndims and sm_size comparision failed");
if (ctx->ndims > 0)
init_acc_pos(ctx, total_size);
@@ -1184,10 +1184,10 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
/* calculate the potential number of elements we're going to print */
if(H5Sselect_hyperslab(f_space, H5S_SELECT_SET, temp_start, temp_stride, temp_count, temp_block) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
if((ssm_nelmts = H5Sget_select_npoints(f_space)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_select_npoints failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_select_npoints failed");
sm_nelmts = (hsize_t)ssm_nelmts;
if (sm_nelmts > 0) {
@@ -1196,7 +1196,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
* a hyperslab whose size is manageable.
*/
if((sm_nbytes = p_type_nbytes = H5Tget_size(p_type)) == 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
if (ctx->ndims > 0)
for (i = ctx->ndims; i > 0; --i) {
@@ -1210,17 +1210,17 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
HDassert(sm_nbytes == (hsize_t) ((size_t) sm_nbytes)); /*check for overflow*/
if(NULL == (sm_buf = (unsigned char *)HDmalloc((size_t) sm_nelmts * p_type_nbytes)))
- H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for strip-mine")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for strip-mine");
if((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed");
if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &sm_nelmts, NULL) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
/* read the data */
if(H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dread failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dread failed");
/* print the data */
flags = START_OF_DATA;
@@ -1234,7 +1234,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
/* print array indices. get the lower bound of the hyperslab and calulate
the element position at the start of hyperslab */
if(H5Sget_select_bounds(f_space, low, high) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_select_bounds failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_select_bounds failed");
elmtno = 0;
for (i = 0; i < (size_t) ctx->ndims - 1; i++) {
@@ -1259,13 +1259,13 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
H5Dvlen_reclaim(p_type, sm_space, H5P_DEFAULT, sm_buf);
if(H5Sclose(sm_space) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sclose failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
if(sm_buf)
HDfree(sm_buf);
sm_buf = NULL;
}
else
- H5E_THROW(SUCCEED, H5E_tools_min_id_g, "nothing to print")
+ H5E_THROW(SUCCEED, H5E_tools_min_id_g, "nothing to print");
ctx->continuation++;
@@ -1462,10 +1462,10 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co
hsize_t total_size[H5S_MAX_RANK];/* total size of dataset*/
if((f_space = H5Dget_space(dset)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
if((sndims = H5Sget_simple_extent_ndims(f_space)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
ctx->ndims = (unsigned)sndims;
/* assume entire data space to be printed */
@@ -1474,7 +1474,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co
ctx->p_min_idx[i] = 0;
if(H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
ctx->size_last_dim = total_size[ctx->ndims - 1];
/* Set the compound datatype field list for display */
@@ -1484,7 +1484,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co
CATCH
if(f_space >= 0 && H5Sclose(f_space) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sclose failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
return ret_value;
}
@@ -1540,15 +1540,15 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
f_space = H5Dget_space(dset);
if (f_space == FAIL)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
sndims = H5Sget_simple_extent_ndims(f_space);
if(sndims < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_simple_extent_ndims failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_simple_extent_ndims failed");
ctx->ndims = (unsigned)sndims;
if ((size_t)ctx->ndims > NELMTS(sm_size))
- H5E_THROW(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(sm_size) failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(sm_size) failed");
/* Assume entire data space to be printed */
if (ctx->ndims > 0)
@@ -1629,7 +1629,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
/* Read the data */
if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0) {
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dread failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dread failed");
}
/* Print the data */
@@ -1667,9 +1667,9 @@ CATCH
done:
if(sm_space >= 0 && H5Sclose(sm_space) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sclose failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
if(f_space >= 0 && H5Sclose(f_space) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sclose failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
return ret_value;
}
@@ -1696,11 +1696,11 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte
sndims = H5Sget_simple_extent_ndims(space);
if(sndims < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_simple_extent_ndims failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_simple_extent_ndims failed");
ctx->ndims = (unsigned)sndims;
if ((size_t) ctx->ndims > NELMTS(ctx->p_min_idx))
- H5E_THROW(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(ctx->p_min_idx) failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(ctx->p_min_idx) failed");
/* Assume entire data space to be printed */
for (i = 0; i < ctx->ndims; i++)
@@ -1900,7 +1900,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
const char *order_s = NULL; /* byte order string */
if((type_class = H5Tget_class(type)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_class failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_class failed");
if (object_search && H5Tcommitted(type) > 0) {
H5O_info_t oinfo;
obj_t *obj = NULL; /* Found object */
@@ -2277,18 +2277,26 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
ctx->indent_level++;
{
- char *ttag;
+ char *ttag;
- if(NULL == (ttag = H5Tget_tag(type)))
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_tag failed")
+ if(NULL == (ttag = H5Tget_tag(type)))
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_tag failed");
- ctx->need_prefix = TRUE;
+ ctx->need_prefix = TRUE;
+
+ h5tools_str_reset(buffer);
+ h5tools_str_append(buffer, "OPAQUE_TAG \"%s\";", ttag);
+ h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
- h5tools_str_reset(buffer);
- h5tools_str_append(buffer, "OPAQUE_TAG \"%s\";", ttag);
- h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
+ H5free_memory(ttag);
- H5free_memory(ttag);
+ if((size = H5Tget_size(type)) <= 0) {
+ ctx->need_prefix = TRUE;
+
+ h5tools_str_reset(buffer);
+ h5tools_str_append(buffer, "OPAQUE_SIZE \"%s\";", size);
+ h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
+ }
}
ctx->indent_level--;
@@ -2300,7 +2308,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
case H5T_COMPOUND:
if((snmembers = H5Tget_nmembers(type)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed");
nmembers = (unsigned)snmembers;
h5tools_str_append(buffer, "H5T_COMPOUND %s", h5tools_dump_header_format->structblockbegin);
@@ -2344,7 +2352,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
case H5T_ENUM:
if((super = H5Tget_super(type)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed");
h5tools_str_append(buffer, "H5T_ENUM %s", h5tools_dump_header_format->enumblockbegin);
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
@@ -2374,14 +2382,14 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
case H5T_VLEN:
if((super = H5Tget_super(type)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed");
h5tools_str_append(buffer, "H5T_VLEN %s ", h5tools_dump_header_format->vlenblockbegin);
h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE);
if(H5Tclose(super) < 0)
- HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed")
+ HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
h5tools_str_append(buffer, "%s", h5tools_dump_header_format->vlenblockend);
@@ -2456,10 +2464,10 @@ h5tools_print_dataspace(h5tools_str_t *buffer, hid_t space)
int i;
if((ndims = H5Sget_simple_extent_dims(space, size, maxsize)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
if((space_type = H5Sget_simple_extent_type(space)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_type failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_type failed");
switch(space_type) {
case H5S_SCALAR:
@@ -2544,15 +2552,15 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
ncols = info->line_ncols;
if((snmembs = H5Tget_nmembers(type)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed");
nmembs = (unsigned)snmembs;
HDassert(nmembs > 0);
if((super = H5Tget_super(type)) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed");
if((type_size = H5Tget_size(type)) <= 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size(type) failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size(type) failed");
/*
* Determine what datatype to use for the native values. To simplify
@@ -2565,7 +2573,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
dst_size = sizeof(long long);
if((sign_type = H5Tget_sign(type))<0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_sign failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_sign failed");
if(H5T_SGN_NONE == sign_type)
native = H5T_NATIVE_ULLONG;
else
@@ -2576,20 +2584,20 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
/* Get the names and raw values of all members */
if(NULL == (name = (char **)HDcalloc((size_t)nmembs, sizeof(char *))))
- H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for member name")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for member name");
if(NULL == (value = (unsigned char *)HDcalloc((size_t)nmembs, MAX(type_size, dst_size))))
- H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for member value")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for member value");
for (i = 0; i < nmembs; i++) {
name[i] = H5Tget_member_name(type, i);
if(H5Tget_member_value(type, i, value + i * type_size) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_member_value failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_member_value failed");
}
/* Convert values to native datatype */
if (native > 0)
if(H5Tconvert(super, native, (size_t)nmembs, value, NULL, H5P_DEFAULT) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tconvert failed")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tconvert failed");
/*
* Sort members by increasing value
@@ -2646,7 +2654,7 @@ CATCH
HDfree(value);
if(super >= 0 && H5Tclose(super) < 0)
- H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not close datatype's super class")
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not close datatype's super class");
if(0 == nmembs)
h5tools_str_append(buffer, "\n<empty>");
@@ -3215,7 +3223,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
*-------------------------------------------------------------------------
*/
if (H5D_VIRTUAL != stl) {
- ctx->need_prefix = TRUE;
+ ctx->need_prefix = TRUE;
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s %s", FILTERS, BEGIN);
diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c
index db61d51..cfe7422 100644
--- a/tools/lib/h5tools_filters.c
+++ b/tools/lib/h5tools_filters.c
@@ -20,7 +20,7 @@
*/
static void print_filter_warning(const char *dname, const char *fname)
{
- fprintf(stderr,
+ HDfprintf(stderr,
"Warning: dataset <%s> cannot be read, %s filter is not available\n",
dname, fname);
}
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 3e8f1fe..b597e5a 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -662,51 +662,10 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info,
/*-------------------------------------------------------------------------
* Function: h5tools_str_sprint
*
- * Purpose: Renders the value pointed to by VP of type TYPE into variable
- * length string STR.
- *
- * Return: A pointer to memory containing the result or NULL on error.
- *
- * Programmer: Robb Matzke
- * Thursday, July 23, 1998
- *
- * Modifications:
- * Robb Matzke, 1999-04-26
- * Made this function safe from overflow problems by allowing it
- * to reallocate the output string.
- *
- * Robb Matzke, 1999-06-04
- * Added support for object references. The new `container'
- * argument is the dataset where the reference came from.
- *
- * Robb Matzke, 1999-06-07
- * Added support for printing raw data. If info->raw is non-zero
- * then data is printed in hexadecimal format.
- *
- * Robb Matzke, 2003-01-10
- * Binary output format is dd:dd:... instead of 0xdddd... so it
- * doesn't look like a hexadecimal integer, and thus users will
- * be less likely to complain that HDF5 didn't properly byte
- * swap their data during type conversion.
- *
- * Robb Matzke, LLNL, 2003-06-05
- * If TYPE is a variable length string then the pointer to
- * the value to pring (VP) is a pointer to a `char*'.
- *
- * PVN, 28 March 2006
- * added H5T_NATIVE_LDOUBLE case
- *
- * Vailin Choi; August 2010
- * Modified to handle printing of selected compound fields for h5watch.
- *
- * Raymond Lu, 2011-09-01
- * CLANG compiler complained about the line (about 800):
- * tempint = (tempint >> packed_data_offset) & packed_data_mask;
- * The right shift may cause undefined behavior if PACKED_DATA_OFFSET is
- * 32-bit or more. For every kind of native integers, I changed the code
- * to make it zero if PACKED_DATA_OFFSET is greater than or equal to the
- * size of integer.
+ * Purpose: Renders the value pointed to by VP of type TYPE into variable
+ * length string STR.
*
+ * Return: A pointer to memory containing the result or NULL on error.
*-------------------------------------------------------------------------
*/
char *
@@ -718,8 +677,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
char *name = NULL;
unsigned char *ucp_vp = (unsigned char *)vp;
char *cp_vp = (char *)vp;
- hid_t memb = -1;
- hid_t obj = -1;
+ hid_t memb = H5I_INVALID_HID;
+ hid_t obj = H5I_INVALID_HID;
static char fmt_llong[8], fmt_ullong[8];
H5T_str_t pad;
H5T_class_t type_class;
@@ -787,7 +746,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
if(H5Tis_variable_str(type)) {
/* cp_vp is the pointer into the struct where a `char*' is stored. So we have
* to dereference the pointer to get the `char*' to pass to HDstrlen(). */
- s = *(char**) cp_vp;
+ s = *(char **)((void *)cp_vp);
if(s != NULL) size = HDstrlen(s);
}
else {
@@ -1240,7 +1199,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
h5tools_str_append(str, "%s", OPT(info->vlen_pre, "("));
/* Get the number of sequence elements */
- nelmts = ((hvl_t *) cp_vp)->len;
+ nelmts = ((hvl_t *)((void *)cp_vp))->len;
for(i = 0; i < nelmts; i++) {
if(i) h5tools_str_append(str, "%s", OPT(info->vlen_sep, "," OPTIONAL_LINE_BREAK));
@@ -1264,7 +1223,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
ctx->indent_level++;
/* Dump the array element */
- h5tools_str_sprint(str, info, container, memb, ((char *) (((hvl_t *) cp_vp)->p)) + i * size, ctx);
+ h5tools_str_sprint(str, info, container, memb, ((char *) (((hvl_t *)((void *)cp_vp))->p)) + i * size, ctx);
ctx->indent_level--;
} /* end for */
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index e7e017f..b733106 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -21,6 +21,10 @@
#include "H5private.h"
#include "h5trav.h"
+#ifdef H5_HAVE_ROS3_VFD
+#include "H5FDros3.h"
+#endif
+
/* global variables */
unsigned h5tools_nCols = 80;
/* ``get_option'' variables */
@@ -97,7 +101,7 @@ parallel_print(const char* format, ...)
HDva_end(ap);
}
-
+
/*-------------------------------------------------------------------------
* Function: error_msg
*
@@ -122,7 +126,7 @@ error_msg(const char *fmt, ...)
HDva_end(ap);
}
-
+
/*-------------------------------------------------------------------------
* Function: warn_msg
*
@@ -161,7 +165,7 @@ help_ref_msg(FILE *output)
HDfprintf(output, "see the <%s> entry in the 'HDF5 Reference Manual'.\n",h5tools_getprogname());
}
-
+
/*-------------------------------------------------------------------------
* Function: get_option
*
@@ -322,7 +326,229 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
return opt_opt;
}
-
+
+/*****************************************************************************
+ *
+ * Function: parse_tuple()
+ *
+ * Purpose:
+ *
+ * Create array of pointers to strings, identified as elements in a tuple
+ * of arbitrary length separated by provided character.
+ * ("tuple" because "nple" looks strange)
+ *
+ * * Receives pointer to start of tuple sequence string, '('.
+ * * Attempts to separate elements by token-character `sep`.
+ * * If the separator character is preceded by a backslash '\',
+ * the backslash is deleted and the separator is included in the
+ * element string as any other character.
+ * * To end an element with a backslash, escape the backslash, e.g.
+ * "(myelem\\,otherelem) -> {"myelem\", "otherelem"}
+ * * In all other cases, a backslash appearing not as part of "\\" or
+ * "\<sep>" digraph will be included berbatim.
+ * * Last two characters in the string MUST be ")\0".
+ *
+ * * Generates a copy of the input string `start`, (src..")\0"), replacing
+ * separators and close-paren with null charaters.
+ * * This string is allocated at runtime and should be freed when done.
+ * * Generates array of char pointers, and directs start of each element
+ * (each pointer) into this copy.
+ * * Each tuple element points to the start of its string (substring)
+ * and ends with a null terminator.
+ * * This array is allocated at runtime and should be freed when done.
+ * * Reallocates and expands elements array during parsing.
+ * * Initially allocated for 2 (plus one null entry), and grows by
+ * powers of 2.
+ * * The final 'slot' in the element array (elements[nelements], e.g.)
+ * always points to NULL.
+ * * The number of elements found and stored are passed out through pointer
+ * to unsigned, `nelems`.
+ *
+ * Return:
+ *
+ * FAIL If malformed--does not look like a tuple "(...)"
+ * or major error was encountered while parsing.
+ * or
+ * SUCCEED String looks properly formed "(...)" and no major errors.
+ *
+ * Stores number of elements through pointer `nelems`.
+ * Stores list of pointers to char (first char in each element
+ * string) through pointer `ptrs_out`.
+ * NOTE: `ptrs_out[nelems] == NULL` should be true.
+ * NOTE: list is malloc'd by function, and should be freed
+ * when done.
+ * Stores "source string" for element pointers through `cpy_out`.
+ * NOTE: Each element substring is null-terminated.
+ * NOTE: There may be extra characters after the last element
+ * (past its null terminator), but is guaranteed to
+ * be null-terminated.
+ * NOTE: `cpy_out` string is malloc'd by function,
+ * and should be freed when done.
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-10
+ *
+ * Changes: None.
+ *
+ *****************************************************************************
+ */
+herr_t
+parse_tuple(const char *start,
+ int sep,
+ char **cpy_out,
+ unsigned *nelems,
+ char ***ptrs_out)
+{
+ char *elem_ptr = NULL;
+ char *dest_ptr = NULL;
+ unsigned elems_count = 0;
+ char **elems = NULL; /* more like *elems[], but complier... */
+ char **elems_re = NULL; /* temporary pointer, for realloc */
+ char *cpy = NULL;
+ herr_t ret_value = SUCCEED;
+ unsigned init_slots = 2;
+
+
+
+ /*****************
+ * SANITY-CHECKS *
+ *****************/
+
+ /* must start with "("
+ */
+ if (start[0] != '(') {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ /* must end with ")"
+ */
+ while (start[elems_count] != '\0') {
+ elems_count++;
+ }
+ if (start[elems_count - 1] != ')') {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ elems_count = 0;
+
+
+
+ /***********
+ * PREPARE *
+ ***********/
+
+ /* create list
+ */
+ elems = (char **)HDmalloc(sizeof(char *) * (init_slots + 1));
+ if (elems == NULL) { ret_value = FAIL; goto done; } /* CANTALLOC */
+
+ /* create destination string
+ */
+ start++; /* advance past opening paren '(' */
+ cpy = (char *)HDmalloc(sizeof(char) * (HDstrlen(start))); /* no +1; less '(' */
+ if (cpy == NULL) { ret_value = FAIL; goto done; } /* CANTALLOC */
+
+ /* set pointers
+ */
+ dest_ptr = cpy; /* start writing copy here */
+ elem_ptr = cpy; /* first element starts here */
+ elems[elems_count++] = elem_ptr; /* set first element pointer into list */
+
+
+
+ /*********
+ * PARSE *
+ *********/
+
+ while (*start != '\0') {
+ /* For each character in the source string...
+ */
+ if (*start == '\\') {
+ /* Possibly an escape digraph.
+ */
+ if ((*(start + 1) == '\\') ||
+ (*(start + 1) == sep) )
+ {
+ /* Valid escape digraph of "\\" or "\<sep>".
+ */
+ start++; /* advance past escape char '\' */
+ *(dest_ptr++) = *(start++); /* Copy subsequent char */
+ /* and advance pointers. */
+ } else {
+ /* Not an accepted escape digraph.
+ * Copy backslash character.
+ */
+ *(dest_ptr++) = *(start++);
+ }
+ } else if (*start == sep) {
+ /* Non-escaped separator.
+ * Terminate elements substring in copy, record element, advance.
+ * Expand elements list if appropriate.
+ */
+ *(dest_ptr++) = 0; /* Null-terminate elem substring in copy */
+ /* and advance pointer. */
+ start++; /* Advance src pointer past separator. */
+ elem_ptr = dest_ptr; /* Element pointer points to start of first */
+ /* character after null sep in copy. */
+ elems[elems_count++] = elem_ptr; /* Set elem pointer in list */
+ /* and increment count. */
+
+ /* Expand elements list, if necessary.
+ */
+ if (elems_count == init_slots) {
+ init_slots *= 2;
+ elems_re = (char **)realloc(elems, sizeof(char *) * \
+ (init_slots + 1));
+ if (elems_re == NULL) {
+ /* CANTREALLOC */
+ ret_value = FAIL;
+ goto done;
+ }
+ elems = elems_re;
+ }
+ } else if (*start == ')' && *(start + 1) == '\0') {
+ /* Found terminal, non-escaped close-paren. Last element.
+ * Write null terminator to copy.
+ * Advance source pointer to gently break from loop.
+ * Requred to prevent ")" from always being added to last element.
+ */
+ start++;
+ } else {
+ /* Copy character into destination. Advance pointers.
+ */
+ *(dest_ptr++) = *(start++);
+ }
+ }
+ *dest_ptr = '\0'; /* Null-terminate destination string. */
+ elems[elems_count] = NULL; /* Null-terminate elements list. */
+
+
+
+ /********************
+ * PASS BACK VALUES *
+ ********************/
+
+ *ptrs_out = elems;
+ *nelems = elems_count;
+ *cpy_out = cpy;
+
+done:
+ if (ret_value == FAIL) {
+ /* CLEANUP */
+ if (cpy) free(cpy);
+ if (elems) free(elems);
+ }
+
+ return ret_value;
+
+} /* parse_tuple */
+
+
+
+
+
/*-------------------------------------------------------------------------
* Function: indentation
*
@@ -344,7 +570,7 @@ indentation(unsigned x)
}
}
-
+
/*-------------------------------------------------------------------------
* Function: print_version
*
@@ -362,7 +588,7 @@ print_version(const char *progname)
((const char *)H5_VERS_SUBRELEASE)[0] ? "-" : "", H5_VERS_SUBRELEASE);
}
-
+
/*-------------------------------------------------------------------------
* Function: init_table
*
@@ -384,7 +610,7 @@ init_table(table_t **tbl)
*tbl = table;
}
-
+
/*-------------------------------------------------------------------------
* Function: free_table
*
@@ -408,7 +634,7 @@ free_table(table_t *table)
}
#ifdef H5DUMP_DEBUG
-
+
/*-------------------------------------------------------------------------
* Function: dump_table
*
@@ -429,7 +655,7 @@ dump_table(char* tablename, table_t *table)
table->objs[u].displayed, table->objs[u].recorded);
}
-
+
/*-------------------------------------------------------------------------
* Function: dump_tables
*
@@ -447,7 +673,7 @@ dump_tables(find_objs_t *info)
}
#endif /* H5DUMP_DEBUG */
-
+
/*-------------------------------------------------------------------------
* Function: search_obj
*
@@ -470,7 +696,7 @@ search_obj(table_t *table, haddr_t objno)
return NULL;
}
-
+
/*-------------------------------------------------------------------------
* Function: find_objs_cb
*
@@ -546,7 +772,7 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen
return ret_value;
}
-
+
/*-------------------------------------------------------------------------
* Function: init_objs
*
@@ -591,7 +817,7 @@ done:
return ret_value;
}
-
+
/*-------------------------------------------------------------------------
* Function: add_obj
*
@@ -622,7 +848,7 @@ add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t record)
table->objs[u].displayed = 0;
}
-
+
#ifndef H5_HAVE_TMPFILE
/*-------------------------------------------------------------------------
* Function: tmpfile
@@ -841,3 +1067,260 @@ done:
return ret_value;
}
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: h5tools_populate_ros3_fapl()
+ *
+ * Purpose:
+ *
+ * Set the values of a ROS3 fapl configuration object.
+ *
+ * If the values pointer is NULL, sets fapl target `fa` to a default
+ * (valid, current-version, non-authenticating) fapl config.
+ *
+ * If `values` pointer is _not_ NULL, expects `values` to contain at least
+ * three non-null pointers to null-terminated strings, corresponding to:
+ * { aws_region,
+ * secret_id,
+ * secret_key,
+ * }
+ * If all three strings are empty (""), the default fapl will be default.
+ * Both aws_region and secret_id values must be both empty or both
+ * populated. If
+ * Only secret_key is allowed to be empty (the empty string, "").
+ * All values are checked against overflow as defined in the ros3 vfd
+ * header file; if a value overruns the permitted space, FAIL is returned
+ * and the function aborts without resetting the fapl to values initially
+ * present.
+ *
+ * Return:
+ *
+ * 0 (failure) if...
+ * * Read-Only S3 VFD is not enabled.
+ * * NULL fapl pointer: (NULL, {...} )
+ * * Warning: In all cases below, fapl will be set as "default"
+ * before error occurs.
+ * * NULL value strings: (&fa, {NULL?, NULL? NULL?, ...})
+ * * Incomplete fapl info:
+ * * empty region, non-empty id, key either way
+ * * (&fa, {"", "...", "?"})
+ * * empty id, non-empty region, key either way
+ * * (&fa, {"...", "", "?"})
+ * * "non-empty key and either id or region empty
+ * * (&fa, {"", "", "...")
+ * * (&fa, {"", "...", "...")
+ * * (&fa, {"...", "", "...")
+ * * Any string would overflow allowed space in fapl definition.
+ * or
+ * 1 (success)
+ * * Sets components in fapl_t pointer, copying strings as appropriate.
+ * * "Default" fapl (valid version, authenticate->False, empty strings)
+ * * `values` pointer is NULL
+ * * (&fa, NULL)
+ * * first three strings in `values` are empty ("")
+ * * (&fa, {"", "", "", ...}
+ * * Authenticating fapl
+ * * region, id, and optional key provided
+ * * (&fa, {"...", "...", ""})
+ * * (&fa, {"...", "...", "..."})
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-13
+ *
+ *----------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_ROS3_VFD
+int
+h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa,
+ const char **values)
+{
+ int show_progress = 0; /* set to 1 for debugging */
+ int ret_value = 1; /* 1 for success, 0 for failure */
+ /* e.g.? if (!populate()) { then failed } */
+
+ if (show_progress) {
+ HDprintf("called h5tools_populate_ros3_fapl\n");
+ }
+
+ if (fa == NULL) {
+ if (show_progress) {
+ HDprintf(" ERROR: null pointer to fapl_t\n");
+ }
+ ret_value = 0;
+ goto done;
+ }
+
+ if (show_progress) {
+ HDprintf(" preset fapl with default values\n");
+ }
+ fa->version = H5FD_CURR_ROS3_FAPL_T_VERSION;
+ fa->authenticate = FALSE;
+ *(fa->aws_region) = '\0';
+ *(fa->secret_id) = '\0';
+ *(fa->secret_key) = '\0';
+
+ /* sanity-check supplied values
+ */
+ if (values != NULL) {
+ if (values[0] == NULL) {
+ if (show_progress) {
+ HDprintf(" ERROR: aws_region value cannot be NULL\n");
+ }
+ ret_value = 0;
+ goto done;
+ }
+ if (values[1] == NULL) {
+ if (show_progress) {
+ HDprintf(" ERROR: secret_id value cannot be NULL\n");
+ }
+ ret_value = 0;
+ goto done;
+ }
+ if (values[2] == NULL) {
+ if (show_progress) {
+ HDprintf(" ERROR: secret_key value cannot be NULL\n");
+ }
+ ret_value = 0;
+ goto done;
+ }
+
+ /* if region and ID are supplied (key optional), write to fapl...
+ * fail if value would overflow
+ */
+ if (*values[0] != '\0' &&
+ *values[1] != '\0')
+ {
+ if (HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN) {
+ if (show_progress) {
+ HDprintf(" ERROR: aws_region value too long\n");
+ }
+ ret_value = 0;
+ goto done;
+ }
+ HDmemcpy(fa->aws_region, values[0],
+ (HDstrlen(values[0]) + 1));
+ if (show_progress) {
+ HDprintf(" aws_region set\n");
+ }
+
+
+ if (HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN) {
+ if (show_progress) {
+ HDprintf(" ERROR: secret_id value too long\n");
+ }
+ ret_value = 0;
+ goto done;
+ }
+ HDmemcpy(fa->secret_id,
+ values[1],
+ (HDstrlen(values[1]) + 1));
+ if (show_progress) {
+ HDprintf(" secret_id set\n");
+ }
+
+ if (HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN) {
+ if (show_progress) {
+ HDprintf(" ERROR: secret_key value too long\n");
+ }
+ ret_value = 0;
+ goto done;
+ }
+ HDmemcpy(fa->secret_key,
+ values[2],
+ (HDstrlen(values[2]) + 1));
+ if (show_progress) {
+ HDprintf(" secret_key set\n");
+ }
+
+ fa->authenticate = TRUE;
+ if (show_progress) {
+ HDprintf(" set to authenticate\n");
+ }
+
+ } else if (*values[0] != '\0' ||
+ *values[1] != '\0' ||
+ *values[2] != '\0')
+ {
+ if (show_progress) {
+ HDprintf(
+ " ERROR: invalid assortment of empty/non-empty values\n"
+ );
+ }
+ ret_value = 0;
+ goto done;
+ }
+ } /* values != NULL */
+
+done:
+ return ret_value;
+
+} /* h5tools_populate_ros3_fapl */
+#endif /* H5_HAVE_ROS3_VFD */
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * Function: h5tools_set_configured_fapl
+ *
+ * Purpose: prepare fapl_id with the given property list, according to
+ * VFD prototype.
+ *
+ * Return: 0 on failure, 1 on success
+ *
+ * Programmer: Jacob Smith
+ * 2018-05-21
+ *
+ * Changes: None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+int
+h5tools_set_configured_fapl(hid_t fapl_id,
+ const char vfd_name[],
+ void *fapl_t_ptr)
+{
+ int ret_value = 1;
+
+ if (fapl_id < 0) {
+ return 0;
+ }
+
+ if (!strcmp("", vfd_name)) {
+ goto done;
+
+#ifdef H5_HAVE_ROS3_VFD
+ } else if (!strcmp("ros3", vfd_name)) {
+ if ((fapl_id == H5P_DEFAULT) ||
+ (fapl_t_ptr == NULL) ||
+ (FAIL == H5Pset_fapl_ros3(
+ fapl_id,
+ (H5FD_ros3_fapl_t *)fapl_t_ptr)))
+ {
+ ret_value = 0;
+ goto done;
+ }
+#endif /* H5_HAVE_ROS3_VFD */
+
+#ifdef H5_HAVE_LIBHDFS
+ } else if (!strcmp("hdfs", vfd_name)) {
+ if ((fapl_id == H5P_DEFAULT) ||
+ (fapl_t_ptr == NULL) ||
+ (FAIL == H5Pset_fapl_hdfs(
+ fapl_id,
+ (H5FD_hdfs_fapl_t *)fapl_t_ptr)))
+ {
+ ret_value = 0;
+ goto done;
+ }
+#endif /* H5_HAVE_LIBHDFS */
+
+ } else {
+ ret_value = 0; /* unrecognized fapl type "name" */
+ }
+
+done:
+ return ret_value;
+
+} /* h5tools_set_configured_fapl() */
+
diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h
index 4c2bf1e..0fa5250 100644
--- a/tools/lib/h5tools_utils.h
+++ b/tools/lib/h5tools_utils.h
@@ -123,6 +123,11 @@ H5TOOLS_DLLVAR unsigned h5tools_nCols; /*max number of columns for
H5TOOLS_DLL void indentation(unsigned);
H5TOOLS_DLL void print_version(const char *progname);
H5TOOLS_DLL void parallel_print(const char* format, ... );
+H5TOOLS_DLL herr_t parse_tuple(const char *start,
+ int sep,
+ char **cpy_out,
+ unsigned *nelems,
+ char ***ptrs_out);
H5TOOLS_DLL void error_msg(const char *fmt, ...);
H5TOOLS_DLL void warn_msg(const char *fmt, ...);
H5TOOLS_DLL void help_ref_msg(FILE *output);
@@ -174,6 +179,14 @@ H5TOOLS_DLL void h5tools_setprogname(const char*progname);
H5TOOLS_DLL int h5tools_getstatus(void);
H5TOOLS_DLL void h5tools_setstatus(int d_status);
H5TOOLS_DLL int h5tools_getenv_update_hyperslab_bufsize(void);
+H5TOOLS_DLL int h5tools_set_configured_fapl(hid_t fapl_id,
+ const char vfd_name[],
+ void *fapl_t_ptr);
+#ifdef H5_HAVE_ROS3_VFD
+H5TOOLS_DLL int h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa,
+ const char **values);
+#endif /* H5_HAVE_ROS3_VFD */
+
#ifdef __cplusplus
}
#endif
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index 917d5f5..19911dc 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -184,7 +184,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo,
if(udata->is_absolute) {
size_t base_len = HDstrlen(udata->base_grp_name);
size_t add_slash = base_len ? ((udata->base_grp_name)[base_len - 1] != '/') : 1;
- size_t new_name_len = base_len + add_slash + HDstrlen(path) + 1;
+ size_t new_name_len = base_len + add_slash + HDstrlen(path) + 1 + 3; /* Extra "+3" to quiet GCC warning - 2019/07/05, QAK */
if(NULL == (new_name = (char*)HDmalloc(new_name_len)))
return(H5_ITER_ERROR);
@@ -823,14 +823,14 @@ trav_attr(hid_t
const char *buf = op_data->path;
if((strlen(buf)==1) && (*buf=='/'))
- printf(" %-10s %s%s", "attribute", buf, attr_name);
+ HDprintf(" %-10s %s%s", "attribute", buf, attr_name);
else
- printf(" %-10s %s/%s", "attribute", buf, attr_name);
+ HDprintf(" %-10s %s/%s", "attribute", buf, attr_name);
#ifdef H5TRAV_PRINT_SPACE
if(trav_verbosity < 2) {
#endif
- printf("\n");
+ HDprintf("\n");
#ifdef H5TRAV_PRINT_SPACE
}
else {
@@ -850,26 +850,26 @@ trav_attr(hid_t
switch(space_type) {
case H5S_SCALAR:
/* scalar dataspace */
- printf(" scalar\n");
+ HDprintf(" scalar\n");
break;
case H5S_SIMPLE:
/* simple dataspace */
- printf(" {");
+ HDprintf(" {");
for (i = 0; i < ndims; i++) {
- printf("%s" HSIZE_T_FORMAT, i?", ":"", size[i]);
+ HDprintf("%s" HSIZE_T_FORMAT, i?", ":"", size[i]);
}
- printf("}\n");
+ HDprintf("}\n");
break;
case H5S_NULL:
/* null dataspace */
- printf(" null\n");
+ HDprintf(" null\n");
break;
default:
/* Unknown dataspace type */
- printf(" unknown\n");
+ HDprintf(" unknown\n");
break;
} /* end switch */
@@ -903,21 +903,21 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo,
*/
switch(oinfo->type) {
case H5O_TYPE_GROUP:
- printf(" %-10s %s", "group", path);
+ HDprintf(" %-10s %s", "group", path);
break;
case H5O_TYPE_DATASET:
- printf(" %-10s %s", "dataset", path);
+ HDprintf(" %-10s %s", "dataset", path);
break;
case H5O_TYPE_NAMED_DATATYPE:
- printf(" %-10s %s", "datatype", path);
+ HDprintf(" %-10s %s", "datatype", path);
break;
case H5O_TYPE_UNKNOWN:
case H5O_TYPE_NTYPES:
default:
- printf(" %-10s %s", "unknown object type", path);
+ HDprintf(" %-10s %s", "unknown object type", path);
break;
} /* end switch */
@@ -927,14 +927,14 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo,
op_data.path = path;
/* Finish printing line about object */
- printf("\n");
+ HDprintf("\n");
if(trav_verbosity > 0)
H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order,
NULL, trav_attr, &op_data, H5P_DEFAULT);
}
else
/* Print the link's original name */
- printf(" -> %s\n", already_visited);
+ HDprintf(" -> %s\n", already_visited);
return(0);
} /* end trav_print_visit_obj() */
@@ -962,12 +962,12 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
if(targbuf) {
if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0)
targbuf[0] = 0;
- printf(" %-10s %s -> %s\n", "link", path, targbuf);
+ HDprintf(" %-10s %s -> %s\n", "link", path, targbuf);
HDfree(targbuf);
}
} /* end if */
else
- printf(" %-10s %s ->\n", "link", path);
+ HDprintf(" %-10s %s ->\n", "link", path);
break;
case H5L_TYPE_EXTERNAL:
@@ -981,12 +981,12 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0)
targbuf[0] = 0;
if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname) >= 0)
- printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname);
+ HDprintf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname);
HDfree(targbuf);
}
} /* end if */
else
- printf(" %-10s %s ->\n", "ext link", path);
+ HDprintf(" %-10s %s ->\n", "ext link", path);
break;
case H5L_TYPE_HARD:
@@ -996,7 +996,7 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
case H5L_TYPE_ERROR:
case H5L_TYPE_MAX:
default:
- printf(" %-10s %s -> ???\n", "unknown type of UD link", path);
+ HDprintf(" %-10s %s -> ???\n", "unknown type of UD link", path);
break;
} /* end switch() */
diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c
index a6885df..ae299fa 100644
--- a/tools/lib/io_timer.c
+++ b/tools/lib/io_timer.c
@@ -133,7 +133,7 @@ io_time_t *
set_time(io_time_t *pt, timer_type t, int start_stop)
{
/* sanity check */
- assert(pt);
+ HDassert(pt);
switch(pt->type){
#ifdef H5_HAVE_PARALLEL
@@ -216,6 +216,9 @@ set_time(io_time_t *pt, timer_type t, int start_stop)
H5_ATTR_PURE double
get_time(io_time_t *pt, timer_type t)
{
+ /* sanity check */
+ HDassert(pt);
+
return pt->total_time[t];
}
diff --git a/tools/libtest/CMakeLists.txt b/tools/libtest/CMakeLists.txt
new file mode 100644
index 0000000..f3d28da
--- /dev/null
+++ b/tools/libtest/CMakeLists.txt
@@ -0,0 +1,18 @@
+cmake_minimum_required (VERSION 3.10)
+project (HDF5_TOOLS_LIBTEST C)
+
+#-----------------------------------------------------------------------------
+# Add the h5tools_utils test executables
+#-----------------------------------------------------------------------------
+add_executable (h5tools_test_utils ${HDF5_TOOLS_LIBTEST_SOURCE_DIR}/h5tools_test_utils.c)
+target_include_directories(h5tools_test_utils PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5tools_test_utils STATIC)
+ target_link_libraries (h5tools_test_utils PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5tools_test_utils SHARED)
+ target_link_libraries (h5tools_test_utils PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
+endif ()
+set_target_properties (h5tools_test_utils PROPERTIES FOLDER tools)
+
+include (CMakeTests.cmake)
diff --git a/tools/libtest/CMakeTests.cmake b/tools/libtest/CMakeTests.cmake
new file mode 100644
index 0000000..4feee9b
--- /dev/null
+++ b/tools/libtest/CMakeTests.cmake
@@ -0,0 +1,49 @@
+#
+# Copyright by The HDF Group.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+
+##############################################################################
+##############################################################################
+### T E S T I N G ###
+##############################################################################
+##############################################################################
+
+
+##############################################################################
+##############################################################################
+### T H E T E S T S M A C R O S ###
+##############################################################################
+##############################################################################
+
+ macro (ADD_H5_TEST resultfile resultcode)
+ add_test (
+ NAME H5LIBTEST-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${resultfile}.out
+ ${resultfile}.out.err
+ )
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (H5LIBTEST-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
+ endif ()
+ add_test (NAME H5LIBTEST-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5tools_test_utils> ${ARGN})
+ if (NOT "${resultcode}" STREQUAL "0")
+ set_tests_properties (H5LIBTEST-${resultfile} PROPERTIES WILL_FAIL "true")
+ endif ()
+ set_tests_properties (H5LIBTEST-${resultfile} PROPERTIES DEPENDS H5LIBTEST-${resultfile}-clear-objects)
+ endmacro ()
+
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
+ ADD_H5_TEST (h5tools_utils-default 0)
diff --git a/tools/libtest/Makefile.am b/tools/libtest/Makefile.am
new file mode 100644
index 0000000..a93e25d
--- /dev/null
+++ b/tools/libtest/Makefile.am
@@ -0,0 +1,34 @@
+#
+# Read-Only S3 Virtual File Driver (VFD)
+# Copyright (c) 2017-2018, The HDF Group.
+#
+# All rights reserved.
+#
+# NOTICE:
+# All information contained herein is, and remains, the property of The HDF
+# Group. The intellectual and technical concepts contained herein are
+# proprietary to The HDF Group. Dissemination of this information or
+# reproduction of this material is strictly forbidden unless prior written
+# permission is obtained from The HDF Group.
+##
+## Makefile.am
+## Run automake to generate a Makefile.in from this file.
+#
+# HDF5 Library Makefile(.in)
+#
+
+include $(top_srcdir)/config/commence.am
+
+# Include src and tools/lib directories
+AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib
+
+# All programs depend on the hdf5 and h5tools libraries
+LDADD=$(LIBH5TOOLS) $(LIBHDF5)
+
+
+# main target
+bin_PROGRAMS=h5tools_test_utils
+# check_PROGRAMS=$(TEST_PROG)
+
+
+include $(top_srcdir)/config/conclude.am
diff --git a/tools/libtest/Makefile.in b/tools/libtest/Makefile.in
new file mode 100644
index 0000000..8ac69a6
--- /dev/null
+++ b/tools/libtest/Makefile.in
@@ -0,0 +1,1486 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+# Read-Only S3 Virtual File Driver (VFD)
+# Copyright (c) 2017-2018, The HDF Group.
+#
+# All rights reserved.
+#
+# NOTICE:
+# All information contained herein is, and remains, the property of The HDF
+# Group. The intellectual and technical concepts contained herein are
+# proprietary to The HDF Group. Dissemination of this information or
+# reproduction of this material is strictly forbidden unless prior written
+# permission is obtained from The HDF Group.
+#
+# HDF5 Library Makefile(.in)
+#
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = h5tools_test_utils$(EXEEXT)
+TESTS =
+subdir = tools/libtest
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \
+ $(top_srcdir)/m4/aclocal_fc.m4 \
+ $(top_srcdir)/m4/ax_check_class.m4 \
+ $(top_srcdir)/m4/ax_check_classpath.m4 \
+ $(top_srcdir)/m4/ax_check_java_home.m4 \
+ $(top_srcdir)/m4/ax_check_junit.m4 \
+ $(top_srcdir)/m4/ax_java_options.m4 \
+ $(top_srcdir)/m4/ax_jni_include_dir.m4 \
+ $(top_srcdir)/m4/ax_prog_jar.m4 \
+ $(top_srcdir)/m4/ax_prog_java.m4 \
+ $(top_srcdir)/m4/ax_prog_java_works.m4 \
+ $(top_srcdir)/m4/ax_prog_javac.m4 \
+ $(top_srcdir)/m4/ax_prog_javac_works.m4 \
+ $(top_srcdir)/m4/ax_prog_javadoc.m4 \
+ $(top_srcdir)/m4/ax_try_compile_java.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/H5config.h \
+ $(top_builddir)/fortran/src/H5config_f.inc
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+h5tools_test_utils_SOURCES = h5tools_test_utils.c
+h5tools_test_utils_OBJECTS = h5tools_test_utils.$(OBJEXT)
+h5tools_test_utils_LDADD = $(LDADD)
+h5tools_test_utils_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src
+depcomp = $(SHELL) $(top_srcdir)/bin/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = h5tools_test_utils.c
+DIST_SOURCES = h5tools_test_utils.c
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.sh.log=.log)
+SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver
+SH_LOG_COMPILE = $(SH_LOG_COMPILER) $(AM_SH_LOG_FLAGS) $(SH_LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/bin/depcomp \
+ $(top_srcdir)/bin/test-driver $(top_srcdir)/config/commence.am \
+ $(top_srcdir)/config/conclude.am
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
+AMTAR = @AMTAR@
+
+# H5_CFLAGS holds flags that should be used when building hdf5,
+# but which should not be exported to h5cc for building other programs.
+# AM_CFLAGS is an automake construct which should be used by Makefiles
+# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
+# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
+AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
+
+# Include src and tools/lib directories
+AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \
+ -I$(top_srcdir)/tools/lib
+AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
+AM_JAVACFLAGS = @AM_JAVACFLAGS@
+AM_JAVAFLAGS = @AM_JAVAFLAGS@
+AM_JNIFLAGS = @AM_JNIFLAGS@
+AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@
+AR = @AR@
+AR_FLAGS = @AR_FLAGS@
+ASSERTS = @ASSERTS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_MODE = @BUILD_MODE@
+BYTESEX = @BYTESEX@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CC_VERSION = @CC_VERSION@
+CFLAGS = @CFLAGS@
+CODESTACK = @CODESTACK@
+CONFIG_DATE = @CONFIG_DATE@
+CONFIG_MODE = @CONFIG_MODE@
+CONFIG_USER = @CONFIG_USER@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CXX_VERSION = @CXX_VERSION@
+CYGPATH_W = @CYGPATH_W@
+DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
+DEV_WARNINGS = @DEV_WARNINGS@
+DIRECT_VFD = @DIRECT_VFD@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTERNAL_FILTERS = @EXTERNAL_FILTERS@
+
+# Make sure that these variables are exported to the Makefiles
+F9XMODEXT = @F9XMODEXT@
+F9XMODFLAG = @F9XMODFLAG@
+F9XSUFFIXFLAG = @F9XSUFFIXFLAG@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_f90 = @FCFLAGS_f90@
+FCLIBS = @FCLIBS@
+FC_VERSION = @FC_VERSION@
+FGREP = @FGREP@
+FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
+FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
+FSEARCH_DIRS = @FSEARCH_DIRS@
+Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
+GREP = @GREP@
+H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@
+H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@
+H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@
+H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@
+H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@
+H5_CFLAGS = @H5_CFLAGS@
+H5_CLASSPATH = @H5_CLASSPATH@
+H5_CPPFLAGS = @H5_CPPFLAGS@
+H5_CXXFLAGS = @H5_CXXFLAGS@
+H5_FCFLAGS = @H5_FCFLAGS@
+H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
+H5_JAVACFLAGS = @H5_JAVACFLAGS@
+H5_JAVAFLAGS = @H5_JAVAFLAGS@
+H5_JNIFLAGS = @H5_JNIFLAGS@
+H5_LDFLAGS = @H5_LDFLAGS@
+H5_VERSION = @H5_VERSION@
+HADDR_T = @HADDR_T@
+HAVE_DMALLOC = @HAVE_DMALLOC@
+HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
+HAVE_PTHREAD = @HAVE_PTHREAD@
+HDF5_HL = @HDF5_HL@
+HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
+HDF_CXX = @HDF_CXX@
+HDF_FORTRAN = @HDF_FORTRAN@
+HDF_JAVA = @HDF_JAVA@
+HID_T = @HID_T@
+HL = @HL@
+HL_FOR = @HL_FOR@
+HSIZE_T = @HSIZE_T@
+HSSIZE_T = @HSSIZE_T@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@
+INTERNAL_DEBUG_OUTPUT = @INTERNAL_DEBUG_OUTPUT@
+JAR = @JAR@
+JAVA = @JAVA@
+JAVAC = @JAVAC@
+JAVACFLAGS = @JAVACFLAGS@
+JAVADOC = @JAVADOC@
+JAVAFLAGS = @JAVAFLAGS@
+JAVAPREFIX = @JAVAPREFIX@
+JAVA_JUNIT = @JAVA_JUNIT@
+JAVA_PATH_NAME = @JAVA_PATH_NAME@
+JAVA_VERSION = @JAVA_VERSION@
+JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
+JUNIT = @JUNIT@
+LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LL_PATH = @LL_PATH@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_STATIC_EXEC = @LT_STATIC_EXEC@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MEMORYALLOCSANITYCHECK = @MEMORYALLOCSANITYCHECK@
+MKDIR_P = @MKDIR_P@
+MPE = @MPE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@
+OBJEXT = @OBJEXT@
+OPTIMIZATION = @OPTIMIZATION@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@
+PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@
+PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@
+PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@
+PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@
+PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@
+PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@
+PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@
+PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@
+PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@
+PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@
+PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@
+PAC_FORTRAN_NUM_INTEGER_KINDS = @PAC_FORTRAN_NUM_INTEGER_KINDS@
+PARALLEL = @PARALLEL@
+PARALLEL_FILTERED_WRITES = @PARALLEL_FILTERED_WRITES@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PREADWRITE = @PREADWRITE@
+PROFILING = @PROFILING@
+RANLIB = @RANLIB@
+ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
+RUNPARALLEL = @RUNPARALLEL@
+RUNSERIAL = @RUNSERIAL@
+R_INTEGER = @R_INTEGER@
+R_LARGE = @R_LARGE@
+SEARCH = @SEARCH@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T = @SIZE_T@
+STATIC_EXEC = @STATIC_EXEC@
+STATIC_SHARED = @STATIC_SHARED@
+STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
+STRIP = @STRIP@
+SYMBOLS = @SYMBOLS@
+TESTPARALLEL = @TESTPARALLEL@
+TESTS_JUNIT = @TESTS_JUNIT@
+THREADSAFE = @THREADSAFE@
+TIME = @TIME@
+TR = @TR@
+TRACE_API = @TRACE_API@
+UNAME_INFO = @UNAME_INFO@
+USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
+USE_FILTER_SZIP = @USE_FILTER_SZIP@
+USINGMEMCHECKER = @USINGMEMCHECKER@
+VERSION = @VERSION@
+WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
+_ACJNI_JAVAC = @_ACJNI_JAVAC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
+docdir = $(exec_prefix)/doc
+dvidir = @dvidir@
+enable_shared = @enable_shared@
+enable_static = @enable_static@
+exec_prefix = @exec_prefix@
+fortran_linux_linker_option = @fortran_linux_linker_option@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Shell commands used in Makefiles
+RM = rm -f
+CP = cp
+
+# Some machines need a command to run executables; this is that command
+# so that our tests will run.
+# We use RUNEXEC instead of RUNSERIAL directly because it may be that
+# some tests need to be run with a different command. Older versions
+# of the makefiles used the command
+# $(LIBTOOL) --mode=execute
+# in some directories, for instance.
+RUNEXEC = $(RUNSERIAL)
+
+# Libraries to link to while building
+LIBHDF5 = $(top_builddir)/src/libhdf5.la
+LIBH5TEST = $(top_builddir)/test/libh5test.la
+LIBH5F = $(top_builddir)/fortran/src/libhdf5_fortran.la
+LIBH5FTEST = $(top_builddir)/fortran/test/libh5test_fortran.la
+LIBH5CPP = $(top_builddir)/c++/src/libhdf5_cpp.la
+LIBH5JNI = $(top_builddir)/java/src/jni/libhdf5_java.la
+LIBH5TOOLS = $(top_builddir)/tools/lib/libh5tools.la
+LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
+LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
+LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
+
+# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
+# has been removed. According to the official description of DESTDIR by Gnu at
+# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
+# prepended to the normal and complete install path that it precedes for the
+# purpose of installing in a temporary directory which is useful for building
+# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
+# '/' at the beginning of the normal install path. When DESTDIR is empty the
+# path then begins with '//', which is incorrect and causes problems at least for
+# Cygwin.
+
+# Scripts used to build examples
+# If only shared libraries have been installed, have h5cc build examples with
+# shared libraries instead of static libraries
+H5CC = ${DESTDIR}$(bindir)/h5cc
+H5CC_PP = ${DESTDIR}$(bindir)/h5pcc
+H5FC = ${DESTDIR}$(bindir)/h5fc
+H5FC_PP = ${DESTDIR}$(bindir)/h5pfc
+H5CPP = ${DESTDIR}$(bindir)/h5c++
+ACLOCAL_AMFLAGS = "-I m4"
+
+# The trace script; this is used on source files from the C library to
+# insert tracing macros.
+TRACE = perl $(top_srcdir)/bin/trace
+
+# .chkexe files are used to mark tests that have run successfully.
+# .chklog files are output from those tests.
+# *.clog and *.clog2 are from the MPE option.
+CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
+
+# All programs depend on the hdf5 and h5tools libraries
+LDADD = $(LIBH5TOOLS) $(LIBHDF5)
+
+# Automake needs to be taught how to build lib, progs and tests targets.
+# These will be filled in automatically for the most part (e.g.,
+# lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and
+# EXTRA_TEST variables are supplied to allow the user to force targets to
+# be built at certain times.
+LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
+ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB)
+
+PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
+ $(EXTRA_PROG)
+
+chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
+TEST_EXTENSIONS = .sh
+SH_LOG_COMPILER = $(SHELL)
+AM_SH_LOG_FLAGS =
+REALTIMEOUTPUT = $(realtimeOutput)
+TEST_PROG_CHKEXE = $(TEST_PROG:=.chkexe_)
+TEST_PROG_PARA_CHKEXE = $(TEST_PROG_PARA:=.chkexe_)
+TEST_SCRIPT_CHKSH = $(TEST_SCRIPT:=.chkexe_)
+TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .log .o .obj .sh .sh$(EXEEXT) .trs
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/libtest/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tools/libtest/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+$(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__empty):
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ || test -f $$p1 \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+h5tools_test_utils$(EXEEXT): $(h5tools_test_utils_OBJECTS) $(h5tools_test_utils_DEPENDENCIES) $(EXTRA_h5tools_test_utils_DEPENDENCIES)
+ @rm -f h5tools_test_utils$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(h5tools_test_utils_OBJECTS) $(h5tools_test_utils_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5tools_test_utils.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+recheck: all
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+.sh.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.sh$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(PROGRAMS) all-local
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-local
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \
+ check-am clean clean-binPROGRAMS clean-generic clean-libtool \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-local pdf pdf-am ps ps-am recheck tags tags-am \
+ uninstall uninstall-am uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# List all build rules defined by HDF5 Makefiles as "PHONY" targets here.
+# This tells the Makefiles that these targets are not files to be built but
+# commands that should be executed even if a file with the same name already
+# exists.
+.PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \
+ build-tests check-clean check-install check-p check-s check-vfd \
+ install-doc lib progs tests uninstall-doc _exec_check-s _test help
+
+help:
+ @$(top_srcdir)/bin/makehelp
+
+# lib/progs/tests targets recurse into subdirectories. build-* targets
+# build files in this directory.
+build-lib: $(LIB)
+build-progs: $(LIB) $(PROGS)
+build-tests: $(LIB) $(PROGS) $(chk_TESTS)
+
+# General rule for recursive building targets.
+# BUILT_SOURCES contain targets that need to be built before anything else
+# in the directory (e.g., for Fortran type detection)
+lib progs tests check-s check-p :: $(BUILT_SOURCES)
+ @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1;
+ @for d in X $(SUBDIRS); do \
+ if test $$d != X && test $$d != .; then \
+ (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
+ fi; \
+ done
+
+# General rule for recursive cleaning targets. Like the rule above,
+# but doesn't require building BUILT_SOURCES.
+check-clean ::
+ @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1;
+ @for d in X $(SUBDIRS); do \
+ if test $$d != X && test $$d != .; then \
+ (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
+ fi; \
+ done
+
+# Tell Automake to build tests when the user types `make all' (this is
+# not its default behavior). Also build EXTRA_LIB and EXTRA_PROG since
+# Automake won't build them automatically, either.
+all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
+
+# make install-doc doesn't do anything outside of doc directory, but
+# Makefiles should recognize it.
+# UPDATE: docs no longer reside in this build tree, so this target
+# is deprecated.
+install-doc uninstall-doc:
+ @echo "Nothing to be done."
+
+# clean up files generated by tests so they can be re-run.
+build-check-clean:
+ $(RM) -rf $(CHECK_CLEANFILES)
+
+# run check-clean whenever mostlyclean is run
+mostlyclean-local: build-check-clean
+
+# check-install is just a synonym for installcheck
+check-install: installcheck
+
+# Run each test in order, passing $(TEST_FLAGS) to the program.
+# Since tests are done in a shell loop, "make -i" does apply inside it.
+# Set HDF5_Make_Ignore to a non-blank string to ignore errors inside the loop.
+# The timestamps give a rough idea how much time the tests use.
+#
+# Note that targets in chk_TESTS (defined above) will be built when the user
+# types 'make tests' or 'make check', but only programs in TEST_PROG,
+# TEST_PROG_PARA, or TEST_SCRIPT will actually be executed.
+check-TESTS: test
+
+test _test:
+ @$(MAKE) build-check-s
+ @$(MAKE) build-check-p
+
+# Actual execution of check-s.
+build-check-s: $(LIB) $(PROGS) $(chk_TESTS)
+ @if test -n "$(TEST_PROG)$(TEST_SCRIPT)"; then \
+ echo "===Serial tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
+ fi
+ @$(MAKE) $(AM_MAKEFLAGS) _exec_check-s
+ @if test -n "$(TEST_PROG)$(TEST_SCRIPT)"; then \
+ echo "===Serial tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\
+ fi
+
+_exec_check-s: $(TEST_PROG_CHKEXE) $(TEST_SCRIPT_CHKSH)
+
+# The dummy.chkexe here prevents the target from being
+# empty if there are no tests in the current directory.
+# $${log} is the log file.
+# $${tname} is the name of test.
+$(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
+ @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummy.chkexe_"; then \
+ tname=$(@:.chkexe_=)$(EXEEXT);\
+ log=$(@:.chkexe_=.chklog); \
+ echo "============================"; \
+ if $(top_srcdir)/bin/newer $(@:.chkexe_=.chkexe) $${tname}; then \
+ echo "No need to test $${tname} again."; \
+ else \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "============================" | tee $${log}; \
+ else \
+ echo "============================" > $${log}; \
+ fi; \
+ if test "X$(FORTRAN_API)" = "Xyes"; then \
+ echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ else \
+ echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ elif test "X$(CXX_API)" = "Xyes"; then \
+ echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\
+ else \
+ echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ fi; \
+ else \
+ echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ else \
+ echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "============================" | tee -a $${log}; \
+ else \
+ echo "============================" >> $${log}; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ srcdir="$(srcdir)" \
+ $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) | tee -a $${log} 2>&1 \
+ && touch $(@:.chkexe_=.chkexe) || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ else \
+ srcdir="$(srcdir)" \
+ $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
+ && touch $(@:.chkexe_=.chkexe) || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ fi; \
+ echo "" >> $${log}; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
+ echo "============================" | tee -a $${log}; \
+ else \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \
+ echo "============================" >> $${log}; \
+ fi; \
+ if test -z "$(REALTIMEOUTPUT)"; then \
+ cat $${log}; \
+ fi; \
+ fi; \
+ fi
+
+# The dummysh.chkexe here prevents the target from being
+# empty if there are no tests in the current directory.
+# $${log} is the log file.
+# $${tname} is the name of test.
+$(TEST_SCRIPT_CHKSH) $(TEST_SCRIPT_PARA_CHKSH) dummysh.chkexe_:
+ @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummysh.chkexe_"; then \
+ cmd=$(@:.chkexe_=);\
+ tname=`basename $$cmd`;\
+ chkname=`basename $(@:.chkexe_=.chkexe)`;\
+ log=`basename $(@:.chkexe_=.chklog)`; \
+ echo "============================"; \
+ if $(top_srcdir)/bin/newer $${chkname} $$cmd $(SCRIPT_DEPEND); then \
+ echo "No need to test $${tname} again."; \
+ else \
+ echo "============================" > $${log}; \
+ if test "X$(FORTRAN_API)" = "Xyes"; then \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ elif test "X$(CXX_API)" = "Xyes"; then \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ else \
+ echo "Testing $${tname} $(TEST_FLAGS)"; \
+ echo "$${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ echo "============================" >> $${log}; \
+ RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \
+ srcdir="$(srcdir)" \
+ $(TIME) $(SHELL) $$cmd $(TEST_FLAGS) >> $${log} 2>&1 \
+ && touch $${chkname} || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ echo "" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \
+ echo "============================" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)"; \
+ cat $${log}; \
+ fi; \
+ echo "============================"; \
+ fi
+
+# Actual execution of check-p.
+build-check-p: $(LIB) $(PROGS) $(chk_TESTS)
+ @if test -n "$(TEST_PROG_PARA)$(TEST_SCRIPT_PARA)"; then \
+ echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
+ fi
+ @if test -n "$(TEST_PROG_PARA)"; then \
+ echo "**** Hint ****"; \
+ echo "Parallel test files reside in the current directory" \
+ "by default."; \
+ echo "Set HDF5_PARAPREFIX to use another directory. e.g.,"; \
+ echo " HDF5_PARAPREFIX=/PFS/user/me"; \
+ echo " export HDF5_PARAPREFIX"; \
+ echo " make check"; \
+ echo "**** end of Hint ****"; \
+ fi
+ @for test in $(TEST_PROG_PARA) dummy; do \
+ if test $$test != dummy; then \
+ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \
+ RUNEXEC="$(RUNPARALLEL)" || exit 1; \
+ fi; \
+ done
+ @for test in $(TEST_SCRIPT_PARA) dummy; do \
+ if test $$test != dummy; then \
+ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ || exit 1; \
+ fi; \
+ done
+ @if test -n "$(TEST_PROG_PARA)$(TEST_SCRIPT_PARA)"; then \
+ echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\
+ fi
+
+# Run test with different Virtual File Driver
+check-vfd: $(LIB) $(PROGS) $(chk_TESTS)
+ @for vfd in $(VFD_LIST) dummy; do \
+ if test $$vfd != dummy; then \
+ echo "============================"; \
+ echo "Testing Virtual File Driver $$vfd"; \
+ echo "============================"; \
+ $(MAKE) $(AM_MAKEFLAGS) check-clean || exit 1; \
+ HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \
+ fi; \
+ done
+# check_PROGRAMS=$(TEST_PROG)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c
new file mode 100644
index 0000000..120f803
--- /dev/null
+++ b/tools/libtest/h5tools_test_utils.c
@@ -0,0 +1,1266 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: unit-test functionality of the routines in `tools/lib/h5tools_utils`
+ *
+ * Jacob Smith 2017-11-10
+ */
+
+#include "h5tools_utils.h"
+#include "h5test.h"
+
+#define UTIL_TEST_DEBUG 0
+
+#ifndef __js_test__
+
+#define __js_test__ 1L
+
+/*****************************************************************************
+ *
+ * FILE-LOCAL TESTING MACROS
+ *
+ * Purpose:
+ *
+ * 1. Upon test failure, goto-jump to single-location teardown in test
+ * function. E.g., `error:` (consistency with HDF corpus) or
+ * `failed:` (reflects purpose).
+ * >>> using "error", in part because `H5E_BEGIN_TRY` expects it.
+ * 2. Increase clarity and reduce overhead found with `TEST_ERROR`.
+ * e.g., "if(somefunction(arg, arg2) < 0) TEST_ERROR:"
+ * requires reading of entire line to know whether this if/call is
+ * part of the test setup, test operation, or a test unto itself.
+ * 3. Provide testing macros with optional user-supplied failure message;
+ * if not supplied (NULL), generate comparison output in the spirit of
+ * test-driven development. E.g., "expected 5 but was -3"
+ * User messages clarify test's purpose in code, encouraging description
+ * without relying on comments.
+ * 4. Configurable expected-actual order in generated comparison strings.
+ * Some prefer `VERIFY(expected, actual)`, others
+ * `VERIFY(actual, expected)`. Provide preprocessor ifdef switch
+ * to satifsy both parties, assuming one paradigm per test file.
+ * (One could #undef and redefine the flag through the file as desired,
+ * but _why_.)
+ *
+ * Provided as courtesy, per consideration for inclusion in the library
+ * proper.
+ *
+ * Macros:
+ *
+ * JSVERIFY_EXP_ACT - ifdef flag, configures comparison order
+ * FAIL_IF() - check condition
+ * FAIL_UNLESS() - check _not_ condition
+ * JSVERIFY() - long-int equality check; prints reason/comparison
+ * JSVERIFY_NOT() - long-int inequality check; prints
+ * JSVERIFY_STR() - string equality check; prints
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *****************************************************************************/
+
+
+/*----------------------------------------------------------------------------
+ *
+ * ifdef flag: JSVERIFY_EXP_ACT
+ *
+ * JSVERIFY macros accept arguments as (EXPECTED, ACTUAL[, reason])
+ * default, if this is undefined, is (ACTUAL, EXPECTED[, reason])
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_EXP_ACT 1L
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSFAILED_AT()
+ *
+ * Purpose:
+ *
+ * Preface a test failure by printing "*FAILED*" and location to stdout
+ * Similar to `H5_FAILED(); AT();` from h5test.h
+ *
+ * *FAILED* at somefile.c:12 in function_name()...
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSFAILED_AT() { \
+ HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: FAIL_IF()
+ *
+ * Purpose:
+ *
+ * Make tests more accessible and less cluttered than
+ * `if (thing == otherthing()) TEST_ERROR`
+ * paradigm.
+ *
+ * The following lines are roughly equivalent:
+ *
+ * `if (myfunc() < 0) TEST_ERROR;` (as seen elsewhere in HDF tests)
+ * `FAIL_IF(myfunc() < 0)`
+ *
+ * Prints a generic "FAILED AT" line to stdout and jumps to `error`,
+ * similar to `TEST_ERROR` in h5test.h
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-23
+ *
+ *----------------------------------------------------------------------------
+ */
+#define FAIL_IF(condition) \
+if (condition) { \
+ JSFAILED_AT() \
+ goto error; \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: FAIL_UNLESS()
+ *
+ * Purpose:
+ *
+ * TEST_ERROR wrapper to reduce cognitive overhead from "negative tests",
+ * e.g., "a != b".
+ *
+ * Opposite of FAIL_IF; fails if the given condition is _not_ true.
+ *
+ * `FAIL_IF( 5 != my_op() )`
+ * is equivalent to
+ * `FAIL_UNLESS( 5 == my_op() )`
+ * However, `JSVERIFY(5, my_op(), "bad return")` may be even clearer.
+ * (see JSVERIFY)
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define FAIL_UNLESS(condition) \
+if (!(condition)) { \
+ JSFAILED_AT() \
+ goto error; \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSERR_LONG()
+ *
+ * Purpose:
+ *
+ * Print an failure message for long-int arguments.
+ * ERROR-AT printed first.
+ * If `reason` is given, it is printed on own line and newlined after
+ * else, prints "expected/actual" aligned on own lines.
+ *
+ * *FAILED* at myfile.c:488 in somefunc()...
+ * forest must be made of trees.
+ *
+ * or
+ *
+ * *FAILED* at myfile.c:488 in somefunc()...
+ * ! Expected 425
+ * ! Actual 3
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSERR_LONG(expected, actual, reason) { \
+ JSFAILED_AT() \
+ if (reason!= NULL) { \
+ HDprintf("%s\n", (reason)); \
+ } else { \
+ HDprintf(" ! Expected %ld\n ! Actual %ld\n", \
+ (long)(expected), (long)(actual)); \
+ } \
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSERR_STR()
+ *
+ * Purpose:
+ *
+ * Print an failure message for string arguments.
+ * ERROR-AT printed first.
+ * If `reason` is given, it is printed on own line and newlined after
+ * else, prints "expected/actual" aligned on own lines.
+ *
+ * *FAILED* at myfile.c:421 in myfunc()...
+ * Blue and Red strings don't match!
+ *
+ * or
+ *
+ * *FAILED* at myfile.c:421 in myfunc()...
+ * !!! Expected:
+ * this is my expected
+ * string
+ * !!! Actual:
+ * not what I expected at all
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSERR_STR(expected, actual, reason) { \
+ JSFAILED_AT() \
+ if ((reason) != NULL) { \
+ HDprintf("%s\n", (reason)); \
+ } else { \
+ HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", \
+ (expected), (actual)); \
+ } \
+}
+
+#ifdef JSVERIFY_EXP_ACT
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSVERIFY()
+ *
+ * Purpose:
+ *
+ * Verify that two long integers are equal.
+ * If unequal, print failure message
+ * (with `reason`, if not NULL; expected/actual if NULL)
+ * and jump to `error` at end of function
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY(expected, actual, reason) \
+if ((long)(actual) != (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)) \
+ goto error; \
+} /* JSVERIFY */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSVERIFY_NOT()
+ *
+ * Purpose:
+ *
+ * Verify that two long integers are _not_ equal.
+ * If equal, print failure message
+ * (with `reason`, if not NULL; expected/actual if NULL)
+ * and jump to `error` at end of function
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_NOT(expected, actual, reason) \
+if ((long)(actual) == (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)) \
+ goto error; \
+} /* JSVERIFY_NOT */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Macro: JSVERIFY_STR()
+ *
+ * Purpose:
+ *
+ * Verify that two strings are equal.
+ * If unequal, print failure message
+ * (with `reason`, if not NULL; expected/actual if NULL)
+ * and jump to `error` at end of function
+ *
+ * Programmer: Jacob Smith
+ * 2017-10-24
+ *
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_STR(expected, actual, reason) \
+if (HDstrcmp((actual), (expected)) != 0) { \
+ JSERR_STR((expected), (actual), (reason)); \
+ goto error; \
+} /* JSVERIFY_STR */
+
+
+#else /* JSVERIFY_EXP_ACT not defined */
+ /* Repeats macros above, but with actual/expected parameters reversed. */
+
+
+/*----------------------------------------------------------------------------
+ * Macro: JSVERIFY()
+ * See: JSVERIFY documentation above.
+ * Programmer: Jacob Smith
+ * 2017-10-14
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY(actual, expected, reason) \
+if ((long)(actual) != (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)); \
+ goto error; \
+} /* JSVERIFY */
+
+
+/*----------------------------------------------------------------------------
+ * Macro: JSVERIFY_NOT()
+ * See: JSVERIFY_NOT documentation above.
+ * Programmer: Jacob Smith
+ * 2017-10-14
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_NOT(actual, expected, reason) \
+if ((long)(actual) == (long)(expected)) { \
+ JSERR_LONG((expected), (actual), (reason)) \
+ goto error; \
+} /* JSVERIFY_NOT */
+
+
+/*----------------------------------------------------------------------------
+ * Macro: JSVERIFY_STR()
+ * See: JSVERIFY_STR documentation above.
+ * Programmer: Jacob Smith
+ * 2017-10-14
+ *----------------------------------------------------------------------------
+ */
+#define JSVERIFY_STR(actual, expected, reason) \
+if (HDstrcmp((actual), (expected)) != 0) { \
+ JSERR_STR((expected), (actual), (reason)); \
+ goto error; \
+} /* JSVERIFY_STR */
+
+#endif /* ifdef/else JSVERIFY_EXP_ACT */
+
+#endif /* __js_test__ */
+
+/* if > 0, be very verbose when performing tests */
+#define H5TOOLS_UTILS_TEST_DEBUG 0
+
+/******************/
+/* TEST FUNCTIONS */
+/******************/
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: test_parse_tuple()
+ *
+ * Purpose:
+ *
+ * Provide unit tests and specification for the `parse_tuple()` function.
+ *
+ * Return:
+ *
+ * 0 Tests passed.
+ * 1 Tests failed.
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-11
+ *
+ * Changes: None.
+ *
+ *----------------------------------------------------------------------------
+ */
+static unsigned
+test_parse_tuple(void)
+{
+ /*************************
+ * TEST-LOCAL STRUCTURES *
+ *************************/
+
+ struct testcase {
+ const char *test_msg; /* info about test case */
+ const char *in_str; /* input string */
+ int sep; /* separator "character" */
+ herr_t exp_ret; /* expected SUCCEED / FAIL */
+ unsigned exp_nelems; /* expected number of elements */
+ /* (no more than 7!) */
+ const char *exp_elems[7]; /* list of elements (no more than 7!) */
+ };
+
+ /******************
+ * TEST VARIABLES *
+ ******************/
+
+ struct testcase cases[] = {
+ { "bad start",
+ "words(before)",
+ ';',
+ FAIL,
+ 0,
+ {NULL},
+ },
+ { "tuple not closed",
+ "(not ok",
+ ',',
+ FAIL,
+ 0,
+ {NULL},
+ },
+ { "empty tuple",
+ "()",
+ '-',
+ SUCCEED,
+ 1,
+ {""},
+ },
+ { "no separator",
+ "(stuff keeps on going)",
+ ',',
+ SUCCEED,
+ 1,
+ {"stuff keeps on going"},
+ },
+ { "4-ple, escaped seperator",
+ "(elem0,elem1,el\\,em2,elem3)", /* "el\,em" */
+ ',',
+ SUCCEED,
+ 4,
+ {"elem0", "elem1", "el,em2", "elem3"},
+ },
+ { "5-ple, escaped escaped separator",
+ "(elem0,elem1,el\\\\,em2,elem3)",
+ ',',
+ SUCCEED,
+ 5,
+ {"elem0", "elem1", "el\\", "em2", "elem3"},
+ },
+ { "escaped non-comma separator",
+ "(5-2-7-2\\-6-2)",
+ '-',
+ SUCCEED,
+ 5,
+ {"5","2","7","2-6","2"},
+ },
+ { "embedded close-paren",
+ "(be;fo)re)",
+ ';',
+ SUCCEED,
+ 2,
+ {"be", "fo)re"},
+ },
+ { "embedded non-escaping backslash",
+ "(be;fo\\re)",
+ ';',
+ SUCCEED,
+ 2,
+ {"be", "fo\\re"},
+ },
+ { "double close-paren at end",
+ "(be;fore))",
+ ';',
+ SUCCEED,
+ 2,
+ {"be", "fore)"},
+ },
+ { "empty elements",
+ "(;a1;;a4;)",
+ ';',
+ SUCCEED,
+ 5,
+ {"", "a1", "", "a4", ""},
+ },
+ { "nested tuples with different separators",
+ "((4,e,a);(6,2,a))",
+ ';',
+ SUCCEED,
+ 2,
+ {"(4,e,a)","(6,2,a)"},
+ },
+ { "nested tuples with same separators",
+ "((4,e,a),(6,2,a))",
+ ',',
+ SUCCEED,
+ 6,
+ {"(4","e","a)","(6","2","a)"},
+ },
+ { "real-world use case",
+ "(us-east-2,AKIAIMC3D3XLYXLN5COA,ugs5aVVnLFCErO/8uW14iWE3K5AgXMpsMlWneO/+)",
+ ',',
+ SUCCEED,
+ 3,
+ {"us-east-2",
+ "AKIAIMC3D3XLYXLN5COA",
+ "ugs5aVVnLFCErO/8uW14iWE3K5AgXMpsMlWneO/+"},
+ }
+ };
+ struct testcase tc;
+ unsigned n_tests = 14;
+ unsigned i = 0;
+ unsigned count = 0;
+ unsigned elem_i = 0;
+ char **parsed = NULL;
+ char *cpy = NULL;
+ herr_t success = TRUE;
+ hbool_t show_progress = FALSE;
+
+
+
+ TESTING("arbitrary-count tuple parsing");
+
+#if H5TOOLS_UTILS_TEST_DEBUG > 0
+ show_progress = TRUE;
+#endif /* H5TOOLS_UTILS_TEST_DEBUG */
+
+ /*********
+ * TESTS *
+ *********/
+
+ for (i = 0; i < n_tests; i++) {
+
+ /* SETUP
+ */
+ HDassert(parsed == NULL);
+ HDassert(cpy == NULL);
+ tc = cases[i];
+ if (show_progress == TRUE) {
+ HDprintf("testing %d: %s...\n", i, tc.test_msg);
+ }
+
+ /* VERIFY
+ */
+ success = parse_tuple(tc.in_str, tc.sep, &cpy, &count, &parsed);
+
+ JSVERIFY( tc.exp_ret, success, "function returned incorrect value" )
+ JSVERIFY( tc.exp_nelems, count, NULL )
+ if (success == SUCCEED) {
+ FAIL_IF( parsed == NULL )
+ for (elem_i = 0; elem_i < count; elem_i++) {
+ JSVERIFY_STR( tc.exp_elems[elem_i], parsed[elem_i], NULL )
+ }
+ /* TEARDOWN */
+ HDassert(parsed != NULL);
+ HDassert(cpy != NULL);
+ HDfree(parsed);
+ parsed = NULL;
+ HDfree(cpy);
+ cpy = NULL;
+ } else {
+ FAIL_IF( parsed != NULL )
+ } /* if parse_tuple() == SUCCEED or no */
+
+ } /* for each testcase */
+
+ PASSED();
+ return 0;
+
+error:
+ /***********
+ * CLEANUP *
+ ***********/
+
+ if (parsed != NULL) HDfree(parsed);
+ if (cpy != NULL) HDfree(cpy);
+
+ return 1;
+
+} /* test_parse_tuple */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: test_populate_ros3_fa()
+ *
+ * Purpose: Verify behavior of `populate_ros3_fa()`
+ *
+ * Return: 0 if test passes
+ * 1 if failure
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-13
+ *
+ * Changes: None
+ *
+ *----------------------------------------------------------------------------
+ */
+static unsigned
+test_populate_ros3_fa(void)
+{
+#ifdef H5_HAVE_ROS3_VFD
+ /*************************
+ * TEST-LOCAL STRUCTURES *
+ *************************/
+
+ /************************
+ * TEST-LOCAL VARIABLES *
+ ************************/
+
+ hbool_t show_progress = FALSE;
+ int bad_version = 0xf87a; /* arbitrarily wrong version number */
+#endif /* H5_HAVE_ROS3_VFD */
+
+ TESTING("programmatic ros3 fapl population");
+
+#ifndef H5_HAVE_ROS3_VFD
+ HDputs(" -SKIP-");
+ HDputs(" Read-Only S3 VFD not enabled");
+ HDfflush(stdout);
+ return 0;
+#else
+#if H5TOOLS_UTILS_TEST_DEBUG > 0
+ show_progress = TRUE;
+#endif /* H5TOOLS_UTILS_TEST_DEBUG */
+
+ HDassert(bad_version != H5FD_CURR_ROS3_FAPL_T_VERSION);
+
+ /*********
+ * TESTS *
+ *********/
+
+ /* NULL fapl config pointer fails
+ */
+ {
+ const char *values[] = {"x", "y", "z"};
+
+ if (show_progress) { HDprintf("NULL fapl pointer\n"); }
+
+ JSVERIFY( 0, h5tools_populate_ros3_fapl(NULL, values),
+ "fapl pointer cannot be null" )
+ }
+
+ /* NULL values pointer yields default fapl
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, TRUE, "u", "v", "w"};
+
+ if (show_progress) { HDprintf("NULL values pointer\n"); }
+
+ JSVERIFY( 1, h5tools_populate_ros3_fapl(&fa, NULL),
+ "NULL values pointer yields \"default\" fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( FALSE, fa.authenticate, NULL )
+ JSVERIFY_STR( "", fa.aws_region, NULL )
+ JSVERIFY_STR( "", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* all-empty values
+ * yields default fapl
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, TRUE, "u", "v", "w"};
+ const char *values[] = {"", "", ""};
+
+ if (show_progress) { HDprintf("all empty values\n"); }
+
+ JSVERIFY( 1, h5tools_populate_ros3_fapl(&fa, values),
+ "empty values yields \"default\" fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( FALSE, fa.authenticate, NULL )
+ JSVERIFY_STR( "", fa.aws_region, NULL )
+ JSVERIFY_STR( "", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* successfully set fapl with values
+ * excess value is ignored
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
+ const char *values[] = {"x", "y", "z", "a"};
+
+ if (show_progress) { HDprintf("successful full set\n"); }
+
+ JSVERIFY( 1, h5tools_populate_ros3_fapl(&fa, values),
+ "four values" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( TRUE, fa.authenticate, NULL )
+ JSVERIFY_STR( "x", fa.aws_region, NULL )
+ JSVERIFY_STR( "y", fa.secret_id, NULL )
+ JSVERIFY_STR( "z", fa.secret_key, NULL )
+ }
+
+ /* NULL region
+ * yeilds default fapl
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
+ const char *values[] = {NULL, "y", "z", NULL};
+
+ if (show_progress) { HDprintf("NULL region\n"); }
+
+ JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
+ "could not fill fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( FALSE, fa.authenticate, NULL )
+ JSVERIFY_STR( "", fa.aws_region, NULL )
+ JSVERIFY_STR( "", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* empty region
+ * yeilds default fapl
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
+ const char *values[] = {"", "y", "z", NULL};
+
+ if (show_progress) { HDprintf("empty region; non-empty id, key\n"); }
+
+ JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
+ "could not fill fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( FALSE, fa.authenticate, NULL )
+ JSVERIFY_STR( "", fa.aws_region, NULL )
+ JSVERIFY_STR( "", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* region overflow
+ * yeilds default fapl
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
+ const char *values[] = {
+ "somewhere over the rainbow not too high " \
+ "there is another rainbow bounding some darkened sky",
+ "y",
+ "z"};
+
+ if (show_progress) { HDprintf("region overflow\n"); }
+
+ HDassert(HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN);
+
+ JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
+ "could not fill fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( FALSE, fa.authenticate, NULL )
+ JSVERIFY_STR( "", fa.aws_region, NULL )
+ JSVERIFY_STR( "", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* NULL id
+ * yields default fapl
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
+ const char *values[] = {"x", NULL, "z", NULL};
+
+ if (show_progress) { HDprintf("NULL id\n"); }
+
+ JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
+ "could not fill fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( FALSE, fa.authenticate, NULL )
+ JSVERIFY_STR( "", fa.aws_region, NULL )
+ JSVERIFY_STR( "", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* empty id (non-empty region, key)
+ * yeilds default fapl
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
+ const char *values[] = {"x", "", "z", NULL};
+
+ if (show_progress) { HDprintf("empty id; non-empty region and key\n"); }
+
+ JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
+ "could not fill fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( FALSE, fa.authenticate, NULL )
+ JSVERIFY_STR( "", fa.aws_region, NULL )
+ JSVERIFY_STR( "", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* id overflow
+ * partial set: region
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
+ const char *values[] = {
+ "x",
+ "Why is it necessary to solve the problem? " \
+ "What benefits will you receive by solving the problem? " \
+ "What is the unknown? " \
+ "What is it you don't yet understand? " \
+ "What is the information you have? " \
+ "What isn't the problem? " \
+ "Is the information insufficient, redundant, or contradictory? " \
+ "Should you draw a diagram or figure of the problem? " \
+ "What are the boundaries of the problem? " \
+ "Can you separate the various parts of the problem?",
+ "z"};
+
+ if (show_progress) { HDprintf("id overflow\n"); }
+
+ HDassert(HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN);
+
+ JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
+ "could not fill fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( FALSE, fa.authenticate, NULL )
+ JSVERIFY_STR( "x", fa.aws_region, NULL )
+ JSVERIFY_STR( "", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* NULL key
+ * yields default fapl
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
+ const char *values[] = {"x", "y", NULL, NULL};
+
+ if (show_progress) { HDprintf("NULL key\n"); }
+
+ JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
+ "could not fill fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( FALSE, fa.authenticate, NULL )
+ JSVERIFY_STR( "", fa.aws_region, NULL )
+ JSVERIFY_STR( "", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* empty key (non-empty region, id)
+ * yeilds authenticating fapl
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
+ const char *values[] = {"x", "y", "", NULL};
+
+ if (show_progress) { HDprintf("empty key; non-empty region and id\n"); }
+
+ JSVERIFY( 1, h5tools_populate_ros3_fapl(&fa, values),
+ "could not fill fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( TRUE, fa.authenticate, NULL )
+ JSVERIFY_STR( "x", fa.aws_region, NULL )
+ JSVERIFY_STR( "y", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* empty key, region (non-empty id)
+ * yeilds default fapl
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
+ const char *values[] = {"", "y", "", NULL};
+
+ if (show_progress) { HDprintf("empty key and region; non-empty id\n"); }
+
+ JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
+ "could not fill fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( FALSE, fa.authenticate, NULL )
+ JSVERIFY_STR( "", fa.aws_region, NULL )
+ JSVERIFY_STR( "", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* empty key, id (non-empty region)
+ * yeilds default fapl
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
+ const char *values[] = {"x", "", "", NULL};
+
+ if (show_progress) { HDprintf("empty key and id; non-empty region\n"); }
+
+ JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
+ "could not fill fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( FALSE, fa.authenticate, NULL )
+ JSVERIFY_STR( "", fa.aws_region, NULL )
+ JSVERIFY_STR( "", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* key overflow
+ * partial set: region, id
+ */
+ {
+ H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
+ const char *values[] = {
+ "x",
+ "y",
+ "Why is it necessary to solve the problem? " \
+ "What benefits will you receive by solving the problem? " \
+ "What is the unknown? " \
+ "What is it you don't yet understand? " \
+ "What is the information you have? " \
+ "What isn't the problem? " \
+ "Is the information insufficient, redundant, or contradictory? " \
+ "Should you draw a diagram or figure of the problem? " \
+ "What are the boundaries of the problem? " \
+ "Can you separate the various parts of the problem?"};
+
+ if (show_progress) { HDprintf("key overflow\n"); }
+
+ HDassert(HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN);
+
+ JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
+ "could not fill fapl" )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( FALSE, fa.authenticate, NULL )
+ JSVERIFY_STR( "x", fa.aws_region, NULL )
+ JSVERIFY_STR( "y", fa.secret_id, NULL )
+ JSVERIFY_STR( "", fa.secret_key, NULL )
+ }
+
+ /* use case
+ */
+ {
+ H5FD_ros3_fapl_t fa = {0, 0, "", "", ""};
+ const char *values[] = {
+ "us-east-2",
+ "AKIAIMC3D3XLYXLN5COA",
+ "ugs5aVVnLFCErO/8uW14iWE3K5AgXMpsMlWneO/+"
+ };
+ JSVERIFY( 1,
+ h5tools_populate_ros3_fapl(&fa, values),
+ "unable to set use case" )
+ JSVERIFY( 1, fa.version, "version check" )
+ JSVERIFY( 1, fa.authenticate, "should authenticate" )
+ }
+
+ PASSED();
+ return 0;
+
+error :
+ /***********
+ * CLEANUP *
+ ***********/
+
+ return 1;
+
+#endif /* H5_HAVE_ROS3_VFD */
+
+} /* test_populate_ros3_fa */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: test_set_configured_fapl()
+ *
+ * Purpose: Verify `h5tools_set_configured_fapl()` with ROS3 VFD
+ *
+ * Return: 0 if test passes
+ * 1 if failure
+ *
+ * Programmer: Jacob Smith
+ * 2018-07-12
+ *
+ * Changes: None
+ *
+ *----------------------------------------------------------------------------
+ */
+static unsigned
+test_set_configured_fapl(void)
+{
+#define UTIL_TEST_NOFAPL 1
+#define UTIL_TEST_DEFAULT 2
+#define UTIL_TEST_CREATE 3
+
+ /*************************
+ * TEST-LOCAL STRUCTURES *
+ *************************/
+ typedef struct testcase {
+ const char message[88];
+ int expected;
+ int fapl_choice;
+ const char vfdname[12];
+ void *conf_fa;
+ } testcase;
+
+ typedef struct other_fa_t {
+ int a;
+ int b;
+ int c;
+ } other_fa_t;
+
+ /************************
+ * TEST-LOCAL VARIABLES *
+ ************************/
+
+ hid_t fapl_id = -1;
+ other_fa_t wrong_fa = {0x432, 0xf82, 0x9093};
+ H5FD_ros3_fapl_t ros3_anon_fa = {1, FALSE, "", "", ""};
+ H5FD_ros3_fapl_t ros3_auth_fa = {
+ 1, /* fapl version */
+ TRUE, /* authenticate */
+ "us-east-1", /* aws region */
+ "12345677890abcdef", /* simulate access key ID */
+ "oiwnerwe9u0234nJw0-aoj+dsf", /* simulate secret key */
+ };
+ H5FD_hdfs_fapl_t hdfs_fa = {
+ 1, /* fapl version */
+ "", /* namenode name */
+ 0, /* namenode port */
+ "", /* kerberos ticket cache */
+ "", /* user name */
+ 2048, /* stream buffer size */
+ };
+ unsigned n_cases = 7; /* number of common testcases */
+ testcase cases[] = {
+ { "(common) should fail: no fapl id",
+ 0,
+ UTIL_TEST_NOFAPL,
+ "",
+ NULL,
+ },
+ { "(common) should fail: no fapl id (with struct)",
+ 0,
+ UTIL_TEST_NOFAPL,
+ "",
+ &wrong_fa,
+ },
+ { "(common) H5P_DEFAULT with no struct should succeed",
+ 1,
+ UTIL_TEST_DEFAULT,
+ "",
+ NULL,
+ },
+ { "(common) H5P_DEFAULT with (ignored) struct should succeed",
+ 1,
+ UTIL_TEST_DEFAULT,
+ "",
+ &wrong_fa,
+ },
+ { "(common) provided fapl entry should not fail",
+ 1,
+ UTIL_TEST_CREATE,
+ "",
+ NULL,
+ },
+ { "(common) provided fapl entry should not fail; ignores struct",
+ 1,
+ UTIL_TEST_CREATE,
+ "",
+ &wrong_fa,
+ },
+ { "(common) should fail: unrecoginzed vfd name",
+ 0,
+ UTIL_TEST_DEFAULT,
+ "unknown",
+ NULL,
+ },
+
+#ifdef H5_HAVE_ROS3_VFD
+ /* WARNING: add number of ROS3 test cases after array definition
+ */
+ { "(ROS3) should fail: no fapl id, no struct",
+ 0,
+ UTIL_TEST_NOFAPL,
+ "ros3",
+ NULL,
+ },
+ { "(ROS3) should fail: no fapl id",
+ 0,
+ UTIL_TEST_NOFAPL,
+ "ros3",
+ &ros3_anon_fa,
+ },
+ { "(ROS3) should fail: no struct",
+ 0,
+ UTIL_TEST_CREATE,
+ "ros3",
+ NULL,
+ },
+ { "(ROS3) successful set",
+ 1,
+ UTIL_TEST_CREATE,
+ "ros3",
+ &ros3_anon_fa,
+ },
+ { "(ROS3) should fail: attempt to set DEFAULT fapl",
+ 0,
+ UTIL_TEST_DEFAULT,
+ "ros3",
+ &ros3_anon_fa,
+ },
+#endif /* H5_HAVE_ROS3_VFD */
+
+#ifdef H5_HAVE_LIBHDFS
+ /* WARNING: add number of HDFS test cases after array definition
+ */
+ { "(HDFS) should fail: no fapl id, no struct",
+ 0,
+ UTIL_TEST_NOFAPL,
+ "hdfs",
+ NULL,
+ },
+ { "(HDFS) should fail: no fapl id",
+ 0,
+ UTIL_TEST_NOFAPL,
+ "hdfs",
+ &hdfs_fa,
+ },
+ { "(HDFS) should fail: no struct",
+ 0,
+ UTIL_TEST_CREATE,
+ "hdfs",
+ NULL,
+ },
+ { "(HDFS) successful set",
+ 1,
+ UTIL_TEST_CREATE,
+ "hdfs",
+ &hdfs_fa,
+ },
+ { "(HDFS) should fail: attempt to set DEFAULT fapl",
+ 0,
+ UTIL_TEST_DEFAULT,
+ "hdfs",
+ &hdfs_fa,
+ },
+#endif /* H5_HAVE_LIBHDFS */
+
+ }; /* testcases `cases` array */
+ unsigned int i;
+
+#ifdef H5_HAVE_ROS3_VFD
+ n_cases += 5;
+#endif /* H5_HAVE_ROS3_VFD */
+
+#ifdef H5_HAVE_LIBHDFS
+ n_cases += 5;
+#endif /* H5_HAVE_LIBHDFS */
+
+ TESTING("programmatic fapl set");
+
+ for (i = 0; i < n_cases; i++) {
+ int result;
+ testcase C = cases[i];
+
+ fapl_id = -1;
+
+#if UTIL_TEST_DEBUG
+ HDfprintf(stderr, "setup test %d\t%s\n", i, C.message); fflush(stderr);
+#endif /* UTIL_TEST_DEBUG */
+
+ /* per-test setup */
+ if (C.fapl_choice == UTIL_TEST_DEFAULT) {
+ fapl_id = H5P_DEFAULT;
+ } else if (C.fapl_choice == UTIL_TEST_CREATE) {
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ FAIL_IF( fapl_id < 0 )
+ }
+
+#if UTIL_TEST_DEBUG
+ HDfprintf(stderr, "before test\n"); fflush(stderr);
+#endif /* UTIL_TEST_DEBUG */
+
+ /* test */
+ result = h5tools_set_configured_fapl(
+ fapl_id,
+ C.vfdname,
+ C.conf_fa);
+ JSVERIFY( result, C.expected, C.message )
+
+#if UTIL_TEST_DEBUG
+ HDfprintf(stderr, "after test\n"); fflush(stderr);
+#endif /* UTIL_TEST_DEBUG */
+
+ /* per-test-teardown */
+ if (fapl_id > 0) {
+ FAIL_IF( FAIL == H5Pclose(fapl_id) )
+ }
+ fapl_id = -1;
+
+#if UTIL_TEST_DEBUG
+ HDfprintf(stderr, "after cleanup\n"); fflush(stderr);
+#endif /* UTIL_TEST_DEBUG */
+
+ }
+
+#if UTIL_TEST_DEBUG
+ HDfprintf(stderr, "after loop\n"); fflush(stderr);
+#endif /* UTIL_TEST_DEBUG */
+
+ PASSED();
+ return 0;
+
+error :
+ /***********
+ * CLEANUP *
+ ***********/
+
+#if UTIL_TEST_DEBUG
+ HDfprintf(stderr, "ERROR\n"); fflush(stderr);
+#endif /* UTIL_TEST_DEBUG */
+
+ if (fapl_id > 0) {
+ (void)H5Pclose(fapl_id);
+ }
+
+ return 1;
+
+#undef UTIL_TEST_NOFAPL
+#undef UTIL_TEST_DEFAULT
+#undef UTIL_TEST_CREATE
+} /* test_set_configured_fapl */
+
+
+/*----------------------------------------------------------------------------
+ *
+ * Function: main()
+ *
+ * Purpose: Run all test functions.
+ *
+ * Return: 0 iff all test pass
+ * 1 iff any failures
+ *
+ * Programmer: Jacob Smith
+ * 2017-11-10
+ *
+ * Changes: None.
+ *
+ *----------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ unsigned nerrors = 0;
+
+#ifdef _H5TEST_
+ h5reset(); /* h5test? */
+#endif /* _H5TEST_ */
+
+ HDfprintf(stdout, "Testing h5tools_utils corpus.\n");
+
+ nerrors += test_parse_tuple();
+ nerrors += test_populate_ros3_fa();
+ nerrors += test_set_configured_fapl();
+
+ if (nerrors > 0) {
+ HDfprintf(stdout, "***** %d h5tools_utils TEST%s FAILED! *****\n",
+ nerrors,
+ nerrors > 1 ? "S" : "");
+ nerrors = 1;
+ } else {
+ HDfprintf(stdout, "All h5tools_utils tests passed\n");
+ }
+
+ return (int)nerrors;
+
+} /* main */
+
+
diff --git a/tools/src/Makefile.in b/tools/src/Makefile.in
index 886c7cb..b54f525 100644
--- a/tools/src/Makefile.in
+++ b/tools/src/Makefile.in
@@ -485,7 +485,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -508,9 +507,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -537,6 +539,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -591,6 +594,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -615,7 +619,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1270,7 +1273,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt
index 10b3f3d..85233ef 100644
--- a/tools/src/h5copy/CMakeLists.txt
+++ b/tools/src/h5copy/CMakeLists.txt
@@ -4,18 +4,20 @@ project (HDF5_TOOLS_SRC_H5COPY C)
# --------------------------------------------------------------------
# Add the h5copy and test executables
# --------------------------------------------------------------------
-add_executable (h5copy ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c)
-target_include_directories(h5copy PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5copy STATIC)
-target_link_libraries (h5copy PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_target_properties (h5copy PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5copy")
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h5copy ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c)
+ target_include_directories (h5copy PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5copy STATIC)
+ target_link_libraries (h5copy PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5copy PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5copy")
-set (H5_DEP_EXECUTABLES h5copy)
+ set (H5_DEP_EXECUTABLES h5copy)
+endif ()
if (BUILD_SHARED_LIBS)
add_executable (h5copy-shared ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c)
- target_include_directories(h5copy-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5copy-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5copy-shared SHARED)
target_link_libraries (h5copy-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
set_target_properties (h5copy-shared PROPERTIES FOLDER tools)
diff --git a/tools/src/h5copy/Makefile.in b/tools/src/h5copy/Makefile.in
index 23371bd..7ab4591 100644
--- a/tools/src/h5copy/Makefile.in
+++ b/tools/src/h5copy/Makefile.in
@@ -485,7 +485,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -508,9 +507,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -537,6 +539,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -591,6 +594,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -615,7 +619,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1304,7 +1307,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c
index 1800810..9490cd9 100644
--- a/tools/src/h5copy/h5copy.c
+++ b/tools/src/h5copy/h5copy.c
@@ -381,10 +381,10 @@ main (int argc, const char *argv[])
*-------------------------------------------------------------------------*/
if (verbose) {
- printf("Copying file <%s> and object <%s> to file <%s> and object <%s>\n",
+ HDprintf("Copying file <%s> and object <%s> to file <%s> and object <%s>\n",
fname_src, oname_src, fname_dst, oname_dst);
if (flag) {
- printf("Using %s flag\n", str_flag);
+ HDprintf("Using %s flag\n", str_flag);
}
}
@@ -419,7 +419,7 @@ main (int argc, const char *argv[])
/* Display some output if requested */
if(verbose)
- printf("%s: Creating parent groups\n", h5tools_getprogname());
+ HDprintf("%s: Creating parent groups\n", h5tools_getprogname());
} /* end if */
else {
/* error, if parent groups doesn't already exist in destination file */
@@ -490,7 +490,7 @@ main (int argc, const char *argv[])
leave(EXIT_SUCCESS);
done:
- printf("Error in copy...Exiting\n");
+ HDprintf("Error in copy...Exiting\n");
/* free link info path */
if (linkinfo.trg_path)
diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt
index 671e6b6..96ed6ad 100644
--- a/tools/src/h5diff/CMakeLists.txt
+++ b/tools/src/h5diff/CMakeLists.txt
@@ -4,24 +4,25 @@ project (HDF5_TOOLS_SRC_H5DIFF C)
# --------------------------------------------------------------------
# Add the h5diff executables
# --------------------------------------------------------------------
-add_executable (h5diff
- ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c
- ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c
-)
-target_include_directories(h5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5diff STATIC)
-target_link_libraries (h5diff PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_target_properties (h5diff PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5diff")
-
-set (H5_DEP_EXECUTABLES h5diff)
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h5diff
+ ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c
+ ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c
+ )
+ target_include_directories (h5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5diff STATIC)
+ target_link_libraries (h5diff PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5diff PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5diff")
+ set (H5_DEP_EXECUTABLES h5diff)
+endif ()
if (BUILD_SHARED_LIBS)
add_executable (h5diff-shared
${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c
${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c
)
- target_include_directories(h5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5diff-shared SHARED)
target_link_libraries (h5diff-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
set_target_properties (h5diff-shared PROPERTIES FOLDER tools)
@@ -31,15 +32,30 @@ if (BUILD_SHARED_LIBS)
endif ()
if (H5_HAVE_PARALLEL)
- add_executable (ph5diff
- ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c
- ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c
- )
- target_include_directories(ph5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (ph5diff STATIC)
- target_link_libraries (ph5diff PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
- set_target_properties (ph5diff PROPERTIES FOLDER tools)
- set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};ph5diff")
+ if (NOT ONLY_SHARED_LIBS)
+ add_executable (ph5diff
+ ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c
+ ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c
+ )
+ target_include_directories (ph5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (ph5diff STATIC)
+ target_link_libraries (ph5diff PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
+ set_target_properties (ph5diff PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};ph5diff")
+ set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} ph5diff)
+ endif ()
+ if (BUILD_SHARED_LIBS)
+ add_executable (ph5diff-shared
+ ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c
+ ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c
+ )
+ target_include_directories (ph5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (ph5diff-shared SHARED)
+ target_link_libraries (ph5diff-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
+ set_target_properties (ph5diff-shared PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};ph5diff-shared")
+ set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} ph5diff-shared)
+ endif ()
endif ()
##############################################################################
@@ -63,16 +79,4 @@ if (HDF5_EXPORTED_TARGETS)
${HDF5_EXPORTED_TARGETS}
RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications
)
-
- if (H5_HAVE_PARALLEL)
- #INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications)
-
- install (
- TARGETS
- ph5diff
- EXPORT
- ${HDF5_EXPORTED_TARGETS}
- RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications
- )
- endif ()
endif ()
diff --git a/tools/src/h5diff/Makefile.in b/tools/src/h5diff/Makefile.in
index 0f95f7f3..5676f59 100644
--- a/tools/src/h5diff/Makefile.in
+++ b/tools/src/h5diff/Makefile.in
@@ -489,7 +489,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -512,9 +511,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -541,6 +543,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -595,6 +598,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -619,7 +623,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1307,7 +1310,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c
index 0c1521e..362e3f2 100644
--- a/tools/src/h5diff/h5diff_common.c
+++ b/tools/src/h5diff/h5diff_common.c
@@ -62,9 +62,9 @@ static void check_options(diff_opt_t* opts)
* These options are mutually exclusive.
*/
if ((opts->d + opts->p + opts->use_system_epsilon) > 1) {
- printf("%s error: -d, -p and --use-system-epsilon options are mutually-exclusive;\n", PROGRAMNAME);
- printf("use no more than one.\n");
- printf("Try '-h' or '--help' option for more information or see the %s entry in the 'HDF5 Reference Manual'.\n", PROGRAMNAME);
+ HDprintf("%s error: -d, -p and --use-system-epsilon options are mutually-exclusive;\n", PROGRAMNAME);
+ HDprintf("use no more than one.\n");
+ HDprintf("Try '-h' or '--help' option for more information or see the %s entry in the 'HDF5 Reference Manual'.\n", PROGRAMNAME);
h5diff_exit(EXIT_FAILURE);
}
}
@@ -186,7 +186,7 @@ void parse_command_line(int argc,
/* create linked list of excluding objects */
if( (exclude_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL) {
- printf("Error: lack of memory!\n");
+ HDprintf("Error: lack of memory!\n");
h5diff_exit(EXIT_FAILURE);
}
@@ -212,7 +212,7 @@ void parse_command_line(int argc,
opts->d=1;
if (check_d_input(opt_arg) == - 1) {
- printf("<-d %s> is not a valid option\n", opt_arg);
+ HDprintf("<-d %s> is not a valid option\n", opt_arg);
usage();
h5diff_exit(EXIT_FAILURE);
}
@@ -226,7 +226,7 @@ void parse_command_line(int argc,
case 'p':
opts->p=1;
if (check_p_input(opt_arg) == -1) {
- printf("<-p %s> is not a valid option\n", opt_arg);
+ HDprintf("<-p %s> is not a valid option\n", opt_arg);
usage();
h5diff_exit(EXIT_FAILURE);
}
@@ -240,7 +240,7 @@ void parse_command_line(int argc,
case 'n':
opts->n=1;
if ( check_n_input(opt_arg) == -1) {
- printf("<-n %s> is not a valid option\n", opt_arg);
+ HDprintf("<-n %s> is not a valid option\n", opt_arg);
usage();
h5diff_exit(EXIT_FAILURE);
}
@@ -309,20 +309,20 @@ void parse_command_line(int argc,
return;
if (opts->cmn_objs == 0) {
- printf("No common objects found. Files are not comparable.\n");
+ HDprintf("No common objects found. Files are not comparable.\n");
if (!opts->m_verbose)
- printf("Use -v for a list of objects.\n");
+ HDprintf("Use -v for a list of objects.\n");
}
if (opts->not_cmp == 1) {
if (opts->m_list_not_cmp == 0) {
- printf("--------------------------------\n");
- printf("Some objects are not comparable\n");
- printf("--------------------------------\n");
+ HDprintf("--------------------------------\n");
+ HDprintf("Some objects are not comparable\n");
+ HDprintf("--------------------------------\n");
if (opts->m_verbose)
- printf("Use -c for a list of objects without details of differences.\n");
+ HDprintf("Use -c for a list of objects without details of differences.\n");
else
- printf("Use -c for a list of objects.\n");
+ HDprintf("Use -c for a list of objects.\n");
}
}
}
diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c
index 83240cb..380ab3b 100644
--- a/tools/src/h5diff/ph5diff_main.c
+++ b/tools/src/h5diff/ph5diff_main.c
@@ -68,7 +68,7 @@ int main(int argc, const char *argv[])
if(g_nTasks == 1)
{
- printf("Only 1 task available...doing serial diff\n");
+ HDprintf("Only 1 task available...doing serial diff\n");
g_Parallel = 0;
@@ -148,12 +148,12 @@ ph5diff_worker(int nID)
/* Open the files */
if ((file1_id = H5Fopen (filenames[0], H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
{
- printf ("h5diff Task [%d]: <%s>: unable to open file\n", nID, filenames[0]);
+ HDprintf("h5diff Task [%d]: <%s>: unable to open file\n", nID, filenames[0]);
MPI_Abort(MPI_COMM_WORLD, 0);
}
if ((file2_id = H5Fopen (filenames[1], H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
{
- printf ("h5diff Task [%d]: <%s>: unable to open file\n", nID, filenames[1]);
+ HDprintf("h5diff Task [%d]: <%s>: unable to open file\n", nID, filenames[1]);
MPI_Abort(MPI_COMM_WORLD, 0);
}
/* enable error reporting */
@@ -170,7 +170,7 @@ ph5diff_worker(int nID)
/* Make certain we've received the filenames and opened the files already */
if(file1_id < 0 || file2_id < 0)
{
- printf("ph5diff_worker: ERROR: work received before/without filenames\n");
+ HDprintf("ph5diff_worker: ERROR: work received before/without filenames\n");
break;
}
@@ -199,7 +199,7 @@ ph5diff_worker(int nID)
char out_data[PRINT_DATA_MAX_SIZE];
int tmp;
- memset(out_data, 0, PRINT_DATA_MAX_SIZE);
+ HDmemset(out_data, 0, PRINT_DATA_MAX_SIZE);
i=0;
rewind(overflow_file);
@@ -210,7 +210,7 @@ ph5diff_worker(int nID)
{
MPI_Send(out_data, PRINT_DATA_MAX_SIZE, MPI_BYTE, 0, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD);
i=0;
- memset(out_data, 0, PRINT_DATA_MAX_SIZE);
+ HDmemset(out_data, 0, PRINT_DATA_MAX_SIZE);
}
}
@@ -221,8 +221,8 @@ ph5diff_worker(int nID)
overflow_file = NULL;
}
- fflush(stdout);
- memset(outBuff, 0, OUTBUFF_SIZE);
+ HDfflush(stdout);
+ HDmemset(outBuff, 0, OUTBUFF_SIZE);
outBuffOffset = 0;
MPI_Send(&diffs, sizeof(diffs), MPI_BYTE, 0, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD);
@@ -238,7 +238,7 @@ ph5diff_worker(int nID)
}
else
{
- printf("ph5diff_worker: ERROR: invalid tag (%d) received\n", Status.MPI_TAG);
+ HDprintf("ph5diff_worker: ERROR: invalid tag (%d) received\n", Status.MPI_TAG);
break;
}
@@ -266,14 +266,14 @@ void print_manager_output(void)
/* If there was something we buffered, let's print it now */
if( (outBuffOffset>0) && g_Parallel)
{
- printf("%s", outBuff);
+ HDprintf("%s", outBuff);
if(overflow_file)
{
int tmp;
rewind(overflow_file);
- while((tmp = getc(overflow_file)) >= 0)
- putchar(tmp);
+ while((tmp = HDgetc(overflow_file)) >= 0)
+ HDputchar(tmp);
fclose(overflow_file);
overflow_file = NULL;
}
@@ -321,6 +321,6 @@ void h5diff_exit(int status)
/* Always exit(0), since MPI implementations do weird stuff when they
* receive a non-zero exit value. - QAK
*/
- exit(0);
+ HDexit(0);
}
diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt
index 25166c7..383b04e 100644
--- a/tools/src/h5dump/CMakeLists.txt
+++ b/tools/src/h5dump/CMakeLists.txt
@@ -4,18 +4,20 @@ project (HDF5_TOOLS_SRC_H5DUMP C)
# --------------------------------------------------------------------
# Add the h5dump executables
# --------------------------------------------------------------------
-add_executable (h5dump
- ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.c
- ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c
- ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c
-)
-target_include_directories(h5dump PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5dump STATIC)
-target_link_libraries (h5dump PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_target_properties (h5dump PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump")
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h5dump
+ ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.c
+ ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c
+ ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c
+ )
+ target_include_directories (h5dump PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5dump STATIC)
+ target_link_libraries (h5dump PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5dump PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump")
-set (H5_DEP_EXECUTABLES h5dump)
+ set (H5_DEP_EXECUTABLES h5dump)
+endif ()
if (BUILD_SHARED_LIBS)
add_executable (h5dump-shared
@@ -23,7 +25,7 @@ if (BUILD_SHARED_LIBS)
${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c
${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c
)
- target_include_directories(h5dump-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5dump-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5dump-shared SHARED)
target_link_libraries (h5dump-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
set_target_properties (h5dump-shared PROPERTIES FOLDER tools)
diff --git a/tools/src/h5dump/Makefile.in b/tools/src/h5dump/Makefile.in
index 30d0b02..3bca706 100644
--- a/tools/src/h5dump/Makefile.in
+++ b/tools/src/h5dump/Makefile.in
@@ -485,7 +485,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -508,9 +507,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -537,6 +539,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -591,6 +594,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -615,7 +619,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1294,7 +1297,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index b9e37e8..19ed013 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -24,6 +24,27 @@ static int doxml = 0;
static int useschema = 1;
static const char *xml_dtd_uri = NULL;
+#ifdef H5_HAVE_ROS3_VFD
+static H5FD_ros3_fapl_t ros3_fa = {
+ 1, /* version */
+ false, /* authenticate */
+ "", /* aws region */
+ "", /* access key id */
+ "", /* secret access key */
+};
+#endif /* H5_HAVE_ROS3_VFD */
+
+#ifdef H5_HAVE_LIBHDFS
+static H5FD_hdfs_fapl_t hdfs_fa = {
+ 1, /* fapl version */
+ "localhost", /* namenode name */
+ 0, /* namenode port */
+ "", /* kerberos ticket cache */
+ "", /* user name */
+ 2048, /* stream buffer size */
+};
+#endif /* H5_HAVE_LIBHDFS */
+
/* module-scoped variables for XML option */
#define DEFAULT_XSD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"
#define DEFAULT_DTD "http://www.hdfgroup.org/HDF5/XML/DTD/HDF5-File.dtd"
@@ -188,6 +209,8 @@ static struct long_options l_opts[] = {
{ "any_path", require_arg, 'N' },
{ "vds-view-first-missing", no_arg, 'v' },
{ "vds-gap-size", require_arg, 'G' },
+ { "s3-cred", require_arg, '$' },
+ { "hdfs-attrs", require_arg, '#' },
{ NULL, 0, '\0' }
};
@@ -198,12 +221,6 @@ static struct long_options l_opts[] = {
* Purpose: Shutdown MPI & HDF5 and call exit()
*
* Return: Does not return
- *
- * Programmer: Quincey Koziol
- * Saturday, 31. January 2004
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
@@ -241,6 +258,16 @@ usage(const char *prog)
PRINTVALSTREAM(rawoutstream, " -b B, --binary=B Binary file output, of form B\n");
PRINTVALSTREAM(rawoutstream, " -O F, --ddl=F Output ddl text into file F\n");
PRINTVALSTREAM(rawoutstream, " Use blank(empty) filename F to suppress ddl display\n");
+ PRINTVALSTREAM(rawoutstream, " --s3-cred=<cred> Supply S3 authentication information to \"ros3\" vfd.\n");
+ PRINTVALSTREAM(rawoutstream, " <cred> :: \"(<aws-region>,<access-id>,<access-key>)\"\n");
+ PRINTVALSTREAM(rawoutstream, " If absent or <cred> -> \"(,,)\", no authentication.\n");
+ PRINTVALSTREAM(rawoutstream, " Has no effect is filedriver is not `ros3'.\n");
+ PRINTVALSTREAM(rawoutstream, " --hdfs-attrs=<attrs> Supply configuration information for HDFS file access.\n");
+ PRINTVALSTREAM(rawoutstream, " For use with \"--filedriver=hdfs\"\n");
+ PRINTVALSTREAM(rawoutstream, " <attrs> :: (<namenode name>,<namenode port>,\n");
+ PRINTVALSTREAM(rawoutstream, " <kerberos cache path>,<username>,\n");
+ PRINTVALSTREAM(rawoutstream, " <buffer size>)\n");
+ PRINTVALSTREAM(rawoutstream, " Any absent attribute will use a default value.\n");
PRINTVALSTREAM(rawoutstream, "--------------- Object Options ---------------\n");
PRINTVALSTREAM(rawoutstream, " -a P, --attribute=P Print the specified attribute\n");
PRINTVALSTREAM(rawoutstream, " If an attribute name contains a slash (/), escape the\n");
@@ -368,17 +395,11 @@ usage(const char *prog)
/*-------------------------------------------------------------------------
- * Function: table_list_add
- *
- * Purpose: Add a new set of tables
- *
- * Return: index of added table on success, -1 on failure
- *
- * Programmer: Neil Fortner, nfortne2@hdfgroup.org
- * Adapted from trav_addr_add in h5trav.c by Quincey Koziol
+ * Function: table_list_add
*
- * Date: October 13, 2008
+ * Purpose: Add a new set of tables
*
+ * Return: index of added table on success, -1 on failure
*-------------------------------------------------------------------------
*/
ssize_t
@@ -405,8 +426,7 @@ table_list_add(hid_t oid, unsigned long file_no)
table_list.nused--;
return -1;
}
- if(init_objs(oid, &info, &table_list.tables[idx].group_table,
- &table_list.tables[idx].dset_table, &table_list.tables[idx].type_table) < 0) {
+ if(init_objs(oid, &info, &table_list.tables[idx].group_table, &table_list.tables[idx].dset_table, &table_list.tables[idx].type_table) < 0) {
H5Idec_ref(oid);
table_list.nused--;
return -1;
@@ -421,17 +441,11 @@ table_list_add(hid_t oid, unsigned long file_no)
/*-------------------------------------------------------------------------
- * Function: table_list_visited
+ * Function: table_list_visited
*
- * Purpose: Check if a table already exists for the specified fileno
- *
- * Return: The index of the matching table, or -1 if no matches found
- *
- * Programmer: Neil Fortner, nfortne2@hdfgroup.org
- * Adapted from trav_addr_visited in h5trav.c by Quincey Koziol
- *
- * Date: October 13, 2008
+ * Purpose: Check if a table already exists for the specified fileno
*
+ * Return: The index of the matching table, or -1 if no matches found
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE ssize_t
@@ -451,16 +465,11 @@ table_list_visited(unsigned long file_no)
/*-------------------------------------------------------------------------
- * Function: table_list_free
- *
- * Purpose: Frees the table list
- *
- * Return: void
+ * Function: table_list_free
*
- * Programmer: Neil Fortner, nfortne2@hdfgroup.org
- *
- * Date: October 13, 2008
+ * Purpose: Frees the table list
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -492,16 +501,10 @@ table_list_free(void)
/*-------------------------------------------------------------------------
* Function: set_binary_form
*
- * Purpose: set the binary form of output by translating from a string input
- * parameter to a integer return value
- *
- * Return: integer form of binary output or -1 if none found
- *
- * Programmer: Pedro Vicente Nunes
- * June 28, 2006
- *
- * Modifications:
+ * Purpose: set the binary form of output by translating from a string input
+ * parameter to a integer return value
*
+ * Return: integer form of binary output or -1 if none found
*-------------------------------------------------------------------------
*/
static int
@@ -526,17 +529,11 @@ set_binary_form(const char *form)
/*-------------------------------------------------------------------------
* Function: set_sort_by
*
- * Purpose: set the "by" form of sorting by translating from a string input
- * parameter to a H5_index_t return value
- * current sort values are [creation_order | name]
- *
- * Return: H5_index_t form of sort or H5_INDEX_UNKNOWN if none found
- *
- * Programmer: Pedro Vicente Nunes
- * October 1, 2007
- *
- * Modifications:
+ * Purpose: set the "by" form of sorting by translating from a string input
+ * parameter to a H5_index_t return value
+ * current sort values are [creation_order | name]
*
+ * Return: H5_index_t form of sort or H5_INDEX_UNKNOWN if none found
*-------------------------------------------------------------------------
*/
static H5_index_t
@@ -555,17 +552,11 @@ set_sort_by(const char *form)
/*-------------------------------------------------------------------------
* Function: set_sort_order
*
- * Purpose: set the order of sorting by translating from a string input
- * parameter to a H5_iter_order_t return value
- * current order values are [ascending | descending ]
- *
- * Return: H5_iter_order_t form of order or H5_ITER_UNKNOWN if none found
- *
- * Programmer: Pedro Vicente Nunes
- * October 1, 2007
- *
- * Modifications:
+ * Purpose: set the order of sorting by translating from a string input
+ * parameter to a H5_iter_order_t return value
+ * current order values are [ascending | descending ]
*
+ * Return: H5_iter_order_t form of order or H5_ITER_UNKNOWN if none found
*-------------------------------------------------------------------------
*/
static H5_iter_order_t
@@ -594,10 +585,6 @@ set_sort_order(const char *form)
* either commas (,) or white spaces.
*
* Return: <none>
- *
- * Programmer: Bill Wendling
- * Tuesday, 6. February 2001
- *
*-------------------------------------------------------------------------
*/
static void
@@ -652,12 +639,6 @@ parse_hsize_list(const char *h_list, subset_d *d)
*
* Return: Success: struct subset_t object
* Failure: NULL
- *
- * Programmer: Bill Wendling
- * Tuesday, 6. February 2001
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static struct subset_t *
@@ -675,21 +656,24 @@ parse_subset_params(char *dset)
while (*brace && *brace != ';')
brace++;
- if (*brace) brace++;
+ if (*brace)
+ brace++;
parse_hsize_list(brace, &s->stride);
while (*brace && *brace != ';')
brace++;
- if (*brace) brace++;
+ if (*brace)
+ brace++;
parse_hsize_list(brace, &s->count);
while (*brace && *brace != ';')
brace++;
- if (*brace) brace++;
+ if (*brace)
+ brace++;
parse_hsize_list(brace, &s->block);
}
@@ -705,9 +689,7 @@ parse_subset_params(char *dset)
* should be at the start of the list you want to parse.
*
* Return: Success: SUCCEED
- *
* Failure: FAIL
- *
*-------------------------------------------------------------------------
*/
static int
@@ -826,12 +808,6 @@ parse_mask_list(const char *h_list)
* to free
*
* Return: Nothing
- *
- * Programmer: Bill Wendling
- * Tuesday, 20. February 2001
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
@@ -874,15 +850,7 @@ free_handler(struct handler_t *hand, int len)
* Return: Success: A pointer to an array of handler_t structures.
* These contain all the information needed to dump
* the necessary object.
- *
* Failure: Exits program with EXIT_FAILURE value.
- *
- * Programmer: Bill Wendling
- * Tuesday, 20. February 2001
- *
- * Modifications:
- * pvn June, 1, 2006. Add a switch for binary output
- *
*-------------------------------------------------------------------------
*/
static struct handler_t *
@@ -1282,6 +1250,110 @@ end_collect:
hand = NULL;
h5tools_setstatus(EXIT_SUCCESS);
goto done;
+
+ case '$':
+#ifndef H5_HAVE_ROS3_VFD
+ error_msg("Read-Only S3 VFD not enabled.\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+#else
+ /* s3 credential */
+ {
+ char **s3_cred = NULL;
+ char *s3_cred_string = NULL;
+ const char *ccred[3];
+ unsigned nelems = 0;
+ if (FAIL == parse_tuple(opt_arg, ',', &s3_cred_string, &nelems, &s3_cred)) {
+ error_msg("unable to parse malformed s3 credentials\n");
+ usage(h5tools_getprogname());
+ free_handler(hand, argc);
+ hand = NULL;
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
+ if (nelems != 3) {
+ error_msg("s3 credentials expects 3 elements\n");
+ usage(h5tools_getprogname());
+ free_handler(hand, argc);
+ hand = NULL;
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
+ ccred[0] = (const char *)s3_cred[0];
+ ccred[1] = (const char *)s3_cred[1];
+ ccred[2] = (const char *)s3_cred[2];
+ if (0 == h5tools_populate_ros3_fapl(&ros3_fa, ccred)) {
+ error_msg("Invalid S3 credentials\n");
+ usage(h5tools_getprogname());
+ free_handler(hand, argc);
+ hand = NULL;
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
+ HDfree(s3_cred);
+ HDfree(s3_cred_string);
+ } /* s3 credential block */
+ break;
+#endif /* H5_HAVE_ROS3_VFD */
+
+ case '#':
+#ifndef H5_HAVE_LIBHDFS
+ error_msg("HDFS VFD is not enabled.\n");
+ goto error;
+#else
+ {
+ /* read hdfs properties tuple and store values in `hdfs_fa` */
+ unsigned nelems = 0;
+ char *props_src = NULL;
+ char **props = NULL;
+ unsigned long k = 0;
+ if (FAIL == parse_tuple((const char *)opt_arg, ',', &props_src, &nelems, &props)) {
+ error_msg("unable to parse hdfs properties tuple\n");
+ goto error;
+ }
+ /* sanity-check tuple count
+ */
+ if (nelems != 5) {
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
+ }
+ /* Populate fapl configuration structure with given
+ * properties.
+ * WARNING: No error-checking is done on length of input
+ * strings... Silent overflow is possible, albeit
+ * unlikely.
+ */
+ if (strncmp(props[0], "", 1))
+ HDstrncpy(hdfs_fa.namenode_name, (const char *)props[0], HDstrlen(props[0]));
+
+ if (strncmp(props[1], "", 1)) {
+ k = strtoul((const char *)props[1], NULL, 0);
+ if (errno == ERANGE) {
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
+ }
+ hdfs_fa.namenode_port = (int32_t)k;
+ }
+ if (strncmp(props[2], "", 1))
+ HDstrncpy(hdfs_fa.kerberos_ticket_cache, (const char *)props[2], HDstrlen(props[2]));
+
+ if (strncmp(props[3], "", 1))
+ HDstrncpy(hdfs_fa.user_name, (const char *)props[3], HDstrlen(props[3]));
+
+ if (strncmp(props[4], "", 1)) {
+ k = strtoul((const char *)props[4], NULL, 0);
+ if (errno == ERANGE) {
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
+ }
+ hdfs_fa.stream_buffer_size = (int32_t)k;
+ }
+ HDfree(props);
+ HDfree(props_src);
+ }
+#endif /* H5_HAVE_LIBHDFS */
+ break;
+
case '?':
default:
usage(h5tools_getprogname());
@@ -1317,36 +1389,6 @@ error:
*
* Return: Success: 0
* Failure: 1
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- * Albert Cheng
- * 30. September 2000
- * Add the -o option--output file for datasets raw data
- *
- * REMcG
- * November 2000
- * Changes to support XML.
- *
- * Bill Wendling
- * Wednesday, 10. January 2001
- * Modified the way command line parameters are interpreted. They go
- * through one function call now (get_option).
- *
- * Bill Wendling
- * Tuesday, 20. February 2001
- * Moved command line parsing to separate function. Made various
- * "display_*" flags global.
- *
- * REMcG
- * August 2003
- * Major upgrade to XML support.
- *
- * Pedro Vicente
- * September 2007
- * list objects in requested order (creation order or alphabetically)
- *
*-------------------------------------------------------------------------
*/
int
@@ -1354,6 +1396,7 @@ main(int argc, const char *argv[])
{
hid_t fid = -1;
hid_t gid = -1;
+ hid_t fapl_id = H5P_DEFAULT;
H5E_auto2_t func;
H5E_auto2_t tools_func;
H5O_info_t oi;
@@ -1399,8 +1442,7 @@ main(int argc, const char *argv[])
/* Check for conflicting options */
if (doxml) {
if (!display_all) {
- error_msg("option \"%s\" not available for XML\n",
- "to display selected objects");
+ error_msg("option \"%s\" not available for XML\n", "to display selected objects");
h5tools_setstatus(EXIT_FAILURE);
goto done;
}
@@ -1440,10 +1482,54 @@ main(int argc, const char *argv[])
/* Initialize indexing options */
h5trav_set_index(sort_by, sort_order);
+ if (driver != NULL) {
+ void *conf_fa = NULL;
+
+ if (!strcmp(driver, "ros3")) {
+#ifndef H5_HAVE_ROS3_VFD
+ error_msg("Read-Only S3 VFD not enabled.\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+#else
+ conf_fa = (void *)&ros3_fa;
+#endif /* H5_HAVE_ROS3_VFD */
+ }
+ else if (!HDstrcmp(driver, "hdfs")) {
+#ifndef H5_HAVE_LIBHDFS
+ error_msg("HDFS VFD is not enabled.\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+#else
+ conf_fa = (void *)&hdfs_fa;
+#endif /* H5_HAVE_LIBHDFS */
+ }
+
+ if (conf_fa != NULL) {
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (fapl_id < 0) {
+ error_msg("unable to create fapl entry\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
+ /* driver guaranteed "ros3" or "hdfs" */
+ /* conf_fa appropriate to driver */
+ if (0 == h5tools_set_configured_fapl(fapl_id, driver, conf_fa)) {
+ error_msg("unable to set fapl\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
+ }
+ } /* driver defined */
+
while(opt_ind < argc) {
fname = HDstrdup(argv[opt_ind++]);
- fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0);
+ if (fapl_id != H5P_DEFAULT) {
+ fid = H5Fopen(fname, H5F_ACC_RDONLY, fapl_id);
+ }
+ else {
+ fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0);
+ }
if (fid < 0) {
error_msg("unable to open file \"%s\"\n", fname);
@@ -1515,8 +1601,7 @@ main(int argc, const char *argv[])
/* alternative first element, depending on schema or DTD. */
if (useschema) {
if (HDstrcmp(xmlnsprefix,"") == 0) {
- PRINTSTREAM(rawoutstream, "<HDF5-File xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"%s\">\n",
- xml_dtd_uri);
+ PRINTSTREAM(rawoutstream, "<HDF5-File xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"%s\">\n", xml_dtd_uri);
}
else {
/* TO DO: make -url option work in this case (may need new option) */
@@ -1525,7 +1610,8 @@ main(int argc, const char *argv[])
ns = HDstrdup(xmlnsprefix);
indx = HDstrrchr(ns,(int)':');
- if (indx) *indx = '\0';
+ if (indx)
+ *indx = '\0';
PRINTSTREAM(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\" "
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
@@ -1624,6 +1710,11 @@ done:
/* Free tables for objects */
table_list_free();
+ if (fapl_id != H5P_DEFAULT && 0 < H5Pclose(fapl_id)) {
+ error_msg("Can't close fapl entry\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
+
if(fid >=0)
if (H5Fclose(fid) < 0)
h5tools_setstatus(EXIT_FAILURE);
@@ -1645,127 +1736,7 @@ done:
H5Eset_auto2(H5E_DEFAULT, func, edata);
leave(h5tools_getstatus());
-}
-
-/*-------------------------------------------------------------------------
- * Function: h5_fileaccess
- *
- * Purpose: Returns a file access template which is the default template
- * but with a file driver set according to the constant or
- * environment variable HDF5_DRIVER
- *
- * Return: Success: A file access property list
- *
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Thursday, November 19, 1998
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-hid_t
-h5_fileaccess(void)
-{
- static const char *multi_letters = "msbrglo";
- const char *val = NULL;
- const char *name;
- char s[1024];
- hid_t fapl = -1;
-
- /* First use the environment variable, then the constant */
- val = HDgetenv("HDF5_DRIVER");
-#ifdef HDF5_DRIVER
- if (!val) val = HDF5_DRIVER;
-#endif
-
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) return -1;
- if (!val || !*val) return fapl; /*use default*/
-
- HDstrncpy(s, val, sizeof s);
- s[sizeof(s)-1] = '\0';
- if (NULL==(name=HDstrtok(s, " \t\n\r"))) return fapl;
-
- if (!HDstrcmp(name, "sec2")) {
- /* Unix read() and write() system calls */
- if (H5Pset_fapl_sec2(fapl)<0) return -1;
- }
- else if (!HDstrcmp(name, "stdio")) {
- /* Standard C fread() and fwrite() system calls */
- if (H5Pset_fapl_stdio(fapl)<0) return -1;
- }
- else if (!HDstrcmp(name, "core")) {
- /* In-core temporary file with 1MB increment */
- if (H5Pset_fapl_core(fapl, 1024*1024, FALSE)<0) return -1;
- }
- else if (!HDstrcmp(name, "split")) {
- /* Split meta data and raw data each using default driver */
- if (H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0)
- return -1;
- }
- else if (!HDstrcmp(name, "multi")) {
- /* Multi-file driver, general case of the split driver */
- H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
- hid_t memb_fapl[H5FD_MEM_NTYPES];
- const char *memb_name[H5FD_MEM_NTYPES];
- char sv[H5FD_MEM_NTYPES][1024];
- haddr_t memb_addr[H5FD_MEM_NTYPES];
- H5FD_mem_t mt;
-
- HDmemset(memb_map, 0, sizeof memb_map);
- HDmemset(memb_fapl, 0, sizeof memb_fapl);
- HDmemset(memb_name, 0, sizeof memb_name);
- HDmemset(memb_addr, 0, sizeof memb_addr);
-
- if(HDstrlen(multi_letters)==H5FD_MEM_NTYPES) {
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
- memb_fapl[mt] = H5P_DEFAULT;
- memb_map[mt] = mt;
- sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
- memb_name[mt] = sv[mt];
- memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10);
- }
- }
- else {
- error_msg("Bad multi_letters list\n");
- return FAIL;
- }
-
- if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0)
- return -1;
- }
- else if (!HDstrcmp(name, "family")) {
- hsize_t fam_size = 100*1024*1024; /*100 MB*/
-
- /* Family of files, each 1MB and using the default driver */
- if ((val=HDstrtok(NULL, " \t\n\r")))
- fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024);
- if (H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0)
- return -1;
- }
- else if (!HDstrcmp(name, "log")) {
- long log_flags = H5FD_LOG_LOC_IO;
-
- /* Log file access */
- if ((val = HDstrtok(NULL, " \t\n\r")))
- log_flags = HDstrtol(val, NULL, 0);
-
- if (H5Pset_fapl_log(fapl, NULL, (unsigned)log_flags, 0) < 0)
- return -1;
- }
- else if (!HDstrcmp(name, "direct")) {
- /* Substitute Direct I/O driver with sec2 driver temporarily because
- * some output has sec2 driver as the standard. */
- if (H5Pset_fapl_sec2(fapl)<0) return -1;
- }
- else {
- /* Unknown driver */
- return -1;
- }
-
- return fapl;
-}
+} /* main */
/*-------------------------------------------------------------------------
diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c
index 5c47abd..4fb8398 100644
--- a/tools/src/h5dump/h5dump_ddl.c
+++ b/tools/src/h5dump/h5dump_ddl.c
@@ -864,7 +864,7 @@ dump_group(hid_t gid, const char *name)
if(!type_table->objs[u].recorded) {
dset = H5Dopen2(gid, type_table->objs[u].objname, H5P_DEFAULT);
type = H5Dget_type(dset);
- sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno);
+ HDsprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno);
dump_function_table->dump_named_datatype_function(type, type_name);
H5Tclose(type);
H5Dclose(dset);
@@ -1941,9 +1941,6 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED * data, int H5_AT
break;
case H5L_TYPE_EXTERNAL:
- begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin);
- PRINTVALSTREAM(rawoutstream, "\n");
- indentation(COL);
begin_obj(h5tools_dump_header_format->extlinkbegin, links, h5tools_dump_header_format->extlinkblockbegin);
PRINTVALSTREAM(rawoutstream, "\n");
if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0) {
@@ -1952,8 +1949,6 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED * data, int H5_AT
if(H5Lunpack_elink_val(buf, linfo.u.val_size, NULL, &elink_file, &elink_path)>=0) {
indentation(COL);
- PRINTSTREAM(rawoutstream, "LINKCLASS %d\n", linfo.type);
- indentation(COL);
PRINTSTREAM(rawoutstream, "TARGETFILE \"%s\"\n", elink_file);
indentation(COL);
PRINTSTREAM(rawoutstream, "TARGETPATH \"%s\"\n", elink_path);
@@ -1977,9 +1972,6 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED * data, int H5_AT
begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin);
PRINTVALSTREAM(rawoutstream, "\n");
indentation(COL);
- begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin);
- PRINTVALSTREAM(rawoutstream, "\n");
- indentation(COL);
PRINTSTREAM(rawoutstream, "LINKCLASS %d\n", linfo.type);
end_obj(h5tools_dump_header_format->udlinkend, h5tools_dump_header_format->udlinkblockend);
break;
@@ -2022,7 +2014,7 @@ handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED * data, int pe
if(!type_table->objs[idx].recorded) {
/* unamed datatype */
- sprintf(name, "/#"H5_PRINTF_HADDR_FMT, type_table->objs[idx].objno);
+ HDsprintf(name, "/#"H5_PRINTF_HADDR_FMT, type_table->objs[idx].objno);
if(!HDstrcmp(name, real_name))
break;
diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c
index ec76511..fdbdd40 100644
--- a/tools/src/h5dump/h5dump_xml.c
+++ b/tools/src/h5dump/h5dump_xml.c
@@ -587,7 +587,7 @@ xml_name_to_XID(const char *str , char *outstr, int outlen, int gen)
if (objno == HADDR_UNDEF) {
if (gen) {
objno = ref_path_table_gen_fake(str);
- sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno);
+ HDsprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno);
return 0;
}
else {
@@ -598,7 +598,7 @@ xml_name_to_XID(const char *str , char *outstr, int outlen, int gen)
else {
if (gen) {
objno = ref_path_table_gen_fake(str);
- sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno);
+ HDsprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno);
return 0;
}
else {
@@ -607,7 +607,7 @@ xml_name_to_XID(const char *str , char *outstr, int outlen, int gen)
}
}
- sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno);
+ HDsprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno);
return(0);
}
@@ -2685,7 +2685,7 @@ xml_dump_group(hid_t gid, const char *name)
if(!type_table->objs[u].recorded) {
dset = H5Dopen2(gid, type_table->objs[u].objname, H5P_DEFAULT);
type = H5Dget_type(dset);
- sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno);
+ HDsprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno);
dump_function_table->dump_named_datatype_function(type, type_name);
H5Tclose(type);
H5Dclose(dset);
@@ -2767,7 +2767,7 @@ xml_dump_group(hid_t gid, const char *name)
if(!type_table->objs[u].recorded) {
dset = H5Dopen2(gid, type_table->objs[u].objname, H5P_DEFAULT);
type = H5Dget_type(dset);
- sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno);
+ HDsprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno);
dump_function_table->dump_named_datatype_function(type, type_name);
H5Tclose(type);
H5Dclose(dset);
@@ -2881,7 +2881,7 @@ xml_print_refs(hid_t did, int source)
goto error;
}
- refbuf = (hobj_ref_t *) buf;
+ refbuf = (hobj_ref_t *)((void *)buf);
/* setup */
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
@@ -3057,7 +3057,7 @@ xml_print_strs(hid_t did, int source)
for (i = 0; i < (hsize_t)ssiz; i++) {
if (is_vlstr) {
- onestring = *(char **) bp;
+ onestring = *(char **)((void *)bp);
if (onestring)
str_size = HDstrlen(onestring);
}
diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt
index 79a1316..540be8c 100644
--- a/tools/src/h5format_convert/CMakeLists.txt
+++ b/tools/src/h5format_convert/CMakeLists.txt
@@ -4,14 +4,26 @@ project (HDF5_TOOLS_SRC_H5FC C)
# --------------------------------------------------------------------
# Add the h5format_convert executables
# --------------------------------------------------------------------
-add_executable (h5format_convert ${HDF5_TOOLS_SRC_H5FC_SOURCE_DIR}/h5format_convert.c)
-target_include_directories(h5format_convert PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5format_convert STATIC)
-target_link_libraries (h5format_convert PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_target_properties (h5format_convert PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5format_convert")
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h5format_convert ${HDF5_TOOLS_SRC_H5FC_SOURCE_DIR}/h5format_convert.c)
+ target_include_directories (h5format_convert PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5format_convert STATIC)
+ target_link_libraries (h5format_convert PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5format_convert PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5format_convert")
-set (H5_DEP_EXECUTABLES h5format_convert)
+ set (H5_DEP_EXECUTABLES h5format_convert)
+endif ()
+if (BUILD_SHARED_LIBS)
+ add_executable (h5format_convert-shared ${HDF5_TOOLS_SRC_H5FC_SOURCE_DIR}/h5format_convert.c)
+ target_include_directories (h5format_convert-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5format_convert-shared SHARED)
+ target_link_libraries (h5format_convert-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ set_target_properties (h5format_convert-shared PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5format_convert-shared")
+
+ set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5format_convert-shared)
+endif ()
##############################################################################
##############################################################################
diff --git a/tools/src/h5format_convert/Makefile.in b/tools/src/h5format_convert/Makefile.in
index 0a24ca2..46a1b54 100644
--- a/tools/src/h5format_convert/Makefile.in
+++ b/tools/src/h5format_convert/Makefile.in
@@ -487,7 +487,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -510,9 +509,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -539,6 +541,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -593,6 +596,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -617,7 +621,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1330,7 +1333,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c
index b9ed9ce..257a047 100644
--- a/tools/src/h5format_convert/h5format_convert.c
+++ b/tools/src/h5format_convert/h5format_convert.c
@@ -259,7 +259,7 @@ convert(hid_t fid, const char *dname)
error_msg("unable to get the chunk indexing type for \"%s\"\n", dname);
h5tools_setstatus(EXIT_FAILURE);
goto error;
- }
+ }
else if(verbose_g)
HDfprintf(stdout, "Retrieve the dataset's chunk indexing type\n");
@@ -268,11 +268,11 @@ convert(hid_t fid, const char *dname)
HDfprintf(stdout, "Dataset's chunk indexing type is already version 1 B-tree: no further action\n");
h5tools_setstatus(EXIT_SUCCESS);
goto done;
- }
+ }
else if (verbose_g)
HDfprintf(stdout, "Dataset's chunk indexing type is not version 1 B-tree\n");
- break;
+ break;
case H5D_CONTIGUOUS:
if(verbose_g)
@@ -302,8 +302,8 @@ convert(hid_t fid, const char *dname)
if(noop_g) {
if(verbose_g)
HDfprintf(stdout, "Not converting the dataset\n");
- h5tools_setstatus(EXIT_SUCCESS);
- goto done;
+ h5tools_setstatus(EXIT_SUCCESS);
+ goto done;
}
if(verbose_g)
diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt
index 7b38420..dd7921d 100644
--- a/tools/src/h5import/CMakeLists.txt
+++ b/tools/src/h5import/CMakeLists.txt
@@ -4,15 +4,29 @@ project (HDF5_TOOLS_SRC_H5IMPORT C)
# --------------------------------------------------------------------
# Add the h5import executables
# --------------------------------------------------------------------
-add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c)
-target_include_directories(h5import PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5import STATIC)
-target_link_libraries (h5import PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-#set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT)
-set_target_properties (h5import PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5import")
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c)
+ target_include_directories (h5import PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5import STATIC)
+ target_link_libraries (h5import PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ #set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT)
+ set_target_properties (h5import PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5import")
-set (H5_DEP_EXECUTABLES h5import)
+ set (H5_DEP_EXECUTABLES h5import)
+endif ()
+
+if (BUILD_SHARED_LIBS)
+ add_executable (h5import-shared ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c)
+ target_include_directories (h5import-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5import-shared SHARED)
+ target_link_libraries (h5import-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ #set_target_properties (h5import-shared PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT)
+ set_target_properties (h5import-shared PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5import-shared")
+
+ set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5import-shared)
+endif ()
##############################################################################
##############################################################################
diff --git a/tools/src/h5import/Makefile.in b/tools/src/h5import/Makefile.in
index d322f67..dabd729 100644
--- a/tools/src/h5import/Makefile.in
+++ b/tools/src/h5import/Makefile.in
@@ -484,7 +484,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -507,9 +506,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -536,6 +538,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -590,6 +593,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -614,7 +618,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1288,7 +1291,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index 16c0d8c..1eef5ab 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -3753,7 +3753,7 @@ void setDefaultValues(struct Input *in, int count)
in->path.count = 1;
HDstrcpy(temp, "dataset");
- sprintf(num, "%d", count);
+ HDsprintf(num, "%d", count);
HDstrcat(temp, num);
HDstrcpy(in->path.group[0], temp);
diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt
index c455b2f..f430417 100644
--- a/tools/src/h5jam/CMakeLists.txt
+++ b/tools/src/h5jam/CMakeLists.txt
@@ -4,24 +4,47 @@ project (HDF5_TOOLS_SRC_H5JAM C)
# --------------------------------------------------------------------
# Add the h5jam executables
# --------------------------------------------------------------------
-add_executable (h5jam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5jam.c)
-target_include_directories(h5jam PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5jam STATIC)
-target_link_libraries (h5jam PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_target_properties (h5jam PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5jam")
-
-add_executable (h5unjam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5unjam.c)
-target_include_directories(h5unjam PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5unjam STATIC)
-target_link_libraries (h5unjam PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_target_properties (h5unjam PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5unjam")
-
-set (H5_DEP_EXECUTABLES
- h5jam
- h5unjam
-)
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h5jam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5jam.c)
+ target_include_directories (h5jam PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5jam STATIC)
+ target_link_libraries (h5jam PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5jam PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5jam")
+
+ add_executable (h5unjam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5unjam.c)
+ target_include_directories (h5unjam PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5unjam STATIC)
+ target_link_libraries (h5unjam PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5unjam PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5unjam")
+
+ set (H5_DEP_EXECUTABLES
+ h5jam
+ h5unjam
+ )
+endif ()
+
+if (BUILD_SHARED_LIBS)
+ add_executable (h5jam-shared ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5jam.c)
+ target_include_directories (h5jam-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5jam-shared SHARED)
+ target_link_libraries (h5jam-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ set_target_properties (h5jam-shared PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5jam-shared")
+
+ add_executable (h5unjam-shared ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5unjam.c)
+ target_include_directories (h5unjam-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5unjam-shared SHARED)
+ target_link_libraries (h5unjam-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ set_target_properties (h5unjam-shared PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5unjam-shared")
+
+ set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES}
+ h5jam-shared
+ h5unjam-shared
+ )
+endif ()
##############################################################################
##############################################################################
diff --git a/tools/src/h5jam/Makefile.in b/tools/src/h5jam/Makefile.in
index f4e3529..f16372a 100644
--- a/tools/src/h5jam/Makefile.in
+++ b/tools/src/h5jam/Makefile.in
@@ -491,7 +491,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -514,9 +513,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -543,6 +545,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -597,6 +600,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -621,7 +625,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1301,7 +1304,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt
index 5b31b84..f2470fb 100644
--- a/tools/src/h5ls/CMakeLists.txt
+++ b/tools/src/h5ls/CMakeLists.txt
@@ -4,18 +4,20 @@ project (HDF5_TOOLS_SRC_H5LS C)
#-----------------------------------------------------------------------------
# Add the h5ls executable
#-----------------------------------------------------------------------------
-add_executable (h5ls ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c)
-target_include_directories(h5ls PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5ls STATIC)
-target_link_libraries (h5ls PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_target_properties (h5ls PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5ls")
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h5ls ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c)
+ target_include_directories (h5ls PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5ls STATIC)
+ target_link_libraries (h5ls PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5ls PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5ls")
-set (H5_DEP_EXECUTABLES h5ls)
+ set (H5_DEP_EXECUTABLES h5ls)
+endif ()
if (BUILD_SHARED_LIBS)
add_executable (h5ls-shared ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c)
- target_include_directories(h5ls-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5ls-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5ls-shared SHARED)
target_link_libraries (h5ls-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
set_target_properties (h5ls-shared PROPERTIES FOLDER tools)
diff --git a/tools/src/h5ls/Makefile.in b/tools/src/h5ls/Makefile.in
index db08750..b51cdcb 100644
--- a/tools/src/h5ls/Makefile.in
+++ b/tools/src/h5ls/Makefile.in
@@ -484,7 +484,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -507,9 +506,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -536,6 +538,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -590,6 +593,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -614,7 +618,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1288,7 +1291,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index 4bc1526..3b0001d 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -158,19 +158,13 @@ static hbool_t print_int_type(h5tools_str_t *buffer, hid_t type, int ind);
static hbool_t print_float_type(h5tools_str_t *buffer, hid_t type, int ind);
static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter);
-
+
/*-------------------------------------------------------------------------
* Function: usage
*
* Purpose: Prints a usage message on stderr and then returns.
*
* Return: void
- *
- * Programmer: Robb Matzke
- * Thursday, July 16, 1998
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
@@ -216,6 +210,15 @@ usage (void)
PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n");
PRINTVALSTREAM(rawoutstream, " --vfd=DRIVER Use the specified virtual file driver\n");
PRINTVALSTREAM(rawoutstream, " -x, --hexdump Show raw data in hexadecimal format\n");
+ PRINTVALSTREAM(rawoutstream, " --s3-cred=C Supply S3 authentication information to \"ros3\" vfd.\n");
+ PRINTVALSTREAM(rawoutstream, " Accepts tuple of \"(<aws-region>,<access-id>,<access-key>)\".\n");
+ PRINTVALSTREAM(rawoutstream, " If absent or C->\"(,,)\", defaults to no-authentication.\n");
+ PRINTVALSTREAM(rawoutstream, " Has no effect if vfd flag not set to \"ros3\".\n");
+ PRINTVALSTREAM(rawoutstream, " --hdfs-attrs=A Supply configuration information to Hadoop VFD.\n");
+ PRINTVALSTREAM(rawoutstream, " Accepts tuple of (<namenode name>,<namenode port>,\n");
+ PRINTVALSTREAM(rawoutstream, " ...<kerberos cache path>,<username>,<buffer size>)\n");
+ PRINTVALSTREAM(rawoutstream, " If absent or A == '(,,,,)', all default values are used.\n");
+ PRINTVALSTREAM(rawoutstream, " Has no effect if vfd flag is not 'hdfs'.\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " file/OBJECT\n");
PRINTVALSTREAM(rawoutstream, " Each object consists of an HDF5 file name optionally followed by a\n");
@@ -237,22 +240,14 @@ usage (void)
PRINTVALSTREAM(rawoutstream, " Replaced by --enable-error-stack.\n");
}
-
/*-------------------------------------------------------------------------
- * Function: print_string
- *
- * Purpose: Print a string value by escaping unusual characters. If
- * STREAM is null then we only count how large the output would
- * be.
- *
- * Return: Number of characters printed.
+ * Function: print_string
*
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
+ * Purpose: Print a string value by escaping unusual characters. If
+ * STREAM is null then we only count how large the output would be.
*
+ * Return: Number of characters printed.
*-------------------------------------------------------------------------
*/
static int
@@ -263,50 +258,61 @@ print_string(h5tools_str_t *buffer, const char *s, hbool_t escape_spaces)
for (/*void*/; s && *s; s++) {
switch (*s) {
case '"':
- if (buffer) h5tools_str_append(buffer, "\\\"");
+ if (buffer)
+ h5tools_str_append(buffer, "\\\"");
nprint += 2;
break;
case '\\':
- if (buffer) h5tools_str_append(buffer, "\\\\");
+ if (buffer)
+ h5tools_str_append(buffer, "\\\\");
nprint += 2;
break;
case '\b':
- if (buffer) h5tools_str_append(buffer, "\\b");
+ if (buffer)
+ h5tools_str_append(buffer, "\\b");
nprint += 2;
break;
case '\f':
- if (buffer) h5tools_str_append(buffer, "\\f");
+ if (buffer)
+ h5tools_str_append(buffer, "\\f");
nprint += 2;
break;
case '\n':
- if (buffer) h5tools_str_append(buffer, "\\n");
+ if (buffer)
+ h5tools_str_append(buffer, "\\n");
nprint += 2;
break;
case '\r':
- if (buffer) h5tools_str_append(buffer, "\\r");
+ if (buffer)
+ h5tools_str_append(buffer, "\\r");
nprint += 2;
break;
case '\t':
- if (buffer) h5tools_str_append(buffer, "\\t");
+ if (buffer)
+ h5tools_str_append(buffer, "\\t");
nprint += 2;
break;
case ' ':
if (escape_spaces) {
- if (buffer) h5tools_str_append(buffer, "\\ ");
+ if (buffer)
+ h5tools_str_append(buffer, "\\ ");
nprint += 2;
}
else {
- if (buffer) h5tools_str_append(buffer, " ");
+ if (buffer)
+ h5tools_str_append(buffer, " ");
nprint++;
}
break;
default:
if (isprint((int)*s)) {
- if (buffer) h5tools_str_append(buffer, "%c", *s);
+ if (buffer)
+ h5tools_str_append(buffer, "%c", *s);
nprint++;
}
else {
- if (buffer) h5tools_str_append(buffer, "\\%03o", *((const unsigned char*)s));
+ if (buffer)
+ h5tools_str_append(buffer, "\\%03o", *((const unsigned char*)s));
nprint += 4;
}
break;
@@ -315,44 +321,36 @@ print_string(h5tools_str_t *buffer, const char *s, hbool_t escape_spaces)
return nprint;
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_obj_name
- *
- * Purpose: Print an object name and another string.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
+ * Function: print_obj_name
*
- * Programmer: Quincey Koziol
- * Tuesday, November 6, 2007
- *
- * Modifications:
+ * Purpose: Print an object name and another string.
*
+ * Return: Success: TRUE
+ * Failure: FALSE, nothing printed
*-------------------------------------------------------------------------
*/
static int
-print_obj_name(h5tools_str_t *buffer, const iter_t *iter, const char *oname,
- const char *s)
+print_obj_name(h5tools_str_t *buffer, const iter_t *iter, const char *oname, const char *s)
{
static char fullname[NAME_BUF_SIZE]; /* Buffer for file and/or object name */
const char *name = fullname; /* Pointer to buffer for printing */
int n;
- if(show_file_name_g)
+ if (show_file_name_g)
HDsnprintf(fullname, sizeof(fullname), "%s/%s", iter->fname, oname + iter->name_start);
else
name = oname + iter->name_start;
/* Print the object name, either full name or base name */
- if(fullname_g)
+ if (fullname_g)
n = print_string(buffer, name, TRUE);
else {
const char *last_sep; /* The location of the last group separator */
/* Find the last component of the path name */
- if(NULL == (last_sep = HDstrrchr(name, '/')))
+ if (NULL == (last_sep = HDstrrchr(name, '/')))
last_sep = name;
else {
last_sep++;
@@ -364,161 +362,190 @@ print_obj_name(h5tools_str_t *buffer, const iter_t *iter, const char *oname,
return TRUE;
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_native_type
- *
- * Purpose: Prints the name of a native C data type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed.
+ * Function: print_native_type
*
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- * Robb Matzke, 1999-06-11
- * Added the C9x types, but we still prefer to display the types
- * from the C language itself (like `int' vs. `int32_t').
+ * Purpose: Prints the name of a native C data type.
*
+ * Return: Success: TRUE
+ * Failure: FALSE, nothing printed.
*-------------------------------------------------------------------------
*/
static hbool_t
print_native_type(h5tools_str_t *buffer, hid_t type, int ind)
{
- if(!simple_output_g) {
- if (H5Tequal(type, H5T_NATIVE_SCHAR)==TRUE) {
+ if (!simple_output_g) {
+ if (H5Tequal(type, H5T_NATIVE_SCHAR) == TRUE) {
h5tools_str_append(buffer, "native signed char");
- } else if (H5Tequal(type, H5T_NATIVE_UCHAR)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UCHAR) == TRUE) {
h5tools_str_append(buffer, "native unsigned char");
- } else if (H5Tequal(type, H5T_NATIVE_INT)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_INT) == TRUE) {
h5tools_str_append(buffer, "native int");
- } else if (H5Tequal(type, H5T_NATIVE_UINT)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT) == TRUE) {
h5tools_str_append(buffer, "native unsigned int");
- } else if (H5Tequal(type, H5T_NATIVE_SHORT)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_SHORT) == TRUE) {
h5tools_str_append(buffer, "native short");
- } else if (H5Tequal(type, H5T_NATIVE_USHORT)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_USHORT) == TRUE) {
h5tools_str_append(buffer, "native unsigned short");
- } else if (H5Tequal(type, H5T_NATIVE_LONG)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_LONG) == TRUE) {
h5tools_str_append(buffer, "native long");
- } else if (H5Tequal(type, H5T_NATIVE_ULONG)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_ULONG) == TRUE) {
h5tools_str_append(buffer, "native unsigned long");
- } else if (H5Tequal(type, H5T_NATIVE_LLONG)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_LLONG) == TRUE) {
h5tools_str_append(buffer, "native long long");
- } else if (H5Tequal(type, H5T_NATIVE_ULLONG)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_ULLONG) == TRUE) {
h5tools_str_append(buffer, "native unsigned long long");
- } else if (H5Tequal(type, H5T_NATIVE_FLOAT)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_FLOAT) == TRUE) {
h5tools_str_append(buffer, "native float");
- } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE) {
h5tools_str_append(buffer, "native double");
+ }
#if H5_SIZEOF_LONG_DOUBLE !=0
- } else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)==TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_LDOUBLE) == TRUE) {
h5tools_str_append(buffer, "native long double");
+ }
#endif
- } else if (H5Tequal(type, H5T_NATIVE_INT8)==TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_INT8) == TRUE) {
h5tools_str_append(buffer, "native int8_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT8)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT8) == TRUE) {
h5tools_str_append(buffer, "native uint8_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT16)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_INT16) == TRUE) {
h5tools_str_append(buffer, "native int16_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT16)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT16) == TRUE) {
h5tools_str_append(buffer, "native uint16_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT32)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_INT32) == TRUE) {
h5tools_str_append(buffer, "native int32_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT32)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT32) == TRUE) {
h5tools_str_append(buffer, "native uint32_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT64)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_INT64) == TRUE) {
h5tools_str_append(buffer, "native int64_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT64)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT64) == TRUE) {
h5tools_str_append(buffer, "native uint64_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST8)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_INT_LEAST8) == TRUE) {
h5tools_str_append(buffer, "native int_least8_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST8)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST8) == TRUE) {
h5tools_str_append(buffer, "native uint_least8_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST16)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_INT_LEAST16) == TRUE) {
h5tools_str_append(buffer, "native int_least16_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST16)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST16) == TRUE) {
h5tools_str_append(buffer, "native uint_least16_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST32)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_INT_LEAST32) == TRUE) {
h5tools_str_append(buffer, "native int_least32_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST32)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST32) == TRUE) {
h5tools_str_append(buffer, "native uint_least32_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST64)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_INT_LEAST64) == TRUE) {
h5tools_str_append(buffer, "native int_least64_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST64)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST64) == TRUE) {
h5tools_str_append(buffer, "native uint_least64_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_FAST8)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_INT_FAST8) == TRUE) {
h5tools_str_append(buffer, "native int_fast8_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST8)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT_FAST8) == TRUE) {
h5tools_str_append(buffer, "native uint_fast8_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_FAST16)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_INT_FAST16) == TRUE) {
h5tools_str_append(buffer, "native int_fast16_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST16)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT_FAST16) == TRUE) {
h5tools_str_append(buffer, "native uint_fast16_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_FAST32)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_INT_FAST32) == TRUE) {
h5tools_str_append(buffer, "native int_fast32_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST32)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT_FAST32) == TRUE) {
h5tools_str_append(buffer, "native uint_fast32_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_FAST64)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_INT_FAST64) == TRUE) {
h5tools_str_append(buffer, "native int_fast64_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST64)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_UINT_FAST64) == TRUE) {
h5tools_str_append(buffer, "native uint_fast64_t");
- } else if (H5Tequal(type, H5T_NATIVE_B8)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_B8) == TRUE) {
h5tools_str_append(buffer, "native 8-bit field");
- } else if (H5Tequal(type, H5T_NATIVE_B16)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_B16) == TRUE) {
h5tools_str_append(buffer, "native 16-bit field");
- } else if (H5Tequal(type, H5T_NATIVE_B32)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_B32) == TRUE) {
h5tools_str_append(buffer, "native 32-bit field");
- } else if (H5Tequal(type, H5T_NATIVE_B64)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_B64) == TRUE) {
h5tools_str_append(buffer, "native 64-bit field");
- } else if (H5Tequal(type, H5T_NATIVE_HSIZE)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_HSIZE) == TRUE) {
h5tools_str_append(buffer, "native hsize_t");
- } else if (H5Tequal(type, H5T_NATIVE_HSSIZE)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_HSSIZE) == TRUE) {
h5tools_str_append(buffer, "native hssize_t");
- } else if (H5Tequal(type, H5T_NATIVE_HERR)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_HERR) == TRUE) {
h5tools_str_append(buffer, "native herr_t");
- } else if (H5Tequal(type, H5T_NATIVE_HBOOL)==TRUE) {
+ }
+ else if (H5Tequal(type, H5T_NATIVE_HBOOL) == TRUE) {
h5tools_str_append(buffer, "native hbool_t");
- } else {
+ }
+ else {
return print_int_type(buffer, type, ind);
}
- } else {
+ }
+ else {
return print_int_type(buffer, type, ind);
}
return TRUE;
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_ieee_type
- *
- * Purpose: Print the name of an IEEE floating-point data type.
- *
- * Return: Success: TRUE
+ * Function: print_ieee_type
*
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
+ * Purpose: Print the name of an IEEE floating-point data type.
*
+ * Return: Success: TRUE
+ * Failure: FALSE, nothing printed
*-------------------------------------------------------------------------
*/
static hbool_t
print_ieee_type(h5tools_str_t *buffer, hid_t type, int ind)
{
- if (H5Tequal(type, H5T_IEEE_F32BE)==TRUE) {
+ if (H5Tequal(type, H5T_IEEE_F32BE) == TRUE) {
h5tools_str_append(buffer, "IEEE 32-bit big-endian float");
}
- else if (H5Tequal(type, H5T_IEEE_F32LE)==TRUE) {
+ else if (H5Tequal(type, H5T_IEEE_F32LE) == TRUE) {
h5tools_str_append(buffer, "IEEE 32-bit little-endian float");
}
- else if (H5Tequal(type, H5T_IEEE_F64BE)==TRUE) {
+ else if (H5Tequal(type, H5T_IEEE_F64BE) == TRUE) {
h5tools_str_append(buffer, "IEEE 64-bit big-endian float");
}
- else if (H5Tequal(type, H5T_IEEE_F64LE)==TRUE) {
+ else if (H5Tequal(type, H5T_IEEE_F64LE) == TRUE) {
h5tools_str_append(buffer, "IEEE 64-bit little-endian float");
}
else {
@@ -527,21 +554,15 @@ print_ieee_type(h5tools_str_t *buffer, hid_t type, int ind)
return TRUE;
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_precision
- *
- * Purpose: Prints information on the next line about precision and
- * padding if the precision is less than the total data type
- * size.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
+ * Function: print_precision
*
- * Modifications:
+ * Purpose: Prints information on the next line about precision and
+ * padding if the precision is less than the total data type
+ * size.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -556,13 +577,12 @@ print_precision(h5tools_str_t *buffer, hid_t type, int ind)
/* If the precision is less than the total size then show the precision
* and offset on the following line. Also display the padding
* information. */
- if(8 * H5Tget_size(type) != (prec = H5Tget_precision(type))) {
+ if (8 * H5Tget_size(type) != (prec = H5Tget_precision(type))) {
h5tools_str_append(buffer, "\n%*s(%lu bit%s of precision beginning at bit %lu)",
- ind, "", (unsigned long)prec, 1 == prec ? "" : "s",
- (unsigned long)H5Tget_offset(type));
+ ind, "", (unsigned long)prec, 1 == prec ? "" : "s", (unsigned long)H5Tget_offset(type));
H5Tget_pad(type, &plsb, &pmsb);
- if(H5Tget_offset(type) > 0) {
+ if (H5Tget_offset(type) > 0) {
switch(plsb) {
case H5T_PAD_ZERO:
plsb_s = "zero";
@@ -581,7 +601,7 @@ print_precision(h5tools_str_t *buffer, hid_t type, int ind)
break;
}
}
- if((unsigned)H5Tget_offset(type) + prec < 8 * H5Tget_size(type)) {
+ if ((unsigned)H5Tget_offset(type) + prec < 8 * H5Tget_size(type)) {
switch(pmsb) {
case H5T_PAD_ZERO:
pmsb_s = "zero";
@@ -604,61 +624,53 @@ print_precision(h5tools_str_t *buffer, hid_t type, int ind)
h5tools_str_append(buffer, "\n%*s(", ind, "");
if (plsb_s) {
nbits = (unsigned)H5Tget_offset(type);
- h5tools_str_append(buffer, "%lu %s bit%s at bit 0",
- (unsigned long)nbits, plsb_s, 1 == nbits ? "" : "s");
+ h5tools_str_append(buffer, "%lu %s bit%s at bit 0", (unsigned long)nbits, plsb_s, 1 == nbits ? "" : "s");
}
- if (plsb_s && pmsb_s) h5tools_str_append(buffer, ", ");
+ if (plsb_s && pmsb_s)
+ h5tools_str_append(buffer, ", ");
if (pmsb_s) {
nbits = (8 * H5Tget_size(type)) - ((unsigned)H5Tget_offset(type) + prec);
- h5tools_str_append(buffer, "%lu %s bit%s at bit %lu",
- (unsigned long)nbits, pmsb_s, 1 == nbits ? "" : "s",
- (unsigned long)(8 * H5Tget_size(type) - nbits));
+ h5tools_str_append(buffer, "%lu %s bit%s at bit %lu", (unsigned long)nbits, pmsb_s, 1 == nbits ? "" : "s", (unsigned long)(8 * H5Tget_size(type) - nbits));
}
h5tools_str_append(buffer, ")");
}
}
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_int_type
- *
- * Purpose: Print the name of an integer data type. Common information
- * like number of bits, byte order, and sign scheme appear on
- * the first line. Additional information might appear in
- * parentheses on the following lines.
- *
- * Return: Success: TRUE
+ * Function: print_int_type
*
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
+ * Purpose: Print the name of an integer data type. Common information
+ * like number of bits, byte order, and sign scheme appear on
+ * the first line. Additional information might appear in
+ * parentheses on the following lines.
*
+ * Return: Success: TRUE
+ * Failure: FALSE, nothing printed
*-------------------------------------------------------------------------
*/
static hbool_t
print_int_type(h5tools_str_t *buffer, hid_t type, int ind)
{
- H5T_order_t order; /* byte order value */
- const char *order_s=NULL; /* byte order string */
- H5T_sign_t sign; /* sign scheme value */
- const char *sign_s=NULL; /* sign scheme string */
+ H5T_order_t order; /* byte order value */
+ const char *order_s = NULL; /* byte order string */
+ H5T_sign_t sign; /* sign scheme value */
+ const char *sign_s = NULL; /* sign scheme string */
- if (H5T_INTEGER!=H5Tget_class(type)) return FALSE;
+ if (H5T_INTEGER != H5Tget_class(type))
+ return FALSE;
/* Byte order */
- if (H5Tget_size(type)>1) {
+ if (H5Tget_size(type) > 1) {
order = H5Tget_order(type);
- if (H5T_ORDER_LE==order) {
+ if (H5T_ORDER_LE == order) {
order_s = " little-endian";
}
- else if (H5T_ORDER_BE==order) {
+ else if (H5T_ORDER_BE == order) {
order_s = " big-endian";
}
- else if (H5T_ORDER_VAX==order) {
+ else if (H5T_ORDER_VAX == order) {
order_s = " mixed-endian";
}
else {
@@ -670,11 +682,11 @@ print_int_type(h5tools_str_t *buffer, hid_t type, int ind)
}
/* Sign */
- if ((sign=H5Tget_sign(type))>=0) {
- if (H5T_SGN_NONE==sign) {
+ if ((sign = H5Tget_sign(type)) >= 0) {
+ if (H5T_SGN_NONE == sign) {
sign_s = " unsigned";
}
- else if (H5T_SGN_2==sign) {
+ else if (H5T_SGN_2 == sign) {
sign_s = "";
}
else {
@@ -687,27 +699,19 @@ print_int_type(h5tools_str_t *buffer, hid_t type, int ind)
/* Print size, order, and sign on first line, precision and padding
* information on the subsequent lines */
- h5tools_str_append(buffer, "%lu-bit%s%s integer",
- (unsigned long)(8*H5Tget_size(type)), order_s, sign_s);
+ h5tools_str_append(buffer, "%lu-bit%s%s integer", (unsigned long)(8*H5Tget_size(type)), order_s, sign_s);
print_precision(buffer, type, ind);
return TRUE;
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_float_type
- *
- * Purpose: Print info about a floating point data type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
+ * Function: print_float_type
*
- * Modifications:
+ * Purpose: Print info about a floating point data type.
*
+ * Return: Success: TRUE
+ * Failure: FALSE, nothing printed
*-------------------------------------------------------------------------
*/
static hbool_t
@@ -724,18 +728,19 @@ print_float_type(h5tools_str_t *buffer, hid_t type, int ind)
H5T_pad_t pad; /* internal padding value */
const char *pad_s=NULL; /* internal padding string */
- if (H5T_FLOAT!=H5Tget_class(type)) return FALSE;
+ if (H5T_FLOAT != H5Tget_class(type))
+ return FALSE;
/* Byte order */
- if (H5Tget_size(type)>1) {
+ if (H5Tget_size(type) > 1) {
order = H5Tget_order(type);
- if (H5T_ORDER_LE==order) {
+ if (H5T_ORDER_LE == order) {
order_s = " little-endian";
}
- else if (H5T_ORDER_BE==order) {
+ else if (H5T_ORDER_BE == order) {
order_s = " big-endian";
}
- else if (H5T_ORDER_VAX==order) {
+ else if (H5T_ORDER_VAX == order) {
order_s = " mixed-endian";
}
else {
@@ -748,8 +753,7 @@ print_float_type(h5tools_str_t *buffer, hid_t type, int ind)
/* Print size and byte order on first line, precision and padding on
* subsequent lines. */
- h5tools_str_append(buffer, "%lu-bit%s floating-point",
- (unsigned long)(8*H5Tget_size(type)), order_s);
+ h5tools_str_append(buffer, "%lu-bit%s floating-point", (unsigned long)(8*H5Tget_size(type)), order_s);
print_precision(buffer, type, ind);
/* Print sizes, locations, and other information about each field */
@@ -774,15 +778,13 @@ print_float_type(h5tools_str_t *buffer, hid_t type, int ind)
break;
}
h5tools_str_append(buffer, "\n%*s(significant for %lu bit%s at bit %lu%s)", ind, "",
- (unsigned long)msize, 1==msize?"":"s", (unsigned long)mpos,
- norm_s);
+ (unsigned long)msize, 1==msize?"":"s", (unsigned long)mpos, norm_s);
h5tools_str_append(buffer, "\n%*s(exponent for %lu bit%s at bit %lu, bias is 0x%lx)",
- ind, "", (unsigned long)esize, 1==esize?"":"s",
- (unsigned long)epos, (unsigned long)ebias);
+ ind, "", (unsigned long)esize, 1==esize?"":"s", (unsigned long)epos, (unsigned long)ebias);
h5tools_str_append(buffer, "\n%*s(sign bit at %lu)", ind, "", (unsigned long)spos);
/* Display internal padding */
- if (1+esize+msize<H5Tget_precision(type)) {
+ if ((1 + esize + msize) < H5Tget_precision(type)) {
pad = H5Tget_inpad(type);
switch (pad) {
case H5T_PAD_ZERO:
@@ -807,25 +809,20 @@ print_float_type(h5tools_str_t *buffer, hid_t type, int ind)
return TRUE;
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_cmpd_type
- *
- * Purpose: Print info about a compound data type.
- *
- * Return: Success: TRUE
+ * Function: print_cmpd_type
*
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
+ * Purpose: Print info about a compound data type.
*
+ * Return: Success: TRUE
+ * Failure: FALSE, nothing printed
*-------------------------------------------------------------------------
*/
static hbool_t
print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind)
{
- char *name=NULL; /* member name */
+ char *name = NULL; /* member name */
size_t size; /* total size of type in bytes */
hid_t subtype; /* member data type */
int nmembs; /* number of members */
@@ -838,14 +835,12 @@ print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind)
return FALSE;
h5tools_str_append(buffer, "struct {");
- for(i = 0; i < (unsigned)nmembs; i++) {
-
+ for (i = 0; i < (unsigned)nmembs; i++) {
/* Name and offset */
name = H5Tget_member_name(type, i);
h5tools_str_append(buffer, "\n%*s\"", ind+4, "");
n = print_string(buffer, name, FALSE);
- h5tools_str_append(buffer, "\"%*s +%-4lu ", MAX(0, 16-n), "",
- (unsigned long)H5Tget_member_offset(type, i));
+ h5tools_str_append(buffer, "\"%*s +%-4lu ", MAX(0, 16-n), "", (unsigned long)H5Tget_member_offset(type, i));
H5free_memory(name);
/* Member's type */
@@ -854,27 +849,19 @@ print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind)
H5Tclose(subtype);
}
size = H5Tget_size(type);
- h5tools_str_append(buffer, "\n%*s} %lu byte%s",
- ind, "", (unsigned long)size, 1==size?"":"s");
+ h5tools_str_append(buffer, "\n%*s} %lu byte%s", ind, "", (unsigned long)size, 1==size?"":"s");
return TRUE;
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_enum_type
- *
- * Purpose: Print info about an enumeration data type.
- *
- * Return: Success: TRUE
+ * Function: print_enum_type
*
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Wednesday, December 23, 1998
- *
- * Modifications:
+ * Purpose: Print info about an enumeration data type.
*
+ * Return: Success: TRUE
+ * Failure: FALSE, nothing printed
*-------------------------------------------------------------------------
*/
static hbool_t
@@ -883,9 +870,9 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
int nmembs; /* number of members */
hid_t super; /* enum base integer type */
- if(H5T_ENUM != H5Tget_class(type))
+ if (H5T_ENUM != H5Tget_class(type))
return FALSE;
- if((nmembs = H5Tget_nmembers(type)) < 0)
+ if ((nmembs = H5Tget_nmembers(type)) < 0)
return FALSE;
super = H5Tget_super(type);
@@ -893,7 +880,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
print_type(buffer, super, ind + 4);
h5tools_str_append(buffer, " {");
- if(nmembs > 0) {
+ if (nmembs > 0) {
char **name; /* member names */
unsigned char *value; /* value array */
hid_t native = -1; /* native integer data type */
@@ -905,9 +892,9 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
* 1. long long -- the largest native signed integer
* 2. unsigned long long -- the largest native unsigned integer
* 3. raw format */
- if(H5Tget_size(type) <= sizeof(long long)) {
+ if (H5Tget_size(type) <= sizeof(long long)) {
dst_size = sizeof(long long);
- if(H5T_SGN_NONE == H5Tget_sign(type))
+ if (H5T_SGN_NONE == H5Tget_sign(type))
native = H5T_NATIVE_ULLONG;
else
native = H5T_NATIVE_LLONG;
@@ -918,16 +905,16 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
/* Get the names and raw values of all members */
name = (char **)HDcalloc((size_t)nmembs, sizeof(char *));
value = (unsigned char *)HDcalloc((size_t)nmembs, MAX(H5Tget_size(type), dst_size));
- for(i = 0; i < (unsigned)nmembs; i++) {
+ for (i = 0; i < (unsigned)nmembs; i++) {
name[i] = H5Tget_member_name(type, i);
H5Tget_member_value(type, i, value + i * H5Tget_size(type));
}
/* Convert values to native data type */
- if(native > 0)
- if(H5Tconvert(super, native, (size_t)nmembs, value, NULL, H5P_DEFAULT) < 0) {
+ if (native > 0)
+ if (H5Tconvert(super, native, (size_t)nmembs, value, NULL, H5P_DEFAULT) < 0) {
/* Release resources */
- for(i = 0; i < (unsigned)nmembs; i++)
+ for (i = 0; i < (unsigned)nmembs; i++)
H5free_memory(name[i]);
HDfree(name);
HDfree(value);
@@ -939,7 +926,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
/*not implemented yet*/
/* Print members */
- for(i = 0; i < (unsigned)nmembs; i++) {
+ for (i = 0; i < (unsigned)nmembs; i++) {
unsigned char *copy; /* a pointer to value array */
int nchars; /* number of output characters */
@@ -947,14 +934,14 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
nchars = print_string(buffer, name[i], TRUE);
h5tools_str_append(buffer, "%*s = ", MAX(0, 16 - nchars), "");
- if(native < 0) {
+ if (native < 0) {
size_t j;
h5tools_str_append(buffer, "0x");
- for(j = 0; j < dst_size; j++)
+ for (j = 0; j < dst_size; j++)
h5tools_str_append(buffer, "%02x", value[i*dst_size+j]);
}
- else if(H5T_SGN_NONE == H5Tget_sign(native)) {
+ else if (H5T_SGN_NONE == H5Tget_sign(native)) {
/*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size"
*strangely, unless use another pointer "copy".*/
copy = value + i * dst_size;
@@ -964,8 +951,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
/*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size"
*strangely, unless use another pointer "copy".*/
copy = value + i * dst_size;
- h5tools_str_append(buffer, "%"H5_PRINTF_LL_WIDTH"d",
- *((long long*)((void*)copy)));
+ h5tools_str_append(buffer, "%"H5_PRINTF_LL_WIDTH"d", *((long long*)((void*)copy)));
}
}
@@ -985,21 +971,14 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
return TRUE;
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_string_type
- *
- * Purpose: Print information about a string data type.
+ * Function: print_string_type
*
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
+ * Purpose: Print information about a string data type.
*
+ * Return: Success: TRUE
+ * Failure: FALSE, nothing printed
*-------------------------------------------------------------------------
*/
static hbool_t
@@ -1010,7 +989,8 @@ print_string_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind)
H5T_cset_t cset;
const char *cset_s=NULL;
- if (H5T_STRING!=H5Tget_class(type)) return FALSE;
+ if (H5T_STRING != H5Tget_class(type))
+ return FALSE;
/* Padding */
pad = H5Tget_strpad(type);
@@ -1086,59 +1066,43 @@ print_string_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind)
return TRUE;
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_reference_type
+ * Function: print_reference_type
*
- * Purpose: Prints information about a reference data type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- * Robb Matzke, 1999-06-04
- * Knows about object and dataset region references.
+ * Purpose: Prints information about a reference data type.
*
+ * Return: Success: TRUE
+ * Failure: FALSE, nothing printed
*-------------------------------------------------------------------------
*/
static hbool_t
print_reference_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind)
{
- if (H5T_REFERENCE!=H5Tget_class(type)) return FALSE;
+ if (H5T_REFERENCE != H5Tget_class(type))
+ return FALSE;
- if (H5Tequal(type, H5T_STD_REF_OBJ)==TRUE) {
+ if (H5Tequal(type, H5T_STD_REF_OBJ) == TRUE) {
h5tools_str_append(buffer, "object reference");
}
- else if (H5Tequal(type, H5T_STD_REF_DSETREG)==TRUE) {
+ else if (H5Tequal(type, H5T_STD_REF_DSETREG) == TRUE) {
h5tools_str_append(buffer, "dataset region reference");
}
else {
- h5tools_str_append(buffer, "%lu-byte unknown reference",
- (unsigned long)H5Tget_size(type));
+ h5tools_str_append(buffer, "%lu-byte unknown reference", (unsigned long)H5Tget_size(type));
}
return TRUE;
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_opaque_type
- *
- * Purpose: Prints information about an opaque data type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Monday, June 7, 1999
+ * Function: print_opaque_type
*
- * Modifications:
+ * Purpose: Prints information about an opaque data type.
*
+ * Return: Success: TRUE
+ * Failure: FALSE, nothing printed
*-------------------------------------------------------------------------
*/
static hbool_t
@@ -1147,11 +1111,12 @@ print_opaque_type(h5tools_str_t *buffer, hid_t type, int ind)
char *tag;
size_t size;
- if (H5T_OPAQUE!=H5Tget_class(type)) return FALSE;
+ if (H5T_OPAQUE != H5Tget_class(type))
+ return FALSE;
size = H5Tget_size(type);
h5tools_str_append(buffer, "%lu-byte opaque type", (unsigned long)size);
- if ((tag=H5Tget_tag(type))) {
+ if ((tag = H5Tget_tag(type))) {
h5tools_str_append(buffer, "\n%*s(tag = \"", ind, "");
print_string(buffer, tag, FALSE);
h5tools_str_append(buffer, "\")");
@@ -1160,20 +1125,14 @@ print_opaque_type(h5tools_str_t *buffer, hid_t type, int ind)
return TRUE;
}
-
+
/*-------------------------------------------------------------------------
* Function: print_vlen_type
*
* Purpose: Print information about a variable-length type
*
* Return: Success: TRUE
- *
* Failure: FALSE
- *
- * Programmer: Robb Matzke
- * Friday, December 1, 2000
- *
- * Modifications:
*-------------------------------------------------------------------------
*/
static hbool_t
@@ -1181,27 +1140,22 @@ print_vlen_type(h5tools_str_t *buffer, hid_t type, int ind)
{
hid_t super;
- if (H5T_VLEN!=H5Tget_class(type)) return FALSE;
+ if (H5T_VLEN != H5Tget_class(type))
+ return FALSE;
- h5tools_str_append(buffer, "variable length of\n%*s", ind+4, "");
+ h5tools_str_append(buffer, "variable length of\n%*s", ind + 4, "");
super = H5Tget_super(type);
- print_type(buffer, super, ind+4);
+ print_type(buffer, super, ind + 4);
H5Tclose(super);
return TRUE;
}
-
+
/*---------------------------------------------------------------------------
* Purpose: Print information about an array type
*
* Return: Success: TRUE
- *
* Failure: FALSE
- *
- * Programmer: Robb Matzke
- * Thursday, January 31, 2002
- *
- * Modifications:
*---------------------------------------------------------------------------
*/
static hbool_t
@@ -1211,7 +1165,7 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind)
int ndims, i;
hsize_t *dims=NULL;
- if (H5T_ARRAY!=H5Tget_class(type))
+ if (H5T_ARRAY != H5Tget_class(type))
return FALSE;
ndims = H5Tget_array_ndims(type);
if (ndims) {
@@ -1219,7 +1173,7 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind)
H5Tget_array_dims2(type, dims);
/* Print dimensions */
- for (i=0; i<ndims; i++)
+ for (i = 0; i < ndims; i++)
h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT , i?",":"[", dims[i]);
h5tools_str_append(buffer, "]");
@@ -1237,72 +1191,60 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind)
return TRUE;
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_bitfield_type
- *
- * Purpose: Print information about a bitfield type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
+ * Function: print_bitfield_type
*
- * Programmer: Pedro Vicente
- * Tuesday, May 20, 2003
+ * Purpose: Print information about a bitfield type.
*
- * Modifications:
- * Robb Matzke, LLNL 2003-06-05
- * Generalized Pedro's original if/then/else. Also display
- * precision/offset information.
+ * Return: Success: TRUE
+ * Failure: FALSE, nothing printed
*-------------------------------------------------------------------------
*/
static hbool_t
print_bitfield_type(h5tools_str_t *buffer, hid_t type, int ind)
{
- H5T_order_t order; /* byte order value */
- const char *order_s=NULL; /* byte order string */
+ H5T_order_t order; /* byte order value */
+ const char *order_s = NULL; /* byte order string */
- if (H5T_BITFIELD!=H5Tget_class(type)) return FALSE;
+ if (H5T_BITFIELD != H5Tget_class(type))
+ return FALSE;
if (H5Tget_size(type)>1) {
order = H5Tget_order(type);
- if (H5T_ORDER_LE==order) {
+ if (H5T_ORDER_LE == order) {
order_s = " little-endian";
- } else if (H5T_ORDER_BE==order) {
+ }
+ else if (H5T_ORDER_BE == order) {
order_s = " big-endian";
- } else if (H5T_ORDER_VAX==order) {
+ }
+ else if (H5T_ORDER_VAX == order) {
order_s = " mixed-endian";
- } else {
+ }
+ else {
order_s = "unknown-byte-order";
}
- } else {
+ }
+ else {
order_s = "";
}
- h5tools_str_append(buffer, "%lu-bit%s bitfield",
- (unsigned long)(8*H5Tget_size(type)), order_s);
+ h5tools_str_append(buffer, "%lu-bit%s bitfield", (unsigned long)(8*H5Tget_size(type)), order_s);
print_precision(buffer, type, ind);
return TRUE;
}
/*-------------------------------------------------------------------------
- * Function: print_type
+ * Function: print_type
*
- * Purpose: Prints a data type definition. The definition is printed
- * without any leading space or trailing line-feed (although
- * there might be line-feeds inside the type definition). The
- * first line is assumed to have IND characters before it on
- * the same line (printed by the caller).
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- * Robb Matzke, 1999-06-11
- * Prints the OID of shared data types.
+ * Purpose: Prints a data type definition. The definition is printed
+ * without any leading space or trailing line-feed (although
+ * there might be line-feeds inside the type definition). The
+ * first line is assumed to have IND characters before it on
+ * the same line (printed by the caller).
+ * Prints the OID of shared data types.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -1311,24 +1253,23 @@ print_type(h5tools_str_t *buffer, hid_t type, int ind)
H5T_class_t data_class = H5Tget_class(type);
/* Bad data type */
- if (type<0) {
+ if (type < 0) {
h5tools_str_append(buffer,"<ERROR>");
return;
}
/* Shared? If so then print the type's OID */
- if(H5Tcommitted(type)) {
+ if (H5Tcommitted(type)) {
H5O_info_t oi;
- if(H5Oget_info2(type, &oi, H5O_INFO_BASIC) >= 0)
- h5tools_str_append(buffer,"shared-%lu:"H5_PRINTF_HADDR_FMT" ",
- oi.fileno, oi.addr);
+ if (H5Oget_info2(type, &oi, H5O_INFO_BASIC) >= 0)
+ h5tools_str_append(buffer,"shared-%lu:"H5_PRINTF_HADDR_FMT" ", oi.fileno, oi.addr);
else
h5tools_str_append(buffer,"shared ");
} /* end if */
/* Print the type */
- if(print_native_type(buffer, type, ind) ||
+ if (print_native_type(buffer, type, ind) ||
print_ieee_type(buffer, type, ind) ||
print_cmpd_type(buffer, type, ind) ||
print_enum_type(buffer, type, ind) ||
@@ -1341,25 +1282,16 @@ print_type(h5tools_str_t *buffer, hid_t type, int ind)
return;
/* Unknown type */
- h5tools_str_append(buffer,"%lu-byte class-%u unknown",
- (unsigned long)H5Tget_size(type), (unsigned)data_class);
+ h5tools_str_append(buffer,"%lu-byte class-%u unknown", (unsigned long)H5Tget_size(type), (unsigned)data_class);
}
-
+
/*-------------------------------------------------------------------------
- * Function: dump_dataset_values
- *
- * Purpose: Prints all values of a dataset.
+ * Function: dump_dataset_values
*
- * Return: void
- *
- * Programmer: Robb Matzke
- * Tuesday, July 21, 1998
+ * Purpose: Prints all values of a dataset.
*
- * Modifications:
- * Robb Matzke, 1999-09-27
- * Understands the simple_output_g switch which causes data to
- * be displayed in a more machine-readable format.
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -1368,7 +1300,7 @@ dump_dataset_values(hid_t dset)
char string_prefix[64];
static char fmt_double[16];
static char fmt_float[16];
- hsize_t curr_pos = 0; /* total data element position */
+ hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
h5tool_format_t outputformat;
@@ -1399,7 +1331,8 @@ dump_dataset_values(hid_t dset)
}
outputformat.cmpd_sep = " ";
- if (label_g) outputformat.cmpd_name = "%s=";
+ if (label_g)
+ outputformat.cmpd_name = "%s=";
outputformat.elmt_suf1 = " ";
outputformat.str_locale = ESCAPE_HTML;
@@ -1442,7 +1375,7 @@ dump_dataset_values(hid_t dset)
* command line switch was given. */
outputformat.raw = TRUE;
}
- else if (string_g && 1==size && H5T_INTEGER==H5Tget_class(f_type)) {
+ else if (string_g && 1 == size && H5T_INTEGER == H5Tget_class(f_type)) {
/* Print 1-byte integer data as an ASCI character string instead of
* integers if the `-s' or `--string' command-line option was given. */
outputformat.ascii = TRUE;
@@ -1475,31 +1408,24 @@ dump_dataset_values(hid_t dset)
PRINTVALSTREAM(rawoutstream, "\n");
}
-
+
/*-------------------------------------------------------------------------
- * Function: list_attr
- *
- * Purpose: Prints information about attributes.
- *
- * Return: Success: 0
- *
- * Failure: -1
+ * Function: list_attr
*
- * Programmer: Robb Matzke
- * Friday, June 5, 1998
- *
- * Modifications:
+ * Purpose: Prints information about attributes.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo,
void H5_ATTR_UNUSED *op_data)
{
- hid_t attr = -1;
- hid_t space = -1;
- hid_t type = -1;
- hid_t p_type = -1;
+ hid_t attr = H5I_INVALID_HID;
+ hid_t space = H5I_INVALID_HID;
+ hid_t type = H5I_INVALID_HID;
+ hid_t p_type = H5I_INVALID_HID;
hsize_t size[H5S_MAX_RANK];
hsize_t nelmts = 1;
hsize_t temp_need;
@@ -1522,7 +1448,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
print_string(&buffer, attr_name, TRUE);
- if((attr = H5Aopen(obj, attr_name, H5P_DEFAULT))) {
+ if ((attr = H5Aopen(obj, attr_name, H5P_DEFAULT))) {
space = H5Aget_space(attr);
type = H5Aget_type(attr);
@@ -1539,7 +1465,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
case H5S_SIMPLE:
/* simple dataspace */
h5tools_str_append(&buffer, " {");
- for (i=0; i<ndims; i++) {
+ for (i = 0; i < ndims; i++) {
h5tools_str_append(&buffer, "%s" HSIZE_T_FORMAT, i?", ":"", size[i]);
nelmts *= size[i];
}
@@ -1571,7 +1497,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
/* Data */
outputformat = *info;
- if(nelmts < 5) {
+ if (nelmts < 5) {
outputformat.idx_fmt = "";
outputformat.line_1st = " Data: ";
outputformat.line_pre = " ";
@@ -1590,10 +1516,9 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
}
outputformat.line_ncols = (unsigned)width_g;
- if(label_g)
+ if (label_g)
outputformat.cmpd_name = "%s=";
- if(string_g && 1==H5Tget_size(type) &&
- H5T_INTEGER==H5Tget_class(type)) {
+ if (string_g && 1 == H5Tget_size(type) && H5T_INTEGER == H5Tget_class(type)) {
outputformat.ascii = TRUE;
outputformat.elmt_suf1 = "";
outputformat.elmt_suf2 = "";
@@ -1617,13 +1542,13 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
info = &outputformat;
- if(space_type != H5S_NULL && space_type != H5S_NO_CLASS) {
- if(hexdump_g)
+ if (space_type != H5S_NULL && space_type != H5S_NO_CLASS) {
+ if (hexdump_g)
p_type = H5Tcopy(type);
else
p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT);
- if(p_type >= 0) {
+ if (p_type >= 0) {
/* VL data special information */
unsigned int vl_data = 0; /* contains VL datatypes */
@@ -1662,24 +1587,17 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
return 0;
}
-
+
/*-------------------------------------------------------------------------
- * Function: dataset_list1
- *
- * Purpose: List information about a dataset which should appear on the
- * same line as the dataset name. This information will precede
- * information which is applicable to all objects which will be
- * printed by the caller.
- *
- * Return: Success: 0
+ * Function: dataset_list1
*
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Thursday, August 27, 1998
- *
- * Modifications:
+ * Purpose: List information about a dataset which should appear on the
+ * same line as the dataset name. This information will precede
+ * information which is applicable to all objects which will be
+ * printed by the caller.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1687,13 +1605,13 @@ dataset_list1(hid_t dset)
{
hsize_t cur_size[H5S_MAX_RANK]; /* current dataset dimensions */
hsize_t max_size[H5S_MAX_RANK]; /* maximum dataset dimensions */
- hid_t space; /* data space */
- int ndims; /* dimensionality */
- H5S_class_t space_type; /* type of dataspace */
- int i;
- hsize_t curr_pos = 0; /* total data element position */
- h5tools_str_t buffer; /* string into which to render */
- h5tools_context_t ctx; /* print context */
+ hid_t space; /* data space */
+ int ndims; /* dimensionality */
+ H5S_class_t space_type; /* type of dataspace */
+ int i;
+ hsize_t curr_pos = 0; /* total data element position */
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t ctx; /* print context */
h5tool_format_t *info = &ls_dataformat;
HDmemset(&ctx, 0, sizeof(ctx));
@@ -1707,17 +1625,19 @@ dataset_list1(hid_t dset)
space_type = H5Sget_simple_extent_type(space);
ndims = H5Sget_simple_extent_dims(space, cur_size, max_size);
h5tools_str_append(&buffer, " {");
- for (i=0; i<ndims; i++) {
+ for (i = 0; i < ndims; i++) {
h5tools_str_append(&buffer, "%s"HSIZE_T_FORMAT, i?", ":"", cur_size[i]);
if (max_size[i]==H5S_UNLIMITED) {
h5tools_str_append(&buffer, "/%s", "Inf");
}
- else if (max_size[i]!=cur_size[i] || verbose_g>0) {
+ else if (max_size[i] != cur_size[i] || verbose_g > 0) {
h5tools_str_append(&buffer, "/"HSIZE_T_FORMAT, max_size[i]);
}
}
- if (space_type==H5S_SCALAR) h5tools_str_append(&buffer, "SCALAR");
- else if (space_type==H5S_NULL) h5tools_str_append(&buffer, "NULL");
+ if (space_type == H5S_SCALAR)
+ h5tools_str_append(&buffer, "SCALAR");
+ else if (space_type == H5S_NULL)
+ h5tools_str_append(&buffer, "NULL");
h5tools_str_append(&buffer, "}");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
H5Sclose (space);
@@ -1727,22 +1647,15 @@ dataset_list1(hid_t dset)
return 0;
}
-
+
/*-------------------------------------------------------------------------
- * Function: dataset_list2
- *
- * Purpose: List information about a dataset which should appear after
- * information which is general to all objects.
- *
- * Return: Success: 0
- *
- * Failure: -1
+ * Function: dataset_list2
*
- * Programmer: Robb Matzke
- * Thursday, August 27, 1998
- *
- * Modifications:
+ * Purpose: List information about a dataset which should appear after
+ * information which is general to all objects.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1767,8 +1680,8 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
double utilization; /* percent utilization of storage */
H5T_class_t tclass; /* datatype class identifier */
int i;
- H5D_layout_t stl;
- hsize_t curr_pos = 0; /* total data element position */
+ H5D_layout_t stl;
+ hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
h5tool_format_t *info = &ls_dataformat;
@@ -1778,7 +1691,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
h5tools_str_reset(&buffer);
- if(verbose_g > 0) {
+ if (verbose_g > 0) {
dcpl = H5Dget_create_plist(dset);
space = H5Dget_space(dset);
type = H5Dget_type(dset);
@@ -1792,7 +1705,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
ndims = H5Pget_chunk(dcpl, (int)NELMTS(chsize), chsize/*out*/);
h5tools_str_append(&buffer, " %-10s {", "Chunks:");
total = H5Tget_size(type);
- for (i=0; i<ndims; i++) {
+ for (i = 0; i < ndims; i++) {
h5tools_str_append(&buffer, "%s"HSIZE_T_FORMAT, i?", ":"", chsize[i]);
total *= chsize[i];
}
@@ -1803,29 +1716,25 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
break;
case H5D_CONTIGUOUS:
/* Print information about external storage */
- if((nf = H5Pget_external_count(dcpl)) > 0) {
- for(i = 0, max_len = 0; i < nf; i++) {
- if(H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, NULL, NULL) < 0)
+ if ((nf = H5Pget_external_count(dcpl)) > 0) {
+ for (i = 0, max_len = 0; i < nf; i++) {
+ if (H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, NULL, NULL) < 0)
continue;
n = print_string(NULL, f_name, TRUE);
max_len = MAX(max_len, n);
} /* end for */
- h5tools_str_append(&buffer, " %-10s %d external file%s\n",
- "Extern:", nf, 1==nf?"":"s");
- h5tools_str_append(&buffer, " %4s %10s %10s %10s %s\n",
- "ID", "DSet-Addr", "File-Addr", "Bytes", "File");
- h5tools_str_append(&buffer, " %4s %10s %10s %10s ",
- "----", "----------", "----------", "----------");
- for (i=0; i<max_len; i++) h5tools_str_append(&buffer, "-");
+ h5tools_str_append(&buffer, " %-10s %d external file%s\n", "Extern:", nf, 1==nf?"":"s");
+ h5tools_str_append(&buffer, " %4s %10s %10s %10s %s\n", "ID", "DSet-Addr", "File-Addr", "Bytes", "File");
+ h5tools_str_append(&buffer, " %4s %10s %10s %10s ", "----", "----------", "----------", "----------");
+ for (i = 0; i < max_len; i++)
+ h5tools_str_append(&buffer, "-");
h5tools_str_append(&buffer, "\n");
- for (i=0, total=0; i<nf; i++) {
+ for (i = 0, total=0; i < nf; i++) {
if (H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, &f_offset, &f_size)<0) {
- h5tools_str_append(&buffer,
- " #%03d %10"H5_PRINTF_LL_WIDTH"u %10s %10s ***ERROR*** %s\n",
- i, total, "", "",
- i+1<nf?"Following addresses are incorrect":"");
+ h5tools_str_append(&buffer, " #%03d %10"H5_PRINTF_LL_WIDTH"u %10s %10s ***ERROR*** %s\n",
+ i, total, "", "", i+1<nf?"Following addresses are incorrect":"");
}
- else if (H5S_UNLIMITED==f_size) {
+ else if (H5S_UNLIMITED == f_size) {
h5tools_str_append(&buffer, " #%03d %10"H5_PRINTF_LL_WIDTH"u %10"H5_PRINTF_LL_WIDTH"u %10s ",
i, total, (hsize_t)f_offset, "INF");
print_string(&buffer, f_name, TRUE);
@@ -1838,9 +1747,8 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
h5tools_str_append(&buffer, "\n");
total += f_size;
}
- h5tools_str_append(&buffer, " %4s %10s %10s %10s ",
- "----", "----------", "----------", "----------");
- for (i=0; i<max_len; i++)
+ h5tools_str_append(&buffer, " %4s %10s %10s %10s ", "----", "----------", "----------", "----------");
+ for (i = 0; i < max_len; i++)
h5tools_str_append(&buffer, "-");
h5tools_str_append(&buffer, "\n");
} /* end if */
@@ -1882,16 +1790,13 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
used = H5Dget_storage_size(dset);
tclass = H5Tget_class(type);
h5tools_str_append(&buffer, " %-10s ", "Storage:");
- switch (tclass)
- {
-
+ switch (tclass) {
case H5T_VLEN:
h5tools_str_append(&buffer, "information not available");
break;
case H5T_REFERENCE:
- if ( H5Tequal(type, H5T_STD_REF_DSETREG))
- {
+ if (H5Tequal(type, H5T_STD_REF_DSETREG)) {
h5tools_str_append(&buffer, "information not available");
}
break;
@@ -1908,11 +1813,8 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
case H5T_ARRAY:
case H5T_NCLASSES:
default:
- h5tools_str_append(&buffer, HSIZE_T_FORMAT" logical byte%s, "HSIZE_T_FORMAT" allocated byte%s",
- total, 1==total?"":"s",
- used, 1==used?"":"s");
- if (used>0)
- {
+ h5tools_str_append(&buffer, HSIZE_T_FORMAT" logical byte%s, "HSIZE_T_FORMAT" allocated byte%s", total, 1==total?"":"s", used, 1==used?"":"s");
+ if (used > 0) {
utilization = ((double)total * (double)100.0f) / (double)used;
h5tools_str_append(&buffer, ", %1.2f%% utilization", utilization);
}
@@ -1921,18 +1823,14 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
h5tools_str_append(&buffer, "\n");
/* Print information about raw data filters */
- if((nf = H5Pget_nfilters(dcpl)) > 0) {
- for(i = 0; i < nf; i++) {
+ if ((nf = H5Pget_nfilters(dcpl)) > 0) {
+ for (i = 0; i < nf; i++) {
cd_nelmts = NELMTS(cd_values);
- filt_id = H5Pget_filter2(dcpl, (unsigned)i, &filt_flags, &cd_nelmts,
- cd_values, sizeof(f_name), f_name, NULL);
+ filt_id = H5Pget_filter2(dcpl, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), f_name, NULL);
f_name[sizeof(f_name) - 1] = '\0';
HDsnprintf(s, sizeof(s), "Filter-%d:", i);
- h5tools_str_append(&buffer, " %-10s %s-%u %s {", s,
- (f_name[0] ? f_name : "method"),
- (unsigned)filt_id,
- ((filt_flags & H5Z_FLAG_OPTIONAL) ? "OPT" : ""));
- for(cd_num = 0; cd_num < cd_nelmts; cd_num++)
+ h5tools_str_append(&buffer, " %-10s %s-%u %s {", s, (f_name[0] ? f_name : "method"), (unsigned)filt_id, ((filt_flags & H5Z_FLAG_OPTIONAL) ? "OPT" : ""));
+ for (cd_num = 0; cd_num < cd_nelmts; cd_num++)
h5tools_str_append(&buffer, "%s%u", (cd_num ? ", " : ""), cd_values[cd_num]);
h5tools_str_append(&buffer, "}\n");
} /* end for */
@@ -1945,7 +1843,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
/* Print address information */
- if(address_g)
+ if (address_g)
H5Ddebug(dset);
/* Close stuff */
@@ -1956,35 +1854,28 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
h5tools_str_close(&buffer);
- if(data_g)
+ if (data_g)
dump_dataset_values(dset);
return 0;
} /* end dataset_list2() */
-
+
/*-------------------------------------------------------------------------
- * Function: datatype_list2
- *
- * Purpose: List information about a datatype which should appear after
- * information which is general to all objects.
- *
- * Return: Success: 0
+ * Function: datatype_list2
*
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
+ * Purpose: List information about a datatype which should appear after
+ * information which is general to all objects.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
datatype_list2(hid_t type, const char H5_ATTR_UNUSED *name)
{
- if (verbose_g>0) {
- hsize_t curr_pos = 0; /* total data element position */
+ if (verbose_g > 0) {
+ hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
h5tool_format_t *info = &ls_dataformat;
@@ -2004,19 +1895,14 @@ datatype_list2(hid_t type, const char H5_ATTR_UNUSED *name)
return 0;
}
-
+
/*-------------------------------------------------------------------------
- * Function: list_obj
- *
- * Purpose: Prints information about an object
- *
- * Return: Success: 0
- *
- * Failure: -1
+ * Function: list_obj
*
- * Programmer: Quincey Koziol
- * Tuesday, November 6, 2007
+ * Purpose: Prints information about an object
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2024,7 +1910,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
{
H5O_type_t obj_type = oinfo->type; /* Type of the object */
iter_t *iter = (iter_t*)_iter;
- hsize_t curr_pos = 0; /* total data element position */
+ hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
h5tool_format_t *info = &ls_dataformat;
@@ -2035,37 +1921,37 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
h5tools_str_reset(&buffer);
/* Print the link's name, either full name or base name */
- if(!iter->symlink_target)
+ if (!iter->symlink_target)
print_obj_name(&buffer, iter, name, "");
/* Check object information */
- if(oinfo->type < 0 || oinfo->type >= H5O_TYPE_NTYPES) {
+ if (oinfo->type < 0 || oinfo->type >= H5O_TYPE_NTYPES) {
h5tools_str_append(&buffer, "Unknown type(%d)", (int)oinfo->type);
obj_type = H5O_TYPE_UNKNOWN;
}
- if(iter->symlink_target)
+ if (iter->symlink_target)
h5tools_str_append(&buffer, "{");
- if(obj_type >= 0 && dispatch_g[obj_type].name)
+ if (obj_type >= 0 && dispatch_g[obj_type].name)
h5tools_str_append(&buffer, "%s", dispatch_g[obj_type].name);
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
/* Check if we've seen this object before */
- if(first_seen) {
+ if (first_seen) {
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, ", same as ");
print_string(&buffer, first_seen, TRUE);
- if(!iter->symlink_target) {
+ if (!iter->symlink_target) {
h5tools_str_append(&buffer, "\n");
}
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
} /* end if */
else {
- hid_t obj = (-1); /* ID of object opened */
+ hid_t obj = H5I_INVALID_HID; /* ID of object opened */
/* Open the object. Not all objects can be opened. If this is the case
* then return right away.
*/
- if(obj_type >= 0 && (obj = H5Oopen(iter->fid, name, H5P_DEFAULT)) < 0) {
+ if (obj_type >= 0 && (obj = H5Oopen(iter->fid, name, H5P_DEFAULT)) < 0) {
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " *ERROR*\n");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
@@ -2073,9 +1959,9 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
} /* end if */
/* List the first line of information for the object. */
- if(obj_type >= 0 && dispatch_g[obj_type].list1)
+ if (obj_type >= 0 && dispatch_g[obj_type].list1)
(dispatch_g[obj_type].list1)(obj);
- if(!iter->symlink_target || (verbose_g > 0)) {
+ if (!iter->symlink_target || (verbose_g > 0)) {
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "\n");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
@@ -2083,13 +1969,13 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
/* Show detailed information about the object, beginning with information
* which is common to all objects. */
- if(verbose_g > 0) {
+ if (verbose_g > 0) {
size_t buf_size = 0;
char* comment = NULL;
ssize_t cmt_bufsize = -1;
/* Display attributes */
- if(obj_type >= 0)
+ if (obj_type >= 0)
H5Aiterate2(obj, H5_INDEX_NAME, H5_ITER_INC, NULL, list_attr, NULL);
/* Object location & reference count */
@@ -2099,7 +1985,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
/* Modification time */
- if(oinfo->mtime > 0) {
+ if (oinfo->mtime > 0) {
char buf[256];
struct tm *tm;
@@ -2107,7 +1993,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
tm = HDgmtime(&(oinfo->mtime));
else
tm = HDlocaltime(&(oinfo->mtime));
- if(tm) {
+ if (tm) {
HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm);
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " %-10s %s\n", "Modified:", buf);
@@ -2123,9 +2009,9 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
* If the call to H5Oget_comment returned an error, skip this block */
if (cmt_bufsize > 0) {
comment = (char *)HDmalloc((size_t)cmt_bufsize + 1); /* new_size including null terminator */
- if(comment) {
+ if (comment) {
cmt_bufsize = H5Oget_comment(obj, comment, (size_t)cmt_bufsize);
- if(cmt_bufsize > 0) {
+ if (cmt_bufsize > 0) {
comment[cmt_bufsize] = 0;
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " %-10s \"", "Comment:");
@@ -2139,16 +2025,16 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
} /* end if */
/* Detailed list for object */
- if(obj_type >= 0 && dispatch_g[obj_type].list2)
+ if (obj_type >= 0 && dispatch_g[obj_type].list2)
(dispatch_g[obj_type].list2)(obj, name);
/* Close the object. */
- if(obj_type >= 0)
+ if (obj_type >= 0)
H5Oclose(obj);
} /* end else */
done:
- if(iter->symlink_target) {
+ if (iter->symlink_target) {
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "}\n");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
@@ -2160,29 +2046,23 @@ done:
} /* end list_obj() */
-
/*-------------------------------------------------------------------------
* Function: list_lnk
*
* Purpose: Prints information about a link
*
* Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Quincey Koziol
- * Thursday, November 8, 2007
- *
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
{
- char *buf=NULL;
+ char *buf = NULL;
iter_t *iter = (iter_t*)_iter;
- int ret;
- hsize_t curr_pos = 0; /* total data element position */
- h5tool_link_info_t lnk_info;
+ int ret;
+ hsize_t curr_pos = 0; /* total data element position */
+ h5tool_link_info_t lnk_info;
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
h5tool_format_t *info = &ls_dataformat;
@@ -2219,15 +2099,13 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
h5tools_str_append(&buffer, buf);
h5tools_str_append(&buffer, "}");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
- if(follow_symlink_g)
- {
+ if (follow_symlink_g) {
hbool_t orig_grp_literal = grp_literal_g;
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " ");
/* Check if we have already seen this softlink */
- if(symlink_is_visited(iter->symlink_list, linfo->type, NULL, buf))
- {
+ if (symlink_is_visited(iter->symlink_list, linfo->type, NULL, buf)) {
h5tools_str_append(&buffer, "{Already Visited}\n");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
goto done;
@@ -2235,7 +2113,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
/* Add this link to the list of seen softlinks */
- if(symlink_visit_add(iter->symlink_list, linfo->type, NULL, buf) < 0)
+ if (symlink_visit_add(iter->symlink_list, linfo->type, NULL, buf) < 0)
goto done;
/* Adjust user data to specify that we are operating on the
@@ -2244,11 +2122,10 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
/* Prevent recursive listing of soft link target if
* recursive_g is off */
- if(!recursive_g)
+ if (!recursive_g)
grp_literal_g = TRUE;
/* Recurse through the soft link */
- if(visit_obj(iter->fid, name, iter) < 0)
- {
+ if (visit_obj(iter->fid, name, iter) < 0) {
grp_literal_g = orig_grp_literal;
goto done;
}
@@ -2280,7 +2157,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
else if (no_dangling_link_g && ret == 0)
iter->symlink_list->dangle_link = TRUE;
- if(H5Lunpack_elink_val(buf, linfo->u.val_size, NULL, &filename, &path) < 0)
+ if (H5Lunpack_elink_val(buf, linfo->u.val_size, NULL, &filename, &path) < 0)
goto done;
h5tools_str_append(&buffer, "External Link {");
@@ -2288,21 +2165,19 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
h5tools_str_append(&buffer, "/");
if(*path != '/')
h5tools_str_append(&buffer, "/");
- h5tools_str_append(&buffer, path);
+ h5tools_str_append(&buffer, path);
h5tools_str_append(&buffer, "}");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
/* Recurse through the external link */
/* keep the follow_elink_g for backward compatibility with -E */
- if(follow_link)
- {
+ if (follow_link) {
hbool_t orig_grp_literal = grp_literal_g;
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " ");
/* Check if we have already seen this elink */
- if(symlink_is_visited(iter->symlink_list, linfo->type, filename, path))
- {
+ if (symlink_is_visited(iter->symlink_list, linfo->type, filename, path)) {
h5tools_str_append(&buffer, "{Already Visited}\n");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
goto done;
@@ -2310,8 +2185,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
/* Add this link to the list of seen elinks */
- if(symlink_visit_add(iter->symlink_list, linfo->type, filename, path) < 0)
- {
+ if (symlink_visit_add(iter->symlink_list, linfo->type, filename, path) < 0) {
goto done;
}
@@ -2321,11 +2195,11 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
/* Prevent recursive listing of external link target if
* recursive_g is off */
- if(!recursive_g)
+ if (!recursive_g)
grp_literal_g = TRUE;
/* Recurse through the external link */
- if(visit_obj(iter->fid, name, iter) < 0) {
+ if (visit_obj(iter->fid, name, iter) < 0) {
grp_literal_g = orig_grp_literal;
goto done;
}
@@ -2354,28 +2228,22 @@ done:
return 0;
} /* end list_lnk() */
-
+
/*-------------------------------------------------------------------------
- * Function: visit_obj
- *
- * Purpose: Begins iteration on an object
+ * Function: visit_obj
*
- * Return:
- * Success: 0
- * Failure: -1
- *
- * Programmer: Neil Fortner
- * Wednesday, August 21, 2008
- * Mostly copied from main()
+ * Purpose: Begins iteration on an object
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
visit_obj(hid_t file, const char *oname, iter_t *iter)
{
- int retval = 0;
- H5O_info_t oi; /* Information for object */
- hsize_t curr_pos = 0; /* total data element position */
+ int retval = 0;
+ H5O_info_t oi; /* Information for object */
+ hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
h5tool_format_t *info = &ls_dataformat;
@@ -2386,8 +2254,8 @@ visit_obj(hid_t file, const char *oname, iter_t *iter)
h5tools_str_reset(&buffer);
/* Retrieve info for object to list */
- if(H5Oget_info_by_name2(file, oname, &oi, H5O_INFO_BASIC|H5O_INFO_TIME, H5P_DEFAULT) < 0) {
- if(iter->symlink_target) {
+ if (H5Oget_info_by_name2(file, oname, &oi, H5O_INFO_BASIC|H5O_INFO_TIME, H5P_DEFAULT) < 0) {
+ if (iter->symlink_target) {
h5tools_str_append(&buffer, "{**NOT FOUND**}\n");
iter->symlink_target = FALSE;
}
@@ -2399,9 +2267,9 @@ visit_obj(hid_t file, const char *oname, iter_t *iter)
} /* end if */
/* Check for group iteration */
- if(H5O_TYPE_GROUP == oi.type && !grp_literal_g) {
+ if (H5O_TYPE_GROUP == oi.type && !grp_literal_g) {
/* Get ID for group */
- if(!iter->symlink_target && (iter->gid = H5Gopen2(file, oname, H5P_DEFAULT)) < 0) {
+ if (!iter->symlink_target && (iter->gid = H5Gopen2(file, oname, H5P_DEFAULT)) < 0) {
h5tools_str_append(&buffer, "%s: unable to open '%s' as group\n", iter->fname, oname);
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
goto done; /* Previously "continue", when this code was in main().
@@ -2417,7 +2285,7 @@ visit_obj(hid_t file, const char *oname, iter_t *iter)
h5trav_visit(file, oname, (hbool_t) (display_root_g || iter->symlink_target), recursive_g, list_obj, list_lnk, iter, H5O_INFO_BASIC|H5O_INFO_TIME);
/* Close group */
- if(!iter->symlink_target)
+ if (!iter->symlink_target)
H5Gclose(iter->gid);
} /* end if */
else {
@@ -2434,35 +2302,28 @@ done:
return retval;
}
-
+
/*-------------------------------------------------------------------------
- * Function: get_width
- *
- * Purpose: Figure out how wide the screen is. This is highly
- * unportable, but the user can always override the width we
- * detect by giving a command-line option. These code snippets
- * were borrowed from the GNU less(1).
- *
- * Return: Success: Number of columns.
- *
- * Failure: Some default number of columms.
+ * Function: get_width
*
- * Programmer: Robb Matzke
- * Friday, November 6, 1998
- *
- * Modifications:
+ * Purpose: Figure out how wide the screen is. This is highly
+ * unportable, but the user can always override the width we
+ * detect by giving a command-line option. These code snippets
+ * were borrowed from the GNU less(1).
*
+ * Return: Success: Number of columns.
+ * Failure: Some default number of columms.
*-------------------------------------------------------------------------
*/
static int
get_width(void)
{
- int width = 80; /*the default */
+ int width = 80; /*the default */
char *s;
/* Try to get it from the COLUMNS environment variable first since it's
* value is sometimes wrong. */
- if ((s=HDgetenv("COLUMNS")) && *s && isdigit((int)*s))
+ if ((s = HDgetenv("COLUMNS")) && *s && isdigit((int)*s))
width = (int)HDstrtol(s, NULL, 0);
#if defined(H5_HAVE_STRUCT_VIDEOCONFIG) && defined(H5_HAVE__GETVIDEOCONFIG)
@@ -2510,37 +2371,31 @@ get_width(void)
#endif
/* Set to at least 1 */
- if (width<1) width = 1;
+ if (width < 1)
+ width = 1;
return width;
}
/*-------------------------------------------------------------------------
- * Function: is_valid_args
- *
- * Purpose: check if command line arguments are valid
- *
- * Return:
- * Success: TRUE (1)
- * Failure: FALSE (0)
+ * Function: is_valid_args
*
- * Programmer:
- * Jonathan Kim (06/15/2010)
+ * Purpose: check if command line arguments are valid
*
+ * Return: Success: TRUE (1)
+ * Failure: FALSE (0)
*-------------------------------------------------------------------------*/
static hbool_t
is_valid_args(void)
{
hbool_t ret = TRUE;
- if(recursive_g && grp_literal_g)
- {
+ if (recursive_g && grp_literal_g) {
HDfprintf(rawerrorstream, "Error: 'recursive' option not compatible with 'group info' option!\n\n");
ret = FALSE;
goto out;
}
- if(no_dangling_link_g && !follow_symlink_g)
- {
+ if (no_dangling_link_g && !follow_symlink_g) {
HDfprintf(rawerrorstream, "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n");
ret = FALSE;
goto out;
@@ -2550,19 +2405,13 @@ out:
return ret;
}
-
+
/*-------------------------------------------------------------------------
- * Function: leave
- *
- * Purpose: Close HDF5 and MPI and call exit()
- *
- * Return: Does not return
+ * Function: leave
*
- * Programmer: Quincey Koziol
- * Saturday, January 31, 2004
- *
- * Modifications:
+ * Purpose: Close HDF5 and MPI and call exit()
*
+ * Return: Does not return
*-------------------------------------------------------------------------
*/
static void
@@ -2573,35 +2422,52 @@ leave(int ret)
HDexit(ret);
}
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Opens a file and lists the specified group
- *
- * Return: Success: 0
- *
- * Failure: 1
- *
- * Programmer: Robb Matzke
- * Monday, March 23, 1998
- *
- * Modifications:
+ * Purpose: Opens a file and lists the specified group
*
+ * Return: Success: 0
+ * Failure: 1
*-------------------------------------------------------------------------
*/
int
main(int argc, const char *argv[])
{
- hid_t file = -1;
- char *fname = NULL, *oname = NULL, *x;
+ hid_t file = H5I_INVALID_HID;
+ char *fname = NULL, *oname = NULL, *x;
const char *s = NULL;
- char *rest;
- int argno;
+ char *rest;
+ int argno;
static char root_name[] = "/";
char drivername[50];
const char *preferred_driver = NULL;
- int err_exit = 0;
+ int err_exit = 0;
+ hid_t fapl_id = H5P_DEFAULT;
+
+#ifdef H5_HAVE_ROS3_VFD
+ /* default "anonymous" s3 configuration */
+ H5FD_ros3_fapl_t ros3_fa = {
+ 1, /* fapl version */
+ false, /* authenticate */
+ "", /* aws region */
+ "", /* access key id */
+ "", /* secret access key */
+ };
+#endif /* H5_HVAE_ROS3_VFD */
+
+#ifdef H5_HAVE_LIBHDFS
+ /* "default" HDFS configuration */
+ H5FD_hdfs_fapl_t hdfs_fa = {
+ 1, /* fapl version */
+ "localhost", /* namenode name */
+ 0, /* namenode port */
+ "", /* kerberos ticket cache */
+ "", /* user name */
+ 2048, /* stream buffer size */
+ };
+#endif /* H5_HAVE_LIBHDFS */
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
@@ -2618,90 +2484,257 @@ main(int argc, const char *argv[])
width_g = get_width();
/* Switches come before non-switch arguments */
- for(argno = 1; argno < argc && '-' == argv[argno][0]; argno++) {
- if(!HDstrcmp(argv[argno], "--")) {
+ for (argno = 1; argno < argc && '-' == argv[argno][0]; argno++) {
+ if (!HDstrcmp(argv[argno], "--")) {
/* Last switch */
argno++;
break;
- } else if(!HDstrcmp(argv[argno], "--help")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--help")) {
usage();
leave(EXIT_SUCCESS);
- } else if(!HDstrcmp(argv[argno], "--address")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--address")) {
address_g = TRUE;
- } else if(!HDstrcmp(argv[argno], "--data")) {
+ }
+ else if(!HDstrcmp(argv[argno], "--data")) {
data_g = TRUE;
- } else if(!HDstrcmp(argv[argno], "--enable-error-stack")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--enable-error-stack")) {
show_errors_g = TRUE;
/* deprecated --errors */
- } else if(!HDstrcmp(argv[argno], "--errors")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--errors")) {
show_errors_g = TRUE;
- } else if(!HDstrcmp(argv[argno], "--follow-symlinks")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--follow-symlinks")) {
follow_symlink_g = TRUE;
- } else if(!HDstrcmp(argv[argno], "--no-dangling-links")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--no-dangling-links")) {
no_dangling_link_g = TRUE;
- } else if(!HDstrcmp(argv[argno], "--external")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--external")) {
follow_elink_g = TRUE;
- } else if(!HDstrcmp(argv[argno], "--full")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--full")) {
fullname_g = TRUE;
- } else if(!HDstrcmp(argv[argno], "--group")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--group")) {
grp_literal_g = TRUE;
- } else if(!HDstrcmp(argv[argno], "--label")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--label")) {
label_g = TRUE;
- } else if(!HDstrcmp(argv[argno], "--recursive")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--recursive")) {
recursive_g = TRUE;
fullname_g = TRUE;
- } else if(!HDstrcmp(argv[argno], "--simple")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--simple")) {
simple_output_g = TRUE;
- } else if(!HDstrcmp(argv[argno], "--string")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--string")) {
string_g = TRUE;
- } else if(!HDstrncmp(argv[argno], "--vfd=", (size_t)6)) {
+ }
+ else if (!HDstrncmp(argv[argno], "--vfd=", (size_t)6)) {
preferred_driver = argv[argno]+6;
- } else if(!HDstrncmp(argv[argno], "--width=", (size_t)8)) {
+ }
+ else if (!HDstrncmp(argv[argno], "--width=", (size_t)8)) {
width_g = (int)HDstrtol(argv[argno]+8, &rest, 0);
- if(0 == width_g)
+ if (0 == width_g)
no_line_wrap_g = TRUE;
- else if(width_g < 0 || *rest) {
+ else if (width_g < 0 || *rest) {
usage();
leave(EXIT_FAILURE);
}
- } else if(!HDstrcmp(argv[argno], "--width")) {
- if((argno + 1) >= argc) {
+ }
+ else if (!HDstrcmp(argv[argno], "--width")) {
+ if ((argno + 1) >= argc) {
usage();
leave(EXIT_FAILURE);
- } else {
+ }
+ else {
s = argv[++argno];
}
width_g = (int)HDstrtol(s, &rest, 0);
- if(width_g <= 0 || *rest) {
+ if (width_g <= 0 || *rest) {
usage();
leave(EXIT_FAILURE);
}
- } else if(!HDstrcmp(argv[argno], "--verbose")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--verbose")) {
verbose_g++;
- } else if(!HDstrcmp(argv[argno], "--version")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--version")) {
print_version(h5tools_getprogname());
leave(EXIT_SUCCESS);
- } else if(!HDstrcmp(argv[argno], "--hexdump")) {
+ }
+ else if (!HDstrcmp(argv[argno], "--hexdump")) {
hexdump_g = TRUE;
- } else if(!HDstrncmp(argv[argno], "-w", (size_t)2)) {
- if(argv[argno][2]) {
+ }
+ else if (!HDstrncmp(argv[argno], "-w", (size_t)2)) {
+ if (argv[argno][2]) {
s = argv[argno] + 2;
- } else if((argno + 1) >= argc) {
+ }
+ else if ((argno + 1) >= argc) {
usage();
leave(EXIT_FAILURE);
- } else {
+ }
+ else {
s = argv[++argno];
}
width_g = (int)HDstrtol(s, &rest, 0);
- if(0 == width_g)
+ if(0 == width_g) {
no_line_wrap_g = TRUE;
+ }
else if(width_g < 0 || *rest) {
usage();
leave(EXIT_FAILURE);
}
- } else if('-'!=argv[argno][1]) {
+
+ }
+ else if (!HDstrncmp(argv[argno], "--s3-cred=", (size_t)10)) {
+#ifndef H5_HAVE_ROS3_VFD
+ HDfprintf(rawerrorstream, "Error: Read-Only S3 VFD is not enabled\n\n");
+ usage();
+ leave(EXIT_FAILURE);
+#else
+ unsigned nelems = 0;
+ char *start = NULL;
+ char *s3cred_src = NULL;
+ char **s3cred = NULL;
+ char const *ccred[3];
+ /* try to parse s3 credentials tuple
+ */
+ start = strchr(argv[argno], '=');
+ if (start == NULL) {
+ HDfprintf(rawerrorstream, "Error: Unable to parse null credentials tuple\n"
+ " For anonymous access, omit \"--s3-cred\" and use only \"--vfd=ros3\"\n\n");
+ usage();
+ leave(EXIT_FAILURE);
+ }
+ start++;
+ if (FAIL == parse_tuple((const char *)start, ',', &s3cred_src, &nelems, &s3cred)) {
+ HDfprintf(rawerrorstream, "Error: Unable to parse S3 credentials\n\n");
+ usage();
+ leave(EXIT_FAILURE);
+ }
+ /* sanity-check tuple count
+ */
+ if (nelems != 3) {
+ HDfprintf(rawerrorstream, "Error: Invalid S3 credentials\n\n");
+ usage();
+ leave(EXIT_FAILURE);
+ }
+ ccred[0] = (const char *)s3cred[0];
+ ccred[1] = (const char *)s3cred[1];
+ ccred[2] = (const char *)s3cred[2];
+ if (0 == h5tools_populate_ros3_fapl(&ros3_fa, ccred)) {
+ HDfprintf(rawerrorstream, "Error: Invalid S3 credentials\n\n");
+ usage();
+ leave(EXIT_FAILURE);
+ }
+ HDfree(s3cred);
+ HDfree(s3cred_src);
+#endif /* H5_HAVE_ROS3_VFD */
+
+ }
+ else if (!HDstrncmp(argv[argno], "--hdfs-attrs=", (size_t)13)) {
+#ifndef H5_HAVE_LIBHDFS
+ PRINTVALSTREAM(rawoutstream, "The HDFS VFD is not enabled.\n");
+ leave(EXIT_FAILURE);
+#else
+ /* Parse received configuration data and set fapl config struct */
+
+ hbool_t _debug = FALSE;
+ unsigned nelems = 0;
+ char const *start = NULL;
+ char *props_src = NULL;
+ char **props = NULL;
+ unsigned long k = 0;
+
+ /* try to parse tuple
+ */
+ if (_debug) {
+ HDfprintf(stderr, "configuring hdfs...\n");
+ }
+ start = argv[argno]+13; /* should never segfault: worst case of */
+ if (*start != '(') { /* null-termintor after '='. */
+
+ if (_debug) {
+ HDfprintf(stderr, " no tuple.\n");
+ }
+ usage();
+ leave(EXIT_FAILURE);
+ }
+ if (FAIL == parse_tuple((const char *)start, ',', &props_src, &nelems, &props)) {
+ HDfprintf(stderr, " unable to parse tuple.\n");
+ usage();
+ leave(EXIT_FAILURE);
+ }
+
+ /* sanity-check tuple count
+ */
+ if (nelems != 5) {
+ HDfprintf(stderr, " expected 5-ple, got `%d`\n", nelems);
+ usage();
+ leave(EXIT_FAILURE);
+ }
+ if (_debug) {
+ HDfprintf(stderr, " got hdfs-attrs tuple: `(%s,%s,%s,%s,%s)`\n", props[0], props[1], props[2], props[3], props[4]);
+ }
+
+ /* Populate fapl configuration structure with given properties.
+ * WARNING: No error-checking is done on length of input strings...
+ * Silent overflow is possible, albeit unlikely.
+ */
+ if (HDstrncmp(props[0], "", 1)) {
+ if (_debug) {
+ HDfprintf(stderr, " setting namenode name: %s\n", props[0]);
+ }
+ HDstrncpy(hdfs_fa.namenode_name, (const char *)props[0], HDstrlen(props[0]));
+ }
+ if (HDstrncmp(props[1], "", 1)) {
+ k = strtoul((const char *)props[1], NULL, 0);
+ if (errno == ERANGE) {
+ HDfprintf(stderr, " supposed port number wasn't.\n");
+ leave(EXIT_FAILURE);
+ }
+ if (_debug) {
+ HDfprintf(stderr, " setting namenode port: %lu\n", k);
+ }
+ hdfs_fa.namenode_port = (int32_t)k;
+ }
+ if (HDstrncmp(props[2], "", 1)) {
+ if (_debug) {
+ HDfprintf(stderr, " setting kerb cache path: %s\n", props[2]);
+ }
+ HDstrncpy(hdfs_fa.kerberos_ticket_cache, (const char *)props[2], HDstrlen(props[2]));
+ }
+ if (HDstrncmp(props[3], "", 1)) {
+ if (_debug) {
+ HDfprintf(stderr, " setting username: %s\n", props[3]);
+ }
+ HDstrncpy(hdfs_fa.user_name, (const char *)props[3], HDstrlen(props[3]));
+ }
+ if (HDstrncmp(props[4], "", 1)) {
+ k = HDstrtoul((const char *)props[4], NULL, 0);
+ if (errno == ERANGE) {
+ HDfprintf(stderr, " supposed buffersize number wasn't.\n");
+ leave(EXIT_FAILURE);
+ }
+ if (_debug) {
+ HDfprintf(stderr, " setting stream buffer size: %lu\n", k);
+ }
+ hdfs_fa.stream_buffer_size = (int32_t)k;
+ }
+ HDfree(props);
+ HDfree(props_src);
+#endif /* H5_HAVE_LIBHDFS */
+
+ }
+ else if('-'!=argv[argno][1]) {
/* Single-letter switches */
for(s = argv[argno] + 1; *s; s++) {
switch(*s) {
@@ -2771,7 +2804,9 @@ main(int argc, const char *argv[])
leave(EXIT_FAILURE);
} /* end switch */
} /* end for */
- } else {
+ }
+ else {
+ HDfprintf(stderr, "Unknown argument: %s\n", argv[argno]);
usage();
leave(EXIT_FAILURE);
}
@@ -2779,18 +2814,54 @@ main(int argc, const char *argv[])
/* If no arguments remain then print a usage message (instead of doing
* absolutely nothing ;-) */
- if(argno >= argc) {
+ if (argno >= argc) {
usage();
leave(EXIT_FAILURE);
} /* end if */
/* Check for conflicting arguments */
- if (!is_valid_args())
- {
+ if (!is_valid_args()) {
usage();
leave(EXIT_FAILURE);
}
+ if (preferred_driver) {
+ void *conf_fa = NULL;
+
+ if (!HDstrcmp(preferred_driver, "ros3")) {
+#ifndef H5_HAVE_ROS3_VFD
+ HDfprintf(rawerrorstream, "Error: Read-Only S3 VFD not enabled.\n\n");
+ usage();
+ leave(EXIT_FAILURE);
+#else
+ conf_fa = (void *)&ros3_fa;
+#endif /* H5_HAVE_ROS3_VFD */
+
+ }
+ else if (!HDstrcmp(preferred_driver, "hdfs")) {
+#ifndef H5_HAVE_LIBHDFS
+ PRINTVALSTREAM(rawoutstream, "The HDFS VFD is not enabled.\n");
+ leave(EXIT_FAILURE);
+#else
+ conf_fa = (void *)&hdfs_fa;
+#endif /* H5_HAVE_LIBHDFS */
+ }
+
+ if (conf_fa != NULL) {
+ HDassert(fapl_id == H5P_DEFAULT);
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (fapl_id < 0) {
+ HDfprintf(rawerrorstream, "Error: Unable to create fapl entry\n\n");
+ leave(EXIT_FAILURE);
+ }
+ if (0 == h5tools_set_configured_fapl(fapl_id, preferred_driver, conf_fa)) {
+ HDfprintf(rawerrorstream, "Error: Unable to set fapl\n\n");
+ usage();
+ leave(EXIT_FAILURE);
+ }
+ }
+ } /* preferred_driver defined */
+
/* Turn off HDF5's automatic error printing unless you're debugging h5ls */
if(!show_errors_g)
H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
@@ -2819,11 +2890,16 @@ main(int argc, const char *argv[])
oname = NULL;
file = -1;
- while(fname && *fname) {
- file = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, preferred_driver, drivername, sizeof drivername);
+ while (fname && *fname) {
+ if (fapl_id != H5P_DEFAULT) {
+ file = H5Fopen(fname, H5F_ACC_RDONLY, fapl_id);
+ }
+ else {
+ file = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, preferred_driver, drivername, sizeof drivername);
+ }
- if(file >= 0) {
- if(verbose_g)
+ if (file >= 0) {
+ if (verbose_g)
PRINTSTREAM(rawoutstream, "Opened \"%s\" with %s driver.\n", fname, drivername);
break; /*success*/
} /* end if */
@@ -2831,27 +2907,27 @@ main(int argc, const char *argv[])
/* Shorten the file name; lengthen the object name */
x = oname;
oname = HDstrrchr(fname, '/');
- if(x)
+ if (x)
*x = '/';
- if(!oname)
+ if (!oname)
break;
*oname = '\0';
} /* end while */
- if(file < 0) {
+ if (file < 0) {
HDfprintf(rawerrorstream, "%s: unable to open file\n", argv[argno-1]);
HDfree(fname);
err_exit = 1;
continue;
} /* end if */
- if(oname) {
+ if (oname) {
/* Always use absolute paths to avoid confusion, keep track of where
* to begin path name output */
*oname = '/';
iter.base_len = HDstrlen(oname);
iter.base_len -= oname[iter.base_len-1] == '/';
x = oname;
- if(NULL == (oname = HDstrdup(oname))) {
+ if (NULL == (oname = HDstrdup(oname))) {
HDfprintf(rawerrorstream, "memory allocation failed\n");
leave(EXIT_FAILURE);
}
@@ -2860,9 +2936,9 @@ main(int argc, const char *argv[])
* is displayed if it is a link or non-group object */
iter.name_start = 1;
}
- if(!oname || !*oname) {
+ if (!oname || !*oname) {
oname = root_name;
- if(recursive_g)
+ if (recursive_g)
display_root_g = TRUE;
iter.base_len = 0;
iter.name_start = 0;
@@ -2883,9 +2959,9 @@ main(int argc, const char *argv[])
symlink_list.objs = NULL;
/* Check for root group as object name */
- if(HDstrcmp(oname, root_name)) {
+ if (HDstrcmp(oname, root_name)) {
/* Check the type of link given */
- if(H5Lget_info(file, oname, &li, H5P_DEFAULT) < 0) {
+ if (H5Lget_info(file, oname, &li, H5P_DEFAULT) < 0) {
hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
@@ -2904,8 +2980,8 @@ main(int argc, const char *argv[])
li.type = H5L_TYPE_HARD;
/* Open the object and display it's information */
- if(li.type == H5L_TYPE_HARD) {
- if(visit_obj(file, oname, &iter) < 0)
+ if (li.type == H5L_TYPE_HARD) {
+ if (visit_obj(file, oname, &iter) < 0)
leave(EXIT_FAILURE);
} /* end if(li.type == H5L_TYPE_HARD) */
else {
@@ -2916,11 +2992,10 @@ main(int argc, const char *argv[])
}
H5Fclose(file);
HDfree(fname);
- if(x)
+ if (x)
HDfree(oname);
- for(u=0; u < symlink_list.nused; u++)
- {
+ for (u = 0; u < symlink_list.nused; u++) {
if (symlink_list.objs[u].type == H5L_TYPE_EXTERNAL)
HDfree(symlink_list.objs[u].file);
@@ -2933,6 +3008,13 @@ main(int argc, const char *argv[])
err_exit = 1;
} /* end while */
+ if (fapl_id != H5P_DEFAULT) {
+ if (0 < H5Pclose(fapl_id)) {
+ HDfprintf(rawerrorstream, "Error: Unable to set close fapl entry\n\n");
+ leave(EXIT_FAILURE);
+ }
+ }
+
if (err_exit)
leave(EXIT_FAILURE);
else
diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt
index c0cd558..4a1430e 100644
--- a/tools/src/h5repack/CMakeLists.txt
+++ b/tools/src/h5repack/CMakeLists.txt
@@ -14,18 +14,20 @@ set (REPACK_COMMON_SOURCES
${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.c
)
-add_executable (h5repack ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c)
-target_include_directories(h5repack PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5repack STATIC)
-target_link_libraries (h5repack PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_target_properties (h5repack PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repack")
-
-set (H5_DEP_EXECUTABLES h5repack)
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h5repack ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c)
+ target_include_directories (h5repack PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5repack STATIC)
+ target_link_libraries (h5repack PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5repack PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repack")
+
+ set (H5_DEP_EXECUTABLES h5repack)
+endif ()
if (BUILD_SHARED_LIBS)
add_executable (h5repack-shared ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c)
- target_include_directories(h5repack-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5repack-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5repack-shared SHARED)
target_link_libraries (h5repack-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
set_target_properties (h5repack-shared PROPERTIES FOLDER tools)
diff --git a/tools/src/h5repack/Makefile.am b/tools/src/h5repack/Makefile.am
index c71e65b..925b8a7 100644
--- a/tools/src/h5repack/Makefile.am
+++ b/tools/src/h5repack/Makefile.am
@@ -28,7 +28,7 @@ libh5repack_la_SOURCES=h5repack.c h5repack_copy.c h5repack_filters.c \
h5repack_opttable.c h5repack_parse.c h5repack_refs.c \
h5repack_verify.c
libh5repack_la_LDFLAGS = $(AM_LDFLAGS)
-libh5repack_la_LIBADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
+libh5repack_la_LIBADD=$(LIBH5TOOLS) $(LIBHDF5)
# Our main target, h5repack tool
diff --git a/tools/src/h5repack/Makefile.in b/tools/src/h5repack/Makefile.in
index a1f4a02..a3a12c5 100644
--- a/tools/src/h5repack/Makefile.in
+++ b/tools/src/h5repack/Makefile.in
@@ -135,7 +135,7 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h \
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
-libh5repack_la_DEPENDENCIES = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
+libh5repack_la_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5)
am_libh5repack_la_OBJECTS = h5repack.lo h5repack_copy.lo \
h5repack_filters.lo h5repack_opttable.lo h5repack_parse.lo \
h5repack_refs.lo h5repack_verify.lo
@@ -494,7 +494,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -517,9 +516,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -546,6 +548,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -600,6 +603,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -624,7 +628,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -749,7 +752,7 @@ libh5repack_la_SOURCES = h5repack.c h5repack_copy.c h5repack_filters.c \
h5repack_verify.c
libh5repack_la_LDFLAGS = $(AM_LDFLAGS)
-libh5repack_la_LIBADD = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
+libh5repack_la_LIBADD = $(LIBH5TOOLS) $(LIBHDF5)
h5repack_SOURCES = h5repack_main.c
# Add h5repack specific linker flags here
@@ -1331,7 +1334,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c
index a63e56f..0183cbf 100644
--- a/tools/src/h5repack/h5repack.c
+++ b/tools/src/h5repack/h5repack.c
@@ -41,7 +41,9 @@ static int have_request(pack_opt_t *options);
* Return: 0, ok, -1, fail
*-------------------------------------------------------------------------
*/
-int h5repack(const char* infile, const char* outfile, pack_opt_t *options) {
+int
+h5repack(const char* infile, const char* outfile, pack_opt_t *options)
+{
/* check input */
if (check_options(options) < 0)
return -1;
@@ -55,7 +57,7 @@ int h5repack(const char* infile, const char* outfile, pack_opt_t *options) {
return -1;
return 0;
-}
+} /* end h5repack() */
/*-------------------------------------------------------------------------
* Function: h5repack_init
@@ -86,7 +88,7 @@ h5repack_init(pack_opt_t *options, int verbose, hbool_t latest)
}
return (options_table_init(&(options->op_tbl)));
-}
+} /* end h5repack_init() */
/*-------------------------------------------------------------------------
* Function: h5repack_end
@@ -95,9 +97,11 @@ h5repack_init(pack_opt_t *options, int verbose, hbool_t latest)
*-------------------------------------------------------------------------
*/
-int h5repack_end(pack_opt_t *options) {
+int
+h5repack_end(pack_opt_t *options)
+{
return options_table_free(options->op_tbl);
-}
+} /* end h5repack_end() */
/*-------------------------------------------------------------------------
* Function: h5repack_addfilter
@@ -138,7 +142,7 @@ h5repack_addfilter(const char *str, pack_opt_t *options)
HDfree(obj_list);
return 0;
-}
+} /* end h5repack_addfilter() */
/*-------------------------------------------------------------------------
* Function: h5repack_addlayout
@@ -175,7 +179,7 @@ h5repack_addlayout(const char *str, pack_opt_t *options)
if (pack.layout == H5D_CHUNKED) {
/* -2 means the NONE option, remove chunking
and set the global layout to contiguous */
- if (pack.chunk.rank == -2)
+ if (pack.chunk.rank == -2) /* TODO: fix 'magic number' */
options->layout_g = H5D_CONTIGUOUS;
/* otherwise set the global chunking type */
else {
@@ -192,10 +196,10 @@ h5repack_addlayout(const char *str, pack_opt_t *options)
HDfree(obj_list);
ret_value = 0;
- }
+ } /* end if obj_list exists */
return ret_value;
-}
+} /* end h5repack_addlayout() */
/* Note: The below copy_named_datatype(), named_datatype_free(), copy_attr()
* were located in h5repack_copy.c as static prior to bugfix1726.
@@ -215,8 +219,9 @@ h5repack_addlayout(const char *str, pack_opt_t *options)
* to free the stack.
*-------------------------------------------------------------------------
*/
-hid_t copy_named_datatype(hid_t type_in, hid_t fidout,
- named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options) {
+hid_t
+copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options)
+{
named_dt_t *dt = *named_dt_head_p; /* Stack pointer */
named_dt_t *dt_ret = NULL; /* Datatype to return */
H5O_info_t oinfo; /* Object info of input dtype */
@@ -250,13 +255,14 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout,
/* Check if this type is the one requested */
if (oinfo.addr == dt->addr_in) {
dt_ret = dt;
- } /* end if */
- } /* end if */
- } /* end for */
- } /* end else */
+ }
+ } /* end if named datatype */
+ } /* end for each object in traversal table */
+ } /* end else (create the stack) */
/* Handle the case that the requested datatype was not found. This is
- * possible if the datatype was committed anonymously in the input file. */
+ * possible if the datatype was committed anonymously in the input file.
+ */
if (!dt_ret) {
/* Push the new datatype onto the stack */
if (NULL == (dt_ret = (named_dt_t *)HDmalloc(sizeof(named_dt_t))))
@@ -267,10 +273,11 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout,
/* Update the address and id */
dt_ret->addr_in = oinfo.addr;
dt_ret->id_out = -1;
- } /* end if */
+ } /* end if requested datatype not found */
/* If the requested datatype does not yet exist in the output file, copy it
- * anonymously */
+ * anonymously
+ */
if (dt_ret->id_out < 0) {
if (options->use_native == 1)
dt_ret->id_out = H5Tget_native_type(type_in, H5T_DIR_DEFAULT);
@@ -280,18 +287,20 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type-H5Tcopy failed");
if (H5Tcommit_anon(fidout, dt_ret->id_out, H5P_DEFAULT, H5P_DEFAULT) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tcommit_anon failed");
- } /* end if */
+ } /* end if named datatype not yet in output file */
/* Set return value */
ret_value = dt_ret->id_out;
- /* Increment the ref count on id_out, because the calling function will try to close it */
- if(H5Iinc_ref(ret_value) < 0)
+ /* Increment the ref count on id_out, because the calling function will try
+ * to close it. (TODO: fix scope envy)
+ */
+ if (H5Iinc_ref(ret_value) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Iinc_ref failed");
done:
return ret_value;
-} /* end copy_named_datatype */
+} /* end copy_named_datatype() */
/*-------------------------------------------------------------------------
* Function: named_datatype_free
@@ -299,7 +308,9 @@ done:
* Purpose: Frees the stack of named datatypes.
*-------------------------------------------------------------------------
*/
-int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) {
+int
+named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err)
+{
named_dt_t *dt = *named_dt_head_p;
int ret_value = -1;
@@ -310,13 +321,13 @@ int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) {
dt = dt->next;
HDfree(*named_dt_head_p);
*named_dt_head_p = dt;
- } /* end while */
+ }
ret_value = 0;
done:
return (ret_value);
-} /* end named_datatype_free */
+} /* end named_datatype_free() */
/*-------------------------------------------------------------------------
* Function: copy_attr
@@ -330,8 +341,7 @@ done:
*-------------------------------------------------------------------------
*/
int
-copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
- trav_table_t *travt, pack_opt_t *options)
+copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options)
{
int ret_value = 0;
hid_t attr_id = -1; /* attr ID */
@@ -364,7 +374,6 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
if ((attr_id = H5Aopen_by_idx(loc_in, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t) u, H5P_DEFAULT, H5P_DEFAULT)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx failed");
- /* get name */
if (H5Aget_name(attr_id, (size_t) 255, name) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed");
@@ -386,17 +395,17 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
if ((wtype_id = copy_named_datatype(ftype_id, fidout, named_dt_head_p, travt, options)) < 0) {
H5Fclose(fidout);
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_named_datatype failed");
- } /* end if */
+ }
if (H5Fclose(fidout) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fclose failed");
- } /* end if */
+ } /* end if datatype is committed and we have a traversal table */
else {
if (options->use_native == 1)
wtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT);
else
wtype_id = H5Tcopy(ftype_id);
- } /* end else */
+ } /* end else: uncommitted datatype and/or no traversal table */
/* get the dataspace handle */
if ((space_id = H5Aget_space(attr_id)) < 0)
@@ -413,12 +422,12 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
if ((msize = H5Tget_size(wtype_id)) == 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
- /*-------------------------------------------------------------------------
- * object references are a special case. We cannot just copy the buffers,
- * but instead we recreate the reference.
- * This is done on a second sweep of the file that just copies the referenced
- * objects at copy_refs_attr()
- *-------------------------------------------------------------------------
+ /*---------------------------------------------------------------------
+ * object references are a special case. We cannot just copy the
+ * buffers, but instead we recreate the reference.
+ * This is done on a second sweep of the file that just copies the
+ * referenced objects at copy_refs_attr().
+ *---------------------------------------------------------------------
*/
type_class = H5Tget_class(wtype_id);
is_ref = (type_class == H5T_REFERENCE);
@@ -429,7 +438,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
is_ref = (is_ref || (H5Tget_class(base_type) == H5T_REFERENCE));
if (H5Tclose(base_type) < 0)
H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed");
- }
+ } /* end if type_class is variable length or array */
if (type_class == H5T_COMPOUND) {
int nmembers = H5Tget_nmembers(wtype_id);
@@ -444,13 +453,13 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
is_ref = 1;
break;
}
- } /* for (j=0; i<nmembers; j++) */
- } /* if (type_class == H5T_COMPOUND) */
+ } /* end for each member */
+ } /* end if type_class is H5T_COMPOUND */
if (!is_ref) {
- /*-------------------------------------------------------------------------
+ /*-----------------------------------------------------------------
* read to memory
- *-------------------------------------------------------------------------
+ *-----------------------------------------------------------------
*/
buf = (void *)HDmalloc((size_t)(nelmts * msize));
@@ -460,9 +469,9 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
if (H5Aread(attr_id, wtype_id, buf) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed");
- /*-------------------------------------------------------------------------
+ /*-----------------------------------------------------------------
* copy
- *-------------------------------------------------------------------------
+ *-----------------------------------------------------------------
*/
if ((attr_out = H5Acreate2(loc_out, name, wtype_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -483,11 +492,11 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
} /*H5T_REFERENCE*/
if (options->verbose)
- printf(FORMAT_OBJ_ATTR, "attr", name);
+ HDprintf(FORMAT_OBJ_ATTR, "attr", name);
- /*-------------------------------------------------------------------------
+ /*---------------------------------------------------------------------
* close
- *-------------------------------------------------------------------------
+ *---------------------------------------------------------------------
*/
if (H5Sclose(space_id) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
@@ -501,19 +510,18 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
if (H5Aclose(attr_id) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed");
attr_id = -1;
- } /* for u */
+ } /* for u (each attribute) */
done:
H5E_BEGIN_TRY {
if (buf) {
- /* Check if we have VL data and string in the attribute's datatype that must
- * be reclaimed */
+ /* Check if we have VL data and string in the attribute's
+ * datatype that must be reclaimed
+ */
if (TRUE == h5tools_detect_vlen(wtype_id))
H5Dvlen_reclaim(wtype_id, space_id, H5P_DEFAULT, buf);
-
- /* Free buf */
HDfree(buf);
- } /* end if */
+ }
H5Aclose(attr_out);
H5Sclose(space_id);
@@ -525,27 +533,29 @@ done:
return ret_value;
} /* end copy_attr() */
-/*-------------------------------------------------------------------------
+/*-----------------------------------------------------------------------------
* Function: check_options
*
* Purpose: print options, checks for invalid options
*
* Return: void, return -1 on error
- *-------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
*/
-static int check_options(pack_opt_t *options) {
+static int
+check_options(pack_opt_t *options)
+{
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
unsigned int i;
int k, j, has_cp = 0, has_ck = 0;
char slayout[30];
/*-------------------------------------------------------------------------
- * objects to layout
- *-------------------------------------------------------------------------
- */
- if (options->verbose && have_request(options) /* only print if requested */) {
+ * Objects to layout
+ *-------------------------------------------------------------------------
+ */
+ if (options->verbose && have_request(options)) {
if (options->all_layout == 1) {
- printf("All objects to modify layout are...\n");
+ HDprintf("All objects to modify layout are...\n");
switch (options->layout_g) {
case H5D_COMPACT:
strcpy(slayout, "compact");
@@ -566,76 +576,76 @@ static int check_options(pack_opt_t *options) {
strcpy(slayout, "invalid layout\n");
HGOTO_DONE(FAIL);
}
- printf(" Apply %s layout to all", slayout);
+ HDprintf(" Apply %s layout to all", slayout);
if (H5D_CHUNKED == options->layout_g) {
- printf("with dimension [ ");
+ HDprintf("with dimension [ ");
for (j = 0; j < options->chunk_g.rank; j++)
- printf("%d ", (int) options->chunk_g.chunk_lengths[j]);
- printf("]");
+ HDprintf("%d ", (int) options->chunk_g.chunk_lengths[j]);
+ HDprintf("]");
}
- printf("\n");
+ HDprintf("\n");
}
else
- printf("No all objects to modify layout\n");
- }/* verbose */
+ HDprintf("No all objects to modify layout\n");
+ } /* end if verbose */
for (i = 0; i < options->op_tbl->nelems; i++) {
char* name = options->op_tbl->objs[i].path;
if (options->op_tbl->objs[i].chunk.rank > 0) {
if (options->verbose) {
- printf(" <%s> with chunk size ", name);
+ HDprintf(" <%s> with chunk size ", name);
for (k = 0; k < options->op_tbl->objs[i].chunk.rank; k++)
- printf("%d ", (int) options->op_tbl->objs[i].chunk.chunk_lengths[k]);
- printf("\n");
+ HDprintf("%d ", (int) options->op_tbl->objs[i].chunk.chunk_lengths[k]);
+ HDprintf("\n");
}
has_ck = 1;
}
- else if (options->op_tbl->objs[i].chunk.rank == -2) {
+ else if (options->op_tbl->objs[i].chunk.rank == -2) { /* TODO: replace 'magic number' */
if (options->verbose)
- printf(" <%s> %s\n", name, "NONE (contiguous)");
+ HDprintf(" <%s> %s\n", name, "NONE (contiguous)");
has_ck = 1;
}
- }
+ } /* end for each object in options */
if (options->all_layout == 1 && has_ck)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid chunking input: 'all' option is present with other objects");
/*-------------------------------------------------------------------------
- * objects to filter
- *-------------------------------------------------------------------------
- */
+ * Objects to filter
+ *-------------------------------------------------------------------------
+ */
- if (options->verbose && have_request(options) /* only print if requested */) {
+ if (options->verbose && have_request(options)) {
if (options->all_filter == 1) {
- printf("All objects to apply filter are...\n");
+ HDprintf("All objects to apply filter are...\n");
for (k = 0; k < options->n_filter_g; k++) {
H5Z_filter_t filtn = options->filter_g[k].filtn;
if (filtn < 0) {
- printf(" Unknown\n");
+ HDprintf(" Unknown\n");
continue;
}
switch (filtn) {
case H5Z_FILTER_NONE:
- printf(" Uncompress all\n");
+ HDprintf(" Uncompress all\n");
break;
case H5Z_FILTER_SHUFFLE:
case H5Z_FILTER_FLETCHER32:
- printf(" All with %s\n", get_sfilter(filtn));
+ HDprintf(" All with %s\n", get_sfilter(filtn));
break;
case H5Z_FILTER_SZIP:
case H5Z_FILTER_DEFLATE:
- printf(" All with %s, parameter %d\n", get_sfilter(filtn), options->filter_g[k].cd_values[0]);
+ HDprintf(" All with %s, parameter %d\n", get_sfilter(filtn), options->filter_g[k].cd_values[0]);
break;
default:
- printf(" User Defined %d\n", filtn);
+ HDprintf(" User Defined %d\n", filtn);
break;
- } /* k */
- };
- }
+ } /* end switch */
+ } /* end for each filter */
+ } /* end if options->all_filter == 1 (TODO: meaning) */
else
- printf("No all objects to apply filter\n");
- } /* verbose */
+ HDprintf("No all objects to apply filter\n");
+ } /* end if verbose */
for (i = 0; i < options->op_tbl->nelems; i++) {
pack_info_t pack = options->op_tbl->objs[i];
@@ -643,24 +653,26 @@ static int check_options(pack_opt_t *options) {
for (j = 0; j < pack.nfilters; j++) {
if (options->verbose) {
- if(pack.filter[j].filtn >= 0) {
- if(pack.filter[j].filtn > H5Z_FILTER_SCALEOFFSET)
- printf(" <%s> with %s filter %d\n", name, get_sfilter(pack.filter[j].filtn), pack.filter[j].filtn);
- else
- printf(" <%s> with %s filter\n", name, get_sfilter(pack.filter[j].filtn));
+ if (pack.filter[j].filtn >= 0) {
+ if (pack.filter[j].filtn > H5Z_FILTER_SCALEOFFSET) {
+ HDprintf(" <%s> with %s filter %d\n", name, get_sfilter(pack.filter[j].filtn), pack.filter[j].filtn);
+ }
+ else {
+ HDprintf(" <%s> with %s filter\n", name, get_sfilter(pack.filter[j].filtn));
+ }
}
}
has_cp = 1;
- } /* j */
- } /* i */
+ } /* end for each filter */
+ } /* end for each object in options table */
if (options->all_filter == 1 && has_cp)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid compression input: 'all' option is present with other objects");
/*-------------------------------------------------------------------------
- * check options for the latest format
- *-------------------------------------------------------------------------
- */
+ * Check options for the latest format
+ *-------------------------------------------------------------------------
+ */
if (options->grp_compact < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid maximum number of links to store as header messages");
@@ -672,13 +684,13 @@ static int check_options(pack_opt_t *options) {
if (options->msg_size[i] < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid shared message size");
- /*--------------------------------------------------------------------------------
- * verify new user userblock options; file name must be present
- *---------------------------------------------------------------------------------
- */
+ /*------------------------------------------------------------------------
+ * Verify new user userblock options; file name must be present
+ *------------------------------------------------------------------------
+ */
if (options->ublock_filename != NULL && options->ublock_size == 0) {
if (options->verbose) {
- printf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n", options->ublock_filename);
+ HDprintf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n", options->ublock_filename);
options->ublock_size = 1024;
}
}
@@ -686,35 +698,37 @@ static int check_options(pack_opt_t *options) {
if (options->ublock_filename == NULL && options->ublock_size != 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file name missing for user block", options->ublock_filename);
- /*--------------------------------------------------------------------------------
- * verify alignment options; threshold is zero default but alignment not
- *---------------------------------------------------------------------------------
- */
+ /*------------------------------------------------------------------------
+ * Verify alignment options; threshold is zero default but alignment not
+ *------------------------------------------------------------------------
+ */
if (options->alignment == 0 && options->threshold != 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "alignment for H5Pset_alignment missing");
done:
return ret_value;
-}
+} /* end check_options() */
/*-------------------------------------------------------------------------
* Function: check_objects
*
- * Purpose: locate all HDF5 objects in the file and compare with user
- * supplied list
+ * Purpose: Locate all HDF5 objects in the file and compare with user-supplied
+ * list.
*
* Return: 0, ok, -1 no
*-------------------------------------------------------------------------
*/
-static int check_objects(const char* fname, pack_opt_t *options) {
- int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
+static int
+check_objects(const char* fname, pack_opt_t *options)
+{
hid_t fid = -1;
hid_t did = -1;
hid_t sid = -1;
unsigned int i;
- unsigned int uf;
+ int ifil;
trav_table_t *travt = NULL;
+ int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
/* nothing to do */
if (options->op_tbl->nelems == 0)
@@ -747,38 +761,40 @@ static int check_objects(const char* fname, pack_opt_t *options) {
*/
if (options->verbose)
- printf("Opening file. Searching %d objects to modify ...\n", travt->nobjs);
+ HDprintf("Opening file. Searching %zu objects to modify ...\n", travt->nobjs);
for (i = 0; i < options->op_tbl->nelems; i++) {
- char* name = options->op_tbl->objs[i].path;
+ pack_info_t obj = options->op_tbl->objs[i];
+ char* name = obj.path;
+
if (options->verbose)
- printf(" <%s>", name);
+ HDprintf(" <%s>", name);
/* the input object names are present in the file and are valid */
if (h5trav_getindext(name, travt) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "%s Could not find <%s> in file <%s>. Exiting...\n",
(options->verbose ? "\n" : ""), name, fname);
if (options->verbose)
- printf("...Found\n");
+ HDprintf("...Found\n");
- for (uf = 0; uf < options->op_tbl->objs[i].nfilters; uf++) {
- if (options->op_tbl->objs[i].filter[uf].filtn < 0)
+ for (ifil = 0; ifil < obj.nfilters; ifil++) {
+ if (obj.filter[ifil].filtn < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter");
/* check for extra filter conditions */
- switch (options->op_tbl->objs[i].filter[uf].filtn) {
+ switch (obj.filter[ifil].filtn) {
/* chunk size must be smaller than pixels per block */
case H5Z_FILTER_SZIP:
{
int j;
hsize_t csize = 1;
- unsigned ppb = options->op_tbl->objs[i].filter[uf].cd_values[0];
+ unsigned ppb = obj.filter[ifil].cd_values[0];
hsize_t dims[H5S_MAX_RANK];
int rank;
- if (options->op_tbl->objs[i].chunk.rank > 0) {
- rank = options->op_tbl->objs[i].chunk.rank;
+ if (obj.chunk.rank > 0) {
+ rank = obj.chunk.rank;
for (j = 0; j < rank; j++)
- csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j];
+ csize *= obj.chunk.chunk_lengths[j];
}
else {
if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0)
@@ -799,16 +815,16 @@ static int check_objects(const char* fname, pack_opt_t *options) {
}
if (csize < ppb) {
- printf(" <warning: SZIP settings, chunk size is smaller than pixels per block>\n");
+ HDprintf(" <warning: SZIP settings, chunk size is smaller than pixels per block>\n");
HGOTO_DONE(0);
}
- }
+ } /* end case SZIP */
break;
default:
break;
- }
- } /* for uf */
- } /* for i */
+ } /* end switch */
+ } /* for ifil (each user-defined filter) */
+ } /* for i (each object in options traversal table) */
done:
H5E_BEGIN_TRY {
@@ -819,7 +835,7 @@ done:
if (travt)
trav_table_free(travt);
return ret_value;
-}
+} /* end check_objects() */
/*-------------------------------------------------------------------------
* Function: have_request
@@ -829,14 +845,15 @@ done:
* Return: 1 yes, 0 no
*-------------------------------------------------------------------------
*/
-static int have_request(pack_opt_t *options) {
+static int
+have_request(pack_opt_t *options)
+{
if (options->all_filter || options->all_layout || options->op_tbl->nelems)
return 1;
return 0;
-
-}
+} /* end have_request() */
/*-------------------------------------------------------------------------
* Function: get_sfilter
@@ -846,8 +863,9 @@ static int have_request(pack_opt_t *options) {
* Return: name of filter, exit on error
*-------------------------------------------------------------------------
*/
-
-static const char* get_sfilter(H5Z_filter_t filtn) {
+static const char *
+get_sfilter(H5Z_filter_t filtn)
+{
if (filtn < 0)
return NULL;
else if (filtn == H5Z_FILTER_NONE)
@@ -866,5 +884,5 @@ static const char* get_sfilter(H5Z_filter_t filtn) {
return "SOFF";
else
return "UD";
-}
+} /* end get_sfilter() */
diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c
index 0567269..f6409e3 100644
--- a/tools/src/h5repack/h5repack_copy.c
+++ b/tools/src/h5repack/h5repack_copy.c
@@ -33,25 +33,11 @@
/* size of buffer/# of bytes to xfer at a time when copying userblock */
#define USERBLOCK_XFER_SIZE 512
-/* check H5Dread()/H5Dwrite() error, e.g. memory allocation error inside the library. */
-#define CHECK_H5DRW_ERROR(_fun, _fail, _did, _mtid, _msid, _fsid, _pid, _buf) { \
- H5E_BEGIN_TRY { \
- if(_fun(_did, _mtid, _msid, _fsid, _pid, _buf) < 0) { \
- hid_t _err_num = 0; \
- char _msg[80]; \
- H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, &_err_num); \
- H5Eget_msg(_err_num, NULL, _msg, (size_t)80); \
- error_msg("%s %s -- %s\n", #_fun, "failed", _msg); \
- HGOTO_DONE(_fail) \
- } \
- } H5E_END_TRY; \
-}
-
/*-------------------------------------------------------------------------
* local functions
*-------------------------------------------------------------------------
*/
-static int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
+static int get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p);
static void print_dataset_info(hid_t dcpl_id, char *objname, double per, int pr);
static int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
@@ -61,15 +47,7 @@ static int copy_user_block(const char *infile, const char *outfile,
#if defined (H5REPACK_DEBUG_USER_BLOCK)
static void print_user_block(const char *filename, hid_t fid);
#endif
-static herr_t walk_error_callback(unsigned n, const H5E_error2_t *err_desc, void *udata);
-
-/* get the major number from the error stack. */
-static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t *err_desc, void *udata) {
- if (err_desc)
- *((hid_t *) udata) = err_desc->maj_num;
- return 0;
-}
/*-------------------------------------------------------------------------
* Function: copy_objects
@@ -80,8 +58,8 @@ static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t
* -1 no
*-------------------------------------------------------------------------
*/
-
-int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
+int
+copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
{
int ret_value = 0;
hid_t fidin = -1;
@@ -167,8 +145,7 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
/* Adjust group creation parameters for root group */
/* (So that it is created in "dense storage" form) */
- if (H5Pset_link_phase_change(fcpl, (unsigned) options->grp_compact,
- (unsigned) options->grp_indexed) < 0)
+ if (H5Pset_link_phase_change(fcpl, (unsigned) options->grp_compact, (unsigned) options->grp_indexed) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_link_phase_change failed to adjust group creation parameters for root group");
for (i = 0; i < 5; i++) {
@@ -318,7 +295,7 @@ print_user_block(fnamein, fidin);
*-------------------------------------------------------------------------
*/
if (options->verbose)
- printf("Making new file ...\n");
+ HDprintf("Making new file ...\n");
if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fcreate could not create file <%s>:", fnameout);
@@ -387,10 +364,10 @@ done:
trav_table_free(travt);
return ret_value;
-}
+} /* end copy_objects() */
/*-------------------------------------------------------------------------
- * Function: Get_hyperslab
+ * Function: get_hyperslab
*
* Purpose: Calulate a hyperslab from a dataset for higher performance.
* The size of hyperslab is limitted by H5TOOLS_BUFSIZE.
@@ -422,7 +399,7 @@ done:
*-----------------------------------------*/
int
-Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
+get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p)
{
int ret_value = 0;
@@ -543,7 +520,7 @@ Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
done:
return ret_value;
-}
+} /* end get_hyperslab() */
/*-------------------------------------------------------------------------
* Function: do_copy_objects
@@ -591,7 +568,7 @@ done:
* in (2) is that, when using the strip mine size, it assures that the "remaining" part
* of the dataset that does not fill an entire strip mine is processed.
*
- * 1. figure out a hyperslab (dimentions) and size (refer to Get_hyperslab()).
+ * 1. figure out a hyperslab (dimentions) and size (refer to get_hyperslab()).
* 2. Calculate the hyperslab selections as the selection is moving forward.
* Selection would be same as the hyperslab except for the remaining edge portion
* of the dataset. The code take care of the remaining portion if exist.
@@ -599,7 +576,8 @@ done:
*-------------------------------------------------------------------------
*/
-int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
+int
+do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
pack_opt_t *options) /* repack options */
{
int ret_value = 0;
@@ -634,7 +612,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
unsigned crt_order_flags; /* group creation order flag */
unsigned i;
unsigned u;
- unsigned uf;
+ int ifil;
int is_ref = 0;
htri_t is_named;
hbool_t limit_maxdims;
@@ -646,9 +624,9 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
*/
if (options->verbose) {
- printf("-----------------------------------------\n");
- printf(" Type Filter (Compression) Name\n");
- printf("-----------------------------------------\n");
+ HDprintf("-----------------------------------------\n");
+ HDprintf(" Type Filter (Compression) Name\n");
+ HDprintf("-----------------------------------------\n");
}
if (travt->objs) {
@@ -667,7 +645,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
*/
case H5TRAV_TYPE_GROUP:
if (options->verbose)
- printf(FORMAT_OBJ, "group", travt->objs[i].name);
+ HDprintf(FORMAT_OBJ, "group", travt->objs[i].name);
/* open input group */
if ((grp_in = H5Gopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
@@ -740,8 +718,8 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
if (options->op_tbl->objs) {
for (u = 0; u < options->op_tbl->nelems; u++) {
if (HDstrcmp(travt->objs[i].name, options->op_tbl->objs[u].path) == 0)
- for (uf = 0; uf < options->op_tbl->objs[uf].nfilters; uf++) {
- if (options->op_tbl->objs[u].filter[uf].filtn > 0)
+ for (ifil = 0; ifil < options->op_tbl->objs[ifil].nfilters; ifil++) {
+ if (options->op_tbl->objs[u].filter[ifil].filtn > 0)
req_filter = 1;
}
}
@@ -799,8 +777,6 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed");
if ((dcpl_in = H5Dget_create_plist(dset_in)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed");
- if ((dcpl_out = H5Pcopy(dcpl_in)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcopy failed");
if ((rank = H5Sget_simple_extent_ndims(f_space_id)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
HDmemset(dims, 0, sizeof dims);
@@ -809,6 +785,19 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
if (H5Dget_space_status(dset_in, &space_status) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space_status failed");
+ /* If the input dataset has external storage, it must be contiguous.
+ * Accordingly, there would be no filter or chunk properties to preserve,
+ * so create a new DCPL.
+ * Otherwise, copy dcpl_in.
+ */
+ if (H5Pget_external_count(dcpl_in)) {
+ if ((dcpl_out = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed");
+ }
+ else if ((dcpl_out = H5Pcopy(dcpl_in)) < 0) {
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcopy failed");
+ }
+
nelmts = 1;
for (j = 0; j < rank; j++)
nelmts *= dims[j];
@@ -819,7 +808,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
wtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT);
else
wtype_id = H5Tcopy(ftype_id);
- } /* end if */
+ }
if ((msize = H5Tget_size(wtype_id)) == 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
@@ -863,7 +852,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
/* only if layout change requested for entire file or
* individual obj */
- if (options->all_layout > 0 || req_obj_layout == 1)
+ if (options->all_layout > 0 || req_obj_layout == 1) {
/*-------------------------------------------------
* Unset the unlimited max dims if convert to other
* than chunk layouts, because unlimited max dims
@@ -883,14 +872,14 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
/* if convert to COMPACT */
if (options->layout_g == H5D_COMPACT)
- /* should be smaller than 64K */
if (size_dset > MAX_COMPACT_DSIZE)
limit_maxdims = FALSE;
/* unset unlimited max dims */
if (limit_maxdims)
H5Sset_extent_simple(f_space_id, rank, dims, NULL);
- }
+ } /* end if not chunked */
+ } /* end if layout change requested for entire file or individual object */
/*-------------------------------------------------------------------------
* create the output dataset;
@@ -902,12 +891,12 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
if (dset_out == FAIL) {
H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, H5E_tools_min_id_g, "H5Dcreate2 failed");
if (options->verbose)
- printf(" warning: could not create dataset <%s>. Applying original settings\n", travt->objs[i].name);
+ HDprintf(" warning: could not create dataset <%s>. Applying original settings\n", travt->objs[i].name);
if ((dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_in, H5P_DEFAULT)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed");
apply_f = 0;
- }
+ } /* end if retry dataset create */
/*-------------------------------------------------------------------------
* read/write
@@ -931,8 +920,8 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
if (TRUE == H5Tdetect_class(wtype_id, H5T_VLEN))
if (H5Dvlen_reclaim(wtype_id, f_space_id, H5P_DEFAULT, buf) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dvlen_reclaim failed");
- /* free */
- if (buf != NULL) {
+
+ if (buf != NULL) { /* TODO: is buf potentially released by H5Dvlen_reclaim()? */
HDfree(buf);
buf = NULL;
}
@@ -968,17 +957,19 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
dset_layout = H5Pget_layout(dcpl_out);
if (dset_layout == H5D_CHUNKED)
dcpl_tmp = dcpl_out; /* writing dataset */
- else { /* if reading dataset is chunked */
+ else {
dset_layout = H5Pget_layout(dcpl_in);
if (dset_layout == H5D_CHUNKED)
dcpl_tmp = dcpl_in; /* reading dataset */
}
/* get hyperslab dims and size in byte */
- if (Get_hyperslab(dcpl_tmp, rank, dims, p_type_nbytes, hslab_dims, &hslab_nbytes) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Get_hyperslab failed");
+ if (get_hyperslab(dcpl_tmp, rank, dims, p_type_nbytes, hslab_dims, &hslab_nbytes) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "get_hyperslab failed");
hslab_buf = HDmalloc((size_t)hslab_nbytes);
+ if (hslab_buf == NULL)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "can't allocate space for hyperslab");
hslab_nelmts = hslab_nbytes / p_type_nbytes;
hslab_space = H5Screate_simple(1, &hslab_nelmts, NULL);
@@ -1005,12 +996,12 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
if (H5Sselect_hyperslab(hslab_space, H5S_SELECT_SET, zero, NULL, &hs_select_nelmts, NULL) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
- }
+ } /* end if rank > 0 */
else {
H5Sselect_all(f_space_id);
H5Sselect_all(hslab_space);
hs_select_nelmts = 1;
- } /* rank */
+ } /* end (else) rank == 0 */
if(H5Dread(dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
@@ -1029,20 +1020,19 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
hs_sel_offset[k - 1] = 0;
else
carry = 0;
- } /* k */
- } /* elmtno */
+ }
+ } /* end for (hyperslab selection loop) */
H5Sclose(hslab_space);
- /* free */
if (hslab_buf != NULL) {
HDfree(hslab_buf);
hslab_buf = NULL;
}
- } /* hyperslab read */
- } /* if (nelmts>0 && space_status==H5D_SPACE_STATUS_NOT_ALLOCATED) */
+ } /* end if reading/writing by hyperslab */
+ } /* end if (nelmts > 0 && space_status != H5D_SPACE_STATUS_NOT_ALLOCATED) */
/*-------------------------------------------------------------------------
- * amount of compression used
+ * print amount of compression used
*-------------------------------------------------------------------------
*/
if (options->verbose) {
@@ -1062,14 +1052,14 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
print_dataset_info(dcpl_in, travt->objs[i].name, ratio, 0);
/* print a message that the filter was not applied
- (in case there was a filter)
+ * (in case there was a filter)
*/
if (has_filter && apply_s == 0)
- printf(" <warning: filter not applied to %s. dataset smaller than %d bytes>\n", travt->objs[i].name, (int) options->min_comp);
+ HDprintf(" <warning: filter not applied to %s. dataset smaller than %d bytes>\n", travt->objs[i].name, (int) options->min_comp);
if (has_filter && apply_f == 0)
- printf(" <warning: could not apply the filter to %s>\n", travt->objs[i].name);
- } /* verbose */
+ HDprintf(" <warning: could not apply the filter to %s>\n", travt->objs[i].name);
+ } /* end if verbose (print compression) */
/*-------------------------------------------------------------------------
* copy attrs
@@ -1078,14 +1068,13 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
if (copy_attr(dset_in, dset_out, &named_dt_head, travt, options) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_attr failed");
- /*close */
if (H5Dclose(dset_out) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
- }/*!H5T_REFERENCE*/
- }/*h5tools_canreadf*/
+ } /* end if not a reference */
+ } /* end if h5tools_canreadf (filter availability check) */
/*-------------------------------------------------------------------------
- * close
+ * Close
*-------------------------------------------------------------------------
*/
if (H5Tclose(ftype_id) < 0)
@@ -1102,7 +1091,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
}
/*-------------------------------------------------------------------------
- * we do not have request for filter/chunking use H5Ocopy instead
+ * We do not have request for filter/chunking; use H5Ocopy instead
*-------------------------------------------------------------------------
*/
else {
@@ -1116,11 +1105,6 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
if (H5Pset_copy_object(pid, H5O_COPY_WITHOUT_ATTR_FLAG) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_copy_object failed");
- /*-------------------------------------------------------------------------
- * do the copy
- *-------------------------------------------------------------------------
- */
-
if (H5Ocopy(fidin, /* Source file or group identifier */
travt->objs[i].name, /* Name of the source object to be copied */
fidout, /* Destination file or group identifier */
@@ -1129,12 +1113,11 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
H5P_DEFAULT) < 0) /* Properties which apply to the new hard link */
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Ocopy failed");
- /* close property */
if (H5Pclose(pid) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed");
/*-------------------------------------------------------------------------
- * copy attrs manually
+ * Copy attrs manually
*-------------------------------------------------------------------------
*/
if ((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
@@ -1149,9 +1132,9 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
if (options->verbose)
- printf(FORMAT_OBJ, "dset", travt->objs[i].name);
+ HDprintf(FORMAT_OBJ, "dset", travt->objs[i].name);
- } /* end do we have request for filter/chunking */
+ } /* end whether we have request for filter/chunking */
break;
/*-------------------------------------------------------------------------
@@ -1160,7 +1143,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
*/
case H5TRAV_TYPE_NAMED_DATATYPE:
if (options->verbose)
- printf(FORMAT_OBJ, "type", travt->objs[i].name);
+ HDprintf(FORMAT_OBJ, "type", travt->objs[i].name);
if ((type_in = H5Topen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Topen2 failed");
@@ -1199,20 +1182,20 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
case H5TRAV_TYPE_LINK:
case H5TRAV_TYPE_UDLINK:
if (options->verbose)
- printf(FORMAT_OBJ, "link", travt->objs[i].name);
+ HDprintf(FORMAT_OBJ, "link", travt->objs[i].name);
if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, H5P_DEFAULT, H5P_DEFAULT) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Lcopy failed");
if (options->verbose)
- printf(FORMAT_OBJ, "link", travt->objs[i].name);
+ HDprintf(FORMAT_OBJ, "link", travt->objs[i].name);
break;
default:
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Object type not found");
} /* switch */
- } /* end for */
- } /* end if */
+ } /* end for each object to traverse */
+ } /* end if there are objects */
done:
@@ -1250,7 +1233,7 @@ done:
HDfree(hslab_buf);
return ret_value;
-}
+} /* end do_copy_objects() */
/*-------------------------------------------------------------------------
* Function: print_dataset_info
@@ -1300,7 +1283,7 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr)
{
unsigned level = cd_values[0];
- sprintf(temp,"(%d)", level);
+ HDsprintf(temp,"(%d)", level);
HDstrcat(strfilter, temp);
}
#endif
@@ -1314,7 +1297,7 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr)
unsigned options_mask = cd_values[0]; /* from dcpl, not filt*/
unsigned ppb = cd_values[1];
- sprintf(temp,"(%d,", ppb);
+ HDsprintf(temp,"(%d,", ppb);
HDstrcat(strfilter, temp);
if (options_mask & H5_SZIP_EC_OPTION_MASK)
HDstrcpy(temp, "EC) ");
@@ -1344,21 +1327,21 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr)
default:
HDstrcat(strfilter, "UD ");
break;
- } /* switch */
- }/*i*/
+ } /* end switch */
+ } /* end for each filter */
if (!pr)
- printf(FORMAT_OBJ, "dset", objname);
+ HDprintf(FORMAT_OBJ, "dset", objname);
else {
- char str[255], temp[28];
+ char str[512], temp[512];
HDstrcpy(str, "dset ");
HDstrcat(str, strfilter);
- sprintf(temp, " (%.3f:1)", ratio);
+ HDsprintf(temp, " (%.3f:1)", ratio);
HDstrcat(str, temp);
- printf(FORMAT_OBJ, str, objname);
+ HDprintf(FORMAT_OBJ, str, objname);
}
-}
+} /* end print_dataset_info() */
/*-------------------------------------------------------------------------
* Function: copy_user_block
@@ -1428,7 +1411,7 @@ done:
HDclose(outfid);
return ret_value;
-}
+} /* end copy_user_block() */
/*-------------------------------------------------------------------------
* Function: print_user_block
@@ -1483,10 +1466,10 @@ print_user_block(const char *filename, hid_t fid)
for (i = 0; i < nread; i++) {
- printf("%c ", rbuf[i]);
+ HDprintf("%c ", rbuf[i]);
}
- printf("\n");
+ HDprintf("\n");
if (nread < 0) {
HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "nread < 0");
@@ -1501,6 +1484,6 @@ done:
HDclose(fh);
return;
-}
+} /* end print_user_block() */
#endif
diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c
index 3d9472a..7e32def 100644
--- a/tools/src/h5repack/h5repack_filters.c
+++ b/tools/src/h5repack/h5repack_filters.c
@@ -42,7 +42,8 @@ static int aux_copy_obj(hid_t dcpl_id, /* dataset creation property list */
H5D_layout_t layout;
int rank; /* rank of dataset */
hsize_t chsize[64]; /* chunk size in elements */
- unsigned int i;
+ int i;
+ unsigned u;
/* get information about input filters */
if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0)
@@ -65,8 +66,8 @@ static int aux_copy_obj(hid_t dcpl_id, /* dataset creation property list */
if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed");
objout->chunk.rank = rank;
- for (i = 0; i < rank; i++)
- objout->chunk.chunk_lengths[i] = chsize[i];
+ for (u = 0; u < (unsigned)rank; u++)
+ objout->chunk.chunk_lengths[u] = chsize[u];
}
done:
@@ -85,8 +86,7 @@ static int aux_find_obj(const char* name, /* object name from traverse list */
pack_info_t *obj /*OUT*/) /* info about object to filter */
{
char *pdest = NULL;
- char *pname = NULL;
- int result;
+ const char *pname = NULL;
unsigned int i;
for (i = 0; i < options->op_tbl->nelems; i++) {
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index dec25f9..b4e1985 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -23,7 +23,8 @@ static void leave(int ret) H5_ATTR_NORETURN;
/* module-scoped variables */
-static int has_i_o = 0;
+static int has_i = 0;
+static int has_o = 0;
const char *infile = NULL;
const char *outfile = NULL;
@@ -33,34 +34,34 @@ const char *outfile = NULL;
*/
static const char *s_opts = "hVvf:l:m:e:nLj:k:c:d:s:u:b:M:t:a:i:o:S:P:T:G:q:z:E";
static struct long_options l_opts[] = {
- { "help", no_arg, 'h' },
- { "version", no_arg, 'V' },
- { "verbose", no_arg, 'v' },
- { "filter", require_arg, 'f' },
- { "layout", require_arg, 'l' },
- { "minimum", require_arg, 'm' },
- { "file", require_arg, 'e' },
- { "native", no_arg, 'n' },
- { "latest", no_arg, 'L' },
- { "low", require_arg, 'j' },
- { "high", require_arg, 'k' },
- { "compact", require_arg, 'c' },
- { "indexed", require_arg, 'd' },
- { "ssize", require_arg, 's' },
- { "ublock", require_arg, 'u' },
- { "block", require_arg, 'b' },
+ { "help", no_arg, 'h' },
+ { "version", no_arg, 'V' },
+ { "verbose", no_arg, 'v' },
+ { "filter", require_arg, 'f' },
+ { "layout", require_arg, 'l' },
+ { "minimum", require_arg, 'm' },
+ { "file", require_arg, 'e' },
+ { "native", no_arg, 'n' },
+ { "latest", no_arg, 'L' },
+ { "low", require_arg, 'j' },
+ { "high", require_arg, 'k' },
+ { "compact", require_arg, 'c' },
+ { "indexed", require_arg, 'd' },
+ { "ssize", require_arg, 's' },
+ { "ublock", require_arg, 'u' },
+ { "block", require_arg, 'b' },
{ "metadata_block_size", require_arg, 'M' },
- { "threshold", require_arg, 't' },
- { "alignment", require_arg, 'a' },
- { "infile", require_arg, 'i' }, /* -i for backward compability */
- { "outfile", require_arg, 'o' }, /* -o for backward compability */
- { "fs_strategy", require_arg, 'S' },
- { "fs_persist", require_arg, 'P' },
- { "fs_threshold", require_arg, 'T' },
- { "fs_pagesize", require_arg, 'G' },
- { "sort_by", require_arg, 'q' },
- { "sort_order", require_arg, 'z' },
- { "enable-error-stack", no_arg, 'E' },
+ { "threshold", require_arg, 't' },
+ { "alignment", require_arg, 'a' },
+ { "infile", require_arg, 'i' }, /* for backward compability */
+ { "outfile", require_arg, 'o' }, /* for backward compability */
+ { "fs_strategy", require_arg, 'S' },
+ { "fs_persist", require_arg, 'P' },
+ { "fs_threshold", require_arg, 'T' },
+ { "fs_pagesize", require_arg, 'G' },
+ { "sort_by", require_arg, 'q' },
+ { "sort_order", require_arg, 'z' },
+ { "enable-error-stack", no_arg, 'E' },
{ NULL, 0, '\0' }
};
@@ -83,13 +84,17 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, " -v, --verbose Verbose mode, print object information\n");
PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n");
PRINTVALSTREAM(rawoutstream, " -n, --native Use a native HDF5 type when repacking\n");
- PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n");
+ PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they\n");
+ PRINTVALSTREAM(rawoutstream, " occur\n");
PRINTVALSTREAM(rawoutstream, " -L, --latest Use latest version of file format\n");
- PRINTVALSTREAM(rawoutstream, " This option will take precedence over the -j and -k options\n");
- PRINTVALSTREAM(rawoutstream, " --low=BOUND The low bound for library release versions to use when creating\n");
- PRINTVALSTREAM(rawoutstream, " objects in the file (default is H5F_LIBVER_EARLIEST)\n");
- PRINTVALSTREAM(rawoutstream, " --high=BOUND The high bound for library release versions to use when creating\n");
- PRINTVALSTREAM(rawoutstream, " objects in the file (default is H5F_LIBVER_LATEST)\n");
+ PRINTVALSTREAM(rawoutstream, " This option will take precedence over the options\n");
+ PRINTVALSTREAM(rawoutstream, " --low and --high\n");
+ PRINTVALSTREAM(rawoutstream, " --low=BOUND The low bound for library release versions to use\n");
+ PRINTVALSTREAM(rawoutstream, " when creating objects in the file\n");
+ PRINTVALSTREAM(rawoutstream, " (default is H5F_LIBVER_EARLIEST)\n");
+ PRINTVALSTREAM(rawoutstream, " --high=BOUND The high bound for library release versions to use\n");
+ PRINTVALSTREAM(rawoutstream, " when creating objects in the file\n");
+ PRINTVALSTREAM(rawoutstream, " (default is H5F_LIBVER_LATEST)\n");
PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n");
PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n");
PRINTVALSTREAM(rawoutstream, " -s S[:F], --ssize=S[:F] Shared object header message minimum size\n");
@@ -104,10 +109,14 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n");
PRINTVALSTREAM(rawoutstream, " -f FILT, --filter=FILT Filter type\n");
PRINTVALSTREAM(rawoutstream, " -l LAYT, --layout=LAYT Layout type\n");
- PRINTVALSTREAM(rawoutstream, " -S FS_STRATEGY, --fs_strategy=FS_STRATEGY File space management strategy for H5Pset_file_space_strategy\n");
- PRINTVALSTREAM(rawoutstream, " -P FS_PERSIST, --fs_persist=FS_PERSIST Persisting or not persisting free-space for H5Pset_file_space_strategy\n");
- PRINTVALSTREAM(rawoutstream, " -T FS_THRESHOLD, --fs_threshold=FS_THRESHOLD Free-space section threshold for H5Pset_file_space_strategy\n");
- PRINTVALSTREAM(rawoutstream, " -G FS_PAGESIZE, --fs_pagesize=FS_PAGESIZE File space page size for H5Pset_file_space_page_size\n");
+ PRINTVALSTREAM(rawoutstream, " -S FS_STRATEGY, --fs_strategy=FS_STRATEGY File space management strategy for\n");
+ PRINTVALSTREAM(rawoutstream, " H5Pset_file_space_strategy\n");
+ PRINTVALSTREAM(rawoutstream, " -P FS_PERSIST, --fs_persist=FS_PERSIST Persisting or not persisting free-\n");
+ PRINTVALSTREAM(rawoutstream, " space for H5Pset_file_space_strategy\n");
+ PRINTVALSTREAM(rawoutstream, " -T FS_THRESHOLD, --fs_threshold=FS_THRESHOLD Free-space section threshold\n");
+ PRINTVALSTREAM(rawoutstream, " for H5Pset_file_space_strategy\n");
+ PRINTVALSTREAM(rawoutstream, " -G FS_PAGESIZE, --fs_pagesize=FS_PAGESIZE File space page size for\n");
+ PRINTVALSTREAM(rawoutstream, " H5Pset_file_space_page_size\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " M - is an integer greater than 1, size of dataset in bytes (default is 0)\n");
PRINTVALSTREAM(rawoutstream, " E - is a filename.\n");
@@ -115,15 +124,17 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, " U - is a filename.\n");
PRINTVALSTREAM(rawoutstream, " T - is an integer\n");
PRINTVALSTREAM(rawoutstream, " A - is an integer greater than zero\n");
- PRINTVALSTREAM(rawoutstream, " Q - is the sort index type for the input file. It can be \"name\" or \"creation_order\" (default)\n");
- PRINTVALSTREAM(rawoutstream, " Z - is the sort order type for the input file. It can be \"descending\" or \"ascending\" (default)\n");
+ PRINTVALSTREAM(rawoutstream, " Q - is the sort index type for the input file. It can be \"name\" or\n");
+ PRINTVALSTREAM(rawoutstream, " \"creation_order\" (default)\n");
+ PRINTVALSTREAM(rawoutstream, " Z - is the sort order type for the input file. It can be \"descending\" or\n");
+ PRINTVALSTREAM(rawoutstream, " \"ascending\" (default)\n");
PRINTVALSTREAM(rawoutstream, " B - is the user block size, any value that is 512 or greater and is\n");
PRINTVALSTREAM(rawoutstream, " a power of 2 (1024 default)\n");
PRINTVALSTREAM(rawoutstream, " F - is the shared object header message type, any of <dspace|dtype|fill|\n");
PRINTVALSTREAM(rawoutstream, " pline|attr>. If F is not specified, S applies to all messages\n");
PRINTVALSTREAM(rawoutstream, "\n");
- PRINTVALSTREAM(rawoutstream, " BOUND is an integer indicating the library release versions to use when creating\n");
- PRINTVALSTREAM(rawoutstream, " objects in the file (see H5Pset_libver_bounds()):\n");
+ PRINTVALSTREAM(rawoutstream, " BOUND is an integer indicating the library release versions to use when\n");
+ PRINTVALSTREAM(rawoutstream, " creating objects in the file (see H5Pset_libver_bounds()):\n");
PRINTVALSTREAM(rawoutstream, " 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct\n");
PRINTVALSTREAM(rawoutstream, " 1: This is H5F_LIBVER_V18 in H5F_libver_t struct\n");
PRINTVALSTREAM(rawoutstream, " 2: This is H5F_LIBVER_V110 in H5F_libver_t struct\n");
@@ -131,24 +142,31 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " FS_STRATEGY is a string indicating the file space strategy used:\n");
PRINTVALSTREAM(rawoutstream, " FSM_AGGR:\n");
- PRINTVALSTREAM(rawoutstream, " The mechanisms used in managing file space are free-space managers, aggregators and virtual file driver.\n");
+ PRINTVALSTREAM(rawoutstream, " The mechanisms used in managing file space are free-space\n");
+ PRINTVALSTREAM(rawoutstream, " managers, aggregators and virtual file driver.\n");
PRINTVALSTREAM(rawoutstream, " PAGE:\n");
- PRINTVALSTREAM(rawoutstream, " The mechanisms used in managing file space are free-space managers with embedded paged aggregation and virtual file driver.\n");
+ PRINTVALSTREAM(rawoutstream, " The mechanisms used in managing file space are free-space\n");
+ PRINTVALSTREAM(rawoutstream, " managers with embedded paged aggregation and virtual file driver.\n");
PRINTVALSTREAM(rawoutstream, " AGGR:\n");
- PRINTVALSTREAM(rawoutstream, " The mechanisms used in managing file space are aggregators and virtual file driver.\n");
+ PRINTVALSTREAM(rawoutstream, " The mechanisms used in managing file space are aggregators and\n");
+ PRINTVALSTREAM(rawoutstream, " virtual file driver.\n");
PRINTVALSTREAM(rawoutstream, " NONE:\n");
- PRINTVALSTREAM(rawoutstream, " The mechanisms used in managing file space are virtual file driver.\n");
- PRINTVALSTREAM(rawoutstream, " The default strategy when not set is FSM_AGGR without persisting free-space.\n");
+ PRINTVALSTREAM(rawoutstream, " The mechanisms used in managing file space are virtual file\n");
+ PRINTVALSTREAM(rawoutstream, " driver.\n");
+ PRINTVALSTREAM(rawoutstream, " The default strategy when not set is FSM_AGGR without persisting free-\n");
+ PRINTVALSTREAM(rawoutstream, " space.\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " FS_PERSIST is 1 to persisting free-space or 0 to not persisting free-space.\n");
PRINTVALSTREAM(rawoutstream, " The default when not set is not persisting free-space.\n");
PRINTVALSTREAM(rawoutstream, " The value is ignored for AGGR and NONE strategies.\n");
PRINTVALSTREAM(rawoutstream, "\n");
- PRINTVALSTREAM(rawoutstream, " FS_THRESHOLD is the minimum size (in bytes) of free-space sections to be tracked by the library.\n");
+ PRINTVALSTREAM(rawoutstream, " FS_THRESHOLD is the minimum size (in bytes) of free-space sections to be\n");
+ PRINTVALSTREAM(rawoutstream, " tracked by the library.\n");
PRINTVALSTREAM(rawoutstream, " The default when not set is 1.\n");
PRINTVALSTREAM(rawoutstream, " The value is ignored for AGGR and NONE strategies.\n");
PRINTVALSTREAM(rawoutstream, "\n");
- PRINTVALSTREAM(rawoutstream, " FS_PAGESIZE is the size (in bytes) >=512 that is used by the library when the file space strategy PAGE is used.\n");
+ PRINTVALSTREAM(rawoutstream, " FS_PAGESIZE is the size (in bytes) >=512 that is used by the library when\n");
+ PRINTVALSTREAM(rawoutstream, " the file space strategy PAGE is used.\n");
PRINTVALSTREAM(rawoutstream, " The default when not set is 4096.\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " FILT - is a string with the format:\n");
@@ -176,9 +194,9 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, " NBIT (no parameter)\n");
PRINTVALSTREAM(rawoutstream, " SOFF=<scale_factor,scale_type> scale_factor is an integer and scale_type\n");
PRINTVALSTREAM(rawoutstream, " is either IN or DS\n");
- PRINTVALSTREAM(rawoutstream, " UD=<filter_number,filter_flag,cd_value_count,value_1[,value_2,...,value_N]>\n");
- PRINTVALSTREAM(rawoutstream, " required values for filter_number,filter_flag,cd_value_count,value_1\n");
- PRINTVALSTREAM(rawoutstream, " optional values for value_2 to value_N\n");
+ PRINTVALSTREAM(rawoutstream, " UD=<filter_number,filter_flag,cd_value_count,value1[,value2,...,valueN]>\n");
+ PRINTVALSTREAM(rawoutstream, " Required values: filter_number, filter_flag, cd_value_count, value1\n");
+ PRINTVALSTREAM(rawoutstream, " Optional values: value2 to valueN\n");
PRINTVALSTREAM(rawoutstream, " NONE (no parameter)\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " LAYT - is a string with the format:\n");
@@ -215,12 +233,7 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, "4) h5repack -L -c 10 -s 20:dtype file1 file2\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " Using latest file format with maximum compact group size of 10 and\n");
- PRINTVALSTREAM(rawoutstream, " and minimum shared datatype size of 20\n");
- PRINTVALSTREAM(rawoutstream, "\n");
- PRINTVALSTREAM(rawoutstream, "5) h5repack --low=0 --high=1 file1 file2\n");
- PRINTVALSTREAM(rawoutstream, "\n");
- PRINTVALSTREAM(rawoutstream, " Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when\n");
- PRINTVALSTREAM(rawoutstream, " creating the repacked file: file2\n");
+ PRINTVALSTREAM(rawoutstream, " minimum shared datatype size of 20\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, "5) h5repack -f SHUF -f GZIP=1 file1 file2\n");
PRINTVALSTREAM(rawoutstream, "\n");
@@ -230,6 +243,11 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " Add bzip2 filter to all datasets\n");
PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "7) h5repack --low=0 --high=1 file1 file2\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via\n");
+ PRINTVALSTREAM(rawoutstream, " H5Pset_libver_bounds() when creating the repacked file, file2\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
}
/*-------------------------------------------------------------------------
@@ -264,7 +282,7 @@ int read_info(const char *filename, pack_opt_t *options)
int i, rc = 1;
int ret_value = EXIT_SUCCESS;
- if ((fp = HDfopen(filename, "r")) == (FILE *) NULL) {
+ if (NULL == (fp = HDfopen(filename, "r"))) {
error_msg("cannot open options file %s\n", filename);
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
@@ -273,90 +291,46 @@ int read_info(const char *filename, pack_opt_t *options)
/* cycle until end of file reached */
while (1) {
- rc = fscanf(fp, "%s", stype);
- if (rc == -1)
- break;
-
- /*-------------------------------------------------------------------------
- * filter
- *-------------------------------------------------------------------------
- */
- if (HDstrcmp(stype,"-f") == 0) {
- /* find begining of info */
- i = 0;
- c = '0';
- while (c != ' ') {
- if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
- error_msg("fscanf error\n");
- h5tools_setstatus(EXIT_FAILURE);
- ret_value = EXIT_FAILURE;
- goto done;
- } /* end if */
- if (HDfeof(fp))
- break;
- }
- c = '0';
- /* go until end */
- while (c != ' ') {
- if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
- error_msg("fscanf error\n");
- h5tools_setstatus(EXIT_FAILURE);
- ret_value = EXIT_FAILURE;
- goto done;
- } /* end if */
- comp_info[i] = c;
- i++;
- if (HDfeof(fp))
- break;
- if (c == 10 /*eol*/)
- break;
- }
- comp_info[i - 1] = '\0'; /*cut the last " */
- if (h5repack_addfilter(comp_info, options) == -1) {
- error_msg("could not add compression option\n");
+ /* Info indicator must be for layout or filter */
+ if (HDstrcmp(stype,"-l") && HDstrcmp(stype, "-f")) {
+ error_msg("bad file format for %s", filename);
+ h5tools_setstatus(EXIT_FAILURE);
+ ret_value = EXIT_FAILURE;
+ goto done;
+ }
+
+ /* find begining of info */
+ i = 0;
+ c = '0';
+ while (c != ' ') {
+ if (fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
goto done;
}
+ if (HDfeof(fp))
+ break;
}
- /*-------------------------------------------------------------------------
- * layout
- *-------------------------------------------------------------------------
- */
- else if (HDstrcmp(stype,"-l") == 0) {
-
- /* find begining of info */
- i = 0;
- c = '0';
- while (c != ' ') {
- if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
- error_msg("fscanf error\n");
- h5tools_setstatus(EXIT_FAILURE);
- ret_value = EXIT_FAILURE;
- goto done;
- } /* end if */
- if (HDfeof(fp))
- break;
- }
- c = '0';
- /* go until end */
- while (c != ' ') {
- if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
- error_msg("fscanf error\n");
- h5tools_setstatus(EXIT_FAILURE);
- ret_value = EXIT_FAILURE;
- goto done;
- } /* end if */
- comp_info[i] = c;
- i++;
- if (HDfeof(fp))
- break;
- if (c == 10 /*eol*/)
- break;
+ c = '0';
+ /* go until end */
+ while (c != ' ') {
+ if (fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ error_msg("fscanf error\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ ret_value = EXIT_FAILURE;
+ goto done;
}
- comp_info[i - 1] = '\0'; /*cut the last " */
+ comp_info[i++] = c;
+ if (HDfeof(fp))
+ break;
+ if (c == 10 /*eol*/)
+ break;
+ }
+ comp_info[i - 1] = '\0'; /*cut the last " */
+ if (!HDstrcmp(stype, "-l")) {
if (h5repack_addlayout(comp_info, options) == -1) {
error_msg("could not add chunck option\n");
h5tools_setstatus(EXIT_FAILURE);
@@ -364,17 +338,15 @@ int read_info(const char *filename, pack_opt_t *options)
goto done;
}
}
- /*-------------------------------------------------------------------------
- * not valid
- *-------------------------------------------------------------------------
- */
else {
- error_msg("bad file format for %s", filename);
- h5tools_setstatus(EXIT_FAILURE);
- ret_value = EXIT_FAILURE;
- goto done;
+ if (h5repack_addfilter(comp_info, options) == -1) {
+ error_msg("could not add compression option\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ ret_value = EXIT_FAILURE;
+ goto done;
+ }
}
- }
+ } /* end while info-read cycling */
done:
if (fp)
@@ -398,9 +370,9 @@ set_sort_by(const char *form)
{
H5_index_t idx_type = H5_INDEX_UNKNOWN;
- if (HDstrcmp(form,"name")==0) /* H5_INDEX_NAME */
+ if (!HDstrcmp(form, "name"))
idx_type = H5_INDEX_NAME;
- else if (HDstrcmp(form,"creation_order")==0) /* H5_INDEX_CRT_ORDER */
+ else if (!HDstrcmp(form, "creation_order"))
idx_type = H5_INDEX_CRT_ORDER;
return idx_type;
@@ -421,9 +393,9 @@ set_sort_order(const char *form)
{
H5_iter_order_t iter_order = H5_ITER_UNKNOWN;
- if (HDstrcmp(form,"ascending")==0) /* H5_ITER_INC */
+ if (!HDstrcmp(form, "ascending"))
iter_order = H5_ITER_INC;
- else if (HDstrcmp(form,"descending")==0) /* H5_ITER_DEC */
+ else if (!HDstrcmp(form, "descending"))
iter_order = H5_ITER_DEC;
return iter_order;
@@ -442,19 +414,19 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
int ret_value = 0;
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while (EOF != (opt = get_option(argc, argv, s_opts, l_opts))) {
switch ((char) opt) {
/* -i for backward compatibility */
case 'i':
infile = opt_arg;
- has_i_o = 1;
+ has_i++;
break;
/* -o for backward compatibility */
case 'o':
outfile = opt_arg;
- has_i_o = 1;
+ has_o++;
break;
case 'h':
@@ -519,7 +491,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
case 'j':
options->low_bound = (H5F_libver_t)HDatoi(opt_arg);
- if(options->low_bound < H5F_LIBVER_EARLIEST || options->low_bound > H5F_LIBVER_LATEST) {
+ if (options->low_bound < H5F_LIBVER_EARLIEST || options->low_bound > H5F_LIBVER_LATEST) {
error_msg("in parsing low bound\n");
goto done;
}
@@ -527,7 +499,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
case 'k':
options->high_bound = (H5F_libver_t)HDatoi(opt_arg);
- if(options->high_bound < H5F_LIBVER_EARLIEST || options->high_bound > H5F_LIBVER_LATEST) {
+ if (options->high_bound < H5F_LIBVER_EARLIEST || options->high_bound > H5F_LIBVER_LATEST) {
error_msg("in parsing high bound\n");
goto done;
}
@@ -549,10 +521,10 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
{
int idx = 0;
int ssize = 0;
- char *msgPtr = HDstrchr( opt_arg, ':');
+ char *msgPtr = HDstrchr(opt_arg, ':');
options->latest = TRUE; /* must use latest format */
if (msgPtr == NULL) {
- ssize = HDatoi( opt_arg );
+ ssize = HDatoi(opt_arg);
for (idx = 0; idx < 5; idx++)
options->msg_size[idx] = ssize;
}
@@ -562,15 +534,15 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
HDstrcpy(msgType, msgPtr + 1);
msgPtr[0] = '\0';
ssize = HDatoi( opt_arg );
- if (HDstrncmp(msgType, "dspace",6) == 0)
+ if (!HDstrncmp(msgType, "dspace", 6))
options->msg_size[0] = ssize;
- else if (HDstrncmp(msgType, "dtype", 5) == 0)
+ else if (!HDstrncmp(msgType, "dtype", 5))
options->msg_size[1] = ssize;
- else if (HDstrncmp(msgType, "fill", 4) == 0)
+ else if (!HDstrncmp(msgType, "fill", 4))
options->msg_size[2] = ssize;
- else if (HDstrncmp(msgType, "pline", 5) == 0)
+ else if (!HDstrncmp(msgType, "pline", 5))
options->msg_size[3] = ssize;
- else if (HDstrncmp(msgType, "attr", 4) == 0)
+ else if (!HDstrncmp(msgType, "attr", 4))
options->msg_size[4] = ssize;
}
}
@@ -607,13 +579,13 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
char strategy[MAX_NC_NAME];
HDstrcpy(strategy, opt_arg);
- if(!HDstrcmp(strategy, "FSM_AGGR"))
+ if (!HDstrcmp(strategy, "FSM_AGGR"))
options->fs_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR;
- else if(!HDstrcmp(strategy, "PAGE"))
+ else if (!HDstrcmp(strategy, "PAGE"))
options->fs_strategy = H5F_FSPACE_STRATEGY_PAGE;
- else if(!HDstrcmp(strategy, "AGGR"))
+ else if (!HDstrcmp(strategy, "AGGR"))
options->fs_strategy = H5F_FSPACE_STRATEGY_AGGR;
- else if(!HDstrcmp(strategy, "NONE"))
+ else if (!HDstrcmp(strategy, "NONE"))
options->fs_strategy = H5F_FSPACE_STRATEGY_NONE;
else {
error_msg("invalid file space management strategy\n", opt_arg);
@@ -621,7 +593,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
ret_value = -1;
goto done;
}
- if(options->fs_strategy == (H5F_fspace_strategy_t)0)
+ if (options->fs_strategy == (H5F_fspace_strategy_t)0)
/* To distinguish the "specified" zero value */
options->fs_strategy = (H5F_fspace_strategy_t)-1;
}
@@ -629,27 +601,27 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
case 'P':
options->fs_persist = HDatoi(opt_arg);
- if(options->fs_persist == 0)
+ if (options->fs_persist == 0)
/* To distinguish the "specified" zero value */
options->fs_persist = -1;
break;
case 'T':
options->fs_threshold = HDatol(opt_arg);
- if(options->fs_threshold == 0)
+ if (options->fs_threshold == 0)
/* To distinguish the "specified" zero value */
options->fs_threshold = -1;
break;
case 'G':
options->fs_pagesize = HDstrtoll(opt_arg, NULL, 0);
- if(options->fs_pagesize == 0)
+ if (options->fs_pagesize == 0)
/* To distinguish the "specified" zero value */
options->fs_pagesize = -1;
break;
case 'q':
- if((sort_by = set_sort_by(opt_arg)) < 0) {
+ if (H5_INDEX_UNKNOWN == set_sort_by(opt_arg)) {
error_msg(" failed to set sort by form <%s>\n", opt_arg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
@@ -658,7 +630,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
break;
case 'z':
- if((sort_order = set_sort_order(opt_arg)) < 0) {
+ if (set_sort_order(opt_arg) == H5_ITER_UNKNOWN) {
error_msg(" failed to set sort order form <%s>\n", opt_arg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
@@ -672,18 +644,35 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
default:
break;
- } /* switch */
- } /* while */
-
- if (has_i_o == 0) {
- /* check for file names to be processed */
- if (argc <= opt_ind || argv[opt_ind + 1] == NULL) {
- error_msg("missing file names\n");
- usage(h5tools_getprogname());
- h5tools_setstatus(EXIT_FAILURE);
- ret_value = -1;
- }
- }
+ } /* end switch */
+ } /* end while there are more options to parse */
+
+ /* If neither -i nor -o given, get in and out files positionally */
+ if (0 == (has_i + has_o)) {
+ if (argv[opt_ind] != NULL && argv[opt_ind + 1] != NULL) {
+ infile = argv[opt_ind];
+ outfile = argv[opt_ind + 1];
+
+ if (!HDstrcmp(infile, outfile)) {
+ error_msg("file names cannot be the same\n");
+ usage(h5tools_getprogname());
+ h5tools_setstatus(EXIT_FAILURE);
+ ret_value = -1;
+ }
+ }
+ else {
+ error_msg("file names missing\n");
+ usage(h5tools_getprogname());
+ h5tools_setstatus(EXIT_FAILURE);
+ ret_value = -1;
+ }
+ }
+ else if (has_i != 1 || has_o != 1) {
+ error_msg("filenames must be either both -i -o or both positional\n");
+ usage(h5tools_getprogname());
+ h5tools_setstatus(EXIT_FAILURE);
+ ret_value = -1;
+ }
done:
return ret_value;
@@ -740,28 +729,6 @@ int main(int argc, const char **argv)
if (parse_command_line(argc, argv, &options) < 0)
goto done;
- /* get file names if they were not yet got */
- if (has_i_o == 0) {
-
- if (argv[opt_ind] != NULL && argv[opt_ind + 1] != NULL) {
- infile = argv[opt_ind];
- outfile = argv[opt_ind + 1];
-
- if ( HDstrcmp( infile, outfile ) == 0) {
- error_msg("file names cannot be the same\n");
- usage(h5tools_getprogname());
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
- }
- }
- else {
- error_msg("file names missing\n");
- usage(h5tools_getprogname());
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
- }
- }
-
if (enable_error_stack > 0) {
H5Eset_auto2(H5E_DEFAULT, func, edata);
H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata);
diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c
index a275443..7e8951f 100644
--- a/tools/src/h5repack/h5repack_refs.c
+++ b/tools/src/h5repack/h5repack_refs.c
@@ -22,7 +22,7 @@
*/
static const char* MapIdToName(hid_t refobj_id,trav_table_t *travt);
-static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options,
+static int copy_refs_attr(hid_t loc_in, hid_t loc_out,
trav_table_t *travt, hid_t fidout);
static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in,
hid_t fid_out, void *ref_out, trav_table_t *travt);
@@ -81,7 +81,7 @@ int do_copy_refobjs(hid_t fidin,
if((grp_in = H5Gopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed");
- if(copy_refs_attr(grp_in, grp_out, options, travt, fidout) < 0)
+ if(copy_refs_attr(grp_in, grp_out, travt, fidout) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed");
if(H5Gclose(grp_out) < 0)
@@ -158,7 +158,7 @@ int do_copy_refobjs(hid_t fidin,
if(nelmts) {
buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize));
if(buf==NULL) {
- printf("cannot read into memory\n" );
+ HDprintf("cannot read into memory\n" );
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
} /* end if */
if(H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
@@ -166,7 +166,7 @@ int do_copy_refobjs(hid_t fidin,
refbuf = (hobj_ref_t*) HDcalloc((unsigned)nelmts, msize);
if(refbuf == NULL){
- printf("cannot allocate memory\n" );
+ HDprintf("cannot allocate memory\n" );
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed");
} /* end if */
for(u = 0; u < nelmts; u++) {
@@ -183,8 +183,8 @@ int do_copy_refobjs(hid_t fidin,
if(H5Rcreate(&refbuf[u], fidout, refname, H5R_OBJECT, (hid_t)-1) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed");
if(options->verbose) {
- printf(FORMAT_OBJ,"dset",travt->objs[i].name );
- printf("object <%s> object reference created to <%s>\n",
+ HDprintf(FORMAT_OBJ,"dset",travt->objs[i].name );
+ HDprintf("object <%s> object reference created to <%s>\n",
travt->objs[i].name,
refname);
}
@@ -234,7 +234,7 @@ int do_copy_refobjs(hid_t fidin,
if(nelmts) {
buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize));
if(buf == NULL) {
- printf("cannot read into memory\n");
+ HDprintf("cannot read into memory\n");
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
} /* end if */
if(H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
@@ -246,7 +246,7 @@ int do_copy_refobjs(hid_t fidin,
*/
refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */
if(refbuf == NULL) {
- printf("cannot allocate memory\n");
+ HDprintf("cannot allocate memory\n");
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed");
} /* end if */
@@ -271,8 +271,8 @@ int do_copy_refobjs(hid_t fidin,
if(H5Sclose(region_id) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
if(options->verbose) {
- printf(FORMAT_OBJ,"dset",travt->objs[i].name );
- printf("object <%s> region reference created to <%s>\n",
+ HDprintf(FORMAT_OBJ,"dset",travt->objs[i].name );
+ HDprintf("object <%s> region reference created to <%s>\n",
travt->objs[i].name,
refname);
}
@@ -316,7 +316,7 @@ int do_copy_refobjs(hid_t fidin,
* copy referenced objects in attributes
*-------------------------------------------------------------------------
*/
- if(copy_refs_attr(dset_in, dset_out, options, travt, fidout) < 0)
+ if(copy_refs_attr(dset_in, dset_out, travt, fidout) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed");
/*-------------------------------------------------------------------------
@@ -426,7 +426,6 @@ done:
static int copy_refs_attr(hid_t loc_in,
hid_t loc_out,
- pack_opt_t *options,
trav_table_t *travt,
hid_t fidout) /* for saving references */
{
@@ -450,7 +449,6 @@ static int copy_refs_attr(hid_t loc_in,
is_ref_comp = 0;
void *refbuf = NULL;
void *buf = NULL;
- const char *refname = NULL;
unsigned *ref_comp_index = NULL;
size_t *ref_comp_size = NULL;
int ref_comp_field_n = 0;
@@ -592,7 +590,7 @@ static int copy_refs_attr(hid_t loc_in,
if((is_ref || is_ref_array) && (H5R_OBJ_REF_BUF_SIZE==msize)) {
buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize));
if(buf == NULL) {
- printf("cannot read into memory\n");
+ HDprintf("cannot read into memory\n");
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
} /* end if */
if(H5Aread(attr_id, mtype_id, buf) < 0)
@@ -600,23 +598,20 @@ static int copy_refs_attr(hid_t loc_in,
refbuf = (hobj_ref_t *)HDcalloc((unsigned)nelmts, msize);
if(refbuf == NULL) {
- printf("cannot allocate memory\n");
+ HDprintf("cannot allocate memory\n");
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed");
} /* end if */
- for(i = 0; i < (unsigned)nelmts; i++) {
- if (update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, &((hobj_ref_t *)refbuf)[i], travt)<0)
+ for(i = 0; i < (unsigned)nelmts; i++)
+ if(update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, &((hobj_ref_t *)refbuf)[i], travt) < 0)
continue;
- if(options->verbose)
- printf("object <%s> reference created to <%s>\n", name, refname);
- } /* i */
} /* H5T_STD_REF_OBJ */
/* handle region references */
else if((is_ref || is_ref_array) && (H5R_DSET_REG_REF_BUF_SIZE == msize)) {
buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize));
if(buf == NULL) {
- printf( "cannot read into memory\n" );
+ HDprintf( "cannot read into memory\n" );
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
} /* end if */
if(H5Aread(attr_id, mtype_id, buf) < 0)
@@ -628,16 +623,13 @@ static int copy_refs_attr(hid_t loc_in,
*/
refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */
if(refbuf == NULL) {
- printf( "cannot allocate memory\n" );
+ HDprintf( "cannot allocate memory\n" );
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed");
} /* end if */
- for(i = 0; i < (unsigned)nelmts; i++) {
- if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt)<0)
+ for(i = 0; i < (unsigned)nelmts; i++)
+ if(update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt) < 0)
continue;
- if(options->verbose)
- printf("object <%s> region reference created to <%s>\n", name, refname);
- }
} /* H5T_STD_REF_DSETREG */
else if (is_ref_vlen) {
/* handle VLEN of references */
@@ -646,7 +638,7 @@ static int copy_refs_attr(hid_t loc_in,
refbuf = buf; /* reuse the read buffer for write */
if(buf == NULL) {
- printf( "cannot read into memory\n" );
+ HDprintf( "cannot read into memory\n" );
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
} /* end if */
@@ -687,7 +679,7 @@ static int copy_refs_attr(hid_t loc_in,
refbuf = buf; /* reuse the read buffer for write */
if(buf == NULL) {
- printf( "cannot read into memory\n" );
+ HDprintf( "cannot read into memory\n" );
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
} /* end if */
@@ -700,7 +692,7 @@ static int copy_refs_attr(hid_t loc_in,
size_t idx = (i * msize) + H5Tget_member_offset(mtype_id, ref_comp_index[j]);
hobj_ref_t ref_out;
- if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
+ if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)((void *)(((char *)buf)+idx)), fidout, &ref_out, travt) < 0) /* Extra (void *) cast to quiet "cast to create alignment" warning - 2019/07/05, QAK */
continue;
HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
} /* if */
diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt
index 56c172c..55c675f 100644
--- a/tools/src/h5stat/CMakeLists.txt
+++ b/tools/src/h5stat/CMakeLists.txt
@@ -4,18 +4,20 @@ project (HDF5_TOOLS_SRC_H5STAT C)
# --------------------------------------------------------------------
# Add the h5stat executables
# --------------------------------------------------------------------
-add_executable (h5stat ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c)
-target_include_directories(h5stat PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5stat STATIC)
-target_link_libraries (h5stat PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_target_properties (h5stat PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5stat")
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h5stat ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c)
+ target_include_directories (h5stat PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5stat STATIC)
+ target_link_libraries (h5stat PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5stat PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5stat")
-set (H5_DEP_EXECUTABLES h5stat)
+ set (H5_DEP_EXECUTABLES h5stat)
+endif ()
if (BUILD_SHARED_LIBS)
add_executable (h5stat-shared ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c)
- target_include_directories(h5stat-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5stat-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5stat-shared SHARED)
target_link_libraries (h5stat-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
set_target_properties (h5stat-shared PROPERTIES FOLDER tools)
diff --git a/tools/src/h5stat/Makefile.in b/tools/src/h5stat/Makefile.in
index 67cc674..50ef10f 100644
--- a/tools/src/h5stat/Makefile.in
+++ b/tools/src/h5stat/Makefile.in
@@ -486,7 +486,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -509,9 +508,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -538,6 +540,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -592,6 +595,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -616,7 +620,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1331,7 +1334,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index 8109b93..dba15e4 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -74,14 +74,14 @@ typedef struct iter_t {
ohdr_info_t group_ohdr_info; /* Object header information for groups */
hsize_t max_attrs; /* Maximum attributes from a group */
- unsigned long *num_small_attrs; /* Size of small attributes tracked */
+ unsigned long *num_small_attrs; /* Size of small attributes tracked */
unsigned attr_nbins; /* Number of bins for attribute counts */
unsigned long *attr_bins; /* Pointer to array of bins for attribute counts */
unsigned max_dset_rank; /* Maximum rank of dataset */
unsigned long dset_rank_count[H5S_MAX_RANK]; /* Number of datasets of each rank */
hsize_t max_dset_dims; /* Maximum dimension size of dataset */
- unsigned long *small_dset_dims; /* Size of dimensions of small datasets tracked */
+ unsigned long *small_dset_dims; /* Size of dimensions of small datasets tracked */
unsigned long dset_layouts[H5D_NLAYOUTS]; /* Type of storage for each dataset */
unsigned long dset_comptype[H5_NFILTERS_IMPL]; /* Number of currently implemented filters */
unsigned long dset_ntypes; /* Number of diff. dataset datatypes found */
@@ -118,6 +118,33 @@ typedef struct iter_t {
} iter_t;
+static const char *drivername = "";
+
+#ifdef H5_HAVE_ROS3_VFD
+/* default "anonymous" s3 configuration
+ */
+static H5FD_ros3_fapl_t ros3_fa = {
+ 1, /* fapl version */
+ false, /* authenticate */
+ "", /* aws region */
+ "", /* access key id */
+ "", /* secret access key */
+};
+#endif /* H5_HAVE_ROS3_VFD */
+
+#ifdef H5_HAVE_LIBHDFS
+/* default HDFS access configuration
+ */
+static H5FD_hdfs_fapl_t hdfs_fa = {
+ 1, /* fapl version */
+ "localhost", /* namenode name */
+ 0, /* namenode port */
+ "", /* kerberos ticket cache */
+ "", /* user name */
+ 2048, /* stream buffer size */
+};
+#endif /* H5_HAVE_LIBHDFS */
+
static int display_all = TRUE;
/* Enable the printing of selected statistics */
@@ -146,7 +173,7 @@ struct handler_t {
char **obj;
};
-static const char *s_opts ="Aa:Ddm:EFfhGgl:sSTO:V";
+static const char *s_opts ="Aa:Ddm:EFfhGgl:sSTO:Vw:H:";
/* e.g. "filemetadata" has to precede "file"; "groupmetadata" has to precede "group" etc. */
static struct long_options l_opts[] = {
{"help", no_arg, 'h'},
@@ -246,6 +273,8 @@ static struct long_options l_opts[] = {
{ "summ", no_arg, 'S' },
{ "sum", no_arg, 'S' },
{ "su", no_arg, 'S' },
+ { "s3-cred", require_arg, 'w' },
+ { "hdfs-attrs", require_arg, 'H' },
{ NULL, 0, '\0' }
};
@@ -257,7 +286,7 @@ leave(int ret)
}
-
+
/*-------------------------------------------------------------------------
* Function: usage
*
@@ -295,9 +324,19 @@ static void usage(const char *prog)
HDfprintf(stdout, " -s, --freespace Print free space information\n");
HDfprintf(stdout, " -S, --summary Print summary of file space information\n");
HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n");
+ HDfprintf(stdout, " --s3-cred=<cred> Access file on S3, using provided credential\n");
+ HDfprintf(stdout, " <cred> :: (region,id,key)\n");
+ HDfprintf(stdout, " If <cred> == \"(,,)\", no authentication is used.\n");
+ HDfprintf(stdout, " --hdfs-attrs=<attrs> Access a file on HDFS with given configuration\n");
+ HDfprintf(stdout, " attributes.\n");
+ HDfprintf(stdout, " <attrs> :: (<namenode name>,<namenode port>,\n");
+ HDfprintf(stdout, " <kerberos cache path>,<username>,\n");
+ HDfprintf(stdout, " <buffer size>)\n");
+ HDfprintf(stdout, " If an attribute is empty, a default value will be\n");
+ HDfprintf(stdout, " used.\n");
}
-
+
/*-------------------------------------------------------------------------
* Function: ceil_log10
*
@@ -324,7 +363,7 @@ ceil_log10(unsigned long x)
return ret;
} /* ceil_log10() */
-
+
/*-------------------------------------------------------------------------
* Function: attribute_stats
*
@@ -357,12 +396,12 @@ attribute_stats(iter_t *iter, const H5O_info_t *oi)
/* Add attribute count to proper bin */
bin = ceil_log10((unsigned long)oi->num_attrs);
if((bin + 1) > iter->attr_nbins) {
- iter->attr_bins = (unsigned long *)HDrealloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long));
+ iter->attr_bins = (unsigned long *)HDrealloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long));
HDassert(iter->attr_bins);
/* Initialize counts for intermediate bins */
while(iter->attr_nbins < bin)
- iter->attr_bins[iter->attr_nbins++] = 0;
+ iter->attr_bins[iter->attr_nbins++] = 0;
iter->attr_nbins++;
/* Initialize count for new bin */
@@ -374,7 +413,7 @@ attribute_stats(iter_t *iter, const H5O_info_t *oi)
return 0;
} /* end attribute_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: group_stats
*
@@ -456,7 +495,7 @@ done:
return ret_value;
} /* end group_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: dataset_stats
*
@@ -509,8 +548,8 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "attribute_stats() failed");
/* Get storage info */
- if((storage = H5Dget_storage_size(did)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_storage_size() failed");
+ /* Failure 0 indistinguishable from no-data-stored 0 */
+ storage = H5Dget_storage_size(did);
/* Gather layout statistics */
if((dcpl = H5Dget_create_plist(did)) < 0)
@@ -535,7 +574,8 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
if(num_ext) {
iter->nexternal += (unsigned long)num_ext;
iter->dset_external_storage_size += (unsigned long)storage;
- } else
+ }
+ else
iter->dset_storage_size += storage;
/* Gather dataspace statistics */
@@ -648,7 +688,7 @@ done:
return ret_value;
} /* end dataset_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: datatype_stats
*
@@ -680,7 +720,7 @@ done:
return ret_value;
} /* end datatype_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: obj_stats
*
@@ -736,7 +776,7 @@ done:
return ret_value;
} /* end obj_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: lnk_stats
*
@@ -834,7 +874,7 @@ freespace_stats(hid_t fid, iter_t *iter)
return 0;
} /* end freespace_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: hand_free
*
@@ -863,7 +903,7 @@ hand_free(struct handler_t *hand)
} /* end if */
} /* end hand_free() */
-
+
/*-------------------------------------------------------------------------
* Function: parse_command_line
*
@@ -931,7 +971,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
error_msg("Invalid threshold for small groups\n");
goto error;
}
- } else
+ }
+ else
error_msg("Missing threshold for small groups\n");
break;
@@ -953,7 +994,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
error_msg("Invalid threshold for small datasets\n");
goto error;
}
- } else
+ }
+ else
error_msg("Missing threshold for small datasets\n");
break;
@@ -975,7 +1017,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
error_msg("Invalid threshold for small # of attributes\n");
goto error;
}
- } else
+ }
+ else
error_msg("Missing threshold for small # of attributes\n");
break;
@@ -1015,6 +1058,105 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
} /* end if */
break;
+ case 'w':
+#ifndef H5_HAVE_ROS3_VFD
+ error_msg("Read-Only S3 VFD not enabled.\n");
+ goto error;
+#else
+ {
+ char *cred_str = NULL;
+ unsigned nelems = 0;
+ char **cred = NULL;
+ char const *ccred[3];
+
+ if (FAIL == parse_tuple((const char *)opt_arg, ',', &cred_str, &nelems, &cred)) {
+ error_msg("Unable to parse s3 credential\n");
+ goto error;
+ }
+ if (nelems != 3) {
+ error_msg("s3 credential must have three elements\n");
+ goto error;
+ }
+ ccred[0] = (const char *)cred[0];
+ ccred[1] = (const char *)cred[1];
+ ccred[2] = (const char *)cred[2];
+ if (0 == h5tools_populate_ros3_fapl(&ros3_fa, ccred)) {
+ error_msg("Unable to set ros3 fapl config\n");
+ goto error;
+ }
+ HDfree(cred);
+ HDfree(cred_str);
+ } /* parse s3-cred block */
+ drivername = "ros3";
+ break;
+#endif /* H5_HAVE_ROS3_VFD */
+
+ case 'H':
+#ifndef H5_HAVE_LIBHDFS
+ error_msg("HDFS VFD is not enabled.\n");
+ goto error;
+#else
+ {
+ unsigned nelems = 0;
+ char *props_src = NULL;
+ char **props = NULL;
+ unsigned long k = 0;
+ if (FAIL == parse_tuple((const char *)opt_arg,
+ ',', &props_src, &nelems, &props)) {
+ error_msg("unable to parse hdfs properties tuple\n");
+ goto error;
+ }
+ /* sanity-check tuple count
+ */
+ if (nelems != 5) {
+ char str[64] = "";
+ HDsprintf(str,
+ "expected 5 elements in hdfs properties tuple "
+ "but found %u\n",
+ nelems);
+ HDfree(props);
+ HDfree(props_src);
+ error_msg(str);
+ goto error;
+ }
+ /* Populate fapl configuration structure with given
+ * properties.
+ * TODO/WARNING: No error-checking is done on length of
+ * input strings... Silent overflow is possible,
+ * albeit unlikely.
+ */
+ if (HDstrncmp(props[0], "", 1)) {
+ HDstrncpy(hdfs_fa.namenode_name,(const char *)props[0], HDstrlen(props[0]));
+ }
+ if (HDstrncmp(props[1], "", 1)) {
+ k = strtoul((const char *)props[1], NULL, 0);
+ if (errno == ERANGE) {
+ error_msg("supposed port number wasn't.\n");
+ goto error;
+ }
+ hdfs_fa.namenode_port = (int32_t)k;
+ }
+ if (HDstrncmp(props[2], "", 1)) {
+ HDstrncpy(hdfs_fa.kerberos_ticket_cache, (const char *)props[2], HDstrlen(props[2]));
+ }
+ if (HDstrncmp(props[3], "", 1)) {
+ HDstrncpy(hdfs_fa.user_name, (const char *)props[3], HDstrlen(props[3]));
+ }
+ if (strncmp(props[4], "", 1)) {
+ k = HDstrtoul((const char *)props[4], NULL, 0);
+ if (errno == ERANGE) {
+ error_msg("supposed buffersize number wasn't.\n");
+ goto error;
+ }
+ hdfs_fa.stream_buffer_size = (int32_t)k;
+ }
+ HDfree(props);
+ HDfree(props_src);
+ drivername = "hdfs";
+ }
+ break;
+#endif /* H5_HAVE_LIBHDFS */
+
default:
usage(h5tools_getprogname());
goto error;
@@ -1041,7 +1183,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: iter_free
*
@@ -1106,7 +1248,7 @@ iter_free(iter_t *iter)
} /* end if */
} /* end iter_free() */
-
+
/*-------------------------------------------------------------------------
* Function: print_file_info
*
@@ -1126,19 +1268,19 @@ iter_free(iter_t *iter)
static herr_t
print_file_info(const iter_t *iter)
{
- printf("File information\n");
- printf("\t# of unique groups: %lu\n", iter->uniq_groups);
- printf("\t# of unique datasets: %lu\n", iter->uniq_dsets);
- printf("\t# of unique named datatypes: %lu\n", iter->uniq_dtypes);
- printf("\t# of unique links: %lu\n", iter->uniq_links);
- printf("\t# of unique other: %lu\n", iter->uniq_others);
- printf("\tMax. # of links to object: %lu\n", iter->max_links);
+ HDprintf("File information\n");
+ HDprintf("\t# of unique groups: %lu\n", iter->uniq_groups);
+ HDprintf("\t# of unique datasets: %lu\n", iter->uniq_dsets);
+ HDprintf("\t# of unique named datatypes: %lu\n", iter->uniq_dtypes);
+ HDprintf("\t# of unique links: %lu\n", iter->uniq_links);
+ HDprintf("\t# of unique other: %lu\n", iter->uniq_others);
+ HDprintf("\tMax. # of links to object: %lu\n", iter->max_links);
HDfprintf(stdout, "\tMax. # of objects in group: %Hu\n", iter->max_fanout);
return 0;
} /* print_file_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_file_metadata
*
@@ -1162,15 +1304,12 @@ print_file_metadata(const iter_t *iter)
HDfprintf(stdout, "\tUser block: %Hu\n", iter->ublk_size);
HDfprintf(stdout, "\tObject headers: (total/unused)\n");
- HDfprintf(stdout, "\t\tGroups: %Hu/%Hu\n",
- iter->group_ohdr_info.total_size,
- iter->group_ohdr_info.free_size);
+ HDfprintf(stdout, "\t\tGroups: %Hu/%Hu\n", iter->group_ohdr_info.total_size,
+ iter->group_ohdr_info.free_size);
HDfprintf(stdout, "\t\tDatasets(exclude compact data): %Hu/%Hu\n",
- iter->dset_ohdr_info.total_size,
- iter->dset_ohdr_info.free_size);
- HDfprintf(stdout, "\t\tDatatypes: %Hu/%Hu\n",
- iter->dtype_ohdr_info.total_size,
- iter->dtype_ohdr_info.free_size);
+ iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size);
+ HDfprintf(stdout, "\t\tDatatypes: %Hu/%Hu\n", iter->dtype_ohdr_info.total_size,
+ iter->dtype_ohdr_info.free_size);
HDfprintf(stdout, "\tGroups:\n");
HDfprintf(stdout, "\t\tB-tree/List: %Hu\n", iter->groups_btree_storage_size);
@@ -1198,7 +1337,7 @@ print_file_metadata(const iter_t *iter)
return 0;
} /* print_file_metadata() */
-
+
/*-------------------------------------------------------------------------
* Function: print_group_info
*
@@ -1225,37 +1364,37 @@ print_group_info(const iter_t *iter)
unsigned long total; /* Total count for various statistics */
unsigned u; /* Local index variable */
- printf("Small groups (with 0 to %u links):\n", sgroups_threshold-1);
+ HDprintf("Small groups (with 0 to %u links):\n", sgroups_threshold-1);
total = 0;
for(u = 0; u < (unsigned)sgroups_threshold; u++) {
if(iter->num_small_groups[u] > 0) {
- printf("\t# of groups with %u link(s): %lu\n", u, iter->num_small_groups[u]);
+ HDprintf("\t# of groups with %u link(s): %lu\n", u, iter->num_small_groups[u]);
total += iter->num_small_groups[u];
} /* end if */
} /* end for */
- printf("\tTotal # of small groups: %lu\n", total);
+ HDprintf("\tTotal # of small groups: %lu\n", total);
- printf("Group bins:\n");
+ HDprintf("Group bins:\n");
total = 0;
if((iter->group_nbins > 0) && (iter->group_bins[0] > 0)) {
- printf("\t# of groups with 0 link: %lu\n", iter->group_bins[0]);
+ HDprintf("\t# of groups with 0 link: %lu\n", iter->group_bins[0]);
total = iter->group_bins[0];
} /* end if */
power = 1;
for(u = 1; u < iter->group_nbins; u++) {
if(iter->group_bins[u] > 0) {
- printf("\t# of groups with %lu - %lu links: %lu\n", power, (power * 10) - 1,
+ HDprintf("\t# of groups with %lu - %lu links: %lu\n", power, (power * 10) - 1,
iter->group_bins[u]);
total += iter->group_bins[u];
} /* end if */
power *= 10;
} /* end for */
- printf("\tTotal # of groups: %lu\n", total);
+ HDprintf("\tTotal # of groups: %lu\n", total);
return 0;
} /* print_group_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_group_metadata
*
@@ -1271,7 +1410,7 @@ print_group_info(const iter_t *iter)
static herr_t
print_group_metadata(const iter_t *iter)
{
- printf("File space information for groups' metadata (in bytes):\n");
+ HDprintf("File space information for groups' metadata (in bytes):\n");
HDfprintf(stdout, "\tObject headers (total/unused): %Hu/%Hu\n",
iter->group_ohdr_info.total_size, iter->group_ohdr_info.free_size);
@@ -1282,7 +1421,7 @@ print_group_metadata(const iter_t *iter)
return 0;
} /* print_group_metadata() */
-
+
/*-------------------------------------------------------------------------
* Function: print_dataset_info
*
@@ -1304,72 +1443,72 @@ print_dataset_info(const iter_t *iter)
unsigned u; /* Local index variable */
if(iter->uniq_dsets > 0) {
- printf("Dataset dimension information:\n");
- printf("\tMax. rank of datasets: %u\n", iter->max_dset_rank);
- printf("\tDataset ranks:\n");
+ HDprintf("Dataset dimension information:\n");
+ HDprintf("\tMax. rank of datasets: %u\n", iter->max_dset_rank);
+ HDprintf("\tDataset ranks:\n");
for(u = 0; u < H5S_MAX_RANK; u++)
if(iter->dset_rank_count[u] > 0)
- printf("\t\t# of dataset with rank %u: %lu\n", u, iter->dset_rank_count[u]);
+ HDprintf("\t\t# of dataset with rank %u: %lu\n", u, iter->dset_rank_count[u]);
- printf("1-D Dataset information:\n");
+ HDprintf("1-D Dataset information:\n");
HDfprintf(stdout, "\tMax. dimension size of 1-D datasets: %Hu\n", iter->max_dset_dims);
- printf("\tSmall 1-D datasets (with dimension sizes 0 to %u):\n", sdsets_threshold - 1);
+ HDprintf("\tSmall 1-D datasets (with dimension sizes 0 to %u):\n", sdsets_threshold - 1);
total = 0;
for(u = 0; u < (unsigned)sdsets_threshold; u++) {
if(iter->small_dset_dims[u] > 0) {
- printf("\t\t# of datasets with dimension sizes %u: %lu\n", u,
+ HDprintf("\t\t# of datasets with dimension sizes %u: %lu\n", u,
iter->small_dset_dims[u]);
total += iter->small_dset_dims[u];
} /* end if */
} /* end for */
- printf("\t\tTotal # of small datasets: %lu\n", total);
+ HDprintf("\t\tTotal # of small datasets: %lu\n", total);
/* Protect against no datasets in file */
if(iter->dset_dim_nbins > 0) {
- printf("\t1-D Dataset dimension bins:\n");
+ HDprintf("\t1-D Dataset dimension bins:\n");
total = 0;
if(iter->dset_dim_bins[0] > 0) {
- printf("\t\t# of datasets with dimension size 0: %lu\n", iter->dset_dim_bins[0]);
+ HDprintf("\t\t# of datasets with dimension size 0: %lu\n", iter->dset_dim_bins[0]);
total = iter->dset_dim_bins[0];
} /* end if */
power = 1;
for(u = 1; u < iter->dset_dim_nbins; u++) {
if(iter->dset_dim_bins[u] > 0) {
- printf("\t\t# of datasets with dimension size %lu - %lu: %lu\n", power, (power * 10) - 1,
+ HDprintf("\t\t# of datasets with dimension size %lu - %lu: %lu\n", power, (power * 10) - 1,
iter->dset_dim_bins[u]);
total += iter->dset_dim_bins[u];
} /* end if */
power *= 10;
} /* end for */
- printf("\t\tTotal # of datasets: %lu\n", total);
+ HDprintf("\t\tTotal # of datasets: %lu\n", total);
} /* end if */
- printf("Dataset storage information:\n");
+ HDprintf("Dataset storage information:\n");
HDfprintf(stdout, "\tTotal raw data size: %Hu\n", iter->dset_storage_size);
HDfprintf(stdout, "\tTotal external raw data size: %Hu\n", iter->dset_external_storage_size);
- printf("Dataset layout information:\n");
+ HDprintf("Dataset layout information:\n");
for(u = 0; u < H5D_NLAYOUTS; u++)
- printf("\tDataset layout counts[%s]: %lu\n", (u == H5D_COMPACT ? "COMPACT" :
+ HDprintf("\tDataset layout counts[%s]: %lu\n", (u == H5D_COMPACT ? "COMPACT" :
(u == H5D_CONTIGUOUS ? "CONTIG" : (u == H5D_CHUNKED ? "CHUNKED" : "VIRTUAL"))), iter->dset_layouts[u]);
- printf("\tNumber of external files : %lu\n", iter->nexternal);
-
- printf("Dataset filters information:\n");
- printf("\tNumber of datasets with:\n");
- printf("\t\tNO filter: %lu\n", iter->dset_comptype[H5Z_FILTER_ERROR+1]);
- printf("\t\tGZIP filter: %lu\n", iter->dset_comptype[H5Z_FILTER_DEFLATE]);
- printf("\t\tSHUFFLE filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SHUFFLE]);
- printf("\t\tFLETCHER32 filter: %lu\n", iter->dset_comptype[H5Z_FILTER_FLETCHER32]);
- printf("\t\tSZIP filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SZIP]);
- printf("\t\tNBIT filter: %lu\n", iter->dset_comptype[H5Z_FILTER_NBIT]);
- printf("\t\tSCALEOFFSET filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SCALEOFFSET]);
- printf("\t\tUSER-DEFINED filter: %lu\n", iter->dset_comptype[H5_NFILTERS_IMPL-1]);
+ HDprintf("\tNumber of external files : %lu\n", iter->nexternal);
+
+ HDprintf("Dataset filters information:\n");
+ HDprintf("\tNumber of datasets with:\n");
+ HDprintf("\t\tNO filter: %lu\n", iter->dset_comptype[H5Z_FILTER_ERROR+1]);
+ HDprintf("\t\tGZIP filter: %lu\n", iter->dset_comptype[H5Z_FILTER_DEFLATE]);
+ HDprintf("\t\tSHUFFLE filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SHUFFLE]);
+ HDprintf("\t\tFLETCHER32 filter: %lu\n", iter->dset_comptype[H5Z_FILTER_FLETCHER32]);
+ HDprintf("\t\tSZIP filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SZIP]);
+ HDprintf("\t\tNBIT filter: %lu\n", iter->dset_comptype[H5Z_FILTER_NBIT]);
+ HDprintf("\t\tSCALEOFFSET filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SCALEOFFSET]);
+ HDprintf("\t\tUSER-DEFINED filter: %lu\n", iter->dset_comptype[H5_NFILTERS_IMPL-1]);
} /* end if */
return 0;
} /* print_dataset_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_dataset_metadata
*
@@ -1386,7 +1525,7 @@ print_dataset_info(const iter_t *iter)
static herr_t
print_dset_metadata(const iter_t *iter)
{
- printf("File space information for datasets' metadata (in bytes):\n");
+ HDprintf("File space information for datasets' metadata (in bytes):\n");
HDfprintf(stdout, "\tObject headers (total/unused): %Hu/%Hu\n",
iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size);
@@ -1398,7 +1537,7 @@ print_dset_metadata(const iter_t *iter)
return 0;
} /* print_dset_metadata() */
-
+
/*-------------------------------------------------------------------------
* Function: print_dset_dtype_meta
*
@@ -1420,26 +1559,26 @@ print_dset_dtype_meta(const iter_t *iter)
unsigned u; /* Local index variable */
if(iter->dset_ntypes) {
- printf("Dataset datatype information:\n");
- printf("\t# of unique datatypes used by datasets: %lu\n", iter->dset_ntypes);
+ HDprintf("Dataset datatype information:\n");
+ HDprintf("\t# of unique datatypes used by datasets: %lu\n", iter->dset_ntypes);
total = 0;
for(u = 0; u < iter->dset_ntypes; u++) {
H5Tencode(iter->dset_type_info[u].tid, NULL, &dtype_size);
- printf("\tDataset datatype #%u:\n", u);
- printf("\t\tCount (total/named) = (%lu/%lu)\n",
+ HDprintf("\tDataset datatype #%u:\n", u);
+ HDprintf("\t\tCount (total/named) = (%lu/%lu)\n",
iter->dset_type_info[u].count, iter->dset_type_info[u].named);
- printf("\t\tSize (desc./elmt) = (%lu/%lu)\n", (unsigned long)dtype_size,
+ HDprintf("\t\tSize (desc./elmt) = (%lu/%lu)\n", (unsigned long)dtype_size,
(unsigned long)H5Tget_size(iter->dset_type_info[u].tid));
H5Tclose(iter->dset_type_info[u].tid);
total += iter->dset_type_info[u].count;
} /* end for */
- printf("\tTotal dataset datatype count: %lu\n", total);
+ HDprintf("\tTotal dataset datatype count: %lu\n", total);
} /* end if */
return 0;
} /* print_dset_dtype_meta() */
-
+
/*-------------------------------------------------------------------------
* Function: print_attr_info
*
@@ -1461,34 +1600,34 @@ print_attr_info(const iter_t *iter)
unsigned long total; /* Total count for various statistics */
unsigned u; /* Local index variable */
- printf("Small # of attributes (objects with 1 to %u attributes):\n", sattrs_threshold);
+ HDprintf("Small # of attributes (objects with 1 to %u attributes):\n", sattrs_threshold);
total = 0;
for(u = 1; u <= (unsigned)sattrs_threshold; u++) {
if(iter->num_small_attrs[u] > 0) {
- printf("\t# of objects with %u attributes: %lu\n", u, iter->num_small_attrs[u]);
+ HDprintf("\t# of objects with %u attributes: %lu\n", u, iter->num_small_attrs[u]);
total += iter->num_small_attrs[u];
} /* end if */
} /* end for */
- printf("\tTotal # of objects with small # of attributes: %lu\n", total);
+ HDprintf("\tTotal # of objects with small # of attributes: %lu\n", total);
- printf("Attribute bins:\n");
+ HDprintf("Attribute bins:\n");
total = 0;
power = 1;
for(u = 1; u < iter->attr_nbins; u++) {
if(iter->attr_bins[u] > 0) {
- printf("\t# of objects with %lu - %lu attributes: %lu\n", power, (power * 10) - 1,
+ HDprintf("\t# of objects with %lu - %lu attributes: %lu\n", power, (power * 10) - 1,
iter->attr_bins[u]);
total += iter->attr_bins[u];
} /* end if */
power *= 10;
} /* end for */
- printf("\tTotal # of objects with attributes: %lu\n", total);
- printf("\tMax. # of attributes to objects: %lu\n", (unsigned long)iter->max_attrs);
+ HDprintf("\tTotal # of objects with attributes: %lu\n", total);
+ HDprintf("\tMax. # of attributes to objects: %lu\n", (unsigned long)iter->max_attrs);
return 0;
} /* print_attr_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_freespace_info
*
@@ -1511,34 +1650,34 @@ print_freespace_info(const iter_t *iter)
HDfprintf(stdout, "Free-space persist: %s\n", iter->fs_persist ? "TRUE" : "FALSE");
HDfprintf(stdout, "Free-space section threshold: %Hu bytes\n", iter->fs_threshold);
- printf("Small size free-space sections (< %u bytes):\n", (unsigned)SIZE_SMALL_SECTS);
+ HDprintf("Small size free-space sections (< %u bytes):\n", (unsigned)SIZE_SMALL_SECTS);
total = 0;
for(u = 0; u < SIZE_SMALL_SECTS; u++) {
if(iter->num_small_sects[u] > 0) {
- printf("\t# of sections of size %u: %lu\n", u, iter->num_small_sects[u]);
+ HDprintf("\t# of sections of size %u: %lu\n", u, iter->num_small_sects[u]);
total += iter->num_small_sects[u];
} /* end if */
} /* end for */
- printf("\tTotal # of small size sections: %lu\n", total);
+ HDprintf("\tTotal # of small size sections: %lu\n", total);
- printf("Free-space section bins:\n");
+ HDprintf("Free-space section bins:\n");
total = 0;
power = 1;
for(u = 1; u < iter->sect_nbins; u++) {
if(iter->sect_bins[u] > 0) {
- printf("\t# of sections of size %lu - %lu: %lu\n", power, (power * 10) - 1,
+ HDprintf("\t# of sections of size %lu - %lu: %lu\n", power, (power * 10) - 1,
iter->sect_bins[u]);
total += iter->sect_bins[u];
} /* end if */
power *= 10;
} /* end for */
- printf("\tTotal # of sections: %lu\n", total);
+ HDprintf("\tTotal # of sections: %lu\n", total);
return 0;
} /* print_freespace_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_storage_summary
*
@@ -1561,7 +1700,7 @@ print_storage_summary(const iter_t *iter)
HDfprintf(stdout, "File space management strategy: %s\n", FS_STRATEGY_NAME[iter->fs_strategy]);
HDfprintf(stdout, "File space page size: %Hu bytes\n", iter->fsp_size);
- printf("Summary of file space information:\n");
+ HDprintf("Summary of file space information:\n");
total_meta =
iter->super_size + iter->super_ext_size + iter->ublk_size +
iter->group_ohdr_info.total_size +
@@ -1602,7 +1741,7 @@ print_storage_summary(const iter_t *iter)
return 0;
} /* print_storage_summary() */
-
+
/*-------------------------------------------------------------------------
* Function: print_file_statistics
*
@@ -1649,7 +1788,7 @@ print_file_statistics(const iter_t *iter)
if(display_summary) print_storage_summary(iter);
} /* print_file_statistics() */
-
+
/*-------------------------------------------------------------------------
* Function: print_object_statistics
*
@@ -1669,10 +1808,10 @@ print_file_statistics(const iter_t *iter)
static void
print_object_statistics(const char *name)
{
- printf("Object name %s\n", name);
+ HDprintf("Object name %s\n", name);
} /* print_object_statistics() */
-
+
/*-------------------------------------------------------------------------
* Function: print_statistics
*
@@ -1698,7 +1837,7 @@ print_statistics(const char *name, const iter_t *iter)
print_file_statistics(iter);
} /* print_statistics() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -1719,6 +1858,7 @@ main(int argc, const char *argv[])
void *edata;
void *tools_edata;
struct handler_t *hand = NULL;
+ hid_t fapl_id = H5P_DEFAULT;
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
@@ -1739,6 +1879,42 @@ main(int argc, const char *argv[])
if(parse_command_line(argc, argv, &hand) < 0)
goto done;
+ /* if drivername is not null, probably need to set the fapl */
+ if (HDstrcmp(drivername, "")) {
+ void *conf_fa = NULL;
+
+ if (!HDstrcmp(drivername, "ros3")) {
+#ifndef H5_HAVE_ROS3_VFD
+ error_msg("Read-Only S3 VFD not enabled.\n\n");
+ goto done;
+#else
+ conf_fa = (void *)&ros3_fa;
+#endif /* H5_HAVE_ROS3_VFD */
+
+ }
+ else if (!HDstrcmp(drivername, "hdfs")) {
+#ifndef H5_HAVE_LIBHDFS
+ error_msg("HDFS VFD not enabled.\n\n");
+ goto done;
+#else
+ conf_fa = (void *)&hdfs_fa;
+#endif /* H5_HAVE_LIBHDFS */
+ }
+
+ if (conf_fa != NULL) {
+ HDassert(fapl_id == H5P_DEFAULT);
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (fapl_id < 0) {
+ error_msg("Unable to create fapl entry\n");
+ goto done;
+ }
+ if (1 > h5tools_set_configured_fapl(fapl_id, drivername, conf_fa)) {
+ error_msg("Unable to set fapl\n");
+ goto done;
+ }
+ }
+ } /* drivername set */
+
fname = argv[opt_ind];
if(enable_error_stack > 0) {
@@ -1751,9 +1927,9 @@ main(int argc, const char *argv[])
hid_t fcpl;
H5F_info2_t finfo;
- printf("Filename: %s\n", fname);
+ HDprintf("Filename: %s\n", fname);
- fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT);
+ fid = H5Fopen(fname, H5F_ACC_RDONLY, fapl_id);
if(fid < 0) {
error_msg("unable to open file \"%s\"\n", fname);
h5tools_setstatus(EXIT_FAILURE);
@@ -1786,7 +1962,7 @@ main(int argc, const char *argv[])
if(iter.num_small_groups == NULL || iter.num_small_attrs == NULL || iter.small_dset_dims == NULL) {
error_msg("Unable to allocate memory for tracking small groups/datasets/attributes\n");
- h5tools_setstatus(EXIT_FAILURE);
+ h5tools_setstatus(EXIT_FAILURE);
goto done;
}
@@ -1815,7 +1991,8 @@ main(int argc, const char *argv[])
if(h5trav_visit(fid, hand->obj[u], TRUE, TRUE, obj_stats, lnk_stats, &iter, H5O_INFO_ALL) < 0) {
error_msg("unable to traverse object \"%s\"\n", hand->obj[u]);
h5tools_setstatus(EXIT_FAILURE);
- } else
+ }
+ else
print_statistics(hand->obj[u], &iter);
} /* end for */
} /* end if */
@@ -1823,7 +2000,8 @@ main(int argc, const char *argv[])
if(h5trav_visit(fid, "/", TRUE, TRUE, obj_stats, lnk_stats, &iter, H5O_INFO_ALL) < 0) {
error_msg("unable to traverse objects/links in file \"%s\"\n", fname);
h5tools_setstatus(EXIT_FAILURE);
- } else
+ }
+ else
print_statistics("/", &iter);
} /* end else */
} /* end if */
@@ -1834,6 +2012,13 @@ done:
/* Free iter structure */
iter_free(&iter);
+ if (fapl_id != H5P_DEFAULT) {
+ if (H5Pclose(fapl_id) < 0) {
+ error_msg("unable to close fapl entry\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
+ }
+
if(fid >= 0 && H5Fclose(fid) < 0) {
error_msg("unable to close file \"%s\"\n", fname);
h5tools_setstatus(EXIT_FAILURE);
diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt
index 937799f..6b41d7f 100644
--- a/tools/src/misc/CMakeLists.txt
+++ b/tools/src/misc/CMakeLists.txt
@@ -5,47 +5,78 @@ project (HDF5_TOOLS_SRC_MISC C)
# Add the misc executables
# --------------------------------------------------------------------
#-- Misc Executables
-add_executable (h5debug ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5debug.c)
-target_include_directories(h5debug PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5debug STATIC)
-target_link_libraries (h5debug PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
-set_target_properties (h5debug PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5debug")
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h5debug ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5debug.c)
+ target_include_directories (h5debug PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5debug STATIC)
+ target_link_libraries (h5debug PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5debug PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5debug")
-add_executable (h5repart ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5repart.c)
-target_include_directories(h5repart PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5repart STATIC)
-target_link_libraries (h5repart PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
-set_target_properties (h5repart PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repart")
+ add_executable (h5repart ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5repart.c)
+ target_include_directories (h5repart PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5repart STATIC)
+ target_link_libraries (h5repart PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5repart PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repart")
-add_executable (h5mkgrp ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5mkgrp.c)
-target_include_directories(h5mkgrp PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5mkgrp STATIC)
-target_link_libraries (h5mkgrp PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_target_properties (h5mkgrp PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5mkgrp")
+ add_executable (h5mkgrp ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5mkgrp.c)
+ target_include_directories (h5mkgrp PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5mkgrp STATIC)
+ target_link_libraries (h5mkgrp PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5mkgrp PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5mkgrp")
-add_executable (h5clear ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5clear.c)
-target_include_directories(h5clear PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5clear STATIC)
-target_link_libraries (h5clear PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_target_properties (h5clear PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5clear")
+ add_executable (h5clear ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5clear.c)
+ target_include_directories (h5clear PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5clear STATIC)
+ target_link_libraries (h5clear PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5clear PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5clear")
-set (H5_DEP_EXECUTABLES
- h5debug
- h5repart
- h5mkgrp
- h5clear
-)
+ set (H5_DEP_EXECUTABLES
+ h5debug
+ h5repart
+ h5mkgrp
+ h5clear
+ )
+endif ()
+if (BUILD_SHARED_LIBS)
+ add_executable (h5debug-shared ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5debug.c)
+ target_include_directories (h5debug-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5debug-shared SHARED)
+ target_link_libraries (h5debug-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ set_target_properties (h5debug-shared PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5debug-shared")
-#-----------------------------------------------------------------------------
-# Generate the h5cc file containing settings needed to compile programs
-#-----------------------------------------------------------------------------
-#if (NOT WIN32)
-# configure_file (${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY)
-#endif ()
+ add_executable (h5repart-shared ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5repart.c)
+ target_include_directories (h5repart-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5repart-shared SHARED)
+ target_link_libraries (h5repart-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ set_target_properties (h5repart-shared PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repart-shared")
+
+ add_executable (h5mkgrp-shared ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5mkgrp.c)
+ target_include_directories (h5mkgrp-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5mkgrp-shared SHARED)
+ target_link_libraries (h5mkgrp-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ set_target_properties (h5mkgrp-shared PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5mkgrp-shared")
+
+ add_executable (h5clear-shared ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5clear.c)
+ target_include_directories (h5clear-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5clear-shared SHARED)
+ target_link_libraries (h5clear-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ set_target_properties (h5clear-shared PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5clear-shared")
+
+ set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES}
+ h5debug-shared
+ h5repart-shared
+ h5mkgrp-shared
+ h5clear-shared
+ )
+endif ()
##############################################################################
##############################################################################
diff --git a/tools/src/misc/Makefile.am b/tools/src/misc/Makefile.am
index 64c5ee5..f1d2aaf 100644
--- a/tools/src/misc/Makefile.am
+++ b/tools/src/misc/Makefile.am
@@ -23,7 +23,6 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib
# These are our main targets, the tools
bin_PROGRAMS=h5debug h5repart h5mkgrp h5clear
-bin_SCRIPTS=h5redeploy
# Add h5debug, h5repart, and h5mkgrp specific linker flags here
h5debug_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
@@ -31,30 +30,7 @@ h5repart_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
h5mkgrp_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
h5clear_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
-# Tell automake to clean h5redeploy script
-CLEANFILES=h5redeploy
-
-# These were generated by configure. Remove them only when distclean.
-DISTCLEANFILES=h5cc
-
# All programs rely on hdf5 library and h5tools library
LDADD=$(LIBH5TOOLS) $(LIBHDF5)
-# h5cc needs custom install and uninstall rules, since it may be
-# named h5pcc if hdf5 is being built in parallel mode.
-if BUILD_PARALLEL_CONDITIONAL
- H5CC_NAME=h5pcc
-else
- H5CC_NAME=h5cc
-endif
-
-install-exec-local:
- @$(INSTALL) h5cc $(DESTDIR)$(bindir)/$(H5CC_NAME)
-uninstall-local:
- @$(RM) $(DESTDIR)$(bindir)/$(H5CC_NAME)
-
-# How to build h5redeploy script
-h5redeploy: h5redeploy.in
- @cp $(srcdir)/$@.in $@
-
include $(top_srcdir)/config/conclude.am
diff --git a/tools/src/misc/Makefile.in b/tools/src/misc/Makefile.in
index 2aafd74..e240c12 100644
--- a/tools/src/misc/Makefile.in
+++ b/tools/src/misc/Makefile.in
@@ -29,7 +29,6 @@
# HDF5 Library Makefile(.in)
#
-
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
@@ -133,9 +132,9 @@ DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/H5config.h \
$(top_builddir)/fortran/src/H5config_f.inc
-CONFIG_CLEAN_FILES = h5cc
+CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
+am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
h5clear_SOURCES = h5clear.c
h5clear_OBJECTS = h5clear.$(OBJEXT)
@@ -169,34 +168,6 @@ h5repart_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5)
h5repart_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(h5repart_LDFLAGS) $(LDFLAGS) -o $@
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-SCRIPTS = $(bin_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -279,6 +250,33 @@ am__tty_colors = { \
std=''; \
fi; \
}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
am__recheck_rx = ^[ ]*:recheck:[ ]*
am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
@@ -430,9 +428,8 @@ am__set_b = \
*) \
b='$*';; \
esac
-am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/h5cc.in \
- $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/test-driver \
- $(top_srcdir)/config/commence.am \
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/bin/depcomp \
+ $(top_srcdir)/bin/test-driver $(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
@@ -509,7 +506,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -532,9 +528,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -561,6 +560,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -615,6 +615,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -639,7 +640,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -756,7 +756,6 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-bin_SCRIPTS = h5redeploy
# Add h5debug, h5repart, and h5mkgrp specific linker flags here
h5debug_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
@@ -764,19 +763,8 @@ h5repart_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
h5mkgrp_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
h5clear_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
-# Tell automake to clean h5redeploy script
-CLEANFILES = h5redeploy
-
-# These were generated by configure. Remove them only when distclean.
-DISTCLEANFILES = h5cc
-
# All programs rely on hdf5 library and h5tools library
LDADD = $(LIBH5TOOLS) $(LIBHDF5)
-@BUILD_PARALLEL_CONDITIONAL_FALSE@H5CC_NAME = h5cc
-
-# h5cc needs custom install and uninstall rules, since it may be
-# named h5pcc if hdf5 is being built in parallel mode.
-@BUILD_PARALLEL_CONDITIONAL_TRUE@H5CC_NAME = h5pcc
# Automake needs to be taught how to build lib, progs and tests targets.
# These will be filled in automatically for the most part (e.g.,
@@ -832,8 +820,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
-h5cc: $(top_builddir)/config.status $(srcdir)/h5cc.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
@@ -899,41 +885,6 @@ h5mkgrp$(EXEEXT): $(h5mkgrp_OBJECTS) $(h5mkgrp_DEPENDENCIES) $(EXTRA_h5mkgrp_DEP
h5repart$(EXEEXT): $(h5repart_OBJECTS) $(h5repart_DEPENDENCIES) $(EXTRA_h5repart_DEPENDENCIES)
@rm -f h5repart$(EXEEXT)
$(AM_V_CCLD)$(h5repart_LINK) $(h5repart_OBJECTS) $(h5repart_LDADD) $(LIBS)
-install-binSCRIPTS: $(bin_SCRIPTS)
- @$(NORMAL_INSTALL)
- @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n' \
- -e 'h;s|.*|.|' \
- -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) { files[d] = files[d] " " $$1; \
- if (++n[d] == $(am__install_max)) { \
- print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
- else { print "f", d "/" $$4, $$1 } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-binSCRIPTS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 's,.*/,,;$(transform)'`; \
- dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -1206,9 +1157,9 @@ distdir: $(DISTFILES)
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
-all-am: Makefile $(PROGRAMS) $(SCRIPTS) all-local
+all-am: Makefile $(PROGRAMS) all-local
installdirs:
- for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \
+ for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -1236,12 +1187,10 @@ mostlyclean-generic:
-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
- -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -1274,8 +1223,7 @@ install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am: install-binPROGRAMS install-binSCRIPTS \
- install-exec-local
+install-exec-am: install-binPROGRAMS
install-html: install-html-am
@@ -1315,8 +1263,7 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
- uninstall-local
+uninstall-am: uninstall-binPROGRAMS
.MAKE: check-am install-am install-strip
@@ -1325,17 +1272,15 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
cscopelist-am ctags ctags-am distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
- install-binPROGRAMS install-binSCRIPTS install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-exec-local install-html \
+ install-binPROGRAMS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
mostlyclean-local pdf pdf-am ps ps-am recheck tags tags-am \
- uninstall uninstall-am uninstall-binPROGRAMS \
- uninstall-binSCRIPTS uninstall-local
+ uninstall uninstall-am uninstall-binPROGRAMS
.PRECIOUS: Makefile
@@ -1351,15 +1296,6 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
help:
@$(top_srcdir)/bin/makehelp
-install-exec-local:
- @$(INSTALL) h5cc $(DESTDIR)$(bindir)/$(H5CC_NAME)
-uninstall-local:
- @$(RM) $(DESTDIR)$(bindir)/$(H5CC_NAME)
-
-# How to build h5redeploy script
-h5redeploy: h5redeploy.in
- @cp $(srcdir)/$@.in $@
-
# lib/progs/tests targets recurse into subdirectories. build-* targets
# build files in this directory.
build-lib: $(LIB)
@@ -1395,7 +1331,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c
index 088e6e9..b28457e 100644
--- a/tools/src/misc/h5debug.c
+++ b/tools/src/misc/h5debug.c
@@ -21,19 +21,19 @@
*
*-------------------------------------------------------------------------
*/
-#define H5A_FRIEND /*suppress error about including H5Apkg */
-#define H5B2_FRIEND /*suppress error about including H5B2pkg */
-#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
-#define H5EA_FRIEND /*suppress error about including H5EApkg */
-#define H5EA_TESTING /*suppress warning about H5EA testing funcs*/
-#define H5FA_FRIEND /*suppress error about including H5FApkg */
-#define H5FA_TESTING /*suppress warning about H5FA testing funcs*/
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
-#define H5G_FRIEND /*suppress error about including H5Gpkg */
-#define H5HF_FRIEND /*suppress error about including H5HFpkg */
-#define H5O_FRIEND /*suppress error about including H5Opkg */
-#define H5SM_FRIEND /*suppress error about including H5SMpkg */
+#define H5A_FRIEND /*suppress error about including H5Apkg */
+#define H5B2_FRIEND /*suppress error about including H5B2pkg */
+#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#define H5EA_FRIEND /*suppress error about including H5EApkg */
+#define H5EA_TESTING /*suppress warning about H5EA testing funcs*/
+#define H5FA_FRIEND /*suppress error about including H5FApkg */
+#define H5FA_TESTING /*suppress warning about H5FA testing funcs*/
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5G_FRIEND /*suppress error about including H5Gpkg */
+#define H5HF_FRIEND /*suppress error about including H5HFpkg */
+#define H5O_FRIEND /*suppress error about including H5Opkg */
+#define H5SM_FRIEND /*suppress error about including H5SMpkg */
#include "H5private.h" /* Generic Functions */
#include "H5Apkg.h" /* Attributes */
@@ -57,7 +57,7 @@
#define VCOL 50
-
+
/*-------------------------------------------------------------------------
* Function: get_H5B2_class
*
@@ -80,68 +80,68 @@ get_H5B2_class(const uint8_t *sig)
const H5B2_class_t *cls;
switch(subtype) {
- case H5B2_TEST_ID:
- cls = H5B2_TEST;
- break;
+ case H5B2_TEST_ID:
+ cls = H5B2_TEST;
+ break;
- case H5B2_FHEAP_HUGE_INDIR_ID:
- cls = H5HF_HUGE_BT2_INDIR;
- break;
+ case H5B2_FHEAP_HUGE_INDIR_ID:
+ cls = H5HF_HUGE_BT2_INDIR;
+ break;
- case H5B2_FHEAP_HUGE_FILT_INDIR_ID:
- cls = H5HF_HUGE_BT2_FILT_INDIR;
- break;
+ case H5B2_FHEAP_HUGE_FILT_INDIR_ID:
+ cls = H5HF_HUGE_BT2_FILT_INDIR;
+ break;
- case H5B2_FHEAP_HUGE_DIR_ID:
- cls = H5HF_HUGE_BT2_DIR;
- break;
+ case H5B2_FHEAP_HUGE_DIR_ID:
+ cls = H5HF_HUGE_BT2_DIR;
+ break;
- case H5B2_FHEAP_HUGE_FILT_DIR_ID:
- cls = H5HF_HUGE_BT2_FILT_DIR;
- break;
+ case H5B2_FHEAP_HUGE_FILT_DIR_ID:
+ cls = H5HF_HUGE_BT2_FILT_DIR;
+ break;
- case H5B2_GRP_DENSE_NAME_ID:
- cls = H5G_BT2_NAME;
- break;
+ case H5B2_GRP_DENSE_NAME_ID:
+ cls = H5G_BT2_NAME;
+ break;
- case H5B2_GRP_DENSE_CORDER_ID:
- cls = H5G_BT2_CORDER;
- break;
+ case H5B2_GRP_DENSE_CORDER_ID:
+ cls = H5G_BT2_CORDER;
+ break;
- case H5B2_SOHM_INDEX_ID:
- cls = H5SM_INDEX;
- break;
+ case H5B2_SOHM_INDEX_ID:
+ cls = H5SM_INDEX;
+ break;
- case H5B2_ATTR_DENSE_NAME_ID:
- cls = H5A_BT2_NAME;
- break;
+ case H5B2_ATTR_DENSE_NAME_ID:
+ cls = H5A_BT2_NAME;
+ break;
- case H5B2_ATTR_DENSE_CORDER_ID:
- cls = H5A_BT2_CORDER;
- break;
+ case H5B2_ATTR_DENSE_CORDER_ID:
+ cls = H5A_BT2_CORDER;
+ break;
- case H5B2_CDSET_ID:
- cls = H5D_BT2;
- break;
+ case H5B2_CDSET_ID:
+ cls = H5D_BT2;
+ break;
- case H5B2_CDSET_FILT_ID:
- cls = H5D_BT2_FILT;
- break;
+ case H5B2_CDSET_FILT_ID:
+ cls = H5D_BT2_FILT;
+ break;
- case H5B2_TEST2_ID:
- cls = H5B2_TEST2;
- break;
+ case H5B2_TEST2_ID:
+ cls = H5B2_TEST2;
+ break;
- case H5B2_NUM_BTREE_ID:
- default:
- HDfprintf(stderr, "Unknown v2 B-tree subtype %u\n", (unsigned)(subtype));
- HDexit(4);
+ case H5B2_NUM_BTREE_ID:
+ default:
+ HDfprintf(stderr, "Unknown v2 B-tree subtype %u\n", (unsigned)(subtype));
+ HDexit(4);
} /* end switch */
return(cls);
} /* end get_H5B2_class() */
-
+
/*-------------------------------------------------------------------------
* Function: get_H5EA_class
*
@@ -164,28 +164,28 @@ get_H5EA_class(const uint8_t *sig)
const H5EA_class_t *cls;
switch(clsid) {
- case H5EA_CLS_TEST_ID:
- cls = H5EA_CLS_TEST;
- break;
+ case H5EA_CLS_TEST_ID:
+ cls = H5EA_CLS_TEST;
+ break;
- case H5EA_CLS_CHUNK_ID:
- cls = H5EA_CLS_CHUNK;
- break;
+ case H5EA_CLS_CHUNK_ID:
+ cls = H5EA_CLS_CHUNK;
+ break;
- case H5EA_CLS_FILT_CHUNK_ID:
- cls = H5EA_CLS_FILT_CHUNK;
- break;
+ case H5EA_CLS_FILT_CHUNK_ID:
+ cls = H5EA_CLS_FILT_CHUNK;
+ break;
- case H5EA_NUM_CLS_ID:
- default:
- HDfprintf(stderr, "Unknown extensible array class %u\n", (unsigned)(clsid));
- HDexit(4);
+ case H5EA_NUM_CLS_ID:
+ default:
+ HDfprintf(stderr, "Unknown extensible array class %u\n", (unsigned)(clsid));
+ HDexit(4);
} /* end switch */
return(cls);
} /* end get_H5EA_class() */
-
+
/*-------------------------------------------------------------------------
* Function: get_H5FA_class
*
@@ -208,28 +208,28 @@ get_H5FA_class(const uint8_t *sig)
const H5FA_class_t *cls;
switch(clsid) {
- case H5FA_CLS_TEST_ID:
- cls = H5FA_CLS_TEST;
- break;
+ case H5FA_CLS_TEST_ID:
+ cls = H5FA_CLS_TEST;
+ break;
- case H5FA_CLS_CHUNK_ID:
- cls = H5FA_CLS_CHUNK;
- break;
+ case H5FA_CLS_CHUNK_ID:
+ cls = H5FA_CLS_CHUNK;
+ break;
- case H5FA_CLS_FILT_CHUNK_ID:
- cls = H5FA_CLS_FILT_CHUNK;
- break;
+ case H5FA_CLS_FILT_CHUNK_ID:
+ cls = H5FA_CLS_FILT_CHUNK;
+ break;
- case H5FA_NUM_CLS_ID:
- default:
- HDfprintf(stderr, "Unknown fixed array class %u\n", (unsigned)(clsid));
- HDexit(4);
+ case H5FA_NUM_CLS_ID:
+ default:
+ HDfprintf(stderr, "Unknown fixed array class %u\n", (unsigned)(clsid));
+ HDexit(4);
} /* end switch */
return(cls);
} /* end get_H5FA_class() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -254,13 +254,13 @@ main(int argc, char *argv[])
uint8_t sig[H5F_SIGNATURE_LEN];
size_t u;
H5E_auto2_t func;
- void *edata;
+ void *edata;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
herr_t status = SUCCEED;
if(argc == 1) {
- HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]);
- HDexit(1);
+ HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]);
+ HDexit(1);
} /* end if */
/* Initialize the library */
@@ -282,7 +282,7 @@ main(int argc, char *argv[])
} /* end if */
if(HDstrchr(argv[1], '%'))
if(H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT) < 0) {
- fprintf(stderr, "cannot set file access property list\n");
+ HDfprintf(stderr, "cannot set file access property list\n");
HDexit(1);
}
if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) {
@@ -342,13 +342,15 @@ main(int argc, char *argv[])
*/
status = H5HL_debug(f, addr, stdout, 0, VCOL);
- } else if(!HDmemcmp (sig, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
- /*
- * Debug a global heap collection.
- */
- status = H5HG_debug(f, addr, stdout, 0, VCOL);
+ }
+ else if(!HDmemcmp (sig, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ /*
+ * Debug a global heap collection.
+ */
+ status = H5HG_debug(f, addr, stdout, 0, VCOL);
- } else if(!HDmemcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug a symbol table node.
*/
@@ -362,7 +364,8 @@ main(int argc, char *argv[])
status = H5G_node_debug(f, addr, stdout, 0, VCOL, extra);
- } else if(!HDmemcmp(sig, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug a B-tree. B-trees are debugged through the B-tree
* subclass. The subclass identifier is the byte immediately
@@ -373,79 +376,81 @@ main(int argc, char *argv[])
uint32_t dim[H5O_LAYOUT_NDIMS];
switch(subtype) {
- case H5B_SNODE_ID:
- /* Check for extra parameters */
- if(extra == 0) {
- HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n");
- HDfprintf(stderr, "B-tree symbol table node usage:\n");
- HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <address of local heap>\n\n");
- HDexit(4);
- } /* end if */
+ case H5B_SNODE_ID:
+ /* Check for extra parameters */
+ if(extra == 0) {
+ HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n");
+ HDfprintf(stderr, "B-tree symbol table node usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <address of local heap>\n\n");
+ HDexit(4);
+ } /* end if */
- status = H5G_node_debug(f, addr, stdout, 0, VCOL, extra);
- break;
+ status = H5G_node_debug(f, addr, stdout, 0, VCOL, extra);
+ break;
- case H5B_CHUNK_ID:
- /* Check for extra parameters */
- if(extra == 0) {
- HDfprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n");
+ case H5B_CHUNK_ID:
+ /* Check for extra parameters */
+ if(extra == 0) {
+ HDfprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n");
+ HDfprintf(stderr, "B-tree chunked storage node usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions> <slowest chunk dim>...<fastest chunk dim>\n");
+ HDexit(4);
+ } /* end if */
+
+ /* Build array of chunk dimensions */
+ ndims = (unsigned)extra;
+ dim[0] = (uint32_t)extra2;
+ if(ndims > 1)
+ dim[1] = (uint32_t)extra3;
+ if(ndims > 2)
+ dim[2] = (uint32_t)extra4;
+
+ /* Check for dimension error */
+ if(ndims > 3) {
+ HDfprintf(stderr, "ERROR: Only 3 dimensions support currently (fix h5debug)\n");
+ HDfprintf(stderr, "B-tree chunked storage node usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions> <slowest chunk dim>...<fastest chunk dim>\n");
+ HDexit(4);
+ } /* end for */
+ for(u = 0; u < ndims; u++)
+ if(0 == dim[u]) {
+ HDfprintf(stderr, "ERROR: Chunk dimensions should be >0\n");
HDfprintf(stderr, "B-tree chunked storage node usage:\n");
HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions> <slowest chunk dim>...<fastest chunk dim>\n");
HDexit(4);
} /* end if */
- /* Build array of chunk dimensions */
- ndims = (unsigned)extra;
- dim[0] = (uint32_t)extra2;
- if(ndims > 1)
- dim[1] = (uint32_t)extra3;
- if(ndims > 2)
- dim[2] = (uint32_t)extra4;
-
- /* Check for dimension error */
- if(ndims > 3) {
- HDfprintf(stderr, "ERROR: Only 3 dimensions support currently (fix h5debug)\n");
- HDfprintf(stderr, "B-tree chunked storage node usage:\n");
- HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions> <slowest chunk dim>...<fastest chunk dim>\n");
- HDexit(4);
- } /* end for */
- for(u = 0; u < ndims; u++)
- if(0 == dim[u]) {
- HDfprintf(stderr, "ERROR: Chunk dimensions should be >0\n");
- HDfprintf(stderr, "B-tree chunked storage node usage:\n");
- HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions> <slowest chunk dim>...<fastest chunk dim>\n");
- HDexit(4);
- } /* end if */
-
- /* Set the last dimension (the element size) to zero */
- dim[ndims] = 0;
-
- status = H5D_btree_debug(f, addr, stdout, 0, VCOL, ndims, dim);
- break;
-
- case H5B_NUM_BTREE_ID:
- default:
- HDfprintf(stderr, "Unknown v1 B-tree subtype %u\n", (unsigned)(subtype));
- HDexit(4);
+ /* Set the last dimension (the element size) to zero */
+ dim[ndims] = 0;
+
+ status = H5D_btree_debug(f, addr, stdout, 0, VCOL, ndims, dim);
+ break;
+
+ case H5B_NUM_BTREE_ID:
+ default:
+ HDfprintf(stderr, "Unknown v1 B-tree subtype %u\n", (unsigned)(subtype));
+ HDexit(4);
}
- } else if(!HDmemcmp(sig, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug a v2 B-tree header.
- */
+ */
const H5B2_class_t *cls = get_H5B2_class(sig);
HDassert(cls);
- if((cls == H5D_BT2 || cls == H5D_BT2_FILT) && extra == 0) {
+ if((cls == H5D_BT2 || cls == H5D_BT2_FILT) && extra == 0) {
HDfprintf(stderr, "ERROR: Need v2 B-tree header address and object header address containing the layout message in order to dump header\n");
HDfprintf(stderr, "v2 B-tree hdr usage:\n");
HDfprintf(stderr, "\th5debug <filename> <v2 B-tree header address> <object header address>\n");
HDexit(4);
- } /* end if */
+ } /* end if */
status = H5B2__hdr_debug(f, addr, stdout, 0, VCOL, cls, (haddr_t)extra);
- } else if(!HDmemcmp(sig, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug a v2 B-tree internal node.
*/
@@ -453,16 +458,15 @@ main(int argc, char *argv[])
HDassert(cls);
/* Check for enough valid parameters */
- if((cls == H5D_BT2 || cls == H5D_BT2_FILT) &&
- (extra == 0 || extra2 == 0 || extra3 == 0 || extra4 == 0)) {
-
- fprintf(stderr, "ERROR: Need v2 B-tree header address, the node's number of records, depth, and object header address containing the layout message in order to dump internal node\n");
- fprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n");
- fprintf(stderr, "v2 B-tree internal node usage:\n");
- fprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> <number of records> <depth> <object header address>\n");
+ if((cls == H5D_BT2 || cls == H5D_BT2_FILT) && (extra == 0 || extra2 == 0 || extra3 == 0 || extra4 == 0)) {
+ HDfprintf(stderr, "ERROR: Need v2 B-tree header address, the node's number of records, depth, and object header address containing the layout message in order to dump internal node\n");
+ HDfprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n");
+ HDfprintf(stderr, "v2 B-tree internal node usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> <number of records> <depth> <object header address>\n");
HDexit(4);
- } else if(extra == 0 || extra2 == 0 || extra3 == 0) {
+ }
+ else if(extra == 0 || extra2 == 0 || extra3 == 0) {
HDfprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and depth in order to dump internal node\n");
HDfprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n");
HDfprintf(stderr, "v2 B-tree internal node usage:\n");
@@ -472,7 +476,8 @@ main(int argc, char *argv[])
status = H5B2__int_debug(f, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (unsigned)extra3, (haddr_t)extra4);
- } else if(!HDmemcmp(sig, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug a v2 B-tree leaf node.
*/
@@ -480,15 +485,15 @@ main(int argc, char *argv[])
HDassert(cls);
/* Check for enough valid parameters */
- if((cls == H5D_BT2 || cls == H5D_BT2_FILT) &&
- (extra == 0 || extra2 == 0 || extra3 == 0 )) {
+ if((cls == H5D_BT2 || cls == H5D_BT2_FILT) && (extra == 0 || extra2 == 0 || extra3 == 0 )) {
- fprintf(stderr, "ERROR: Need v2 B-tree header address, number of records, and object header address containing the layout message in order to dump leaf node\n");
- fprintf(stderr, "v2 B-tree leaf node usage:\n");
- fprintf(stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number of records> <object header address>\n");
+ HDfprintf(stderr, "ERROR: Need v2 B-tree header address, number of records, and object header address containing the layout message in order to dump leaf node\n");
+ HDfprintf(stderr, "v2 B-tree leaf node usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number of records> <object header address>\n");
HDexit(4);
- } else if(extra == 0 || extra2 == 0) {
+ }
+ else if(extra == 0 || extra2 == 0) {
HDfprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n");
HDfprintf(stderr, "v2 B-tree leaf node usage:\n");
HDfprintf(stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number of records>\n");
@@ -497,13 +502,15 @@ main(int argc, char *argv[])
status = H5B2__leaf_debug(f, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (haddr_t)extra3);
- } else if(!HDmemcmp(sig, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug a fractal heap header.
*/
status = H5HF_hdr_debug(f, addr, stdout, 0, VCOL);
- } else if(!HDmemcmp(sig, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug a fractal heap direct block.
*/
@@ -518,7 +525,8 @@ main(int argc, char *argv[])
status = H5HF_dblock_debug(f, addr, stdout, 0, VCOL, extra, (size_t)extra2);
- } else if(!HDmemcmp(sig, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug a fractal heap indirect block.
*/
@@ -533,14 +541,16 @@ main(int argc, char *argv[])
status = H5HF_iblock_debug(f, addr, stdout, 0, VCOL, extra, (unsigned)extra2);
- } else if(!HDmemcmp(sig, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug a free space header.
*/
status = H5FS_debug(f, addr, stdout, 0, VCOL);
- } else if(!HDmemcmp(sig, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug free space serialized sections.
*/
@@ -555,14 +565,16 @@ main(int argc, char *argv[])
status = H5FS_sects_debug(f, addr, stdout, 0, VCOL, extra, extra2);
- } else if(!HDmemcmp(sig, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug shared message master table.
*/
status = H5SM_table_debug(f, addr, stdout, 0, VCOL, (unsigned) UFAIL, (unsigned) UFAIL);
- } else if(!HDmemcmp(sig, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug shared message list index.
*/
@@ -577,7 +589,8 @@ main(int argc, char *argv[])
status = H5SM_list_debug(f, addr, stdout, 0, VCOL, (haddr_t)extra);
- } else if(!HDmemcmp(sig, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug an extensible aray header.
*/
@@ -594,7 +607,8 @@ main(int argc, char *argv[])
status = H5EA__hdr_debug(f, addr, stdout, 0, VCOL, cls, extra);
- } else if(!HDmemcmp(sig, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug an extensible aray index block.
*/
@@ -611,7 +625,8 @@ main(int argc, char *argv[])
status = H5EA__iblock_debug(f, addr, stdout, 0, VCOL, cls, extra, extra2);
- } else if(!HDmemcmp(sig, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug an extensible aray super block.
*/
@@ -628,7 +643,8 @@ main(int argc, char *argv[])
status = H5EA__sblock_debug(f, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, extra3);
- } else if(!HDmemcmp(sig, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug an extensible aray data block.
*/
@@ -645,7 +661,8 @@ main(int argc, char *argv[])
status = H5EA__dblock_debug(f, addr, stdout, 0, VCOL, cls, extra, (size_t)extra2, extra3);
- } else if(!HDmemcmp(sig, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug a fixed array header.
*/
@@ -662,7 +679,8 @@ main(int argc, char *argv[])
status = H5FA__hdr_debug(f, addr, stdout, 0, VCOL, cls, extra);
- } else if(!HDmemcmp(sig, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug a fixed array data block.
*/
@@ -679,33 +697,37 @@ main(int argc, char *argv[])
status = H5FA__dblock_debug(f, addr, stdout, 0, VCOL, cls, extra, extra2);
- } else if(!HDmemcmp(sig, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
+ }
+ else if(!HDmemcmp(sig, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
* Debug v2 object header (which have signatures).
*/
status = H5O_debug(f, addr, stdout, 0, VCOL);
- } else if(sig[0] == H5O_VERSION_1) {
+ }
+ else if(sig[0] == H5O_VERSION_1) {
/*
* This could be a v1 object header. Since they don't have a signature
* it's a somewhat "ify" detection.
*/
status = H5O_debug(f, addr, stdout, 0, VCOL);
- } else {
+ }
+ else {
/*
* Got some other unrecognized signature.
*/
- printf("%-*s ", VCOL, "Signature:");
+ HDprintf("%-*s ", VCOL, "Signature:");
for (u = 0; u < sizeof(sig); u++) {
if (sig[u] > ' ' && sig[u] <= '~' && '\\' != sig[u])
HDputchar(sig[u]);
else if ('\\' == sig[u]) {
HDputchar('\\');
HDputchar('\\');
- } else
- printf("\\%03o", sig[u]);
+ }
+ else
+ HDprintf("\\%03o", sig[u]);
}
HDputchar('\n');
diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c
index b7ff73c..feb60d4 100644
--- a/tools/src/misc/h5mkgrp.c
+++ b/tools/src/misc/h5mkgrp.c
@@ -251,7 +251,7 @@ main(int argc, const char *argv[])
/* Display some output if requested */
if(params.verbose)
- printf("%s: Creating groups with latest version of the format\n", h5tools_getprogname());
+ HDprintf("%s: Creating groups with latest version of the format\n", h5tools_getprogname());
} /* end if */
/* Attempt to open an existing HDF5 file first */
@@ -284,7 +284,7 @@ main(int argc, const char *argv[])
/* Display some output if requested */
if(params.verbose)
- printf("%s: Creating parent groups\n", h5tools_getprogname());
+ HDprintf("%s: Creating parent groups\n", h5tools_getprogname());
} /* end if */
/* Loop over creating requested groups */
@@ -305,7 +305,7 @@ main(int argc, const char *argv[])
/* Display some output if requested */
if(params.verbose)
- printf("%s: created group '%s'\n", h5tools_getprogname(), params.groups[curr_group]);
+ HDprintf("%s: created group '%s'\n", h5tools_getprogname(), params.groups[curr_group]);
} /* end for */
/* Close link creation property list */
diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c
index 2f4d93e..d516fa0 100644
--- a/tools/src/misc/h5repart.c
+++ b/tools/src/misc/h5repart.c
@@ -15,19 +15,19 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Wednesday, May 13, 1998
*
- * Purpose: Repartitions a file family. This program can be used to
- * split a single file into a family of files, join a family of
- * files into a single file, or copy one family to another while
- * changing the size of the family members. It can also be used
- * to copy a single file to a single file with holes.
+ * Purpose: Repartitions a file family. This program can be used to
+ * split a single file into a family of files, join a family of
+ * files into a single file, or copy one family to another while
+ * changing the size of the family members. It can also be used
+ * to copy a single file to a single file with holes.
*/
/* See H5private.h for how to include system headers */
#include "hdf5.h"
#include "H5private.h"
-#define NAMELEN 4096
-#define GB *1024*1024*1024
+#define NAMELEN 4096
+#define GB *1024*1024*1024
/* Make these 2 private properties(defined in H5Fprivate.h) available to h5repart.
* The first one updates the member file size in the superblock. The second one
@@ -36,15 +36,15 @@
#define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize"
#define H5F_ACS_FAMILY_TO_SINGLE_NAME "family_to_single"
-
+
/*-------------------------------------------------------------------------
- * Function: usage
+ * Function: usage
*
- * Purpose: Prints a usage message.
+ * Purpose: Prints a usage message.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, May 13, 1998
*
* Modifications:
@@ -54,98 +54,99 @@
static void
usage (const char *progname)
{
- fprintf(stderr, "usage: %s [-v] [-V] [-[b|m] N[g|m|k]] [-family_to_sec2|-family_to_single] SRC DST\n",
- progname);
- fprintf(stderr, " -v Produce verbose output\n");
- fprintf(stderr, " -V Print a version number and exit\n");
- fprintf(stderr, " -b N The I/O block size, defaults to 1kB\n");
- fprintf(stderr, " -m N The destination member size or 1GB\n");
- fprintf(stderr, " -family_to_sec2 Deprecated version of -family_to_single (below)\n");
- fprintf(stderr, " -family_to_single Change file driver from family to the default single-file VFD (windows or sec2)\n");
- fprintf(stderr, " SRC The name of the source file\n");
- fprintf(stderr, " DST The name of the destination files\n");
- fprintf(stderr, "Sizes may be suffixed with `g' for GB, `m' for MB or "
- "`k' for kB.\n");
- fprintf(stderr, "File family names include an integer printf "
- "format such as `%%d'\n");
- exit (EXIT_FAILURE);
+ HDfprintf(stderr, "usage: %s [-v] [-V] [-[b|m] N[g|m|k]] [-family_to_sec2|-family_to_single] SRC DST\n",
+ progname);
+ HDfprintf(stderr, " -v Produce verbose output\n");
+ HDfprintf(stderr, " -V Print a version number and exit\n");
+ HDfprintf(stderr, " -b N The I/O block size, defaults to 1kB\n");
+ HDfprintf(stderr, " -m N The destination member size or 1GB\n");
+ HDfprintf(stderr, " -family_to_sec2 Deprecated version of -family_to_single (below)\n");
+ HDfprintf(stderr, " -family_to_single Change file driver from family to the default single-file VFD (windows or sec2)\n");
+ HDfprintf(stderr, " SRC The name of the source file\n");
+ HDfprintf(stderr, " DST The name of the destination files\n");
+ HDfprintf(stderr, "Sizes may be suffixed with `g' for GB, `m' for MB or "
+ "`k' for kB.\n");
+ HDfprintf(stderr, "File family names include an integer printf "
+ "format such as `%%d'\n");
+ HDexit (EXIT_FAILURE);
}
-
+
/*-------------------------------------------------------------------------
- * Function: get_size
+ * Function: get_size
*
- * Purpose: Reads a size option of the form `-XNS' where `X' is any
- * letter, `N' is a multi-character positive decimal number, and
- * `S' is an optional suffix letter in the set [GgMmk]. The
- * option may also be split among two arguments as: `-X NS'.
- * The input value of ARGNO is the argument number for the
- * switch in the ARGV vector and ARGC is the number of entries
- * in that vector.
+ * Purpose: Reads a size option of the form `-XNS' where `X' is any
+ * letter, `N' is a multi-character positive decimal number, and
+ * `S' is an optional suffix letter in the set [GgMmk]. The
+ * option may also be split among two arguments as: `-X NS'.
+ * The input value of ARGNO is the argument number for the
+ * switch in the ARGV vector and ARGC is the number of entries
+ * in that vector.
*
- * Return: Success: The value N multiplied according to the
- * suffix S. On return ARGNO will be the number
- * of the next argument to process.
+ * Return: Success: The value N multiplied according to the
+ * suffix S. On return ARGNO will be the number
+ * of the next argument to process.
*
- * Failure: Calls usage() which exits with a non-zero
- * status.
+ * Failure: Calls usage() which exits with a non-zero
+ * status.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, May 13, 1998
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static off_t
get_size (const char *progname, int *argno, int argc, char *argv[])
{
- off_t retval=-1;
- char *suffix;
+ off_t retval=-1;
+ char *suffix;
if (isdigit ((int)(argv[*argno][2]))) {
- retval = strtol (argv[*argno]+2, &suffix, 10);
- (*argno)++;
- } else if (argv[*argno][2] || *argno+1>=argc) {
- usage (progname);
- } else {
- retval = strtol (argv[*argno+1], &suffix, 0);
- if (suffix==argv[*argno+1]) usage (progname);
- *argno += 2;
+ retval = HDstrtol(argv[*argno]+2, &suffix, 10);
+ (*argno)++;
+ }
+ else if (argv[*argno][2] || *argno+1>=argc) {
+ usage (progname);
+ }
+ else {
+ retval = HDstrtol(argv[*argno+1], &suffix, 0);
+ if (suffix == argv[*argno+1])
+ usage (progname);
+ *argno += 2;
}
if (suffix && suffix[0] && !suffix[1]) {
- switch (*suffix) {
- case 'G':
- case 'g':
- retval *= 1024 * 1024 * 1024;
- break;
- case 'M':
- case 'm':
- retval *= 1024 * 1024;
- break;
- case 'k':
- retval *= 1024;
- break;
- default:
- usage (progname);
- }
- } else if (suffix && suffix[0]) {
- usage (progname);
+ switch (*suffix) {
+ case 'G':
+ case 'g':
+ retval *= 1024 * 1024 * 1024;
+ break;
+ case 'M':
+ case 'm':
+ retval *= 1024 * 1024;
+ break;
+ case 'k':
+ retval *= 1024;
+ break;
+ default:
+ usage(progname);
+ }
+ }
+ else if (suffix && suffix[0]) {
+ usage (progname);
}
return retval;
}
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Split an hdf5 file
+ * Purpose: Split an hdf5 file
*
- * Return: Success:
+ * Return: Success:
*
- * Failure:
+ * Failure:
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, May 13, 1998
*
* Modifications:
@@ -155,36 +156,36 @@ get_size (const char *progname, int *argno, int argc, char *argv[])
int
main (int argc, char *argv[])
{
- const char *prog_name; /*program name */
- size_t blk_size=1024; /*size of each I/O block */
- char *buf=NULL; /*I/O block buffer */
- size_t n, i; /*counters */
- ssize_t nio; /*I/O return value */
- int argno=1; /*program argument number */
- int src, dst=-1; /*source & destination files */
- int need_seek=FALSE; /*destination needs to seek? */
- int need_write; /*data needs to be written? */
- h5_stat_t sb; /*temporary file stat buffer */
-
- int verbose=FALSE; /*display file names? */
-
- const char *src_gen_name; /*general source name */
- char *src_name=NULL; /*source member name */
-
- int src_is_family; /*is source name a family name? */
- int src_membno=0; /*source member number */
-
- const char *dst_gen_name; /*general destination name */
- char *dst_name=NULL; /*destination member name */
- int dst_is_family; /*is dst name a family name? */
- int dst_membno=0; /*destination member number */
-
- off_t left_overs=0; /*amount of zeros left over */
- off_t src_offset=0; /*offset in source member */
- off_t dst_offset=0; /*offset in destination member */
- off_t src_size; /*source logical member size */
- off_t src_act_size; /*source actual member size */
- off_t dst_size=1 GB; /*destination logical memb size */
+ const char *prog_name; /*program name */
+ size_t blk_size=1024; /*size of each I/O block */
+ char *buf=NULL; /*I/O block buffer */
+ size_t n, i; /*counters */
+ ssize_t nio; /*I/O return value */
+ int argno=1; /*program argument number */
+ int src, dst=-1; /*source & destination files */
+ int need_seek=FALSE; /*destination needs to seek? */
+ int need_write; /*data needs to be written? */
+ h5_stat_t sb; /*temporary file stat buffer */
+
+ int verbose=FALSE; /*display file names? */
+
+ const char *src_gen_name; /*general source name */
+ char *src_name=NULL; /*source member name */
+
+ int src_is_family; /*is source name a family name? */
+ int src_membno=0; /*source member number */
+
+ const char *dst_gen_name; /*general destination name */
+ char *dst_name=NULL; /*destination member name */
+ int dst_is_family; /*is dst name a family name? */
+ int dst_membno=0; /*destination member number */
+
+ off_t left_overs=0; /*amount of zeros left over */
+ off_t src_offset=0; /*offset in source member */
+ off_t dst_offset=0; /*offset in destination member */
+ off_t src_size; /*source logical member size */
+ off_t src_act_size; /*source actual member size */
+ off_t dst_size=1 GB; /*destination logical memb size */
hid_t fapl; /*file access property list */
hid_t file;
hsize_t hdsize; /*destination logical memb size */
@@ -193,48 +194,50 @@ main (int argc, char *argv[])
/*
* Get the program name from argv[0]. Use only the last component.
*/
- if ((prog_name=strrchr (argv[0], '/'))) prog_name++;
- else prog_name = argv[0];
+ if ((prog_name = HDstrrchr (argv[0], '/')))
+ prog_name++;
+ else
+ prog_name = argv[0];
/*
* Parse switches.
*/
- while (argno<argc && '-'==argv[argno][0]) {
- if (!strcmp (argv[argno], "-v")) {
+ while (argno < argc && '-' == argv[argno][0]) {
+ if (!HDstrcmp(argv[argno], "-v")) {
verbose = TRUE;
argno++;
- } else if (!strcmp(argv[argno], "-V")) {
- printf("This is %s version %u.%u release %u\n",
- prog_name, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE);
- exit(EXIT_SUCCESS);
- } else if (!strcmp (argv[argno], "-family_to_sec2")) {
+ } else if (!HDstrcmp(argv[argno], "-V")) {
+ HDprintf("This is %s version %u.%u release %u\n", prog_name, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE);
+ HDexit(EXIT_SUCCESS);
+ } else if (!HDstrcmp(argv[argno], "-family_to_sec2")) {
family_to_single = TRUE;
argno++;
- } else if (!strcmp (argv[argno], "-family_to_single")) {
+ } else if (!HDstrcmp(argv[argno], "-family_to_single")) {
family_to_single = TRUE;
argno++;
- } else if ('b'==argv[argno][1]) {
- blk_size = (size_t)get_size (prog_name, &argno, argc, argv);
- } else if ('m'==argv[argno][1]) {
- dst_size = get_size (prog_name, &argno, argc, argv);
+ } else if ('b' == argv[argno][1]) {
+ blk_size = (size_t) get_size(prog_name, &argno, argc, argv);
+ } else if ('m' == argv[argno][1]) {
+ dst_size = get_size(prog_name, &argno, argc, argv);
} else {
- usage (prog_name);
+ usage(prog_name);
} /* end if */
} /* end while */
/* allocate names */
if(NULL == (src_name = (char *)HDcalloc((size_t)NAMELEN, sizeof(char))))
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
if(NULL == (dst_name = (char *)HDcalloc((size_t)NAMELEN, sizeof(char))))
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
/*
* Get the name for the source file and open the first member. The size
* of the first member determines the logical size of all the members.
*/
- if (argno>=argc) usage (prog_name);
+ if (argno >= argc)
+ usage(prog_name);
src_gen_name = argv[argno++];
- sprintf (src_name, src_gen_name, src_membno);
+ HDsprintf(src_name, src_gen_name, src_membno);
src_is_family = strcmp (src_name, src_gen_name);
if ((src = HDopen(src_name, O_RDONLY)) < 0) {
@@ -242,157 +245,170 @@ main (int argc, char *argv[])
HDexit(EXIT_FAILURE);
}
- if (HDfstat(src, &sb)<0) {
- perror ("fstat");
- exit (EXIT_FAILURE);
+ if (HDfstat(src, &sb) < 0) {
+ HDperror("fstat");
+ HDexit(EXIT_FAILURE);
}
src_size = src_act_size = sb.st_size;
- if (verbose) fprintf (stderr, "< %s\n", src_name);
+ if (verbose)
+ HDfprintf(stderr, "< %s\n", src_name);
/*
* Get the name for the destination file and open the first member.
*/
- if (argno>=argc) usage (prog_name);
+ if (argno>=argc)
+ usage (prog_name);
dst_gen_name = argv[argno++];
- sprintf (dst_name, dst_gen_name, dst_membno);
- dst_is_family = strcmp (dst_name, dst_gen_name);
+ HDsprintf(dst_name, dst_gen_name, dst_membno);
+ dst_is_family = HDstrcmp(dst_name, dst_gen_name);
if ((dst = HDopen(dst_name, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) {
HDperror(dst_name);
HDexit(EXIT_FAILURE);
}
- if (verbose) fprintf (stderr, "> %s\n", dst_name);
+ if (verbose)
+ HDfprintf(stderr, "> %s\n", dst_name);
/* No more arguments */
- if (argno<argc) usage (prog_name);
+ if (argno < argc)
+ usage (prog_name);
/* Now the real work, split the file */
buf = (char *)HDmalloc(blk_size);
while (src_offset<src_size) {
- /* Read a block. The amount to read is the minimum of:
- * 1. The I/O block size
- * 2. What's left to write in the destination member
- * 3. Left over zeros or what's left in the source member.
- */
- n = blk_size;
- if (dst_is_family) n = (size_t)MIN((off_t)n, dst_size-dst_offset);
- if (left_overs) {
- n = (size_t)MIN ((off_t)n, left_overs);
- left_overs = left_overs - (off_t)n;
- need_write = FALSE;
- } else if (src_offset<src_act_size) {
- n = (size_t)MIN ((off_t)n, src_act_size-src_offset);
- if ((nio=HDread (src, buf, n))<0) {
- perror ("read");
- exit (EXIT_FAILURE);
- } else if ((size_t)nio!=n) {
- fprintf (stderr, "%s: short read\n", src_name);
- exit (EXIT_FAILURE);
- }
- for (i=0; i<n; i++) {
- if (buf[i]) break;
- }
- need_write = (i<n);
- } else {
- n = 0;
- left_overs = src_size - src_act_size;
- need_write = FALSE;
- }
-
- /*
- * If the block contains non-zero data then write it to the
- * destination, otherwise just remember that we'll have to do a seek
- * later in the destination when we finally get non-zero data.
- */
- if (need_write) {
- if (need_seek && HDlseek (dst, dst_offset, SEEK_SET)<0) {
- perror ("HDlseek");
- exit (EXIT_FAILURE);
- }
- if ((nio=HDwrite (dst, buf, n))<0) {
- perror ("write");
- exit (EXIT_FAILURE);
- } else if ((size_t)nio!=n) {
- fprintf (stderr, "%s: short write\n", dst_name);
- exit (EXIT_FAILURE);
- }
- need_seek = FALSE;
- } else {
- need_seek = TRUE;
- }
-
- /*
- * Update the source offset and open the next source family member if
- * necessary. The source stream ends at the first member which
- * cannot be opened because it doesn't exist. At the end of the
- * source stream, update the destination offset and break out of the
- * loop. The destination offset must be updated so we can fix
- * trailing holes.
- */
- src_offset = src_offset + (off_t)n;
- if (src_offset==src_act_size) {
- HDclose (src);
- if (!src_is_family) {
- dst_offset = dst_offset + (off_t)n;
- break;
- }
- sprintf (src_name, src_gen_name, ++src_membno);
- if ((src = HDopen(src_name, O_RDONLY)) < 0 && ENOENT == errno) {
- dst_offset = dst_offset + (off_t)n;
- break;
- } else if (src<0) {
- perror (src_name);
- exit (EXIT_FAILURE);
- }
- if (HDfstat (src, &sb)<0) {
- perror ("fstat");
- exit (EXIT_FAILURE);
- }
- src_act_size = sb.st_size;
- if (src_act_size>src_size) {
- fprintf (stderr, "%s: member truncated to %lu bytes\n",
- src_name, (unsigned long)src_size);
- }
- src_offset = 0;
- if (verbose) fprintf (stderr, "< %s\n", src_name);
- }
-
- /*
- * Update the destination offset, opening a new member if one will be
- * needed. The first member is extended to the logical member size
- * but other members might be smaller if they end with a hole.
- */
- dst_offset = dst_offset + (off_t)n;
- if (dst_is_family && dst_offset==dst_size) {
- if (0==dst_membno) {
- if (HDlseek (dst, dst_size-1, SEEK_SET)<0) {
- perror ("HDHDlseek");
- exit (EXIT_FAILURE);
- }
- if (HDread (dst, buf, 1)<0) {
- perror ("read");
- exit (EXIT_FAILURE);
- }
- if (HDlseek (dst, dst_size-1, SEEK_SET)<0) {
- perror ("HDlseek");
- exit (EXIT_FAILURE);
- }
- if (HDwrite (dst, buf, 1)<0) {
- perror ("write");
- exit (EXIT_FAILURE);
- }
- }
- HDclose (dst);
- sprintf (dst_name, dst_gen_name, ++dst_membno);
- if ((dst = HDopen(dst_name, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) {
- HDperror(dst_name);
- HDexit(EXIT_FAILURE);
- }
- dst_offset = 0;
- need_seek = FALSE;
- if (verbose) fprintf (stderr, "> %s\n", dst_name);
- }
+ /* Read a block. The amount to read is the minimum of:
+ * 1. The I/O block size
+ * 2. What's left to write in the destination member
+ * 3. Left over zeros or what's left in the source member.
+ */
+ n = blk_size;
+ if (dst_is_family)
+ n = (size_t)MIN((off_t)n, dst_size-dst_offset);
+ if (left_overs) {
+ n = (size_t)MIN((off_t)n, left_overs);
+ left_overs = left_overs - (off_t) n;
+ need_write = FALSE;
+ }
+ else if (src_offset < src_act_size) {
+ n = (size_t)MIN((off_t)n, src_act_size-src_offset);
+ if ((nio = HDread(src, buf, n)) < 0) {
+ HDperror("read");
+ HDexit(EXIT_FAILURE);
+ }
+ else if ((size_t) nio != n) {
+ HDfprintf(stderr, "%s: short read\n", src_name);
+ HDexit(EXIT_FAILURE);
+ }
+ for (i = 0; i < n; i++) {
+ if (buf[i])
+ break;
+ }
+ need_write = (i < n);
+ }
+ else {
+ n = 0;
+ left_overs = src_size - src_act_size;
+ need_write = FALSE;
+ }
+
+ /*
+ * If the block contains non-zero data then write it to the
+ * destination, otherwise just remember that we'll have to do a seek
+ * later in the destination when we finally get non-zero data.
+ */
+ if (need_write) {
+ if (need_seek && HDlseek (dst, dst_offset, SEEK_SET) < 0) {
+ HDperror("HDlseek");
+ HDexit(EXIT_FAILURE);
+ }
+ if ((nio = HDwrite(dst, buf, n)) < 0) {
+ HDperror("write");
+ HDexit(EXIT_FAILURE);
+ }
+ else if ((size_t) nio != n) {
+ HDfprintf(stderr, "%s: short write\n", dst_name);
+ HDexit(EXIT_FAILURE);
+ }
+ need_seek = FALSE;
+ }
+ else {
+ need_seek = TRUE;
+ }
+
+ /*
+ * Update the source offset and open the next source family member if
+ * necessary. The source stream ends at the first member which
+ * cannot be opened because it doesn't exist. At the end of the
+ * source stream, update the destination offset and break out of the
+ * loop. The destination offset must be updated so we can fix
+ * trailing holes.
+ */
+ src_offset = src_offset + (off_t) n;
+ if (src_offset == src_act_size) {
+ HDclose(src);
+ if (!src_is_family) {
+ dst_offset = dst_offset + (off_t) n;
+ break;
+ }
+ HDsprintf(src_name, src_gen_name, ++src_membno);
+ if ((src = HDopen(src_name, O_RDONLY)) < 0 && ENOENT == errno) {
+ dst_offset = dst_offset + (off_t) n;
+ break;
+ }
+ else if (src < 0) {
+ HDperror(src_name);
+ HDexit(EXIT_FAILURE);
+ }
+ if (HDfstat (src, &sb) < 0) {
+ HDperror("fstat");
+ HDexit(EXIT_FAILURE);
+ }
+ src_act_size = sb.st_size;
+ if (src_act_size > src_size) {
+ HDfprintf(stderr, "%s: member truncated to %lu bytes\n", src_name, (unsigned long) src_size);
+ }
+ src_offset = 0;
+ if (verbose)
+ HDfprintf(stderr, "< %s\n", src_name);
+ }
+
+ /*
+ * Update the destination offset, opening a new member if one will be
+ * needed. The first member is extended to the logical member size
+ * but other members might be smaller if they end with a hole.
+ */
+ dst_offset = dst_offset + (off_t) n;
+ if (dst_is_family && dst_offset == dst_size) {
+ if (0 == dst_membno) {
+ if (HDlseek (dst, dst_size-1, SEEK_SET) < 0) {
+ HDperror("HDHDlseek");
+ HDexit(EXIT_FAILURE);
+ }
+ if (HDread (dst, buf, 1) < 0) {
+ HDperror("read");
+ HDexit(EXIT_FAILURE);
+ }
+ if (HDlseek (dst, dst_size-1, SEEK_SET) < 0) {
+ HDperror("HDlseek");
+ HDexit(EXIT_FAILURE);
+ }
+ if (HDwrite (dst, buf, 1) < 0) {
+ HDperror("write");
+ HDexit(EXIT_FAILURE);
+ }
+ }
+ HDclose(dst);
+ HDsprintf(dst_name, dst_gen_name, ++dst_membno);
+ if ((dst = HDopen(dst_name, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) {
+ HDperror(dst_name);
+ HDexit(EXIT_FAILURE);
+ }
+ dst_offset = 0;
+ need_seek = FALSE;
+ if (verbose)
+ HDfprintf(stderr, "> %s\n", dst_name);
+ }
}
/*
@@ -401,30 +417,30 @@ main (int argc, char *argv[])
* family has been truncated.
*/
if (need_seek) {
- if (HDlseek (dst, dst_offset-1, SEEK_SET)<0) {
- perror ("HDlseek");
- exit (EXIT_FAILURE);
- }
- if (HDread (dst, buf, 1)<0) {
- perror ("read");
- exit (EXIT_FAILURE);
- }
- if (HDlseek (dst, dst_offset-1, SEEK_SET)<0) {
- perror ("HDlseek");
- exit (EXIT_FAILURE);
- }
- if (HDwrite (dst, buf, 1)<0) {
- perror ("write");
- exit (EXIT_FAILURE);
- }
+ if (HDlseek (dst, dst_offset-1, SEEK_SET)<0) {
+ HDperror ("HDlseek");
+ HDexit (EXIT_FAILURE);
+ }
+ if (HDread (dst, buf, 1)<0) {
+ HDperror ("read");
+ HDexit (EXIT_FAILURE);
+ }
+ if (HDlseek (dst, dst_offset-1, SEEK_SET)<0) {
+ HDperror ("HDlseek");
+ HDexit (EXIT_FAILURE);
+ }
+ if (HDwrite (dst, buf, 1)<0) {
+ HDperror ("write");
+ HDexit (EXIT_FAILURE);
+ }
}
HDclose (dst);
/* Modify family driver information saved in superblock through private property.
* These private properties are for this tool only. */
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) {
- perror ("H5Pcreate");
- exit (EXIT_FAILURE);
+ if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) {
+ HDperror ("H5Pcreate");
+ HDexit (EXIT_FAILURE);
}
if(family_to_single) {
@@ -433,23 +449,24 @@ main (int argc, char *argv[])
* the library to ignore the family driver information saved in the superblock.
*/
if(H5Pset(fapl, H5F_ACS_FAMILY_TO_SINGLE_NAME, &family_to_single) < 0) {
- perror ("H5Pset");
- exit (EXIT_FAILURE);
+ HDperror ("H5Pset");
+ HDexit (EXIT_FAILURE);
}
- } else {
+ }
+ else {
/* Modify family size saved in superblock through private property. It signals
* library to save the new member size(specified in command line) in superblock.
* This private property is for this tool only. */
if(H5Pset_fapl_family(fapl, H5F_FAMILY_DEFAULT, H5P_DEFAULT) < 0) {
- perror ("H5Pset_fapl_family");
- exit (EXIT_FAILURE);
+ HDperror ("H5Pset_fapl_family");
+ HDexit (EXIT_FAILURE);
}
/* Set the property of the new member size as hsize_t */
hdsize = (hsize_t)dst_size;
if(H5Pset(fapl, H5F_ACS_FAMILY_NEWSIZE_NAME, &hdsize) < 0) {
- perror ("H5Pset");
- exit (EXIT_FAILURE);
+ HDperror ("H5Pset");
+ HDexit (EXIT_FAILURE);
}
}
@@ -465,16 +482,16 @@ main (int argc, char *argv[])
file = H5Fopen(dst_gen_name, H5F_ACC_RDWR, fapl);
} H5E_END_TRY;
- if(file>=0) {
- if(H5Fclose(file)<0) {
- perror ("H5Fclose");
- exit (EXIT_FAILURE);
+ if(file >= 0) {
+ if(H5Fclose(file) < 0) {
+ HDperror("H5Fclose");
+ HDexit(EXIT_FAILURE);
} /* end if */
} /* end if */
- if(H5Pclose(fapl)<0) {
- perror ("H5Pclose");
- exit (EXIT_FAILURE);
+ if(H5Pclose(fapl) < 0) {
+ HDperror("H5Pclose");
+ HDexit(EXIT_FAILURE);
} /* end if */
/* Free resources and return */
diff --git a/tools/test/Makefile.in b/tools/test/Makefile.in
index 13a8784..16ddba4 100644
--- a/tools/test/Makefile.in
+++ b/tools/test/Makefile.in
@@ -485,7 +485,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -508,9 +507,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -537,6 +539,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -591,6 +594,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -615,7 +619,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1270,7 +1273,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt
index a71a12a..1130ea7 100644
--- a/tools/test/h5copy/CMakeLists.txt
+++ b/tools/test/h5copy/CMakeLists.txt
@@ -4,29 +4,29 @@ project (HDF5_TOOLS_TEST_H5COPY C)
# --------------------------------------------------------------------
# Add the h5copy test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c)
- target_include_directories(h5copygentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5copygentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5copygentest STATIC)
target_link_libraries (h5copygentest PRIVATE ${HDF5_LIB_TARGET})
set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>)
+ #add_test (NAME h5copygentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copygentest>)
endif ()
#-----------------------------------------------------------------------------
# If plugin library tests can be tested
#-----------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
- set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibcopy")
- set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
- set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
+ set (H5COPY_TOOL_PLUGIN_LIB_CORENAME "dynlibcopy")
+ set (H5COPY_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5COPY_TOOL_PLUGIN_LIB_CORENAME}")
+ set (H5COPY_TOOL_PLUGIN_LIB_TARGET ${H5COPY_TOOL_PLUGIN_LIB_CORENAME})
- add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_copy.c)
- target_include_directories(${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIB_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
+ add_library (${H5COPY_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_copy.c)
+ target_include_directories (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5COPY_TOOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5COPY_TOOL_PLUGIN_LIB_TARGET} ${H5COPY_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
# make plugins dir
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
@@ -34,12 +34,12 @@ if (BUILD_SHARED_LIBS)
# Copy plugin library to a plugins folder
#-----------------------------------------------------------------------------
add_custom_command (
- TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET}
+ TARGET ${H5COPY_TOOL_PLUGIN_LIB_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
+ "$<TARGET_FILE:${H5COPY_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5COPY_TOOL_PLUGIN_LIB_TARGET}>"
)
endif ()
diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake
index f31068b..b0d1615 100644
--- a/tools/test/h5copy/CMakeTests.cmake
+++ b/tools/test/h5copy/CMakeTests.cmake
@@ -45,6 +45,12 @@
endforeach ()
add_custom_target(h5copy_files ALL COMMENT "Copying files needed by h5copy tests" DEPENDS ${h5copy_files_list})
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
##############################################################################
##############################################################################
### T H E T E S T S M A C R O S ###
@@ -52,25 +58,23 @@
##############################################################################
#
- # Perform h5copy according to passing parmeters
+ # Perform h5copy according to passing parameters
#
macro (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
# Remove any output file left over from previous test run
add_test (
NAME H5COPY_F-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/${testname}.out.h5
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5
)
endif ()
add_test (
NAME H5COPY_F-${testname}
- COMMAND $<TARGET_FILE:h5copy> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
@@ -78,13 +82,13 @@
endif ()
# resultcode=2 will cause the test to skip the diff test
- if (NOT "${resultcode}" STREQUAL "2")
+ if (NOT ${resultcode} EQUAL 2)
add_test (
NAME H5COPY_F-${testname}-DIFF
- COMMAND $<TARGET_FILE:h5diff> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname})
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
endif ()
@@ -95,18 +99,16 @@
# Remove any output file left over from previous test run
add_test (
NAME H5COPY-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/${testname}.out.h5
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5
)
endif ()
add_test (
NAME H5COPY-${testname}
- COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
@@ -114,13 +116,13 @@
endif ()
# resultcode=2 will cause the test to skip the diff test
- if (NOT "${resultcode}" STREQUAL "2")
+ if (NOT ${resultcode} EQUAL 2)
add_test (
NAME H5COPY-${testname}-DIFF
- COMMAND $<TARGET_FILE:h5diff> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
endif ()
@@ -141,18 +143,16 @@
# Remove any output file left over from previous test run
add_test (
NAME H5COPY-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/${testname}.out.h5
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5
)
endif ()
add_test (
NAME H5COPY-${testname}-prefill
- COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam}
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test})
endif ()
else ()
@@ -161,17 +161,17 @@
add_test (
NAME H5COPY-${testname}
- COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
)
set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill)
# resultcode=2 will cause the test to skip the diff test
- if (NOT "${resultcode}" STREQUAL "2")
+ if (NOT ${resultcode} EQUAL 2)
add_test (
NAME H5COPY-${testname}-DIFF
- COMMAND $<TARGET_FILE:h5diff> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
endif ()
@@ -182,18 +182,16 @@
# Remove any output file left over from previous test run
add_test (
NAME H5COPY_SAME-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/${testname}.out.h5
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5
)
endif ()
add_test (
NAME H5COPY_SAME-${testname}-prefill
- COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam}
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test})
endif ()
else (HDF5_ENABLE_USING_MEMCHECKER)
@@ -202,17 +200,17 @@
add_test (
NAME H5COPY_SAME-${testname}
- COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
)
set_tests_properties (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill)
# resultcode=2 will cause the test to skip the diff test
- if (NOT "${resultcode}" STREQUAL "2")
+ if (NOT ${resultcode} EQUAL 2)
add_test (
NAME H5COPY_SAME-${testname}-DIFF
- COMMAND $<TARGET_FILE:h5diff> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname})
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
endif ()
@@ -225,27 +223,24 @@
macro (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN})
- if ("${resultcode}" STREQUAL "1")
+ add_test (NAME H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN})
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
# Remove any output file left over from previous test run
add_test (
NAME H5COPY-CMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/${testname}.out.h5
- ./testfiles/${testname}.out.out
- ./testfiles/${testname}.out.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5
)
add_test (
NAME H5COPY-CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5copy>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5copy${tgt_ext}>"
-D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${vparam};${sparam};${srcname};${dparam};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=./testfiles/${testname}.out.out"
@@ -264,18 +259,13 @@
# Remove any output file left over from previous test run
add_test (
NAME H5COPY_UD-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${testname}.out.h5
- testfiles/${infile}.out
- testfiles/${infile}.out.err
- testfiles/${testname}.out.h5.out
- testfiles/${testname}.out.h5.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}.out.h5
)
- if ("${resultcode}" STREQUAL "2")
+ if (${resultcode} EQUAL 2)
add_test (
NAME H5COPY_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>"
-D "TEST_ARGS:STRING=-v;-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${sparam};${srcname};${dparam};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
@@ -285,12 +275,14 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
else ()
add_test (
NAME H5COPY_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>"
-D "TEST_ARGS:STRING=-v;-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${sparam};${srcname};${dparam};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
@@ -300,6 +292,7 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
@@ -307,6 +300,7 @@
add_test (
NAME H5COPY_UD-${testname}-DIFF
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}.out.h5;${srcname};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
@@ -316,6 +310,7 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5COPY_UD-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD-${testname})
@@ -327,18 +322,13 @@
# Remove any output file left over from previous test run
add_test (
NAME H5COPY_UD_ERR-${testname}-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${testname}_ERR.out.h5
- testfiles/${infile}_ERR.out
- testfiles/${infile}_ERR.out.err
- testfiles/${testname}_ERR.out.h5.out
- testfiles/${testname}_ERR.out.h5.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}_ERR.out.h5
)
- if ("${resultcode}" STREQUAL "2")
+ if (${resultcode} EQUAL 2)
add_test (
NAME H5COPY_UD_ERR-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>"
-D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
@@ -349,12 +339,14 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
else ()
add_test (
NAME H5COPY_UD_ERR-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>"
-D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
@@ -365,6 +357,7 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
@@ -372,6 +365,7 @@
add_test (
NAME H5COPY_UD_ERR-${testname}-DIFF
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}_ERR.out.h5;${srcname};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
@@ -381,6 +375,7 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD_ERR-${testname})
@@ -405,8 +400,7 @@
# Remove any output file left over from previous test run
add_test (
NAME H5COPY-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
simple.out.h5
chunk.out.h5
compact.out.h5
@@ -439,11 +433,9 @@
samefile1.out.h5
samefile2.out.h5
h5copy_misc1.out.h5
- h5copy_misc1.out.out
- h5copy_misc1.out.out.err
)
set_tests_properties (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "H5COPY-clearall-objects")
diff --git a/tools/test/h5copy/Makefile.in b/tools/test/h5copy/Makefile.in
index 5f35228..3cef610 100644
--- a/tools/test/h5copy/Makefile.in
+++ b/tools/test/h5copy/Makefile.in
@@ -482,7 +482,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -505,9 +504,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -534,6 +536,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -588,6 +591,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -612,7 +616,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1262,7 +1265,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c
index 9f5d916..f6aa72f 100644
--- a/tools/test/h5copy/h5copygentest.c
+++ b/tools/test/h5copy/h5copygentest.c
@@ -326,7 +326,7 @@ static void gent_nested_vl(hid_t loc_id)
* Function: gent_att_compound_vlstr
*
* Purpose: Generate a dataset and a group.
- * Both has an attribute with a compound datatype consisting
+ * Both has an attribute with a compound datatype consisting
* of a variable length string
*
*-------------------------------------------------------------------------
@@ -337,15 +337,15 @@ static void gent_att_compound_vlstr(hid_t loc_id)
int i;
const char *v;
} s1;
- hsize_t dim[1] = {1}; /* Dimension size */
- hid_t sid = -1; /* Dataspace ID */
- hid_t tid = -1; /* Datatype ID */
- hid_t aid = -1; /* Attribute ID */
- hid_t did = -1; /* Dataset ID */
- hid_t gid = -1; /* Group ID */
- hid_t vl_str_tid = -1; /* Variable length datatype ID */
- hid_t cmpd_tid = -1; /* Compound datatype ID */
- hid_t null_sid = -1; /* Null dataspace ID */
+ hsize_t dim[1] = {1}; /* Dimension size */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t tid = -1; /* Datatype ID */
+ hid_t aid = -1; /* Attribute ID */
+ hid_t did = -1; /* Dataset ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t vl_str_tid = -1; /* Variable length datatype ID */
+ hid_t cmpd_tid = -1; /* Compound datatype ID */
+ hid_t null_sid = -1; /* Null dataspace ID */
s1 buf; /* Buffer */
buf.i = 9;
@@ -509,7 +509,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
sid = H5Screate_simple(1, dims1, NULL);
if (sid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -517,7 +517,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
oid = H5Dcreate2 (loc_id, OBJ_REF_DS, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -525,7 +525,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Dwrite(oid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -538,7 +538,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
oid = H5Gcreate2 (loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -547,14 +547,14 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Rcreate (&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
status = H5Rcreate (&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -562,7 +562,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
sid = H5Screate_simple (1, dims2, NULL);
if (sid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -570,7 +570,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
oid = H5Dcreate2 (loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
if (oid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -578,7 +578,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, or_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -618,7 +618,7 @@ static herr_t gen_region_ref(hid_t loc_id)
sid = H5Screate_simple (2, dims2, NULL);
if (sid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -627,7 +627,7 @@ static herr_t gen_region_ref(hid_t loc_id)
oid2 = H5Dcreate2 (loc_id, REG_REF_DS2, H5T_STD_I8LE, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
if (oid2 < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -636,7 +636,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Dwrite (oid2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -645,7 +645,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Sselect_elements (sid, H5S_SELECT_SET, 4, coords[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -654,7 +654,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Rcreate (&rr_data[0], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -663,7 +663,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Sselect_hyperslab (sid, H5S_SELECT_SET, start, stride, count, block);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -672,7 +672,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Rcreate (&rr_data[1], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -683,7 +683,7 @@ static herr_t gen_region_ref(hid_t loc_id)
sid = H5Screate_simple (1, dims1, NULL);
if (sid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -692,7 +692,7 @@ static herr_t gen_region_ref(hid_t loc_id)
oid1 = H5Dcreate2 (loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
if (oid1 < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -701,7 +701,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Dwrite (oid1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -725,30 +725,30 @@ out:
*------------------------------------------------------------------------*/
static void Test_Obj_Copy(void)
{
- hid_t fid = -1; /* File id */
- hid_t fapl_new = (-1); /* File access property id */
- unsigned new_format; /* New format or old format */
+ hid_t fid = -1; /* File id */
+ hid_t fapl_new = (-1); /* File access property id */
+ unsigned new_format; /* New format or old format */
if((fapl_new = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
- fprintf(stderr, "Error: H5Pcreate failed.\n");
+ HDfprintf(stderr, "Error: H5Pcreate failed.\n");
goto out;
}
if(H5Pset_libver_bounds(fapl_new, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
- fprintf(stderr, "Error: H5Pset_libver_bounds failed.\n");
+ HDfprintf(stderr, "Error: H5Pset_libver_bounds failed.\n");
goto out;
}
/* Test with old & new format groups */
for(new_format = FALSE; new_format <= TRUE; new_format++) {
-
+
/* Set the FAPL for the type of format */
/* Create source file */
if(new_format)
- fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new);
- else
- fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new);
+ else
+ fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if(fid < 0) {
- fprintf(stderr, "Error: H5Fcreate failed.\n");
+ HDfprintf(stderr, "Error: H5Fcreate failed.\n");
goto out;
}
@@ -756,7 +756,7 @@ static void Test_Obj_Copy(void)
gent_empty_group(fid);
gent_nested_datasets(fid);
gent_nested_group(fid);
- gent_att_compound_vlstr(fid);
+ gent_att_compound_vlstr(fid);
H5Fclose(fid);
fid = (-1);
@@ -786,19 +786,19 @@ static void Test_Ref_Copy(void)
fid = H5Fcreate (HDF_FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid < 0)
{
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_FILE2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_FILE2);
goto out;
}
/* add object reference */
status = gen_obj_ref(fid);
if (status < 0)
- fprintf(stderr, "Failed to generate object reference.\n");
+ HDfprintf(stderr, "Failed to generate object reference.\n");
/* add region reference */
status = gen_region_ref(fid);
if (status < 0)
- fprintf(stderr, "Failed to generate region reference.\n");
+ HDfprintf(stderr, "Failed to generate region reference.\n");
out:
/*-----------------------------------------------------------------------
@@ -829,7 +829,7 @@ static herr_t gen_extlink_trg(hid_t loc_id)
gid = H5Gcreate2(loc_id, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -845,7 +845,7 @@ static herr_t gen_extlink_trg(hid_t loc_id)
status = H5Tcommit2(loc_id, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -878,7 +878,7 @@ static herr_t gen_extlink_src(hid_t loc_id)
gid = H5Gcreate2(loc_id, "/group_ext", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -890,7 +890,7 @@ static herr_t gen_extlink_src(hid_t loc_id)
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/simple", gid, "extlink_dset", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -899,7 +899,7 @@ static herr_t gen_extlink_src(hid_t loc_id)
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/group", gid, "extlink_grp", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -908,7 +908,7 @@ static herr_t gen_extlink_src(hid_t loc_id)
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/datatype", gid, "extlink_datatype", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -917,7 +917,7 @@ static herr_t gen_extlink_src(hid_t loc_id)
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "notyet", gid, "extlink_notyet1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -926,7 +926,7 @@ static herr_t gen_extlink_src(hid_t loc_id)
status = H5Lcreate_external("notyet_file.h5", "notyet", gid, "extlink_notyet2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -953,26 +953,26 @@ static void Test_Extlink_Copy(void)
fid1 = H5Fcreate (HDF_EXT_SRC_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0)
{
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_SRC_FILE);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_SRC_FILE);
goto out;
}
fid2 = H5Fcreate (HDF_EXT_TRG_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0)
{
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_TRG_FILE);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_TRG_FILE);
goto out;
}
/* add links to source external link file */
status = gen_extlink_src(fid1);
if (status < 0)
- fprintf(stderr, "Error: %s> gen_extlink_src failed.\n", HDF_EXT_SRC_FILE);
+ HDfprintf(stderr, "Error: %s> gen_extlink_src failed.\n", HDF_EXT_SRC_FILE);
/* add objs to target external link file */
status = gen_extlink_trg(fid2);
if (status < 0)
- fprintf(stderr, "Error: %s> gen_extlink_trg failed.\n", HDF_EXT_TRG_FILE);
+ HDfprintf(stderr, "Error: %s> gen_extlink_trg failed.\n", HDF_EXT_TRG_FILE);
out:
/*-----------------------------------------------------------------------
diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in
index 50758b5..2440ca4 100644
--- a/tools/test/h5copy/testh5copy.sh.in
+++ b/tools/test/h5copy/testh5copy.sh.in
@@ -504,22 +504,21 @@ fi
TOOLTEST -i $TESTFILE -o $TESTDIR/dsrename.out.h5 -v -s compound -d rename
echo "Test copying empty, 'full' & 'nested' groups"
-if test $USE_FILTER_DEFLATE = "yes" ; then
TOOLTEST -i $TESTFILE -o $TESTDIR/grp_empty.out.h5 -v -s grp_empty -d grp_empty
-fi
+if test $USE_FILTER_DEFLATE = "yes" ; then
TOOLTEST -i $TESTFILE -o $TESTDIR/grp_dsets.out.h5 -v -s grp_dsets -d grp_dsets
TOOLTEST -i $TESTFILE -o $TESTDIR/grp_nested.out.h5 -v -s grp_nested -d grp_nested
+fi
TOOLTEST -i $TESTFILE -o $TESTDIR/grp_attr.out.h5 -v -s grp_attr -d grp_attr
-if test $USE_FILTER_DEFLATE = "yes" ; then
echo "Test copying dataset within group in source file to group in destination"
TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/simple_group.out.h5 grp_dsets grp_dsets /grp_dsets/simple /grp_dsets/simple_group
+if test $USE_FILTER_DEFLATE = "yes" ; then
echo "Test copying & renaming group"
TOOLTEST -i $TESTFILE -o $TESTDIR/grp_rename.out.h5 -v -s grp_dsets -d grp_rename
-fi
-
echo "Test copying 'full' group hierarchy into group in destination file"
TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/grp_dsets_rename.out.h5 grp_dsets grp_rename grp_dsets /grp_rename/grp_dsets
+fi
echo "Test copying objects into group hier. that doesn't exist yet in destination file"
TOOLTEST -i $TESTFILE -o $TESTDIR/A_B1_simple.out.h5 -vp -s simple -d /A/B1/simple
diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt
index c0aac36..cb4397f 100644
--- a/tools/test/h5diff/CMakeLists.txt
+++ b/tools/test/h5diff/CMakeLists.txt
@@ -4,29 +4,29 @@ project (HDF5_TOOLS_TEST_H5DIFF C)
# --------------------------------------------------------------------
# Add the h5diff and test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5diffgentest ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/h5diffgentest.c)
- target_include_directories(h5diffgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5diffgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5diffgentest STATIC)
target_link_libraries (h5diffgentest PRIVATE ${HDF5_LIB_TARGET})
set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>)
+ #add_test (NAME h5diffgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diffgentest>)
endif ()
#-----------------------------------------------------------------------------
# If plugin library tests can be tested
#-----------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
- set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff")
- set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
- set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
+ set (H5DIFF_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff")
+ set (H5DIFF_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5DIFF_TOOL_PLUGIN_LIB_CORENAME}")
+ set (H5DIFF_TOOL_PLUGIN_LIB_TARGET ${H5DIFF_TOOL_PLUGIN_LIB_CORENAME})
- add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c)
- target_include_directories(${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIB_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
+ add_library (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c)
+ target_include_directories (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} ${H5DIFF_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
# make plugins dir
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
@@ -34,12 +34,12 @@ if (BUILD_SHARED_LIBS)
# Copy plugin library to a plugins folder
#-----------------------------------------------------------------------------
add_custom_command (
- TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET}
+ TARGET ${H5DIFF_TOOL_PLUGIN_LIB_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
+ "$<TARGET_FILE:${H5DIFF_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5DIFF_TOOL_PLUGIN_LIB_TARGET}>"
)
endif ()
diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake
index 1376e0d..57bcd12 100644
--- a/tools/test/h5diff/CMakeTests.cmake
+++ b/tools/test/h5diff/CMakeTests.cmake
@@ -324,7 +324,14 @@
#
# Overwrite system dependent files (Windows) and not VS2015
#
+ set (COPY_WINDOWS_FILES false)
+ if (MINGW)
+ set (COPY_WINDOWS_FILES true)
+ endif ()
if (WIN32 AND MSVC_VERSION LESS 1900)
+ set (COPY_WINDOWS_FILES true)
+ endif ()
+ if (COPY_WINDOWS_FILES)
foreach (h5_tstfiles ${LIST_WIN_TEST_FILES})
get_filename_component(fname "${h5_tstfiles}" NAME)
HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}w.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files")
@@ -343,6 +350,12 @@
endif ()
add_custom_target(h5diff_files ALL COMMENT "Copying files needed by h5diff tests" DEPENDS ${h5diff_files_list})
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
##############################################################################
##############################################################################
### T H E T E S T S M A C R O S ###
@@ -352,30 +365,20 @@
macro (ADD_H5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DIFF-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${ARGN})
+ add_test (NAME H5DIFF-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${ARGN})
set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DIFF-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${resultfile}.out
- testfiles/${resultfile}.out.err
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5DIFF-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5DIFF-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -384,7 +387,9 @@
-D "TEST_APPEND=EXIT CODE:"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS H5DIFF-${resultfile}-clear-objects)
+ if (last_test)
+ set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
+ endif ()
endif ()
if (H5_HAVE_PARALLEL)
ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN})
@@ -396,24 +401,13 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME MPI_TEST_H5DIFF-${resultfile} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5diff> ${MPIEXEC_POSTFLAGS} ${ARGN})
set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME MPI_TEST_H5DIFF-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- PAR/testfiles/${resultfile}.out
- PAR/testfiles/${resultfile}.out.err
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (MPI_TEST_H5DIFF-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME MPI_TEST_H5DIFF-${resultfile}
COMMAND "${CMAKE_COMMAND}"
@@ -429,25 +423,20 @@
-D "TEST_SORT_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES DEPENDS MPI_TEST_H5DIFF-${resultfile}-clear-objects)
- set (last_test "PH5DIFF-${resultfile}")
+ if (last_test)
+ set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
+ endif ()
+ set (last_test "MPI_TEST_H5DIFF-${resultfile}")
endif ()
endmacro ()
macro (ADD_H5_UD_TEST testname resultcode resultfile)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DIFF_UD-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${resultfile}.out
- testfiles/${resultfile}.out.err
- )
- if ("${resultcode}" STREQUAL "2")
+ if (${resultcode} EQUAL 2)
add_test (
NAME H5DIFF_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
@@ -457,12 +446,14 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
else ()
add_test (
NAME H5DIFF_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
@@ -472,10 +463,13 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clear-objects)
+ if (last_test)
+ set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS ${last_test})
+ endif ()
endif ()
endmacro ()
@@ -925,7 +919,7 @@
h5diff_vlstr.out.err
)
set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "H5DIFF-clearall-objects")
diff --git a/tools/test/h5diff/Makefile.in b/tools/test/h5diff/Makefile.in
index 2e46a50..664abdc 100644
--- a/tools/test/h5diff/Makefile.in
+++ b/tools/test/h5diff/Makefile.in
@@ -497,7 +497,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -520,9 +519,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -549,6 +551,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -603,6 +606,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -627,7 +631,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1312,7 +1315,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c
index ac3bbee..d60e393 100644
--- a/tools/test/h5diff/h5diffgentest.c
+++ b/tools/test/h5diff/h5diffgentest.c
@@ -108,6 +108,10 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024);
#define SPACE1_DIM1 0
#define SPACE1_DIM2 0
+/* Error macros */
+#define AT() HDprintf("ERROR at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC);
+#define PROGRAM_ERROR {AT(); goto error;}
+
/* A UD link traversal function. Shouldn't actually be called. */
static hid_t
UD_traverse(H5_ATTR_UNUSED const char * link_name, H5_ATTR_UNUSED hid_t cur_group,
@@ -176,7 +180,7 @@ static void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int ma
static void gen_datareg(hid_t fid, int make_diffs);
/* utilities */
static int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf);
-static int write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf);
+static herr_t write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf);
static int gen_dataset_idx(const char *file, int format);
/*-------------------------------------------------------------------------
@@ -284,7 +288,7 @@ int main(void)
/* string dataset and attribute. HDFFV-10028 */
test_objs_strings(DIFF_STRINGS1, DIFF_STRINGS2);
- return 0;
+ return EXIT_SUCCESS;
}
/*-------------------------------------------------------------------------
@@ -306,11 +310,11 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3)
/* create the empty file */
if ((fid1 = H5Fcreate(fname3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- fprintf(stderr, "empty file (%s) creation failed.\n", fname3);
+ HDfprintf(stderr, "empty file (%s) creation failed.\n", fname3);
goto out;
}
if (H5Fclose(fid1) < 0) {
- fprintf(stderr, "empty file (%s) close failed.\n", fname3);
+ HDfprintf(stderr, "empty file (%s) close failed.\n", fname3);
goto out;
}
@@ -1061,7 +1065,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
* Create file1
*-----------------------------------------------------------------------*/
if ((fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1071,28 +1075,28 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
*/
f1_gid = H5Gcreate2(fid1, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f1_gid < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
f1_gid2 = H5Gcreate2(fid1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f1_gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
f1_gid3 = H5Gcreate2(fid1, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f1_gid3 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
f1_gid4 = H5Gcreate2(fid1, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f1_gid4 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1103,13 +1107,13 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
f1_sid = H5Screate_simple(1, dset_dims, NULL);
f1_did = H5Dcreate2(fid1, "dset", H5T_NATIVE_INT, f1_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f1_did == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = H5Dwrite(f1_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1120,7 +1124,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
f1_tid = H5Tcopy(H5T_NATIVE_INT);
status = H5Tcommit2(fid1, "ntype", f1_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1129,7 +1133,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
* Create file2
*-----------------------------------------------------------------------*/
if ((fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1139,28 +1143,28 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
*/
f2_gid = H5Gcreate2(fid2, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f2_gid < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
f2_gid2 = H5Gcreate2(fid2, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f2_gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
f2_gid3 = H5Gcreate2(fid2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f2_gid3 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
f2_gid4 = H5Gcreate2(fid2, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f2_gid4 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1171,13 +1175,13 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
f2_sid = H5Screate_simple(1, dset_dims, NULL);
f2_did = H5Dcreate2(fid2, "dset", H5T_NATIVE_INT, f2_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f2_did == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = H5Dwrite(f2_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1188,7 +1192,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
f2_tid = H5Tcopy(H5T_NATIVE_INT);
status = H5Tcommit2(fid2, "ntype", f2_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1419,7 +1423,7 @@ static int test_link_name(const char *fname1)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1429,7 +1433,7 @@ static int test_link_name(const char *fname1)
*------------------------------------------------------------------------*/
gid1 = H5Gcreate2(fid1, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1437,7 +1441,7 @@ static int test_link_name(const char *fname1)
H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1447,14 +1451,14 @@ static int test_link_name(const char *fname1)
*------------------------------------------------------------------------*/
status = H5Lcreate_soft("group", fid1, "link_g1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("group_longname", fid1, "link_g2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1494,7 +1498,7 @@ static int test_soft_links(const char *fname1)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1504,7 +1508,7 @@ static int test_soft_links(const char *fname1)
*------------------------------------------------------------------------*/
gid1 = H5Gcreate2(fid1, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1515,21 +1519,21 @@ static int test_soft_links(const char *fname1)
/* file1 */
status = write_dset(fid1, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(fid1, 2, dims2, "target_dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -1540,42 +1544,42 @@ static int test_soft_links(const char *fname1)
/* file 1 */
status = H5Lcreate_soft("/target_dset1", fid1, "softlink_dset1_1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/target_dset1", fid1, "softlink_dset1_2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/target_dset2", fid1, "softlink_dset2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/target_group", fid1, "softlink_group1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/target_group", fid1, "softlink_group2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/no_obj", fid1, "softlink_noexist", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1615,7 +1619,7 @@ static int test_linked_softlinks(const char *fname1)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1625,21 +1629,21 @@ static int test_linked_softlinks(const char *fname1)
*------------------------------------------------------------------------*/
gid1 = H5Gcreate2(fid1, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
gid2 = H5Gcreate2(fid1, "target_group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
gid3 = H5Gcreate2(fid1, "target_group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid3 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1650,20 +1654,20 @@ static int test_linked_softlinks(const char *fname1)
/* file1 */
status = write_dset(fid1, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(fid1, 2, dims2, "target_dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -1675,84 +1679,84 @@ static int test_linked_softlinks(const char *fname1)
* file 1 */
status = H5Lcreate_soft("/target_dset1", fid1, "softlink1_to_dset1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink1_to_dset1", fid1, "softlink1_to_slink1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink1_to_slink1", fid1, "softlink1_to_slink2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/target_dset2", fid1, "softlink2_to_dset2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink2_to_dset2", fid1, "softlink2_to_slink1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink2_to_slink1", fid1, "softlink2_to_slink2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("target_group1", fid1, "softlink3_to_group1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink3_to_group1", fid1, "softlink3_to_slink1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink3_to_slink1", fid1, "softlink3_to_slink2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("target_group2", fid1, "softlink4_to_group2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink4_to_group2", fid1, "softlink4_to_slink1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink4_to_slink1", fid1, "softlink4_to_slink2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1797,7 +1801,7 @@ static int test_external_links(const char *fname1, const char *fname2)
/* source file */
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1805,7 +1809,7 @@ static int test_external_links(const char *fname1, const char *fname2)
/* target file */
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1817,14 +1821,14 @@ static int test_external_links(const char *fname1, const char *fname2)
* target file */
gid1 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
gid2 = H5Gcreate2(fid2, "target_group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1835,21 +1839,21 @@ static int test_external_links(const char *fname1, const char *fname2)
* target file */
status = write_dset(fid2, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "x_dset", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid2, 2, dims2, "x_dset", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -1861,42 +1865,42 @@ static int test_external_links(const char *fname1, const char *fname2)
/* source file */
status = H5Lcreate_external(fname2, "/target_group/x_dset", fid1, "ext_link_dset1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/target_group2/x_dset", fid1, "ext_link_dset2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/target_group", fid1, "/ext_link_grp1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/target_group2", fid1, "/ext_link_grp2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link_noexist1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link_noexist2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1941,7 +1945,7 @@ static int test_ext2soft_links(const char *fname1, const char *fname2)
/* source file */
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1949,7 +1953,7 @@ static int test_ext2soft_links(const char *fname1, const char *fname2)
/* target file */
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1960,7 +1964,7 @@ static int test_ext2soft_links(const char *fname1, const char *fname2)
/* target file */
gid2 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1972,14 +1976,14 @@ static int test_ext2soft_links(const char *fname1, const char *fname2)
* target file */
status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -1991,14 +1995,14 @@ static int test_ext2soft_links(const char *fname1, const char *fname2)
* target file */
status = H5Lcreate_soft("/dset1", fid2, "softlink_to_dset1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/dset2", fid2, "softlink_to_dset2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2010,21 +2014,21 @@ static int test_ext2soft_links(const char *fname1, const char *fname2)
* source file */
status = H5Lcreate_external(fname2, "/target_group", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/softlink_to_dset1", fid1, "ext_link_to_slink1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/softlink_to_dset2", fid1, "ext_link_to_slink2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -2154,14 +2158,14 @@ static int test_dangle_links(const char *fname1, const char *fname2)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2172,14 +2176,14 @@ static int test_dangle_links(const char *fname1, const char *fname2)
/* file1 */
status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(fid1, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -2187,14 +2191,14 @@ static int test_dangle_links(const char *fname1, const char *fname2)
/* file2 */
status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -2205,28 +2209,28 @@ static int test_dangle_links(const char *fname1, const char *fname2)
/* file 1 */
status = H5Lcreate_soft("no_obj", fid1, "soft_link1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/dset1", fid1, "soft_link2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("no_obj", fid1, "soft_link3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("no_obj1", fid1, "soft_link4", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -2234,28 +2238,28 @@ static int test_dangle_links(const char *fname1, const char *fname2)
/* file 2 */
status = H5Lcreate_soft("no_obj", fid2, "soft_link1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("no_obj", fid2, "soft_link2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/dset2", fid2, "soft_link3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("no_obj2", fid2, "soft_link4", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2266,28 +2270,28 @@ static int test_dangle_links(const char *fname1, const char *fname2)
/* file1 */
status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/dset1", fid1, "ext_link2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link4", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -2295,28 +2299,28 @@ static int test_dangle_links(const char *fname1, const char *fname2)
/* file2 */
status = H5Lcreate_external(fname1, "no_obj", fid2, "ext_link1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname1, "no_obj", fid2, "ext_link2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname1, "/dset2", fid2, "ext_link3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_external("no_file.h5", "no_obj", fid2, "ext_link4", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2357,14 +2361,14 @@ static int test_group_recurse(const char *fname1, const char *fname2)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2375,28 +2379,28 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file1 */
gid1_f1 = H5Gcreate2(fid1, "/grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1_f1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
gid2_f1 = H5Gcreate2(fid1, "/grp1/grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2_f1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
gid3_f1 = H5Gcreate2(fid1, "/grp1/grp2/grp3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid3_f1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
gid10_f1 = H5Gcreate2(fid1, "/grp10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid10_f1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -2404,28 +2408,28 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file2 */
gid1_f2 = H5Gcreate2(fid2, "/grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1_f2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
gid2_f2 = H5Gcreate2(fid2, "/grp1/grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2_f2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
gid3_f2 = H5Gcreate2(fid2, "/grp1/grp2/grp3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid3_f2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
gid11_f2 = H5Gcreate2(fid2, "/grp11", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid11_f2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2436,21 +2440,21 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file1 */
status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(fid1, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(fid1, 2, dims2, "dset3", H5T_NATIVE_INT, data3);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -2458,21 +2462,21 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file2 */
status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(fid2, 2, dims2, "dset3", H5T_NATIVE_INT, data3);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -2483,54 +2487,54 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file1 */
status = write_dset(gid1_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid2_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid2_f1, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid3_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid3_f1, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid3_f1, 2, dims2, "dset3", H5T_NATIVE_INT, data3);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid10_f1, 2, dims2, "dset4", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid10_f1, 2, dims2, "dset5", H5T_NATIVE_INT, data3);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -2538,54 +2542,54 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file2 */
status = write_dset(gid1_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid2_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid2_f2, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid3_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid3_f2, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid3_f2, 2, dims2, "dset3", H5T_NATIVE_INT, data3);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid11_f2, 2, dims2, "dset4", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid11_f2, 2, dims2, "dset5", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -2596,28 +2600,28 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file 1 */
status = H5Lcreate_soft("/grp1", fid1, "slink_grp1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/grp1/grp2", fid1, "slink_grp2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/grp1/grp2/grp3", fid1, "slink_grp3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/grp10", fid1, "slink_grp10", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -2625,28 +2629,28 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file 2 */
status = H5Lcreate_soft("/grp1", fid2, "slink_grp1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/grp1/grp2", fid2, "slink_grp2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/grp1/grp2/grp3", fid2, "slink_grp3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/grp11", fid2, "slink_grp11", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2657,21 +2661,21 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file1 */
status = H5Lcreate_external(fname2, "/grp1", fid1, "elink_grp1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/grp1/grp2", fid1, "elink_grp2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/grp1/grp2/grp3", fid1, "elink_grp3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -2679,21 +2683,21 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file2 */
status = H5Lcreate_external(fname1, "/grp1", fid2, "elink_grp1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname1, "/grp1/grp2", fid2, "elink_grp2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname1, "/grp1/grp2/grp3", fid2, "elink_grp3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2705,14 +2709,14 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file1 */
status = H5Lcreate_external(fname2, "/grp11", gid10_f1, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
/* file2 */
status = H5Lcreate_external(fname1, "/grp10", gid11_f2, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2786,28 +2790,28 @@ static int test_group_recurse2(void)
*------------------------------------------------------------------------*/
grp1 = H5Gcreate2(fileid1, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
status = FAIL;
goto out;
}
grp2 = H5Gcreate2(grp1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
status = FAIL;
goto out;
}
grp3 = H5Gcreate2(grp2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp3 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
status = FAIL;
goto out;
}
grp4 = H5Gcreate2(grp3, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp4 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
status = FAIL;
goto out;
}
@@ -2882,7 +2886,7 @@ static int test_group_recurse2(void)
/* link to dset1 */
status = H5Lcreate_soft(GRP_R_DSETNAME1, fileid1, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE1_EXT);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE1_EXT);
status = FAIL;
goto out;
}
@@ -2906,7 +2910,7 @@ static int test_group_recurse2(void)
*/
grp4 = H5Gcreate2(fileid4, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp4 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT3);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT3);
status = FAIL;
goto out;
}
@@ -2940,14 +2944,14 @@ static int test_group_recurse2(void)
*/
grp2 = H5Gcreate2(fileid3, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2);
status = FAIL;
goto out;
}
grp3 = H5Gcreate2(grp2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp3 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2);
status = FAIL;
goto out;
}
@@ -2971,7 +2975,7 @@ static int test_group_recurse2(void)
*/
status = H5Lcreate_external(GRP_RECURSE2_EXT3, "/g4", fileid3, "/g2/g3/g4", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT2);
status = FAIL;
goto out;
}
@@ -2992,7 +2996,7 @@ static int test_group_recurse2(void)
*/
grp1 = H5Gcreate2(fileid2, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
status = FAIL;
goto out;
}
@@ -3016,7 +3020,7 @@ static int test_group_recurse2(void)
/* link to dset1 */
status = H5Lcreate_soft(GRP_R_DSETNAME1, fileid2, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE2_EXT1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE2_EXT1);
status = FAIL;
goto out;
}
@@ -3026,7 +3030,7 @@ static int test_group_recurse2(void)
*/
status = H5Lcreate_external(GRP_RECURSE2_EXT2, "/g2", fileid2, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT1);
status = FAIL;
goto out;
}
@@ -3079,14 +3083,14 @@ static int test_exclude_obj1(const char *fname1, const char *fname2)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -3097,7 +3101,7 @@ static int test_exclude_obj1(const char *fname1, const char *fname2)
/* file1 */
gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3106,7 +3110,7 @@ static int test_exclude_obj1(const char *fname1, const char *fname2)
gid2 = H5Gcreate2(fid2, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -3117,21 +3121,21 @@ static int test_exclude_obj1(const char *fname1, const char *fname2)
/* file1 */
status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "dset2", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "dset3", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -3139,21 +3143,21 @@ static int test_exclude_obj1(const char *fname1, const char *fname2)
/* file2 */
status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid2, 2, dims2, "dset3", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -3200,14 +3204,14 @@ static int test_exclude_obj2(const char *fname1, const char *fname2)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -3218,7 +3222,7 @@ static int test_exclude_obj2(const char *fname1, const char *fname2)
/* file1 */
gid1 = H5Gcreate2(fid1, "group10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3226,7 +3230,7 @@ static int test_exclude_obj2(const char *fname1, const char *fname2)
/* file2 */
gid2 = H5Gcreate2(fid2, "group10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -3235,7 +3239,7 @@ static int test_exclude_obj2(const char *fname1, const char *fname2)
gid3 = H5Gcreate2(fid2, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid3 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -3246,21 +3250,21 @@ static int test_exclude_obj2(const char *fname1, const char *fname2)
/* file1 */
status = write_dset(fid1, 2, dims2, "dset10", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "dset2", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -3268,21 +3272,21 @@ static int test_exclude_obj2(const char *fname1, const char *fname2)
/* file2 */
status = write_dset(fid2, 2, dims2, "dset10", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid3, 2, dims2, "dset3", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -3328,14 +3332,14 @@ static int test_exclude_obj3(const char *fname1, const char *fname2)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -3346,7 +3350,7 @@ static int test_exclude_obj3(const char *fname1, const char *fname2)
/* file1 */
gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3357,14 +3361,14 @@ static int test_exclude_obj3(const char *fname1, const char *fname2)
/* file1 */
status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -3372,7 +3376,7 @@ static int test_exclude_obj3(const char *fname1, const char *fname2)
/* file2 */
status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -3694,7 +3698,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
if (is_file_new == 1) {
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3702,7 +3706,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
else {
fid1 = H5Fopen(fname1, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3713,7 +3717,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
*------------------------------------------------------------------------*/
gid = H5Gcreate2(fid1, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3723,7 +3727,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
*------------------------------------------------------------------------*/
sid_vlen_str = H5Screate_simple(STR_RANK, dims_vlen_str, NULL);
if (sid_vlen_str < 0) {
- fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3731,7 +3735,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
tid_vlen_str = H5Tcopy(H5T_C_S1);
status = H5Tset_size(tid_vlen_str, H5T_VARIABLE);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3741,7 +3745,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
*------------------------------------------------------------------------*/
sid_fixlen_str = H5Screate_simple(STR_RANK, dims_fixlen_str, NULL);
if (sid_fixlen_str < 0) {
- fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3749,7 +3753,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
tid_fixlen_str = H5Tcopy(H5T_C_S1);
status = H5Tset_size(tid_fixlen_str, FIXLEN_STR_SIZE);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3759,7 +3763,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
*------------------------------------------------------------------------*/
sid_vlen_str_array = H5Screate_simple(STR_RANK, dims_vlen_str_array, NULL);
if (sid_vlen_str_array < 0) {
- fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3767,7 +3771,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
tid_vlen_str_array_pre = H5Tcopy(H5T_C_S1);
status = H5Tset_size(tid_vlen_str_array_pre, H5T_VARIABLE);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3775,7 +3779,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
/* Create the array data type for the string array */
tid_vlen_str_array = H5Tarray_create2(tid_vlen_str_array_pre, COMP_RANK, dims_vlen_str_array);
if (tid_vlen_str_array < 0) {
- fprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3785,7 +3789,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
*------------------------------------------------------------------------*/
sid_fixlen_str_array = H5Screate_simple(STR_RANK, dims_fixlen_str_array, NULL);
if (sid_fixlen_str_array < 0) {
- fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3793,14 +3797,14 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
tid_fixlen_str_array_pre = H5Tcopy(H5T_C_S1);
status = H5Tset_size(tid_fixlen_str_array_pre, FIXLEN_STR_ARRY_SIZE);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
status = FAIL;
goto out;
}
/* Create the array data type for the string array */
tid_fixlen_str_array = H5Tarray_create2(tid_fixlen_str_array_pre, COMP_RANK, dims_fixlen_str_array);
if (tid_fixlen_str_array < 0) {
- fprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3810,7 +3814,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
*------------------------------------------------------------------------*/
sid_comp = H5Screate_simple(COMP_RANK, dims_comp, NULL);
if (sid_comp < 0) {
- fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3924,7 +3928,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset1", tid1_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid1_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp1_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3934,7 +3938,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset2", tid2_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid2_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp2_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3944,7 +3948,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset3", tid3_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid3_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp3_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3954,7 +3958,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset4", tid4_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid4_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp4_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3964,7 +3968,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset5", tid5_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid5_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp5_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3974,7 +3978,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset6", tid6_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid6_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp6_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3984,7 +3988,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset7", tid7_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid7_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp7_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3994,7 +3998,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset8", tid8_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid8_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp8_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -4010,7 +4014,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
status = H5Dwrite(did_comp, tid9_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp9_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -4132,14 +4136,14 @@ static int test_enums(const char *fname)
enum_val = 0;
status = H5Tenum_insert(tid, "YIN", &enum_val);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname);
+ HDfprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname);
status = FAIL;
goto out;
}
enum_val = 1;
status = H5Tenum_insert(tid, "YANG", &enum_val);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname);
+ HDfprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname);
status = FAIL;
goto out;
}
@@ -4150,13 +4154,13 @@ static int test_enums(const char *fname)
status = write_dset(fid, 1, &dims, "dset1", tid, data1);
if (status < 0) {
- fprintf(stderr, "Error: %s> write_dset failed.\n", fname);
+ HDfprintf(stderr, "Error: %s> write_dset failed.\n", fname);
status = FAIL;
goto out;
}
status = write_dset(fid, 1, &dims, "dset2", tid, data2);
if (status < 0) {
- fprintf(stderr, "Error: %s> write_dset failed.\n", fname);
+ HDfprintf(stderr, "Error: %s> write_dset failed.\n", fname);
status = FAIL;
goto out;
}
@@ -4790,7 +4794,7 @@ static void test_data_nocomparables(const char * fname, int make_diffs)
*------------------------------------------------------------------------*/
fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname);
status = FAIL;
goto out;
}
@@ -4800,14 +4804,14 @@ static void test_data_nocomparables(const char * fname, int make_diffs)
*------------------------------------------------------------------------*/
gid1 = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname);
status = FAIL;
goto out;
}
gid2 = H5Gcreate2(fid, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname);
status = FAIL;
goto out;
}
@@ -4820,13 +4824,13 @@ static void test_data_nocomparables(const char * fname, int make_diffs)
/* dset1 */
if ((did1 = H5Dcreate2(gid1, "dset1", tid_dset1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1");
+ HDfprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1");
status = FAIL;
goto out;
}
if (H5Dwrite(did1, tid_dset1, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr1) < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1");
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1");
status = FAIL;
goto out;
}
@@ -4835,7 +4839,7 @@ static void test_data_nocomparables(const char * fname, int make_diffs)
/* dset2 */
status = write_dset(gid1, 1, dims1_1, "dset2", H5T_NATIVE_INT, dset_data_ptr2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname);
goto out;
}
@@ -4845,13 +4849,13 @@ static void test_data_nocomparables(const char * fname, int make_diffs)
/* ---------
* dset1 */
if ((did2 = H5Dcreate2(gid2, "dset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1");
+ HDfprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1");
status = FAIL;
goto out;
}
if (H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr3) < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1");
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1");
status = FAIL;
goto out;
}
@@ -4871,7 +4875,7 @@ static void test_data_nocomparables(const char * fname, int make_diffs)
* dset2 */
status = write_dset(gid2, 1, dims1_1, "dset2", H5T_NATIVE_INT, dset_data_ptr3);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname);
goto out;
}
@@ -4906,9 +4910,9 @@ out:
* types.
* h5diff should show non-comparable output from these common objects.
*-------------------------------------------------------------------------*/
-static void test_objs_nocomparables(const char *fname1, const char *fname2)
+static void
+test_objs_nocomparables(const char *fname1, const char *fname2)
{
- herr_t status = SUCCEED;
hid_t fid1 = -1;
hid_t fid2 = -1;
hid_t topgid1 = -1;
@@ -4925,110 +4929,90 @@ static void test_objs_nocomparables(const char *fname1, const char *fname2)
* Open file(s) to add objects
*------------------------------------------------------------------------*/
/* file1 */
- fid1 = H5Fopen(fname1, H5F_ACC_RDWR, H5P_DEFAULT);
- if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1);
- status = FAIL;
- goto out;
- }
+ if((fid1 = H5Fopen(fname1, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
+ PROGRAM_ERROR
/* file2 */
- fid2 = H5Fopen(fname2, H5F_ACC_RDWR, H5P_DEFAULT);
- if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname2);
- status = FAIL;
- goto out;
- }
+ if((fid2 = H5Fopen(fname2, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
+ PROGRAM_ERROR
/*-----------------------------------------------------------------------
* in file1 : add member objects
*------------------------------------------------------------------------*/
/* parent group */
- topgid1 = H5Gcreate2(fid1, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (topgid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
- status = FAIL;
- goto out;
- }
+ if((topgid1 = H5Gcreate2(fid1, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ PROGRAM_ERROR
/* dataset */
- status = write_dset(topgid1, 1, dims, "obj1", H5T_NATIVE_INT, data1);
- if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
- goto out;
- }
+ if(write_dset(topgid1, 1, dims, "obj1", H5T_NATIVE_INT, data1) < 0)
+ PROGRAM_ERROR
/* group */
- gid1 = H5Gcreate2(topgid1, "obj2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
- status = FAIL;
- goto out;
- }
+ if((gid1 = H5Gcreate2(topgid1, "obj2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ PROGRAM_ERROR
/* committed type */
- tid1 = H5Tcopy(H5T_NATIVE_INT);
- status = H5Tcommit2(topgid1, "obj3", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1);
- goto out;
- }
+ if((tid1 = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ PROGRAM_ERROR
+ if(H5Tcommit2(topgid1, "obj3", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ PROGRAM_ERROR
/*-----------------------------------------------------------------------
* in file2 : add member objects
*------------------------------------------------------------------------*/
/* parent group */
- topgid2 = H5Gcreate2(fid2, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (topgid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
- status = FAIL;
- goto out;
- }
+ if((topgid2 = H5Gcreate2(fid2, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ PROGRAM_ERROR
/* group */
- gid2 = H5Gcreate2(topgid2, "obj1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
- status = FAIL;
- goto out;
- }
+ if((gid2 = H5Gcreate2(topgid2, "obj1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ PROGRAM_ERROR
/* committed type */
- tid2 = H5Tcopy(H5T_NATIVE_INT);
- status = H5Tcommit2(topgid2, "obj2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2);
- goto out;
- }
+ if((tid2 = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ PROGRAM_ERROR
+ if(H5Tcommit2(topgid2, "obj2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ PROGRAM_ERROR
/* dataset */
- status = write_dset(topgid2, 1, dims, "obj3", H5T_NATIVE_INT, data2);
- if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
- goto out;
- }
+ if(write_dset(topgid2, 1, dims, "obj3", H5T_NATIVE_INT, data2) < 0)
+ PROGRAM_ERROR
-out:
/*-----------------------------------------------------------------------
* Close IDs
*-----------------------------------------------------------------------*/
- if (fid1)
+ if(H5Fclose(fid1) < 0)
+ PROGRAM_ERROR
+ if(H5Fclose(fid2) < 0)
+ PROGRAM_ERROR
+ if(H5Gclose(topgid1) < 0)
+ PROGRAM_ERROR
+ if(H5Gclose(topgid2) < 0)
+ PROGRAM_ERROR
+ if(H5Gclose(gid1) < 0)
+ PROGRAM_ERROR
+ if(H5Gclose(gid2) < 0)
+ PROGRAM_ERROR
+ if(H5Tclose(tid1) < 0)
+ PROGRAM_ERROR
+ if(H5Tclose(tid2) < 0)
+ PROGRAM_ERROR
+
+ return;
+
+error:
+ H5E_BEGIN_TRY {
H5Fclose(fid1);
- if (fid2)
H5Fclose(fid2);
- if (topgid1)
H5Gclose(topgid1);
- if (topgid2)
H5Gclose(topgid2);
- if (gid1)
H5Gclose(gid1);
- if (gid2)
H5Gclose(gid2);
- if (tid1)
H5Tclose(tid1);
- if (tid2)
H5Tclose(tid2);
+ } H5E_END_TRY;
+ return;
}
static hid_t mkstr(int size, H5T_str_t pad)
@@ -5101,14 +5085,14 @@ static void test_objs_strings(const char *fname1, const char *fname2)
/* file1 */
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
goto out;
}
/* file2 */
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
goto out;
}
@@ -8083,36 +8067,40 @@ out:
*
*-------------------------------------------------------------------------
*/
-static
-int write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf)
+static herr_t
+write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf)
{
hid_t did = -1;
hid_t sid = -1;
/* create a space */
- if ((sid = H5Screate_simple(rank, dims, NULL)) < 0)
- goto out;
+ if((sid = H5Screate_simple(rank, dims, NULL)) < 0)
+ PROGRAM_ERROR
/* create the dataset */
- if ((did = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
+ if((did = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ PROGRAM_ERROR
/* write */
- if (buf) {
- if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
- goto out;
- }
+ if(buf)
+ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ PROGRAM_ERROR
/* close */
- H5Dclose(did);
- H5Sclose(sid);
+ if(H5Dclose(did) < 0)
+ PROGRAM_ERROR
+ if(H5Sclose(sid) < 0)
+ PROGRAM_ERROR
return SUCCEED;
-out:
+error:
+
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ H5Sclose(sid);
+ } H5E_END_TRY;
- H5Dclose(did);
- H5Sclose(sid);
return FAIL;
-}
+} /* end write_dset() */
diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt
index 51938ae..38f4118 100644
--- a/tools/test/h5dump/CMakeLists.txt
+++ b/tools/test/h5dump/CMakeLists.txt
@@ -5,15 +5,15 @@ project (HDF5_TOOLS_TEST_H5DUMP C)
# If plugin library tests can be tested
#-----------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
- set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdump")
- set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
- set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
+ set (H5DUMP_TOOL_PLUGIN_LIB_CORENAME "dynlibdump")
+ set (H5DUMP_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5DUMP_TOOL_PLUGIN_LIB_CORENAME}")
+ set (H5DUMP_TOOL_PLUGIN_LIB_TARGET ${H5DUMP_TOOL_PLUGIN_LIB_CORENAME})
- add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c)
- target_include_directories(${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIB_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
+ add_library (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c)
+ target_include_directories (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} ${H5DUMP_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
# make plugins dir
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
@@ -21,26 +21,26 @@ if (BUILD_SHARED_LIBS)
# Copy plugin library to a plugins folder
#-----------------------------------------------------------------------------
add_custom_command (
- TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET}
+ TARGET ${H5DUMP_TOOL_PLUGIN_LIB_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
+ "$<TARGET_FILE:${H5DUMP_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5DUMP_TOOL_PLUGIN_LIB_TARGET}>"
)
endif ()
# --------------------------------------------------------------------
# Add the h5dump test executable
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5dumpgentest ${HDF5_TOOLS_TEST_H5DUMP_SOURCE_DIR}/h5dumpgentest.c)
- target_include_directories(h5dumpgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5dumpgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5dumpgentest STATIC)
- target_link_libraries (h5dumpgentest PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_link_libraries (h5dumpgentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>)
+ #add_test (NAME h5dumpgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dumpgentest>)
endif ()
include (CMakeTests.cmake)
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index 126d972..8f6fe45 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -318,6 +318,7 @@
${HDF5_TOOLS_DIR}/testfiles/tvlenstr_array.h5
${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5
${HDF5_TOOLS_DIR}/testfiles/tvms.h5
+ ${HDF5_TOOLS_DIR}/testfiles/t128bit_float.h5
${HDF5_TOOLS_DIR}/testfiles/zerodim.h5
)
set (HDF5_ERROR_REFERENCE_TEST_FILES
@@ -359,12 +360,7 @@
endforeach ()
foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES})
- if (WIN32)
- file (READ ${HDF5_TOOLS_DIR}/testfiles/${tst_exp_file} TEST_STREAM)
- file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}")
- else ()
- HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${tst_exp_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file}" "h5dump_std_files")
- endif ()
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${tst_exp_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file}" "h5dump_std_files")
endforeach ()
foreach (tst_other_file ${HDF5_REFERENCE_FILES})
@@ -385,9 +381,10 @@
# --------------------------------------------------------------------
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbin1.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl" "h5dump_std_files")
- if (WIN32)
- file (READ ${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp TEST_STREAM)
- file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}")
+ if (WIN32 OR MINGW)
+ configure_file(${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp NEWLINE_STYLE CRLF)
+ #file (READ ${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp TEST_STREAM)
+ #file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}")
else ()
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp" "${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp" "h5dump_std_files")
endif ()
@@ -399,31 +396,27 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_HELP_TEST testname resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${testname} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
+ add_test (NAME H5DUMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "H5DUMP-${testname}")
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/std/h5dump-${testname}.out
- testfiles/std/h5dump-${testname}.out.err
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5DUMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=h5dump-${testname}.out"
@@ -431,7 +424,9 @@
-D "TEST_REFERENCE=h5dump-${testname}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS H5DUMP-${testname}-clear-objects)
+ if (last_test)
+ set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test})
+ endif ()
endif ()
endmacro ()
@@ -452,28 +447,25 @@
macro (ADD_H5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
add_test (
NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.bin
- ${resultfile}.out
- ${resultfile}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.bin
)
set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -488,28 +480,25 @@
macro (ADD_H5_TEST_N resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-N-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
+ add_test (NAME H5DUMP-N-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
add_test (
NAME H5DUMP-N-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}-N.bin
- ${resultfile}-N.out
- ${resultfile}-N.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}-N.bin
)
set_tests_properties (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-N-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}-N.out"
@@ -524,28 +513,25 @@
macro (ADD_H5_TEST_EXPORT resultfile targetfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${resultfile}.txt ${targetfile})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
add_test (
NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.txt
- ${resultfile}.out
- ${resultfile}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt
)
set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${resultfile}.txt;${targetfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -554,42 +540,41 @@
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
- add_test (
- NAME H5DUMP-${resultfile}-output-cmp
- COMMAND ${CMAKE_COMMAND}
- -E compare_files ${resultfile}.txt ${resultfile}.exp
- )
- set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile})
+ if(NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ add_test (
+ NAME H5DUMP-${resultfile}-output-cmp
+ COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${resultfile}.txt ${resultfile}.exp
+ )
+ set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile})
+ endif ()
endif ()
endmacro ()
macro (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
add_test (
NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
${ddlfile}.txt
${resultfile}.txt
- ${resultfile}.out
- ${resultfile}.out.err
)
set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=--ddl=${ddlfile}.txt;${ARGN};${resultfile}.txt;${targetfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -598,20 +583,20 @@
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
- add_test (
- NAME H5DUMP-${resultfile}-output-cmp
- COMMAND ${CMAKE_COMMAND}
- -E compare_files ${resultfile}.txt ${resultfile}.exp
- )
- set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile})
- add_test (
- NAME H5DUMP-${resultfile}-output-cmp-ddl
- COMMAND ${CMAKE_COMMAND}
- -E compare_files ${ddlfile}.txt ${ddlfile}.exp
- )
- set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp)
+ if(NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ add_test (
+ NAME H5DUMP-${resultfile}-output-cmp
+ COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${resultfile}.txt ${resultfile}.exp
+ )
+ set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile})
+ add_test (
+ NAME H5DUMP-${resultfile}-output-cmp-ddl
+ COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${ddlfile}.txt ${ddlfile}.exp
+ )
+ set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp)
+ endif ()
endif ()
endmacro ()
@@ -619,41 +604,33 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5DUMP-output-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove ${resultfile}.txt
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt
)
set_tests_properties (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-output-${resultfile}
- COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${resultfile}.txt ${targetfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile}
)
set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects)
- add_test (
- NAME H5DUMP-output-cmp-${resultfile}
- COMMAND ${CMAKE_COMMAND}
- -E compare_files ${resultfile}.txt ${resultfile}.exp
- )
- set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile})
+ if(NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ add_test (
+ NAME H5DUMP-output-cmp-${resultfile}
+ COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${resultfile}.txt ${resultfile}.exp
+ )
+ set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile})
+ endif ()
endif ()
endmacro ()
macro (ADD_H5_MASK_TEST resultfile resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -662,65 +639,61 @@
-D "TEST_MASK_ERROR=true"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif ()
endmacro ()
- macro (ADD_H5ERR_MASK_TEST resultfile resultcode)
+ macro (ADD_H5_GREP_TEST resultfile resultcode result_check)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
add_test (
- NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
+ NAME H5DUMP-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${result_check}"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5ERR_MASK_TEST resultfile resultcode result_errcheck)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ddl"
- -D "TEST_ERRREF=${resultfile}.err"
- -D "TEST_MASK_ERROR=true"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ -D "TEST_ERRREF=${result_errcheck}"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif ()
endmacro ()
- macro (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval)
+ macro (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode result_errcheck envvar envval)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ddl"
- -D "TEST_ERRREF=${resultfile}.err"
- -D "TEST_MASK_ERROR=true"
+ -D "TEST_ERRREF=${result_errcheck}"
-D "TEST_ENV_VAR:STRING=${envvar}"
-D "TEST_ENV_VALUE:STRING=${envval}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif ()
endmacro ()
@@ -729,17 +702,16 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5DUMP-IMPORT-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
${resultfile}.bin
${resultfile}.h5
- ${conffile}.out
)
set_tests_properties (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-IMPORT-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};-o;${resultfile}.bin;${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${conffile}.out"
@@ -748,10 +720,10 @@
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects")
- add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND $<TARGET_FILE:h5import> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5)
+ add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5)
set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile})
- add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${testfile} ${resultfile}.h5 /integer /integer)
+ add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff> ${testfile} ${resultfile}.h5 /integer /integer)
set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile})
endif ()
@@ -759,19 +731,11 @@
macro (ADD_H5_UD_TEST testname resultcode resultfile)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP_UD-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5DUMP_UD-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -779,9 +743,9 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clear-objects)
endif ()
endmacro ()
@@ -791,368 +755,6 @@
##############################################################################
##############################################################################
- if (HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- h5dump-help.out
- charsets.out
- charsets.out.err
- file_space.out
- file_space.out.err
- filter_fail.out
- filter_fail.out.err
- non_existing.out
- non_existing.out.err
- packedbits.out
- packedbits.out.err
- tall-1.out
- tall-1.out.err
- tall-2.out
- tall-2.out.err
- tall-2A.out
- tall-2A.out.err
- tall-2A0.out
- tall-2A0.out.err
- tall-2B.out
- tall-2B.out.err
- tall-3.out
- tall-3.out.err
- tall-4s.out
- tall-4s.out.err
- tall-5s.out
- tall-5s.out.err
- tall-6.txt
- tall-6.out
- tall-6.out.err
- tall-7.out
- tall-7.out.err
- tall-7N.out
- tall-7N.out.err
- tallfilters.out
- tallfilters.out.err
- tarray1.out
- tarray1.out.err
- tarray1_big.out
- tarray1_big.out.err
- tarray2.out
- tarray2.out.err
- tarray3.out
- tarray3.out.err
- tarray4.out
- tarray4.out.err
- tarray5.out
- tarray5.out.err
- tarray6.out
- tarray6.out.err
- tarray7.out
- tarray7.out.err
- tarray8.out
- tarray8.out.err
- tattr-1.out
- tattr-1.out.err
- tattr-2.out
- tattr-2.out.err
- tattr-3.out
- tattr-3.out.err
- tattr-4_be.out
- tattr-4_be.out.err
- tattrcontents1.out
- tattrcontents1.out.err
- tattrcontents2.out
- tattrcontents2.out.err
- tattrintsize.out
- tattrintsize.out.err
- tattrreg.out
- tattrreg.out.err
- tattrregR.out
- tattrregR.out.err
- tbin1LE.bin
- tbinregR.txt
- tbinregR.out
- tbinregR.out.err
- tbigdims.out
- tbigdims.out.err
- tbitnopaque_be.out
- tbitnopaque_be.out.err
- tbitnopaque_le.out
- tbitnopaque_le.out.err
- tboot1.out
- tboot1.out.err
- tboot2.out
- tboot2.out.err
- tboot2A.out
- tboot2A.out.err
- tboot2B.out
- tboot2B.out.err
- tchar1.out
- tchar1.out.err
- tchunked.out
- tchunked.out.err
- tcmpdattrintsize.out
- tcmpdattrintsize.out.err
- tcmpdintarray.out
- tcmpdintarray.out.err
- tcmpdints.out
- tcmpdints.out.err
- tcmpdintsize.out
- tcmpdintsize.out.err
- tcomp-1.out
- tcomp-1.out.err
- tcomp-2.out
- tcomp-2.out.err
- tcomp-3.out
- tcomp-3.out.err
- tcomp-4.out
- tcomp-4.out.err
- tcompact.out
- tcompact.out.err
- tcompound_complex.out
- tcompound_complex.out.err
- tcontents.out
- tcontents.out.err
- tcontiguos.out
- tcontiguos.out.err
- tdatareg.out
- tdatareg.out.err
- tdataregR.out
- tdataregR.out.err
- tdeflate.out
- tdeflate.out.err
- tdset-1.out
- tdset-1.out.err
- tdset-2.out
- tdset-2.out.err
- tdset-3s.out
- tdset-3s.out.err
- tempty.out
- tempty.out.err
- texternal.out
- texternal.out.err
- textlinksrc.out
- textlinksrc.out.err
- textlinkfar.out
- textlinkfar.out.err
- textlink.out
- textlink.out.err
- tfamily.out
- tfamily.out.err
- tfill.out
- tfill.out.err
- tfletcher32.out
- tfletcher32.out.err
- tfpformat.out
- tfpformat.out.err
- tgroup-1.out
- tgroup-1.out.err
- tgroup-2.out
- tgroup-2.out.err
- tgrp_comments.out
- tgrp_comments.out.err
- tgrpnullspace.out
- tgrpnullspace.out.err
- thlink-1.out
- thlink-1.out.err
- thlink-2.out
- thlink-2.out.err
- thlink-3.out
- thlink-3.out.err
- thlink-4.out
- thlink-4.out.err
- thlink-5.out
- thlink-5.out.err
- thyperslab.out
- thyperslab.out.err
- tindicesno.out
- tindicesno.out.err
- tindicessub1.out
- tindicessub1.out.err
- tindicessub2.out
- tindicessub2.out.err
- tindicessub3.out
- tindicessub3.out.err
- tindicessub4.out
- tindicessub4.out.err
- texceedsubstart.out
- texceedsubstart.out.err
- texceedsubcount.out
- texceedsubcount.out.err
- texceedsubstride.out
- texceedsubstride.out.err
- texceedsubblock.out
- texceedsubblock.out.err
- tindicesyes.out
- tindicesyes.out.err
- tints4dims.out
- tints4dims.out.err
- tints4dimsBlock2.out
- tints4dimsBlock2.out.err
- tints4dimsBlockEq.out
- tints4dimsBlockEq.out.err
- tints4dimsCount2.out
- tints4dimsCount2.out.err
- tints4dimsCountEq.out
- tints4dimsCountEq.out.err
- tints4dimsStride2.out
- tints4dimsStride2.out.err
- tintsattrs.out
- tintsattrs.out.err
- tintsnodata.out
- tintsnodata.out.err
- tlarge_objname.out
- tlarge_objname.out.err
- tldouble.out
- tldouble.out.err
- tlonglinks.out
- tlonglinks.out.err
- tloop-1.out
- tloop-1.out.err
- tmulti.out
- tmulti.out.err
- tmultifile.out
- tmultifile.out.err
-# tqmarkfile.out
-# tqmarkfile.out.err
-# tstarfile.out
-# tstarfile.out.err
- tnamed_dtype_attr.out
- tnamed_dtype_attr.out.err
- tnbit.out
- tnbit.out.err
- tnestcomp-1.out
- tnestcomp-1.out.err
- tnestedcmpddt.out
- tnestedcmpddt.out.err
- tnoattrdata.out
- tnoattrdata.out.err
- tnoattrddl.out
- tnoattrddl.out.err
- tnodata.out
- tnodata.out.err
- tnoddl.out
- tnoddl.out.err
- tnoddlfile.out
- tnoddlfile.out.err
- tno-subset.out
- tno-subset.out.err
- tnullspace.out
- tnullspace.out.err
- tordergr1.out
- tordergr1.out.err
- tordergr2.out
- tordergr2.out.err
- tordergr3.out
- tordergr3.out.err
- tordergr4.out
- tordergr4.out.err
- tordergr5.out
- tordergr5.out.err
- torderattr1.out
- torderattr1.out.err
- torderattr2.out
- torderattr2.out.err
- torderattr3.out
- torderattr3.out.err
- torderattr4.out
- torderattr4.out.err
- tordercontents1.out
- tordercontents1.out.err
- tordercontents2.out
- tordercontents2.out.err
- torderlinks1.out
- torderlinks1.out.err
- torderlinks2.out
- torderlinks2.out.err
- tperror.out
- tperror.out.err
- trawdatafile.out
- trawdatafile.out.err
- trawdatafile.txt
- trawssetfile.out
- trawssetfile.out.err
- trawssetfile.txt
- treadfilter.out
- treadfilter.out.err
- treadintfilter.out
- treadintfilter.out.err
- treference.out
- treference.out.err
- tsaf.out
- tsaf.out.err
- tscalarattrintsize.out
- tscalarattrintsize.out.err
- tscalarintattrsize.out
- tscalarintattrsize.out.err
- tscalarintsize.out
- tscalarintsize.out.err
- tscalarstring.out
- tscalarstring.out.err
- tscaleoffset.out
- tscaleoffset.out.err
- tshuffle.out
- tshuffle.out.err
- tslink-1.out
- tslink-1.out.err
- tslink-2.out
- tslink-2.out.err
- tslink-D.out
- tslink-D.out.err
- tsplit_file.out
- tsplit_file.out.err
- tstr-1.out
- tstr-1.out.err
- tstr-2.out
- tstr-2.out.err
- tstr2bin2.txt
- tstr2bin6.txt
- tstring.out
- tstring.out.err
- tstring2.out
- tstring2.out.err
- tstringe.out
- tstringe.out.err
- tszip.out
- tszip.out.err
- tudlink-1.out
- tudlink-1.out.err
- tudlink-2.out
- tudlink-2.out.err
- tuserfilter.out
- tuserfilter.out.err
- tvldtypes1.out
- tvldtypes1.out.err
- tvldtypes2.out
- tvldtypes2.out.err
- tvldtypes3.out
- tvldtypes3.out.err
- tvldtypes4.out
- tvldtypes4.out.err
- tvldtypes5.out
- tvldtypes5.out.err
- tvlenstr_array.out
- tvlenstr_array.out.err
- tvlstr.out
- tvlstr.out.err
- tvms.out
- tvms.out.err
- twidedisplay.out
- twidedisplay.out.err
- twithddl.txt
- twithddlfile.out
- twithddlfile.out.err
- twithddlfile.txt
- zerodim.out
- zerodim.out.err
- )
- set_tests_properties (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5DUMP-clearall-objects")
- endif ()
-
ADD_HELP_TEST(help 0 -h)
# test data output redirection
@@ -1197,12 +799,12 @@
# test for displaying groups
ADD_H5_TEST (tgroup-1 0 --enable-error-stack tgroup.h5)
# test for displaying the selected groups
- ADD_H5ERR_MASK_TEST (tgroup-2 1 --enable-error-stack --group=/g2 --group / -g /y tgroup.h5)
+ ADD_H5ERR_MASK_TEST (tgroup-2 1 "h5dump error: unable to open group \"/y\"" --enable-error-stack --group=/g2 --group / -g /y tgroup.h5)
# test for displaying simple space datasets
ADD_H5_TEST (tdset-1 0 --enable-error-stack tdset.h5)
# test for displaying selected datasets
- ADD_H5ERR_MASK_TEST (tdset-2 1 --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5)
+ ADD_H5ERR_MASK_TEST (tdset-2 1 "h5dump error: unable to get link info from \"dset3\"" --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5)
# test for displaying attributes
ADD_H5_TEST (tattr-1 0 --enable-error-stack tattr.h5)
@@ -1210,7 +812,7 @@
ADD_H5_TEST (tattr-2 0 --enable-error-stack -a /\\\\/attr1 --attribute /attr4 --attribute=/attr5 tattr.h5)
ADD_H5_TEST_N (tattr-2 0 --enable-error-stack -N /\\\\/attr1 --any_path /attr4 --any_path=/attr5 tattr.h5)
# test for header and error messages
- ADD_H5ERR_MASK_TEST (tattr-3 1 --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5)
+ ADD_H5ERR_MASK_TEST (tattr-3 1 "h5dump error: unable to open attribute \"attr\"" --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5)
# test for displaying at least 9 attributes on root from a be machine
ADD_H5_TEST (tattr-4_be 0 --enable-error-stack tattr4_be.h5)
# test for displaying attributes in shared datatype (also in group and dataset)
@@ -1224,7 +826,7 @@
ADD_H5_TEST_N (tslink-2 0 --enable-error-stack -N slink2 tslink.h5)
ADD_H5_TEST (tudlink-2 0 --enable-error-stack -l udlink2 tudlink.h5)
# test for displaying dangling soft links
- ADD_H5ERR_MASK_TEST (tslink-D 0 --enable-error-stack -d /slink1 tslink.h5)
+ ADD_H5ERR_MASK_TEST (tslink-D 0 "component not found" --enable-error-stack -d /slink1 tslink.h5)
# tests for hard links
ADD_H5_TEST (thlink-1 0 --enable-error-stack thlink.h5)
@@ -1241,7 +843,7 @@
ADD_H5_TEST (tcomp-2 0 --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5)
ADD_H5_TEST_N (tcomp-2 0 --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5)
# test for unamed type
- ADD_H5ERR_MASK_TEST (tcomp-3 0 "--enable-error-stack;-t;/#6632;-g;/group2;tcompound.h5")
+ ADD_H5ERR_MASK_TEST (tcomp-3 0 "object '#6632' doesn't exist" "--enable-error-stack;-t;/#6632;-g;/group2;tcompound.h5")
# test complicated compound datatype
ADD_H5_TEST (tcomp-4 0 --enable-error-stack tcompound_complex.h5)
ADD_H5_TEST (tcompound_complex2 0 --enable-error-stack tcompound_complex2.h5)
@@ -1257,7 +859,7 @@
ADD_H5_TEST (tnestedcmpddt 0 --enable-error-stack tnestedcmpddt.h5)
# test for options
- ADD_H5ERR_MASK_TEST (tall-1 0 --enable-error-stack tall.h5)
+ ADD_H5ERR_MASK_TEST (tall-1 0 "unable to open external file, external link file name = 'somefile'" --enable-error-stack tall.h5)
ADD_H5_TEST (tall-2 0 --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5)
ADD_H5_TEST (tall-3 0 --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5)
ADD_H5_TEST_N (tall-3 0 --enable-error-stack -N /g2/dset2.1 -N /g1/g1.2/g1.2.1/slink tall.h5)
@@ -1288,7 +890,7 @@
# test for files with array data
ADD_H5_TEST (tarray1 0 --enable-error-stack tarray1.h5)
# # added for bug# 2092 - tarray1_big.h5
- ADD_H5ERR_MASK_TEST (tarray1_big 0 --enable-error-stack -R tarray1_big.h5)
+ ADD_H5ERR_MASK_TEST (tarray1_big 0 "Undefined reference pointer" --enable-error-stack -R tarray1_big.h5)
ADD_H5_TEST (tarray2 0 --enable-error-stack tarray2.h5)
ADD_H5_TEST (tarray3 0 --enable-error-stack tarray3.h5)
ADD_H5_TEST (tarray4 0 --enable-error-stack tarray4.h5)
@@ -1317,13 +919,13 @@
ADD_H5_TEST (tlarge_objname 0 --enable-error-stack -w157 tlarge_objname.h5)
# test '-A' to suppress data but print attr's
- ADD_H5ERR_MASK_TEST (tall-2A 0 --enable-error-stack -A tall.h5)
+ ADD_H5ERR_MASK_TEST (tall-2A 0 "unable to open external file, external link file name = 'somefile'" --enable-error-stack -A tall.h5)
# test '-A' to suppress attr's but print data
- ADD_H5ERR_MASK_TEST (tall-2A0 0 --enable-error-stack -A 0 tall.h5)
+ ADD_H5ERR_MASK_TEST (tall-2A0 0 "unable to open external file, external link file name = 'somefile'" --enable-error-stack -A 0 tall.h5)
# test '-r' to print attributes in ASCII instead of decimal
- ADD_H5ERR_MASK_TEST (tall-2B 0 --enable-error-stack -A -r tall.h5)
+ ADD_H5ERR_MASK_TEST (tall-2B 0 "unable to open external file, external link file name = 'somefile'" --enable-error-stack -A -r tall.h5)
# test Subsetting
ADD_H5_TEST (tall-4s 0 --enable-error-stack --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5)
@@ -1352,7 +954,7 @@
ADD_H5_TEST (file_space 0 --enable-error-stack -B file_space.h5)
# test -p with a non existing dataset
- ADD_H5ERR_MASK_TEST (tperror 1 --enable-error-stack -p -d bogus tfcontents1.h5)
+ ADD_H5ERR_MASK_TEST (tperror 1 "h5dump error: unable to get link info from \"bogus\"" --enable-error-stack -p -d bogus tfcontents1.h5)
# test for file contents
ADD_H5_TEST (tcontents 0 --enable-error-stack -n tfcontents1.h5)
@@ -1499,9 +1101,9 @@
# test for dataset region references
ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5)
- ADD_H5ERR_MASK_TEST (tdataregR 0 --enable-error-stack -R tdatareg.h5)
+ ADD_H5ERR_MASK_TEST (tdataregR 0 "Undefined reference pointer" --enable-error-stack -R tdatareg.h5)
ADD_H5_TEST (tattrreg 0 --enable-error-stack tattrreg.h5)
- ADD_H5ERR_MASK_TEST (tattrregR 0 -R --enable-error-stack tattrreg.h5)
+ ADD_H5ERR_MASK_TEST (tattrregR 0 "Undefined reference pointer" -R --enable-error-stack tattrreg.h5)
ADD_H5_EXPORT_TEST (tbinregR tdatareg.h5 0 --enable-error-stack -d /Dataset1 -s 0 -R -y -o)
# tests for group creation order
@@ -1519,21 +1121,21 @@
ADD_H5_TEST (torderattr4 0 --enable-error-stack -H --sort_by=creation_order --sort_order=descending torderattr.h5)
# tests for link references and order
- ADD_H5ERR_MASK_TEST (torderlinks1 0 --enable-error-stack --sort_by=name --sort_order=ascending tfcontents1.h5)
- ADD_H5ERR_MASK_TEST (torderlinks2 0 --enable-error-stack --sort_by=name --sort_order=descending tfcontents1.h5)
+ ADD_H5ERR_MASK_TEST (torderlinks1 0 "unable to open external file, external link file name = 'fname'" --enable-error-stack --sort_by=name --sort_order=ascending tfcontents1.h5)
+ ADD_H5ERR_MASK_TEST (torderlinks2 0 "unable to open external file, external link file name = 'fname'" --enable-error-stack --sort_by=name --sort_order=descending tfcontents1.h5)
# tests for floating point user defined printf format
ADD_H5_TEST (tfpformat 0 --enable-error-stack -m %.7f tfpformat.h5)
# tests for traversal of external links
- ADD_H5ERR_MASK_TEST (textlinksrc 0 --enable-error-stack textlinksrc.h5)
- ADD_H5ERR_MASK_TEST (textlinkfar 0 --enable-error-stack textlinkfar.h5)
+ ADD_H5ERR_MASK_TEST (textlinksrc 0 "Too many soft links in path" --enable-error-stack textlinksrc.h5)
+ ADD_H5ERR_MASK_TEST (textlinkfar 0 "Too many soft links in path" --enable-error-stack textlinkfar.h5)
# test for dangling external links
- ADD_H5ERR_MASK_TEST (textlink 0 --enable-error-stack textlink.h5)
+ ADD_H5ERR_MASK_TEST (textlink 0 "unable to open external file, external link file name = 'anotherfile'" --enable-error-stack textlink.h5)
# test for error stack display (BZ2048)
- ADD_H5ERR_MASK_ENV_TEST (filter_fail 1 "HDF5_PLUGIN_PRELOAD" "::" --enable-error-stack filter_fail.h5)
+ ADD_H5ERR_MASK_ENV_TEST (filter_fail 1 "filter plugins disabled" "HDF5_PLUGIN_PRELOAD" "::" --enable-error-stack filter_fail.h5)
# test for -o -y for dataset with attributes
ADD_H5_TEST_EXPORT (tall-6 tall.h5 0 --enable-error-stack -d /g1/g1.1/dset1.1.1 -y -o)
@@ -1541,9 +1143,22 @@
# test for non-existing file
ADD_H5_TEST (non_existing 1 --enable-error-stack tgroup.h5 non_existing.h5)
+ # test to verify HDFFV-9407: long double full precision
+ ADD_H5_GREP_TEST (t128bit_float 1 "1.123456789012345" -m %.35Lf t128bit_float.h5)
+
##############################################################################
### P L U G I N T E S T S
##############################################################################
if (BUILD_SHARED_LIBS)
ADD_H5_UD_TEST (h5dump_plugin_test 0 tudfilter --enable-error-stack tudfilter.h5)
endif ()
+
+##############################################################################
+##############################################################################
+### V F D T E S T S ###
+##############################################################################
+##############################################################################
+
+if (HDF5_TEST_VFD)
+ include (CMakeVFDTests.cmake)
+endif ()
diff --git a/tools/test/h5dump/CMakeTestsPBITS.cmake b/tools/test/h5dump/CMakeTestsPBITS.cmake
index 4f3ee9f..a6be9ae 100644
--- a/tools/test/h5dump/CMakeTestsPBITS.cmake
+++ b/tools/test/h5dump/CMakeTestsPBITS.cmake
@@ -119,31 +119,29 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_H5_PBITS_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits")
- if (NOT ${resultcode} STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_pbits_test}" STREQUAL "")
+ if (last_pbits_test)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/pbits"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -151,7 +149,6 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS H5DUMP-${resultfile}-clear-objects)
endif ()
endmacro ()
@@ -161,126 +158,6 @@
##############################################################################
##############################################################################
- if (HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP_PACKED_BITS-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- tnofilename-with-packed-bits.out
- tnofilename-with-packed-bits.out.err
- tpbitsArray.out
- tpbitsArray.out.err
- tpbitsCompound.out
- tpbitsCompound.out.err
- tpbitsIncomplete.out
- tpbitsIncomplete.out.err
- tpbitsLengthExceeded.out
- tpbitsLengthExceeded.out.err
- tpbitsCharLengthExceeded.out
- tpbitsCharLengthExceeded.out.err
- tpbitsIntLengthExceeded.out
- tpbitsIntLengthExceeded.out.err
- tpbitsLongLengthExceeded.out
- tpbitsLongLengthExceeded.out.err
- tpbitsLengthPositive.out
- tpbitsLengthPositive.out.err
- tpbitsMax.out
- tpbitsMax.out.err
- tpbitsMaxExceeded.out
- tpbitsMaxExceeded.out.err
- tpbitsOffsetExceeded.out
- tpbitsOffsetExceeded.out.err
- tpbitsCharOffsetExceeded.out
- tpbitsCharOffsetExceeded.out.err
- tpbitsIntOffsetExceeded.out
- tpbitsIntOffsetExceeded.out.err
- tpbitsLongOffsetExceeded.out
- tpbitsLongOffsetExceeded.out.err
- tpbitsOffsetNegative.out
- tpbitsOffsetNegative.out.err
- tpbitsOverlapped.out
- tpbitsOverlapped.out.err
- tpbitsSigned.out
- tpbitsSigned.out.err
- tpbitsUnsigned.out
- tpbitsUnsigned.out.err
- tpbitsSignedInt.out
- tpbitsSignedInt.out.err
- tpbitsUnsignedInt.out
- tpbitsUnsignedInt.out.err
- tpbitsSignedLong.out
- tpbitsSignedLong.out.err
- tpbitsUnsignedLong.out
- tpbitsUnsignedLong.out.err
- tpbitsSignedLongLong.out
- tpbitsSignedLongLong.out.err
- tpbitsUnsignedLongLong.out
- tpbitsUnsignedLongLong.out.err
- tpbitsSignedWhole.out
- tpbitsSignedWhole.out.err
- tpbitsUnsignedWhole.out
- tpbitsUnsignedWhole.out.err
- tpbitsSignedIntWhole.out
- tpbitsSignedIntWhole.out.err
- tpbitsUnsignedIntWhole.out
- tpbitsUnsignedIntWhole.out.err
- tpbitsSignedLongWhole.out
- tpbitsSignedLongWhole.out.err
- tpbitsUnsignedLongWhole.out
- tpbitsUnsignedLongWhole.out.err
- tpbitsSignedLongLongWhole.out
- tpbitsSignedLongLongWhole.out.err
- tpbitsUnsignedLongLongWhole.out
- tpbitsUnsignedLongLongWhole.out.err
- tpbitsSignedLongLongWhole1.out
- tpbitsSignedLongLongWhole1.out.err
- tpbitsUnsignedLongLongWhole1.out
- tpbitsUnsignedLongLongWhole1.out.err
- tpbitsSignedLongLongWhole63.out
- tpbitsSignedLongLongWhole63.out.err
- tpbitsUnsignedLongLongWhole63.out
- tpbitsUnsignedLongLongWhole63.out.err
- tpbitsSigned4.out
- tpbitsSigned4.out.err
- tpbitsUnsigned4.out
- tpbitsUnsigned4.out.err
- tpbitsSignedInt8.out
- tpbitsSignedInt8.out.err
- tpbitsUnsignedInt8.out
- tpbitsUnsignedInt8.out.err
- tpbitsSignedLong16.out
- tpbitsSignedLong16.out.err
- tpbitsUnsignedLong16.out
- tpbitsUnsignedLong16.out.err
- tpbitsSignedLongLong32.out
- tpbitsSignedLongLong32.out.err
- tpbitsUnsignedLongLong32.out
- tpbitsUnsignedLongLong32.out.err
- tpbitsSigned2.out
- tpbitsSigned2.out.err
- tpbitsUnsigned2.out
- tpbitsUnsigned2.out.err
- tpbitsSignedInt4.out
- tpbitsSignedInt4.out.err
- tpbitsUnsignedInt4.out
- tpbitsUnsignedInt4.out.err
- tpbitsSignedLong8.out
- tpbitsSignedLong8.out.err
- tpbitsUnsignedLong8.out
- tpbitsUnsignedLong8.out.err
- tpbitsSignedLongLong16.out
- tpbitsSignedLongLong16.out.err
- tpbitsUnsignedLongLong16.out
- tpbitsUnsignedLongLong16.out.err
- )
- set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits")
- if (NOT "${last_pbits_test}" STREQUAL "")
- set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test})
- endif ()
- set (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects")
- endif ()
-
# test failure handling
# Missing file name
ADD_H5_PBITS_TEST (tnofilename-with-packed-bits 1 --enable-error-stack)
diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake
index 922e79e..036609c 100644
--- a/tools/test/h5dump/CMakeTestsVDS.cmake
+++ b/tools/test/h5dump/CMakeTestsVDS.cmake
@@ -115,31 +115,29 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_H5_VDS_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_vds_test}" STREQUAL "")
+ if (last_vds_test)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -147,38 +145,29 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS H5DUMP-${resultfile}-clear-objects)
endif ()
endmacro ()
macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
+ add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES
ENVIRONMENT "HDF5_VDS_PREFIX=${PROJECT_BINARY_DIR}/testfiles/vds/"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix"
)
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_vds_test}" STREQUAL "")
+ if (last_vds_test)
set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_VDS_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP_PREFIX-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5DUMP_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix")
add_test (
NAME H5DUMP_PREFIX-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -188,35 +177,26 @@
-D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/testfiles/vds/"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS H5DUMP_PREFIX-${resultfile}-clear-objects)
endif ()
endmacro ()
macro (ADD_H5_VDS_LAYOUT resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> -p ${ARGN})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> -p ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_vds_test}" STREQUAL "")
+ if (last_vds_test)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-p;${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -224,7 +204,6 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif ()
endmacro ()
@@ -234,54 +213,6 @@
##############################################################################
##############################################################################
- if (HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP_VDS-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- tvds-1.out
- tvds-1.out.err
- tvds-2.out
- tvds-2.out.err
- tvds-3_1.out
- tvds-3_1.out.err
- tvds-3_2.out
- tvds-3_2.out.err
- tvds-4.out
- tvds-4.out.err
- tvds-5.out
- tvds-5.out.err
- vds-first.out
- vds-first.out.err
- vds-gap1.out
- vds-gap1.out.err
- vds-gap2.out
- vds-gap2.out.err
- tvds_layout-1.out
- tvds_layout-1.out.err
- tvds_layout-2.out
- tvds_layout-2.out.err
- tvds_layout-3_1.out
- tvds_layout-3_1.out.err
- tvds_layout-3_2.out
- tvds_layout-3_2.out.err
- tvds_layout-4.out
- tvds_layout-4.out.err
- tvds_layout-5.out
- tvds_layout-5.out.err
- vds_layout-eiger.out
- vds_layout-eiger.out.err
- vds_layout-maxmin.out
- vds_layout-maxmin.out.err
- )
- set_tests_properties (H5DUMP_VDS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- if (NOT "${last_vds_test}" STREQUAL "")
- set_tests_properties (H5DUMP_VDS-clearall-objects PROPERTIES DEPENDS ${last_vds_test})
- endif ()
- set (last_VDS_test "H5DUMP_VDS-clearall-objects")
- endif ()
-
# See which filters are usable (and skip tests for filters we
# don't have). Do this by searching H5pubconf.h to see which
# filters are defined.
diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake
index de87d2f..6d73cb1 100644
--- a/tools/test/h5dump/CMakeTestsXML.cmake
+++ b/tools/test/h5dump/CMakeTestsXML.cmake
@@ -160,6 +160,12 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype)
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -176,28 +182,20 @@
macro (ADD_XML_H5_TEST resultfile resultcode)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP_XML-${resultfile} COMMAND $<TARGET_FILE:h5dump> --xml ${ARGN})
+ add_test (NAME H5DUMP_XML-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --xml ${ARGN})
set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_xml_test}" STREQUAL "")
+ if (last_xml_test)
set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP_XML-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5DUMP_XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml")
add_test (
NAME H5DUMP_XML-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=--xml;${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/xml"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -205,7 +203,6 @@
-D "TEST_REFERENCE=${resultfile}.xml"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES DEPENDS H5DUMP_XML-${resultfile}-clear-objects)
endif ()
endmacro ()
@@ -215,154 +212,6 @@
##############################################################################
##############################################################################
- if (HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP-XML-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- tall.h5.out
- tall.h5.out.err
- tall-2A.h5.out
- tall-2A.h5.out.err
- tarray1.h5.out
- tarray1.h5.out.err
- tarray2.h5.out
- tarray2.h5.out.err
- tarray3.h5.out
- tarray3.h5.out.err
- tarray6.h5.out
- tarray6.h5.out.err
- tarray7.h5.out
- tarray7.h5.out.err
- tattr.h5.out
- tattr.h5.out.err
- tbitfields_be.h5.out
- tbitfields_be.h5.out.err
- tbitfields_le.h5.out
- tbitfields_le.h5.out.err
- tcompound.h5.out
- tcompound.h5.out.err
- tcompound2.h5.out
- tcompound2.h5.out.err
- tcompound_complex.h5.out
- tcompound_complex.h5.out.err
- tdatareg.h5.out
- tdatareg.h5.out.err
- tdset.h5.out
- tdset.h5.out.err
- tdset2.h5.out
- tdset2.h5.out.err
- tempty-dtd-2.h5.out
- tempty-dtd-2.h5.out.err
- tempty-dtd-uri.h5.out
- tempty-dtd-uri.h5.out.err
- tempty-dtd.h5.out
- tempty-dtd.h5.out.err
- tempty-nons-2.h5.out
- tempty-nons-2.h5.out.err
- tempty-nons-uri.h5.out
- tempty-nons-uri.h5.out.err
- tempty-nons.h5.out
- tempty-nons.h5.out.err
- tempty-ns-2.h5.out
- tempty-ns-2.h5.out.err
- tempty-ns.h5.out
- tempty-ns.h5.out.err
- tempty.h5.out
- tempty.h5.out.err
- tenum.h5.out
- tenum.h5.out.err
- test35.nc.out
- test35.nc.out.err
- textlink.h5.out
- textlink.h5.out.err
- tfpformat.h5.out
- tfpformat.h5.out.err
- tgroup.h5.out
- tgroup.h5.out.err
- thlink.h5.out
- thlink.h5.out.err
- tloop.h5.out
- tloop.h5.out.err
- tloop2.h5.out
- tloop2.h5.out.err
- tmany.h5.out
- tmany.h5.out.err
- tname-amp.h5.out
- tname-amp.h5.out.err
- tname-apos.h5.out
- tname-apos.h5.out.err
- tname-gt.h5.out
- tname-gt.h5.out.err
- tname-lt.h5.out
- tname-lt.h5.out.err
- tname-quot.h5.out
- tname-quot.h5.out.err
- tname-sp.h5.out
- tname-sp.h5.out.err
- tnamed_dtype_attr.h5.out
- tnamed_dtype_attr.h5.out.err
- tnestedcomp.h5.out
- tnestedcomp.h5.out.err
- tnodata.h5.out
- tnodata.h5.out.err
- tnoname.h5.out
- tnoname.h5.out.err
- tnullspace.h5.out
- tnullspace.h5.out.err
- tobjref.h5.out
- tobjref.h5.out.err
- topaque.h5.out
- topaque.h5.out.err
- torderattr1.h5.out
- torderattr1.h5.out.err
- torderattr2.h5.out
- torderattr2.h5.out.err
- torderattr3.h5.out
- torderattr3.h5.out.err
- torderattr4.h5.out
- torderattr4.h5.out.err
- tref-escapes-at.h5.out
- tref-escapes-at.h5.out.err
- tref-escapes.h5.out
- tref-escapes.h5.out.err
- tref.h5.out
- tref.h5.out.err
- tsaf.h5.out
- tsaf.h5.out.err
- tslink.h5.out
- tslink.h5.out.err
- tstr.h5.out
- tstr.h5.out.err
- tstr2.h5.out
- tstr2.h5.out.err
- tstring.h5.out
- tstring.h5.out.err
- tstring-at.h5.out
- tstring-at.h5.out.err
- tudlink.h5.out
- tudlink.h5.out.err
- tvldtypes1.h5.out
- tvldtypes1.h5.out.err
- tvldtypes2.h5.out
- tvldtypes2.h5.out.err
- tvldtypes3.h5.out
- tvldtypes3.h5.out.err
- tvldtypes4.h5.out
- tvldtypes4.h5.out.err
- tvldtypes5.h5.out
- tvldtypes5.h5.out.err
- tvlstr.h5.out
- tvlstr.h5.out.err
- )
- set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml")
- if (NOT "${last_xml_test}" STREQUAL "")
- set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test})
- endif ()
- set (last_test "H5DUMP-XML-clearall-objects")
- endif ()
-
########## test XML
ADD_XML_H5_TEST (tall.h5 0 tall.h5)
ADD_XML_H5_TEST (tattr.h5 0 tattr.h5)
diff --git a/tools/test/h5dump/CMakeVFDTests.cmake b/tools/test/h5dump/CMakeVFDTests.cmake
new file mode 100644
index 0000000..0a345ef
--- /dev/null
+++ b/tools/test/h5dump/CMakeVFDTests.cmake
@@ -0,0 +1,91 @@
+#
+# Copyright by The HDF Group.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+
+##############################################################################
+##############################################################################
+### T E S T I N G ###
+##############################################################################
+##############################################################################
+
+set (VFD_H5DUMP_LIST
+ sec2
+ stdio
+ core
+ core_paged
+ split
+ multi
+ family
+)
+
+if (DIRECT_VFD)
+ set (VFD_H5DUMP_LIST ${VFD_H5DUMP_LIST} direct)
+endif ()
+
+# --------------------------------------------------------------------
+# Copy all the HDF5 files from the source directory into the test directory
+# --------------------------------------------------------------------
+set (HDF5_VFD_H5DUMP_FILES
+ packedbits
+)
+
+foreach (vfdtest ${VFD_H5DUMP_LIST})
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}")
+ foreach (h5_tfile ${HDF5_VFD_H5DUMP_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}.h5" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}.h5" "HDF5_VFD_H5DUMP_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}.ddl" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}.ddl" "HDF5_VFD_H5DUMP_files")
+ endforeach ()
+endforeach ()
+
+add_custom_target(HDF5_VFD_H5DUMP_files ALL COMMENT "Copying files needed by HDF5_VFD_H5DUMP tests" DEPENDS ${HDF5_VFD_H5DUMP_files_list})
+
+##############################################################################
+##############################################################################
+### T H E T E S T S M A C R O S ###
+##############################################################################
+##############################################################################
+
+if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+else ()
+ set (tgt_ext "-shared")
+endif ()
+
+macro (ADD_VFD_H5DUMP_TEST vfdname resultfile resultcode)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (
+ NAME H5DUMP_VFD-${vfdname}-${resultfile}-h5dump
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_VFD:STRING=${vfdname}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_REFERENCE=${resultfile}.ddl"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
+ -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ set_tests_properties (H5DUMP_VFD-${vfdname}-${resultfile}-h5dump PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT})
+ endif ()
+endmacro ()
+
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
+
+# Run test with different Virtual File Driver
+foreach (vfd ${VFD_H5DUMP_LIST})
+ # test for signed/unsigned datasets
+ ADD_VFD_H5DUMP_TEST (${vfd} packedbits 0 --enable-error-stack packedbits.h5)
+endforeach ()
diff --git a/tools/test/h5dump/Makefile.in b/tools/test/h5dump/Makefile.in
index 8cf3c69..cf523b0 100644
--- a/tools/test/h5dump/Makefile.in
+++ b/tools/test/h5dump/Makefile.in
@@ -503,7 +503,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -526,9 +525,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -555,6 +557,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -609,6 +612,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -633,7 +637,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1317,7 +1320,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index fe43ecd..fb3ba65 100644
--- a/tools/test/h5dump/h5dumpgentest.c
+++ b/tools/test/h5dump/h5dumpgentest.c
@@ -562,7 +562,7 @@ gent_attribute(void)
dims[0] = 24;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(root, "/attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "attribute of root group");
+ HDsprintf(buf, "attribute of root group");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -1372,7 +1372,7 @@ static void gent_all(void)
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "abcdefghi");
+ HDsprintf(buf, "abcdefghi");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -1403,7 +1403,7 @@ static void gent_all(void)
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "1st attribute of dset1.1.1");
+ HDsprintf(buf, "1st attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -1411,7 +1411,7 @@ static void gent_all(void)
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "2nd attribute of dset1.1.1");
+ HDsprintf(buf, "2nd attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -1607,7 +1607,7 @@ gent_many(void)
dims[0] = 10;
space2 = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space2, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "abcdefghi");
+ HDsprintf(buf, "abcdefghi");
H5Awrite(attr, H5T_NATIVE_CHAR, buf);
H5Sclose(space2);
H5Aclose(attr);
@@ -1888,7 +1888,7 @@ static void gent_str2(void)
int i;
- char buf[LENSTR+10];
+ char buf[LENSTR+20];
char buf2[3*LENSTR2];
hsize_t sdim;
@@ -1926,9 +1926,9 @@ static void gent_str2(void)
dims[0] = 3;
space2 = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr1", fxdlenstr2, space2, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(&(buf2[0*LENSTR2]), "0123456789");
- sprintf(&(buf2[1*LENSTR2]), "abcdefghij");
- sprintf(&(buf2[2*LENSTR2]), "ABCDEFGHIJ");
+ HDsprintf(&(buf2[0*LENSTR2]), "0123456789");
+ HDsprintf(&(buf2[1*LENSTR2]), "abcdefghij");
+ HDsprintf(&(buf2[2*LENSTR2]), "ABCDEFGHIJ");
H5Awrite(attr, fxdlenstr2, buf2);
H5Sclose(space2);
H5Tclose(fxdlenstr2);
@@ -1940,7 +1940,7 @@ static void gent_str2(void)
for(i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i);
+ HDsprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i);
H5Tset_size(memtype, HDstrlen(buf)+1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -1953,7 +1953,7 @@ static void gent_str2(void)
for(i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i);
+ HDsprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i);
H5Tset_size(memtype, HDstrlen(buf)+1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -1973,7 +1973,7 @@ static void gent_str2(void)
for(i = 0;(hsize_t) i < sdim; i++) {
start[0] = (hsize_t)i;
- sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i);
+ HDsprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i);
H5Tset_size(memtype, HDstrlen(buf)+1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -1987,7 +1987,7 @@ static void gent_str2(void)
for(i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i);
+ HDsprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i);
H5Tset_size(memtype, HDstrlen(buf)+1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -2006,7 +2006,7 @@ static void gent_str2(void)
for(i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i);
+ HDsprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i);
H5Tset_size(memtype, HDstrlen(buf) + 1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -2020,7 +2020,7 @@ static void gent_str2(void)
for(i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i);
+ HDsprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i);
H5Tset_size(memtype, HDstrlen(buf) + 1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -2703,14 +2703,14 @@ gent_vldatatypes2(void)
for(i = 0; i < SPACE1_DIM1; i++) {
wdata[i].p = (hvl_t *)HDmalloc((i + 1) * sizeof(hvl_t));
if(wdata[i].p == NULL) {
- printf("Cannot allocate memory for VL data! i=%u\n", i);
+ HDprintf("Cannot allocate memory for VL data! i=%u\n", i);
return;
} /* end if */
wdata[i].len = i + 1;
for(t1 = (hvl_t *)wdata[i].p, j = 0; j < (i + 1); j++, t1++) {
t1->p = (unsigned *)HDmalloc((j + 1) * sizeof(unsigned));
if(t1->p == NULL) {
- printf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j);
+ HDprintf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j);
return;
} /* end if */
t1->len=j+1;
@@ -3762,9 +3762,9 @@ void gent_multi(void)
for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
memb_fapl[mt] = H5P_DEFAULT;
memb_map[mt] = mt;
- sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
+ HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv[mt];
- /*printf("memb_name[%d]=%s, memb_map[%d]=%d; ", mt, memb_name[mt], mt, memb_map[mt]);*/
+ /*HDprintf("memb_name[%d]=%s, memb_map[%d]=%d; ", mt, memb_name[mt], mt, memb_map[mt]);*/
memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10);
}
memb_map[H5FD_MEM_DEFAULT] = H5FD_MEM_SUPER;
@@ -3803,7 +3803,7 @@ static void gent_large_objname(void)
group = H5Gcreate2(fid, "this_is_a_large_group_name", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for(i = 0; i < 50; ++i) {
- sprintf(grp_name, "this_is_a_large_group_name%d", i);
+ HDsprintf(grp_name, "this_is_a_large_group_name%d", i);
group2 = H5Gcreate2(group, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group2);
}
@@ -6273,8 +6273,8 @@ static int gent_ldouble(void)
return 0;
- error:
- printf("error !\n");
+error:
+ HDprintf("error !\n");
return -1;
}
@@ -6437,7 +6437,7 @@ gent_bigdims(void)
return;
out:
- printf("Error.....\n");
+ HDprintf("Error.....\n");
H5E_BEGIN_TRY {
H5Pclose(dcpl);
H5Sclose(f_sid);
@@ -6629,7 +6629,7 @@ gent_group_creation_order(void)
return;
out:
- printf("Error.....\n");
+ HDprintf("Error.....\n");
H5E_BEGIN_TRY {
H5Gclose(gid);
H5Pclose(gcpl_id);
@@ -6898,7 +6898,7 @@ gent_attr_creation_order(void)
return;
out:
- printf("Error.....\n");
+ HDprintf("Error.....\n");
H5E_BEGIN_TRY {
H5Gclose(gid);
H5Dclose(did);
@@ -7526,21 +7526,12 @@ gent_attr_intsize(void)
H5Gclose(root);
H5Fclose(fid);
}
+
static void
gent_nodata(void)
{
hid_t fid, dataset, space;
hsize_t dims[2];
- uint8_t dsetu8[F66_XDIM][F66_YDIM8], valu8bits;
- uint16_t dsetu16[F66_XDIM][F66_YDIM16], valu16bits;
- uint32_t dsetu32[F66_XDIM][F66_YDIM32], valu32bits;
- uint64_t dsetu64[F66_XDIM][F66_YDIM64], valu64bits;
- int8_t dset8[F66_XDIM][F66_YDIM8], val8bits;
- int16_t dset16[F66_XDIM][F66_YDIM16], val16bits;
- int32_t dset32[F66_XDIM][F66_YDIM32], val32bits;
- int64_t dset64[F66_XDIM][F66_YDIM64], val64bits;
- double dsetdbl[F66_XDIM][F66_YDIM8];
- unsigned int i, j;
fid = H5Fcreate(FILE87, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in
index 9b1543c..507556f 100644
--- a/tools/test/h5dump/testh5dump.sh.in
+++ b/tools/test/h5dump/testh5dump.sh.in
@@ -34,6 +34,7 @@ H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
RM='rm -rf'
CMP='cmp'
DIFF='diff -c'
+GREP='grep'
CP='cp'
DIRNAME='dirname'
LS='ls'
@@ -81,6 +82,7 @@ $SRC_H5DUMP_TESTFILES/charsets.h5
$SRC_H5DUMP_TESTFILES/file_space.h5
$SRC_H5DUMP_TESTFILES/filter_fail.h5
$SRC_H5DUMP_TESTFILES/packedbits.h5
+$SRC_H5DUMP_TESTFILES/t128bit_float.h5
$SRC_H5DUMP_TESTFILES/taindices.h5
$SRC_H5DUMP_TESTFILES/tall.h5
$SRC_H5DUMP_TESTFILES/tarray1.h5
@@ -752,7 +754,7 @@ TOOLTEST4() {
TESTING $DUMPER $@
(
cd $TESTDIR
- $RUNSERIAL $DUMPER_BIN "$@"
+ $ENVCMD $RUNSERIAL $DUMPER_BIN "$@"
) >$actual 2>$actual_err
# save actual and actual_err in case they are needed later.
@@ -899,6 +901,36 @@ TOOLTEST_HELP() {
}
+# Call the h5dump tool and grep for a value
+#
+GREPTEST()
+{
+ expectdata=$1
+ actual=$TESTDIR/$2
+ actual_err="$TESTDIR/`basename $2 .ddl`.oerr"
+ shift
+ shift
+
+ # Run test.
+ TESTING $DUMPER -p $@
+ (
+ cd $TESTDIR
+ $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@"
+ ) >$actual 2>$actual_err
+ $GREP $expectdata $actual > /dev/null
+ if [ $? -eq 0 ]; then
+ echo " PASSED"
+ else
+ echo " FAILED"
+ nerrors="`expr $nerrors + 1`"
+ fi
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actual $actual_err
+ fi
+}
+
# Print a "SKIP" message
SKIP() {
TESTING $DUMPER $@
@@ -1356,6 +1388,9 @@ TOOLTEST2 tall-6.exp --enable-error-stack -y -o tall-6.txt -d /g1/g1.1/dset1.1.1
# test for non-existing file
TOOLTEST3 non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5
+# test to verify HDFFV-9407: long double full precision
+GREPTEST "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5
+
# Clean up temporary files/directories
CLEAN_TESTFILES_AND_TESTDIR
diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt
index 170ba4c..55d5623 100644
--- a/tools/test/h5format_convert/CMakeLists.txt
+++ b/tools/test/h5format_convert/CMakeLists.txt
@@ -5,19 +5,24 @@ project (HDF5_TOOLS_TEST_H5FC C)
# Add the h5format_convert test executables
# --------------------------------------------------------------------
add_executable (h5fc_chk_idx ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_chk_idx.c)
-target_include_directories(h5fc_chk_idx PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5fc_chk_idx STATIC)
-target_link_libraries (h5fc_chk_idx PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (h5fc_chk_idx PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5fc_chk_idx STATIC)
+ target_link_libraries (h5fc_chk_idx PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5fc_chk_idx SHARED)
+ target_link_libraries (h5fc_chk_idx PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (h5fc_chk_idx PROPERTIES FOLDER tools)
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5fc_gentest ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_gentest.c)
- target_include_directories(h5fc_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5fc_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5fc_gentest STATIC)
- target_link_libraries (h5fc_gentest PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_link_libraries (h5fc_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5fc_gentest COMMAND $<TARGET_FILE:h5fc_gentest>)
+ #add_test (NAME h5fc_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_gentest>)
endif ()
include (CMakeTests.cmake)
diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake
index 5792d40..398866c 100644
--- a/tools/test/h5format_convert/CMakeTests.cmake
+++ b/tools/test/h5format_convert/CMakeTests.cmake
@@ -97,31 +97,33 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_H5_OUTPUT testname resultfile resultcode testfile)
# If using memchecker add tests without using scripts
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/outtmp.h5
- ./testfiles/${testname}.out
- ./testfiles/${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/outtmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
endif ()
- if (NOT "${testfile}" STREQUAL "")
+ if (${testfile})
add_test (
NAME H5FC-${testname}-${testfile}-tmpfile
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5
)
set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
add_test (
NAME H5FC-${testname}-${testfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
-D "TEST_ARGS=${ARGN};outtmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -136,7 +138,8 @@
add_test (
NAME H5FC-${testname}-NA
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -155,25 +158,21 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/outtmp.h5
- ./testfiles/${testname}.out
- ./testfiles/${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/outtmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
endif ()
add_test (
NAME H5FC-${testname}-${testfile}-tmpfile
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5
)
set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
add_test (
NAME H5FC-${testname}-${testfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
-D "TEST_ARGS=${ARGN};outtmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -186,59 +185,36 @@
endif ()
endmacro ()
- macro (ADD_H5_MASK_OUTPUT testname resultfile resultcode testfile)
+ macro (ADD_H5_MASK_OUTPUT testname resultfile resultcode result_errcheck testfile)
# If using memchecker add tests without using scripts
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/outtmp.h5
- ./testfiles/${testname}.out
- ./testfiles/${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/outtmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
endif ()
- if (NOT "${testfile}" STREQUAL "")
- add_test (
- NAME H5FC-${testname}-${testfile}-tmpfile
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5
- )
- set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
- add_test (
- NAME H5FC-${testname}-${testfile}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
- -D "TEST_ARGS=${ARGN};outtmp.h5"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
- -D "TEST_OUTPUT=${testname}.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=${resultfile}"
- -D "TEST_ERRREF=${resultfile}.err"
- -D "TEST_MASK_ERROR=true"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile")
- set (last_test "H5FC-${testname}-${testfile}")
- else ()
- add_test (
- NAME H5FC-${testname}-NA
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
- -D "TEST_ARGS=${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
- -D "TEST_OUTPUT=${testname}.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=${resultfile}"
- -D "TEST_ERRREF=${resultfile}.err"
- -D "TEST_MASK_ERROR=true"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- set_tests_properties (H5FC-${testname}-NA PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
- set (last_test "H5FC-${testname}-NA")
- endif ()
+ add_test (
+ NAME H5FC-${testname}-${testfile}-tmpfile
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5
+ )
+ set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
+ add_test (
+ NAME H5FC-${testname}-${testfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
+ -D "TEST_ARGS=${ARGN};outtmp.h5"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${testname}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}"
+ -D "TEST_ERRREF=${result_errcheck}"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
+ )
+ set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile")
+ set (last_test "H5FC-${testname}-${testfile}")
endif ()
endmacro ()
@@ -247,25 +223,21 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/tmp.h5
- ./testfiles/${testname}.out
- ./testfiles/${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/tmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
endif ()
add_test (
NAME H5FC-${testname}-tmpfile
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} testfiles/tmp.h5
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} testfiles/tmp.h5
)
set_tests_properties (H5FC-${testname}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
add_test (
NAME H5FC-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
-D "TEST_ARGS=${ARGN};./testfiles/tmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=testfiles/${testname}.out"
@@ -283,7 +255,7 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC_CHECK_IDX-${testname}
- COMMAND "$<TARGET_FILE:h5fc_chk_idx>" "./testfiles/tmp.h5" "${ARGN}"
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_chk_idx> ./testfiles/tmp.h5 ${ARGN}
)
set_tests_properties (H5FC_CHECK_IDX-${testname} PROPERTIES DEPENDS "H5FC-${dependtest}")
endif ()
@@ -294,25 +266,21 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/chktmp.h5
- ./testfiles/${testname}.out
- ./testfiles/${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/chktmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
endif ()
add_test (
NAME H5FC-${testname}-tmpfile
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} testfiles/chktmp.h5
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} testfiles/chktmp.h5
)
set_tests_properties (H5FC-${testname}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
add_test (
NAME H5FC-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
-D "TEST_ARGS=-d;${ARGN};./testfiles/chktmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=testfiles/${testname}.out"
@@ -323,7 +291,7 @@
set_tests_properties (H5FC-${testname} PROPERTIES DEPENDS "H5FC-${testname}-tmpfile")
add_test (
NAME H5FC_CHECK_IDX-${testname}
- COMMAND "$<TARGET_FILE:h5fc_chk_idx>" "./testfiles/chktmp.h5" "${ARGN}"
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_chk_idx> ./testfiles/chktmp.h5 ${ARGN}
)
set_tests_properties (H5FC_CHECK_IDX-${testname} PROPERTIES DEPENDS "H5FC-${testname}")
set (last_test "H5FC_CHECK_IDX-${testname}")
@@ -331,31 +299,25 @@
endmacro ()
macro (ADD_H5_H5DUMP_CHECK testname)
- # If using memchecker add tests without using scripts
+ # If using memchecker skip tests
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/dmptmp.h5
- ./testfiles/${testname}.out
- ./testfiles/${testname}.out.err
- ./testfiles/${testname}_chk.out
- ./testfiles/${testname}_chk.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/dmptmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
endif ()
add_test (
NAME H5FC-${testname}-tmpfile
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testname}.h5 testfiles/dmptmp.h5
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testname}.h5 testfiles/dmptmp.h5
)
set_tests_properties (H5FC-${testname}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
add_test (
NAME H5FC-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
-D "TEST_ARGS=${ARGN};./testfiles/dmptmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=testfiles/${testname}.out"
@@ -367,7 +329,8 @@
add_test (
NAME H5FC_CHECK_DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-BH;./testfiles/dmptmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=testfiles/${testname}_chk.out"
@@ -390,66 +353,13 @@
# Remove any output file left over from previous test run
add_test (
NAME H5FC-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- h5fc_help.out
- h5fc_help.out.err
- h5fc_nooption.out
- h5fc_nooption.out.err
- h5fc_nonexistfile.out
- h5fc_nonexistfile.out.err
- h5fc_d_file.out
- h5fc_d_file.out.err
- h5fc_d_file-d.out
- h5fc_d_file-d.out.err
- h5fc_dname.out
- h5fc_dname.out.err
- h5fc_nonexistdset_file.out
- h5fc_nonexistdset_file.out.err
- h5fc_v_non_chunked.out
- h5fc_v_non_chunked.out.err
- h5fc_v_bt1.out
- h5fc_v_bt1.out.err
- h5fc_v_ndata_bt1.out
- h5fc_v_ndata_bt1.out.err
- h5fc_v_all.out
- h5fc_v_all.out.err
- h5fc_v_n_1d.out
- h5fc_v_n_1d.out.err
- h5fc_v_n_all.out
- h5fc_v_n_all.out.err
- h5fc_ext1_i.out
- h5fc_ext1_i.out.err
- h5fc_ext1_s.out
- h5fc_ext1_s.out.err
- h5fc_ext1_f.out
- h5fc_ext1_f.out.err
- h5fc_ext2_if.out
- h5fc_ext2_if.out.err
- h5fc_ext2_is.out
- h5fc_ext2_is.out.err
- h5fc_ext2_sf.out
- h5fc_ext2_sf.out.err
- h5fc_ext3_isf.out
- h5fc_ext3_isf.out.err
- old_h5fc_ext1_i.out
- old_h5fc_ext1_i.out.err
- old_h5fc_ext1_s.out
- old_h5fc_ext1_s.out.err
- old_h5fc_ext1_f.out
- old_h5fc_ext1_f.out.err
- old_h5fc_ext2_if.out
- old_h5fc_ext2_is.out.err
- old_h5fc_ext2_is.out
- old_h5fc_ext2_sf.out.err
- old_h5fc_ext3_isf.out
- old_h5fc_ext3_isf.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove
outtmp.h5
tmp.h5
chktmp.h5
dmptmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-clearall-objects PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "H5FC-clearall-objects")
@@ -493,7 +403,7 @@
#
#
# h5format_convert -v h5fc_err_level.h5 (error encountered in converting the dataset)
- ADD_H5_MASK_OUTPUT (h5fc_v_err h5fc_v_err.ddl 1 h5fc_err_level.h5 -v)
+ ADD_H5_MASK_OUTPUT (h5fc_v_err h5fc_v_err.ddl 1 "h5format_convert error: unable to downgrade dataset \"/DSET_ERR\"" h5fc_err_level.h5 -v)
#
#
#
diff --git a/tools/test/h5format_convert/Makefile.in b/tools/test/h5format_convert/Makefile.in
index da61977..5e8e85c 100644
--- a/tools/test/h5format_convert/Makefile.in
+++ b/tools/test/h5format_convert/Makefile.in
@@ -486,7 +486,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -509,9 +508,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -538,6 +540,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -592,6 +595,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -616,7 +620,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1273,7 +1276,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt
index 500be58..9364683 100644
--- a/tools/test/h5import/CMakeLists.txt
+++ b/tools/test/h5import/CMakeLists.txt
@@ -5,9 +5,14 @@ project (HDF5_TOOLS_TEST_H5IMPORT C)
# Add the h5import executables
# --------------------------------------------------------------------
add_executable (h5importtest ${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/h5importtest.c)
-target_include_directories(h5importtest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5importtest STATIC)
-target_link_libraries (h5importtest PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (h5importtest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5importtest STATIC)
+ target_link_libraries (h5importtest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5importtest SHARED)
+ target_link_libraries (h5importtest PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (h5importtest PROPERTIES FOLDER tools)
include (CMakeTests.cmake)
diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake
index 7d76fba..22ab848 100644
--- a/tools/test/h5import/CMakeTests.cmake
+++ b/tools/test/h5import/CMakeTests.cmake
@@ -95,34 +95,39 @@
### T H E T E S T S M A C R O S ###
##############################################################################
##############################################################################
+
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_H5_TEST testname importfile conffile testfile)
# If using memchecker skip macro based tests
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile})
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest)
- endif ()
+ add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile})
+ set_tests_properties (H5IMPORT-${testname} PROPERTIES
+ FIXTURES_REQUIRED set_h5importtest
+ )
else ()
add_test (
NAME H5IMPORT-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${testfile}
- ${testfile}.new
- ${testfile}.new.err
- ${testfile}.out
- ${testfile}.out.err
- ${testfile}
+ COMMAND ${CMAKE_COMMAND} -E remove ${testfile}
+ )
+ set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED set_h5importtest
)
- set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest)
- add_test (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile})
- set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects)
+ add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile})
+ set_tests_properties (H5IMPORT-${testname} PROPERTIES
+ DEPENDS H5IMPORT-${testname}-clear-objects
+ )
add_test (
NAME H5IMPORT-${testname}-H5DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testfile}.new"
@@ -131,11 +136,14 @@
-D "TEST_SKIP_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname})
+ set_tests_properties (H5IMPORT-${testname}-H5DMP PROPERTIES
+ DEPENDS H5IMPORT-${testname}
+ )
add_test (
NAME H5IMPORT-${testname}-H5DMP_CMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=testfiles/${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testfile}.out"
@@ -144,7 +152,9 @@
-D "TEST_REFERENCE=${testfile}.new"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP)
+ set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES
+ DEPENDS H5IMPORT-${testname}-H5DMP
+ )
endif ()
endmacro ()
@@ -153,24 +163,20 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5IMPORT-DUMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
d${testfile}
d${testfile}.bin
- d${testfile}.dmp
- d${testfile}.dmp.err
- d${testfile}.imp
- d${testfile}.imp.err
- d${testfile}.dff
- d${testfile}.dff.err
)
- set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest)
+ set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES
+ DEPENDS H5IMPORT-${testname}-H5DMP_CMP
+ )
if ("${ARGN}" STREQUAL "BINARY")
add_test (
NAME H5IMPORT-DUMP-${testname}-H5DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;NATIVE;testfiles/${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d${testfile}.dmp"
@@ -182,7 +188,8 @@
add_test (
NAME H5IMPORT-DUMP-${testname}-H5DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-y;--width=1;testfiles/${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d${testfile}.dmp"
@@ -191,12 +198,15 @@
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects")
+ set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES
+ DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects"
+ )
add_test (
NAME H5IMPORT-DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5import>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_ext}>"
-D "TEST_ARGS:STRING=d${testfile}.bin;-c;d${testfile}.dmp;-o;d${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d${testfile}.imp"
@@ -204,12 +214,15 @@
-D "TEST_SKIP_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP")
+ set_tests_properties (H5IMPORT-DUMP-${testname} PROPERTIES
+ DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP"
+ )
add_test (
NAME H5IMPORT-DUMP-${testname}-H5DFF
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_ext}>"
-D "TEST_ARGS:STRING=-r;d${testfile};testfiles/${testfile};${datasetname};${datasetname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d${testfile}.dff"
@@ -218,7 +231,9 @@
-D "TEST_REFERENCE=testfiles/d${testfile}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}")
+ set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES
+ DEPENDS "H5IMPORT-DUMP-${testname}"
+ )
endif ()
endmacro ()
@@ -227,23 +242,19 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5IMPORT_SUB-DUMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- d-${testname}.dmp
- d-${testname}.dmp.err
+ COMMAND ${CMAKE_COMMAND} -E remove
d-${testname}.h5
- ${testname}.dmp
- ${testname}.dmp.err
- ${testname}.imp
- ${testname}.imp.err
${testname}.bin
)
- set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest)
+ set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED set_h5importtest
+ )
add_test (
NAME H5IMPORT_SUB-DUMP-${testname}-H5DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;NATIVE;testfiles/${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testname}.dmp"
@@ -251,12 +262,15 @@
-D "TEST_SKIP_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-clear-objects")
+ set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5DMP PROPERTIES
+ DEPENDS "H5IMPORT_SUB-DUMP-${testname}-clear-objects"
+ )
add_test (
NAME H5IMPORT_SUB-DUMP-${testname}-H5IMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5import>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_ext}>"
-D "TEST_ARGS:STRING=${testname}.bin;-c;${testname}.dmp;-o;d-${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testname}.imp"
@@ -264,11 +278,14 @@
-D "TEST_SKIP_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5IMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5DMP")
+ set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5IMP PROPERTIES
+ DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5DMP"
+ )
add_test (
NAME H5IMPORT_SUB-DUMP-${testname}-CMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-p;d-${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d-${testname}.dmp"
@@ -276,7 +293,9 @@
-D "TEST_REFERENCE=testfiles/${testname}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-CMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5IMP")
+ set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-CMP PROPERTIES
+ DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5IMP"
+ )
endif ()
endmacro ()
@@ -307,8 +326,7 @@
# Remove any output file left over from previous test run
add_test (
NAME H5IMPORT-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
binfp64.bin
binin8.bin
binin8w.bin
@@ -317,164 +335,40 @@
binuin16.bin
binuin32.bin
txtin32.h5
- txtin32.h5.new
- txtin32.h5.new.err
- txtin32.h5.out
- txtin32.h5.out.err
txtin16.h5
- txtin16.h5.new
- txtin16.h5.new.err
- txtin16.h5.out
- txtin16.h5.out.err
txtin8.h5
- txtin8.h5.new
- txtin8.h5.new.err
- txtin8.h5.out
- txtin8.h5.out.err
txtuin16.h5
- txtuin16.h5.new
- txtuin16.h5.new.err
- txtuin16.h5.out
- txtuin16.h5.out.err
txtuin32.h5
- txtuin32.h5.new
- txtuin32.h5.new.err
- txtuin32.h5.out
- txtuin32.h5.out.err
txtfp32.h5
- txtfp32.h5.new
- txtfp32.h5.new.err
- txtfp32.h5.out
- txtfp32.h5.out.err
txtfp64.h5
- txtfp64.h5.new
- txtfp64.h5.new.err
- txtfp64.h5.out
- txtfp64.h5.out.err
binfp64.h5
- binfp64.h5.new
- binfp64.h5.new.err
- binfp64.h5.out
- binfp64.h5.out.err
binin8.h5
- binin8.h5.new
- binin8.h5.new.err
- binin8.h5.out
- binin8.h5.out.err
binin8w.h5
- binin8w.h5.new
- binin8w.h5.new.err
- binin8w.h5.out
- binin8w.h5.out.err
binin16.h5
- binin16.h5.new
- binin16.h5.new.err
- binin16.h5.out
- binin16.h5.out.err
binin32.h5
- binin32.h5.new
- binin32.h5.new.err
- binin32.h5.out
- binin32.h5.out.err
binuin16.h5
- binuin16.h5.new
- binuin16.h5.new.err
- binuin16.h5.out
- binuin16.h5.out.err
binuin32.h5
- binuin32.h5.new
- binuin32.h5.new.err
- binuin32.h5.out
- binuin32.h5.out.err
txtstr.h5
- txtstr.h5.new
- txtstr.h5.new.err
- txtstr.h5.out
- txtstr.h5.out.err
textpfe.h5
- textpfe.h5.new
- textpfe.h5.new.err
- textpfe.h5.out
- textpfe.h5.out.err
dbinfp64.h5
dbinfp64.h5.bin
- dbinfp64.h5.imp
- dbinfp64.h5.imp.err
- dbinfp64.h5.dmp
- dbinfp64.h5.dmp.err
- dbinfp64.h5.dff
- dbinfp64.h5.dff.err
dbinin8.h5
dbinin8.h5.bin
- dbinin8.h5.imp
- dbinin8.h5.imp.err
- dbinin8.h5.dmp
- dbinin8.h5.dmp.err
- dbinin8.h5.dff
- dbinin8.h5.dff.err
dbinin8w.h5
dbinin8w.h5.bin
- dbinin8w.h5.imp
- dbinin8w.h5.imp.err
- dbinin8w.h5.dmp
- dbinin8w.h5.dmp.err
- dbinin8w.h5.dff
- dbinin8w.h5.dff.err
dbinin16.h5
dbinin16.h5.bin
- dbinin16.h5.imp
- dbinin16.h5.imp.err
- dbinin16.h5.dmp
- dbinin16.h5.dmp.err
- dbinin16.h5.dff
- dbinin16.h5.dff.err
dbinin32.h5
dbinin32.h5.bin
- dbinin32.h5.imp
- dbinin32.h5.imp.err
- dbinin32.h5.dmp
- dbinin32.h5.dmp.err
- dbinin32.h5.dff
- dbinin32.h5.dff.err
dbinuin16.h5
dbinuin16.h5.bin
- dbinuin16.h5.imp
- dbinuin16.h5.imp.err
- dbinuin16.h5.dmp
- dbinuin16.h5.dmp.err
- dbinuin16.h5.dff
- dbinuin16.h5.dff.err
dbinuin32.h5
dbinuin32.h5.bin
- dbinuin32.h5.imp
- dbinuin32.h5.imp.err
- dbinuin32.h5.dmp
- dbinuin32.h5.dmp.err
- dbinuin32.h5.dff
- dbinuin32.h5.dff.err
dtxtstr.h5
dtxtstr.h5.bin
- dtxtstr.h5.imp
- dtxtstr.h5.imp.err
- dtxtstr.h5.dmp
- dtxtstr.h5.dmp.err
- dtxtstr.h5.dff
- dtxtstr.h5.dff.err
- tall_fp32.dmp
- tall_fp32.dmp.err
tall_fp32.bin
- tall_fp32.imp
- tall_fp32.imp.err
- d-tall_fp32.dmp
- d-tall_fp32.dmp.err
d-tall_fp32.h5
- tall_i32.dmp
- tall_i32.dmp.err
tall_i32.bin
- tall_i32.imp
- tall_i32.imp.err
- d-tall_i32.dmp
- d-tall_i32.dmp.err
d-tall_i32.h5
)
set (last_test "H5IMPORT-clear-objects")
@@ -482,8 +376,7 @@
add_test (
NAME H5IMPORT-h5importtest-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
binfp64.bin
binfp64.conf
binin8.bin
@@ -499,13 +392,12 @@
binuin32.bin
binuin32.conf
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5IMPORT-clear-objects")
- add_test (NAME H5IMPORT-h5importtest COMMAND $<TARGET_FILE:h5importtest>)
- set_tests_properties (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-h5importtest-clear-objects)
+ add_test (NAME H5IMPORT-h5importtest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5importtest>)
+ set_tests_properties (H5IMPORT-h5importtest PROPERTIES
+ FIXTURES_SETUP set_h5importtest
+ DEPENDS H5IMPORT-h5importtest-clear-objects
+ )
# ----- TESTING "ASCII I32 rank 3 - Output BE " ;
ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5)
diff --git a/tools/test/h5import/Makefile.in b/tools/test/h5import/Makefile.in
index 7e41e7f..d4870e2 100644
--- a/tools/test/h5import/Makefile.in
+++ b/tools/test/h5import/Makefile.in
@@ -482,7 +482,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -505,9 +504,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -534,6 +536,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -588,6 +591,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -612,7 +616,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1258,7 +1261,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c
index bbb67b6..560f1b3 100644
--- a/tools/test/h5import/h5importtest.c
+++ b/tools/test/h5import/h5importtest.c
@@ -183,8 +183,8 @@ main(void)
for (i = 0; i < nrow; i++)
{
for (j = 0; j < ncol; j++)
- (void) fprintf(sp, "%10u", b8i3[k][i][j]);
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "%10u", b8i3[k][i][j]);
+ (void) HDfprintf(sp, "\n");
}
}
(void) HDfclose(sp);
@@ -200,8 +200,8 @@ main(void)
for (i = 0; i < nrow; i++)
{
for (j = 0; j < ncol; j++)
- (void) fprintf(sp, "%10u", b16i3[k][i][j]);
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "%10u", b16i3[k][i][j]);
+ (void) HDfprintf(sp, "\n");
}
}
(void) HDfclose(sp);
@@ -217,8 +217,8 @@ main(void)
for (i = 0; i < nrow; i++)
{
for (j = 0; j < ncol; j++)
- (void) fprintf(sp, "%10d", b32i3[k][i][j]);
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "%10d", b32i3[k][i][j]);
+ (void) HDfprintf(sp, "\n");
}
}
(void) HDfclose(sp);
@@ -243,16 +243,16 @@ main(void)
(void) HDfclose(sp);
sp = HDfopen("binin32.conf", "w");
- (void) fprintf(sp, "PATH /int/bin/32-bit\n");
- (void) fprintf(sp, "INPUT-CLASS IN\n");
- (void) fprintf(sp, "INPUT-SIZE 32\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 3\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER BE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
- (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "PATH /int/bin/32-bit\n");
+ (void) HDfprintf(sp, "INPUT-CLASS IN\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 32\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 3\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER BE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n");
+ (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
/*-------------------------------------------------------------------------
@@ -274,15 +274,15 @@ main(void)
(void) HDfclose(sp);
sp = HDfopen("binuin32.conf", "w");
- (void) fprintf(sp, "PATH /int/buin/32-bit\n");
- (void) fprintf(sp, "INPUT-CLASS UIN\n");
- (void) fprintf(sp, "INPUT-SIZE 32\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 3\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "PATH /int/buin/32-bit\n");
+ (void) HDfprintf(sp, "INPUT-CLASS UIN\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 32\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 3\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
/*-------------------------------------------------------------------------
@@ -304,17 +304,17 @@ main(void)
(void) HDfclose(sp);
sp = HDfopen("binin16.conf", "w");
- (void) fprintf(sp, "PATH /int/bin/16-bit\n");
- (void) fprintf(sp, "INPUT-CLASS IN\n");
- (void) fprintf(sp, "INPUT-SIZE 16\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 3\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 2 3 4\n");
- (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
- (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "PATH /int/bin/16-bit\n");
+ (void) HDfprintf(sp, "INPUT-CLASS IN\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 16\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 3\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 2 3 4\n");
+ (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
+ (void) HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
/*-------------------------------------------------------------------------
@@ -335,17 +335,17 @@ main(void)
(void) HDfclose(sp);
sp = HDfopen("binuin16.conf", "w");
- (void) fprintf(sp, "PATH /int/buin/16-bit\n");
- (void) fprintf(sp, "INPUT-CLASS UIN\n");
- (void) fprintf(sp, "INPUT-SIZE 16\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 3\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER BE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 2 3 4\n");
- (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
- (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "PATH /int/buin/16-bit\n");
+ (void) HDfprintf(sp, "INPUT-CLASS UIN\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 16\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 3\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER BE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 2 3 4\n");
+ (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
+ (void) HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
/*-------------------------------------------------------------------------
@@ -367,20 +367,20 @@ main(void)
(void) HDfclose(sp);
sp = HDfopen("binin8.conf", "w");
- (void) fprintf(sp, "PATH /int/bin/8-bit\n");
- (void) fprintf(sp, "INPUT-CLASS IN\n");
- (void) fprintf(sp, "INPUT-SIZE 8\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 3\n");
- (void) fprintf(sp, "OUTPUT-CLASS IN\n");
- (void) fprintf(sp, "OUTPUT-SIZE 16\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
- (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
- (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n");
- (void) fprintf(sp, "COMPRESSION-PARAM 3\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "PATH /int/bin/8-bit\n");
+ (void) HDfprintf(sp, "INPUT-CLASS IN\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 8\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 3\n");
+ (void) HDfprintf(sp, "OUTPUT-CLASS IN\n");
+ (void) HDfprintf(sp, "OUTPUT-SIZE 16\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n");
+ (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
+ (void) HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n");
+ (void) HDfprintf(sp, "COMPRESSION-PARAM 3\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
#endif /* UNICOS */
@@ -408,18 +408,18 @@ main(void)
(void) HDfclose(sp);
sp = HDfopen("binfp64.conf", "w");
- (void) fprintf(sp, "PATH /fp/bin/64-bit\n");
- (void) fprintf(sp, "INPUT-CLASS FP\n");
- (void) fprintf(sp, "INPUT-SIZE 64\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 3\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE IEEE\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
- (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
- (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n");
- (void) fprintf(sp, "COMPRESSION-PARAM 8\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "PATH /fp/bin/64-bit\n");
+ (void) HDfprintf(sp, "INPUT-CLASS FP\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 64\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 3\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE IEEE\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n");
+ (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
+ (void) HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n");
+ (void) HDfprintf(sp, "COMPRESSION-PARAM 8\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
/*-------------------------------------------------------------------------
@@ -436,21 +436,21 @@ main(void)
{
char c = bin8w[i];
if ( HDfwrite( &c, sizeof(char), 1, sp) != 1 )
- printf("error writing file\n");
+ HDprintf("error writing file\n");
}
HDfclose(sp);
sp = HDfopen("binin8w.conf", "w");
- (void) fprintf(sp, "INPUT-CLASS IN\n");
- (void) fprintf(sp, "INPUT-SIZE 8\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 1\n");
- (void) fprintf(sp, "OUTPUT-CLASS IN\n");
- (void) fprintf(sp, "OUTPUT-SIZE 8\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 4\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "INPUT-CLASS IN\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 8\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 1\n");
+ (void) HDfprintf(sp, "OUTPUT-CLASS IN\n");
+ (void) HDfprintf(sp, "OUTPUT-SIZE 8\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 4\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
}
diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt
index cc70adc..6fdf7b0 100644
--- a/tools/test/h5jam/CMakeLists.txt
+++ b/tools/test/h5jam/CMakeLists.txt
@@ -4,26 +4,36 @@ project (HDF5_TOOLS_TEST_H5JAM C)
# --------------------------------------------------------------------
# Add the h5jam test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5jamgentest ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/h5jamgentest.c)
- target_include_directories(h5jamgentest PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5jamgentest PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5jamgentest STATIC)
target_link_libraries (h5jamgentest PRIVATE ${HDF5_LIB_TARGET})
set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>)
+ #add_test (NAME h5jamgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jamgentest>)
endif ()
add_executable (getub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/getub.c)
-target_include_directories(getub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (getub STATIC)
-target_link_libraries (getub PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_include_directories (getub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (getub STATIC)
+ target_link_libraries (getub PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (getub SHARED)
+ target_link_libraries (getub PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (getub PROPERTIES FOLDER tools)
add_executable (tellub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/tellub.c)
-target_include_directories(tellub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (tellub STATIC)
-target_link_libraries (tellub PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_include_directories (tellub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (tellub STATIC)
+ target_link_libraries (tellub PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (tellub SHARED)
+ target_link_libraries (tellub PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (tellub PROPERTIES FOLDER tools)
include (CMakeTests.cmake)
diff --git a/tools/test/h5jam/CMakeTests.cmake b/tools/test/h5jam/CMakeTests.cmake
index 2d00b86..f108afc 100644
--- a/tools/test/h5jam/CMakeTests.cmake
+++ b/tools/test/h5jam/CMakeTests.cmake
@@ -47,6 +47,12 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
# ============================================================
# TEST_H5JAM_OUTPUT
# For the purpose to verify only output & exitcode from h5jam
@@ -54,22 +60,16 @@
macro (TEST_H5JAM_OUTPUT expectfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5JAM-${expectfile} COMMAND $<TARGET_FILE:h5jam> ${ARGN})
- if (NOT "${resultcode}" STREQUAL "0")
+ add_test (NAME H5JAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> ${ARGN})
+ if (${resultcode})
set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true")
endif ()
else ()
add_test (
- NAME H5JAM-${expectfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${expectfile}.out
- ${expectfile}.out.err
- )
- add_test (
NAME H5JAM-${expectfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5jam>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5jam${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${expectfile}.out"
@@ -79,7 +79,6 @@
-D "TEST_REFERENCE=testfiles/${expectfile}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5JAM-${expectfile} PROPERTIES DEPENDS "H5JAM-${expectfile}-clear-objects")
endif ()
endmacro ()
@@ -90,22 +89,16 @@
macro (TEST_H5UNJAM_OUTPUT expectfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND $<TARGET_FILE:h5unjam> ${ARGN})
- if (NOT "${resultcode}" STREQUAL "0")
+ add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> ${ARGN})
+ if (${resultcode})
set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true")
endif ()
else ()
add_test (
- NAME H5JAM-UNJAM-${expectfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${expectfile}.out
- ${expectfile}.out.err
- )
- add_test (
NAME H5JAM-UNJAM-${expectfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${expectfile}.out"
@@ -113,7 +106,6 @@
-D "TEST_REFERENCE=testfiles/${expectfile}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS "H5JAM-UNJAM-${expectfile}-clear-objects")
endif ()
endmacro ()
@@ -121,19 +113,10 @@
# If using memchecker add tests without using scripts
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5JAM-${testname}-CHECKFILE-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${actual}.new
- ${actual}.new.err
- ${actual}.out
- ${actual}.out.err
- )
- set_tests_properties (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends})
- add_test (
NAME H5JAM-${testname}-CHECKFILE-H5DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=testfiles/${expected}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${actual}.new"
@@ -142,11 +125,12 @@
-D "TEST_SKIP_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects)
+ set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS ${testdepends})
add_test (
NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${actual}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${actual}.out"
@@ -181,7 +165,7 @@
COMMAND ${CMAKE_COMMAND} -E remove ${ufile}
)
set_tests_properties (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
- add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -u ${ufile} -o ${outfile})
+ add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -u ${ufile} -o ${outfile})
set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects)
set (compare_test ${ufile})
else ()
@@ -189,7 +173,8 @@
add_test (
NAME H5JAM-${testname}-UNJAM
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>"
-D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${outfile}.ufile.txt"
@@ -200,16 +185,15 @@
set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
set (compare_test "${outfile}.ufile.txt")
else ()
- add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile})
+ add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -o ${outfile})
set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
set (compare_test "")
endif ()
endif ()
- if (NOT "${compare_test}" STREQUAL "")
+ if (${compare_test})
add_test (
NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
${infile}.len.txt
${infile}.cmp
${infile}-ub.cmp
@@ -218,6 +202,7 @@
add_test (
NAME H5JAM-${testname}-UNJAM-CHECK_UB_1
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:tellub>"
-D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>"
-D "TEST_CHECKUB=YES"
@@ -234,6 +219,7 @@
add_test (
NAME H5JAM-${testname}-UNJAM-CHECK_NOUB
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:tellub>"
-D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>"
-D "TEST_CHECKUB=NO"
@@ -244,7 +230,7 @@
-D "TEST_OFILE=NULL"
-P "${HDF_RESOURCES_DIR}/userblockTest.cmake"
)
- if (NOT "${compare_test}" STREQUAL "")
+ if (${compare_test})
set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1)
else ()
set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM)
@@ -261,7 +247,7 @@
COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5
)
endif ()
- add_test (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN})
+ add_test (NAME H5JAM-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN})
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
set_tests_properties (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects)
set (compare_test ${outfile})
@@ -272,8 +258,7 @@
add_test (
NAME H5JAM-${testname}-CHECK_UB_1-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
${compare_test}.len.txt
${compare_test}.cmp
${compare_test}-ub.cmp
@@ -282,6 +267,7 @@
add_test (
NAME H5JAM-${testname}-CHECK_UB_1
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:tellub>"
-D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>"
-D "TEST_CHECKUB=YES"
@@ -316,7 +302,7 @@
)
set_tests_properties (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP)
- add_test (NAME H5JAM-${testname}_NONE COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i ${chkfile} ${ARGN})
+ add_test (NAME H5JAM-${testname}_NONE COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i ${chkfile} ${ARGN})
set_tests_properties (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY)
set (compare_test ${chkfile})
@@ -327,8 +313,7 @@
add_test (
NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
${compare_test}.len.txt
${compare_test}.cmp
${compare_test}-ub.cmp
@@ -337,6 +322,7 @@
add_test (
NAME H5JAM-${testname}_NONE-CHECK_UB_1
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:tellub>"
-D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>"
-D "TEST_CHECKUB=YES"
diff --git a/tools/test/h5jam/Makefile.in b/tools/test/h5jam/Makefile.in
index 1517f52..5ac0d40 100644
--- a/tools/test/h5jam/Makefile.in
+++ b/tools/test/h5jam/Makefile.in
@@ -487,7 +487,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -510,9 +509,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -539,6 +541,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -593,6 +596,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -617,7 +621,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1267,7 +1270,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c
index 1644440..56b4ead 100644
--- a/tools/test/h5jam/h5jamgentest.c
+++ b/tools/test/h5jam/h5jamgentest.c
@@ -172,7 +172,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "abcdefghi");
+ HDsprintf(buf, "abcdefghi");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -203,7 +203,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "1st attribute of dset1.1.1");
+ HDsprintf(buf, "1st attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -211,7 +211,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "2nd attribute of dset1.1.1");
+ HDsprintf(buf, "2nd attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c
index ea362f5..2fce729 100644
--- a/tools/test/h5jam/tellub.c
+++ b/tools/test/h5jam/tellub.c
@@ -126,7 +126,7 @@ main (int argc, const char *argv[])
ifname = HDstrdup(argv[opt_ind]);
- testval = H5Fis_hdf5 (ifname);
+ testval = H5Fis_hdf5 (ifname);
if(testval <= 0) {
error_msg("Input HDF5 file is not HDF \"%s\"\n", ifname);
diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt
index dc5804c..0da03c5 100644
--- a/tools/test/h5ls/CMakeLists.txt
+++ b/tools/test/h5ls/CMakeLists.txt
@@ -5,15 +5,15 @@ project (HDF5_TOOLS_TEST_H5LS C)
# If plugin library tests can be tested
#-----------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
- set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibls")
- set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
- set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
+ set (H5LS_TOOL_PLUGIN_LIB_CORENAME "dynlibls")
+ set (H5LS_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5LS_TOOL_PLUGIN_LIB_CORENAME}")
+ set (H5LS_TOOL_PLUGIN_LIB_TARGET ${H5LS_TOOL_PLUGIN_LIB_CORENAME})
- add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_ls.c)
- target_include_directories(${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIB_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
+ add_library (${H5LS_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_ls.c)
+ target_include_directories (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5LS_TOOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5LS_TOOL_PLUGIN_LIB_TARGET} ${H5LS_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
# make plugins dir
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
@@ -21,12 +21,12 @@ if (BUILD_SHARED_LIBS)
# Copy plugin library to a plugins folder
#-----------------------------------------------------------------------------
add_custom_command (
- TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET}
+ TARGET ${H5LS_TOOL_PLUGIN_LIB_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
+ "$<TARGET_FILE:${H5LS_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5LS_TOOL_PLUGIN_LIB_TARGET}>"
)
endif ()
diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake
index 116d097..2f3f3ab 100644
--- a/tools/test/h5ls/CMakeTests.cmake
+++ b/tools/test/h5ls/CMakeTests.cmake
@@ -134,30 +134,27 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_H5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN})
+ add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN})
set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
else ()
# Remove any output file left over from previous test run
add_test (
- NAME H5LS-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${resultfile}.out
- testfiles/${resultfile}.out.err
- )
- add_test (
NAME H5LS-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -165,34 +162,23 @@
-D "TEST_REFERENCE=${resultfile}.ls"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS H5LS-${resultfile}-clear-objects)
endif ()
endmacro ()
macro (ADD_H5_ERR_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN})
+ add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls> ${ARGN})
set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME H5LS-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${resultfile}.out
- testfiles/${resultfile}.out.err
- )
add_test (
NAME H5LS-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -201,24 +187,16 @@
-D "TEST_ERRREF=${resultfile}.err"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS H5LS-${resultfile}-clear-objects)
endif ()
endmacro ()
macro (ADD_H5_UD_TEST testname resultcode resultfile)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5LS_UD-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${resultfile}.out
- testfiles/${resultfile}.out.err
- )
add_test (
NAME H5LS_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -226,9 +204,9 @@
-D "TEST_REFERENCE=${resultfile}.ls"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clear-objects)
endif ()
endmacro ()
@@ -238,128 +216,6 @@
##############################################################################
##############################################################################
- if (HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5LS-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- help-1.out
- help-1.out.err
- help-2.out
- help-2.out.err
- help-3.out
- help-3.out.err
- nosuchfile.out
- nosuchfile.out.err
- tall-1.out
- tall-1.out.err
- tall-2.out
- tall-2.out.err
- tarray1.out
- tarray1.out.err
- tattr2.out
- tattr2.out.err
- tcomp-1.out
- tcomp-1.out.err
- tdataregbe.out
- tdataregbe.out.err
- tdataregle.out
- tdataregle.out.err
- tdset-1.out
- tdset-1.out.err
- tempty.out
- tempty.out.err
- textlink-1.out
- textlink-1.out.err
- textlinksrc-1.out
- textlinksrc-1.out.err
- textlinksrc-2.out
- textlinksrc-2.out.err
- textlinksrc-3.out
- textlinksrc-3.out.err
- textlinksrc-4.out
- textlinksrc-4.out.err
- textlinksrc-5.out
- textlinksrc-5.out.err
- textlinksrc-6.out
- textlinksrc-6.out.err
- textlinksrc-7.out
- textlinksrc-7.out.err
- textlinksrc-1-old.out
- textlinksrc-1-old.out.err
- textlinksrc-2-old.out
- textlinksrc-2-old.out.err
- textlinksrc-3-old.out
- textlinksrc-3-old.out.err
- textlinksrc-6-old.out
- textlinksrc-6-old.out.err
- textlinksrc-7-old.out
- textlinksrc-7-old.out.err
- tgrp_comments.out
- tgrp_comments.out.err
- tgrpnullspace.out
- tgrpnullspace.out.err
- tsoftlinks-1.out
- tsoftlinks-1.out.err
- tsoftlinks-2.out
- tsoftlinks-2.out.err
- tsoftlinks-3.out
- tsoftlinks-3.out.err
- tsoftlinks-4.out
- tsoftlinks-4.out.err
- tsoftlinks-5.out
- tsoftlinks-5.out.err
- textlinksrc-nodangle-1.out
- textlinksrc-nodangle-1.out.err
- textlinksrc-nodangle-2.out
- textlinksrc-nodangle-2.out.err
- tsoftlinks-nodangle-1.out
- tsoftlinks-nodangle-1.out.err
- thlinks-nodangle-1.out
- thlinks-nodangle-1.out.err
- tgroup.out
- tgroup.out.err
- tgroup-1.out
- tgroup-1.out.err
- tgroup-2.out
- tgroup-2.out.err
- tgroup-3.out
- tgroup-3.out.err
- thlink-1.out
- thlink-1.out.err
- tloop-1.out
- tloop-1.out.err
- tnestcomp-1.out
- tnestcomp-1.out.err
- tnestcomp-2.out
- tnestcomp-2.out.err
- tnestcomp-3.out
- tnestcomp-3.out.err
- tnestcomp-4.out
- tnestcomp-4.out.err
- tsaf.out
- tsaf.out.err
- tslink-1.out
- tslink-1.out.err
- tstr-1.out
- tstr-1.out.err
- tudlink-1.out
- tudlink-1.out.err
- tvldtypes1.out
- tvldtypes1.out.err
- tvldtypes2le.out
- tvldtypes2le.out.err
- tvldtypes2be.out
- tvldtypes2be.out.err
- )
- set_tests_properties (H5LS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5LS-clearall-objects")
- endif ()
-
# See which filters are usable (and skip tests for filters we
# don't have). Do this by searching H5pubconf.h to see which
# filters are defined.
diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake
index 2b6f61e..cf5b6d7 100644
--- a/tools/test/h5ls/CMakeTestsVDS.cmake
+++ b/tools/test/h5ls/CMakeTestsVDS.cmake
@@ -80,30 +80,26 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_H5_VDS_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN})
+ add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN})
set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
else ()
add_test (
- NAME H5LS-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5LS-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- add_test (
NAME H5LS-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -111,37 +107,26 @@
-D "TEST_REFERENCE=${resultfile}.ls"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS H5LS-${resultfile}-clear-objects)
endif ()
endmacro ()
macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN})
+ add_test (NAME H5LS_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN})
set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES
ENVIRONMENT "HDF5_VDS_PREFIX=\${ORIGIN}"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
)
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
else ()
add_test (
- NAME H5LS_PREFIX-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix")
- add_test (
NAME H5LS_PREFIX-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=vds/prefix/${resultfile}.out"
@@ -151,7 +136,6 @@
-D "TEST_ENV_VALUE=\${ORIGIN}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS H5LS_PREFIX-${resultfile}-clear-objects)
endif ()
endmacro ()
@@ -161,44 +145,6 @@
##############################################################################
##############################################################################
- if (HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5LS_VDS-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- tvds-1.out
- tvds-1.out.err
- tvds-2.out
- tvds-2.out.err
- tvds-3_1.out
- tvds-3_1.out.err
- tvds-3_2.out
- tvds-3_2.out.err
- tvds-4.out
- tvds-4.out.err
- tvds-5.out
- tvds-5.out.err
- tvds_layout-1.out
- tvds_layout-1.out.err
- tvds_layout-2.out
- tvds_layout-2.out.err
- tvds_layout-3_1.out
- tvds_layout-3_1.out.err
- tvds_layout-3_2.out
- tvds_layout-3_2.out.err
- tvds_layout-4.out
- tvds_layout-4.out.err
- tvds_layout-5.out
- tvds_layout-5.out.err
- )
- set_tests_properties (H5LS_VDS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5LS_VDS-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5LS_VDS-clearall-objects")
- endif ()
-
ADD_H5_VDS_TEST (tvds-1 0 -w80 -v -S 1_vds.h5)
ADD_H5_VDS_TEST (tvds-2 0 -w80 -v -S 2_vds.h5)
ADD_H5_VDS_TEST (tvds-3_1 0 -w80 -v -S 3_1_vds.h5)
diff --git a/tools/test/h5ls/Makefile.in b/tools/test/h5ls/Makefile.in
index faa88ce..0ebfcff 100644
--- a/tools/test/h5ls/Makefile.in
+++ b/tools/test/h5ls/Makefile.in
@@ -488,7 +488,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -511,9 +510,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -540,6 +542,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -594,6 +597,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -618,7 +622,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1267,7 +1270,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt
index 890d5d2..f81ce4f 100644
--- a/tools/test/h5repack/CMakeLists.txt
+++ b/tools/test/h5repack/CMakeLists.txt
@@ -2,14 +2,19 @@ cmake_minimum_required (VERSION 3.10)
project (HDF5_TOOLS_TEST_H5REPACK C)
# --------------------------------------------------------------------
-# Add h5Repack test executables
+# Add h5repack test executables
# --------------------------------------------------------------------
add_executable (testh5repack_detect_szip ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c)
-target_include_directories(testh5repack_detect_szip
+target_include_directories (testh5repack_detect_szip
PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
-TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC)
-target_link_libraries (testh5repack_detect_szip PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC)
+ target_link_libraries (testh5repack_detect_szip PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (testh5repack_detect_szip SHARED)
+ target_link_libraries (testh5repack_detect_szip PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
+endif ()
set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools)
set (REPACK_COMMON_SOURCES
@@ -22,35 +27,40 @@ set (REPACK_COMMON_SOURCES
${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.c
)
add_executable (h5repacktest ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/h5repacktst.c)
-target_include_directories(h5repacktest
+target_include_directories (h5repacktest
PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
-TARGET_C_PROPERTIES (h5repacktest STATIC)
-target_link_libraries (h5repacktest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5repacktest STATIC)
+ target_link_libraries (h5repacktest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5repacktest SHARED)
+ target_link_libraries (h5repacktest PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
+endif ()
set_target_properties (h5repacktest PROPERTIES FOLDER tools)
#-----------------------------------------------------------------------------
# If plugin library tests can be tested
#-----------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
- set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd")
- set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
- set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
- set (HDF5_TOOL_PLUGIN_LIB_VCORENAME "dynlibvers")
- set (HDF5_TOOL_PLUGIN_LIB_VNAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_VCORENAME}")
- set (HDF5_TOOL_PLUGIN_LIB_VTARGET ${HDF5_TOOL_PLUGIN_LIB_VCORENAME})
+ set (H5REPACK_TOOL_PLUGIN_LIB_CORENAME "dynlibadd")
+ set (H5REPACK_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5REPACK_TOOL_PLUGIN_LIB_CORENAME}")
+ set (H5REPACK_TOOL_PLUGIN_LIB_TARGET ${H5REPACK_TOOL_PLUGIN_LIB_CORENAME})
+ set (H5REPACK_TOOL_PLUGIN_LIB_VCORENAME "dynlibvers")
+ set (H5REPACK_TOOL_PLUGIN_LIB_VNAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5REPACK_TOOL_PLUGIN_LIB_VCORENAME}")
+ set (H5REPACK_TOOL_PLUGIN_LIB_VTARGET ${H5REPACK_TOOL_PLUGIN_LIB_VCORENAME})
- add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.c)
- target_include_directories(${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIB_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
+ add_library (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.c)
+ target_include_directories (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} ${H5REPACK_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
- add_library (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c)
- target_include_directories(${HDF5_TOOL_PLUGIN_LIB_VTARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED)
- target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_VTARGET} PRIVATE ${HDF5_TEST_LIB_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB")
+ add_library (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c)
+ target_include_directories (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} SHARED)
+ target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} ${H5REPACK_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB")
# make plugins dir
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
@@ -58,21 +68,34 @@ if (BUILD_SHARED_LIBS)
# Copy plugin library to a plugins folder
#-----------------------------------------------------------------------------
add_custom_command (
- TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET}
+ TARGET ${H5REPACK_TOOL_PLUGIN_LIB_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
+ "$<TARGET_FILE:${H5REPACK_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5REPACK_TOOL_PLUGIN_LIB_TARGET}>"
)
add_custom_command (
- TARGET ${HDF5_TOOL_PLUGIN_LIB_VTARGET}
+ TARGET ${H5REPACK_TOOL_PLUGIN_LIB_VTARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_VTARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_VTARGET}>"
+ "$<TARGET_FILE:${H5REPACK_TOOL_PLUGIN_LIB_VTARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5REPACK_TOOL_PLUGIN_LIB_VTARGET}>"
)
endif ()
+# --------------------------------------------------------------------
+# Add the h5repack test executable
+# --------------------------------------------------------------------
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+ add_executable (h5repackgentest ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/h5repackgentest.c)
+ target_include_directories (h5repackgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5repackgentest STATIC)
+ target_link_libraries (h5repackgentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5repackgentest PROPERTIES FOLDER generator/tools)
+
+ #add_test (NAME h5repackgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repackgentest>)
+endif ()
+
include (CMakeTests.cmake)
diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake
index c2a2be7..c8db1c3 100644
--- a/tools/test/h5repack/CMakeTests.cmake
+++ b/tools/test/h5repack/CMakeTests.cmake
@@ -26,10 +26,23 @@
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_deflate.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_early.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_f32le.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_f32le_ex-0.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_f32le_ex.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fill.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_filters.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fletcher.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_hlink.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_1d.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_1d_ex-0.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_1d_ex-1.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_1d_ex.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_2d.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_2d_ex-0.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_2d_ex.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_3d.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_3d_ex-0.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_3d_ex.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layouto.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout2.h5
@@ -44,6 +57,12 @@
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_shuffle.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_soffset.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_szip.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_uint8be.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_uint8be_ex-0.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_uint8be_ex-1.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_uint8be_ex-2.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_uint8be_ex-3.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_uint8be_ex.h5
# fsm
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_aggr.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fsm_aggr_nopersist.h5
@@ -157,30 +176,25 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_HELP_TEST testname resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5REPACK-h5repack-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN})
- set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5REPACK-h5repack-${testname}")
- else ()
- add_test (
- NAME H5REPACK-h5repack-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/h5repack-${testname}.out
- testfiles/h5repack-${testname}.out.err
+ add_test (NAME H5REPACK-h5repack-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN})
+ set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+ else ()
add_test (
NAME H5REPACK-h5repack-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=h5repack-${testname}.out"
@@ -188,39 +202,43 @@
-D "TEST_REFERENCE=h5repack-${testname}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS H5REPACK-h5repack-${testname}-clear-objects)
endif ()
+ set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
+ )
endmacro ()
macro (ADD_H5_TEST_OLD testname testtype testfile)
- if ("${testtype}" STREQUAL "SKIP")
- if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ if ("${testtype}" STREQUAL "SKIP")
add_test (
NAME H5REPACK_OLD-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}"
)
set_property(TEST H5REPACK_OLD-${testname} PROPERTY DISABLED)
+ else ()
+ add_test (
+ NAME H5REPACK_OLD-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_OLD-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
+ )
+ add_test (
+ NAME H5REPACK_OLD-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES
+ DEPENDS H5REPACK_OLD-${testname}-clear-objects
+ )
+ add_test (
+ NAME H5REPACK_OLD-${testname}_DFF
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES
+ DEPENDS H5REPACK_OLD-${testname}
+ )
endif ()
- else ()
- add_test (
- NAME H5REPACK_OLD-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${testfile}
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_OLD-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- add_test (
- NAME H5REPACK_OLD-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
- )
- set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES DEPENDS H5REPACK_OLD-${testname}-clear-objects)
- add_test (
- NAME H5REPACK_OLD-${testname}_DFF
- COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
- )
- set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname})
endif ()
endmacro ()
@@ -236,23 +254,25 @@
else ()
add_test (
NAME H5REPACK-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK-${testname}
- COMMAND $<TARGET_FILE:h5repack> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK-${testname} PROPERTIES
+ DEPENDS H5REPACK-${testname}-clear-objects
)
- set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS H5REPACK-${testname}-clear-objects)
add_test (
NAME H5REPACK-${testname}_DFF
- COMMAND $<TARGET_FILE:h5diff> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES
+ DEPENDS H5REPACK-${testname}
)
- set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname})
endif ()
endmacro ()
@@ -270,27 +290,21 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_CMP-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test})
- endif ()
else ()
add_test (
NAME H5REPACK_CMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${resultfile}
- testfiles/${resultfile}-${testname}.out
- testfiles/${resultfile}-${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_CMP-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
@@ -299,12 +313,14 @@
-D "TEST_REFERENCE=${resultfile}-${testname}.tst"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS H5REPACK_CMP-${testname}-clear-objects)
+ set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES
+ DEPENDS H5REPACK_CMP-${testname}-clear-objects
+ )
endif ()
endif ()
endmacro ()
- macro (ADD_H5_MASK_TEST testname testtype resultcode resultfile)
+ macro (ADD_H5_MASK_TEST testname testtype resultcode result_errcheck resultfile)
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
@@ -318,35 +334,32 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_MASK-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS ${last_test})
- endif ()
else (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_MASK-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${resultfile}
- testfiles/${resultfile}-${testname}.out
- testfiles/${resultfile}-${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_MASK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_MASK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_MASK-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
-D "TEST_EXPECT=${resultcode}"
- -D "TEST_MASK_ERROR=true"
+ -D "TEST_SKIP_COMPARE=true"
-D "TEST_REFERENCE=${resultfile}.mty"
- -D "TEST_ERRREF=${resultfile}-${testname}.tst"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ -D "TEST_ERRREF=${result_errcheck}"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS H5REPACK_MASK-${testname}-clear-objects)
endif ()
@@ -365,25 +378,24 @@
else ()
add_test (
NAME H5REPACK_DMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${resultfile}
- testfiles/${resultfile}-${testname}.out
- testfiles/${resultfile}-${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_DMP-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_DMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_DMP-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES
+ DEPENDS H5REPACK_DMP-${testname}-clear-objects
)
- set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS H5REPACK_DMP-${testname}-clear-objects)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_DMP-h5dump-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-q;creation_order;-pH;out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
@@ -391,7 +403,9 @@
-D "TEST_REFERENCE=${testname}.${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}")
+ set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES
+ DEPENDS "H5REPACK_DMP-${testname}"
+ )
endif ()
endif ()
endmacro ()
@@ -408,25 +422,24 @@
else ()
add_test (
NAME H5REPACK_STAT-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${statarg}.${resultfile}
- testfiles/${resultfile}-${testname}.out
- testfiles/${resultfile}-${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${statarg}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_STAT-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_STAT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_STAT-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES
+ DEPENDS H5REPACK_STAT-${testname}-clear-objects
)
- set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES DEPENDS H5REPACK_STAT-${testname}-clear-objects)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_STAT-h5stat-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5stat>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>"
-D "TEST_ARGS:STRING=-S;-s;out-${statarg}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
@@ -434,7 +447,9 @@
-D "TEST_REFERENCE=${statarg}.${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK_STAT-h5stat-${testname} PROPERTIES DEPENDS "H5REPACK_STAT-${testname}")
+ set_tests_properties (H5REPACK_STAT-h5stat-${testname} PROPERTIES
+ DEPENDS "H5REPACK_STAT-${testname}"
+ )
endif ()
endif ()
endmacro ()
@@ -452,30 +467,31 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${testfile}
- testfiles/${testfile}-${testname}-v.out
- testfiles/${testfile}-${testname}-v.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_VERIFY_LAYOUT-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES
+ DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects
)
- set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects)
add_test (
NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF
- COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
- set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname})
- if ("${resultcode}" STREQUAL "0")
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES
+ DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}
+ )
+ if (NOT ${resultcode})
add_test (
NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
@@ -484,7 +500,9 @@
-D "TEST_REFERENCE=${testfilter}"
-P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
- set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF)
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES
+ DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF
+ )
else ()
if ("${testfilter}" STREQUAL "CHUNKED")
set (nottestfilter "(CONTIGUOUS|COMPACT)")
@@ -498,7 +516,8 @@
add_test (
NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-pH;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
@@ -507,7 +526,9 @@
-D "TEST_REFERENCE=${testfilter}"
-P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
- set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF)
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES
+ DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF
+ )
endif ()
endif ()
endif ()
@@ -527,25 +548,24 @@
# Remove any output file left over from previous test run
add_test (
NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${testfile}
- testfiles/${testfile}-${testname}-v.out
- testfiles/${testfile}-${testname}-v.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects
)
- set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects)
add_test (
NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-d;${testdset};-p;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
@@ -553,8 +573,10 @@
-D "TEST_REFERENCE=${testfile}-${testname}-v.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname})
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}
+ )
endif ()
endif ()
endmacro ()
@@ -564,24 +586,23 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${testfile}
- testfiles/${testfile}-${testname}-v.out
- testfiles/${testfile}-${testname}-v.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}
- COMMAND $<TARGET_FILE:h5repack> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES
+ DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects
)
- set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects)
add_test (
NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
@@ -590,28 +611,27 @@
-D "TEST_REFERENCE=SUPERBLOCK_VERSION ${superblock}"
-P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
- set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname})
+ set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES
+ DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}
+ )
endif ()
endmacro ()
macro (ADD_H5_VERIFY_INVALIDBOUNDS testname resultcode lowbound highbound)
add_test (
NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}
- COMMAND $<TARGET_FILE:h5repack> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
- set_tests_properties (
- ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES
- DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects
- WILL_FAIL "true"
+ set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES
+ DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects
+ WILL_FAIL "true"
)
endmacro ()
@@ -619,28 +639,33 @@
# Remove any output file left over from previous test run
add_test (
NAME H5REPACK_META-${testname}_N-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
testfiles/out-${testname}_N.${testname}.h5
testfiles/out-${testname}_M.${testname}.h5
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_META-${testname}_N-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+ set_tests_properties (H5REPACK_META-${testname}_N-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
+ )
add_test (
NAME H5REPACK_META-${testname}_N
- COMMAND $<TARGET_FILE:h5repack> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5
+ )
+ set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES
+ DEPENDS H5REPACK_META-${testname}_N-clear-objects
)
- set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES DEPENDS H5REPACK_META-${testname}_N-clear-objects)
add_test (
NAME H5REPACK_META-${testname}_M
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5
+ )
+ set_tests_properties (H5REPACK_META-${testname}_M PROPERTIES
+ DEPENDS H5REPACK_META-${testname}_N
)
- set_tests_properties (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N)
add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5)
- set_tests_properties (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true")
- set_tests_properties (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M)
+ set_tests_properties (H5REPACK_META-${testname} PROPERTIES
+ WILL_FAIL "true"
+ DEPENDS H5REPACK_META-${testname}_M
+ )
endmacro ()
macro (ADD_H5_UD_TEST testname resultcode resultfile)
@@ -648,21 +673,16 @@
# Remove any output file left over from previous test run
add_test (
NAME H5REPACK_UD-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${resultfile}
- testfiles/${testname}.${resultfile}.out
- testfiles/${testname}.${resultfile}.out.err
- testfiles/${resultfile}-${testname}.out
- testfiles/${resultfile}-${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_UD-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_UD-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repack-shared>"
-D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_EXPECT=${resultcode}"
@@ -671,13 +691,17 @@
-D "TEST_REFERENCE=${testname}.${resultfile}.tst"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clear-objects)
+ set_tests_properties (H5REPACK_UD-${testname} PROPERTIES
+ DEPENDS H5REPACK_UD-${testname}-clear-objects
+ )
add_test (
NAME H5REPACK_UD-${testname}-h5dump
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump-shared>"
-D "TEST_ARGS:STRING=-pH;out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
@@ -685,9 +709,110 @@
-D "TEST_REFERENCE=${resultfile}-${testname}.ddl"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK_UD-${testname}-h5dump PROPERTIES DEPENDS "H5REPACK_UD-${testname}")
+ set_tests_properties (H5REPACK_UD-${testname}-h5dump PROPERTIES
+ DEPENDS "H5REPACK_UD-${testname}"
+ )
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5_EXTERNAL_TEST testname testtype testfile)
+ # canonical file = h5repack_${testfile}.h5 - preexist
+ # external file = h5repack_${testfile}_ex.h5 - preexist
+ # repacked file = h5repack_${testfile}_rp.h5 - created
+ # external data file = h5repack_${testfile}_ex-0.dat
+ if ("${testtype}" STREQUAL "SKIP")
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}
+ COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}"
+ )
+ set_property(TEST H5REPACK_EXTERNAL-${testname} PROPERTY DISABLED)
+ endif ()
+ else ()
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_rp.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}-clear-objects PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ FIXTURES_REQUIRED clear_h5repack
+ )
+ # make sure external data file 0 is available
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_CPY
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${PROJECT_SOURCE_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" "${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex-0.dat"
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_CPY PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}-clear-objects
+ )
+ # comparison of known files
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF1
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF1 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_CPY
+ )
+ # repack the external file to the repacked file
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF1
+ )
+ # comparison of repacked file to known files
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF2
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF2 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}
+ )
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF3
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF3 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF2
+ )
+ # invalidate external file by removing its first data file
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DATA_RMV
+ COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_ex-0.dat
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DATA_RMV PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF3
+ )
+ # verify comparison of repacked file to known file
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF4
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF4 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DATA_RMV
+ )
+ # verify comparison of repacked file to known external file fails
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF_FAIL
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF_FAIL PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF4
+ WILL_FAIL "true"
+ )
endif ()
endmacro ()
@@ -719,6 +844,7 @@
set (FILE15 h5repack_named_dtypes.h5)
set (FILE16 tfamily%05d.h5) # located in common testfiles folder
set (FILE18 h5repack_layout2.h5)
+ set (FILE19 h5repack_layout3.h5)
set (FILE_REF h5repack_refs.h5)
set (FILE_ATTR_REF h5repack_attr_refs.h5)
set (FILEV1 1_vds.h5)
@@ -731,67 +857,6 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
# Remove any output file left over from previous test run
set (LIST_TO_CLEAR
- h5dump-help.out
- h5repack_layout.h5-chunk_18x13-v.out
- h5repack_layout.h5-chunk_18x13-v.out.err
- h5repack_layout.h5-chunk_20x10-v.out
- h5repack_layout.h5-chunk_20x10-v.out.err
- h5repack_layout.h5-chunk_compa-v.out
- h5repack_layout.h5-chunk_compa-v.out.err
- h5repack_layout.h5-chunk_conti-v.out
- h5repack_layout.h5-chunk_conti-v.out.err
- h5repack_layout.h5-compa-v.out
- h5repack_layout.h5-compa-v.out.err
- h5repack_layout.h5-conti-v.out
- h5repack_layout.h5-conti-v.out.err
- h5repack_layout.h5-deflate_limit.out
- h5repack_layout.h5-deflate_limit.out.err
- h5repack_layout.h5-dset2_chunk_20x10-v.out
- h5repack_layout.h5-dset2_chunk_20x10-v.out.err
- h5repack_layout.h5-dset2_chunk_20x10-errstk.out
- h5repack_layout.h5-dset2_chunk_20x10-errstk.out.err
- h5repack_layout.h5-dset2_compa-v.out
- h5repack_layout.h5-dset2_compa-v.out.err
- h5repack_layout.h5-dset2_conti-v.out
- h5repack_layout.h5-dset2_conti-v.out.err
- h5repack_layout.h5-dset_compa_chunk-v.out
- h5repack_layout.h5-dset_compa_chunk-v.out.err
- h5repack_layout.h5-dset_compa_compa-v.out
- h5repack_layout.h5-dset_compa_compa-v.out.err
- h5repack_layout.h5-dset_compa_conti-v.out
- h5repack_layout.h5-dset_compa_conti-v.out.err
- h5repack_layout.h5-dset_conti_chunk-v.out
- h5repack_layout.h5-dset_conti_chunk-v.out.err
- h5repack_layout.h5-dset_conti_compa-v.out
- h5repack_layout.h5-dset_conti_compa-v.out.err
- h5repack_layout.h5-dset_conti_conti-v.out
- h5repack_layout.h5-dset_conti_conti-v.out.err
- h5repack_layout.h5-layout_long_switches-v.out
- h5repack_layout.h5-layout_long_switches-v.out.err
- h5repack_layout.h5-layout_short_switches-v.out
- h5repack_layout.h5-layout_short_switches-v.out.err
- h5repack_layout.h5-plugin_test.out
- h5repack_layout.h5-plugin_test.out.err
- h5repack_layout2.h5-contig_small_compa-v.out
- h5repack_layout2.h5-contig_small_compa-v.out.err
- h5repack_layout2.h5-contig_small_fixed_compa-v.out
- h5repack_layout2.h5-contig_small_fixed_compa-v.out.err
- h5repack_layout3.h5-ckdim_biger-v.out
- h5repack_layout3.h5-ckdim_biger-v.out.err
- h5repack_layout3.h5-ckdim_smaller-v.out
- h5repack_layout3.h5-ckdim_smaller-v.out.err
- h5repack_layout3.h5-chunk2chunk-v.out
- h5repack_layout3.h5-chunk2chunk-v.out.err
- h5repack_layout3.h5-chunk2compa-v.out
- h5repack_layout3.h5-chunk2compa-v.out.err
- h5repack_layout3.h5-chunk2conti-v.out
- h5repack_layout3.h5-chunk2conti-v.out.err
- h5repack_layout3.h5-error1-v.out
- h5repack_layout3.h5-error1-v.out.err
- h5repack_layout3.h5-error2-v.out
- h5repack_layout3.h5-error2-v.out.err
- h5repack_layout3.h5-error3-v.out
- h5repack_layout3.h5-error3-v.out.err
out-family.tfamily%05d.h5
out-HDFFV-7840.h5diff_attr1.h5
out-attr.h5repack_attr.h5
@@ -900,15 +965,15 @@
NAME H5REPACK-clearall-objects
COMMAND ${CMAKE_COMMAND} -E remove ${LIST_TO_CLEAR}
)
- set_tests_properties (H5REPACK-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+ set_tests_properties (H5REPACK-clearall-objects PROPERTIES
+ FIXTURES_SETUP clear_h5repack
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
endif ()
ADD_HELP_TEST(help 0 -h)
- add_test (NAME H5REPACK-testh5repack_detect_szip COMMAND $<TARGET_FILE:testh5repack_detect_szip>)
+ add_test (NAME H5REPACK-testh5repack_detect_szip COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testh5repack_detect_szip>)
if (HDF5_ENABLE_SZIP_SUPPORT)
if (HDF5_ENABLE_SZIP_ENCODING)
set (passRegex "yes")
@@ -922,11 +987,11 @@
set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no")
endif ()
set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects)
+ set (last_test "H5REPACK-testh5repack_detect_szip")
- add_test (NAME H5REPACK-h5repacktest COMMAND $<TARGET_FILE:h5repacktest>)
- set_tests_properties (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip)
- set (last_test "H5REPACK-h5repacktest")
-
+# add_test (NAME H5REPACK-h5repacktest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repacktest>)
+# set_tests_properties (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip)
+# set (last_test "H5REPACK-h5repacktest")
#
# The tests
# We use the files generated by h5repacktst
@@ -1222,7 +1287,7 @@
ADD_H5_VERIFY_TEST (conti "TEST" 1 ${FILE4} null CONTIGUOUS -l CONTI)
ADD_H5_VERIFY_TEST (dset2_compa "TEST" 0 ${FILE4} dset2 COMPACT -l dset2:COMPA)
ADD_H5_VERIFY_TEST (compa "TEST" 1 ${FILE4} null COMPACT -l COMPA)
- ADD_H5_MASK_TEST (dset2_chunk_20x10-errstk "TEST" 0 ${FILE4} --layout=dset2:CHUNK=20x10x5 --enable-error-stack)
+ ADD_H5_MASK_TEST (dset2_chunk_20x10-errstk "TEST" 0 "dimensionality of chunks doesn't match the dataspace" ${FILE4} --layout=dset2:CHUNK=20x10x5 --enable-error-stack)
################################################################
# layout conversions (file has no filters)
@@ -1247,14 +1312,14 @@
# Use first dset to test.
#---------------------------------------------------------------------------
# chunk to chunk - specify chunk dim bigger than any current dim
- ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300)
+ ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 ${FILE19} chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300)
# chunk to contiguous
- ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CONTI -l chunk_unlimit1:CONTI)
+ ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 ${FILE19} chunk_unlimit1 CONTI -l chunk_unlimit1:CONTI)
# chunk to compact - convert big dataset (should be > 64k) for this purpose,
# should remain as original layout (chunk)
- ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA)
+ ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 ${FILE19} chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA)
#--------------------------------------------------------------------------
# Test -f for some specific cases. Chunked dataset with unlimited max dims.
@@ -1264,16 +1329,16 @@
# - should not change max dims from unlimit
# chunk dim is bigger than dataset dim. ( dset size < 64k )
- ADD_H5_VERIFY_TEST (error1 "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE)
+ ADD_H5_VERIFY_TEST (error1 "TEST" 0 ${FILE19} chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE)
# chunk dim is bigger than dataset dim. ( dset size > 64k )
- ADD_H5_VERIFY_TEST (error2 "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE)
+ ADD_H5_VERIFY_TEST (error2 "TEST" 0 ${FILE19} chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE)
# chunk dims are smaller than dataset dims. ( dset size < 64k )
- ADD_H5_VERIFY_TEST (error3 "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE)
+ ADD_H5_VERIFY_TEST (error3 "TEST" 0 ${FILE19} chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE)
# file input - should not fail
- ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE)
+ ADD_H5_TEST (error4 "TEST" ${FILE19} -f NONE)
#--------------------------------------------------------------------------
# Test base: Convert CHUNK to CONTI for a chunked dataset with small dataset
@@ -1281,9 +1346,9 @@
# (HDFFV-8214)
#--------------------------------------------------------------------------
# chunk dim is bigger than dataset dim. should succeed.
- ADD_H5_VERIFY_TEST (ckdim_biger "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI)
+ ADD_H5_VERIFY_TEST (ckdim_biger "TEST" 0 ${FILE19} chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI)
# chunk dim is smaller than dataset dim. should succeed.
- ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI)
+ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 ${FILE19} chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI)
@@ -1416,6 +1481,15 @@ ADD_H5_VERIFY_SUPERBLOCK (SB_IS_3 h5repack_layout.h5 2 2 3)
ADD_H5_VERIFY_INVALIDBOUNDS (latest_latest_invalid bounds_latest_latest.h5 0 1)
##############################################################################
+### E X T E R N A L S T O R A G E T E S T S
+##############################################################################
+ADD_H5_EXTERNAL_TEST (ext_f32le "TEST" f32le -l CONTI)
+ADD_H5_EXTERNAL_TEST (ext_int32le_1d "TEST" int32le_1d -l CONTI)
+ADD_H5_EXTERNAL_TEST (ext_int32le_2d "TEST" int32le_2d -l CONTI)
+ADD_H5_EXTERNAL_TEST (ext_int32le_3d "TEST" int32le_3d -l CONTI)
+ADD_H5_EXTERNAL_TEST (ext_uint8be "TEST" uint8be -l CONTI)
+
+##############################################################################
### P L U G I N T E S T S
##############################################################################
if (BUILD_SHARED_LIBS)
diff --git a/tools/test/h5repack/CMakeVFDTests.cmake b/tools/test/h5repack/CMakeVFDTests.cmake
index 2042f31..6399ee0 100644
--- a/tools/test/h5repack/CMakeVFDTests.cmake
+++ b/tools/test/h5repack/CMakeVFDTests.cmake
@@ -16,18 +16,18 @@
##############################################################################
##############################################################################
- set (VFD_LIST
- sec2
- stdio
- core
- split
- multi
- family
- )
+set (VFD_LIST
+ sec2
+ stdio
+ core
+ split
+ multi
+ family
+)
- if (DIRECT_VFD)
- set (VFD_LIST ${VFD_LIST} direct)
- endif ()
+if (DIRECT_VFD)
+ set (VFD_LIST ${VFD_LIST} direct)
+endif ()
##############################################################################
##############################################################################
@@ -35,23 +35,61 @@
##############################################################################
##############################################################################
- macro (ADD_VFD_TEST vfdname resultcode)
+macro (ADD_VFD_TEST vfdname resultcode)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}")
+ add_test (
+ NAME H5REPACK-${vfdname}-h5repacktest-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
+ bounds_latest_latest.h5
+ h5repack_attr.h5
+ h5repack_attr_refs.h5
+ h5repack_deflate.h5
+ h5repack_early.h5
+ h5repack_ext.h5
+ h5repack_fill.h5
+ h5repack_filters.h5
+ h5repack_fletcher.h5
+ h5repack_hlink.h5
+ h5repack_layout.h5
+ h5repack_layouto.h5
+ h5repack_layout2.h5
+ h5repack_layout3.h5
+ h5repack_layout.UD.h5
+ h5repack_named_dtypes.h5
+ h5repack_nested_8bit_enum.h5
+ h5repack_nested_8bit_enum_deflated.h5
+ h5repack_nbit.h5
+ h5repack_objs.h5
+ h5repack_refs.h5
+ h5repack_shuffle.h5
+ h5repack_soffset.h5
+ h5repack_szip.h5
+ # fsm
+ h5repack_aggr.h5
+ h5repack_fsm_aggr_nopersist.h5
+ h5repack_fsm_aggr_persist.h5
+ h5repack_none.h5
+ h5repack_paged_nopersist.h5
+ h5repack_paged_persist.h5
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${vfdname}
+ )
add_test (
- NAME H5REPACK-VFD-${vfdname}-h5repacktest
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5repacktest>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=h5repacktest"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
+ NAME H5REPACK_VFD-${vfdname}-h5repacktest
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repacktest>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_VFD:STRING=${vfdname}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${vfdname}-h5repacktest.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
+ -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest")
- endmacro ()
+ set_tests_properties (H5REPACK_VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS H5REPACK_VFD-${vfdname}-h5repacktest-clear-objects)
+ set_tests_properties (H5REPACK_VFD-${vfdname}-h5repacktest PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT})
+ endif ()
+endmacro ()
##############################################################################
##############################################################################
@@ -59,7 +97,7 @@
##############################################################################
##############################################################################
- # Run test with different Virtual File Driver
- foreach (vfd ${VFD_LIST})
- ADD_VFD_TEST (${vfd} 0)
- endforeach ()
+# Run test with different Virtual File Driver
+foreach (vfd ${VFD_LIST})
+ ADD_VFD_TEST (${vfd} 0)
+endforeach ()
diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am
index 59d7a6a..38f7b2f 100644
--- a/tools/test/h5repack/Makefile.am
+++ b/tools/test/h5repack/Makefile.am
@@ -22,10 +22,12 @@ include $(top_srcdir)/config/commence.am
AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib -I$(top_srcdir)/tools/src/h5repack
# Test programs and scripts
+TEST_PROG=h5repackgentest
TEST_SCRIPT=h5repack.sh
noinst_PROGRAMS=h5repacktst testh5repack_detect_szip
+check_PROGRAMS=$(TEST_PROG)
SCRIPT_DEPEND=../../src/h5repack/h5repack$(EXEEXT) h5repacktst$(EXEEXT)
if HAVE_SHARED_CONDITIONAL
if USE_PLUGINS_CONDITIONAL
@@ -57,7 +59,8 @@ endif
# Temporary files. *.h5 are generated by h5repack. They should
# copied to the testfiles/ directory if update is required.
-CHECK_CLEANFILES+=*.h5 *.bin testfiles/h5diff_attr1.h5 testfiles/tfamily*.h5
+# *.dat files may be created by h5repackgentest.
+CHECK_CLEANFILES+=*.h5 *.dat *.bin testfiles/h5diff_attr1.h5 testfiles/tfamily*.h5
DISTCLEANFILES=h5repack.sh h5repack_plugin.sh
include $(top_srcdir)/config/conclude.am
diff --git a/tools/test/h5repack/Makefile.in b/tools/test/h5repack/Makefile.in
index 013985e..89134bc 100644
--- a/tools/test/h5repack/Makefile.in
+++ b/tools/test/h5repack/Makefile.in
@@ -106,8 +106,9 @@ build_triplet = @build@
host_triplet = @host@
noinst_PROGRAMS = h5repacktst$(EXEEXT) \
testh5repack_detect_szip$(EXEEXT)
+check_PROGRAMS = $(am__EXEEXT_1)
@HAVE_SHARED_CONDITIONAL_TRUE@@USE_PLUGINS_CONDITIONAL_TRUE@am__append_1 = h5repack_plugin.sh
-TESTS = $(TEST_SCRIPT)
+TESTS = $(am__EXEEXT_1) $(TEST_SCRIPT)
subdir = tools/test/h5repack
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \
@@ -165,7 +166,13 @@ libdynlibvers_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_CFLAGS) $(CFLAGS) $(libdynlibvers_la_LDFLAGS) $(LDFLAGS) \
-o $@
@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibvers_la_rpath =
+am__EXEEXT_1 = h5repackgentest$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
+h5repackgentest_SOURCES = h5repackgentest.c
+h5repackgentest_OBJECTS = h5repackgentest.$(OBJEXT)
+h5repackgentest_LDADD = $(LDADD)
+h5repackgentest_DEPENDENCIES = ../../src/h5repack/libh5repack.la \
+ $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
am_h5repacktst_OBJECTS = h5repacktst.$(OBJEXT)
h5repacktst_OBJECTS = $(am_h5repacktst_OBJECTS)
h5repacktst_LDADD = $(LDADD)
@@ -214,10 +221,11 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libdynlibadd_la_SOURCES) $(libdynlibvers_la_SOURCES) \
- $(h5repacktst_SOURCES) $(testh5repack_detect_szip_SOURCES)
-DIST_SOURCES = $(am__libdynlibadd_la_SOURCES_DIST) \
- $(am__libdynlibvers_la_SOURCES_DIST) $(h5repacktst_SOURCES) \
+ h5repackgentest.c $(h5repacktst_SOURCES) \
$(testh5repack_detect_szip_SOURCES)
+DIST_SOURCES = $(am__libdynlibadd_la_SOURCES_DIST) \
+ $(am__libdynlibvers_la_SOURCES_DIST) h5repackgentest.c \
+ $(h5repacktst_SOURCES) $(testh5repack_detect_szip_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -427,11 +435,8 @@ am__set_TESTS_bases = \
RECHECK_LOGS = $(TEST_LOGS)
AM_RECURSIVE_TARGETS = check recheck
TEST_SUITE_LOG = test-suite.log
-am__test_logs1 = $(TESTS:=.log)
-am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
-TEST_LOGS = $(am__test_logs2:.sh.log=.log)
-SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver
-SH_LOG_COMPILE = $(SH_LOG_COMPILER) $(AM_SH_LOG_FLAGS) $(SH_LOG_FLAGS)
+LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
am__set_b = \
case '$@' in \
*/*) \
@@ -442,6 +447,11 @@ am__set_b = \
*) \
b='$*';; \
esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.sh.log=.log)
+SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver
+SH_LOG_COMPILE = $(SH_LOG_COMPILER) $(AM_SH_LOG_FLAGS) $(SH_LOG_FLAGS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/h5repack.sh.in \
$(srcdir)/h5repack_plugin.sh.in $(top_srcdir)/bin/depcomp \
$(top_srcdir)/bin/test-driver $(top_srcdir)/config/commence.am \
@@ -522,7 +532,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -545,9 +554,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -574,6 +586,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -628,6 +641,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -652,7 +666,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -771,10 +784,12 @@ TRACE = perl $(top_srcdir)/bin/trace
# Temporary files. *.h5 are generated by h5repack. They should
# copied to the testfiles/ directory if update is required.
-CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 *.bin \
+# *.dat files may be created by h5repackgentest.
+CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 *.dat *.bin \
testfiles/h5diff_attr1.h5 testfiles/tfamily*.h5
# Test programs and scripts
+TEST_PROG = h5repackgentest
TEST_SCRIPT = h5repack.sh $(am__append_1)
SCRIPT_DEPEND = ../../src/h5repack/h5repack$(EXEEXT) h5repacktst$(EXEEXT)
check_SCRIPTS = $(TEST_SCRIPT)
@@ -868,6 +883,15 @@ libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EX
libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES)
$(AM_V_CCLD)$(libdynlibvers_la_LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD) $(LIBS)
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
@@ -877,6 +901,10 @@ clean-noinstPROGRAMS:
echo " rm -f" $$list; \
rm -f $$list
+h5repackgentest$(EXEEXT): $(h5repackgentest_OBJECTS) $(h5repackgentest_DEPENDENCIES) $(EXTRA_h5repackgentest_DEPENDENCIES)
+ @rm -f h5repackgentest$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(h5repackgentest_OBJECTS) $(h5repackgentest_LDADD) $(LIBS)
+
h5repacktst$(EXEEXT): $(h5repacktst_OBJECTS) $(h5repacktst_DEPENDENCIES) $(EXTRA_h5repacktst_DEPENDENCIES)
@rm -f h5repacktst$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(h5repacktst_OBJECTS) $(h5repacktst_LDADD) $(LIBS)
@@ -893,6 +921,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib_rpk.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib_vrpk.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5repackgentest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5repacktst.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testh5repack_detect_szip.Po@am__quote@
@@ -1097,7 +1126,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
echo "$$col$$br$$std"; \
fi; \
$$success || exit 1
-recheck: all $(check_SCRIPTS)
+recheck: all $(check_PROGRAMS) $(check_SCRIPTS)
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
bases=`for i in $$bases; do echo $$i; done \
@@ -1108,6 +1137,13 @@ recheck: all $(check_SCRIPTS)
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
exit $$?
+h5repackgentest.log: h5repackgentest$(EXEEXT)
+ @p='h5repackgentest$(EXEEXT)'; \
+ b='h5repackgentest'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
.sh.log:
@p='$<'; \
$(am__set_b); \
@@ -1154,7 +1190,7 @@ distdir: $(DISTFILES)
fi; \
done
check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS)
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local
@@ -1195,8 +1231,8 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- clean-noinstPROGRAMS mostlyclean-am
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
@@ -1267,7 +1303,7 @@ uninstall-am:
.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \
- check-am clean clean-generic clean-libtool \
+ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \
clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist-am \
ctags ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
@@ -1332,7 +1368,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in
index a36eb08..67056fb 100644
--- a/tools/test/h5repack/h5repack.sh.in
+++ b/tools/test/h5repack/h5repack.sh.in
@@ -111,6 +111,16 @@ $SRC_H5REPACK_TESTFILES/h5repack_fsm_aggr_persist.h5
$SRC_H5REPACK_TESTFILES/h5repack_none.h5
$SRC_H5REPACK_TESTFILES/h5repack_paged_nopersist.h5
$SRC_H5REPACK_TESTFILES/h5repack_paged_persist.h5
+$SRC_H5REPACK_TESTFILES/h5repack_f32le.h5
+$SRC_H5REPACK_TESTFILES/h5repack_f32le_ex.h5
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d.h5
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex.h5
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d.h5
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d_ex.h5
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d.h5
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d_ex.h5
+$SRC_H5REPACK_TESTFILES/h5repack_uint8be.h5
+$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex.h5
$SRC_H5DIFF_TESTFILES/h5diff_attr1.h5
$SRC_TOOLS_TESTFILES/tfamily00000.h5
$SRC_TOOLS_TESTFILES/tfamily00001.h5
@@ -156,10 +166,19 @@ $SRC_H5REPACK_TESTFILES/ublock.bin
$SRC_H5REPACK_TESTFILES/h5repack.info
$SRC_H5REPACK_TESTFILES/crtorder.tordergr.h5.ddl
$SRC_H5REPACK_TESTFILES/deflate_limit.h5repack_layout.h5.ddl
+$SRC_H5REPACK_TESTFILES/h5repack_f32le_ex-0.dat
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex-0.dat
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex-1.dat
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d_ex-0.dat
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d_ex-0.dat
$SRC_H5REPACK_TESTFILES/h5repack_layout.h5.ddl
$SRC_H5REPACK_TESTFILES/h5repack_filters.h5-gzip_verbose_filters.tst
$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst
$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-plugin_test.ddl
+$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-0.dat
+$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-1.dat
+$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-2.dat
+$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-3.dat
$SRC_H5REPACK_TESTFILES/plugin_test.h5repack_layout.h5.tst
$SRC_H5REPACK_TESTFILES/1_vds.h5-vds_dset_chunk20x10x5-v.ddl
$SRC_H5REPACK_TESTFILES/2_vds.h5-vds_chunk3x6x9-v.ddl
@@ -595,8 +614,94 @@ VERIFY_INVALIDBOUNDS()
} # end of VERIFY_INVALIDBOUNDS
+# -----------------------------------------------------------------------------
+# Expect h5diff to fail
+# -----------------------------------------------------------------------------
+DIFFFAIL()
+{
+ VERIFY h5diff unequal $@
+ (
+ cd $TESTDIR
+ $RUNSERIAL $H5DIFF_BIN -q "$@"
+ )
+ RET=$?
+ if [ $RET == 0 ] ; then
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+ fi
+}
+
+# -----------------------------------------------------------------------------
+# Catchall test for repacking with external files
+# Loops over all (internally-listed) cases and applies the given arguments
+# to h5repack.
+# Each test file family must be listed in the for loop at the start of the
+# 'function'.
+# Expects case files to be of format:
+# + h5repack_<NAME>.h5
+# + h5repack_<NAME>_ex.h5
+# + h5repack_<NAME>_ex-<N>.dat
+# ...where NAME is part of the internal list, and N is a positive decimal
+# number; multiple external files (*.dat) are allowed per file, but they must
+# follow the pattern and be in contiguous numerical sequence starting at 0.
+# -----------------------------------------------------------------------------
+VERIFY_EXTERNAL_CONSOLIDATION()
+{
+ for name in f32le int32le_1d int32le_2d int32le_3d uint8be
+ do
+ basename="h5repack_${name}"
+ base_ext="${basename}_ex"
+ base_rpkg="${basename}_rp"
+ canonical="${basename}.h5"
+ external="${base_ext}.h5"
+ ex_dat="${base_ext}-0.dat"
+ ex_dat_mv="__${ext_dat}"
+ repacked="${base_rpkg}.h5"
+ prev_nerrors=$nerrors
+
+ TESTING external consolidation on $name with h5repack $@
+ echo " . . ."
+
+ # baseline comparison of known files
+ DIFFTEST $canonical $external
+
+ # repack the external file, verify integrity
+ ( cd $TESTDIR
+ $H5REPACK_BIN $@ $external $repacked
+ )
+ DIFFTEST $repacked $canonical
+ DIFFTEST $repacked $external
+
+ # invalidate external file by moving its first data file; verify
+ ( cd $TESTDIR
+ mv $ex_dat $ex_dat_mv
+ )
+ DIFFFAIL $canonical $external
+ DIFFFAIL $repacked $external
+ DIFFTEST $canonical $repacked
+
+ # reset test state for re-runs with different h5repack arguments
+ ( cd $TESTDIR
+ mv $ex_dat_mv $ex_dat
+ rm $repacked
+ )
+
+ # flag if any of the above checks failed
+ if [ $prev_nerrors != $nerrors ]
+ then
+ echo ". . . *FAILED*"
+ nerrors="`expr $prev_nerrors + 1`"
+ else
+ echo ". . . PASSED"
+ fi
+ done
+} # end VERIFY_EXTERNAL_CONSOLIDATION
+
+# -----------------------------------------------------------------------------
# same as TOOLTEST, but it uses the old syntax -i input_file -o output_file
-#
+# -----------------------------------------------------------------------------
TOOLTEST0()
{
infile=$2
@@ -1387,7 +1492,12 @@ TOOLTEST add_alignment $arg
TOOLTEST upgrade_layout h5repack_layouto.h5
# test for datum size > H5TOOLS_MALLOCSIZE
-TOOLTEST gt_mallocsize h5repack_objs.h5 -f GZIP=1
+arg="h5repack_objs.h5 -f GZIP=1"
+if test $USE_FILTER_DEFLATE != "yes" ; then
+ SKIP $arg
+else
+ TOOLTEST gt_mallocsize $arg
+fi
# Check repacking file with committed datatypes in odd configurations
TOOLTEST committed_dt h5repack_named_dtypes.h5
@@ -1458,7 +1568,12 @@ VERIFY_SUPERBLOCK 1 2 2 h5repack_layout.h5 -j 1 -k 2 h5repack_layout.h5
# -j 2 -k 2, superblock will be 3
VERIFY_SUPERBLOCK 2 2 3 h5repack_layout.h5 -j 2 -k 2 h5repack_layout.h5
# -j 0 -k 1, file cannot be opened
-VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5
+VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5
+
+########################################
+# Testing external storage
+########################################
+VERIFY_EXTERNAL_CONSOLIDATION -l CONTI
# Clean up temporary files/directories
CLEAN_TESTFILES_AND_TESTDIR
diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c
new file mode 100644
index 0000000..aaac285
--- /dev/null
+++ b/tools/test/h5repack/h5repackgentest.c
@@ -0,0 +1,340 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* For generating files for verifying h5repack with external storage. . .
+ *
+ * Each case file should follow the format of:
+ * + h5repack_<NAME>.h5
+ * + h5repack_<NAME>_ex.h5
+ * + h5repack_<NAME>_ex-<N>.dat
+ * ...where NAME idenfities the type, and N is a positive decimal number;
+ * multiple external files (*.dat) are allowed per file, but they must
+ * follow the pattern and be in contiguous numerical sequence starting at 0.
+ *
+ * Each file typename must be added to the listing for
+ * `VERIFY_EXTERNAL_CONSOLIDATION` in h5repack.sh
+ *
+ * There is no restriction on the name, number, or structure of datasets and
+ * groups in HDF5 file.
+ *
+ * The inluded datatypes should be more than adequate to verify the correctness
+ * of the behavior -- if one type can be consolidated from external storage,
+ * then thay all can.
+ */
+
+#include "hdf5.h"
+#include "H5private.h"
+
+#define MAX_NAME_SIZE 256
+#define FILE_INT32LE_1 "h5repack_int32le_1d"
+#define FILE_INT32LE_2 "h5repack_int32le_2d"
+#define FILE_INT32LE_3 "h5repack_int32le_3d"
+#define FILE_UINT8BE "h5repack_uint8be"
+#define FILE_F32LE "h5repack_f32le"
+
+#define H5REPACKGENTEST_OOPS { \
+ ret_value = -1; \
+ goto done; \
+}
+
+#define H5REPACKGENTEST_COMMON_CLEANUP(dcpl, file, space) { \
+ if ((dcpl) != H5P_DEFAULT && (dcpl) != H5I_INVALID_HID) { \
+ (void)H5Pclose((dcpl)); \
+ } \
+ if ((file) != H5I_INVALID_HID) { (void)H5Fclose((file)); } \
+ if ((space) != H5I_INVALID_HID) { (void)H5Sclose((space)); } \
+}
+
+struct external_def {
+ hsize_t type_size;
+ unsigned n_elts_per_file;
+ unsigned n_elts_total;
+};
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Helper function to create and write a dataset to file.
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+__make_dataset(hid_t file_id, const char *dset_name,
+ hid_t mem_type_id, hid_t space_id, hid_t dcpl_id, void *wdata) {
+ hid_t dset_id = H5I_INVALID_HID;
+ int ret_value = 0;
+
+ dset_id = H5Dcreate2(file_id, dset_name, mem_type_id, space_id,
+ H5P_DEFAULT, dcpl_id,
+ H5P_DEFAULT);
+ if (dset_id == H5I_INVALID_HID)
+ H5REPACKGENTEST_OOPS;
+
+ if (H5Dwrite(dset_id, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata) < 0)
+ H5REPACKGENTEST_OOPS;
+
+done:
+ if (dset_id != H5I_INVALID_HID)
+ (void) H5Dclose(dset_id);
+
+ return ret_value;
+} /* end __make_dataset() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Helper function to populate the DCPL external storage list.
+ * Creates external files for the DCPL, with each file name following the
+ * convention "<filename>_ex-<num>.dat". Will append `n_external_files` to
+ * the filename list, with each file having space for `n_elts` items of the
+ * type (of size `elt_size`). The numeric inputs are not sanity-checked.
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+__set_dcpl_external_list(hid_t dcpl, const char *filename,
+ unsigned n_elts_per_file, unsigned n_elts_total, hsize_t elt_size) {
+ char name[MAX_NAME_SIZE];
+ unsigned n_external_files = 0;
+ unsigned i = 0;
+
+ if (NULL == filename || '\0' == *filename)
+ return -1;
+
+ n_external_files = n_elts_total / n_elts_per_file;
+ if (n_elts_total != (n_external_files * n_elts_per_file))
+ return -1;
+
+
+ for (i = 0; i < n_external_files; i++) {
+ if (HDsnprintf(name, MAX_NAME_SIZE, "%s_ex-%u.dat", filename, i) >= MAX_NAME_SIZE)
+ return -1;
+
+ if (H5Pset_external(dcpl, name, 0, n_elts_per_file * elt_size) < 0)
+ return -1;
+ }
+ return 0;
+} /* end __set_dcpl_external_list() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Generalized utility function to write a file with the specified data and
+ * dataset configuration. If `ext` is provided, will attempt to use external
+ * storage.
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+__make_file(const char *basename, struct external_def *ext,
+ hid_t type_id, hsize_t rank, hsize_t *dims, void *wdata) {
+ char filename[MAX_NAME_SIZE];
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t dcpl_id = H5P_DEFAULT;
+ hid_t space_id = H5I_INVALID_HID;
+ int ret_value = 0;
+
+ if (HDsnprintf(filename, MAX_NAME_SIZE, "%s%s.h5", basename, (NULL != ext) ? "_ex" : "") >= MAX_NAME_SIZE)
+ H5REPACKGENTEST_OOPS;
+
+ if (NULL != ext) {
+ dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
+ if (dcpl_id == H5I_INVALID_HID)
+ H5REPACKGENTEST_OOPS;
+
+ if (__set_dcpl_external_list(dcpl_id, basename, ext->n_elts_per_file, ext->n_elts_total, ext->type_size) < 0)
+ H5REPACKGENTEST_OOPS;
+ }
+
+ space_id = H5Screate_simple(rank, dims, NULL);
+ if (space_id == H5I_INVALID_HID)
+ H5REPACKGENTEST_OOPS;
+
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ if (file_id == H5I_INVALID_HID)
+ H5REPACKGENTEST_OOPS;
+
+
+ if (__make_dataset(file_id, "dset", type_id, space_id, dcpl_id, wdata) < 0)
+ H5REPACKGENTEST_OOPS;
+
+done:
+ H5REPACKGENTEST_COMMON_CLEANUP(dcpl_id, file_id, space_id);
+return ret_value;
+} /* end __make_file() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+generate_int32le_1d(hbool_t external) {
+ int32_t wdata[12];
+ hsize_t dims[] = { 12 };
+ struct external_def *def_ptr = NULL;
+ struct external_def def = { (hsize_t) sizeof(int32_t), 6, 12 };
+ int32_t n = 0;
+ int ret_value = 0;
+
+ /* Generate values
+ */
+ for (n = 0; n < 12; n++) {
+ wdata[n] = n - 6;
+ }
+
+ def_ptr = (TRUE == external) ? (&def) : NULL;
+ if (__make_file(FILE_INT32LE_1, def_ptr, H5T_STD_I32LE, 1, dims, wdata) < 0)
+ ret_value = -1;
+
+ return ret_value;
+} /* end generate_int32le_1d() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+generate_int32le_2d(hbool_t external) {
+ int32_t wdata[64];
+ hsize_t dims[] = { 8, 8 };
+ struct external_def *def_ptr = NULL;
+ struct external_def def = { (hsize_t) sizeof(int32_t), 64, 64 };
+ int32_t n = 0;
+ int ret_value = 0;
+
+ /* Generate values
+ */
+ for (n = 0; n < 64; n++) {
+ wdata[n] = n - 32;
+ }
+
+ def_ptr = (TRUE == external) ? (&def) : NULL;
+ if (__make_file(FILE_INT32LE_2, def_ptr, H5T_STD_I32LE, 2, dims, wdata) < 0)
+ ret_value = -1;
+
+ return ret_value;
+} /* end generate_int32le_2d() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+generate_int32le_3d(hbool_t external) {
+ hsize_t dims[] = { 8, 8, 8 };
+ int32_t wdata[512]; /* 8^3, from dims */
+ struct external_def *def_ptr = NULL;
+ struct external_def def = { (hsize_t) sizeof(int32_t), 512, 512 };
+ int32_t n = 0;
+ int i = 0;
+ int j = 0;
+ int k = 0;
+ int ret_value = 0;
+
+ /* generate values, alternating positive and negative
+ */
+ for (i = 0, n = 0; i < dims[0]; i++) {
+ for (j = 0; j < dims[1]; j++) {
+ for (k = 0; k < dims[2]; k++, n++) {
+ wdata[n] = (k + j * 512 + i * 4096) * ((n & 1) ? (-1) : (1));
+ }
+ }
+ }
+
+ def_ptr = (TRUE == external) ? (&def) : NULL;
+ if (__make_file(FILE_INT32LE_3, def_ptr, H5T_STD_I32LE, 3, dims, wdata) < 0)
+ ret_value = -1;
+
+ return ret_value;
+} /* end generate_int32le_3d() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+generate_uint8be(hbool_t external) {
+ hsize_t dims[] = { 4, 8, 8 };
+ uint8_t wdata[256]; /* 4*8*8, from dims */
+ struct external_def *def_ptr = NULL;
+ struct external_def def = { (hsize_t) sizeof(uint8_t), 64, 256 };
+ uint8_t n = 0;
+ int i = 0;
+ int j = 0;
+ int k = 0;
+ int ret_value = 0;
+
+ /* Generate values, ping-pong from ends of range
+ */
+ for (i = 0, n = 0; i < dims[0]; i++) {
+ for (j = 0; j < dims[1]; j++) {
+ for (k = 0; k < dims[2]; k++, n++) {
+ wdata[n] = n * ((n & 1) ? (-1) : (1));
+ }
+ }
+ }
+
+ def_ptr = (TRUE == external) ? (&def) : NULL;
+ if (__make_file(FILE_UINT8BE, def_ptr, H5T_STD_U8BE, 3, dims, wdata) < 0)
+ ret_value = -1;
+
+ return ret_value;
+} /* end generate_uint8be() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+generate_f32le(hbool_t external) {
+ hsize_t dims[] = { 12, 6 };
+ float wdata[72]; /* 12*6, from dims */
+ struct external_def *def_ptr = NULL;
+ struct external_def def = { (hsize_t) sizeof(float), 72, 72 };
+ float n = 0;
+ int i = 0;
+ int j = 0;
+ int k = 0;
+ int ret_value = 0;
+
+ /* Generate values */
+ for (i = 0, k = 0, n = 0; i < dims[0]; i++) {
+ for (j = 0; j < dims[1]; j++, k++, n++) {
+ wdata[k] = n * 801.1 * ((k % 5 == 1) ? (-1) : (1));
+ }
+ }
+
+ def_ptr = (TRUE == external) ? (&def) : NULL;
+ if (__make_file(FILE_F32LE, def_ptr, H5T_IEEE_F32LE, 2, dims, wdata) < 0)
+ ret_value = -1;
+
+ return ret_value;
+} /* end generate_f32le() */
+
+/* ----------------------------------------------------------------------------
+ * Create files.
+ * Return 0 on success, nonzero on failure.
+ */
+int
+main(void) {
+ int i = 0;
+ int ret_value = 0;
+
+ for (i = 0; i < 2; i++) {
+ hbool_t external = (i & 1) ? TRUE : FALSE;
+ if (generate_int32le_1d(external) < 0)
+ HDprintf("A generate_int32le_1d failed!\n");
+
+ if (generate_int32le_2d(external) < 0)
+ HDprintf("A generate_int32le_2d failed!\n");
+
+ if (generate_int32le_3d(external) < 0)
+ HDprintf("A generate_int32le_3d failed!\n");
+
+ if (generate_uint8be(external) < 0)
+ HDprintf("A generate_uint8be failed!\n");
+
+ if (generate_f32le(external) < 0)
+ HDprintf("A generate_f32le failed!\n");
+
+ } /* end for external data storage or not */
+
+ return EXIT_SUCCESS;
+} /* end main() */
+
diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c
index 0ae570b..ec8df3c 100644
--- a/tools/test/h5repack/h5repacktst.c
+++ b/tools/test/h5repack/h5repacktst.c
@@ -2907,10 +2907,10 @@ out:
static
int make_all_filters(hid_t loc_id)
{
- hid_t dcpl; /* dataset creation property list */
- hid_t sid; /* dataspace ID */
- hid_t dtid;
- hid_t dsid;
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */
+ hid_t sid = H5I_INVALID_HID; /* dataspace ID */
+ hid_t dtid = H5I_INVALID_HID;
+ hid_t dsid = H5I_INVALID_HID;
#if defined (H5_HAVE_FILTER_SZIP)
unsigned szip_options_mask=H5_SZIP_ALLOW_K13_OPTION_MASK|H5_SZIP_NN_OPTION_MASK;
unsigned szip_pixels_per_block=8;
@@ -3083,7 +3083,7 @@ int make_early(void)
hid_t tid=-1;
hid_t dcpl=-1;
int i;
- char name[10];
+ char name[16];
int iter=100;
if ((fid = H5Fcreate(FNAME5, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -3108,7 +3108,7 @@ int make_early(void)
goto out;
if ((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0)
goto out;
- sprintf(name, "%d", i);
+ HDsprintf(name, "%d", i);
if ((H5Tcommit2(fid, name, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if (H5Tclose(tid) < 0)
@@ -3133,7 +3133,7 @@ int make_early(void)
{
if ((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0)
goto out;
- sprintf(name, "%d", i);
+ HDsprintf(name, "%d", i);
if ((H5Tcommit2(fid, name, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if (H5Tclose(tid) < 0)
@@ -3178,7 +3178,7 @@ int make_layout(hid_t loc_id)
hsize_t chunk_dims[RANK]={CDIM1,CDIM2};
int buf[DIM1][DIM2];
int i, j, n;
- char name[6];
+ char name[16];
for (i=n=0; i<DIM1; i++)
@@ -3195,7 +3195,7 @@ int make_layout(hid_t loc_id)
*/
for (i=0; i<4; i++)
{
- sprintf(name,"dset%d",i+1);
+ HDsprintf(name,"dset%d",i+1);
if (write_dset(loc_id,RANK,dims,name,H5T_NATIVE_INT,buf) < 0)
return -1;
}
@@ -4120,7 +4120,7 @@ int write_dset_in(hid_t loc_id,
dbuf = (double*)HDmalloc( size );
if (NULL == dbuf)
{
- printf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 );
+ HDprintf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 );
goto out;
}
@@ -6182,7 +6182,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id)
status = H5Rcreate(&data_attr_objref[0],file_id,NAME_OBJ_DS1,H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6191,7 +6191,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id)
status = H5Rcreate(&data_attr_objref[1],file_id,NAME_OBJ_GRP,H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6200,7 +6200,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id)
status = H5Rcreate(&data_attr_objref[2],file_id,NAME_OBJ_NDTYPE,H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6209,7 +6209,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id)
status = make_attr(obj_id,1,dim_attr_objref,"Attr_OBJREF",H5T_STD_REF_OBJ,data_attr_objref);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6251,7 +6251,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id)
sid_regrefed_dset = H5Screate_simple (2, dim_regrefed_dset, NULL);
if (sid_regrefed_dset < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6260,7 +6260,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id)
status = H5Sselect_elements (sid_regrefed_dset, H5S_SELECT_SET, (size_t)3, coords_regrefed_dset[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6269,7 +6269,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id)
status = H5Rcreate (&data_attr_regref[0], file_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_regrefed_dset);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6278,7 +6278,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id)
status = make_attr(obj_id,1,dim_attr_regref,"Attr_REGREF",H5T_STD_REF_DSETREG,data_attr_regref);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6324,7 +6324,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
sid = H5Screate_simple(1, dims1, NULL);
if (sid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6332,7 +6332,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
did1 = H5Dcreate2 (loc_id, NAME_OBJ_DS1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (did1 < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6340,7 +6340,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6352,7 +6352,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
gid = H5Gcreate2 (loc_id, NAME_OBJ_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6365,7 +6365,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6378,7 +6378,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
sid2 = H5Screate_simple (2, dims2, NULL);
if (sid2 < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6387,7 +6387,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
did2 = H5Dcreate2 (loc_id, NAME_OBJ_DS2, H5T_STD_I8LE, sid2, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
if (did2 < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6396,7 +6396,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
status = H5Dwrite (did2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6453,7 +6453,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Rcreate (&objref_buf[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6462,7 +6462,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Rcreate (&objref_buf[1], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6471,7 +6471,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Rcreate (&objref_buf[2], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6482,7 +6482,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
sid = H5Screate_simple (1, dims_dset_objref, NULL);
if (sid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6490,7 +6490,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
oid = H5Dcreate2 (loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
if (oid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6498,7 +6498,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, objref_buf);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6511,7 +6511,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = add_attr_with_objref(loc_id, oid);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6520,7 +6520,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = add_attr_with_regref(loc_id, oid);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6573,7 +6573,7 @@ static herr_t gen_region_ref(hid_t loc_id)
sid_trg = H5Screate_simple (2, dims_trg, NULL);
if (sid_trg < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6582,7 +6582,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Sselect_elements (sid_trg, H5S_SELECT_SET, (size_t)4, coords[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6591,7 +6591,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Rcreate (&rr_data[0], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6600,7 +6600,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Sselect_hyperslab (sid_trg, H5S_SELECT_SET, start, stride, count, block);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6609,7 +6609,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Rcreate (&rr_data[1], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6618,7 +6618,7 @@ static herr_t gen_region_ref(hid_t loc_id)
sid_ref = H5Screate_simple (1, dims1, NULL);
if (sid_ref < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6627,7 +6627,7 @@ static herr_t gen_region_ref(hid_t loc_id)
oid_ref = H5Dcreate2 (loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid_ref, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
if (oid_ref < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6636,7 +6636,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Dwrite (oid_ref, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6649,7 +6649,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = add_attr_with_objref(loc_id, oid_ref);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6658,7 +6658,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = add_attr_with_regref(loc_id, oid_ref);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6691,7 +6691,7 @@ static herr_t make_references(hid_t loc_id)
status = gen_refered_objs(loc_id);
if (status == FAIL)
{
- fprintf(stderr, "Failed to generate referenced object.\n");
+ HDfprintf(stderr, "Failed to generate referenced object.\n");
ret = FAIL;
}
@@ -6699,7 +6699,7 @@ static herr_t make_references(hid_t loc_id)
status = gen_obj_ref(loc_id);
if (status == FAIL)
{
- fprintf(stderr, "Failed to generate object reference.\n");
+ HDfprintf(stderr, "Failed to generate object reference.\n");
ret = FAIL;
}
@@ -6707,7 +6707,7 @@ static herr_t make_references(hid_t loc_id)
status = gen_region_ref(loc_id);
if (status == FAIL)
{
- fprintf(stderr, "Failed to generate region reference.\n");
+ HDfprintf(stderr, "Failed to generate region reference.\n");
ret = FAIL;
}
@@ -6831,7 +6831,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Dwrite(objdid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6841,7 +6841,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, objtid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6854,7 +6854,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
main_gid = H5Gcreate2(loc_id, "group_main", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (main_gid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6869,7 +6869,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Dwrite(main_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6893,7 +6893,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Rcreate (&(comp_objref_data[0].val_objref), loc_id, NAME_OBJ_DS1, H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6903,7 +6903,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Rcreate (&(comp_objref_data[1].val_objref), loc_id, NAME_OBJ_GRP, H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6913,7 +6913,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Rcreate (&(comp_objref_data[2].val_objref), loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6927,7 +6927,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Awrite (comp_objref_aid, comp_objref_tid, comp_objref_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6949,14 +6949,14 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Sselect_elements (objsid, H5S_SELECT_SET, (size_t)4, coords[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
status = H5Rcreate (&(comp_regref_data[0].val_regref), loc_id, NAME_OBJ_DS1, H5R_DATASET_REGION, objsid);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6970,7 +6970,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Awrite (comp_regref_aid, comp_regref_tid, comp_regref_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6996,7 +6996,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -7004,7 +7004,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -7012,7 +7012,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[2].p)[0], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -7030,7 +7030,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Awrite (vlen_objref_attr_id, vlen_objref_attr_tid, vlen_objref_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -7039,7 +7039,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Dvlen_reclaim (vlen_objref_attr_tid, vlen_objref_attr_sid, H5P_DEFAULT, vlen_objref_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dvlen_reclaim failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dvlen_reclaim failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -7060,14 +7060,14 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
status = H5Rcreate (&((hdset_reg_ref_t*)vlen_regref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_DATASET_REGION, objsid);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -7085,7 +7085,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Awrite(vlen_regref_attr_id, vlen_regref_attr_tid, vlen_regref_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -7094,7 +7094,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Dvlen_reclaim (vlen_regref_attr_tid, vlen_regref_attr_sid, H5P_DEFAULT, vlen_regref_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dvlen_reclaim failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dvlen_reclaim failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt
index 0eef0f5..9231e01 100644
--- a/tools/test/h5repack/testfiles/h5repack-help.txt
+++ b/tools/test/h5repack/testfiles/h5repack-help.txt
@@ -6,13 +6,17 @@ usage: h5repack [OPTIONS] file1 file2
-v, --verbose Verbose mode, print object information
-V, --version Print version number and exit
-n, --native Use a native HDF5 type when repacking
- --enable-error-stack Prints messages from the HDF5 error stack as they occur
+ --enable-error-stack Prints messages from the HDF5 error stack as they
+ occur
-L, --latest Use latest version of file format
- This option will take precedence over the -j and -k options
- --low=BOUND The low bound for library release versions to use when creating
- objects in the file (default is H5F_LIBVER_EARLIEST)
- --high=BOUND The high bound for library release versions to use when creating
- objects in the file (default is H5F_LIBVER_LATEST)
+ This option will take precedence over the options
+ --low and --high
+ --low=BOUND The low bound for library release versions to use
+ when creating objects in the file
+ (default is H5F_LIBVER_EARLIEST)
+ --high=BOUND The high bound for library release versions to use
+ when creating objects in the file
+ (default is H5F_LIBVER_LATEST)
-c L1, --compact=L1 Maximum number of links in header messages
-d L2, --indexed=L2 Minimum number of links in the indexed format
-s S[:F], --ssize=S[:F] Shared object header message minimum size
@@ -27,10 +31,14 @@ usage: h5repack [OPTIONS] file1 file2
-z Z, --sort_order=Z Sort groups and attributes by order Z
-f FILT, --filter=FILT Filter type
-l LAYT, --layout=LAYT Layout type
- -S FS_STRATEGY, --fs_strategy=FS_STRATEGY File space management strategy for H5Pset_file_space_strategy
- -P FS_PERSIST, --fs_persist=FS_PERSIST Persisting or not persisting free-space for H5Pset_file_space_strategy
- -T FS_THRESHOLD, --fs_threshold=FS_THRESHOLD Free-space section threshold for H5Pset_file_space_strategy
- -G FS_PAGESIZE, --fs_pagesize=FS_PAGESIZE File space page size for H5Pset_file_space_page_size
+ -S FS_STRATEGY, --fs_strategy=FS_STRATEGY File space management strategy for
+ H5Pset_file_space_strategy
+ -P FS_PERSIST, --fs_persist=FS_PERSIST Persisting or not persisting free-
+ space for H5Pset_file_space_strategy
+ -T FS_THRESHOLD, --fs_threshold=FS_THRESHOLD Free-space section threshold
+ for H5Pset_file_space_strategy
+ -G FS_PAGESIZE, --fs_pagesize=FS_PAGESIZE File space page size for
+ H5Pset_file_space_page_size
M - is an integer greater than 1, size of dataset in bytes (default is 0)
E - is a filename.
@@ -38,15 +46,17 @@ usage: h5repack [OPTIONS] file1 file2
U - is a filename.
T - is an integer
A - is an integer greater than zero
- Q - is the sort index type for the input file. It can be "name" or "creation_order" (default)
- Z - is the sort order type for the input file. It can be "descending" or "ascending" (default)
+ Q - is the sort index type for the input file. It can be "name" or
+ "creation_order" (default)
+ Z - is the sort order type for the input file. It can be "descending" or
+ "ascending" (default)
B - is the user block size, any value that is 512 or greater and is
a power of 2 (1024 default)
F - is the shared object header message type, any of <dspace|dtype|fill|
pline|attr>. If F is not specified, S applies to all messages
- BOUND is an integer indicating the library release versions to use when creating
- objects in the file (see H5Pset_libver_bounds()):
+ BOUND is an integer indicating the library release versions to use when
+ creating objects in the file (see H5Pset_libver_bounds()):
0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct
1: This is H5F_LIBVER_V18 in H5F_libver_t struct
2: This is H5F_LIBVER_V110 in H5F_libver_t struct
@@ -54,24 +64,31 @@ usage: h5repack [OPTIONS] file1 file2
FS_STRATEGY is a string indicating the file space strategy used:
FSM_AGGR:
- The mechanisms used in managing file space are free-space managers, aggregators and virtual file driver.
+ The mechanisms used in managing file space are free-space
+ managers, aggregators and virtual file driver.
PAGE:
- The mechanisms used in managing file space are free-space managers with embedded paged aggregation and virtual file driver.
+ The mechanisms used in managing file space are free-space
+ managers with embedded paged aggregation and virtual file driver.
AGGR:
- The mechanisms used in managing file space are aggregators and virtual file driver.
+ The mechanisms used in managing file space are aggregators and
+ virtual file driver.
NONE:
- The mechanisms used in managing file space are virtual file driver.
- The default strategy when not set is FSM_AGGR without persisting free-space.
+ The mechanisms used in managing file space are virtual file
+ driver.
+ The default strategy when not set is FSM_AGGR without persisting free-
+ space.
FS_PERSIST is 1 to persisting free-space or 0 to not persisting free-space.
The default when not set is not persisting free-space.
The value is ignored for AGGR and NONE strategies.
- FS_THRESHOLD is the minimum size (in bytes) of free-space sections to be tracked by the library.
+ FS_THRESHOLD is the minimum size (in bytes) of free-space sections to be
+ tracked by the library.
The default when not set is 1.
The value is ignored for AGGR and NONE strategies.
- FS_PAGESIZE is the size (in bytes) >=512 that is used by the library when the file space strategy PAGE is used.
+ FS_PAGESIZE is the size (in bytes) >=512 that is used by the library when
+ the file space strategy PAGE is used.
The default when not set is 4096.
FILT - is a string with the format:
@@ -99,9 +116,9 @@ usage: h5repack [OPTIONS] file1 file2
NBIT (no parameter)
SOFF=<scale_factor,scale_type> scale_factor is an integer and scale_type
is either IN or DS
- UD=<filter_number,filter_flag,cd_value_count,value_1[,value_2,...,value_N]>
- required values for filter_number,filter_flag,cd_value_count,value_1
- optional values for value_2 to value_N
+ UD=<filter_number,filter_flag,cd_value_count,value1[,value2,...,valueN]>
+ Required values: filter_number, filter_flag, cd_value_count, value1
+ Optional values: value2 to valueN
NONE (no parameter)
LAYT - is a string with the format:
@@ -138,12 +155,7 @@ Examples of use:
4) h5repack -L -c 10 -s 20:dtype file1 file2
Using latest file format with maximum compact group size of 10 and
- and minimum shared datatype size of 20
-
-5) h5repack --low=0 --high=1 file1 file2
-
- Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when
- creating the repacked file: file2
+ minimum shared datatype size of 20
5) h5repack -f SHUF -f GZIP=1 file1 file2
@@ -153,3 +165,8 @@ Examples of use:
Add bzip2 filter to all datasets
+7) h5repack --low=0 --high=1 file1 file2
+
+ Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via
+ H5Pset_libver_bounds() when creating the repacked file, file2
+
diff --git a/tools/test/h5repack/testfiles/h5repack_f32le.h5 b/tools/test/h5repack/testfiles/h5repack_f32le.h5
new file mode 100644
index 0000000..03a9b57
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_f32le.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_f32le_ex-0.dat b/tools/test/h5repack/testfiles/h5repack_f32le_ex-0.dat
new file mode 100644
index 0000000..8378fc2
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_f32le_ex-0.dat
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_f32le_ex.h5 b/tools/test/h5repack/testfiles/h5repack_f32le_ex.h5
new file mode 100644
index 0000000..ca6c49d
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_f32le_ex.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_1d.h5 b/tools/test/h5repack/testfiles/h5repack_int32le_1d.h5
new file mode 100644
index 0000000..7d60566
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_1d.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-0.dat b/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-0.dat
new file mode 100644
index 0000000..f75ada5
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-0.dat
@@ -0,0 +1 @@
+úÿÿÿûÿÿÿüÿÿÿýÿÿÿþÿÿÿÿÿÿÿ \ No newline at end of file
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-1.dat b/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-1.dat
new file mode 100644
index 0000000..1f8f3b6
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-1.dat
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex.h5 b/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex.h5
new file mode 100644
index 0000000..ba4b534
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_2d.h5 b/tools/test/h5repack/testfiles/h5repack_int32le_2d.h5
new file mode 100644
index 0000000..2f32bd1
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_2d.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_2d_ex-0.dat b/tools/test/h5repack/testfiles/h5repack_int32le_2d_ex-0.dat
new file mode 100644
index 0000000..c6bfc64
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_2d_ex-0.dat
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_2d_ex.h5 b/tools/test/h5repack/testfiles/h5repack_int32le_2d_ex.h5
new file mode 100644
index 0000000..f6cce59
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_2d_ex.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_3d.h5 b/tools/test/h5repack/testfiles/h5repack_int32le_3d.h5
new file mode 100644
index 0000000..7a61ef5
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_3d.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_3d_ex-0.dat b/tools/test/h5repack/testfiles/h5repack_int32le_3d_ex-0.dat
new file mode 100644
index 0000000..b505eb4
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_3d_ex-0.dat
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_3d_ex.h5 b/tools/test/h5repack/testfiles/h5repack_int32le_3d_ex.h5
new file mode 100644
index 0000000..7c4b750
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_3d_ex.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
index 341a404..15d326a 100644
--- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
+++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
@@ -11,7 +11,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 5 }
+ PARAMS { 9 1 10 6 }
}
}
FILLVALUE {
@@ -33,7 +33,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 5 }
+ PARAMS { 9 1 10 6 }
}
}
FILLVALUE {
@@ -55,7 +55,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 5 }
+ PARAMS { 9 1 10 6 }
}
}
FILLVALUE {
@@ -77,7 +77,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 5 }
+ PARAMS { 9 1 10 6 }
}
}
FILLVALUE {
@@ -99,7 +99,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 5 }
+ PARAMS { 9 1 10 6 }
}
}
FILLVALUE {
@@ -121,7 +121,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 5 }
+ PARAMS { 9 1 10 6 }
}
}
FILLVALUE {
@@ -143,7 +143,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 10 5 }
+ PARAMS { 9 1 10 6 }
}
}
FILLVALUE {
diff --git a/tools/test/h5repack/testfiles/h5repack_uint8be.h5 b/tools/test/h5repack/testfiles/h5repack_uint8be.h5
new file mode 100644
index 0000000..0e25211
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_uint8be.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_uint8be_ex-0.dat b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-0.dat
new file mode 100644
index 0000000..f95b90a
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-0.dat
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_uint8be_ex-1.dat b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-1.dat
new file mode 100644
index 0000000..011ab48
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-1.dat
@@ -0,0 +1 @@
+@¿B½D»F¹H·JµL³N±P¯R­T«V©X§Z¥\£^¡`Ÿbd›f™h—j•l“n‘prt‹v‰x‡z…|ƒ~ \ No newline at end of file
diff --git a/tools/test/h5repack/testfiles/h5repack_uint8be_ex-2.dat b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-2.dat
new file mode 100644
index 0000000..069b96d
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-2.dat
@@ -0,0 +1 @@
+€‚}„{†yˆwŠuŒsŽqo’m”k–i˜gšeœcža _¢]¤[¦Y¨WªU¬S®Q°O²M´K¶I¸GºE¼C¾A \ No newline at end of file
diff --git a/tools/test/h5repack/testfiles/h5repack_uint8be_ex-3.dat b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-3.dat
new file mode 100644
index 0000000..240d8ca
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-3.dat
@@ -0,0 +1 @@
+À?Â=Ä;Æ9È7Ê5Ì3Î1Ð/Ò-Ô+Ö)Ø'Ú%Ü#Þ!àâäæèêìîðò ô ö øúüþ \ No newline at end of file
diff --git a/tools/test/h5repack/testfiles/h5repack_uint8be_ex.h5 b/tools/test/h5repack/testfiles/h5repack_uint8be_ex.h5
new file mode 100644
index 0000000..8787188
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_uint8be_ex.h5
Binary files differ
diff --git a/tools/test/h5repack/testh5repack_detect_szip.c b/tools/test/h5repack/testh5repack_detect_szip.c
index 6e7a24e..6b86dd5 100644
--- a/tools/test/h5repack/testh5repack_detect_szip.c
+++ b/tools/test/h5repack/testh5repack_detect_szip.c
@@ -50,10 +50,10 @@ int main(void)
#ifdef H5_HAVE_FILTER_SZIP
if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
- printf("yes\n");
+ HDprintf("yes\n");
return(1);
}
#endif /* H5_HAVE_FILTER_SZIP */
- printf("no\n");
+ HDprintf("no\n");
return(0);
}
diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt
index e65c76f..5c17fd5 100644
--- a/tools/test/h5stat/CMakeLists.txt
+++ b/tools/test/h5stat/CMakeLists.txt
@@ -4,14 +4,14 @@ project (HDF5_TOOLS_TEST_H5STAT C)
# --------------------------------------------------------------------
# Add the h5stat test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5stat_gentest ${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/h5stat_gentest.c)
- target_include_directories(h5stat_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5stat_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5stat_gentest STATIC)
target_link_libraries (h5stat_gentest PRIVATE ${HDF5_LIB_TARGET})
set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>)
+ #add_test (NAME h5stat_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat_gentest>)
endif ()
include (CMakeTests.cmake)
diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake
index ec8c9b1..9674a77 100644
--- a/tools/test/h5stat/CMakeTests.cmake
+++ b/tools/test/h5stat/CMakeTests.cmake
@@ -93,31 +93,25 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_H5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5STAT-${resultfile} COMMAND $<TARGET_FILE:h5stat> ${ARGN})
- if (NOT "${resultcode}" STREQUAL "0")
+ add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN})
+ if (${resultcode})
set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
else (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5STAT-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5STAT-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- add_test (
NAME H5STAT-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5stat>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -125,35 +119,22 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS H5STAT-${resultfile}-clear-objects)
endif ()
endmacro ()
macro (ADD_H5_ERR_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5STAT-${resultfile} COMMAND $<TARGET_FILE:h5stat> ${ARGN})
- if (NOT "${resultcode}" STREQUAL "0")
+ add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN})
+ if (${resultcode})
set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
else (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5STAT-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5STAT-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- add_test (
NAME H5STAT-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5stat>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -162,7 +143,6 @@
-D "TEST_ERRREF=${resultfile}.err"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS H5STAT-${resultfile}-clear-objects)
endif ()
endmacro ()
@@ -179,13 +159,8 @@
endforeach ()
add_test (
NAME H5STAT-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove ${CLEAR_LIST}
+ COMMAND ${CMAKE_COMMAND} -E remove ${CLEAR_LIST}
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5STAT-clearall-objects")
endif ()
# Test for help flag
diff --git a/tools/test/h5stat/Makefile.in b/tools/test/h5stat/Makefile.in
index e292740..76e99f9 100644
--- a/tools/test/h5stat/Makefile.in
+++ b/tools/test/h5stat/Makefile.in
@@ -482,7 +482,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -505,9 +504,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -534,6 +536,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -588,6 +591,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -612,7 +616,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1269,7 +1272,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c
index ae11032..2edfcf6 100644
--- a/tools/test/h5stat/h5stat_gentest.c
+++ b/tools/test/h5stat/h5stat_gentest.c
@@ -88,7 +88,7 @@ gen_newgrat_file(const char *fname)
/* Create NUM_GRPS groups in the root group */
for(i = 1; i <= NUM_GRPS; i++) {
- sprintf(name, "%s%d", GROUP_NAME,i);
+ HDsprintf(name, "%s%d", GROUP_NAME,i);
if((gid = H5Gcreate2(fid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
if(H5Gclose(gid) < 0)
@@ -109,7 +109,7 @@ gen_newgrat_file(const char *fname)
/* Create NUM_ATTRS for the dataset */
for(i = 1; i <= NUM_ATTRS; i++) {
- sprintf(attrname, "%s%d", ATTR_NAME,i);
+ HDsprintf(attrname, "%s%d", ATTR_NAME,i);
if((attr_id = H5Acreate2(did, attrname, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
if(H5Aclose(attr_id) < 0)
@@ -190,7 +190,7 @@ gen_threshold_file(const char *fname)
/* Create 11 attributes for the dataset */
for(i = 1; i <= (THRES_NUM+1); i++) {
- sprintf(name, "%s%d", THRES_ATTR_NAME,i);
+ HDsprintf(name, "%s%d", THRES_ATTR_NAME,i);
if((attr_id = H5Acreate2(did, name, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
if(H5Aclose(attr_id) < 0)
@@ -217,7 +217,7 @@ gen_threshold_file(const char *fname)
/* Create 10 attributes for the 2-D dataset */
for(i = 1; i <= THRES_NUM; i++) {
- sprintf(name, "%s%d", THRES_ATTR_NAME,i);
+ HDsprintf(name, "%s%d", THRES_ATTR_NAME,i);
if((attr_id = H5Acreate2(did, name, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
if(H5Aclose(attr_id) < 0)
@@ -241,7 +241,7 @@ gen_threshold_file(const char *fname)
/* Create 10 1-D datasets with non-zero dimension size for the group */
for(i = 1; i <= THRES_NUM; i++) {
/* set up dataset name */
- sprintf(name, "%s%d", THRES_DSET_NAME,i);
+ HDsprintf(name, "%s%d", THRES_DSET_NAME,i);
/* Create the dataset */
if((did = H5Dcreate2(gid, name, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -264,7 +264,7 @@ gen_threshold_file(const char *fname)
/* Create 25 attributes for the group */
for(i = 1; i <= THRES_NUM_25; i++) {
/* Set up attribute name */
- sprintf(name, "%s%d", THRES_ATTR_GRP_NAME,i);
+ HDsprintf(name, "%s%d", THRES_ATTR_GRP_NAME,i);
/* Create the attribute */
if((attr_id = H5Acreate2(gid, name, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -286,7 +286,7 @@ gen_threshold_file(const char *fname)
/* Create 9 1-D datasets with non-zero dimension size for the group */
for(i = 1; i < THRES_NUM; i++) {
/* set up dataset name */
- sprintf(name, "%s%d", THRES_DSET_NAME,i);
+ HDsprintf(name, "%s%d", THRES_DSET_NAME,i);
/* Create the dataset */
if((did = H5Dcreate2(gid, name, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
diff --git a/tools/test/h5stat/testfiles/h5stat_help1.ddl b/tools/test/h5stat/testfiles/h5stat_help1.ddl
index 01e39af..2ba7772 100644
--- a/tools/test/h5stat/testfiles/h5stat_help1.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_help1.ddl
@@ -23,3 +23,13 @@ Usage: h5stat [OPTIONS] file
-s, --freespace Print free space information
-S, --summary Print summary of file space information
--enable-error-stack Prints messages from the HDF5 error stack as they occur
+ --s3-cred=<cred> Access file on S3, using provided credential
+ <cred> :: (region,id,key)
+ If <cred> == "(,,)", no authentication is used.
+ --hdfs-attrs=<attrs> Access a file on HDFS with given configuration
+ attributes.
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ If an attribute is empty, a default value will be
+ used.
diff --git a/tools/test/h5stat/testfiles/h5stat_help2.ddl b/tools/test/h5stat/testfiles/h5stat_help2.ddl
index 01e39af..2ba7772 100644
--- a/tools/test/h5stat/testfiles/h5stat_help2.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_help2.ddl
@@ -23,3 +23,13 @@ Usage: h5stat [OPTIONS] file
-s, --freespace Print free space information
-S, --summary Print summary of file space information
--enable-error-stack Prints messages from the HDF5 error stack as they occur
+ --s3-cred=<cred> Access file on S3, using provided credential
+ <cred> :: (region,id,key)
+ If <cred> == "(,,)", no authentication is used.
+ --hdfs-attrs=<attrs> Access a file on HDFS with given configuration
+ attributes.
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ If an attribute is empty, a default value will be
+ used.
diff --git a/tools/test/h5stat/testfiles/h5stat_nofile.ddl b/tools/test/h5stat/testfiles/h5stat_nofile.ddl
index 01e39af..2ba7772 100644
--- a/tools/test/h5stat/testfiles/h5stat_nofile.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_nofile.ddl
@@ -23,3 +23,13 @@ Usage: h5stat [OPTIONS] file
-s, --freespace Print free space information
-S, --summary Print summary of file space information
--enable-error-stack Prints messages from the HDF5 error stack as they occur
+ --s3-cred=<cred> Access file on S3, using provided credential
+ <cred> :: (region,id,key)
+ If <cred> == "(,,)", no authentication is used.
+ --hdfs-attrs=<attrs> Access a file on HDFS with given configuration
+ attributes.
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ If an attribute is empty, a default value will be
+ used.
diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt
index 556b5b2..a250222 100644
--- a/tools/test/misc/CMakeLists.txt
+++ b/tools/test/misc/CMakeLists.txt
@@ -4,35 +4,55 @@ project (HDF5_TOOLS_TEST_MISC C)
# --------------------------------------------------------------------
# Add the misc test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5repart_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5repart_gentest.c)
- target_include_directories(h5repart_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (h5repart_gentest STATIC)
- target_link_libraries (h5repart_gentest PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_include_directories (h5repart_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5repart_gentest STATIC)
+ target_link_libraries (h5repart_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (h5repart_gentest SHARED)
+ target_link_libraries (h5repart_gentest PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
+ endif ()
set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>)
+ #add_test (NAME h5repart_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart_gentest>)
add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c)
- target_include_directories(h5clear_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (h5clear_gentest STATIC)
- target_link_libraries (h5clear_gentest PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_include_directories (h5clear_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5clear_gentest STATIC)
+ target_link_libraries (h5clear_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (h5clear_gentest SHARED)
+ target_link_libraries (h5clear_gentest PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
+ endif ()
set_target_properties (h5clear_gentest PROPERTIES FOLDER tools)
- #add_test (NAME H5CLEAR-h5clear_gentest COMMAND $<TARGET_FILE:h5clear_gentest>)
+ #add_test (NAME H5CLEAR-h5clear_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear_gentest>)
add_subdirectory (vds)
endif ()
add_executable (h5repart_test ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/repart_test.c)
-target_include_directories(h5repart_test PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5repart_test STATIC)
-target_link_libraries (h5repart_test PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (h5repart_test PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5repart_test STATIC)
+ target_link_libraries (h5repart_test PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5repart_test SHARED)
+ target_link_libraries (h5repart_test PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (h5repart_test PROPERTIES FOLDER tools)
add_executable (clear_open_chk ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/clear_open_chk.c)
-target_include_directories(clear_open_chk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (clear_open_chk STATIC)
-target_link_libraries (clear_open_chk PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (clear_open_chk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (clear_open_chk STATIC)
+ target_link_libraries (clear_open_chk PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (clear_open_chk SHARED)
+ target_link_libraries (clear_open_chk PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (clear_open_chk PROPERTIES FOLDER tools)
include (CMakeTestsRepart.cmake)
diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake
index c46ac59..a2c494d 100644
--- a/tools/test/misc/CMakeTestsClear.cmake
+++ b/tools/test/misc/CMakeTestsClear.cmake
@@ -83,24 +83,21 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
# Need special dependencies for tests that use the same reference file
# This is an issue on Windows
macro (ADD_H5_CMP testname resultfile resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5CLEAR_CMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${testname}.out
- testfiles/${testname}.out.err
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- add_test (
NAME H5CLEAR_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -108,27 +105,16 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects)
- set (last_test "H5CLEAR_CMP-${testname}")
endif ()
endmacro ()
macro (ADD_H5_ERR_CMP testname resultfile resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5CLEAR_CMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${testname}.out
- testfiles/${testname}.out.err
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- add_test (
NAME H5CLEAR_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -137,8 +123,6 @@
-D "TEST_ERRREF=${resultfile}.err"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects)
- set (last_test "H5CLEAR_CMP-${testname}")
endif ()
endmacro ()
@@ -146,26 +130,21 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5CLEAR_CMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${testname}.out
- testfiles/${testname}.out.err
- testfiles/${testfile}
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testfile}
+ )
add_test (
NAME H5CLEAR_CMP-copy_${testname}
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/testfiles/${testfile}" "${PROJECT_BINARY_DIR}/testfiles/${testfile}"
)
- set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects)
+ set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES
+ DEPENDS H5CLEAR_CMP-${testname}-clear-objects
+ )
add_test (
NAME H5CLEAR_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -173,8 +152,9 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-copy_${testname})
- set (last_test "H5CLEAR_CMP-${testname}")
+ set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES
+ DEPENDS H5CLEAR_CMP-copy_${testname}
+ )
endif ()
endmacro ()
@@ -182,26 +162,21 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5CLEAR_CMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${testname}.out
- testfiles/${testname}.out.err
- testfiles/${testfile}
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testfile}
+ )
add_test (
NAME H5CLEAR_CMP-copy_${testname}
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/testfiles/${testfile}" "${PROJECT_BINARY_DIR}/testfiles/${testfile}"
)
- set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects)
+ set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES
+ DEPENDS H5CLEAR_CMP-${testname}-clear-objects
+ )
add_test (
NAME H5CLEAR_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -210,8 +185,9 @@
-D "TEST_ERRREF=${resultfile}.err"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-copy_${testname})
- set (last_test "H5CLEAR_CMP-${testname}")
+ set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES
+ DEPENDS H5CLEAR_CMP-copy_${testname}
+ )
endif ()
endmacro ()
@@ -219,14 +195,12 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5CLEAR_RET-${testname}
- COMMAND $<TARGET_FILE:h5clear> ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> ${ARGN}
+ )
+ set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ WILL_FAIL "${resultcode}"
)
- set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES WILL_FAIL "${resultcode}")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5CLEAR_RET-${testname}")
endif ()
endmacro ()
@@ -234,28 +208,21 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5CLEAR_FILESIZE_TEST-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${testname}_before_size.out
- testfiles/${testname}_before_size.out.err
- testfiles/${testname}_after_size.out
- testfiles/${testname}_after_size.out.err
- testfiles/${testname}.h5
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR_FILESIZE_TEST-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}.h5
+ )
add_test (
NAME H5CLEAR_FILESIZE_TEST-copy_${testname}
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/testfiles/${testname}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testname}.h5"
)
- set_tests_properties (H5CLEAR_FILESIZE_TEST-copy_${testname} PROPERTIES DEPENDS H5CLEAR_FILESIZE_TEST-${testname}-clear-objects)
+ set_tests_properties (H5CLEAR_FILESIZE_TEST-copy_${testname} PROPERTIES
+ DEPENDS H5CLEAR_FILESIZE_TEST-${testname}-clear-objects
+ )
add_test (
NAME H5CLEAR_FILESIZE_CMP-${testname}_before_size
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
-D "TEST_ARGS:STRING=--filesize;${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}_before_size.out"
@@ -263,34 +230,102 @@
-D "TEST_REFERENCE=${resultfile}_before_size.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_before_size PROPERTIES DEPENDS H5CLEAR_FILESIZE_TEST-copy_${testname})
+ set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_before_size PROPERTIES
+ DEPENDS H5CLEAR_FILESIZE_TEST-copy_${testname}
+ )
if (NOT ${incr_size} MATCHES "NONE")
add_test (
NAME H5CLEAR_FILESIZE_INCR-${testname}
- COMMAND $<TARGET_FILE:h5clear> --increment=${incr_size} ${testname}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> --increment=${incr_size} ${testname}.h5
)
else ()
add_test (
NAME H5CLEAR_FILESIZE_INCR-${testname}
- COMMAND $<TARGET_FILE:h5clear> --increment ${testname}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> --increment ${testname}.h5
)
endif ()
- set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES WILL_FAIL "${resultcode}")
- set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES DEPENDS H5CLEAR_FILESIZE_CMP-${testname}_before_size)
+ set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ WILL_FAIL "${resultcode}"
+ DEPENDS H5CLEAR_FILESIZE_CMP-${testname}_before_size
+ )
add_test (
NAME H5CLEAR_FILESIZE_CMP-${testname}_after_size
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
-D "TEST_ARGS:STRING=--filesize;${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}_after_size.out"
+ -D "TEST_EXPECT=0"
+ -D "TEST_REFERENCE=${resultfile}_after_size.ddl"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_after_size PROPERTIES
+ DEPENDS H5CLEAR_FILESIZE_INCR-${testname}
+ )
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5_FILESIZE_FAIL_TEST testname resultcode resultfile incr_size)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (
+ NAME H5CLEAR_FILESIZE_FAIL_TEST-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}.h5
+ )
+ add_test (
+ NAME H5CLEAR_FILESIZE_FAIL_TEST-copy_${testname}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${PROJECT_SOURCE_DIR}/testfiles/${testname}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testname}.h5"
+ )
+ set_tests_properties (H5CLEAR_FILESIZE_FAIL_TEST-copy_${testname} PROPERTIES
+ DEPENDS H5CLEAR_FILESIZE_FAIL_TEST-${testname}-clear-objects
+ )
+ add_test (
+ NAME H5CLEAR_FILESIZE_FAIL_CMP-${testname}_before_size
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_ARGS:STRING=--filesize;${testname}.h5"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${testname}_before_size.out"
-D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.mty"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5CLEAR_FILESIZE_FAIL_CMP-${testname}_before_size PROPERTIES
+ DEPENDS H5CLEAR_FILESIZE_FAIL_TEST-copy_${testname}
+ )
+ if (NOT ${incr_size} MATCHES "NONE")
+ add_test (
+ NAME H5CLEAR_FILESIZE_FAIL_INCR-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s --increment=${incr_size} ${testname}.h5
+ )
+ else ()
+ add_test (
+ NAME H5CLEAR_FILESIZE_FAIL_INCR-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s --increment ${testname}.h5
+ )
+ endif ()
+ set_tests_properties (H5CLEAR_FILESIZE_FAIL_INCR-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5CLEAR_FILESIZE_FAIL_CMP-${testname}_before_size
+ )
+ add_test (
+ NAME H5CLEAR_FILESIZE_FAIL_CMP-${testname}_after_size
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_ARGS:STRING=--filesize;${testname}.h5"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${testname}_after_size.out"
+ -D "TEST_EXPECT=0"
-D "TEST_REFERENCE=${resultfile}_after_size.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_after_size PROPERTIES DEPENDS H5CLEAR_FILESIZE_INCR-${testname})
- set (last_test "H5CLEAR_FILESIZE_CMP-${testname}_after_size")
+ set_tests_properties (H5CLEAR_FILESIZE_FAIL_CMP-${testname}_after_size PROPERTIES
+ DEPENDS H5CLEAR_FILESIZE_FAIL_INCR-${testname}
+ )
endif ()
endmacro ()
@@ -298,32 +333,39 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5CLEAR-clr_open_chk-copy_${testname}.h5
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/testfiles/${testfile}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testfile}.h5"
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR-clr_open_chk-copy_${testname}.h5 PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5CLEAR-clr_open_chk-copy_${testname}.h5")
# Initial file open fails OR
# File open succeeds because the library does not check status_flags for file with < v3 superblock
- add_test (NAME H5CLEAR-clr_open_chk-${testname}_${resultcode} COMMAND $<TARGET_FILE:clear_open_chk> ${testfile}.h5)
- set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES WILL_FAIL "${resultcode}")
- set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES DEPENDS ${last_test})
- endif ()
+ add_test (
+ NAME H5CLEAR-clr_open_chk-${testname}_${resultcode}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:clear_open_chk> ${testfile}.h5
+ )
+ set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES
+ WILL_FAIL "${resultcode}"
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5CLEAR-clr_open_chk-copy_${testname}.h5
+ )
# After "h5clear" the file, the subsequent file open succeeds
- add_test (NAME H5CLEAR-h5clr-${testname} COMMAND $<TARGET_FILE:h5clear> -s ${testfile}.h5)
- set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES DEPENDS H5CLEAR-clr_open_chk-${testname}_${resultcode})
- set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- add_test (NAME H5CLEAR-clr_open_chk-${testname} COMMAND $<TARGET_FILE:clear_open_chk> ${testfile}.h5)
- set_tests_properties (H5CLEAR-clr_open_chk-${testname} PROPERTIES DEPENDS H5CLEAR-h5clr-${testname})
- set_tests_properties (H5CLEAR-clr_open_chk-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- set (last_test "H5CLEAR-clr_open_chk-${testname}")
+ add_test (
+ NAME H5CLEAR-h5clr-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s ${testfile}.h5
+ )
+ set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES
+ DEPENDS H5CLEAR-clr_open_chk-${testname}_${resultcode}
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
+ add_test (
+ NAME H5CLEAR-clr_open_chk-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:clear_open_chk> ${testfile}.h5
+ )
+ set_tests_properties (H5CLEAR-clr_open_chk-${testname} PROPERTIES
+ DEPENDS H5CLEAR-h5clr-${testname}
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
endif ()
endmacro ()
@@ -335,73 +377,6 @@
#
#
#
-# The following are tests to verify the status_flags field is cleared properly:
-if (HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5CLEAR-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- h5clear_log_v3.h5
- h5clear_mdc_image.h5
- h5clear_sec2_v0.h5
- h5clear_sec2_v2.h5
- h5clear_sec2_v3.h5
- orig_h5clear_sec2_v0.h5
- orig_h5clear_sec2_v2.h5
- orig_h5clear_sec2_v3.h5
- latest_h5clear_log_v3.h5
- latest_h5clear_sec2_v3.h5
- mod_h5clear_mdc_image.h5
- mod_h5clear_mdc_image2.h5
- ${HDF5_TEST_FILES}
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5CLEAR-clearall-objects")
-
- foreach (h5_file ${HDF5_TEST_FILES} ${HDF5_SEC2_TEST_FILES})
- add_test (
- NAME H5CLEAR-copy_${h5_file}
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
- "${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}"
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR-copy_${h5_file} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5CLEAR-copy_${h5_file}")
- endforeach ()
- # make second copy of h5clear_sec2.h5
- foreach (h5_file ${HDF5_SEC2_TEST_FILES})
- add_test (
- NAME H5CLEAR-copy_orig_${h5_file}
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
- "${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/orig_${h5_file}"
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR-copy_orig_${h5_file} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5CLEAR-copy_orig_${h5_file}")
- endforeach ()
- # make second copy of mod_h5clear_mdc_image.h5
- add_test (
- NAME H5CLEAR-copy_mod_h5clr_mdc_image2.h5
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
- "${PROJECT_SOURCE_DIR}/testfiles/mod_h5clear_mdc_image.h5" "${PROJECT_BINARY_DIR}/testfiles/mod_h5clear_mdc_image2.h5"
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR-copy_mod_h5clr_mdc_image2.h5 PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5CLEAR-copy_mod_h5clr_mdc_image2.h5")
-endif()
-
-#
-#
-#
# The following are tests to verify the expected output from h5clear
# "h5clear -h"
# "h5clear" (no options, no file)
@@ -475,9 +450,7 @@ endif()
# "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0)
# (no output, check exit code)
# "h5clear --filesize h5clear_status_noclose.h5" (print EOA/EOF after the last action)
- ADD_H5_ERR_CMP_WITH_COPY (h5clr_open_fail_nc_s 1 h5clear_open_fail h5clear_status_noclose.h5 "--filesize")
- ADD_H5_RETTEST (h5clr_mdc_image_nc "false" "-s" "--increment=0" h5clear_status_noclose.h5)
- ADD_H5_CMP (h5clr_no_mdc_image_nc_m h5clear_status_noclose_after_size 0 "--filesize" h5clear_status_noclose.h5)
+ ADD_H5_FILESIZE_FAIL_TEST (h5clear_status_noclose 1 h5clear_status_noclose 0)
#
# (2) h5clear_fsm_persist_noclose.h5
# "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF before the next action)
diff --git a/tools/test/misc/CMakeTestsMkgrp.cmake b/tools/test/misc/CMakeTestsMkgrp.cmake
index e99983b..11fa3f2 100644
--- a/tools/test/misc/CMakeTestsMkgrp.cmake
+++ b/tools/test/misc/CMakeTestsMkgrp.cmake
@@ -54,34 +54,34 @@
##############################################################################
##############################################################################
- macro (ADD_H5_TEST resultfile resultcode resultoption)
- if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- add_test (
- NAME H5MKGRP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.h5
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- endif ()
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+ macro (ADD_H5_TEST resultfile resultcode resultoption)
+ add_test (
+ NAME H5MKGRP-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5
+ )
+ set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
add_test (
NAME H5MKGRP-${resultfile}
- COMMAND $<TARGET_FILE:h5mkgrp> ${resultoption} ${resultfile}.h5 ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_ext}> ${resultoption} ${resultfile}.h5 ${ARGN}
)
- set_tests_properties (H5MKGRP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (HDF5_ENABLE_USING_MEMCHECKER)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
- else (HDF5_ENABLE_USING_MEMCHECKER)
- set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects)
+ set_tests_properties (H5MKGRP-${resultfile} PROPERTIES
+ DEPENDS H5MKGRP-${resultfile}-clear-objects
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5MKGRP-${resultfile}-h5ls
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
-D "TEST_ARGS:STRING=-v;-r;${resultfile}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -96,21 +96,20 @@
macro (ADD_H5_CMP resultfile resultcode)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${ARGN})
+ add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp> ${ARGN})
else ()
add_test (
NAME H5MKGRP_CMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.h5
- ${resultfile}.out
- ${resultfile}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5
+ )
+ set_tests_properties (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
)
- set_tests_properties (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
add_test (
NAME H5MKGRP_CMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -118,7 +117,9 @@
-D "TEST_REFERENCE=${resultfile}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects)
+ set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES
+ DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects
+ )
endif ()
endmacro ()
@@ -130,54 +131,23 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5MKGRP-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- h5mkgrp_help.out
- h5mkgrp_help.out.err
- h5mkgrp_version.out
- h5mkgrp_version.out.err
- h5mkgrp_single.h5
- h5mkgrp_single.out
- h5mkgrp_single.out.err
- h5mkgrp_single_v.h5
- h5mkgrp_single_v.out
- h5mkgrp_single_v.out.err
- h5mkgrp_single_p.h5
- h5mkgrp_single_p.out
- h5mkgrp_single_p.out.err
- h5mkgrp_single_l.h5
- h5mkgrp_single_l.out
- h5mkgrp_single_l.out.err
- h5mkgrp_several.h5
- h5mkgrp_several.out
- h5mkgrp_several.out.err
- h5mkgrp_several_v.h5
- h5mkgrp_several_v.out
- h5mkgrp_several_v.out.err
- h5mkgrp_several_p.h5
- h5mkgrp_several_p.out
- h5mkgrp_several_p.out.err
- h5mkgrp_several_l.h5
- h5mkgrp_several_l.out
- h5mkgrp_several_l.out.err
- h5mkgrp_nested_p.h5
- h5mkgrp_nested_p.out
- h5mkgrp_nested_p.out.err
- h5mkgrp_nested_lp.h5
- h5mkgrp_nested_lp.out
- h5mkgrp_nested_lp.out.err
- h5mkgrp_nested_mult_p.h5
- h5mkgrp_nested_mult_p.out
- h5mkgrp_nested_mult_p.out.err
- h5mkgrp_nested_mult_lp.h5
- h5mkgrp_nested_mult_lp.out
- h5mkgrp_nested_mult_lp.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove
+ h5mkgrp_single.h5
+ h5mkgrp_single_v.h5
+ h5mkgrp_single_p.h5
+ h5mkgrp_single_l.h5
+ h5mkgrp_several.h5
+ h5mkgrp_several_v.h5
+ h5mkgrp_several_p.h5
+ h5mkgrp_several_l.h5
+ h5mkgrp_nested_p.h5
+ h5mkgrp_nested_lp.h5
+ h5mkgrp_nested_mult_p.h5
+ h5mkgrp_nested_mult_lp.h5
+ )
+ set_tests_properties (H5MKGRP-clearall-objects PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
)
- set_tests_properties (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5MKGRP-clearall-objects")
endif ()
# Check that help & version is displayed properly
diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake
index 8edd243..fa49c53 100644
--- a/tools/test/misc/CMakeTestsRepart.cmake
+++ b/tools/test/misc/CMakeTestsRepart.cmake
@@ -58,6 +58,12 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
# Remove any output file left over from previous test run
add_test (
NAME H5REPART-clearall-objects
@@ -74,31 +80,46 @@
set_tests_properties (H5REPART-clearall-objects PROPERTIES FIXTURES_SETUP clear_testrepart)
# repartition family member size to 20,000 bytes.
- add_test (NAME H5REPART-h5repart_20K COMMAND $<TARGET_FILE:h5repart> -m 20000 family_file%05d.h5 fst_family%05d.h5)
+ add_test (
+ NAME H5REPART-h5repart_20K
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 family_file%05d.h5 fst_family%05d.h5
+ )
set_tests_properties (H5REPART-h5repart_20K PROPERTIES
FIXTURES_REQUIRED clear_testrepart
)
# repartition family member size to 5 KB.
- add_test (NAME H5REPART-h5repart_5K COMMAND $<TARGET_FILE:h5repart> -m 5k family_file%05d.h5 scd_family%05d.h5)
+ add_test (
+ NAME H5REPART-h5repart_5K
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 5k family_file%05d.h5 scd_family%05d.h5
+ )
set_tests_properties (H5REPART-h5repart_5K PROPERTIES
FIXTURES_REQUIRED clear_testrepart
)
# convert family file to sec2 file of 20,000 bytes
- add_test (NAME H5REPART-h5repart_single COMMAND $<TARGET_FILE:h5repart> -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5)
+ add_test (
+ NAME H5REPART-h5repart_single
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5
+ )
set_tests_properties (H5REPART-h5repart_single PROPERTIES
FIXTURES_REQUIRED clear_testrepart
)
# convert family file to sec2 file of 20,000 bytes (old argument)
- add_test (NAME H5REPART-h5repart_sec2 COMMAND $<TARGET_FILE:h5repart> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5)
+ add_test (
+ NAME H5REPART-h5repart_sec2
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5
+ )
set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES
FIXTURES_REQUIRED clear_testrepart
)
# test the output files repartitioned above.
- add_test (NAME H5REPART-h5repart_test COMMAND $<TARGET_FILE:h5repart_test>)
+ add_test (
+ NAME H5REPART-h5repart_test
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart_test>
+ )
set_tests_properties (H5REPART-h5repart_test PROPERTIES
DEPENDS "H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_single;H5REPART-h5repart_sec2"
)
diff --git a/tools/test/misc/Makefile.in b/tools/test/misc/Makefile.in
index c0f403c..d7b226a 100644
--- a/tools/test/misc/Makefile.in
+++ b/tools/test/misc/Makefile.in
@@ -544,7 +544,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -567,9 +566,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -596,6 +598,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -650,6 +653,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -674,7 +678,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1441,7 +1444,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c
index 88c8ea5..96d7e75e7 100644
--- a/tools/test/misc/h5clear_gentest.c
+++ b/tools/test/misc/h5clear_gentest.c
@@ -15,10 +15,10 @@
/* The HDF5 test files */
const char *FILENAME[] = {
- "h5clear_sec2_v3.h5", /* 0 -- sec2 file with superblock version 3 */
- "h5clear_log_v3.h5", /* 1 -- log file with superblock veresion 3 */
- "h5clear_sec2_v0.h5", /* 2 -- sec2 file with superblock version 0 */
- "h5clear_sec2_v2.h5" /* 3 -- sec2 file with superblock version 2 */
+ "h5clear_sec2_v3.h5", /* 0 -- sec2 file with superblock version 3 */
+ "h5clear_log_v3.h5", /* 1 -- log file with superblock veresion 3 */
+ "h5clear_sec2_v0.h5", /* 2 -- sec2 file with superblock version 0 */
+ "h5clear_sec2_v2.h5" /* 3 -- sec2 file with superblock version 2 */
};
const char *FILENAME_ENHANCE[] = {
@@ -28,12 +28,12 @@ const char *FILENAME_ENHANCE[] = {
"h5clear_fsm_persist_user_equal.h5", /* 3: user block, persisting free-space, stored EOA = actual EOF */
"h5clear_fsm_persist_user_greater.h5", /* 4: user block, persisting free-space, stored EOA > actual EOF */
"h5clear_fsm_persist_user_less.h5", /* 5: user block, persisting free-space, stored EOA < actual EOF */
- "h5clear_status_noclose.h5", /* 6 -- v3 superblock, nonzero status_flags, no flush, exit,
+ "h5clear_status_noclose.h5", /* 6 -- v3 superblock, nonzero status_flags, no flush, exit,
stored EOA < actual EOF */
"h5clear_fsm_persist_noclose.h5" /* 7 -- persisting free-space, no flush, exit, stored EOA < actual EOF */
};
-#define KB 1024U
+#define KB 1024U
#define CACHE_IMAGE_FILE "h5clear_mdc_image.h5"
#define DSET "DSET"
@@ -42,14 +42,14 @@ const char *FILENAME_ENHANCE[] = {
#define USERBLOCK 512
/*-------------------------------------------------------------------------
- * Function: gen_cache_image_file
+ * Function: gen_cache_image_file
*
- * Purpose: To create a file with cache image feature enabled.
+ * Purpose: To create a file with cache image feature enabled.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Vailin Choi; March 2017
+ * Programmer: Vailin Choi; March 2017
*
*-------------------------------------------------------------------------
*/
@@ -136,9 +136,9 @@ error:
} /* gen_cache_image_file() */
/*-------------------------------------------------------------------------
- * Function: gen_enhance_files
+ * Function: gen_enhance_files
*
- * Purpose: To create the first 6 files in FILENAME_ENHANCE[]:
+ * Purpose: To create the first 6 files in FILENAME_ENHANCE[]:
* (0) FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5"
* (1) FILENAME_ENHANCE[1]: "h5clear_fsm_persist_greater.h5"
* (2) FILENAME_ENHANCE[2]: "h5clear_fsm_persist_less.h5"
@@ -149,15 +149,15 @@ error:
* value to the location where the EOA is stored in the superblock.
* Also modify the chksum in the superblock due to this change.
*
- * The first call to this routine (without user block) will generate
+ * The first call to this routine (without user block) will generate
* the first 3 files.
* The second call to this routine (with user block) will generate
* the last 3 files.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Vailin Choi; March 2017
+ * Programmer: Vailin Choi; March 2017
*
*-------------------------------------------------------------------------
*/
@@ -172,7 +172,7 @@ gen_enhance_files(hbool_t user)
int data[NUM_ELMTS]; /* Buffer for data */
int fd = -1; /* The file descriptor ID */
int64_t eoa; /* The EOA value */
- int32_t chksum; /* The chksum value */
+ uint32_t chksum; /* The chksum value */
int i = 0 , j = 0, u = 0; /* Local index variable */
/* Get a copy of the default file creation property */
@@ -190,7 +190,7 @@ gen_enhance_files(hbool_t user)
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0)
goto error;
- /*
+ /*
* Create the file, then write invalid EOA to the file.
*/
for(i = 0+u; i < 3+u; i++) {
@@ -221,21 +221,21 @@ gen_enhance_files(hbool_t user)
if(H5Fclose(fid) < 0)
goto error;
- /*
+ /*
* No further action for:
- * --FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5"
+ * --FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5"
* --FILENAME_ENHANCE[3]: "h5clear_fsm_persist_user_equal.h5",
*/
if(!(i % 3))
continue;
- /*
+ /*
* For the following files:
* --FILENAME_ENHANCE[1]: "h5clear_fsm_persist_greater.h5"
* --FILENAME_ENHANCE[2]: "h5clear_fsm_persist_less.h5"
* --FILENAME_ENHANCE[4]: "h5clear_fsm_persist_greater.h5"
* --FILENAME_ENHANCE[5]: "h5clear_fsm_persist_less.h5"
*
- * Write invalid value to the location for stored eoa and
+ * Write invalid value to the location for stored eoa and
* update the chksum value.
*/
/* Open the file */
@@ -306,9 +306,9 @@ error:
} /* gen_enhance_files() */
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Generate test files used by h5clear.
+ * Purpose: Generate test files used by h5clear.
*
* (A) gen_cache_image_file():
* --generate a file with cache image feature
@@ -317,10 +317,10 @@ error:
* --generate the first 6 files in FILENAME_ENHANCE[]:
* (0) "h5clear_fsm_persist_equal.h5"
* (1) "h5clear_fsm_persist_greater.h5"
- * (2) "h5clear_fsm_persist_less.h5"
- * (3) "h5clear_fsm_persist_user_equal.h5"
+ * (2) "h5clear_fsm_persist_less.h5"
+ * (3) "h5clear_fsm_persist_user_equal.h5"
* (4) "h5clear_fsm_persist_user_greater.h5"
- * (5) "h5clear_fsm_persist_user_less.h5"
+ * (5) "h5clear_fsm_persist_user_less.h5"
*
* (C) Generate the following FILENAME[] files in main():
* (0a) "h5clear_sec2_v3.h5"
@@ -328,43 +328,43 @@ error:
* (1a) "h5clear_log_v3.h5",
* (1b) "latest_h5clear_log_v3.h5"
* (2) "h5clear_sec2_v0.h5"
- * (3) "h5clear_sec2_v2.h5"
- *
- * These HDF5 files are created with non-zero status_flags in
+ * (3) "h5clear_sec2_v2.h5"
+ *
+ * These HDF5 files are created with non-zero status_flags in
* the superblock via flushing and exiting without closing the
* library.
- * Due to file locking, status_flags in the superblock will be
- * nonzero after H5Fcreate. The library will clear status_flags
- * on file closing.
+ * Due to file locking, status_flags in the superblock will be
+ * nonzero after H5Fcreate. The library will clear status_flags
+ * on file closing.
* This program, after "H5Fcreate" the files, exits without
- * going through library closing. Thus, status_flags for these
- * files are not cleared.
- * The library will check consistency of status_flags when
- * opening a file with superblock >= v3 and will return error
+ * going through library closing. Thus, status_flags for these
+ * files are not cleared.
+ * The library will check consistency of status_flags when
+ * opening a file with superblock >= v3 and will return error
* accordingly.
- * The library will not check status_flags when opening a file
- * with < v3 superblock.
- * These files are used by "h5clear" to see if the tool clears
- * status_flags properly so users can open the files afterwards.
- *
+ * The library will not check status_flags when opening a file
+ * with < v3 superblock.
+ * These files are used by "h5clear" to see if the tool clears
+ * status_flags properly so users can open the files afterwards.
+ *
* (D) Generate the last two files in FILENAME_ENHANCE[] in main():
- * (6) "h5clear_status_noclose.h5",
+ * (6) "h5clear_status_noclose.h5",
* (7) "h5clear_fsm_persist_noclose.h5"
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Vailin Choi; July 2013
+ * Programmer: Vailin Choi; July 2013
*
*-------------------------------------------------------------------------
*/
int
main(void)
{
- hid_t fid = -1; /* File ID */
- hid_t fcpl = -1; /* File creation property list */
- hid_t fapl = -1, new_fapl = -1; /* File access property lists */
- char fname[512]; /* File name */
+ hid_t fid = -1; /* File ID */
+ hid_t fcpl = -1; /* File creation property list */
+ hid_t fapl = -1, new_fapl = -1; /* File access property lists */
+ char fname[512]; /* File name */
unsigned new_format; /* To use latest library format or not */
hid_t sid = -1; /* Dataspace ID */
hid_t did = -1; /* Dataset ID */
@@ -382,7 +382,7 @@ main(void)
if(gen_enhance_files(TRUE) < 0)
goto error;
- /*
+ /*
* Generate files in FILENAME[]
*/
/* Create a copy of the file access property list */
@@ -396,13 +396,13 @@ main(void)
if(H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
goto error;
- /*
+ /*
* Files created within this for loop will have v3 superblock and nonzero status_flags
* --FILENAME[0]: "h5clear_sec2_v3.h5", "latest_h5clear_sec2_v3.h5"
* --FILENAME[1]: "h5clear_log_v3.h5", "latest_h5clear_log_v3.h5"
*/
for(new_format = FALSE; new_format <= TRUE; new_format++) {
- hid_t fapl2, my_fapl; /* File access property lists */
+ hid_t fapl2, my_fapl; /* File access property lists */
/* Set to use the appropriate file access property list */
if(new_format)
@@ -415,14 +415,14 @@ main(void)
if((my_fapl = H5Pcopy(fapl2)) < 0)
goto error;
/* Create the file */
- sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]);
- if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0)
+ HDsprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]);
+ if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0)
goto error;
/* Flush the file */
if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
goto error;
-
+
/* Close the property list */
if(H5Pclose(my_fapl) < 0)
goto error;
@@ -439,8 +439,8 @@ main(void)
goto error;
/* Create the file */
- sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]);
- if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0)
+ HDsprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]);
+ if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0)
goto error;
/* Flush the file */
@@ -453,11 +453,11 @@ main(void)
} /* end for */
- /*
+ /*
* Create a sec2 file with v0 superblock but nonzero status_flags:
* FILENAME[2]: "h5clear_sec2_v0.h5"
*/
- if((fid = H5Fcreate(FILENAME[2], H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if((fid = H5Fcreate(FILENAME[2], H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
/* Flush the file */
@@ -465,9 +465,9 @@ main(void)
goto error;
- /*
+ /*
* Create a sec2 file with v2 superblock but nonzero status_flags:
- * FILENAME[3]: "h5clear_sec2_v2.h5"
+ * FILENAME[3]: "h5clear_sec2_v2.h5"
*/
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
goto error;
@@ -476,14 +476,14 @@ main(void)
if(H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 50) < 0)
goto error;
- if((fid = H5Fcreate(FILENAME[3], H5F_ACC_TRUNC, fcpl, fapl)) < 0)
+ if((fid = H5Fcreate(FILENAME[3], H5F_ACC_TRUNC, fcpl, fapl)) < 0)
goto error;
/* Flush the file */
if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
goto error;
-
+
/* Close the property lists */
if(H5Pclose(fapl) < 0)
goto error;
@@ -492,10 +492,10 @@ main(void)
if(H5Pclose(fcpl) < 0)
goto error;
- /*
+ /*
* Create the last two files in FILENAME_ENHANCE[]:
* --FILENAME_ENHANCE[6]: h5clear_status_noclose.h5
- * --FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5
+ * --FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5
*/
/*
* FILENAME_ENHANCE[6]: h5clear_status_noclose.h5
@@ -503,7 +503,7 @@ main(void)
* --version 3 superblock
* --nonzero status_flags
* --does not persist free-space
- * --does not flush the file, just exit without closing file:
+ * --does not flush the file, just exit without closing file:
* --this file is similar to the user-suppplied test file attached with HDFFV-10347
*/
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
@@ -542,8 +542,8 @@ main(void)
/* Does not flush and does not close the file */
- /*
- * FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5
+ /*
+ * FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5
* --stored EOA < actual EOF
* --persisting free-space
* --undefined fsinfo.eoa_pre_fsm_fsalloc
diff --git a/tools/test/misc/h5perf_gentest.c b/tools/test/misc/h5perf_gentest.c
index 3784278..f50e5fb 100644
--- a/tools/test/misc/h5perf_gentest.c
+++ b/tools/test/misc/h5perf_gentest.c
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*****************************************************************************
- This test generates attributes, groups, and datasets of many types. It
- creates a large number of attributes, groups, and datasets by specifying
+ This test generates attributes, groups, and datasets of many types. It
+ creates a large number of attributes, groups, and datasets by specifying
-a, -g, -d options respectively. Using "-h" option to see details.
Programmer: Peter Cao <xcao@hdfgroup.org>, Jan. 2013
@@ -31,7 +31,7 @@
#define MAXVLEN 10
#define FIXED_LEN 8
-typedef enum { SOLID=0, LIQUID, GAS, PLASMA } phase_t;
+typedef enum { SOLID=0, LIQUID, GAS, PLASMA } phase_t;
typedef struct {
int i;
@@ -43,24 +43,24 @@ typedef struct {
float f_array[FIXED_LEN];
hvl_t i_vlen;
char *s_vlen;
-} test_comp_t;
+} test_comp_t;
typedef struct {
int zipcode;
char *city;
-} zipcode_t;
+} zipcode_t;
int add_attrs(hid_t oid, int idx);
int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) ;
-herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
- int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
- int compressed, int latest);
+herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
+ int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
+ int compressed, int latest);
int main (int argc, char *argv[])
{
char fname[32];
- int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, dim0=DIM0,
- chunk=DIM0/10+1, nrows=NROWS, vlen=MAXVLEN, l=0, z=0;
+ int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, dim0=DIM0,
+ chunk=DIM0/10+1, nrows=NROWS, vlen=MAXVLEN, l=0, z=0;
memset(fname, 0, 32);
for (i=1; i<argc; i++) {
@@ -83,92 +83,92 @@ int main (int argc, char *argv[])
else if (strcmp(argv[i], "-l")==0)
l = 1;
else if (strcmp(argv[i], "-z")==0)
- z = 1;
+ z = 1;
else if (strcmp(argv[i], "-h")==0) {
- printf("\nOPTONS:\n");
- printf("\t-f F:\tname of the test file (default: %s).\n", FNAME);
- printf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS);
- printf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS);
- printf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS);
- printf("\t-r N:\tnumber of rows in the large compound dataset (default: %d).\n", NROWS);
- printf("\t-s N:\tsize of dim0 in datasets (default: %d).\n", DIM0);
- printf("\t-c N:\tchunk size of dim0 (default: %d).\n", (DIM0/10+1));
- printf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN);
- printf("\t-l:\tuse latest format (default: no).\n");
- printf("\t-z:\tuse gzip compression (default: no).\n");
- printf("\t-h:\tthis help information.\n");
- printf("Example:\n");
- printf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 10000 -s 200 -c 20 -v 40 -l -z\n\n");
+ HDprintf("\nOPTONS:\n");
+ HDprintf("\t-f F:\tname of the test file (default: %s).\n", FNAME);
+ HDprintf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS);
+ HDprintf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS);
+ HDprintf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS);
+ HDprintf("\t-r N:\tnumber of rows in the large compound dataset (default: %d).\n", NROWS);
+ HDprintf("\t-s N:\tsize of dim0 in datasets (default: %d).\n", DIM0);
+ HDprintf("\t-c N:\tchunk size of dim0 (default: %d).\n", (DIM0/10+1));
+ HDprintf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN);
+ HDprintf("\t-l:\tuse latest format (default: no).\n");
+ HDprintf("\t-z:\tuse gzip compression (default: no).\n");
+ HDprintf("\t-h:\tthis help information.\n");
+ HDprintf("Example:\n");
+ HDprintf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 10000 -s 200 -c 20 -v 40 -l -z\n\n");
exit(0);
}
}
-
+
if (strlen(fname)<=0)
- sprintf(fname, FNAME);
+ HDsprintf(fname, FNAME);
+
+ create_perf_test_file(fname, ngrps, ndsets, nattrs, (hsize_t)nrows,
+ (hsize_t)dim0, (hsize_t)chunk, vlen, z, l);
- create_perf_test_file(fname, ngrps, ndsets, nattrs, (hsize_t)nrows,
- (hsize_t)dim0, (hsize_t)chunk, vlen, z, l);
-
return 0;
}
/*****************************************************************************
- This function generates attributes, groups, and datasets of many types.
+ This function generates attributes, groups, and datasets of many types.
Parameters:
- fname: file_name.
- ngrps: number of top level groups.
- ndsets: number of datasets.
- attrs: number of attributes.
- nrow: number of rows in a dataset.
- chunk: chunk size (single number).
- vlen: max vlen size.
- comp: use latest format.
- latest: use gzip comnpression.
-
+ fname: file_name.
+ ngrps: number of top level groups.
+ ndsets: number of datasets.
+ attrs: number of attributes.
+ nrow: number of rows in a dataset.
+ chunk: chunk size (single number).
+ vlen: max vlen size.
+ comp: use latest format.
+ latest: use gzip comnpression.
+
Return: Non-negative on success/Negative on failure
-
+
Programmer: Peter Cao <xcao@hdfgroup.org>, Jan. 2013
****************************************************************************/
-herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
- int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
- int compressed, int latest)
+herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
+ int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
+ int compressed, int latest)
{
int i, j, k;
- hid_t fid, sid_null, sid_scalar, sid_1d, sid_2d, did, aid, sid_2, sid_large,
- fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str,
- tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s;
+ hid_t fid, sid_null, sid_scalar, sid_1d, sid_2d, did, aid, sid_2, sid_large,
+ fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str,
+ tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s;
char name[32], tmp_name1[32], tmp_name2[32], tmp_name3[32];
- hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN},
- dim1[1]={2};
+ hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN},
+ dim1[1]={2};
char *enum_names[4] = {"SOLID", "LIQUID", "GAS", "PLASMA"};
test_comp_t *buf_comp=NULL, *buf_comp_large=NULL;
int *buf_int=NULL;
float (*buf_float_a)[FIXED_LEN]=NULL;
double **buf_double2d=NULL;
hvl_t *buf_vlen_i=NULL;
- char (*buf_str)[FIXED_LEN];
- char **buf_vlen_s=NULL;
- hobj_ref_t buf_ref[2];
- hdset_reg_ref_t buf_reg_ref[2];
+ char (*buf_str)[FIXED_LEN];
+ char **buf_vlen_s=NULL;
+ hobj_ref_t buf_ref[2];
+ hdset_reg_ref_t buf_reg_ref[2];
size_t offset, len;
herr_t status;
- char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string",
- "enum", "fixed float array", "vlen int array", "vlen strings"};
- hid_t types[NTYPES] = { H5T_NATIVE_INT, H5T_NATIVE_UINT64, H5T_NATIVE_FLOAT,
+ char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string",
+ "enum", "fixed float array", "vlen int array", "vlen strings"};
+ hid_t types[NTYPES] = { H5T_NATIVE_INT, H5T_NATIVE_UINT64, H5T_NATIVE_FLOAT,
H5T_NATIVE_DOUBLE, tid_str, tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s};
- hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1;
-
- if (nrows < NROWS) nrows = NROWS;
+ hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1;
+
+ if (nrows < NROWS) nrows = NROWS;
if (ngrps<NGROUPS) ngrps=NGROUPS;
- if (ndsets<NDSETS) ndsets=NDSETS;
- if (nattrs<NATTRS) nattrs=NATTRS;
- if (dim0<DIM0) dim0=DIM0;
+ if (ndsets<NDSETS) ndsets=NDSETS;
+ if (nattrs<NATTRS) nattrs=NATTRS;
+ if (dim0<DIM0) dim0=DIM0;
if (chunk>dim0) chunk=dim0/4;
if (chunk<1) chunk = 1;
- if (vlen<1) vlen = MAXVLEN;
+ if (vlen<1) vlen = MAXVLEN;
- /* create fixed string datatype */
+ /* create fixed string datatype */
types[4] = tid_str = H5Tcopy (H5T_C_S1);
H5Tset_size (tid_str, FIXED_LEN);
@@ -181,15 +181,15 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
/* create float array datatype */
types[6] = tid_array_f = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims_array);
-
+
/* create variable length integer datatypes */
types[7] = tid_vlen_i = H5Tvlen_create (H5T_NATIVE_INT);
-
+
/* create variable length string datatype */
types[8] = tid_vlen_s = H5Tcopy (H5T_C_S1);
H5Tset_size (tid_vlen_s, H5T_VARIABLE);
-
- /* create compound datatypes */
+
+ /* create compound datatypes */
cmp_tid = H5Tcreate (H5T_COMPOUND, sizeof (test_comp_t));
offset = 0;
for (i=0; i<NTYPES-2; i++) {
@@ -197,31 +197,31 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
offset += H5Tget_size(types[i]);
}
- H5Tinsert(cmp_tid, names[7], offset, types[7]);
- offset += sizeof (hvl_t);
- H5Tinsert(cmp_tid, names[8], offset, types[8]);
+ H5Tinsert(cmp_tid, names[7], offset, types[7]);
+ offset += sizeof (hvl_t);
+ H5Tinsert(cmp_tid, names[8], offset, types[8]);
- /* create dataspace */
+ /* create dataspace */
sid_1d = H5Screate_simple (1, dims, NULL);
sid_2d = H5Screate_simple (2, dims2d, NULL);
sid_2 = H5Screate_simple (1, dim1, NULL);
- sid_large = H5Screate_simple (1, &nrows, NULL);
- sid_null = H5Screate (H5S_NULL);
- sid_scalar = H5Screate (H5S_SCALAR);
-
- /* create fid access property */
- fapl = H5Pcreate (H5P_FILE_ACCESS);
+ sid_large = H5Screate_simple (1, &nrows, NULL);
+ sid_null = H5Screate (H5S_NULL);
+ sid_scalar = H5Screate (H5S_SCALAR);
+
+ /* create fid access property */
+ fapl = H5Pcreate (H5P_FILE_ACCESS);
H5Pset_libver_bounds (fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
- /* create dataset creation property */
+ /* create dataset creation property */
dcpl = H5Pcreate (H5P_DATASET_CREATE);
- /* set dataset chunk */
+ /* set dataset chunk */
if (chunk>0) {
H5Pset_chunk (dcpl, 1, &chunk);
}
- /* set dataset compression */
+ /* set dataset compression */
if (compressed) {
if (chunk<=0) {
chunk = dim0/10+1;;
@@ -229,54 +229,54 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
}
H5Pset_shuffle (dcpl);
H5Pset_deflate (dcpl, 6);
- }
+ }
- /* allocate buffers */
+ /* allocate buffers */
buf_comp = (test_comp_t *)calloc(dim0, sizeof(test_comp_t));
buf_comp_large = (test_comp_t *)calloc(nrows, sizeof(test_comp_t));
buf_int = (int *)calloc(dim0, sizeof(int));
buf_float_a = malloc(dim0*sizeof(*buf_float_a));
- buf_vlen_i = (hvl_t *)calloc(dim0, sizeof (hvl_t));
+ buf_vlen_i = (hvl_t *)calloc(dim0, sizeof (hvl_t));
buf_vlen_s = (char **)calloc(dim0, sizeof(char *));
- buf_str = malloc(dim0*sizeof (*buf_str));
+ buf_str = malloc(dim0*sizeof (*buf_str));
- /* allocate array of doulbe pointers */
- buf_double2d = (double **)calloc(dims2d[0],sizeof(double *));
- /* allocate a contigous chunk of memory for the data */
- buf_double2d[0] = (double *)calloc( dims2d[0]*dims2d[1],sizeof(double) );
- /* assign memory city to pointer array */
- for (i=1; i <dims2d[0]; i++) buf_double2d[i] = buf_double2d[0]+i*dims2d[1];
+ /* allocate array of doulbe pointers */
+ buf_double2d = (double **)calloc(dims2d[0],sizeof(double *));
+ /* allocate a contigous chunk of memory for the data */
+ buf_double2d[0] = (double *)calloc( dims2d[0]*dims2d[1],sizeof(double) );
+ /* assign memory city to pointer array */
+ for (i=1; i <dims2d[0]; i++) buf_double2d[i] = buf_double2d[0]+i*dims2d[1];
- /* fill buffer values */
- len = 1;
+ /* fill buffer values */
+ len = 1;
for (i=0; i<dims[0]; i++) {
buf_comp[i].i = buf_int[i] = i-2147483648;
buf_comp[i].l = 0xffffffffffffffff-i;
buf_comp[i].f = 1.0/(i+1.0);
buf_comp[i].d = 987654321.0*i+1.0/(i+1.0);
buf_comp[i].e = (phase_t) (i % (int) (PLASMA + 1));
-
- for (j=0; j<FIXED_LEN; j++) {
- buf_comp[i].f_array[j] = buf_float_a[i][j] = i*100+j;
- buf_str[i][j] = 'a' + (i%26);
- }
- buf_str[i][FIXED_LEN-1] = 0;
+
+ for (j=0; j<FIXED_LEN; j++) {
+ buf_comp[i].f_array[j] = buf_float_a[i][j] = i*100+j;
+ buf_str[i][j] = 'a' + (i%26);
+ }
+ buf_str[i][FIXED_LEN-1] = 0;
strcpy(buf_comp[i].s, buf_str[i]);
-
- len = (1-cos(i/8.0))/2*vlen+1;
- if (!i) len = vlen;
- buf_vlen_i[i].len = len;
- buf_vlen_i[i].p = (int *)calloc(len, sizeof(int));
- for (j=0; j<len; j++) ((int*)(buf_vlen_i[i].p))[j] = i*100+j;
- buf_comp[i].i_vlen = buf_vlen_i[i];
-
- buf_vlen_s[i] = (char *)calloc(len, sizeof(char));
- for (j=0; j<len-1; j++)
- buf_vlen_s[i][j] = j%26+'A';
- buf_comp[i].s_vlen = buf_vlen_s[i];
-
- for (j=0; j<dims2d[1]; j++)
- buf_double2d[i][j] = i+j/10000.0;
+
+ len = (1-cos(i/8.0))/2*vlen+1;
+ if (!i) len = vlen;
+ buf_vlen_i[i].len = len;
+ buf_vlen_i[i].p = (int *)calloc(len, sizeof(int));
+ for (j=0; j<len; j++) ((int*)(buf_vlen_i[i].p))[j] = i*100+j;
+ buf_comp[i].i_vlen = buf_vlen_i[i];
+
+ buf_vlen_s[i] = (char *)calloc(len, sizeof(char));
+ for (j=0; j<len-1; j++)
+ buf_vlen_s[i][j] = j%26+'A';
+ buf_comp[i].s_vlen = buf_vlen_s[i];
+
+ for (j=0; j<dims2d[1]; j++)
+ buf_double2d[i][j] = i+j/10000.0;
}
for (i=0; i<nrows; i++) {
@@ -289,147 +289,147 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
buf_comp_large[i].f_array[j] = i*100+j;
buf_comp_large[i].s[j] = 'a' + (i%26);
}
- len = i%vlen+1;
+ len = i%vlen+1;
buf_comp_large[i].i_vlen.len = len;
buf_comp_large[i].i_vlen.p = (int *)calloc(len, sizeof(int));
for (j=0; j<len; j++) ((int*)(buf_comp_large[i].i_vlen.p))[j] = i*100+j;
buf_comp_large[i].s_vlen = (char *)calloc(i+2, sizeof(char));
for (j=0; j<i+1; j++) (buf_comp_large[i].s_vlen)[j] = j%26+'A';
}
-
- /* create file */
+
+ /* create file */
if (latest)
fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
else
fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- add_attrs(fid, 0);
+ add_attrs(fid, 0);
- sprintf(name, "a cmp ds of %d rows", nrows);
- did = H5Dcreate (fid, name, cmp_tid, sid_large, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp_large);
- add_attrs(did, 0);
- H5Dclose(did);
+ HDsprintf(name, "a cmp ds of %d rows", nrows);
+ did = H5Dcreate (fid, name, cmp_tid, sid_large, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp_large);
+ add_attrs(did, 0);
+ H5Dclose(did);
- // /* add attributes*/
+ // /* add attributes*/
gid1 = H5Gcreate (fid, "attributes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (nattrs<1) nattrs = 1;
- i=0;
- while (i<nattrs) i += add_attrs(gid1, i);
- H5Gclose(gid1);
-
- /* add many sub groups to a group*/
+ if (nattrs<1) nattrs = 1;
+ i=0;
+ while (i<nattrs) i += add_attrs(gid1, i);
+ H5Gclose(gid1);
+
+ /* add many sub groups to a group*/
gid1 = H5Gcreate (fid, "groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- add_attrs(gid1, 0);
+ add_attrs(gid1, 0);
for (i=0; i<ngrps; i++) {
- /* create sub groups */
- sprintf(name, "g%02d", i);
+ /* create sub groups */
+ HDsprintf(name, "g%02d", i);
gid2 = H5Gcreate (gid1, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (i<10) add_attrs(gid2, 0);
- H5Gclose(gid2);
- }
- H5Gclose(gid1);
-
- /* add many datasets to a group */
- gid1 = H5Gcreate (fid, "datasets", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- add_attrs(gid1, 0);
+ if (i<10) add_attrs(gid2, 0);
+ H5Gclose(gid2);
+ }
+ H5Gclose(gid1);
+
+ /* add many datasets to a group */
+ gid1 = H5Gcreate (fid, "datasets", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ add_attrs(gid1, 0);
for (j=0; j<ndsets; j+=12) {
- /* 1 add a null dataset */
- sprintf(name, "%05d null dataset", j);
+ /* 1 add a null dataset */
+ HDsprintf(name, "%05d null dataset", j);
did = H5Dcreate (gid1, name, H5T_STD_I32LE, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
- /* 2 add scalar int point */
- sprintf(name, "%05d scalar int point", j);
+ /* 2 add scalar int point */
+ HDsprintf(name, "%05d scalar int point", j);
did = H5Dcreate (gid1, name, H5T_NATIVE_INT, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &j);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 3 scalar vlen string */
- sprintf(name, "%05d scalar vlen string", j);
+ H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &j);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 3 scalar vlen string */
+ HDsprintf(name, "%05d scalar vlen string", j);
did = H5Dcreate (gid1, name, tid_vlen_s, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf_vlen_s[0]);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 4 add fixed-length float array */
- sprintf(name, "%05d fixed-length float array", j);
- did = H5Dcreate (gid1, name, tid_array_f, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, tid_array_f, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_float_a);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 5 add fixed-length strings */
- sprintf(name, "%05d fixed-length strings", j);
- did = H5Dcreate (gid1, name, tid_str, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, tid_str, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_str);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 6 add compound data */
- sprintf(name, "%05d compund data", j);
- did = H5Dcreate (gid1, name, cmp_tid, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 7 add 2D double */
- sprintf(name, "%05d 2D double", j);
- strcpy (tmp_name1, name);
- did = H5Dcreate (gid1, name, H5T_NATIVE_DOUBLE, sid_2d, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_double2d[0]);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 8 add 1D int array */
- sprintf(name, "%05d 1D int array", j);
+ H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf_vlen_s[0]);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 4 add fixed-length float array */
+ HDsprintf(name, "%05d fixed-length float array", j);
+ did = H5Dcreate (gid1, name, tid_array_f, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ H5Dwrite (did, tid_array_f, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_float_a);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 5 add fixed-length strings */
+ HDsprintf(name, "%05d fixed-length strings", j);
+ did = H5Dcreate (gid1, name, tid_str, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ H5Dwrite (did, tid_str, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_str);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 6 add compound data */
+ HDsprintf(name, "%05d compund data", j);
+ did = H5Dcreate (gid1, name, cmp_tid, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 7 add 2D double */
+ HDsprintf(name, "%05d 2D double", j);
+ strcpy (tmp_name1, name);
+ did = H5Dcreate (gid1, name, H5T_NATIVE_DOUBLE, sid_2d, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Dwrite (did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_double2d[0]);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 8 add 1D int array */
+ HDsprintf(name, "%05d 1D int array", j);
did = H5Dcreate (gid1, name, H5T_NATIVE_INT, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_int);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 9 add vlen int array */
- sprintf(name, "%05d vlen int array", j);
- strcpy (tmp_name2, name);
+ H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_int);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 9 add vlen int array */
+ HDsprintf(name, "%05d vlen int array", j);
+ strcpy (tmp_name2, name);
did = H5Dcreate (gid1, name, tid_vlen_i, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, tid_vlen_i, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_i);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
+ H5Dwrite (did, tid_vlen_i, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_i);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
- /* 10 add vlen strings */
- sprintf(name, "%05d vlen strings", j);
- strcpy (tmp_name3, name);
+ /* 10 add vlen strings */
+ HDsprintf(name, "%05d vlen strings", j);
+ strcpy (tmp_name3, name);
did = H5Dcreate (gid1, name, tid_vlen_s, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_s);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 11 add object refs */
- H5Rcreate(&buf_ref[0],gid1, ".", H5R_OBJECT, (hid_t)-1);
- H5Rcreate(&buf_ref[1],gid1, tmp_name3, H5R_OBJECT, (hid_t)-1);
- sprintf(name, "%05d obj refs", j);
+ H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_s);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 11 add object refs */
+ H5Rcreate(&buf_ref[0],gid1, ".", H5R_OBJECT, (hid_t)-1);
+ H5Rcreate(&buf_ref[1],gid1, tmp_name3, H5R_OBJECT, (hid_t)-1);
+ HDsprintf(name, "%05d obj refs", j);
did = H5Dcreate (gid1, name, H5T_STD_REF_OBJ, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ref);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 12 add region refs */
- H5Sselect_elements (sid_2d, H5S_SELECT_SET, 4, coords[0]);
- H5Rcreate(&buf_reg_ref[0],gid1, tmp_name1, H5R_DATASET_REGION, sid_2d);
- H5Sselect_none(sid_2d);
- count = dims[0]/2+1;
- H5Sselect_hyperslab (sid_1d, H5S_SELECT_SET, &start, &stride, &count,NULL);
- H5Rcreate(&buf_reg_ref[1],gid1, tmp_name2, H5R_DATASET_REGION, sid_1d);
- H5Sselect_none(sid_1d);
- sprintf(name, "%05d region refs", j);
+ H5Dwrite (did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ref);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 12 add region refs */
+ H5Sselect_elements (sid_2d, H5S_SELECT_SET, 4, coords[0]);
+ H5Rcreate(&buf_reg_ref[0],gid1, tmp_name1, H5R_DATASET_REGION, sid_2d);
+ H5Sselect_none(sid_2d);
+ count = dims[0]/2+1;
+ H5Sselect_hyperslab (sid_1d, H5S_SELECT_SET, &start, &stride, &count,NULL);
+ H5Rcreate(&buf_reg_ref[1],gid1, tmp_name2, H5R_DATASET_REGION, sid_1d);
+ H5Sselect_none(sid_1d);
+ HDsprintf(name, "%05d region refs", j);
did = H5Dcreate (gid1, name, H5T_STD_REF_DSETREG, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_reg_ref);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
- }
- H5Gclose(gid1);
-
+ H5Dwrite (did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_reg_ref);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+ }
+ H5Gclose(gid1);
+
H5Tclose (tid_array_f);
H5Tclose (tid_vlen_i);
H5Tclose (tid_vlen_s);
@@ -447,22 +447,22 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
H5Fclose (fid);
for (i=0; i<dims[0]; i++) {
- if (buf_vlen_i[i].p) free(buf_vlen_i[i].p);
- if (buf_vlen_s[i]) free(buf_vlen_s[i]);
- }
+ if (buf_vlen_i[i].p) free(buf_vlen_i[i].p);
+ if (buf_vlen_s[i]) free(buf_vlen_s[i]);
+ }
for (i=0; i<nrows; i++) {
- if (buf_comp_large[i].i_vlen.p) free(buf_comp_large[i].i_vlen.p);
- if (buf_comp_large[i].s_vlen) free(buf_comp_large[i].s_vlen);
- }
-
+ if (buf_comp_large[i].i_vlen.p) free(buf_comp_large[i].i_vlen.p);
+ if (buf_comp_large[i].s_vlen) free(buf_comp_large[i].s_vlen);
+ }
+
free (buf_comp);
free (buf_comp_large);
free (buf_int);
free (buf_float_a);
free (buf_double2d[0]);
free (buf_double2d);
- free (buf_str);
+ free (buf_str);
free(buf_vlen_i);
free(buf_vlen_s);
@@ -470,34 +470,34 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
}
/* add a single attribute */
-int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf)
+int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf)
{
hid_t aid;
aid = H5Acreate (oid, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT);
- if (aid <0)
- return 0;
-
- H5Awrite(aid, tid, buf);
+ if (aid <0)
+ return 0;
+
+ H5Awrite(aid, tid, buf);
H5Aclose(aid);
-
- return 1;
+
+ return 1;
}
-/*
+/*
adds different types of attributes to an object.
-
- returns the number of attributes added to the objects.
+
+ returns the number of attributes added to the objects.
*/
-int add_attrs(hid_t oid, int idx)
+int add_attrs(hid_t oid, int idx)
{
char name[32];
int i0, i1, i2, j, nattrs=0;
- hid_t aid, tid, tid1, sid;
+ hid_t aid, tid, tid1, sid;
hvl_t i_vlen[4];
- hobj_ref_t ref;
- zipcode_t cmp_data[4];
+ hobj_ref_t ref;
+ zipcode_t cmp_data[4];
unsigned int i = 0xffffffff;
long long l = -2147483647;
float f = 123456789.987654321;
@@ -505,22 +505,22 @@ int add_attrs(hid_t oid, int idx)
char *s[7] = {"Parting", "is such", "sweeter", "sorrow."};
float f_array[4] = {1.0, 2.22, 3.333, 4.444};
char *s_vlen[4] = {"Parting", "is such", "sweet", "sorrow."};
- hsize_t dims1[1]={1}, dims2[1]={4}, dims3[2]={3,5};
- int int3d[4][3][5];
- size_t offset = 0;
-
- for (i0=0; i0<4; i0++) {
- i_vlen[i0].len = (i0+1);
- i_vlen[i0].p = (int *)calloc(i_vlen[i0].len, sizeof(int));
- for (j=0; j<i_vlen[i0].len; j++)
- ((int *)i_vlen[i0].p)[j] = i0*100+j;
- for (i1=0; i1<3; i1++) {
- for (i2=0; i2<5; i2++)
- int3d[i0][i1][i2] = i0*i1-i1*i2+i0*i2;
- }
+ hsize_t dims1[1]={1}, dims2[1]={4}, dims3[2]={3,5};
+ int int3d[4][3][5];
+ size_t offset = 0;
+
+ for (i0=0; i0<4; i0++) {
+ i_vlen[i0].len = (i0+1);
+ i_vlen[i0].p = (int *)calloc(i_vlen[i0].len, sizeof(int));
+ for (j=0; j<i_vlen[i0].len; j++)
+ ((int *)i_vlen[i0].p)[j] = i0*100+j;
+ for (i1=0; i1<3; i1++) {
+ for (i2=0; i2<5; i2++)
+ int3d[i0][i1][i2] = i0*i1-i1*i2+i0*i2;
+ }
}
- cmp_data[0].zipcode = 01001;
+ cmp_data[0].zipcode = 01001;
cmp_data[0].city = "Agawam, Massachusetts";
cmp_data[1].zipcode = 99950;
cmp_data[1].city = "Ketchikan, Alaska";
@@ -528,82 +528,82 @@ int add_attrs(hid_t oid, int idx)
cmp_data[2].city = "Holtsville, New York";
cmp_data[3].zipcode = 61820;
cmp_data[3].city = "Champaign, Illinois";
-
- /* 1 scalar point */
- sid = H5Screate (H5S_SCALAR);
- sprintf(name, "%05d scalar int", idx);
- nattrs += add_attr(oid, name, H5T_NATIVE_UINT, sid, &i);
- sprintf(name, "%05d scalar ulong", idx);
- nattrs += add_attr(oid, name, H5T_NATIVE_INT64, sid, &l);
- sprintf(name, "%05d scalar str", idx);
- tid = H5Tcopy (H5T_C_S1);
+
+ /* 1 scalar point */
+ sid = H5Screate (H5S_SCALAR);
+ HDsprintf(name, "%05d scalar int", idx);
+ nattrs += add_attr(oid, name, H5T_NATIVE_UINT, sid, &i);
+ HDsprintf(name, "%05d scalar ulong", idx);
+ nattrs += add_attr(oid, name, H5T_NATIVE_INT64, sid, &l);
+ HDsprintf(name, "%05d scalar str", idx);
+ tid = H5Tcopy (H5T_C_S1);
H5Tset_size (tid, H5T_VARIABLE);
- nattrs += add_attr(oid, name, tid, sid, &s[2]);
- H5Tclose(tid);
- H5Sclose(sid);
+ nattrs += add_attr(oid, name, tid, sid, &s[2]);
+ H5Tclose(tid);
+ H5Sclose(sid);
- /* 4 single point */
- sid = H5Screate_simple (1, dims1, NULL);
+ /* 4 single point */
+ sid = H5Screate_simple (1, dims1, NULL);
H5Rcreate(&ref, oid, ".", H5R_OBJECT, (hid_t)-1);
- sprintf(name, "%05d single float", idx);
- nattrs += add_attr(oid, name, H5T_NATIVE_FLOAT, sid, &f);
- sprintf(name, "%05d single double", idx);
- nattrs += add_attr(oid, name, H5T_NATIVE_DOUBLE, sid, &d);
- sprintf(name, "%05d single obj_ref", idx);
- nattrs += add_attr(oid, name, H5T_STD_REF_OBJ, sid, &ref);
- H5Sclose(sid);
-
- /* 7 fixed length 1D array */
- sid = H5Screate_simple (1, dims1, NULL);
- tid = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims2);
- sprintf(name, "%05d array float", idx);
+ HDsprintf(name, "%05d single float", idx);
+ nattrs += add_attr(oid, name, H5T_NATIVE_FLOAT, sid, &f);
+ HDsprintf(name, "%05d single double", idx);
+ nattrs += add_attr(oid, name, H5T_NATIVE_DOUBLE, sid, &d);
+ HDsprintf(name, "%05d single obj_ref", idx);
+ nattrs += add_attr(oid, name, H5T_STD_REF_OBJ, sid, &ref);
+ H5Sclose(sid);
+
+ /* 7 fixed length 1D array */
+ sid = H5Screate_simple (1, dims1, NULL);
+ tid = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims2);
+ HDsprintf(name, "%05d array float", idx);
nattrs += add_attr(oid, name, tid, sid, &f_array[0]);
- H5Tclose(tid);
- tid = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid, strlen(s[0])+1);
- tid1 = H5Tarray_create (tid, 1, dims2);
- sprintf(name, "%05d array str", idx);
- nattrs += add_attr(oid, name, tid1, sid, s);
- H5Tclose(tid1);
- H5Tclose(tid);
- H5Sclose(sid);
-
- /* 9 fixed length 2D int arrays */
- sid = H5Screate_simple (1, dims2, NULL);
- tid = H5Tarray_create (H5T_NATIVE_INT, 2, dims3);
- sprintf(name, "%05d array int 2D", idx);
+ H5Tclose(tid);
+ tid = H5Tcopy (H5T_C_S1);
+ H5Tset_size (tid, strlen(s[0])+1);
+ tid1 = H5Tarray_create (tid, 1, dims2);
+ HDsprintf(name, "%05d array str", idx);
+ nattrs += add_attr(oid, name, tid1, sid, s);
+ H5Tclose(tid1);
+ H5Tclose(tid);
+ H5Sclose(sid);
+
+ /* 9 fixed length 2D int arrays */
+ sid = H5Screate_simple (1, dims2, NULL);
+ tid = H5Tarray_create (H5T_NATIVE_INT, 2, dims3);
+ HDsprintf(name, "%05d array int 2D", idx);
nattrs += add_attr(oid, name, tid, sid, int3d[0][0]);
- H5Tclose(tid);
- H5Sclose(sid);
-
- /* 10 variable length arrays */
- sid = H5Screate_simple (1, dims2, NULL);
- tid = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid, H5T_VARIABLE);
- sprintf(name, "%05d vlen strings", idx);
+ H5Tclose(tid);
+ H5Sclose(sid);
+
+ /* 10 variable length arrays */
+ sid = H5Screate_simple (1, dims2, NULL);
+ tid = H5Tcopy (H5T_C_S1);
+ H5Tset_size (tid, H5T_VARIABLE);
+ HDsprintf(name, "%05d vlen strings", idx);
nattrs += add_attr(oid, name, tid, sid, s_vlen);
- H5Tclose(tid);
- tid = H5Tvlen_create (H5T_NATIVE_INT);;
- sprintf(name, "%05d vlen int array", idx);
+ H5Tclose(tid);
+ tid = H5Tvlen_create (H5T_NATIVE_INT);;
+ HDsprintf(name, "%05d vlen int array", idx);
nattrs += add_attr(oid, name, tid, sid, i_vlen);
- H5Tclose(tid);
- H5Sclose(sid);
-
- /* 12 compound data */
- sid = H5Screate_simple (1, dims2, NULL);
- tid = H5Tcreate (H5T_COMPOUND, sizeof (zipcode_t));
- tid1 = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid1, H5T_VARIABLE);
+ H5Tclose(tid);
+ H5Sclose(sid);
+
+ /* 12 compound data */
+ sid = H5Screate_simple (1, dims2, NULL);
+ tid = H5Tcreate (H5T_COMPOUND, sizeof (zipcode_t));
+ tid1 = H5Tcopy (H5T_C_S1);
+ H5Tset_size (tid1, H5T_VARIABLE);
H5Tinsert (tid, "zip code", 0, H5T_NATIVE_INT); offset += sizeof(H5T_NATIVE_INT);
H5Tinsert (tid, "City", offset, tid1); offset += sizeof(char *);
- sprintf(name, "%05d compound data", idx);
+ HDsprintf(name, "%05d compound data", idx);
nattrs += add_attr(oid, name, tid, sid, cmp_data);
- H5Tclose(tid1);
- H5Tclose(tid);
- H5Sclose(sid);
-
- for (i0=0; i0<4; i0++)
- free(i_vlen[i0].p);
-
- return nattrs;
+ H5Tclose(tid1);
+ H5Tclose(tid);
+ H5Sclose(sid);
+
+ for (i0=0; i0<4; i0++)
+ free(i_vlen[i0].p);
+
+ return nattrs;
}
diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c
index ce866b4..7f1f038 100644
--- a/tools/test/misc/talign.c
+++ b/tools/test/misc/talign.c
@@ -51,14 +51,14 @@ int main(void)
int result = 0;
herr_t error = 1;
- printf("%-70s", "Testing alignment in compound datatypes");
+ HDprintf("%-70s", "Testing alignment in compound datatypes");
- strcpy(string5, "Hi!");
+ HDstrcpy(string5, "Hi!");
HDunlink(fname);
fil = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fil < 0) {
- puts("*FAILED*");
+ HDputs("*FAILED*");
return 1;
}
@@ -123,20 +123,20 @@ int main(void)
data = (char *)HDmalloc(H5Tget_size(fix));
if(!data) {
- perror("malloc() failed");
- abort();
+ HDperror("malloc() failed");
+ HDabort();
}
set = H5Dopen2(fil, setname, H5P_DEFAULT);
H5Dread(set, fix, spc, H5S_ALL, H5P_DEFAULT, data);
- fptr = (float *)(data + H5Tget_member_offset(fix, 1));
+ fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 1)));
H5Dclose(set);
out:
if(error < 0) {
result = 1;
- puts("*FAILED - HDF5 library error*");
+ HDputs("*FAILED - HDF5 library error*");
} else if(!(H5_FLT_ABS_EQUAL(fok[0], fptr[0]))
|| !(H5_FLT_ABS_EQUAL(fok[1], fptr[1]))
|| !(H5_FLT_ABS_EQUAL(fnok[0], fptr[2]))
@@ -145,15 +145,15 @@ out:
result = 1;
mname = H5Tget_member_name(fix, 0);
- printf("%14s (%2d) %6s = %s\n",
+ HDprintf("%14s (%2d) %6s = %s\n",
mname ? mname : "(null)", (int)H5Tget_member_offset(fix,0),
string5, (char *)(data + H5Tget_member_offset(fix, 0)));
if(mname)
H5free_memory(mname);
- fptr = (float *)(data + H5Tget_member_offset(fix, 1));
+ fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 1)));
mname = H5Tget_member_name(fix, 1);
- printf("Data comparison:\n"
+ HDprintf("Data comparison:\n"
"%14s (%2d) %6f = %f\n"
" %6f = %f\n",
mname ? mname : "(null)", (int)H5Tget_member_offset(fix,1),
@@ -162,9 +162,9 @@ out:
if(mname)
H5free_memory(mname);
- fptr = (float *)(data + H5Tget_member_offset(fix, 2));
+ fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 2)));
mname = H5Tget_member_name(fix, 2);
- printf("%14s (%2d) %6f = %f\n"
+ HDprintf("%14s (%2d) %6f = %f\n"
" %6f = %6f\n",
mname ? mname : "(null)", (int)H5Tget_member_offset(fix,2),
(double)fnok[0], (double)fptr[0],
@@ -172,8 +172,8 @@ out:
if(mname)
H5free_memory(mname);
- fptr = (float *)(data + H5Tget_member_offset(fix, 1));
- printf("\n"
+ fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 1)));
+ HDprintf("\n"
"Short circuit\n"
" %6f = %f\n"
" %6f = %f\n"
@@ -183,9 +183,9 @@ out:
(double)fok[1], (double)fptr[1],
(double)fnok[0], (double)fptr[2],
(double)fnok[1], (double)fptr[3]);
- puts("*FAILED - compound type alignmnent problem*");
+ HDputs("*FAILED - compound type alignmnent problem*");
} else {
- puts(" PASSED");
+ HDputs(" PASSED");
}
if(data)
@@ -200,7 +200,7 @@ out:
H5Pclose(plist);
H5Fclose(fil);
HDunlink(fname);
- fflush(stdout);
+ HDfflush(stdout);
return result;
}
diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt
index 98bce4d..092cabc 100644
--- a/tools/test/misc/vds/CMakeLists.txt
+++ b/tools/test/misc/vds/CMakeLists.txt
@@ -3,9 +3,14 @@ project (HDF5_TOOLS_TEST_MISC_VDS C)
MACRO (ADD_H5_GENERATOR genfile)
add_executable (${genfile} ${HDF5_TOOLS_TEST_MISC_VDS_SOURCE_DIR}/${genfile}.c)
- target_include_directories(${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${genfile} STATIC)
- target_link_libraries (${genfile} PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_include_directories (${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (${genfile} STATIC)
+ target_link_libraries (${genfile} PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (${genfile} SHARED)
+ target_link_libraries (${genfile} PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ endif ()
set_target_properties (${genfile} PROPERTIES FOLDER generator/tools)
ENDMACRO ()
diff --git a/tools/test/misc/vds/Makefile.in b/tools/test/misc/vds/Makefile.in
index 90970d8..e539a2f 100644
--- a/tools/test/misc/vds/Makefile.in
+++ b/tools/test/misc/vds/Makefile.in
@@ -501,7 +501,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -524,9 +523,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -553,6 +555,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -607,6 +610,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -631,7 +635,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1322,7 +1325,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt
index fa41608..d6a25d5 100644
--- a/tools/test/perform/CMakeLists.txt
+++ b/tools/test/perform/CMakeLists.txt
@@ -10,9 +10,14 @@ set (h5perf_serial_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c
)
add_executable (h5perf_serial ${h5perf_serial_SOURCES})
-target_include_directories(h5perf_serial PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5perf_serial STATIC)
-target_link_libraries (h5perf_serial PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (h5perf_serial PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5perf_serial STATIC)
+ target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5perf_serial SHARED)
+ target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (h5perf_serial PROPERTIES FOLDER perform)
if (HDF5_BUILD_PERFORM_STANDALONE)
@@ -20,11 +25,17 @@ if (HDF5_BUILD_PERFORM_STANDALONE)
set (h5perf_serial_alone_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_perf.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c
+ ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_standalone.c
)
add_executable (h5perf_serial_alone ${h5perf_serial_alone_SOURCES})
- target_include_directories(h5perf_serial_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (h5perf_serial_alone STATIC)
- target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_include_directories (h5perf_serial_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5perf_serial_alone STATIC)
+ target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (h5perf_serial_alone SHARED)
+ target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ endif ()
set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform)
set_property (TARGET h5perf_serial_alone
APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE
@@ -36,9 +47,14 @@ set (chunk_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/chunk.c
)
add_executable(chunk ${chunk_SOURCES})
-target_include_directories(chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (chunk STATIC)
-target_link_libraries(chunk PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (chunk STATIC)
+ target_link_libraries (chunk PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (chunk SHARED)
+ target_link_libraries (chunk PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (chunk PROPERTIES FOLDER perform)
#-- Adding test for iopipe
@@ -46,9 +62,14 @@ set (iopipe_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/iopipe.c
)
add_executable (iopipe ${iopipe_SOURCES})
-target_include_directories(iopipe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (iopipe STATIC)
-target_link_libraries (iopipe PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (iopipe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (iopipe STATIC)
+ target_link_libraries (iopipe PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (iopipe SHARED)
+ target_link_libraries (iopipe PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (iopipe PROPERTIES FOLDER perform)
#-- Adding test for overhead
@@ -56,9 +77,14 @@ set (overhead_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/overhead.c
)
add_executable (overhead ${overhead_SOURCES})
-target_include_directories(overhead PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (overhead STATIC)
-target_link_libraries (overhead PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (overhead PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (overhead STATIC)
+ target_link_libraries (overhead PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (overhead SHARED)
+ target_link_libraries (overhead PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (overhead PROPERTIES FOLDER perform)
#-- Adding test for perf_meta
@@ -66,9 +92,14 @@ set (perf_meta_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf_meta.c
)
add_executable (perf_meta ${perf_meta_SOURCES})
-target_include_directories(perf_meta PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (perf_meta STATIC)
-target_link_libraries (perf_meta PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+target_include_directories (perf_meta PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (perf_meta STATIC)
+ target_link_libraries (perf_meta PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (perf_meta SHARED)
+ target_link_libraries (perf_meta PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (perf_meta PROPERTIES FOLDER perform)
#-- Adding test for zip_perf
@@ -76,21 +107,48 @@ set (zip_perf_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/zip_perf.c
)
add_executable (zip_perf ${zip_perf_SOURCES})
-target_include_directories(zip_perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (zip_perf STATIC)
-target_link_libraries (zip_perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_include_directories (zip_perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (zip_perf STATIC)
+ target_link_libraries (zip_perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_COMP_LIBS})
+else ()
+ TARGET_C_PROPERTIES (zip_perf SHARED)
+ target_link_libraries (zip_perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_COMP_LIBS})
+endif ()
set_target_properties (zip_perf PROPERTIES FOLDER perform)
if (H5_HAVE_PARALLEL AND BUILD_TESTING)
+ if (UNIX)
+ #-- Adding test for perf - only on unix systems
+ set (perf_SOURCES
+ ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf.c
+ )
+ add_executable (perf ${perf_SOURCES})
+ target_include_directories (perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (perf STATIC)
+ target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (perf SHARED)
+ target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ endif ()
+ set_target_properties (perf PROPERTIES FOLDER perform)
+ endif ()
+
#-- Adding test for h5perf
set (h5perf_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_perf.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c
)
add_executable (h5perf ${h5perf_SOURCES})
- target_include_directories(h5perf PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (h5perf STATIC)
- target_link_libraries (h5perf PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ target_include_directories (h5perf PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5perf STATIC)
+ target_link_libraries (h5perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (h5perf SHARED)
+ target_link_libraries (h5perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ endif ()
set_target_properties (h5perf PROPERTIES FOLDER perform)
if (HDF5_BUILD_PERFORM_STANDALONE)
@@ -98,11 +156,17 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING)
set (h5perf_alone_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_perf.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c
+ ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_standalone.c
)
add_executable (h5perf_alone ${h5perf_alone_SOURCES})
- target_include_directories(h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (h5perf_alone STATIC)
- target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ target_include_directories (h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5perf_alone STATIC)
+ target_link_libraries (h5perf_alone PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (h5perf_alone SHARED)
+ target_link_libraries (h5perf_alone PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ endif ()
set_target_properties (h5perf_alone PROPERTIES FOLDER perform)
set_property (TARGET h5perf_alone
APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE
diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake
index 36172d1..f0ae416 100644
--- a/tools/test/perform/CMakeTests.cmake
+++ b/tools/test/perform/CMakeTests.cmake
@@ -53,9 +53,10 @@ add_test (
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_h5perf_serial COMMAND $<TARGET_FILE:h5perf_serial>)
+ add_test (NAME PERFORM_h5perf_serial COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial>)
else ()
add_test (NAME PERFORM_h5perf_serial COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5perf_serial>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -66,17 +67,20 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_h5perf_serial PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
-set_tests_properties (PERFORM_h5perf_serial PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_h5perf_serial PROPERTIES
+ TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_BUILD_PERFORM_STANDALONE)
- add_test (NAME PERFORM_h5perf_serial_alone COMMAND $<TARGET_FILE:h5perf_serial_alone>)
+ add_test (NAME PERFORM_h5perf_serial_alone COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial_alone>)
endif ()
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_chunk COMMAND $<TARGET_FILE:chunk>)
+ add_test (NAME PERFORM_chunk COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:chunk>)
else ()
add_test (NAME PERFORM_chunk COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:chunk>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -87,12 +91,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_chunk PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_chunk PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_iopipe COMMAND $<TARGET_FILE:iopipe>)
+ add_test (NAME PERFORM_iopipe COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:iopipe>)
else ()
add_test (NAME PERFORM_iopipe COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:iopipe>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -103,12 +110,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_iopipe PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_iopipe PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_overhead COMMAND $<TARGET_FILE:overhead>)
+ add_test (NAME PERFORM_overhead COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:overhead>)
else ()
add_test (NAME PERFORM_overhead COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:overhead>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -119,12 +129,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_overhead PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_overhead PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_perf_meta COMMAND $<TARGET_FILE:perf_meta>)
+ add_test (NAME PERFORM_perf_meta COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:perf_meta>)
else ()
add_test (NAME PERFORM_perf_meta COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:perf_meta>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -135,12 +148,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_perf_meta PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_perf_meta PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_zip_perf_help COMMAND $<TARGET_FILE:zip_perf> "-h")
+ add_test (NAME PERFORM_zip_perf_help COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:zip_perf> "-h")
else ()
add_test (NAME PERFORM_zip_perf_help COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -151,12 +167,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_zip_perf_help PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_zip_perf_help PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_zip_perf COMMAND $<TARGET_FILE:zip_perf> tfilters.h5)
+ add_test (NAME PERFORM_zip_perf COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:zip_perf> tfilters.h5)
else ()
add_test (NAME PERFORM_zip_perf COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -167,9 +186,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_zip_perf PROPERTIES
+ DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects"
+)
if (H5_HAVE_PARALLEL)
+ if (UNIX)
+ add_test (NAME MPI_TEST_PERFORM_perf COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:perf> ${MPIEXEC_POSTFLAGS})
+ endif ()
+
add_test (NAME MPI_TEST_PERFORM_h5perf COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:h5perf> ${MPIEXEC_POSTFLAGS})
if (HDF5_BUILD_PERFORM_STANDALONE)
diff --git a/tools/test/perform/Makefile.in b/tools/test/perform/Makefile.in
index b94f309..6f1619a 100644
--- a/tools/test/perform/Makefile.in
+++ b/tools/test/perform/Makefile.in
@@ -523,7 +523,6 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
-FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
Fortran_COMPILER_ID = @Fortran_COMPILER_ID@
GREP = @GREP@
@@ -546,9 +545,12 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@
+HAVE_LIBHDFS = @HAVE_LIBHDFS@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
+HDF5_TESTS = @HDF5_TESTS@
+HDF5_TOOLS = @HDF5_TOOLS@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_JAVA = @HDF_JAVA@
@@ -575,6 +577,7 @@ JAVA_JUNIT = @JAVA_JUNIT@
JAVA_PATH_NAME = @JAVA_PATH_NAME@
JAVA_VERSION = @JAVA_VERSION@
JNIFLAGS = @JNIFLAGS@
+JNI_LDFLAGS = @JNI_LDFLAGS@
JUNIT = @JUNIT@
LARGE_PARALLEL_IO = @LARGE_PARALLEL_IO@
LD = @LD@
@@ -629,6 +632,7 @@ PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
+ROS3_VFD = @ROS3_VFD@
RUNPARALLEL = @RUNPARALLEL@
RUNSERIAL = @RUNSERIAL@
R_INTEGER = @R_INTEGER@
@@ -653,7 +657,6 @@ UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
-UUDECODE = @UUDECODE@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
_ACJNI_JAVAC = @_ACJNI_JAVAC@
@@ -1447,7 +1450,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
# make install-doc doesn't do anything outside of doc directory, but
# Makefiles should recognize it.
# UPDATE: docs no longer reside in this build tree, so this target
-# is depreciated.
+# is deprecated.
install-doc uninstall-doc:
@echo "Nothing to be done."
diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c
index eac099b..2d9c44f 100644
--- a/tools/test/perform/iopipe.c
+++ b/tools/test/perform/iopipe.c
@@ -224,7 +224,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "fill raw");
+ HDfprintf (stderr, HEADING, "fill raw");
for(u = 0; u < nwrite; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -262,7 +262,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "fill hdf5");
+ HDfprintf (stderr, HEADING, "fill hdf5");
for(u = 0; u < nread; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -301,7 +301,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "out raw");
+ HDfprintf (stderr, HEADING, "out raw");
for(u = 0; u < nwrite; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -341,7 +341,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "out hdf5");
+ HDfprintf (stderr, HEADING, "out hdf5");
for(u = 0; u < nwrite; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -380,7 +380,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "in raw");
+ HDfprintf (stderr, HEADING, "in raw");
for(u = 0; u < nread; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -421,7 +421,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "in hdf5");
+ HDfprintf (stderr, HEADING, "in hdf5");
for(u = 0; u < nread; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -465,7 +465,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "in hdf5 partial");
+ HDfprintf (stderr, HEADING, "in hdf5 partial");
for(u = 0; u < nread; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c
index 81f9de6..108d9e4 100644
--- a/tools/test/perform/overhead.c
+++ b/tools/test/perform/overhead.c
@@ -84,9 +84,9 @@ typedef enum fill_t {
static void
usage(const char *prog)
{
- fprintf(stderr, "usage: %s [STYLE|cache] [LEFT [MIDDLE [RIGHT]]]\n",
+ HDfprintf(stderr, "usage: %s [STYLE|cache] [LEFT [MIDDLE [RIGHT]]]\n",
prog);
- fprintf(stderr, "\
+ HDfprintf(stderr, "\
STYLE is the order that the dataset is filled and should be one of:\n\
forward -- Fill the dataset from lowest address to highest\n\
address. This style tests the right split ratio.\n\
@@ -401,6 +401,6 @@ main(int argc, char *argv[])
return 0;
error:
- fprintf(stderr, "*** ERRORS DETECTED ***\n");
+ HDfprintf(stderr, "*** ERRORS DETECTED ***\n");
return 1;
}
diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c
index c6e62d5..34b8a2d 100644
--- a/tools/test/perform/perf.c
+++ b/tools/test/perform/perf.c
@@ -22,6 +22,7 @@
#include "hdf5.h"
#include "H5private.h"
+#include "h5test.h"
#ifdef H5_HAVE_PARALLEL
@@ -63,13 +64,13 @@
#define H5FATAL 1
#define VRFY(val, mesg, fatal) do { \
if (!val) { \
- printf("Proc %d: ", mynod); \
+ printf("Proc %d: ", mynod); \
printf("*** Assertion failed (%s) at line %4d in %s\n", \
- mesg, (int)__LINE__, __FILE__); \
- if (fatal){ \
- fflush(stdout); \
- goto die_jar_jar_die; \
- } \
+ mesg, (int)__LINE__, __FILE__); \
+ if (fatal){ \
+ fflush(stdout); \
+ goto die_jar_jar_die; \
+ } \
} \
} while(0)
#define RANK 1
@@ -77,7 +78,7 @@
hsize_t dims[RANK]; /* dataset dim sizes */
hsize_t block[RANK], stride[RANK], count[RANK];
-hssize_t start[RANK];
+hsize_t start[RANK];
hid_t fid; /* HDF5 file ID */
hid_t acc_tpl; /* File access templates */
hid_t sid; /* Dataspace ID */
@@ -240,7 +241,7 @@ int main(int argc, char **argv)
*/
for(j=0; j < opt_iter; j++) {
/* setup a file dataspace selection */
- start[0] = (j*iter_jump)+(mynod*opt_block);
+ start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block));
stride[0] = block[0] = opt_block;
count[0]= 1;
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -293,7 +294,7 @@ int main(int argc, char **argv)
/* we are going to repeat the read the same pattern the write used */
for (j=0; j < opt_iter; j++) {
/* setup a file dataspace selection */
- start[0] = (j*iter_jump)+(mynod*opt_block);
+ start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block));
stride[0] = block[0] = opt_block;
count[0]= 1;
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -320,13 +321,13 @@ int main(int argc, char **argv)
VRFY((ret >= 0), "H5Dwrite dataset1 succeeded", !H5FATAL);
- if (ret < 0) fprintf(stderr, "node %d, read error, loc = %Ld: %s\n",
+ if (ret < 0) HDfprintf(stderr, "node %d, read error, loc = %Ld: %s\n",
mynod, mynod*opt_block, strerror(myerrno));
/* if the user wanted to check correctness, compare the write
* buffer to the read buffer */
if (opt_correct && memcmp(buf, buf2, opt_block)) {
- fprintf(stderr, "node %d, correctness test failed\n", mynod);
+ HDfprintf(stderr, "node %d, correctness test failed\n", mynod);
my_correct = 0;
MPI_Allreduce(&my_correct, &correct, 1, MPI_INT, MPI_MIN,
MPI_COMM_WORLD);
@@ -435,10 +436,12 @@ parse_args(int argc, char **argv)
* e.g., -a4096/512 allocate at 4096 bytes
* boundary if request size >= 512.
*/
- {char *p;
- opt_alignment = atoi(optarg);
- if (p=(char*)strchr(optarg, '/'))
- opt_threshold = atoi(p+1);
+ {
+ char *p;
+
+ opt_alignment = HDatoi(optarg);
+ if(NULL != (p = (char*)HDstrchr(optarg, '/')))
+ opt_threshold = HDatoi(p + 1);
}
HDfprintf(stdout,
"alignment/threshold=%Hu/%Hu\n",
diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c
index c24e598..b56f074 100644
--- a/tools/test/perform/perf_meta.c
+++ b/tools/test/perform/perf_meta.c
@@ -313,7 +313,7 @@ create_dsets(hid_t file)
* Create a dataset using the default dataset creation properties.
*/
for(i = 0; i < NUM_DSETS; i++) {
- sprintf(dset_name, "dataset %d", i);
+ HDsprintf(dset_name, "dataset %d", i);
if((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
@@ -378,14 +378,14 @@ create_attrs_1(void)
* Create all(user specifies the number) attributes for each dataset
*/
for(i = 0; i < NUM_DSETS; i++) {
- sprintf(dset_name, "dataset %d", i);
+ HDsprintf(dset_name, "dataset %d", i);
open_t.start = retrieve_time();
if((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0)
goto error;
perf(&open_t, open_t.start, retrieve_time());
for(j = 0; j < NUM_ATTRS; j++) {
- sprintf(attr_name, "all attrs for each dset %d", j);
+ HDsprintf(attr_name, "all attrs for each dset %d", j);
attr_t.start = retrieve_time();
if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE,
small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -422,7 +422,7 @@ create_attrs_1(void)
attr_t.avg = attr_t.total / (NUM_ATTRS*NUM_DSETS);
/* Print out the performance result */
- fprintf(stderr, "1. Create %d attributes for each of %d existing datasets\n",
+ HDfprintf(stderr, "1. Create %d attributes for each of %d existing datasets\n",
NUM_ATTRS, NUM_DSETS);
print_perf(open_t, close_t, attr_t);
}
@@ -480,7 +480,7 @@ create_attrs_2(void)
* Create all(user specifies the number) attributes for each new dataset
*/
for(i = 0; i < NUM_DSETS; i++) {
- sprintf(dset_name, "dataset %d", i);
+ HDsprintf(dset_name, "dataset %d", i);
create_t.start = retrieve_time();
if((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE,
space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -488,7 +488,7 @@ create_attrs_2(void)
perf(&create_t, create_t.start, retrieve_time());
for(j = 0; j < NUM_ATTRS; j++) {
- sprintf(attr_name, "all attrs for each dset %d", j);
+ HDsprintf(attr_name, "all attrs for each dset %d", j);
attr_t.start = retrieve_time();
if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE,
small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -525,7 +525,7 @@ create_attrs_2(void)
attr_t.avg = attr_t.total / (NUM_ATTRS*NUM_DSETS);
/* Print out the performance result */
- fprintf(stderr, "2. Create %d attributes for each of %d new datasets\n",
+ HDfprintf(stderr, "2. Create %d attributes for each of %d new datasets\n",
NUM_ATTRS, NUM_DSETS);
print_perf(create_t, close_t, attr_t);
}
@@ -593,14 +593,14 @@ create_attrs_3(void)
for(i = 0; i < loop_num; i++) {
for(j = 0; j < NUM_DSETS; j++) {
- sprintf(dset_name, "dataset %d", j);
+ HDsprintf(dset_name, "dataset %d", j);
open_t.start = retrieve_time();
if((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0)
goto error;
perf(&open_t, open_t.start, retrieve_time());
for(k = 0; k < BATCH_ATTRS; k++) {
- sprintf(attr_name, "some attrs for each dset %d %d", i, k);
+ HDsprintf(attr_name, "some attrs for each dset %d %d", i, k);
attr_t.start = retrieve_time();
if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE,
small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -637,7 +637,7 @@ create_attrs_3(void)
attr_t.avg = attr_t.total / (NUM_ATTRS*NUM_DSETS);
/* Print out the performance result */
- fprintf(stderr, "3. Create %d attributes for each of %d existing datasets for %d times\n",
+ HDfprintf(stderr, "3. Create %d attributes for each of %d existing datasets for %d times\n",
BATCH_ATTRS, NUM_DSETS, loop_num);
print_perf(open_t, close_t, attr_t);
}
@@ -750,12 +750,12 @@ void perf(p_time *perf_t, double start_t, double end_t)
*/
void print_perf(p_time open_t, p_time close_t, p_time attr_t)
{
- fprintf(stderr, "\t%s:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
+ HDfprintf(stderr, "\t%s:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
open_t.func, open_t.avg, open_t.max, open_t.min);
- fprintf(stderr, "\tH5Dclose:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
+ HDfprintf(stderr, "\tH5Dclose:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
close_t.avg, close_t.max, close_t.min);
if(NUM_ATTRS)
- fprintf(stderr, "\tH5A(create & close):\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
+ HDfprintf(stderr, "\tH5A(create & close):\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
attr_t.avg, attr_t.max, attr_t.min);
}
@@ -799,7 +799,7 @@ main(int argc, char **argv)
#ifdef H5_HAVE_PARALLEL
if (facc_type == FACC_DEFAULT || (facc_type != FACC_DEFAULT && MAINPROCESS))
#endif /*H5_HAVE_PARALLEL*/
- fprintf(stderr, "\t\tPerformance result of metadata for datasets and attributes\n\n");
+ HDfprintf(stderr, "\t\tPerformance result of metadata for datasets and attributes\n\n");
fapl = H5Pcreate (H5P_FILE_ACCESS);
#ifdef H5_HAVE_PARALLEL
diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c
index 1c0d621..798e32e 100644
--- a/tools/test/perform/pio_engine.c
+++ b/tools/test/perform/pio_engine.c
@@ -61,14 +61,14 @@
#define GOTOERROR(errcode) { ret_code = errcode; goto done; }
#define GOTODONE { goto done; }
#define ERRMSG(mesg) { \
- fprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
- fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
+ HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
+ HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
}
#define MSG(mesg) { \
- fprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
- fprintf(stderr, "(%s) at line %4d in %s\n", \
+ HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
+ HDfprintf(stderr, "(%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
}
@@ -82,6 +82,12 @@
/* POSIX I/O macros */
+#ifdef H5_HAVE_WIN32_API
+/* Can't link against the library, so this test will use the older, non-Unicode
+ * _open() call on Windows.
+ */
+#define HDopen(S,F,...) _open(S, F | _O_BINARY, __VA_ARGS__)
+#endif /* H5_HAVE_WIN32_API */
#define POSIXCREATE(fn) HDopen(fn, O_CREAT|O_TRUNC|O_RDWR, 0600)
#define POSIXOPEN(fn, F) HDopen(fn, F, 0600)
#define POSIXCLOSE(F) HDclose(F)
@@ -188,7 +194,7 @@ do_pio(parameters param)
break;
default:
/* unknown request */
- fprintf(stderr, "Unknown IO type request (%d)\n", iot);
+ HDfprintf(stderr, "Unknown IO type request (%d)\n", iot);
GOTOERROR(FAIL);
}
@@ -207,21 +213,21 @@ do_pio(parameters param)
}
if (param.num_files < 0 ) {
- fprintf(stderr,
+ HDfprintf(stderr,
"number of files must be >= 0 (%ld)\n",
param.num_files);
GOTOERROR(FAIL);
}
if (ndsets < 0 ) {
- fprintf(stderr,
+ HDfprintf(stderr,
"number of datasets per file must be >= 0 (%ld)\n",
ndsets);
GOTOERROR(FAIL);
}
if (param.num_procs <= 0 ) {
- fprintf(stderr,
+ HDfprintf(stderr,
"maximum number of process to use must be > 0 (%d)\n",
param.num_procs);
GOTOERROR(FAIL);
@@ -286,7 +292,7 @@ do_pio(parameters param)
/* output all of the times for all iterations */
if (myrank == 0)
- fprintf(output, "Timer details:\n");
+ HDfprintf(output, "Timer details:\n");
}
for (nf = 1; nf <= param.num_files; nf++) {
@@ -296,7 +302,7 @@ do_pio(parameters param)
/* Open file for write */
char base_name[256];
- sprintf(base_name, "#pio_tmp_%lu", nf);
+ HDsprintf(base_name, "#pio_tmp_%lu", nf);
pio_create_filename(iot, base_name, fname, sizeof(fname));
if (pio_debug_level > 0)
HDfprintf(output, "rank %d: data filename=%s\n",
@@ -312,7 +318,6 @@ do_pio(parameters param)
set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
hrc = do_write(&res, &fd, &param, ndsets, nbytes, buf_size, buffer);
- hrc == SUCCESS;
set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_write failed");
@@ -380,7 +385,7 @@ done:
/* release generic resources */
if(buffer)
- free(buffer);
+ HDfree(buffer);
res.ret_code = ret_code;
return res;
}
@@ -615,7 +620,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Prepare buffer for verifying data */
if (parms->verify)
- memset(buffer,pio_mpi_rank_g+1,buf_size*blk_size);
+ HDmemset(buffer,pio_mpi_rank_g+1,buf_size*blk_size);
} /* end else */
@@ -848,7 +853,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -856,7 +861,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
if(parms->collective) {
hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
@@ -878,7 +883,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
case PHDF5:
h5dcpl = H5Pcreate(H5P_DATASET_CREATE);
if (h5dcpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
/* 1D dataspace */
@@ -889,7 +894,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
h5dims[0] = blk_size;
hrc = H5Pset_chunk(h5dcpl, 1, h5dims);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
@@ -902,25 +907,25 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
h5dims[1] = blk_size;
hrc = H5Pset_chunk(h5dcpl, 2, h5dims);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
}/* end else */
- sprintf(dname, "Dataset_%ld", ndset);
+ HDsprintf(dname, "Dataset_%ld", ndset);
h5ds_id = H5DCREATE(fd->h5fd, dname, ELMT_H5_TYPE,
h5dset_space_id, h5dcpl);
if (h5ds_id < 0) {
- fprintf(stderr, "HDF5 Dataset Create failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Create failed\n");
GOTOERROR(FAIL);
}
hrc = H5Pclose(h5dcpl);
/* verifying the close of the dcpl */
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Property List Close failed\n");
GOTOERROR(FAIL);
}
break;
@@ -1393,7 +1398,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
hrc = H5Dclose(h5ds_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Close failed\n");
GOTOERROR(FAIL);
}
@@ -1450,7 +1455,7 @@ done:
if (h5dset_space_id != -1) {
hrc = H5Sclose(h5dset_space_id);
if (hrc < 0){
- fprintf(stderr, "HDF5 Dataset Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
h5dset_space_id = -1;
@@ -1460,7 +1465,7 @@ done:
if (h5mem_space_id != -1) {
hrc = H5Sclose(h5mem_space_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Memory Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
h5mem_space_id = -1;
@@ -1470,7 +1475,7 @@ done:
if (h5dxpl != -1) {
hrc = H5Pclose(h5dxpl);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
h5dxpl = -1;
@@ -1819,7 +1824,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -1827,7 +1832,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
if(parms->collective) {
hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
@@ -1847,10 +1852,10 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
break;
case PHDF5:
- sprintf(dname, "Dataset_%ld", ndset);
+ HDsprintf(dname, "Dataset_%ld", ndset);
h5ds_id = H5DOPEN(fd->h5fd, dname);
if (h5ds_id < 0) {
- fprintf(stderr, "HDF5 Dataset open failed\n");
+ HDfprintf(stderr, "HDF5 Dataset open failed\n");
GOTOERROR(FAIL);
}
@@ -2348,7 +2353,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
hrc = H5Dclose(h5ds_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Close failed\n");
GOTOERROR(FAIL);
}
@@ -2405,7 +2410,7 @@ done:
if (h5dset_space_id != -1) {
hrc = H5Sclose(h5dset_space_id);
if (hrc < 0){
- fprintf(stderr, "HDF5 Dataset Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
h5dset_space_id = -1;
@@ -2415,7 +2420,7 @@ done:
if (h5mem_space_id != -1) {
hrc = H5Sclose(h5mem_space_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Memory Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
h5mem_space_id = -1;
@@ -2425,7 +2430,7 @@ done:
if (h5dxpl != -1) {
hrc = H5Pclose(h5dxpl);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
h5dxpl = -1;
@@ -2456,7 +2461,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
fd->posixfd = POSIXOPEN(fname, O_RDONLY);
if (fd->posixfd < 0 ) {
- fprintf(stderr, "POSIX File Open failed(%s)\n", fname);
+ HDfprintf(stderr, "POSIX File Open failed(%s)\n", fname);
GOTOERROR(FAIL);
}
@@ -2480,7 +2485,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
h5_io_info_g, &fd->mpifd);
if (mrc != MPI_SUCCESS) {
- fprintf(stderr, "MPI File Open failed(%s)\n", fname);
+ HDfprintf(stderr, "MPI File Open failed(%s)\n", fname);
GOTOERROR(FAIL);
}
@@ -2488,13 +2493,13 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
/*filesize , set size to 0 explicitedly. */
mrc = MPI_File_set_size(fd->mpifd, (MPI_Offset)0);
if (mrc != MPI_SUCCESS) {
- fprintf(stderr, "MPI_File_set_size failed\n");
+ HDfprintf(stderr, "MPI_File_set_size failed\n");
GOTOERROR(FAIL);
}
} else {
mrc = MPI_File_open(pio_comm_g, fname, MPI_MODE_RDONLY, h5_io_info_g, &fd->mpifd);
if (mrc != MPI_SUCCESS) {
- fprintf(stderr, "MPI File Open failed(%s)\n", fname);
+ HDfprintf(stderr, "MPI File Open failed(%s)\n", fname);
GOTOERROR(FAIL);
}
}
@@ -2503,19 +2508,19 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
case PHDF5:
if ((acc_tpl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
/* Set the file driver to the MPI-IO driver */
if (H5Pset_fapl_mpio(acc_tpl, pio_comm_g, h5_io_info_g) < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
}
/* Set the alignment of objects in HDF5 file */
if (H5Pset_alignment(acc_tpl, param->h5_thresh, param->h5_align) < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
}
@@ -2525,13 +2530,13 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
else
fd->h5fd = H5Fopen(fname, H5F_ACC_RDONLY, acc_tpl);
if (fd->h5fd < 0) {
- fprintf(stderr, "HDF5 File Create failed(%s)\n", fname);
+ HDfprintf(stderr, "HDF5 File Create failed(%s)\n", fname);
GOTOERROR(FAIL);
}
/* verifying the close of the acc_tpl */
if (H5Pclose(acc_tpl) < 0) {
- fprintf(stderr, "HDF5 Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Property List Close failed\n");
GOTOERROR(FAIL);
}
@@ -2560,7 +2565,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
rc = POSIXCLOSE(fd->posixfd);
if (rc != 0){
- fprintf(stderr, "POSIX File Close failed\n");
+ HDfprintf(stderr, "POSIX File Close failed\n");
GOTOERROR(FAIL);
}
@@ -2571,7 +2576,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
mrc = MPI_File_close(&fd->mpifd);
if (mrc != MPI_SUCCESS){
- fprintf(stderr, "MPI File close failed\n");
+ HDfprintf(stderr, "MPI File close failed\n");
GOTOERROR(FAIL);
}
@@ -2582,7 +2587,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
hrc = H5Fclose(fd->h5fd);
if (hrc < 0) {
- fprintf(stderr, "HDF5 File Close failed\n");
+ HDfprintf(stderr, "HDF5 File Close failed\n");
GOTOERROR(FAIL);
}
@@ -2616,7 +2621,7 @@ do_cleanupfile(iotype iot, char *fname)
if (clean_file_g){
switch (iot){
case POSIXIO:
- remove(fname);
+ HDremove(fname);
break;
case MPIO:
case PHDF5:
diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c
index 597629e..93741c4 100644
--- a/tools/test/perform/pio_perf.c
+++ b/tools/test/perform/pio_perf.c
@@ -277,13 +277,13 @@ struct options {
unsigned interleaved; /* Interleaved vs. contiguous blocks */
unsigned collective; /* Collective vs. independent I/O */
unsigned dim2d; /* 1D vs. 2D geometry */
- int print_times; /* print times as well as throughputs */
- int print_raw; /* print raw data throughput info */
+ int print_times; /* print times as well as throughputs */
+ int print_raw; /* print raw data throughput info */
off_t h5_alignment; /* alignment in HDF5 file */
off_t h5_threshold; /* threshold for alignment in HDF5 file */
- int h5_use_chunks; /* Make HDF5 dataset chunked */
- int h5_write_only; /* Perform the write tests only */
- int verify; /* Verify data correctness */
+ int h5_use_chunks; /* Make HDF5 dataset chunked */
+ int h5_write_only; /* Perform the write tests only */
+ int verify; /* Verify data correctness */
};
typedef struct _minmax {
@@ -339,12 +339,12 @@ main(int argc, char **argv)
ret = MPI_Comm_size(MPI_COMM_WORLD, &comm_world_nprocs_g);
if (ret != MPI_SUCCESS) {
- fprintf(stderr, "%s: MPI_Comm_size call failed\n", progname);
+ HDfprintf(stderr, "%s: MPI_Comm_size call failed\n", progname);
if (ret == MPI_ERR_COMM)
- fprintf(stderr, "invalid MPI communicator\n");
+ HDfprintf(stderr, "invalid MPI communicator\n");
else
- fprintf(stderr, "invalid argument\n");
+ HDfprintf(stderr, "invalid argument\n");
exit_value = EXIT_FAILURE;
goto finish;
@@ -353,12 +353,12 @@ main(int argc, char **argv)
ret = MPI_Comm_rank(MPI_COMM_WORLD, &comm_world_rank_g);
if (ret != MPI_SUCCESS) {
- fprintf(stderr, "%s: MPI_Comm_rank call failed\n", progname);
+ HDfprintf(stderr, "%s: MPI_Comm_rank call failed\n", progname);
if (ret == MPI_ERR_COMM)
- fprintf(stderr, "invalid MPI communicator\n");
+ HDfprintf(stderr, "invalid MPI communicator\n");
else
- fprintf(stderr, "invalid argument\n");
+ HDfprintf(stderr, "invalid argument\n");
exit_value = EXIT_FAILURE;
goto finish;
@@ -376,7 +376,7 @@ main(int argc, char **argv)
if (opts->output_file) {
if ((output = HDfopen(opts->output_file, "w")) == NULL) {
- fprintf(stderr, "%s: cannot open output file\n", progname);
+ HDfprintf(stderr, "%s: cannot open output file\n", progname);
perror(opts->output_file);
goto finish;
}
@@ -667,7 +667,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
/*
* Show various statistics
*/
- /* Write statistics */
+ /* Write statistics */
/* Print the raw data throughput if desired */
if (opts->print_raw) {
/* accumulate and output the max, min, and average "raw write" times */
@@ -733,7 +733,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
}
if (!parms.h5_write_only) {
- /* Read statistics */
+ /* Read statistics */
/* Print the raw data throughput if desired */
if (opts->print_raw) {
/* accumulate and output the max, min, and average "raw read" times */
@@ -925,7 +925,7 @@ create_comm_world(int num_procs, int *doing_pio)
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
if (num_procs > nprocs) {
- fprintf(stderr,
+ HDfprintf(stderr,
"number of process(%d) must be <= number of processes in MPI_COMM_WORLD(%d)\n",
num_procs, nprocs);
goto error_done;
@@ -936,7 +936,7 @@ create_comm_world(int num_procs, int *doing_pio)
mrc = MPI_Comm_split(MPI_COMM_WORLD, color, myrank, &pio_comm_g);
if (mrc != MPI_SUCCESS) {
- fprintf(stderr, "MPI_Comm_split failed\n");
+ HDfprintf(stderr, "MPI_Comm_split failed\n");
goto error_done;
}
@@ -1065,9 +1065,9 @@ output_report(const char *fmt, ...)
if (myrank == 0) {
va_list ap;
- va_start(ap, fmt);
- vfprintf(output, fmt, ap);
- va_end(ap);
+ HDva_start(ap, fmt);
+ HDvfprintf(output, fmt, ap);
+ HDva_end(ap);
}
}
@@ -1087,10 +1087,10 @@ print_indent(register int indent)
MPI_Comm_rank(pio_comm_g, &myrank);
if (myrank == 0) {
- indent *= TAB_SPACE;
+ indent *= TAB_SPACE;
- for (; indent > 0; --indent)
- fputc(' ', output);
+ for (; indent > 0; --indent)
+ HDfputc(' ', output);
}
}
@@ -1115,11 +1115,11 @@ static void
print_io_api(long io_types)
{
if (io_types & PIO_POSIX)
- HDfprintf(output, "posix ");
+ HDfprintf(output, "posix ");
if (io_types & PIO_MPI)
- HDfprintf(output, "mpiio ");
+ HDfprintf(output, "mpiio ");
if (io_types & PIO_HDF5)
- HDfprintf(output, "phdf5 ");
+ HDfprintf(output, "phdf5 ");
HDfprintf(output, "\n");
}
@@ -1128,7 +1128,7 @@ report_parameters(struct options *opts)
{
int rank = comm_world_rank_g;
- print_version("HDF5 Library"); /* print library version */
+ print_version("HDF5 Library"); /* print library version */
HDfprintf(output, "rank %d: ==== Parameters ====\n", rank);
HDfprintf(output, "rank %d: IO API=", rank);
@@ -1303,9 +1303,9 @@ parse_command_line(int argc, char *argv[])
} else if (!HDstrcasecmp(buf, "posix")) {
cl_opts->io_types |= PIO_POSIX;
} else {
- fprintf(stderr, "pio_perf: invalid --api option %s\n",
+ HDfprintf(stderr, "pio_perf: invalid --api option %s\n",
buf);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
if (*end == '\0')
@@ -1345,17 +1345,17 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
- if (strlen(buf) > 1 || isdigit(buf[0])) {
+ if (HDstrlen(buf) > 1 || HDisdigit(buf[0])) {
size_t j;
for (j = 0; j < 10 && buf[j] != '\0'; ++j)
if (!isdigit(buf[j])) {
- fprintf(stderr, "pio_perf: invalid --debug option %s\n",
+ HDfprintf(stderr, "pio_perf: invalid --debug option %s\n",
buf);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
pio_debug_level = atoi(buf);
@@ -1379,8 +1379,8 @@ parse_command_line(int argc, char *argv[])
cl_opts->verify = TRUE;
break;
default:
- fprintf(stderr, "pio_perf: invalid --debug option %s\n", buf);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "pio_perf: invalid --debug option %s\n", buf);
+ HDexit(EXIT_FAILURE);
}
}
@@ -1396,13 +1396,13 @@ parse_command_line(int argc, char *argv[])
cl_opts->num_bpp = parse_size_directive(opt_arg);
break;
case 'F':
- cl_opts->num_files = atoi(opt_arg);
+ cl_opts->num_files = HDatoi(opt_arg);
break;
case 'g':
cl_opts->dim2d = 1;
break;
case 'i':
- cl_opts->num_iters = atoi(opt_arg);
+ cl_opts->num_iters = HDatoi(opt_arg);
break;
case 'I':
cl_opts->interleaved = 1;
@@ -1411,10 +1411,10 @@ parse_command_line(int argc, char *argv[])
cl_opts->output_file = opt_arg;
break;
case 'p':
- cl_opts->min_num_procs = atoi(opt_arg);
+ cl_opts->min_num_procs = HDatoi(opt_arg);
break;
case 'P':
- cl_opts->max_num_procs = atoi(opt_arg);
+ cl_opts->max_num_procs = HDatoi(opt_arg);
break;
case 'T':
cl_opts->h5_threshold = parse_size_directive(opt_arg);
@@ -1432,7 +1432,7 @@ parse_command_line(int argc, char *argv[])
case '?':
default:
usage(progname);
- free(cl_opts);
+ HDfree(cl_opts);
return NULL;
}
}
@@ -1526,8 +1526,8 @@ parse_size_directive(const char *size)
s *= ONE_GB;
break;
default:
- fprintf(stderr, "Illegal size specifier '%c'\n", *endptr);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "Illegal size specifier '%c'\n", *endptr);
+ HDexit(EXIT_FAILURE);
}
}
@@ -1540,7 +1540,7 @@ parse_size_directive(const char *size)
* Return: Nothing
* Programmer: Bill Wendling, 31. October 2001
* Modifications:
- * Added 2D testing (Christian Chilan, 10. August 2005)
+ * Added 2D testing (Christian Chilan, 10. August 2005)
*/
static void
usage(const char *prog)
@@ -1550,125 +1550,125 @@ usage(const char *prog)
MPI_Comm_rank(pio_comm_g, &myrank);
if (myrank == 0) {
- print_version(prog);
- printf("usage: %s [OPTIONS]\n", prog);
- printf(" OPTIONS\n");
- printf(" -h, --help Print a usage message and exit\n");
- printf(" -a S, --align=S Alignment of objects in HDF5 file [default: 1]\n");
- printf(" -A AL, --api=AL Which APIs to test [default: all of them]\n");
+ print_version(prog);
+ HDprintf("usage: %s [OPTIONS]\n", prog);
+ HDprintf(" OPTIONS\n");
+ HDprintf(" -h, --help Print a usage message and exit\n");
+ HDprintf(" -a S, --align=S Alignment of objects in HDF5 file [default: 1]\n");
+ HDprintf(" -A AL, --api=AL Which APIs to test [default: all of them]\n");
#if 0
- printf(" -b, --binary The elusive binary option\n");
+ HDprintf(" -b, --binary The elusive binary option\n");
#endif /* 0 */
- printf(" -B S, --block-size=S Block size within transfer buffer\n");
- printf(" (see below for description)\n");
- printf(" [default: half the number of bytes per process\n");
- printf(" per dataset]\n");
- printf(" -c, --chunk Create HDF5 datasets using chunked storage\n");
- printf(" [default: contiguous storage]\n");
- printf(" -C, --collective Use collective I/O for MPI and HDF5 APIs\n");
- printf(" [default: independent I/O)\n");
- printf(" -d N, --num-dsets=N Number of datasets per file [default: 1]\n");
- printf(" -D DL, --debug=DL Indicate the debugging level\n");
- printf(" [default: no debugging]\n");
- printf(" -e S, --num-bytes=S Number of bytes per process per dataset\n");
- printf(" (see below for description)\n");
- printf(" [default: 256K for 1D, 8K for 2D]\n");
- printf(" -F N, --num-files=N Number of files [default: 1]\n");
- printf(" -g, --geometry Use 2D geometry [default: 1D geometry]\n");
- printf(" -i N, --num-iterations=N Number of iterations to perform [default: 1]\n");
- printf(" -I, --interleaved Interleaved access pattern\n");
- printf(" (see below for example)\n");
- printf(" [default: Contiguous access pattern]\n");
- printf(" -o F, --output=F Output raw data into file F [default: none]\n");
- printf(" -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n");
- printf(" -P N, --max-num-processes=N Maximum number of processes to use\n");
- printf(" [default: all MPI_COMM_WORLD processes ]\n");
- printf(" -T S, --threshold=S Threshold for alignment of objects in HDF5 file\n");
- printf(" [default: 1]\n");
- printf(" -w, --write-only Perform write tests not the read tests\n");
- printf(" -x S, --min-xfer-size=S Minimum transfer buffer size\n");
- printf(" (see below for description)\n");
- printf(" [default: half the number of bytes per process\n");
- printf(" per dataset]\n");
- printf(" -X S, --max-xfer-size=S Maximum transfer buffer size\n");
- printf(" [default: the number of bytes per process per\n");
- printf(" dataset]\n");
- printf("\n");
- printf(" F - is a filename.\n");
- printf(" N - is an integer >=0.\n");
- printf(" S - is a size specifier, an integer >=0 followed by a size indicator:\n");
- printf(" K - Kilobyte (%d)\n", ONE_KB);
- printf(" M - Megabyte (%d)\n", ONE_MB);
- printf(" G - Gigabyte (%d)\n", ONE_GB);
- printf("\n");
- printf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB);
- printf("\n");
- printf(" AL - is an API list. Valid values are:\n");
- printf(" phdf5 - Parallel HDF5\n");
- printf(" mpiio - MPI-I/O\n");
- printf(" posix - POSIX\n");
- printf("\n");
- printf(" Example: --api=mpiio,phdf5\n");
- printf("\n");
- printf(" Dataset size:\n");
- printf(" Depending on the selected geometry, each test dataset is either a linear\n");
- printf(" array of size bytes-per-process * num-processes, or a square array of size\n");
- printf(" (bytes-per-process * num-processes) x (bytes-per-process * num-processes).\n");
- printf("\n");
- printf(" Block size vs. Transfer buffer size:\n");
- printf(" buffer-size controls the size of the memory buffer, which is broken into\n");
- printf(" blocks and written to the file. Depending on the selected geometry, each\n");
- printf(" block can be a linear array of size block-size or a square array of size\n");
- printf(" block-size x block-size. The arrangement in which blocks are written is\n");
- printf(" determined by the access pattern.\n");
- printf("\n");
- printf(" In 1D geometry, the transfer buffer is a linear array of size buffer-size.\n");
- printf(" In 2D geometry, it is a rectangular array of size block-size x buffer-size\n");
- printf(" or buffer-size x block-size if interleaved pattern is selected.\n");
- printf("\n");
- printf(" Interleaved and Contiguous patterns in 1D geometry:\n");
- printf(" When contiguous access pattern is chosen, the dataset is evenly divided\n");
- printf(" into num-processes regions and each process writes data to its own region.\n");
- printf(" When interleaved blocks are written to a dataset, space for the first\n");
- printf(" block of the first process is allocated in the dataset, then space is\n");
- printf(" allocated for the first block of the second process, etc. until space is\n");
- printf(" allocated for the first block of each process, then space is allocated for\n");
- printf(" the second block of the first process, the second block of the second\n");
- printf(" process, etc.\n");
- printf("\n");
- printf(" For example, with a 3 process run, 512KB bytes-per-process, 256KB transfer\n");
- printf(" buffer size, and 64KB block size, each process must issue 2 transfer\n");
- printf(" requests to complete access to the dataset.\n");
- printf(" Contiguous blocks of the first transfer request are written like so:\n");
- printf(" 1111----2222----3333----\n");
- printf(" Interleaved blocks of the first transfer request are written like so:\n");
- printf(" 123123123123------------\n");
- printf(" The actual number of I/O operations involved in a transfer request\n");
- printf(" depends on the access pattern and communication mode.\n");
- printf(" When using independent I/O with interleaved pattern, each process\n");
- printf(" performs 4 small non-contiguous I/O operations per transfer request.\n");
- printf(" If collective I/O is turned on, the combined content of the buffers of\n");
- printf(" the 3 processes will be written using one collective I/O operation\n");
- printf(" per transfer request.\n");
- printf("\n");
- printf(" For information about access patterns in 2D geometry, please refer to the\n");
- printf(" HDF5 Reference Manual.\n");
- printf("\n");
- printf(" DL - is a list of debugging flags. Valid values are:\n");
- printf(" 1 - Minimal\n");
- printf(" 2 - Not quite everything\n");
- printf(" 3 - Everything\n");
- printf(" 4 - The kitchen sink\n");
- printf(" r - Raw data I/O throughput information\n");
- printf(" t - Times as well as throughputs\n");
- printf(" v - Verify data correctness\n");
- printf("\n");
- printf(" Example: --debug=2,r,t\n");
- printf("\n");
- printf(" Environment variables:\n");
- printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
- printf(" HDF5_MPI_INFO MPI INFO object key=value separated by ;\n");
- printf(" HDF5_PARAPREFIX Paralllel data files prefix\n");
+ HDprintf(" -B S, --block-size=S Block size within transfer buffer\n");
+ HDprintf(" (see below for description)\n");
+ HDprintf(" [default: half the number of bytes per process\n");
+ HDprintf(" per dataset]\n");
+ HDprintf(" -c, --chunk Create HDF5 datasets using chunked storage\n");
+ HDprintf(" [default: contiguous storage]\n");
+ HDprintf(" -C, --collective Use collective I/O for MPI and HDF5 APIs\n");
+ HDprintf(" [default: independent I/O)\n");
+ HDprintf(" -d N, --num-dsets=N Number of datasets per file [default: 1]\n");
+ HDprintf(" -D DL, --debug=DL Indicate the debugging level\n");
+ HDprintf(" [default: no debugging]\n");
+ HDprintf(" -e S, --num-bytes=S Number of bytes per process per dataset\n");
+ HDprintf(" (see below for description)\n");
+ HDprintf(" [default: 256K for 1D, 8K for 2D]\n");
+ HDprintf(" -F N, --num-files=N Number of files [default: 1]\n");
+ HDprintf(" -g, --geometry Use 2D geometry [default: 1D geometry]\n");
+ HDprintf(" -i N, --num-iterations=N Number of iterations to perform [default: 1]\n");
+ HDprintf(" -I, --interleaved Interleaved access pattern\n");
+ HDprintf(" (see below for example)\n");
+ HDprintf(" [default: Contiguous access pattern]\n");
+ HDprintf(" -o F, --output=F Output raw data into file F [default: none]\n");
+ HDprintf(" -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n");
+ HDprintf(" -P N, --max-num-processes=N Maximum number of processes to use\n");
+ HDprintf(" [default: all MPI_COMM_WORLD processes ]\n");
+ HDprintf(" -T S, --threshold=S Threshold for alignment of objects in HDF5 file\n");
+ HDprintf(" [default: 1]\n");
+ HDprintf(" -w, --write-only Perform write tests not the read tests\n");
+ HDprintf(" -x S, --min-xfer-size=S Minimum transfer buffer size\n");
+ HDprintf(" (see below for description)\n");
+ HDprintf(" [default: half the number of bytes per process\n");
+ HDprintf(" per dataset]\n");
+ HDprintf(" -X S, --max-xfer-size=S Maximum transfer buffer size\n");
+ HDprintf(" [default: the number of bytes per process per\n");
+ HDprintf(" dataset]\n");
+ HDprintf("\n");
+ HDprintf(" F - is a filename.\n");
+ HDprintf(" N - is an integer >=0.\n");
+ HDprintf(" S - is a size specifier, an integer >=0 followed by a size indicator:\n");
+ HDprintf(" K - Kilobyte (%d)\n", ONE_KB);
+ HDprintf(" M - Megabyte (%d)\n", ONE_MB);
+ HDprintf(" G - Gigabyte (%d)\n", ONE_GB);
+ HDprintf("\n");
+ HDprintf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB);
+ HDprintf("\n");
+ HDprintf(" AL - is an API list. Valid values are:\n");
+ HDprintf(" phdf5 - Parallel HDF5\n");
+ HDprintf(" mpiio - MPI-I/O\n");
+ HDprintf(" posix - POSIX\n");
+ HDprintf("\n");
+ HDprintf(" Example: --api=mpiio,phdf5\n");
+ HDprintf("\n");
+ HDprintf(" Dataset size:\n");
+ HDprintf(" Depending on the selected geometry, each test dataset is either a linear\n");
+ HDprintf(" array of size bytes-per-process * num-processes, or a square array of size\n");
+ HDprintf(" (bytes-per-process * num-processes) x (bytes-per-process * num-processes).\n");
+ HDprintf("\n");
+ HDprintf(" Block size vs. Transfer buffer size:\n");
+ HDprintf(" buffer-size controls the size of the memory buffer, which is broken into\n");
+ HDprintf(" blocks and written to the file. Depending on the selected geometry, each\n");
+ HDprintf(" block can be a linear array of size block-size or a square array of size\n");
+ HDprintf(" block-size x block-size. The arrangement in which blocks are written is\n");
+ HDprintf(" determined by the access pattern.\n");
+ HDprintf("\n");
+ HDprintf(" In 1D geometry, the transfer buffer is a linear array of size buffer-size.\n");
+ HDprintf(" In 2D geometry, it is a rectangular array of size block-size x buffer-size\n");
+ HDprintf(" or buffer-size x block-size if interleaved pattern is selected.\n");
+ HDprintf("\n");
+ HDprintf(" Interleaved and Contiguous patterns in 1D geometry:\n");
+ HDprintf(" When contiguous access pattern is chosen, the dataset is evenly divided\n");
+ HDprintf(" into num-processes regions and each process writes data to its own region.\n");
+ HDprintf(" When interleaved blocks are written to a dataset, space for the first\n");
+ HDprintf(" block of the first process is allocated in the dataset, then space is\n");
+ HDprintf(" allocated for the first block of the second process, etc. until space is\n");
+ HDprintf(" allocated for the first block of each process, then space is allocated for\n");
+ HDprintf(" the second block of the first process, the second block of the second\n");
+ HDprintf(" process, etc.\n");
+ HDprintf("\n");
+ HDprintf(" For example, with a 3 process run, 512KB bytes-per-process, 256KB transfer\n");
+ HDprintf(" buffer size, and 64KB block size, each process must issue 2 transfer\n");
+ HDprintf(" requests to complete access to the dataset.\n");
+ HDprintf(" Contiguous blocks of the first transfer request are written like so:\n");
+ HDprintf(" 1111----2222----3333----\n");
+ HDprintf(" Interleaved blocks of the first transfer request are written like so:\n");
+ HDprintf(" 123123123123------------\n");
+ HDprintf(" The actual number of I/O operations involved in a transfer request\n");
+ HDprintf(" depends on the access pattern and communication mode.\n");
+ HDprintf(" When using independent I/O with interleaved pattern, each process\n");
+ HDprintf(" performs 4 small non-contiguous I/O operations per transfer request.\n");
+ HDprintf(" If collective I/O is turned on, the combined content of the buffers of\n");
+ HDprintf(" the 3 processes will be written using one collective I/O operation\n");
+ HDprintf(" per transfer request.\n");
+ HDprintf("\n");
+ HDprintf(" For information about access patterns in 2D geometry, please refer to the\n");
+ HDprintf(" HDF5 Reference Manual.\n");
+ HDprintf("\n");
+ HDprintf(" DL - is a list of debugging flags. Valid values are:\n");
+ HDprintf(" 1 - Minimal\n");
+ HDprintf(" 2 - Not quite everything\n");
+ HDprintf(" 3 - Everything\n");
+ HDprintf(" 4 - The kitchen sink\n");
+ HDprintf(" r - Raw data I/O throughput information\n");
+ HDprintf(" t - Times as well as throughputs\n");
+ HDprintf(" v - Verify data correctness\n");
+ HDprintf("\n");
+ HDprintf(" Example: --debug=2,r,t\n");
+ HDprintf("\n");
+ HDprintf(" Environment variables:\n");
+ HDprintf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
+ HDprintf(" HDF5_MPI_INFO MPI INFO object key=value separated by ;\n");
+ HDprintf(" HDF5_PARAPREFIX Paralllel data files prefix\n");
fflush(stdout);
} /* end if */
} /* end usage() */
@@ -1685,7 +1685,7 @@ usage(const char *prog)
int
main(void)
{
- printf("No parallel IO performance because parallel is not configured\n");
+ HDprintf("No parallel IO performance because parallel is not configured\n");
return EXIT_SUCCESS;
} /* end main */
diff --git a/tools/test/perform/pio_standalone.c b/tools/test/perform/pio_standalone.c
index bd5fb6f..0fba904 100644
--- a/tools/test/perform/pio_standalone.c
+++ b/tools/test/perform/pio_standalone.c
@@ -18,6 +18,9 @@
#include "pio_perf.h"
+#ifdef STANDALONE
+MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */
+#endif
/** From h5tools_utils.c **/
@@ -161,119 +164,3 @@ print_version(const char *progname)
progname, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE,
H5_VERS_SUBRELEASE[0] ? "-" : "", H5_VERS_SUBRELEASE);
}
-
-
-
-/** From h5test.c **/
-
-#ifdef H5_HAVE_PARALLEL
-MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */
-#endif
-
-int
-h5_set_info_object(void)
-{
- char *envp; /* environment pointer */
- int ret_value=0;
-
- /* handle any MPI INFO hints via $HDF5_MPI_INFO */
- if ((envp = getenv("HDF5_MPI_INFO")) != NULL){
- char *next, *valp;
-
-
- valp = envp = next = HDstrdup(envp);
-
- /* create an INFO object if not created yet */
- if (h5_io_info_g == MPI_INFO_NULL)
- MPI_Info_create(&h5_io_info_g);
-
- do {
- size_t len;
- char *key_val, *endp, *namep;
-
- if (*valp == ';')
- valp++;
-
- /* copy key/value pair into temporary buffer */
- len = strcspn(valp, ";");
- next = &valp[len];
- key_val = calloc(1, len + 1);
-
- /* increment the next pointer past the terminating semicolon */
- if (*next == ';')
- ++next;
-
- namep = HDstrncpy(key_val, valp, len);
-
- /* pass up any beginning whitespaces */
- while (*namep && (*namep == ' ' || *namep == '\t'))
- namep++;
-
- /* eat up any ending white spaces */
- endp = &namep[strlen(namep) - 1];
-
- while (endp && (*endp == ' ' || *endp == '\t'))
- *endp-- = '\0';
-
- /* find the '=' */
-
- valp = HDstrchr(namep, '=');
-
- if (valp != NULL) { /* it's a valid key/value pairing */
- char *tmp_val = valp + 1;
-
- /* change '=' to \0, move valp down one */
- *valp-- = '\0';
-
- /* eat up ending whitespace on the "key" part */
- while (*valp == ' ' || *valp == '\t')
- *valp-- = '\0';
-
- valp = tmp_val;
-
- /* eat up beginning whitespace on the "value" part */
- while (*valp == ' ' || *valp == '\t')
- *valp++ = '\0';
-
- /* actually set the darned thing */
- if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
- printf("MPI_Info_set failed\n");
- ret_value = -1;
- }
- }
-
- valp = next;
- HDfree(key_val);
- } while (next && *next);
-
- HDfree(envp);
- }
-
- return ret_value;
-}
-
-
-void
-h5_dump_info_object(MPI_Info info)
-{
- char key[MPI_MAX_INFO_KEY+1];
- char value[MPI_MAX_INFO_VAL+1];
- int flag;
- int i, nkeys;
-
- printf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info,
- MPI_MAX_INFO_VAL);
- if (info==MPI_INFO_NULL){
- printf("object is MPI_INFO_NULL\n");
- }
- else {
- MPI_Info_get_nkeys(info, &nkeys);
- printf("object has %d items\n", nkeys);
- for (i=0; i<nkeys; i++){
- MPI_Info_get_nthkey(info, i, key);
- MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
- printf("%s=%s\n", key, value);
- }
-
- }
-}
diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h
index a40cff8..e6db2e8 100644
--- a/tools/test/perform/pio_standalone.h
+++ b/tools/test/perform/pio_standalone.h
@@ -294,6 +294,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDpipe(F) pipe(F)
#define HDpow(X,Y) pow(X,Y)
/* printf() variable arguments */
+#define HDprintf(...) HDfprintf(stdout, __VA_ARGS__)
#define HDputc(C,F) putc(C,F)
#define HDputchar(C) putchar(C)
#define HDputs(S) puts(S)
@@ -355,6 +356,7 @@ H5_DLL int c99_snprintf(char* str, size_t size, const char* format, ...);
#define HDsnprintf snprintf /*varargs*/
#endif
/* sprintf() variable arguments */
+#define HDsprintf sprintf /*varargs*/
#define HDsqrt(X) sqrt(X)
#ifdef H5_HAVE_RAND_R
H5_DLL void HDsrand(unsigned int seed);
diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c
index 4fead3f..488f575 100644
--- a/tools/test/perform/sio_engine.c
+++ b/tools/test/perform/sio_engine.c
@@ -41,7 +41,7 @@
#define GOTOERROR(errcode) { ret_code = errcode; goto done; }
#define ERRMSG(mesg) { \
- fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
+ HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
}
@@ -54,6 +54,12 @@
} while(0)
/* POSIX I/O macros */
+#ifdef H5_HAVE_WIN32_API
+/* Can't link against the library, so this test will use the older, non-Unicode
+ * _open() call on Windows.
+ */
+#define HDopen(S,F,...) _open(S, F | _O_BINARY, __VA_ARGS__)
+#endif /* H5_HAVE_WIN32_API */
#define POSIXCREATE(fn) HDopen(fn, O_CREAT|O_TRUNC|O_RDWR, 0600)
#define POSIXOPEN(fn, F) HDopen(fn, F, 0600)
#define POSIXCLOSE(F) HDclose(F)
@@ -192,7 +198,7 @@ do_sio(parameters param, results *res)
if (sio_debug_level >= 4)
/* output all of the times for all iterations */
- fprintf(output, "Timer details:\n");
+ HDfprintf(output, "Timer details:\n");
/*
* Write performance measurement
@@ -258,7 +264,7 @@ done:
case HDF5:
if (fd.h5fd != -1)
hrc = do_fclose(iot, &fd);
- break;
+ break;
default:
/* unknown request */
HDassert(0 && "Unknown IO type");
@@ -484,7 +490,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -506,7 +512,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
h5dcpl = H5Pcreate(H5P_DATASET_CREATE);
if (h5dcpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -514,12 +520,12 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
/* Set the chunk size to be the same as the buffer size */
hrc = H5Pset_chunk(h5dcpl, rank, h5chunk);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
- sprintf(dname, "Dataset_%ld", (unsigned long)parms->num_bytes);
+ HDsprintf(dname, "Dataset_%ld", (unsigned long)parms->num_bytes);
h5ds_id = H5Dcreate2(fd->h5fd, dname, ELMT_H5_TYPE,
h5dset_space_id, H5P_DEFAULT, h5dcpl, H5P_DEFAULT);
@@ -550,7 +556,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
hrc = dset_write(rank-1, fd, parms, buffer);
if (hrc < 0) {
- fprintf(stderr, "Error in dataset write\n");
+ HDfprintf(stderr, "Error in dataset write\n");
GOTOERROR(FAIL);
}
@@ -565,7 +571,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
hrc = H5Dclose(h5ds_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Close failed\n");
GOTOERROR(FAIL);
}
@@ -578,7 +584,7 @@ done:
if (h5dset_space_id != -1) {
hrc = H5Sclose(h5dset_space_id);
if (hrc < 0){
- fprintf(stderr, "HDF5 Dataset Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
h5dset_space_id = -1;
@@ -588,7 +594,7 @@ done:
if (h5mem_space_id != -1) {
hrc = H5Sclose(h5mem_space_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Memory Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
h5mem_space_id = -1;
@@ -598,7 +604,7 @@ done:
if (h5dxpl != -1) {
hrc = H5Pclose(h5dxpl);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
h5dxpl = -1;
@@ -679,7 +685,7 @@ dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer)
VRFY((hrc >= 0), "H5Dwrite");
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type);
@@ -831,7 +837,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
break;
@@ -850,14 +856,14 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
break;
case HDF5:
- sprintf(dname, "Dataset_%ld", (long)parms->num_bytes);
+ HDsprintf(dname, "Dataset_%ld", (long)parms->num_bytes);
h5ds_id = H5Dopen2(fd->h5fd, dname, H5P_DEFAULT);
if (h5ds_id < 0) {
HDfprintf(stderr, "HDF5 Dataset open failed\n");
GOTOERROR(FAIL);
}
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type);
@@ -870,7 +876,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
hrc = dset_read(rank-1, fd, parms, buffer, buffer2);
if (hrc < 0) {
- fprintf(stderr, "Error in dataset read\n");
+ HDfprintf(stderr, "Error in dataset read\n");
GOTOERROR(FAIL);
}
@@ -884,7 +890,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
hrc = H5Dclose(h5ds_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Close failed\n");
GOTOERROR(FAIL);
}
@@ -897,7 +903,7 @@ done:
if (h5dset_space_id != -1) {
hrc = H5Sclose(h5dset_space_id);
if (hrc < 0){
- fprintf(stderr, "HDF5 Dataset Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
h5dset_space_id = -1;
@@ -907,7 +913,7 @@ done:
if (h5mem_space_id != -1) {
hrc = H5Sclose(h5mem_space_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Memory Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
h5mem_space_id = -1;
@@ -917,7 +923,7 @@ done:
if (h5dxpl != -1) {
hrc = H5Pclose(h5dxpl);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
h5dxpl = -1;
@@ -981,7 +987,7 @@ dset_read(int local_dim, file_descr *fd, parameters *parms, void *buffer,
h5dset_space_id, h5dxpl, buffer);
VRFY((hrc >= 0), "H5Dread");
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type);
@@ -1083,7 +1089,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
fapl = set_vfd(param);
if (fapl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -1104,11 +1110,11 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
if (fd->h5fd < 0) {
- fprintf(stderr, "HDF5 File Create failed(%s)\n", fname);
+ HDfprintf(stderr, "HDF5 File Create failed(%s)\n", fname);
GOTOERROR(FAIL);
}
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)param->io_type);
@@ -1170,7 +1176,7 @@ set_vfd(parameters *param)
HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
memb_fapl[mt] = H5P_DEFAULT;
- sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
+ HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv[mt];
memb_addr[mt] = (haddr_t)MAX(mt - 1,0) * (HADDR_MAX / 10);
}
@@ -1219,7 +1225,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
rc = POSIXCLOSE(fd->posixfd);
if (rc != 0){
- fprintf(stderr, "POSIX File Close failed\n");
+ HDfprintf(stderr, "POSIX File Close failed\n");
GOTOERROR(FAIL);
}
@@ -1230,13 +1236,13 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
hrc = H5Fclose(fd->h5fd);
if (hrc < 0) {
- fprintf(stderr, "HDF5 File Close failed\n");
+ HDfprintf(stderr, "HDF5 File Close failed\n");
GOTOERROR(FAIL);
}
fd->h5fd = -1;
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot);
@@ -1256,7 +1262,15 @@ done:
* Programmer: Albert Cheng 2001/12/12
* Modifications: Support for file drivers. Christian Chilan, April, 2008
*/
- static void
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'temp' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+static void
do_cleanupfile(iotype iot, char *filename)
{
char temp[2048];
@@ -1269,12 +1283,12 @@ do_cleanupfile(iotype iot, char *filename)
if (clean_file_g){
switch (iot) {
- case POSIXIO:
- HDremove(filename);
- break;
+ case POSIXIO:
+ HDremove(filename);
+ break;
- case HDF5:
- driver = H5Pget_driver(fapl);
+ case HDF5:
+ driver = H5Pget_driver(fapl);
if (driver == H5FD_FAMILY) {
for (j = 0; /*void*/; j++) {
@@ -1307,14 +1321,15 @@ do_cleanupfile(iotype iot, char *filename)
HDremove(filename);
}
H5Pclose(fapl);
- break;
-
- default:
- /* unknown request */
- HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot);
- HDassert(0 && "Unknown IO type");
- break;
- }
+ break;
+
+ default:
+ /* unknown request */
+ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot);
+ HDassert(0 && "Unknown IO type");
+ break;
+ }
}
}
+#pragma GCC diagnostic pop
diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c
index e77b99e..90030d8 100644
--- a/tools/test/perform/sio_perf.c
+++ b/tools/test/perform/sio_perf.c
@@ -98,7 +98,7 @@ static const char *progname = "h5perf_serial";
* It seems that only the options that accept additional information
* such as dataset size (-e) require the colon next to it.
*/
-static const char *s_opts = "a:A:B:b:c:Cd:D:e:F:G:ghi:Imno:p:P:r:stT:v:wx:X:";
+static const char *s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:";
static struct long_options l_opts[] = {
{ "align", require_arg, 'a' },
{ "alig", require_arg, 'a' },
@@ -281,14 +281,14 @@ struct options {
int buf_rank; /* Rank */
int order_rank; /* Rank */
int chk_rank; /* Rank */
- int print_times; /* print times as well as throughputs */
- int print_raw; /* print raw data throughput info */
+ int print_times; /* print times as well as throughputs */
+ int print_raw; /* print raw data throughput info */
hsize_t h5_alignment; /* alignment in HDF5 file */
hsize_t h5_threshold; /* threshold for alignment in HDF5 file */
- int h5_use_chunks; /* Make HDF5 dataset chunked */
- int h5_write_only; /* Perform the write tests only */
- int h5_extendable; /* Perform the write tests only */
- int verify; /* Verify data correctness */
+ int h5_use_chunks; /* Make HDF5 dataset chunked */
+ int h5_write_only; /* Perform the write tests only */
+ int h5_extendable; /* Perform the write tests only */
+ int verify; /* Verify data correctness */
vfdtype vfd; /* File driver */
size_t page_buffer_size;
size_t page_size;
@@ -333,7 +333,7 @@ main(int argc, char **argv)
/* Initialize h5tools lib */
h5tools_init();
#endif
-
+
output = stdout;
opts = parse_command_line(argc, argv);
@@ -345,8 +345,8 @@ main(int argc, char **argv)
if (opts->output_file) {
if ((output = HDfopen(opts->output_file, "w")) == NULL) {
- fprintf(stderr, "%s: cannot open output file\n", progname);
- perror(opts->output_file);
+ HDfprintf(stderr, "%s: cannot open output file\n", progname);
+ HDperror(opts->output_file);
goto finish;
}
}
@@ -356,7 +356,7 @@ main(int argc, char **argv)
run_test_loop(opts);
finish:
- free(opts);
+ HDfree(opts);
return exit_value;
}
@@ -385,8 +385,8 @@ static void
run_test_loop(struct options *opts)
{
parameters parms;
- int i;
- size_t buf_bytes;
+ int i;
+ size_t buf_bytes;
/* load options into parameter structure */
parms.num_files = opts->num_files;
@@ -552,7 +552,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
/*
* Show various statistics
*/
- /* Write statistics */
+ /* Write statistics */
/* Print the raw data throughput if desired */
if (opts->print_raw) {
/* accumulate and output the max, min, and average "raw write" times */
@@ -598,7 +598,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
output_results(opts,"Write Open-Close",write_gross_mm_table,parms.num_iters,raw_size);
if (!parms.h5_write_only) {
- /* Read statistics */
+ /* Read statistics */
/* Print the raw data throughput if desired */
if (opts->print_raw) {
/* accumulate and output the max, min, and average "raw read" times */
@@ -647,16 +647,16 @@ run_test(iotype iot, parameters parms, struct options *opts)
}
/* clean up our mess */
- free(write_sys_mm_table);
- free(write_mm_table);
- free(write_gross_mm_table);
- free(write_raw_mm_table);
+ HDfree(write_sys_mm_table);
+ HDfree(write_mm_table);
+ HDfree(write_gross_mm_table);
+ HDfree(write_raw_mm_table);
if (!parms.h5_write_only) {
- free(read_sys_mm_table);
- free(read_mm_table);
- free(read_gross_mm_table);
- free(read_raw_mm_table);
+ HDfree(read_sys_mm_table);
+ HDfree(read_mm_table);
+ HDfree(read_gross_mm_table);
+ HDfree(read_raw_mm_table);
}
return ret_value;
@@ -790,9 +790,9 @@ output_report(const char *fmt, ...)
{
va_list ap;
- va_start(ap, fmt);
- vfprintf(output, fmt, ap);
- va_end(ap);
+ HDva_start(ap, fmt);
+ HDvfprintf(output, fmt, ap);
+ HDva_end(ap);
}
/*
@@ -806,10 +806,10 @@ output_report(const char *fmt, ...)
static void
print_indent(register int indent)
{
- indent *= TAB_SPACE;
+ indent *= TAB_SPACE;
- for (; indent > 0; --indent)
- fputc(' ', output);
+ for (; indent > 0; --indent)
+ HDfputc(' ', output);
}
static void
@@ -833,9 +833,9 @@ static void
print_io_api(long io_types)
{
if (io_types & SIO_POSIX)
- HDfprintf(output, "posix ");
+ HDfprintf(output, "posix ");
if (io_types & SIO_HDF5)
- HDfprintf(output, "hdf5 ");
+ HDfprintf(output, "hdf5 ");
HDfprintf(output, "\n");
}
@@ -845,7 +845,7 @@ report_parameters(struct options *opts)
int i, rank;
rank = opts->dset_rank;
- print_version("HDF5 Library"); /* print library version */
+ print_version("HDF5 Library"); /* print library version */
HDfprintf(output, "==== Parameters ====\n");
HDfprintf(output, "IO API=");
@@ -1004,7 +1004,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
if (!HDstrcasecmp(buf, "hdf5")) {
@@ -1012,9 +1012,9 @@ parse_command_line(int argc, char *argv[])
} else if (!HDstrcasecmp(buf, "posix")) {
cl_opts->io_types |= SIO_POSIX;
} else {
- fprintf(stderr, "sio_perf: invalid --api option %s\n",
+ HDfprintf(stderr, "sio_perf: invalid --api option %s\n",
buf);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
if (*end == '\0')
@@ -1043,7 +1043,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
cl_opts->chk_size[j] = parse_size_directive(buf);
@@ -1071,17 +1071,17 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
- if (strlen(buf) > 1 || isdigit(buf[0])) {
+ if (HDstrlen(buf) > 1 || HDisdigit(buf[0])) {
size_t j;
for (j = 0; j < 10 && buf[j] != '\0'; ++j)
- if (!isdigit(buf[j])) {
- fprintf(stderr, "sio_perf: invalid --debug option %s\n",
+ if (!HDisdigit(buf[j])) {
+ HDfprintf(stderr, "sio_perf: invalid --debug option %s\n",
buf);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
sio_debug_level = atoi(buf);
@@ -1105,8 +1105,8 @@ parse_command_line(int argc, char *argv[])
cl_opts->verify = TRUE;
break;
default:
- fprintf(stderr, "sio_perf: invalid --debug option %s\n", buf);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "sio_perf: invalid --debug option %s\n", buf);
+ HDexit(EXIT_FAILURE);
}
}
@@ -1129,7 +1129,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
cl_opts->dset_size[j] = parse_size_directive(buf);
@@ -1147,7 +1147,7 @@ parse_command_line(int argc, char *argv[])
break;
case 'i':
- cl_opts->num_iters = atoi(opt_arg);
+ cl_opts->num_iters = HDatoi(opt_arg);
break;
case 'o':
cl_opts->output_file = opt_arg;
@@ -1171,9 +1171,9 @@ parse_command_line(int argc, char *argv[])
} else if (!HDstrcasecmp(opt_arg, "direct")) {
cl_opts->vfd=direct;
} else {
- fprintf(stderr, "sio_perf: invalid --api option %s\n",
+ HDfprintf(stderr, "sio_perf: invalid --api option %s\n",
opt_arg);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
break;
case 'w':
@@ -1193,7 +1193,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
cl_opts->buf_size[j] = parse_size_directive(buf);
@@ -1221,7 +1221,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
cl_opts->order[j] = (int)parse_size_directive(buf);
@@ -1243,7 +1243,7 @@ parse_command_line(int argc, char *argv[])
case '?':
default:
usage(progname);
- free(cl_opts);
+ HDfree(cl_opts);
return NULL;
}
}
@@ -1339,8 +1339,8 @@ parse_size_directive(const char *size)
break;
default:
- fprintf(stderr, "Illegal size specifier '%c'\n", *endptr);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "Illegal size specifier '%c'\n", *endptr);
+ HDexit(EXIT_FAILURE);
}
}
@@ -1357,72 +1357,72 @@ parse_size_directive(const char *size)
static void
usage(const char *prog)
{
- print_version(prog);
- printf("usage: %s [OPTIONS]\n", prog);
- printf(" OPTIONS\n");
- printf(" -h Print an usage message and exit\n");
- printf(" -A AL Which APIs to test\n");
- printf(" [default: all of them]\n");
- printf(" -c SL Selects chunked storage and defines chunks dimensions\n");
- printf(" and sizes\n");
- printf(" [default: Off]\n");
- printf(" -e SL Dimensions and sizes of dataset\n");
- printf(" [default: 100,200]\n");
- printf(" -i N Number of iterations to perform\n");
- printf(" [default: 1]\n");
- printf(" -r NL Dimension access order (see below for description)\n");
- printf(" [default: 1,2]\n");
- printf(" -t Selects extendable dimensions for HDF5 dataset\n");
- printf(" [default: Off]\n");
- printf(" -v VFD Selects file driver for HDF5 access\n");
- printf(" [default: sec2]\n");
- printf(" -w Perform write tests, not the read tests\n");
- printf(" [default: Off]\n");
- printf(" -x SL Dimensions and sizes of the transfer buffer\n");
- printf(" [default: 10,20]\n");
- printf("\n");
- printf(" N - is an integer > 0.\n");
- printf("\n");
- printf(" S - is a size specifier, an integer > 0 followed by a size indicator:\n");
- printf(" K - Kilobyte (%d)\n", ONE_KB);
- printf(" M - Megabyte (%d)\n", ONE_MB);
- printf(" G - Gigabyte (%d)\n", ONE_GB);
- printf("\n");
- printf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB);
- printf("\n");
- printf(" AL - is an API list. Valid values are:\n");
- printf(" hdf5 - HDF5\n");
- printf(" posix - POSIX\n");
- printf("\n");
- printf(" Example: -A posix,hdf5\n");
- printf("\n");
- printf(" NL - is list of integers (N) separated by commas.\n");
- printf("\n");
- printf(" Example: 1,2,3\n");
- printf("\n");
- printf(" SL - is list of size specifiers (S) separated by commas.\n");
- printf("\n");
- printf(" Example: 2K,2K,3K\n");
- printf("\n");
- printf(" The example defines an object (dataset, tranfer buffer) with three\n");
- printf(" dimensions. Be aware that as the number of dimensions increases, the\n");
- printf(" the total size of the object increases exponentially.\n");
- printf("\n");
- printf(" VFD - is an HDF5 file driver specifier. Valid values are:\n");
- printf(" sec2, stdio, core, split, multi, family, direct\n");
- printf("\n");
- printf(" Dimension access order:\n");
- printf(" Data access starts at the cardinal origin of the dataset using the\n");
- printf(" transfer buffer. The next access occurs on a dataset region next to\n");
- printf(" the previous one. For a multidimensional dataset, there are several\n");
- printf(" directions as to where to proceed. This can be specified in the dimension\n");
- printf(" access order. For example, -r 1,2 states that the tool should traverse\n");
- printf(" dimension 1 first, and then dimension 2.\n");
- printf("\n");
- printf(" Environment variables:\n");
- printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
- printf(" HDF5_PREFIX Data file prefix\n");
- printf("\n");
- fflush(stdout);
+ print_version(prog);
+ HDprintf("usage: %s [OPTIONS]\n", prog);
+ HDprintf(" OPTIONS\n");
+ HDprintf(" -h Print an usage message and exit\n");
+ HDprintf(" -A AL Which APIs to test\n");
+ HDprintf(" [default: all of them]\n");
+ HDprintf(" -c SL Selects chunked storage and defines chunks dimensions\n");
+ HDprintf(" and sizes\n");
+ HDprintf(" [default: Off]\n");
+ HDprintf(" -e SL Dimensions and sizes of dataset\n");
+ HDprintf(" [default: 100,200]\n");
+ HDprintf(" -i N Number of iterations to perform\n");
+ HDprintf(" [default: 1]\n");
+ HDprintf(" -r NL Dimension access order (see below for description)\n");
+ HDprintf(" [default: 1,2]\n");
+ HDprintf(" -t Selects extendable dimensions for HDF5 dataset\n");
+ HDprintf(" [default: Off]\n");
+ HDprintf(" -v VFD Selects file driver for HDF5 access\n");
+ HDprintf(" [default: sec2]\n");
+ HDprintf(" -w Perform write tests, not the read tests\n");
+ HDprintf(" [default: Off]\n");
+ HDprintf(" -x SL Dimensions and sizes of the transfer buffer\n");
+ HDprintf(" [default: 10,20]\n");
+ HDprintf("\n");
+ HDprintf(" N - is an integer > 0.\n");
+ HDprintf("\n");
+ HDprintf(" S - is a size specifier, an integer > 0 followed by a size indicator:\n");
+ HDprintf(" K - Kilobyte (%d)\n", ONE_KB);
+ HDprintf(" M - Megabyte (%d)\n", ONE_MB);
+ HDprintf(" G - Gigabyte (%d)\n", ONE_GB);
+ HDprintf("\n");
+ HDprintf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB);
+ HDprintf("\n");
+ HDprintf(" AL - is an API list. Valid values are:\n");
+ HDprintf(" hdf5 - HDF5\n");
+ HDprintf(" posix - POSIX\n");
+ HDprintf("\n");
+ HDprintf(" Example: -A posix,hdf5\n");
+ HDprintf("\n");
+ HDprintf(" NL - is list of integers (N) separated by commas.\n");
+ HDprintf("\n");
+ HDprintf(" Example: 1,2,3\n");
+ HDprintf("\n");
+ HDprintf(" SL - is list of size specifiers (S) separated by commas.\n");
+ HDprintf("\n");
+ HDprintf(" Example: 2K,2K,3K\n");
+ HDprintf("\n");
+ HDprintf(" The example defines an object (dataset, tranfer buffer) with three\n");
+ HDprintf(" dimensions. Be aware that as the number of dimensions increases, the\n");
+ HDprintf(" the total size of the object increases exponentially.\n");
+ HDprintf("\n");
+ HDprintf(" VFD - is an HDF5 file driver specifier. Valid values are:\n");
+ HDprintf(" sec2, stdio, core, split, multi, family, direct\n");
+ HDprintf("\n");
+ HDprintf(" Dimension access order:\n");
+ HDprintf(" Data access starts at the cardinal origin of the dataset using the\n");
+ HDprintf(" transfer buffer. The next access occurs on a dataset region next to\n");
+ HDprintf(" the previous one. For a multidimensional dataset, there are several\n");
+ HDprintf(" directions as to where to proceed. This can be specified in the dimension\n");
+ HDprintf(" access order. For example, -r 1,2 states that the tool should traverse\n");
+ HDprintf(" dimension 1 first, and then dimension 2.\n");
+ HDprintf("\n");
+ HDprintf(" Environment variables:\n");
+ HDprintf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
+ HDprintf(" HDF5_PREFIX Data file prefix\n");
+ HDprintf("\n");
+ HDfflush(stdout);
} /* end usage() */
diff --git a/tools/test/perform/sio_standalone.c b/tools/test/perform/sio_standalone.c
index dfdbc55..ac191e5 100644
--- a/tools/test/perform/sio_standalone.c
+++ b/tools/test/perform/sio_standalone.c
@@ -162,122 +162,3 @@ print_version(const char *progname)
H5_VERS_SUBRELEASE[0] ? "-" : "", H5_VERS_SUBRELEASE);
}
-
-
-/** From h5test.c **/
-
-#ifdef H5_HAVE_PARALLEL
-MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */
-#endif
-
-#if 0
-int
-h5_set_info_object(void)
-{
- char *envp; /* environment pointer */
- int ret_value=0;
-
- /* handle any MPI INFO hints via $HDF5_MPI_INFO */
- if ((envp = getenv("HDF5_MPI_INFO")) != NULL){
- char *next, *valp;
-
-
- valp = envp = next = HDstrdup(envp);
-
- /* create an INFO object if not created yet */
- if (h5_io_info_g == MPI_INFO_NULL)
- MPI_Info_create(&h5_io_info_g);
-
- do {
- size_t len;
- char *key_val, *endp, *namep;
-
- if (*valp == ';')
- valp++;
-
- /* copy key/value pair into temporary buffer */
- len = strcspn(valp, ";");
- next = &valp[len];
- key_val = calloc(1, len + 1);
-
- /* increment the next pointer past the terminating semicolon */
- if (*next == ';')
- ++next;
-
- namep = HDstrncpy(key_val, valp, len);
-
- /* pass up any beginning whitespaces */
- while (*namep && (*namep == ' ' || *namep == '\t'))
- namep++;
-
- /* eat up any ending white spaces */
- endp = &namep[strlen(namep) - 1];
-
- while (endp && (*endp == ' ' || *endp == '\t'))
- *endp-- = '\0';
-
- /* find the '=' */
-
- valp = HDstrchr(namep, '=');
-
- if (valp != NULL) { /* it's a valid key/value pairing */
- char *tmp_val = valp + 1;
-
- /* change '=' to \0, move valp down one */
- *valp-- = '\0';
-
- /* eat up ending whitespace on the "key" part */
- while (*valp == ' ' || *valp == '\t')
- *valp-- = '\0';
-
- valp = tmp_val;
-
- /* eat up beginning whitespace on the "value" part */
- while (*valp == ' ' || *valp == '\t')
- *valp++ = '\0';
-
- /* actually set the darned thing */
- if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
- printf("MPI_Info_set failed\n");
- ret_value = -1;
- }
- }
-
- valp = next;
- HDfree(key_val);
- } while (next && *next);
-
- HDfree(envp);
- }
-
- return ret_value;
-}
-
-
-void
-h5_dump_info_object(MPI_Info info)
-{
- char key[MPI_MAX_INFO_KEY+1];
- char value[MPI_MAX_INFO_VAL+1];
- int flag;
- int i, nkeys;
-
- printf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info,
- MPI_MAX_INFO_VAL);
- if (info==MPI_INFO_NULL){
- printf("object is MPI_INFO_NULL\n");
- }
- else {
- MPI_Info_get_nkeys(info, &nkeys);
- printf("object has %d items\n", nkeys);
- for (i=0; i<nkeys; i++){
- MPI_Info_get_nthkey(info, i, key);
- MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
- printf("%s=%s\n", key, value);
- }
-
- }
-}
-
-#endif
-
diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h
index e73a6b5..5ce922b 100644
--- a/tools/test/perform/sio_standalone.h
+++ b/tools/test/perform/sio_standalone.h
@@ -316,6 +316,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDpipe(F) pipe(F)
#define HDpow(X,Y) pow(X,Y)
/* printf() variable arguments */
+#define HDprintf(...) HDfprintf(stdout, __VA_ARGS__)
#define HDputc(C,F) putc(C,F)
#define HDputchar(C) putchar(C)
#define HDputs(S) puts(S)
@@ -377,6 +378,7 @@ H5_DLL int c99_snprintf(char* str, size_t size, const char* format, ...);
#define HDsnprintf snprintf /*varargs*/
#endif
/* sprintf() variable arguments */
+#define HDsprintf sprintf /*varargs*/
#define HDsqrt(X) sqrt(X)
#ifdef H5_HAVE_RAND_R
H5_DLL void HDsrand(unsigned int seed);
diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt
index 19de76f..95dfc3b 100644
--- a/tools/testfiles/h5dump-help.txt
+++ b/tools/testfiles/h5dump-help.txt
@@ -12,6 +12,16 @@ usage: h5dump [OPTIONS] files
-b B, --binary=B Binary file output, of form B
-O F, --ddl=F Output ddl text into file F
Use blank(empty) filename F to suppress ddl display
+ --s3-cred=<cred> Supply S3 authentication information to "ros3" vfd.
+ <cred> :: "(<aws-region>,<access-id>,<access-key>)"
+ If absent or <cred> -> "(,,)", no authentication.
+ Has no effect is filedriver is not `ros3'.
+ --hdfs-attrs=<attrs> Supply configuration information for HDFS file access.
+ For use with "--filedriver=hdfs"
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ Any absent attribute will use a default value.
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
diff --git a/tools/testfiles/help-1.ls b/tools/testfiles/help-1.ls
index 491f696..396bed3 100644
--- a/tools/testfiles/help-1.ls
+++ b/tools/testfiles/help-1.ls
@@ -37,6 +37,15 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]
-V, --version Print version number and exit
--vfd=DRIVER Use the specified virtual file driver
-x, --hexdump Show raw data in hexadecimal format
+ --s3-cred=C Supply S3 authentication information to "ros3" vfd.
+ Accepts tuple of "(<aws-region>,<access-id>,<access-key>)".
+ If absent or C->"(,,)", defaults to no-authentication.
+ Has no effect if vfd flag not set to "ros3".
+ --hdfs-attrs=A Supply configuration information to Hadoop VFD.
+ Accepts tuple of (<namenode name>,<namenode port>,
+ ...<kerberos cache path>,<username>,<buffer size>)
+ If absent or A == '(,,,,)', all default values are used.
+ Has no effect if vfd flag is not 'hdfs'.
file/OBJECT
Each object consists of an HDF5 file name optionally followed by a
diff --git a/tools/testfiles/help-2.ls b/tools/testfiles/help-2.ls
index 491f696..396bed3 100644
--- a/tools/testfiles/help-2.ls
+++ b/tools/testfiles/help-2.ls
@@ -37,6 +37,15 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]
-V, --version Print version number and exit
--vfd=DRIVER Use the specified virtual file driver
-x, --hexdump Show raw data in hexadecimal format
+ --s3-cred=C Supply S3 authentication information to "ros3" vfd.
+ Accepts tuple of "(<aws-region>,<access-id>,<access-key>)".
+ If absent or C->"(,,)", defaults to no-authentication.
+ Has no effect if vfd flag not set to "ros3".
+ --hdfs-attrs=A Supply configuration information to Hadoop VFD.
+ Accepts tuple of (<namenode name>,<namenode port>,
+ ...<kerberos cache path>,<username>,<buffer size>)
+ If absent or A == '(,,,,)', all default values are used.
+ Has no effect if vfd flag is not 'hdfs'.
file/OBJECT
Each object consists of an HDF5 file name optionally followed by a
diff --git a/tools/testfiles/help-3.ls b/tools/testfiles/help-3.ls
index 491f696..396bed3 100644
--- a/tools/testfiles/help-3.ls
+++ b/tools/testfiles/help-3.ls
@@ -37,6 +37,15 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]
-V, --version Print version number and exit
--vfd=DRIVER Use the specified virtual file driver
-x, --hexdump Show raw data in hexadecimal format
+ --s3-cred=C Supply S3 authentication information to "ros3" vfd.
+ Accepts tuple of "(<aws-region>,<access-id>,<access-key>)".
+ If absent or C->"(,,)", defaults to no-authentication.
+ Has no effect if vfd flag not set to "ros3".
+ --hdfs-attrs=A Supply configuration information to Hadoop VFD.
+ Accepts tuple of (<namenode name>,<namenode port>,
+ ...<kerberos cache path>,<username>,<buffer size>)
+ If absent or A == '(,,,,)', all default values are used.
+ Has no effect if vfd flag is not 'hdfs'.
file/OBJECT
Each object consists of an HDF5 file name optionally followed by a
diff --git a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
index 19de76f..95dfc3b 100644
--- a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
+++ b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
@@ -12,6 +12,16 @@ usage: h5dump [OPTIONS] files
-b B, --binary=B Binary file output, of form B
-O F, --ddl=F Output ddl text into file F
Use blank(empty) filename F to suppress ddl display
+ --s3-cred=<cred> Supply S3 authentication information to "ros3" vfd.
+ <cred> :: "(<aws-region>,<access-id>,<access-key>)"
+ If absent or <cred> -> "(,,)", no authentication.
+ Has no effect is filedriver is not `ros3'.
+ --hdfs-attrs=<attrs> Supply configuration information for HDFS file access.
+ For use with "--filedriver=hdfs"
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ Any absent attribute will use a default value.
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
diff --git a/tools/testfiles/pbits/tpbitsIncomplete.ddl b/tools/testfiles/pbits/tpbitsIncomplete.ddl
index 19de76f..95dfc3b 100644
--- a/tools/testfiles/pbits/tpbitsIncomplete.ddl
+++ b/tools/testfiles/pbits/tpbitsIncomplete.ddl
@@ -12,6 +12,16 @@ usage: h5dump [OPTIONS] files
-b B, --binary=B Binary file output, of form B
-O F, --ddl=F Output ddl text into file F
Use blank(empty) filename F to suppress ddl display
+ --s3-cred=<cred> Supply S3 authentication information to "ros3" vfd.
+ <cred> :: "(<aws-region>,<access-id>,<access-key>)"
+ If absent or <cred> -> "(,,)", no authentication.
+ Has no effect is filedriver is not `ros3'.
+ --hdfs-attrs=<attrs> Supply configuration information for HDFS file access.
+ For use with "--filedriver=hdfs"
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ Any absent attribute will use a default value.
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
diff --git a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl
index 19de76f..95dfc3b 100644
--- a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl
@@ -12,6 +12,16 @@ usage: h5dump [OPTIONS] files
-b B, --binary=B Binary file output, of form B
-O F, --ddl=F Output ddl text into file F
Use blank(empty) filename F to suppress ddl display
+ --s3-cred=<cred> Supply S3 authentication information to "ros3" vfd.
+ <cred> :: "(<aws-region>,<access-id>,<access-key>)"
+ If absent or <cred> -> "(,,)", no authentication.
+ Has no effect is filedriver is not `ros3'.
+ --hdfs-attrs=<attrs> Supply configuration information for HDFS file access.
+ For use with "--filedriver=hdfs"
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ Any absent attribute will use a default value.
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
diff --git a/tools/testfiles/pbits/tpbitsLengthPositive.ddl b/tools/testfiles/pbits/tpbitsLengthPositive.ddl
index 19de76f..95dfc3b 100644
--- a/tools/testfiles/pbits/tpbitsLengthPositive.ddl
+++ b/tools/testfiles/pbits/tpbitsLengthPositive.ddl
@@ -12,6 +12,16 @@ usage: h5dump [OPTIONS] files
-b B, --binary=B Binary file output, of form B
-O F, --ddl=F Output ddl text into file F
Use blank(empty) filename F to suppress ddl display
+ --s3-cred=<cred> Supply S3 authentication information to "ros3" vfd.
+ <cred> :: "(<aws-region>,<access-id>,<access-key>)"
+ If absent or <cred> -> "(,,)", no authentication.
+ Has no effect is filedriver is not `ros3'.
+ --hdfs-attrs=<attrs> Supply configuration information for HDFS file access.
+ For use with "--filedriver=hdfs"
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ Any absent attribute will use a default value.
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
diff --git a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl
index 19de76f..95dfc3b 100644
--- a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl
@@ -12,6 +12,16 @@ usage: h5dump [OPTIONS] files
-b B, --binary=B Binary file output, of form B
-O F, --ddl=F Output ddl text into file F
Use blank(empty) filename F to suppress ddl display
+ --s3-cred=<cred> Supply S3 authentication information to "ros3" vfd.
+ <cred> :: "(<aws-region>,<access-id>,<access-key>)"
+ If absent or <cred> -> "(,,)", no authentication.
+ Has no effect is filedriver is not `ros3'.
+ --hdfs-attrs=<attrs> Supply configuration information for HDFS file access.
+ For use with "--filedriver=hdfs"
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ Any absent attribute will use a default value.
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
diff --git a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
index 19de76f..95dfc3b 100644
--- a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
@@ -12,6 +12,16 @@ usage: h5dump [OPTIONS] files
-b B, --binary=B Binary file output, of form B
-O F, --ddl=F Output ddl text into file F
Use blank(empty) filename F to suppress ddl display
+ --s3-cred=<cred> Supply S3 authentication information to "ros3" vfd.
+ <cred> :: "(<aws-region>,<access-id>,<access-key>)"
+ If absent or <cred> -> "(,,)", no authentication.
+ Has no effect is filedriver is not `ros3'.
+ --hdfs-attrs=<attrs> Supply configuration information for HDFS file access.
+ For use with "--filedriver=hdfs"
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ Any absent attribute will use a default value.
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
diff --git a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl
index 19de76f..95dfc3b 100644
--- a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl
+++ b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl
@@ -12,6 +12,16 @@ usage: h5dump [OPTIONS] files
-b B, --binary=B Binary file output, of form B
-O F, --ddl=F Output ddl text into file F
Use blank(empty) filename F to suppress ddl display
+ --s3-cred=<cred> Supply S3 authentication information to "ros3" vfd.
+ <cred> :: "(<aws-region>,<access-id>,<access-key>)"
+ If absent or <cred> -> "(,,)", no authentication.
+ Has no effect is filedriver is not `ros3'.
+ --hdfs-attrs=<attrs> Supply configuration information for HDFS file access.
+ For use with "--filedriver=hdfs"
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ Any absent attribute will use a default value.
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
diff --git a/tools/testfiles/t128bit_float.h5 b/tools/testfiles/t128bit_float.h5
new file mode 100644
index 0000000..134d510
--- /dev/null
+++ b/tools/testfiles/t128bit_float.h5
Binary files differ
diff --git a/tools/testfiles/textlinksrc-nodangle-1.ls b/tools/testfiles/textlinksrc-nodangle-1.ls
index 491f696..396bed3 100644
--- a/tools/testfiles/textlinksrc-nodangle-1.ls
+++ b/tools/testfiles/textlinksrc-nodangle-1.ls
@@ -37,6 +37,15 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]
-V, --version Print version number and exit
--vfd=DRIVER Use the specified virtual file driver
-x, --hexdump Show raw data in hexadecimal format
+ --s3-cred=C Supply S3 authentication information to "ros3" vfd.
+ Accepts tuple of "(<aws-region>,<access-id>,<access-key>)".
+ If absent or C->"(,,)", defaults to no-authentication.
+ Has no effect if vfd flag not set to "ros3".
+ --hdfs-attrs=A Supply configuration information to Hadoop VFD.
+ Accepts tuple of (<namenode name>,<namenode port>,
+ ...<kerberos cache path>,<username>,<buffer size>)
+ If absent or A == '(,,,,)', all default values are used.
+ Has no effect if vfd flag is not 'hdfs'.
file/OBJECT
Each object consists of an HDF5 file name optionally followed by a
diff --git a/tools/testfiles/tgroup-1.ls b/tools/testfiles/tgroup-1.ls
index 491f696..396bed3 100644
--- a/tools/testfiles/tgroup-1.ls
+++ b/tools/testfiles/tgroup-1.ls
@@ -37,6 +37,15 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]
-V, --version Print version number and exit
--vfd=DRIVER Use the specified virtual file driver
-x, --hexdump Show raw data in hexadecimal format
+ --s3-cred=C Supply S3 authentication information to "ros3" vfd.
+ Accepts tuple of "(<aws-region>,<access-id>,<access-key>)".
+ If absent or C->"(,,)", defaults to no-authentication.
+ Has no effect if vfd flag not set to "ros3".
+ --hdfs-attrs=A Supply configuration information to Hadoop VFD.
+ Accepts tuple of (<namenode name>,<namenode port>,
+ ...<kerberos cache path>,<username>,<buffer size>)
+ If absent or A == '(,,,,)', all default values are used.
+ Has no effect if vfd flag is not 'hdfs'.
file/OBJECT
Each object consists of an HDF5 file name optionally followed by a
diff --git a/tools/testfiles/tudlink-2.ddl b/tools/testfiles/tudlink-2.ddl
index 7f4281a..82b9f8e 100644
--- a/tools/testfiles/tudlink-2.ddl
+++ b/tools/testfiles/tudlink-2.ddl
@@ -1,6 +1,5 @@
HDF5 "tudlink.h5" {
USERDEFINED_LINK "udlink2" {
- USERDEFINED_LINK "udlink2" {
LINKCLASS 187
}
}